markform 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -29
- package/dist/ai-sdk.d.mts +1 -1
- package/dist/ai-sdk.mjs +48 -6
- package/dist/ai-sdk.mjs.map +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/{cli-ZcOC47KK.mjs → cli-B1T8kMFt.mjs} +709 -125
- package/dist/cli-B1T8kMFt.mjs.map +1 -0
- package/dist/cli.d.mts +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/{coreTypes-BlsJkU1w.d.mts → coreTypes-CxpqKpBA.d.mts} +181 -4
- package/dist/{coreTypes-CTLr-NGd.mjs → coreTypes-DIv9Aabl.mjs} +56 -6
- package/dist/coreTypes-DIv9Aabl.mjs.map +1 -0
- package/dist/{fillRecord-DTl5lnK0.d.mts → fillRecord-V3vlyobd.d.mts} +29 -1
- package/dist/{fillRecordRenderer-VBQ2vwPV.mjs → fillRecordRenderer-BqRPHPmE.mjs} +47 -15
- package/dist/fillRecordRenderer-BqRPHPmE.mjs.map +1 -0
- package/dist/index.d.mts +34 -30
- package/dist/index.mjs +4 -4
- package/dist/{apply-KzQztrDV.mjs → prompts-DaPKumGY.mjs} +1081 -17
- package/dist/prompts-DaPKumGY.mjs.map +1 -0
- package/dist/render.d.mts +2 -2
- package/dist/render.mjs +1 -1
- package/dist/{session-BCcltrLA.mjs → session-BW9jtYNV.mjs} +2 -2
- package/dist/{session-BCcltrLA.mjs.map → session-BW9jtYNV.mjs.map} +1 -1
- package/dist/{session-VeSkVrck.mjs → session-DHyTMP67.mjs} +1 -1
- package/dist/{shared-fb0nkzQi.mjs → shared-BLh342F5.mjs} +1 -1
- package/dist/{shared-CsdT2T7k.mjs → shared-BszoSkAO.mjs} +10 -10
- package/dist/shared-BszoSkAO.mjs.map +1 -0
- package/dist/{src-B2uFvGli.mjs → src-DrXmaOWl.mjs} +179 -840
- package/dist/src-DrXmaOWl.mjs.map +1 -0
- package/docs/markform-apis.md +25 -7
- package/docs/markform-reference.md +273 -179
- package/docs/markform-spec.md +92 -36
- package/docs/skill/SKILL.md +161 -0
- package/examples/markform-demo-playbook.md +342 -0
- package/examples/parallel/parallel-research.form.md +2 -6
- package/examples/rejection-test/rejection-test.session.yaml +52 -0
- package/examples/simple/simple-mock-filled.report.md +2 -2
- package/examples/simple/simple-skipped-filled.report.md +2 -2
- package/examples/simple/simple-with-skips.session.yaml +78 -0
- package/examples/simple/simple.session.yaml +78 -0
- package/examples/twitter-thread/twitter-thread.form.md +5 -5
- package/package.json +2 -2
- package/dist/apply-KzQztrDV.mjs.map +0 -1
- package/dist/cli-ZcOC47KK.mjs.map +0 -1
- package/dist/coreTypes-CTLr-NGd.mjs.map +0 -1
- package/dist/fillRecordRenderer-VBQ2vwPV.mjs.map +0 -1
- package/dist/shared-CsdT2T7k.mjs.map +0 -1
- package/dist/src-B2uFvGli.mjs.map +0 -1
- package/examples/startup-research/startup-research-mock-filled.form.md +0 -297
- package/examples/startup-research/startup-research.form.md +0 -181
package/README.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Markform
|
|
2
2
|
|
|
3
|
-
[](https://x.com/ojoshe)
|
|
4
|
+
[](https://github.com/jlevy/markform/actions/workflows/ci.yml)
|
|
5
5
|
[](https://www.npmjs.com/package/markform)
|
|
6
|
-
[](https://x.com/ojoshe)
|
|
7
6
|
|
|
8
7
|
### What if your Markdown docs had an agent-friendly semantic API?
|
|
9
8
|
|
|
@@ -17,10 +16,10 @@ Humans can review or intervene at any point.
|
|
|
17
16
|
|
|
18
17
|
### Why forms?
|
|
19
18
|
|
|
20
|
-
For deep research or complex AI tasks, you need more than just prompts or
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
For deep research or complex AI tasks, you need more than just prompts or flow: you need
|
|
20
|
+
*structure*, which is precise control over agent output at every stage of a workflow.
|
|
21
|
+
A well-designed form combines instructions, structured data, and validations in one
|
|
22
|
+
place.
|
|
24
23
|
|
|
25
24
|
### How it Works
|
|
26
25
|
|
|
@@ -42,20 +41,24 @@ in one place.
|
|
|
42
41
|
|
|
43
42
|
### Useful details
|
|
44
43
|
|
|
45
|
-
- Markform syntax is a good source format: it is **token-efficient text** you can read,
|
|
46
|
-
version control and it is **ideal for context engineering** because it
|
|
47
|
-
document context, data schema, and memory (data filled so far).
|
|
44
|
+
- Markform syntax is a good source format: it is **token-efficient text** you can read,
|
|
45
|
+
diff, and version control and it is **ideal for context engineering** because it
|
|
46
|
+
combines document context, data schema, and memory (data filled so far).
|
|
48
47
|
|
|
49
|
-
- Structure is defined with HTML comment tags (`<!-- field -->`) that
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
- Structure is defined with HTML comment tags (`<!-- field -->`) that render invisibly
|
|
49
|
+
on GitHub, so **forms look like regular Markdown**. (Jinja-style tag syntax also works
|
|
50
|
+
if you prefer.)
|
|
52
51
|
|
|
53
|
-
-
|
|
54
|
-
|
|
52
|
+
- Form-filling can scale to **hundreds of fields** in a form filled by **dozens of
|
|
53
|
+
concurrent LLM requests** which makes it possible to systemetize large, complex
|
|
54
|
+
research processes or workflows.
|
|
55
|
+
(And **a fill record** of the form-filling process is kept, so you can see and debug
|
|
56
|
+
exactly how forms are filled by agents, tool usage, LLM call time, etc.)
|
|
55
57
|
|
|
56
|
-
- The CLI has a built-in web renderer, **`markform serve`**, for easy viewing and
|
|
57
|
-
of forms (including a form web UI, the form schema, and a waterfall-style
|
|
58
|
-
fill record, including performance details, which is useful for large,
|
|
58
|
+
- The CLI has a built-in web renderer, **`markform serve`**, for easy viewing and
|
|
59
|
+
debugging of forms (including a form web UI, the form schema, and a waterfall-style
|
|
60
|
+
overview of the fill record, including performance details, which is useful for large,
|
|
61
|
+
concurrently filled forms).
|
|
59
62
|
|
|
60
63
|
## Simple Example: Research a Movie
|
|
61
64
|
|
|
@@ -302,11 +305,34 @@ See [the FAQ](#faq) for more on the design.
|
|
|
302
305
|
|
|
303
306
|
## Quick Start
|
|
304
307
|
|
|
308
|
+
There are three ways to get started, from quickest to most thorough:
|
|
309
|
+
|
|
310
|
+
**1. Run an example automatically** — copy bundled forms and let an LLM fill one:
|
|
311
|
+
|
|
305
312
|
```bash
|
|
306
|
-
#
|
|
307
|
-
# Set OPENAI_API_KEY or ANTHROPIC_API_KEY (or put in .env) for research examples
|
|
313
|
+
# Set OPENAI_API_KEY or ANTHROPIC_API_KEY (or put in .env)
|
|
308
314
|
npx markform@latest examples
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Pick `movie-research-demo.form.md` for a quick demo.
|
|
318
|
+
|
|
319
|
+
**2. Agent-guided tour** — ask a coding agent (like Claude Code) to walk you through a
|
|
320
|
+
specific example step by step.
|
|
321
|
+
The agent copies the form, explains the structure, fills fields, validates, and exports:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# List available examples
|
|
325
|
+
markform examples --list
|
|
326
|
+
# Copy one to work with
|
|
327
|
+
markform examples --name movie-research-demo
|
|
328
|
+
```
|
|
309
329
|
|
|
330
|
+
**3. End-to-end walkthrough** — have a coding agent follow the
|
|
331
|
+
[demo playbook](packages/markform/examples/markform-demo-playbook.md) to design a
|
|
332
|
+
research form from scratch, fill it with real data, validate, export, and browse.
|
|
333
|
+
This is the most thorough tour of all Markform features.
|
|
334
|
+
|
|
335
|
+
```bash
|
|
310
336
|
# Read the docs (tell your agents to run these; they are agent-friendly!)
|
|
311
337
|
npx markform # CLI help
|
|
312
338
|
npx markform readme # This file
|
|
@@ -314,10 +340,6 @@ npx markform docs # Quick reference for writing Markforms
|
|
|
314
340
|
npx markform spec # Read the full spec
|
|
315
341
|
```
|
|
316
342
|
|
|
317
|
-
The `markform examples` command copies some sample forms to `./forms` and prompts you to
|
|
318
|
-
fill in a form interactively and then optionally have an agent complete it.
|
|
319
|
-
Pick `movie-research-demo.form.md` for a quick example.
|
|
320
|
-
|
|
321
343
|
## Installation
|
|
322
344
|
|
|
323
345
|
Requires Node.js 20+.
|
|
@@ -330,6 +352,24 @@ npm install -g markform
|
|
|
330
352
|
npm install markform
|
|
331
353
|
```
|
|
332
354
|
|
|
355
|
+
### Use as a Claude Code Skill
|
|
356
|
+
|
|
357
|
+
If you install markform globally (`npm install -g markform`), you can tell Claude to run
|
|
358
|
+
`markform setup --auto` to install it as a Claude Code skill.
|
|
359
|
+
This teaches Claude how to use markform commands when working with `.form.md` files in
|
|
360
|
+
your project.
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# Install as a Claude Code skill (non-interactive, for agents)
|
|
364
|
+
markform setup --auto
|
|
365
|
+
|
|
366
|
+
# Or guided setup with prompts (for humans)
|
|
367
|
+
markform setup --interactive
|
|
368
|
+
|
|
369
|
+
# View the skill content
|
|
370
|
+
markform skill
|
|
371
|
+
```
|
|
372
|
+
|
|
333
373
|
### More Example Forms
|
|
334
374
|
|
|
335
375
|
The package includes example forms.
|
|
@@ -414,7 +454,7 @@ flowchart LR
|
|
|
414
454
|
subgraph ENGINE["<b>CORE TYPESCRIPT APIS</b><br/>Markdoc parser, serializer,<br/>patch application,<br/>validation (jiti for rules)"]
|
|
415
455
|
end
|
|
416
456
|
|
|
417
|
-
subgraph
|
|
457
|
+
subgraph PARSER["<b>PARSER</b><br/>Markform language<br/>parser/serializer"]
|
|
418
458
|
end
|
|
419
459
|
|
|
420
460
|
CLI --> ENGINE
|
|
@@ -422,7 +462,7 @@ flowchart LR
|
|
|
422
462
|
AGENT --> HARNESS
|
|
423
463
|
AGENT --> ENGINE
|
|
424
464
|
HARNESS --> ENGINE
|
|
425
|
-
ENGINE -->
|
|
465
|
+
ENGINE --> PARSER
|
|
426
466
|
end
|
|
427
467
|
|
|
428
468
|
SPEC ~~~ IMPL
|
|
@@ -437,7 +477,7 @@ flowchart LR
|
|
|
437
477
|
style CLI fill:#ffe8cc,stroke:#fb8500
|
|
438
478
|
style AGENT fill:#ffe8cc,stroke:#fb8500
|
|
439
479
|
style HARNESS fill:#ffe8cc,stroke:#fb8500
|
|
440
|
-
style
|
|
480
|
+
style PARSER fill:#ffe8cc,stroke:#fb8500
|
|
441
481
|
```
|
|
442
482
|
|
|
443
483
|
## CLI Commands
|
|
@@ -571,8 +611,8 @@ If unsure, try `gpt-5-mini` first as it’s fast and supports web search.
|
|
|
571
611
|
|
|
572
612
|
## Programmatic Usage
|
|
573
613
|
|
|
574
|
-
Markform exports a parsing engine, rendering functions, and AI SDK integration for use
|
|
575
|
-
your own applications.
|
|
614
|
+
Markform exports a parsing engine, rendering functions, and AI SDK integration for use
|
|
615
|
+
in your own applications.
|
|
576
616
|
|
|
577
617
|
### Basic Parsing
|
|
578
618
|
|
package/dist/ai-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { At as ParsedForm, Nt as PatchSchema, U as FieldResponse, Y as FormSchema, at as InspectResult, et as Id,
|
|
2
|
+
import { At as ParsedForm, Nt as PatchSchema, U as FieldResponse, Y as FormSchema, at as InspectResult, et as Id, gr as ValidatorRegistry, jt as Patch, r as ApplyResult } from "./coreTypes-CxpqKpBA.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/integrations/toolTypes.d.ts
|
package/dist/ai-sdk.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { R as PatchSchema } from "./coreTypes-
|
|
3
|
-
import {
|
|
2
|
+
import { R as PatchSchema } from "./coreTypes-DIv9Aabl.mjs";
|
|
3
|
+
import { _ as inspect, m as applyPatches, p as findFieldById, s as getPatchFormatHint, u as getFieldIdFromRef, w as serializeForm } from "./prompts-DaPKumGY.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/integrations/vercelAiSdkTools.ts
|
|
@@ -64,7 +64,7 @@ const InspectInputSchema = z.object({}).describe("No input parameters required.
|
|
|
64
64
|
/**
|
|
65
65
|
* Input schema for markform_apply tool.
|
|
66
66
|
*/
|
|
67
|
-
const ApplyInputSchema = z.object({ patches: z.array(PatchSchema).min(1).max(20).describe("Array of patches to apply to the form. Each patch sets or clears a field value.
|
|
67
|
+
const ApplyInputSchema = z.object({ patches: z.array(PatchSchema).min(1).max(20).describe("Array of patches to apply to the form. Each patch sets or clears a field value. Set operations: set_string, set_number, set_string_list, set_single_select, set_multi_select, set_checkboxes, set_url, set_url_list, set_date, set_year, set_table. Incremental operations: append_table, delete_table, append_string_list, delete_string_list, append_url_list, delete_url_list. Meta operations: clear_field, skip_field, abort_field. Example: [{ \"op\": \"set_string\", \"fieldId\": \"name\", \"value\": \"Alice\" }]") }).describe("Apply patches to update form field values.");
|
|
68
68
|
/**
|
|
69
69
|
* Input schema for markform_export tool (no parameters).
|
|
70
70
|
*/
|
|
@@ -73,6 +73,43 @@ const ExportInputSchema = z.object({}).describe("No input parameters required. C
|
|
|
73
73
|
* Input schema for markform_get_markdown tool (no parameters).
|
|
74
74
|
*/
|
|
75
75
|
const GetMarkdownInputSchema = z.object({}).describe("No input parameters required. Call this tool to get the canonical Markdown representation of the current form.");
|
|
76
|
+
function buildFieldMeta(field) {
|
|
77
|
+
const meta = {
|
|
78
|
+
kind: field.kind,
|
|
79
|
+
label: field.label,
|
|
80
|
+
required: field.required
|
|
81
|
+
};
|
|
82
|
+
if (field.kind === "single_select" || field.kind === "multi_select") meta.options = field.options.map((o) => o.id);
|
|
83
|
+
else if (field.kind === "checkboxes") {
|
|
84
|
+
meta.options = field.options.map((o) => o.id);
|
|
85
|
+
meta.checkbox_mode = field.checkboxMode;
|
|
86
|
+
} else if (field.kind === "table") meta.columns = field.columns.map((c) => ({
|
|
87
|
+
id: c.id,
|
|
88
|
+
type: c.type,
|
|
89
|
+
required: c.required
|
|
90
|
+
}));
|
|
91
|
+
return meta;
|
|
92
|
+
}
|
|
93
|
+
function generatePatchExample(field) {
|
|
94
|
+
const opts = { fieldId: field.id };
|
|
95
|
+
if (field.kind === "table") opts.columnIds = field.columns.map((c) => c.id);
|
|
96
|
+
else if (field.kind === "checkboxes") {
|
|
97
|
+
opts.checkboxMode = field.checkboxMode;
|
|
98
|
+
opts.optionIds = field.options.map((o) => o.id);
|
|
99
|
+
}
|
|
100
|
+
return getPatchFormatHint(field.kind, opts);
|
|
101
|
+
}
|
|
102
|
+
function enrichIssue(issue, form) {
|
|
103
|
+
const fieldId = getFieldIdFromRef(issue.ref, issue.scope);
|
|
104
|
+
const field = fieldId ? findFieldById(form, fieldId) : void 0;
|
|
105
|
+
if (!field) return issue;
|
|
106
|
+
return {
|
|
107
|
+
...issue,
|
|
108
|
+
field: buildFieldMeta(field),
|
|
109
|
+
set_example: generatePatchExample(field),
|
|
110
|
+
skip_example: field.required ? null : `{ op: "skip_field", fieldId: "${field.id}", reason: "Not applicable" }`
|
|
111
|
+
};
|
|
112
|
+
}
|
|
76
113
|
/**
|
|
77
114
|
* Create Markform AI SDK tools for agent-driven form filling.
|
|
78
115
|
*
|
|
@@ -105,18 +142,23 @@ function createMarkformTools(options) {
|
|
|
105
142
|
description: "Inspect the current form state. Returns structure summary, progress summary, validation issues, and completion status. Use this to understand what fields need to be filled and what issues exist. Issues are sorted by priority (1 = highest). Focus on 'required' severity issues first.",
|
|
106
143
|
inputSchema: InspectInputSchema,
|
|
107
144
|
execute: () => {
|
|
108
|
-
const
|
|
145
|
+
const form = sessionStore.getForm();
|
|
146
|
+
const result = inspect(form);
|
|
147
|
+
const enrichedIssues = result.issues.map((issue) => enrichIssue(issue, form));
|
|
109
148
|
const requiredCount = result.issues.filter((i) => i.severity === "required").length;
|
|
110
149
|
const message = result.isComplete ? "Form is complete. All required fields are filled." : `Form has ${requiredCount} required issue(s) to resolve.`;
|
|
111
150
|
return Promise.resolve({
|
|
112
151
|
success: true,
|
|
113
|
-
data:
|
|
152
|
+
data: {
|
|
153
|
+
...result,
|
|
154
|
+
issues: enrichedIssues
|
|
155
|
+
},
|
|
114
156
|
message
|
|
115
157
|
});
|
|
116
158
|
}
|
|
117
159
|
},
|
|
118
160
|
markform_apply: {
|
|
119
|
-
description: "Apply patches to update form field values. Valid patches are applied even if some fail. Single values are automatically coerced to arrays for list fields. Returns applied patches, warnings for coerced values, and rejected patches separately.
|
|
161
|
+
description: "Apply patches to update form field values. Valid patches are applied even if some fail. Single values are automatically coerced to arrays for list fields. Returns applied patches, warnings for coerced values, and rejected patches separately. Set operations: set_string, set_number, set_string_list, set_single_select, set_multi_select, set_checkboxes, set_url, set_url_list, set_date, set_year, set_table. Incremental: append_table, delete_table, append_string_list, delete_string_list, append_url_list, delete_url_list. Meta: clear_field, skip_field, abort_field.",
|
|
120
162
|
inputSchema: ApplyInputSchema,
|
|
121
163
|
execute: ({ patches }) => {
|
|
122
164
|
const form = sessionStore.getForm();
|
package/dist/ai-sdk.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-sdk.mjs","names":[],"sources":["../src/integrations/vercelAiSdkTools.ts"],"sourcesContent":["/**\n * AI SDK Integration for Markform.\n *\n * Provides Vercel AI SDK compatible tools for agent-driven form filling.\n * Use createMarkformTools() to create a toolset that wraps the Markform engine.\n *\n * @example\n * ```typescript\n * import { createMarkformTools, MarkformSessionStore } from 'markform/ai-sdk';\n * import { generateText } from 'ai';\n *\n * const store = new MarkformSessionStore(parsedForm);\n * const tools = createMarkformTools({ sessionStore: store });\n *\n * const { text } = await generateText({\n * model: openai('gpt-4'),\n * prompt: 'Fill out this form...',\n * tools,\n * });\n * ```\n */\n\nimport { z } from 'zod';\nimport type { ParsedForm, Patch, ValidatorRegistry } from '../engine/coreTypes.js';\nimport { inspect } from '../engine/inspect.js';\nimport { applyPatches } from '../engine/apply.js';\nimport { serializeForm } from '../engine/serialize.js';\nimport { PatchSchema } from '../engine/coreTypes.js';\n\n// =============================================================================\n// Session Store\n// =============================================================================\n\n/**\n * Session store for managing form state during AI interactions.\n *\n * The AI SDK tools operate on a shared form instance through this store.\n * Create one store per form-filling session.\n */\nexport class MarkformSessionStore {\n private form: ParsedForm;\n private validatorRegistry: ValidatorRegistry;\n\n constructor(form: ParsedForm, validatorRegistry?: ValidatorRegistry) {\n this.form = form;\n this.validatorRegistry = validatorRegistry ?? {};\n }\n\n /**\n * Get the current form.\n */\n getForm(): ParsedForm {\n return this.form;\n }\n\n /**\n * Get the validator registry.\n */\n getValidatorRegistry(): ValidatorRegistry {\n return this.validatorRegistry;\n }\n\n /**\n * Update the form values.\n */\n updateForm(form: ParsedForm): void {\n this.form = form;\n }\n}\n\n// =============================================================================\n// Tool Creation Options\n// =============================================================================\n\n/**\n * Options for creating Markform AI SDK tools.\n */\nexport interface CreateMarkformToolsOptions {\n /**\n * Session store managing the form state.\n */\n sessionStore: MarkformSessionStore;\n\n /**\n * Whether to include the markform_get_markdown tool.\n * Defaults to true.\n */\n includeGetMarkdown?: boolean;\n}\n\n// =============================================================================\n// Tool Types (imported from toolTypes.ts)\n// =============================================================================\n\nimport type {\n ApplyToolResult,\n ExportToolResult,\n GetMarkdownToolResult,\n InspectToolResult,\n MarkformTool,\n MarkformToolSet,\n} from './toolTypes.js';\n\n// Re-export types for backwards compatibility\nexport type {\n ApplyToolResult,\n ExportToolResult,\n GetMarkdownToolResult,\n InspectToolResult,\n MarkformTool,\n MarkformToolSet,\n} from './toolTypes.js';\n\n// =============================================================================\n// Zod Schemas for Tool Inputs\n// =============================================================================\n\n/**\n * Input schema for markform_inspect tool (no parameters).\n */\nconst InspectInputSchema = z\n .object({})\n .describe('No input parameters required. Call this tool to inspect the current form state.');\n\n/**\n * Input schema for markform_apply tool.\n */\nconst ApplyInputSchema = z\n .object({\n patches: z\n .array(PatchSchema)\n .min(1)\n .max(20)\n .describe(\n 'Array of patches to apply to the form. Each patch sets or clears a field value. ' +\n 'Operations: set_string, set_number, set_string_list, set_single_select, set_multi_select, ' +\n 'set_checkboxes, set_url, set_url_list, set_date, set_year, set_table, clear_field, skip_field, abort_field. ' +\n 'Example: [{ \"op\": \"set_string\", \"fieldId\": \"name\", \"value\": \"Alice\" }]',\n ),\n })\n .describe('Apply patches to update form field values.');\n\n/**\n * Input schema for markform_export tool (no parameters).\n */\nconst ExportInputSchema = z\n .object({})\n .describe(\n 'No input parameters required. Call this tool to export the form schema and current values as JSON.',\n );\n\n/**\n * Input schema for markform_get_markdown tool (no parameters).\n */\nconst GetMarkdownInputSchema = z\n .object({})\n .describe(\n 'No input parameters required. Call this tool to get the canonical Markdown representation of the current form.',\n );\n\n// =============================================================================\n// Tool Factory\n// =============================================================================\n\n/**\n * Create Markform AI SDK tools for agent-driven form filling.\n *\n * Returns a toolset compatible with Vercel AI SDK's generateText and streamText.\n *\n * @param options - Tool creation options including session store\n * @returns MarkformToolSet containing all tools\n *\n * @example\n * ```typescript\n * import { parseForm } from 'markform';\n * import { createMarkformTools, MarkformSessionStore } from 'markform/ai-sdk';\n *\n * const form = parseForm(markdownContent);\n * const store = new MarkformSessionStore(form);\n * const tools = createMarkformTools({ sessionStore: store });\n *\n * // Use with AI SDK\n * const result = await generateText({\n * model: yourModel,\n * tools,\n * prompt: 'Fill out this form based on the user information...',\n * });\n * ```\n */\nexport function createMarkformTools(options: CreateMarkformToolsOptions): MarkformToolSet {\n const { sessionStore, includeGetMarkdown = true } = options;\n\n // markform_inspect - Get current form state with issues\n const markform_inspect: MarkformTool<Record<string, never>, InspectToolResult> = {\n description:\n 'Inspect the current form state. Returns structure summary, progress summary, validation issues, ' +\n 'and completion status. Use this to understand what fields need to be filled and what issues exist. ' +\n \"Issues are sorted by priority (1 = highest). Focus on 'required' severity issues first.\",\n inputSchema: InspectInputSchema,\n execute: () => {\n const form = sessionStore.getForm();\n const result = inspect(form);\n\n const requiredCount = result.issues.filter((i) => i.severity === 'required').length;\n const message = result.isComplete\n ? 'Form is complete. All required fields are filled.'\n : `Form has ${requiredCount} required issue(s) to resolve.`;\n\n return Promise.resolve({\n success: true,\n data: result,\n message,\n });\n },\n };\n\n // markform_apply - Apply patches to update form values\n const markform_apply: MarkformTool<{ patches: Patch[] }, ApplyToolResult> = {\n description:\n 'Apply patches to update form field values. Valid patches are applied even if some fail. ' +\n 'Single values are automatically coerced to arrays for list fields. ' +\n 'Returns applied patches, warnings for coerced values, and rejected patches separately. ' +\n 'Patch operations: set_string, set_number, set_string_list, set_single_select, set_multi_select, ' +\n 'set_checkboxes, set_url, set_url_list, set_date, set_year, set_table, clear_field, skip_field, abort_field.',\n inputSchema: ApplyInputSchema,\n execute: ({ patches }) => {\n const form = sessionStore.getForm();\n const result = applyPatches(form, patches);\n\n // Update the store with the modified form\n sessionStore.updateForm(form);\n\n const warningNote = result.warnings.length > 0 ? ` (${result.warnings.length} coerced)` : '';\n const remaining = result.issues.filter((i) => i.severity === 'required').length;\n\n const message =\n result.applyStatus === 'applied'\n ? `Applied ${patches.length} patch(es)${warningNote}. ${\n result.isComplete\n ? 'Form is now complete!'\n : `${remaining} required issue(s) remaining.`\n }`\n : result.applyStatus === 'partial'\n ? `Applied ${result.appliedPatches.length}/${patches.length} patches${warningNote}. ` +\n `${result.rejectedPatches.length} rejected.`\n : `All patches rejected. Check field IDs and value types.`;\n\n return Promise.resolve({\n success: result.applyStatus !== 'rejected',\n data: result,\n message,\n });\n },\n };\n\n // markform_export - Export schema and values as JSON\n const markform_export: MarkformTool<Record<string, never>, ExportToolResult> = {\n description:\n 'Export the form schema and current values as JSON. Use this to get a machine-readable ' +\n 'representation of the form structure and all field values. Useful for processing or analysis.',\n inputSchema: ExportInputSchema,\n execute: () => {\n const form = sessionStore.getForm();\n\n // Count answered fields\n const answeredCount = Object.values(form.responsesByFieldId).filter(\n (response) => response.state === 'answered',\n ).length;\n\n return Promise.resolve({\n success: true,\n data: {\n schema: form.schema,\n values: form.responsesByFieldId,\n },\n message: `Exported form with ${form.schema.groups.length} group(s) and ${answeredCount} answered field(s).`,\n });\n },\n };\n\n // Build the toolset\n const toolset: MarkformToolSet = {\n markform_inspect,\n markform_apply,\n markform_export,\n };\n\n // Optionally include markform_get_markdown\n if (includeGetMarkdown) {\n const markform_get_markdown: MarkformTool<Record<string, never>, GetMarkdownToolResult> = {\n description:\n 'Get the canonical Markdown representation of the current form. ' +\n 'Use this to see the complete form with all current values in Markform format. ' +\n 'The output is deterministic and round-trip safe.',\n inputSchema: GetMarkdownInputSchema,\n execute: () => {\n const form = sessionStore.getForm();\n const markdown = serializeForm(form);\n\n return Promise.resolve({\n success: true,\n data: {\n markdown,\n },\n message: `Generated Markdown (${markdown.length} characters).`,\n });\n },\n };\n\n toolset.markform_get_markdown = markform_get_markdown;\n }\n\n return toolset;\n}\n\n// =============================================================================\n// Convenience Exports\n// =============================================================================\n\nexport { PatchSchema } from '../engine/coreTypes.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAa,uBAAb,MAAkC;CAChC,AAAQ;CACR,AAAQ;CAER,YAAY,MAAkB,mBAAuC;AACnE,OAAK,OAAO;AACZ,OAAK,oBAAoB,qBAAqB,EAAE;;;;;CAMlD,UAAsB;AACpB,SAAO,KAAK;;;;;CAMd,uBAA0C;AACxC,SAAO,KAAK;;;;;CAMd,WAAW,MAAwB;AACjC,OAAK,OAAO;;;;;;AAsDhB,MAAM,qBAAqB,EACxB,OAAO,EAAE,CAAC,CACV,SAAS,kFAAkF;;;;AAK9F,MAAM,mBAAmB,EACtB,OAAO,EACN,SAAS,EACN,MAAM,YAAY,CAClB,IAAI,EAAE,CACN,IAAI,GAAG,CACP,SACC,2WAID,EACJ,CAAC,CACD,SAAS,6CAA6C;;;;AAKzD,MAAM,oBAAoB,EACvB,OAAO,EAAE,CAAC,CACV,SACC,qGACD;;;;AAKH,MAAM,yBAAyB,EAC5B,OAAO,EAAE,CAAC,CACV,SACC,iHACD;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BH,SAAgB,oBAAoB,SAAsD;CACxF,MAAM,EAAE,cAAc,qBAAqB,SAAS;CA2FpD,MAAM,UAA2B;EAC/B,kBAzF+E;GAC/E,aACE;GAGF,aAAa;GACb,eAAe;IAEb,MAAM,SAAS,QADF,aAA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;GAEb,MAAM,WAAW,cADJ,aAAa,SAAS,CACC;AAEpC,UAAO,QAAQ,QAAQ;IACrB,SAAS;IACT,MAAM,EACJ,UACD;IACD,SAAS,uBAAuB,SAAS,OAAO;IACjD,CAAC;;EAEL;AAKH,QAAO"}
|
|
1
|
+
{"version":3,"file":"ai-sdk.mjs","names":[],"sources":["../src/integrations/vercelAiSdkTools.ts"],"sourcesContent":["/**\n * AI SDK Integration for Markform.\n *\n * Provides Vercel AI SDK compatible tools for agent-driven form filling.\n * Use createMarkformTools() to create a toolset that wraps the Markform engine.\n *\n * @example\n * ```typescript\n * import { createMarkformTools, MarkformSessionStore } from 'markform/ai-sdk';\n * import { generateText } from 'ai';\n *\n * const store = new MarkformSessionStore(parsedForm);\n * const tools = createMarkformTools({ sessionStore: store });\n *\n * const { text } = await generateText({\n * model: openai('gpt-4'),\n * prompt: 'Fill out this form...',\n * tools,\n * });\n * ```\n */\n\nimport { z } from 'zod';\nimport type {\n Field,\n InspectIssue,\n ParsedForm,\n Patch,\n ValidatorRegistry,\n} from '../engine/coreTypes.js';\nimport { inspect } from '../engine/inspect.js';\nimport { applyPatches } from '../engine/apply.js';\nimport { serializeForm } from '../engine/serialize.js';\nimport { PatchSchema } from '../engine/coreTypes.js';\nimport { getFieldIdFromRef } from '../engine/issueFiltering.js';\nimport { findFieldById } from '../engine/valueCoercion.js';\nimport { getPatchFormatHint } from '../harness/prompts.js';\n\n// =============================================================================\n// Session Store\n// =============================================================================\n\n/**\n * Session store for managing form state during AI interactions.\n *\n * The AI SDK tools operate on a shared form instance through this store.\n * Create one store per form-filling session.\n */\nexport class MarkformSessionStore {\n private form: ParsedForm;\n private validatorRegistry: ValidatorRegistry;\n\n constructor(form: ParsedForm, validatorRegistry?: ValidatorRegistry) {\n this.form = form;\n this.validatorRegistry = validatorRegistry ?? {};\n }\n\n /**\n * Get the current form.\n */\n getForm(): ParsedForm {\n return this.form;\n }\n\n /**\n * Get the validator registry.\n */\n getValidatorRegistry(): ValidatorRegistry {\n return this.validatorRegistry;\n }\n\n /**\n * Update the form values.\n */\n updateForm(form: ParsedForm): void {\n this.form = form;\n }\n}\n\n// =============================================================================\n// Tool Creation Options\n// =============================================================================\n\n/**\n * Options for creating Markform AI SDK tools.\n */\nexport interface CreateMarkformToolsOptions {\n /**\n * Session store managing the form state.\n */\n sessionStore: MarkformSessionStore;\n\n /**\n * Whether to include the markform_get_markdown tool.\n * Defaults to true.\n */\n includeGetMarkdown?: boolean;\n}\n\n// =============================================================================\n// Tool Types (imported from toolTypes.ts)\n// =============================================================================\n\nimport type {\n ApplyToolResult,\n ExportToolResult,\n GetMarkdownToolResult,\n InspectToolResult,\n MarkformTool,\n MarkformToolSet,\n} from './toolTypes.js';\n\n// Re-export types for backwards compatibility\nexport type {\n ApplyToolResult,\n ExportToolResult,\n GetMarkdownToolResult,\n InspectToolResult,\n MarkformTool,\n MarkformToolSet,\n} from './toolTypes.js';\n\n// =============================================================================\n// Zod Schemas for Tool Inputs\n// =============================================================================\n\n/**\n * Input schema for markform_inspect tool (no parameters).\n */\nconst InspectInputSchema = z\n .object({})\n .describe('No input parameters required. Call this tool to inspect the current form state.');\n\n/**\n * Input schema for markform_apply tool.\n */\nconst ApplyInputSchema = z\n .object({\n patches: z\n .array(PatchSchema)\n .min(1)\n .max(20)\n .describe(\n 'Array of patches to apply to the form. Each patch sets or clears a field value. ' +\n 'Set operations: set_string, set_number, set_string_list, set_single_select, set_multi_select, ' +\n 'set_checkboxes, set_url, set_url_list, set_date, set_year, set_table. ' +\n 'Incremental operations: append_table, delete_table, append_string_list, delete_string_list, append_url_list, delete_url_list. ' +\n 'Meta operations: clear_field, skip_field, abort_field. ' +\n 'Example: [{ \"op\": \"set_string\", \"fieldId\": \"name\", \"value\": \"Alice\" }]',\n ),\n })\n .describe('Apply patches to update form field values.');\n\n/**\n * Input schema for markform_export tool (no parameters).\n */\nconst ExportInputSchema = z\n .object({})\n .describe(\n 'No input parameters required. Call this tool to export the form schema and current values as JSON.',\n );\n\n/**\n * Input schema for markform_get_markdown tool (no parameters).\n */\nconst GetMarkdownInputSchema = z\n .object({})\n .describe(\n 'No input parameters required. Call this tool to get the canonical Markdown representation of the current form.',\n );\n\n// =============================================================================\n// Issue Enrichment\n// =============================================================================\n\ninterface EnrichedFieldMeta {\n kind: string;\n label: string;\n required: boolean;\n options?: string[];\n checkbox_mode?: string;\n columns?: { id: string; type: string; required: boolean }[];\n}\n\nfunction buildFieldMeta(field: Field): EnrichedFieldMeta {\n const meta: EnrichedFieldMeta = {\n kind: field.kind,\n label: field.label,\n required: field.required,\n };\n\n if (field.kind === 'single_select' || field.kind === 'multi_select') {\n meta.options = field.options.map((o) => o.id);\n } else if (field.kind === 'checkboxes') {\n meta.options = field.options.map((o) => o.id);\n meta.checkbox_mode = field.checkboxMode;\n } else if (field.kind === 'table') {\n meta.columns = field.columns.map((c) => ({\n id: c.id,\n type: c.type,\n required: c.required,\n }));\n }\n\n return meta;\n}\n\nfunction generatePatchExample(field: Field): string {\n const opts: {\n fieldId: string;\n columnIds?: string[];\n checkboxMode?: 'simple' | 'multi' | 'explicit';\n optionIds?: string[];\n } = {\n fieldId: field.id,\n };\n\n if (field.kind === 'table') {\n opts.columnIds = field.columns.map((c) => c.id);\n } else if (field.kind === 'checkboxes') {\n opts.checkboxMode = field.checkboxMode;\n opts.optionIds = field.options.map((o) => o.id);\n }\n\n return getPatchFormatHint(field.kind, opts);\n}\n\nfunction enrichIssue(\n issue: InspectIssue,\n form: ParsedForm,\n): InspectIssue & {\n field?: EnrichedFieldMeta;\n set_example?: string;\n skip_example?: string | null;\n} {\n const fieldId = getFieldIdFromRef(issue.ref, issue.scope);\n const field = fieldId ? findFieldById(form, fieldId) : undefined;\n\n if (!field) return issue;\n\n return {\n ...issue,\n field: buildFieldMeta(field),\n set_example: generatePatchExample(field),\n skip_example: field.required\n ? null\n : `{ op: \"skip_field\", fieldId: \"${field.id}\", reason: \"Not applicable\" }`,\n };\n}\n\n// =============================================================================\n// Tool Factory\n// =============================================================================\n\n/**\n * Create Markform AI SDK tools for agent-driven form filling.\n *\n * Returns a toolset compatible with Vercel AI SDK's generateText and streamText.\n *\n * @param options - Tool creation options including session store\n * @returns MarkformToolSet containing all tools\n *\n * @example\n * ```typescript\n * import { parseForm } from 'markform';\n * import { createMarkformTools, MarkformSessionStore } from 'markform/ai-sdk';\n *\n * const form = parseForm(markdownContent);\n * const store = new MarkformSessionStore(form);\n * const tools = createMarkformTools({ sessionStore: store });\n *\n * // Use with AI SDK\n * const result = await generateText({\n * model: yourModel,\n * tools,\n * prompt: 'Fill out this form based on the user information...',\n * });\n * ```\n */\nexport function createMarkformTools(options: CreateMarkformToolsOptions): MarkformToolSet {\n const { sessionStore, includeGetMarkdown = true } = options;\n\n // markform_inspect - Get current form state with issues\n const markform_inspect: MarkformTool<Record<string, never>, InspectToolResult> = {\n description:\n 'Inspect the current form state. Returns structure summary, progress summary, validation issues, ' +\n 'and completion status. Use this to understand what fields need to be filled and what issues exist. ' +\n \"Issues are sorted by priority (1 = highest). Focus on 'required' severity issues first.\",\n inputSchema: InspectInputSchema,\n execute: () => {\n const form = sessionStore.getForm();\n const result = inspect(form);\n\n // Enrich issues with field metadata and patch examples\n const enrichedIssues = result.issues.map((issue) => enrichIssue(issue, form));\n\n const requiredCount = result.issues.filter((i) => i.severity === 'required').length;\n const message = result.isComplete\n ? 'Form is complete. All required fields are filled.'\n : `Form has ${requiredCount} required issue(s) to resolve.`;\n\n return Promise.resolve({\n success: true,\n data: { ...result, issues: enrichedIssues },\n message,\n });\n },\n };\n\n // markform_apply - Apply patches to update form values\n const markform_apply: MarkformTool<{ patches: Patch[] }, ApplyToolResult> = {\n description:\n 'Apply patches to update form field values. Valid patches are applied even if some fail. ' +\n 'Single values are automatically coerced to arrays for list fields. ' +\n 'Returns applied patches, warnings for coerced values, and rejected patches separately. ' +\n 'Set operations: set_string, set_number, set_string_list, set_single_select, set_multi_select, ' +\n 'set_checkboxes, set_url, set_url_list, set_date, set_year, set_table. ' +\n 'Incremental: append_table, delete_table, append_string_list, delete_string_list, append_url_list, delete_url_list. ' +\n 'Meta: clear_field, skip_field, abort_field.',\n inputSchema: ApplyInputSchema,\n execute: ({ patches }) => {\n const form = sessionStore.getForm();\n const result = applyPatches(form, patches);\n\n // Update the store with the modified form\n sessionStore.updateForm(form);\n\n const warningNote = result.warnings.length > 0 ? ` (${result.warnings.length} coerced)` : '';\n const remaining = result.issues.filter((i) => i.severity === 'required').length;\n\n const message =\n result.applyStatus === 'applied'\n ? `Applied ${patches.length} patch(es)${warningNote}. ${\n result.isComplete\n ? 'Form is now complete!'\n : `${remaining} required issue(s) remaining.`\n }`\n : result.applyStatus === 'partial'\n ? `Applied ${result.appliedPatches.length}/${patches.length} patches${warningNote}. ` +\n `${result.rejectedPatches.length} rejected.`\n : `All patches rejected. Check field IDs and value types.`;\n\n return Promise.resolve({\n success: result.applyStatus !== 'rejected',\n data: result,\n message,\n });\n },\n };\n\n // markform_export - Export schema and values as JSON\n const markform_export: MarkformTool<Record<string, never>, ExportToolResult> = {\n description:\n 'Export the form schema and current values as JSON. Use this to get a machine-readable ' +\n 'representation of the form structure and all field values. Useful for processing or analysis.',\n inputSchema: ExportInputSchema,\n execute: () => {\n const form = sessionStore.getForm();\n\n // Count answered fields\n const answeredCount = Object.values(form.responsesByFieldId).filter(\n (response) => response.state === 'answered',\n ).length;\n\n return Promise.resolve({\n success: true,\n data: {\n schema: form.schema,\n values: form.responsesByFieldId,\n },\n message: `Exported form with ${form.schema.groups.length} group(s) and ${answeredCount} answered field(s).`,\n });\n },\n };\n\n // Build the toolset\n const toolset: MarkformToolSet = {\n markform_inspect,\n markform_apply,\n markform_export,\n };\n\n // Optionally include markform_get_markdown\n if (includeGetMarkdown) {\n const markform_get_markdown: MarkformTool<Record<string, never>, GetMarkdownToolResult> = {\n description:\n 'Get the canonical Markdown representation of the current form. ' +\n 'Use this to see the complete form with all current values in Markform format. ' +\n 'The output is deterministic and round-trip safe.',\n inputSchema: GetMarkdownInputSchema,\n execute: () => {\n const form = sessionStore.getForm();\n const markdown = serializeForm(form);\n\n return Promise.resolve({\n success: true,\n data: {\n markdown,\n },\n message: `Generated Markdown (${markdown.length} characters).`,\n });\n },\n };\n\n toolset.markform_get_markdown = markform_get_markdown;\n }\n\n return toolset;\n}\n\n// =============================================================================\n// Convenience Exports\n// =============================================================================\n\nexport { PatchSchema } from '../engine/coreTypes.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAa,uBAAb,MAAkC;CAChC,AAAQ;CACR,AAAQ;CAER,YAAY,MAAkB,mBAAuC;AACnE,OAAK,OAAO;AACZ,OAAK,oBAAoB,qBAAqB,EAAE;;;;;CAMlD,UAAsB;AACpB,SAAO,KAAK;;;;;CAMd,uBAA0C;AACxC,SAAO,KAAK;;;;;CAMd,WAAW,MAAwB;AACjC,OAAK,OAAO;;;;;;AAsDhB,MAAM,qBAAqB,EACxB,OAAO,EAAE,CAAC,CACV,SAAS,kFAAkF;;;;AAK9F,MAAM,mBAAmB,EACtB,OAAO,EACN,SAAS,EACN,MAAM,YAAY,CAClB,IAAI,EAAE,CACN,IAAI,GAAG,CACP,SACC,8fAMD,EACJ,CAAC,CACD,SAAS,6CAA6C;;;;AAKzD,MAAM,oBAAoB,EACvB,OAAO,EAAE,CAAC,CACV,SACC,qGACD;;;;AAKH,MAAM,yBAAyB,EAC5B,OAAO,EAAE,CAAC,CACV,SACC,iHACD;AAeH,SAAS,eAAe,OAAiC;CACvD,MAAM,OAA0B;EAC9B,MAAM,MAAM;EACZ,OAAO,MAAM;EACb,UAAU,MAAM;EACjB;AAED,KAAI,MAAM,SAAS,mBAAmB,MAAM,SAAS,eACnD,MAAK,UAAU,MAAM,QAAQ,KAAK,MAAM,EAAE,GAAG;UACpC,MAAM,SAAS,cAAc;AACtC,OAAK,UAAU,MAAM,QAAQ,KAAK,MAAM,EAAE,GAAG;AAC7C,OAAK,gBAAgB,MAAM;YAClB,MAAM,SAAS,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