Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @fleet/ai-forms
# ai-forms

Headless AI form filling and conversational refinement. One implementation, shared by every app in the fleet.

Expand Down Expand Up @@ -45,7 +45,7 @@ The same mistake has a sibling: a single minimum input length. A fill descriptio

```ts
// src/config/ai-forms.ts
import { defineFields, type FormTarget } from '@fleet/ai-forms';
import { defineFields, type FormTarget } from 'ai-forms';

export const GOAL_FORM: FormTarget = {
key: 'goal',
Expand All @@ -68,7 +68,7 @@ export const AI_FORMS = [GOAL_FORM /* , ... */];

```ts
// src/app/api/ai/form-assist/route.ts
import { createFormAssistHandler } from '@fleet/ai-forms/server';
import { createFormAssistHandler } from 'ai-forms/server';
import { AI_FORMS } from '@/config/ai-forms';
import { callGroqText } from '@/lib/groq';
import { getCurrentUserId } from '@/lib/session';
Expand Down Expand Up @@ -110,7 +110,7 @@ Rendering is yours. The package ships no markup and no classes — each app has

## API

### `@fleet/ai-forms`
### `ai-forms`

| Export | Purpose |
| --- | --- |
Expand All @@ -121,11 +121,11 @@ Rendering is yours. The package ships no markup and no classes — each app has
| `parseAssistResponse(text)` | Extract JSON from fenced or prose-wrapped completions |
| `MIN_INSTRUCTION_LENGTH` | Per-intent input floors |

### `@fleet/ai-forms/server`
### `ai-forms/server`

`createFormAssistHandler(config)` → `(Request) => Promise<Response>`. Web-standard, so it drops straight into a Next.js App Router route. `authorize` runs before any model call.

### `@fleet/ai-forms/react`
### `ai-forms/react`

`useAiForm(options)` → values, `setValue`, `ask` / `fill` / `refine`, `busy`, `error`, `transcript`, `changed`, `isAiTouched`, `undo`, `canUndo`, `reset`.

Expand Down
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 24 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
{
"name": "@fleet/ai-forms",
"version": "0.1.0",
"name": "ai-forms",
"version": "0.2.0",
"description": "Headless AI form filling and conversational refinement. Provider-agnostic core, React hook, and a server route factory.",
"keywords": [
"ai",
"forms",
"form-fill",
"llm",
"react",
"structured-output",
"natural-language",
"zod",
"headless",
"openai",
"anthropic",
"form-builder"
],
"license": "MIT",
"homepage": "https://github.com/maonakamoto/ai-forms#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/maonakamoto/ai-forms.git"
},
"bugs": {
"url": "https://github.com/maonakamoto/ai-forms/issues"
},
"type": "module",
"sideEffects": false,
"engines": {
"node": ">=18"
},
"files": [
"dist"
],
Expand Down