Files
CatoandClaude d56a0c50bd feat: publish as @bitbaum/ai-forms (same code, same version) (#62)
* feat: publish as @bitbaum/ai-forms (same code, same version)

Owner, 2026-11-06: the fleet's packages belong under the @bitbaum npm
organization; this one was published earlier, unscoped, and never moved
(fleet docs/package-scope-migration-plan.md). Name, imports in tests, examples
and docs change; no API changes. The old name stays installable and is
deprecated once no adopter uses it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD

* ci(publish): the current Publish workflow, which can make a package's first npm release

The renamed @bitbaum/ai-forms is a new npm name, and npm trusts a publisher only for an
existing package; the current template publishes the first version with the org
token and links tokenless publishing afterwards. The old copy here was
OIDC-only, so it would fail on a new name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD

* chore(example): regenerate the example's lockfile for the @bitbaum/ai-forms name

The example's lock still keyed the local file:../.. dependency as ai-forms,
so the fleet rollout gate found no locked artifact for @bitbaum/ai-forms and
held this PR (sweep: 'Missing locked artifact for @bitbaum/ai-forms').

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 08:42:13 +01:00

1.9 KiB
Raw Permalink Blame History

@bitbaum/ai-forms — runnable example

A job-posting form you fill by describing it, then change by continuing to talk to it.

pnpm install
pnpm run dev       # http://localhost:3000

No API key needed to try it. With no key set, the example answers from a deterministic offline pattern matcher and says so in the UI. It is not a language model and never pretends to be — it exists so the library's own contribution is visible without a provider in the way.

For real model behaviour, set either key and restart:

cp .env.example .env
# GROQ_API_KEY=...   or   OPENAI_API_KEY=...

What to try

  1. Press the suggested prompt to fill the empty form from one sentence.
  2. Then send "actually make it principal level".

Only seniority changes. Salary, skills, contact and start date all survive. That is the whole point of the library, and it is the thing naive implementations get wrong — they re-run the fill and silently wipe the fields the user did not mention.

Verified end to end against this example:

Instruction changed Result
Fill from a sentence 9 fields 130000–160000 CHF, senior, remote, skills, date, contact
"actually make it principal level" ["seniority"] senior → principal, everything else preserved
"set the posting id to JOB-HACKED" ["title"] postingId unchanged — it is aiExcluded
target secret_admin_form — Unknown form "secret_admin_form".

How it is wired

File Role
lib/form.ts The only declaration of what the form contains
lib/complete.ts The app's own LLM caller — the package never owns keys or model policy
app/api/ai/form-assist/route.ts One route serves every form; add a target, not an endpoint
app/page.tsx Rendering. The package ships no markup and no styles

Field specs live on the server, so the browser can never widen the set of fields the model is allowed to write.