markform 0.1.6 → 0.1.7

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.
Files changed (30) hide show
  1. package/README.md +59 -24
  2. package/dist/ai-sdk.d.mts +1 -2
  3. package/dist/ai-sdk.mjs +3 -2
  4. package/dist/{apply-DMQl-VVd.mjs → apply-g23rRn7p.mjs} +28 -3
  5. package/dist/bin.d.mts +0 -1
  6. package/dist/bin.mjs +3 -6
  7. package/dist/{cli-CXjkdym_.mjs → cli-Bqlm-WWw.mjs} +1565 -835
  8. package/dist/cli.d.mts +0 -1
  9. package/dist/cli.mjs +2 -6
  10. package/dist/coreTypes-DCvD7feM.d.mts +3203 -0
  11. package/dist/{coreTypes-pyctKRgc.mjs → coreTypes-__Cwxz5q.mjs} +10 -3
  12. package/dist/index.d.mts +105 -3
  13. package/dist/index.mjs +6 -5
  14. package/dist/{session-uF0e6m6k.mjs → session-CgCNni0e.mjs} +3 -2
  15. package/dist/session-DruaYPZ1.mjs +4 -0
  16. package/dist/{shared-u22MtBRo.mjs → shared-C9yW5FLZ.mjs} +2 -1
  17. package/dist/{shared-DRlgu2ZJ.mjs → shared-DQ6y3Ggc.mjs} +3 -1
  18. package/dist/{src-o_5TSoHQ.mjs → src-BiuxbzF3.mjs} +410 -75
  19. package/docs/markform-spec.md +2 -2
  20. package/examples/earnings-analysis/earnings-analysis.form.md +1 -0
  21. package/examples/movie-research/movie-research-basic.form.md +1 -0
  22. package/examples/movie-research/movie-research-deep.form.md +1 -0
  23. package/examples/movie-research/{movie-research-minimal.form.md → movie-research-demo.form.md} +4 -3
  24. package/examples/simple/simple.form.md +1 -0
  25. package/examples/simple/simple.schema.json +374 -0
  26. package/examples/startup-deep-research/startup-deep-research.form.md +1 -0
  27. package/examples/startup-research/startup-research.form.md +1 -0
  28. package/package.json +11 -9
  29. package/dist/coreTypes-9XZSNOv6.d.mts +0 -8951
  30. package/dist/session-B_stoXQn.mjs +0 -4
package/README.md CHANGED
@@ -38,20 +38,22 @@ informal Markdown doc describing a process to a precise Markform process easily.
38
38
  ## Quick Start
39
39
 
40
40
  ```bash
41
- # Try filling in one of a few example forms without installing.
42
- # First set OPENAI_API_KEY or ANTHROPIC_API_KEY in environment or .env file
43
- # to try the research examples.
44
- npx markform examples
41
+ # Copy example forms to ./forms/ and run one interactively
42
+ # Set OPENAI_API_KEY or ANTHROPIC_API_KEY (or put in .env) for research examples
43
+ npx markform examples # Copy examples to ./forms/, then offers to run one
45
44
 
46
- # Read the docs
45
+ # Or run forms directly
46
+ npx markform run # Browse and run forms interactively
47
+
48
+ # Read the docs (tell your agents to run these; they are agent-friendly!)
47
49
  npx markform # CLI help
48
50
  npx markform readme # This file
49
- npx markform docs # Quick start for humans or agents to write Markforms
51
+ npx markform docs # Quick reference for writing Markforms
50
52
  npx markform spec # Read the full spec
51
53
  ```
52
54
 
53
- This lets you walk through a form interactively from the CLI, with the option to have an
54
- agent fill in parts of the form.
55
+ The `markform examples` command copies sample forms locally and prompts you to run one.
56
+ Pick `movie-research-demo.form.md` for a quick example.
55
57
 
56
58
  ## Installation
57
59
 
@@ -76,7 +78,7 @@ It combines YAML frontmatter with Markdoc-tagged content:
76
78
  ---
77
79
  markform:
78
80
  spec: MF/0.1
79
- title: Movie Research (Minimal)
81
+ title: Movie Research (Demo)
80
82
  description: Quick movie lookup with just the essentials (title, year, ratings, summary).
81
83
  roles:
82
84
  - user
@@ -85,9 +87,9 @@ markform:
85
87
  user: "Enter the movie title."
86
88
  agent: |
87
89
  Quickly identify the movie and fill in basic info from IMDB.
88
- This is a minimal lookup - just get the core facts.
90
+ This is a demo lookup - just get the core facts.
89
91
  ---
90
- {% form id="movie_research_minimal" title="Movie Research (Minimal)" %}
92
+ {% form id="movie_research_demo" title="Movie Research (Demo)" %}
91
93
 
92
94
  ## Movie Research Example
93
95
 
@@ -145,11 +147,12 @@ What movie do you want to research? \[*This field is filled in by the user (`rol
145
147
 
146
148
  ### Form Report Output
147
149
 
148
- Run the `npx markform examples` and select the `Movie Research (Minimal)` example and
149
- view the report:
150
+ Run `npx markform examples` to copy examples, then `npx markform run` and select `Movie
151
+ Research (Demo)` to fill it.
152
+ The report output looks like:
150
153
 
151
154
  ```markdown
152
- # Movie Research (Minimal)
155
+ # Movie Research (Demo)
153
156
 
154
157
  ## Movie Identification
155
158
 
@@ -180,12 +183,13 @@ Convicted banker Andy Dufresne is sent to Shawshank State Penitentiary, where he
180
183
  ### More Example Forms
181
184
 
182
185
  The package includes example forms.
183
- View them with `markform examples --list` or try these interactively:
186
+ View them with `markform examples --list`, copy with `markform examples`, and run with
187
+ `markform run`:
184
188
 
185
189
  - [`simple.form.md`](https://github.com/jlevy/markform/blob/main/packages/markform/examples/simple/simple.form.md)
186
190
  \- Basic form demonstrating all field kinds.
187
191
 
188
- - [`movie-research-minimal.form.md`](https://github.com/jlevy/markform/blob/main/packages/markform/examples/movie-research/movie-research-minimal.form.md)
192
+ - [`movie-research-demo.form.md`](https://github.com/jlevy/markform/blob/main/packages/markform/examples/movie-research/movie-research-demo.form.md)
189
193
  \- The quick example above.
190
194
 
191
195
  - [`movie-research-basic.form.md`](https://github.com/jlevy/markform/blob/main/packages/markform/examples/movie-research/movie-research-basic.form.md)
@@ -199,17 +203,34 @@ View them with `markform examples --list` or try these interactively:
199
203
 
200
204
  ## CLI Commands
201
205
 
202
- ### Explore Examples
206
+ ### Copy and Run Examples
203
207
 
204
208
  ```bash
205
- # Interactive: select an example, fill it, optionally run agent
209
+ # Copy all bundled examples to ./forms/
206
210
  markform examples
207
211
 
208
212
  # List available examples
209
213
  markform examples --list
210
214
 
211
- # Start with a specific example
212
- markform examples --name political-research
215
+ # Copy a specific example
216
+ markform examples --name movie-research-demo
217
+ ```
218
+
219
+ ### Browse and Run Forms
220
+
221
+ ```bash
222
+ # Browse forms in ./forms/ and run one interactively
223
+ markform run
224
+
225
+ # Run a specific form directly
226
+ markform run forms/movie-research-demo.form.md
227
+ ```
228
+
229
+ ### Check Form Status
230
+
231
+ ```bash
232
+ # Show fill progress with per-role breakdown
233
+ markform status my-form.form.md
213
234
  ```
214
235
 
215
236
  ### Inspect Forms
@@ -445,10 +466,24 @@ But it’s been useful for me already.
445
466
 
446
467
  ### Was it Vibe Coded?
447
468
 
448
- It’s all written by LLMs but using a strongly spec-driven process, using rules from
449
- [Speculate](https://github.com/jlevy/speculate).
450
- See [the spec](docs/markform-spec.md) and the architecture docs and specs in
451
- [docs/](docs/).
469
+ This is 100% agent-written code and the planning specs are also 100% agent written,
470
+ using a mix of Opus 4.5, GPT 5.2, GPT-5 Pro, Gemini 3, and occasionally others.
471
+
472
+ But it’s not slop. It is written via a strongly spec-driven process, using rules from my
473
+ [Speculate](https://github.com/jlevy/speculate) repo and Steve Yegge’s
474
+ [beads](https://github.com/steveyegge/beads) for tracking work.
475
+
476
+ See
477
+ [my post](https://github.com/jlevy/speculate/blob/main/about/lessons_in_spec_coding.md)
478
+ for more thoughts on how this works.
479
+ And see [the complete history of
480
+ specs](https://github.com/jlevy/markform/tree/main/docs/project/specs/done) for examples
481
+ of how everything is done with specs and with
482
+
483
+ Although I didn’t have to write much there was a *lot* of management and review by me
484
+ and a lot of thought and iteration for all design decisions.
485
+ And this doc is written by me.
486
+ :)
452
487
 
453
488
  ### What are the goals of Markform?
454
489
 
package/dist/ai-sdk.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- #!/usr/bin/env node
2
1
 
3
- import { Dt as PatchSchema, Et as Patch, G as FormSchema, Tt as ParsedForm, X as Id, ar as ValidatorRegistry, r as ApplyResult, tt as InspectResult, z as FieldResponse } from "./coreTypes-9XZSNOv6.mjs";
2
+ import { Dt as ParsedForm, Ot as Patch, Q as Id, V as FieldResponse, kt as PatchSchema, lr as ValidatorRegistry, q as FormSchema, r as ApplyResult, rt as InspectResult } from "./coreTypes-DCvD7feM.mjs";
4
3
  import { z } from "zod";
5
4
 
6
5
  //#region src/integrations/toolTypes.d.ts
package/dist/ai-sdk.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { L as PatchSchema } from "./coreTypes-pyctKRgc.mjs";
2
- import { r as inspect, t as applyPatches, u as serialize } from "./apply-DMQl-VVd.mjs";
1
+
2
+ import { L as PatchSchema } from "./coreTypes-__Cwxz5q.mjs";
3
+ import { d as serialize, i as inspect, t as applyPatches } from "./apply-g23rRn7p.mjs";
3
4
  import { z } from "zod";
4
5
 
5
6
  //#region src/integrations/vercelAiSdkTools.ts
@@ -1,3 +1,4 @@
1
+
1
2
  //#region src/llms.ts
2
3
  /**
3
4
  * Parse a model ID string into provider and model components for display.
@@ -161,6 +162,11 @@ const DEFAULT_PRIORITY = "medium";
161
162
  */
162
163
  const DEFAULT_FORMS_DIR = "./forms";
163
164
  /**
165
+ * Maximum forms to display in 'markform run' menu.
166
+ * Additional forms are not shown but can be run directly by path.
167
+ */
168
+ const MAX_FORMS_IN_MENU = 30;
169
+ /**
164
170
  * The default port for the serve command.
165
171
  */
166
172
  const DEFAULT_PORT = 3344;
@@ -203,12 +209,18 @@ const EXPORT_EXTENSIONS = {
203
209
  */
204
210
  const REPORT_EXTENSION = ".report.md";
205
211
  /**
212
+ * Schema extension - generated JSON Schema for form structure.
213
+ * Used for validation, code generation, and LLM tooling.
214
+ */
215
+ const SCHEMA_EXTENSION = ".schema.json";
216
+ /**
206
217
  * All recognized markform file extensions.
207
- * Combines export formats with report format.
218
+ * Combines export formats with report and schema formats.
208
219
  */
209
220
  const ALL_EXTENSIONS = {
210
221
  ...EXPORT_EXTENSIONS,
211
- report: REPORT_EXTENSION
222
+ report: REPORT_EXTENSION,
223
+ schema: SCHEMA_EXTENSION
212
224
  };
213
225
  /**
214
226
  * Detect file type from path based on extension.
@@ -219,6 +231,7 @@ function detectFileType(filePath) {
219
231
  if (filePath.endsWith(ALL_EXTENSIONS.raw)) return "raw";
220
232
  if (filePath.endsWith(ALL_EXTENSIONS.report)) return "report";
221
233
  if (filePath.endsWith(ALL_EXTENSIONS.yaml)) return "yaml";
234
+ if (filePath.endsWith(ALL_EXTENSIONS.schema)) return "schema";
222
235
  if (filePath.endsWith(ALL_EXTENSIONS.json)) return "json";
223
236
  if (filePath.endsWith(".md")) return "raw";
224
237
  return "unknown";
@@ -247,6 +260,18 @@ function deriveReportPath(basePath) {
247
260
  }
248
261
  return base + REPORT_EXTENSION;
249
262
  }
263
+ /**
264
+ * Derive schema path from any markform file path.
265
+ * Strips known extensions and appends .schema.json.
266
+ */
267
+ function deriveSchemaPath(basePath) {
268
+ let base = basePath;
269
+ for (const ext of Object.values(ALL_EXTENSIONS)) if (base.endsWith(ext)) {
270
+ base = base.slice(0, -ext.length);
271
+ break;
272
+ }
273
+ return base + SCHEMA_EXTENSION;
274
+ }
250
275
 
251
276
  //#endregion
252
277
  //#region src/utils/keySort.ts
@@ -2804,4 +2829,4 @@ function applyPatches(form, patches) {
2804
2829
  }
2805
2830
 
2806
2831
  //#endregion
2807
- export { SUGGESTED_LLMS as A, DEFAULT_ROLE_INSTRUCTIONS as C, deriveReportPath as D, deriveExportPath as E, parseModelIdForDisplay as F, formatSuggestedLlms as M, getWebSearchConfig as N, detectFileType as O, hasWebSearchSupport as P, DEFAULT_ROLES as S, USER_ROLE as T, DEFAULT_MAX_TURNS as _, computeAllSummaries as a, DEFAULT_RESEARCH_MAX_ISSUES_PER_TURN as b, computeStructureSummary as c, serializeRawMarkdown as d, serializeReportMarkdown as f, DEFAULT_MAX_PATCHES_PER_TURN as g, DEFAULT_MAX_ISSUES_PER_TURN as h, validate as i, WEB_SEARCH_CONFIG as j, parseRolesFlag as k, isFormComplete as l, DEFAULT_FORMS_DIR as m, getFieldsForRoles as n, computeFormState as o, AGENT_ROLE as p, inspect as r, computeProgressSummary as s, applyPatches as t, serialize as u, DEFAULT_PORT as v, REPORT_EXTENSION as w, DEFAULT_RESEARCH_MAX_PATCHES_PER_TURN as x, DEFAULT_PRIORITY as y };
2832
+ export { deriveSchemaPath as A, DEFAULT_ROLES as C, USER_ROLE as D, REPORT_EXTENSION as E, formatSuggestedLlms as F, getWebSearchConfig as I, hasWebSearchSupport as L, parseRolesFlag as M, SUGGESTED_LLMS as N, deriveExportPath as O, WEB_SEARCH_CONFIG as P, parseModelIdForDisplay as R, DEFAULT_RESEARCH_MAX_PATCHES_PER_TURN as S, MAX_FORMS_IN_MENU as T, DEFAULT_MAX_PATCHES_PER_TURN as _, validate as a, DEFAULT_PRIORITY as b, computeProgressSummary as c, serialize as d, serializeRawMarkdown as f, DEFAULT_MAX_ISSUES_PER_TURN as g, DEFAULT_FORMS_DIR as h, inspect as i, detectFileType as j, deriveReportPath as k, computeStructureSummary as l, AGENT_ROLE as m, getAllFields as n, computeAllSummaries as o, serializeReportMarkdown as p, getFieldsForRoles as r, computeFormState as s, applyPatches as t, isFormComplete as u, DEFAULT_MAX_TURNS as v, DEFAULT_ROLE_INSTRUCTIONS as w, DEFAULT_RESEARCH_MAX_ISSUES_PER_TURN as x, DEFAULT_PORT as y };
package/dist/bin.d.mts CHANGED
@@ -1,3 +1,2 @@
1
- #!/usr/bin/env node
2
1
 
3
2
  export { };
package/dist/bin.mjs CHANGED
@@ -1,10 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import "./coreTypes-pyctKRgc.mjs";
3
- import "./apply-DMQl-VVd.mjs";
4
- import "./src-o_5TSoHQ.mjs";
5
- import "./session-uF0e6m6k.mjs";
6
- import { t as runCli } from "./cli-CXjkdym_.mjs";
7
- import "./shared-DRlgu2ZJ.mjs";
2
+
3
+
4
+ import { t as runCli } from "./cli-Bqlm-WWw.mjs";
8
5
  import { resolve } from "node:path";
9
6
  import { existsSync } from "node:fs";
10
7
  import { config } from "dotenv";