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.
Files changed (50) hide show
  1. package/README.md +69 -29
  2. package/dist/ai-sdk.d.mts +1 -1
  3. package/dist/ai-sdk.mjs +48 -6
  4. package/dist/ai-sdk.mjs.map +1 -1
  5. package/dist/bin.mjs +1 -1
  6. package/dist/{cli-ZcOC47KK.mjs → cli-B1T8kMFt.mjs} +709 -125
  7. package/dist/cli-B1T8kMFt.mjs.map +1 -0
  8. package/dist/cli.d.mts +1 -1
  9. package/dist/cli.mjs +1 -1
  10. package/dist/{coreTypes-BlsJkU1w.d.mts → coreTypes-CxpqKpBA.d.mts} +181 -4
  11. package/dist/{coreTypes-CTLr-NGd.mjs → coreTypes-DIv9Aabl.mjs} +56 -6
  12. package/dist/coreTypes-DIv9Aabl.mjs.map +1 -0
  13. package/dist/{fillRecord-DTl5lnK0.d.mts → fillRecord-V3vlyobd.d.mts} +29 -1
  14. package/dist/{fillRecordRenderer-VBQ2vwPV.mjs → fillRecordRenderer-BqRPHPmE.mjs} +47 -15
  15. package/dist/fillRecordRenderer-BqRPHPmE.mjs.map +1 -0
  16. package/dist/index.d.mts +34 -30
  17. package/dist/index.mjs +4 -4
  18. package/dist/{apply-KzQztrDV.mjs → prompts-DaPKumGY.mjs} +1081 -17
  19. package/dist/prompts-DaPKumGY.mjs.map +1 -0
  20. package/dist/render.d.mts +2 -2
  21. package/dist/render.mjs +1 -1
  22. package/dist/{session-BCcltrLA.mjs → session-BW9jtYNV.mjs} +2 -2
  23. package/dist/{session-BCcltrLA.mjs.map → session-BW9jtYNV.mjs.map} +1 -1
  24. package/dist/{session-VeSkVrck.mjs → session-DHyTMP67.mjs} +1 -1
  25. package/dist/{shared-fb0nkzQi.mjs → shared-BLh342F5.mjs} +1 -1
  26. package/dist/{shared-CsdT2T7k.mjs → shared-BszoSkAO.mjs} +10 -10
  27. package/dist/shared-BszoSkAO.mjs.map +1 -0
  28. package/dist/{src-B2uFvGli.mjs → src-DrXmaOWl.mjs} +179 -840
  29. package/dist/src-DrXmaOWl.mjs.map +1 -0
  30. package/docs/markform-apis.md +25 -7
  31. package/docs/markform-reference.md +273 -179
  32. package/docs/markform-spec.md +92 -36
  33. package/docs/skill/SKILL.md +161 -0
  34. package/examples/markform-demo-playbook.md +342 -0
  35. package/examples/parallel/parallel-research.form.md +2 -6
  36. package/examples/rejection-test/rejection-test.session.yaml +52 -0
  37. package/examples/simple/simple-mock-filled.report.md +2 -2
  38. package/examples/simple/simple-skipped-filled.report.md +2 -2
  39. package/examples/simple/simple-with-skips.session.yaml +78 -0
  40. package/examples/simple/simple.session.yaml +78 -0
  41. package/examples/twitter-thread/twitter-thread.form.md +5 -5
  42. package/package.json +2 -2
  43. package/dist/apply-KzQztrDV.mjs.map +0 -1
  44. package/dist/cli-ZcOC47KK.mjs.map +0 -1
  45. package/dist/coreTypes-CTLr-NGd.mjs.map +0 -1
  46. package/dist/fillRecordRenderer-VBQ2vwPV.mjs.map +0 -1
  47. package/dist/shared-CsdT2T7k.mjs.map +0 -1
  48. package/dist/src-B2uFvGli.mjs.map +0 -1
  49. package/examples/startup-research/startup-research-mock-filled.form.md +0 -297
  50. package/examples/startup-research/startup-research.form.md +0 -181
@@ -138,6 +138,12 @@ Each patch has an `op` and `fieldId`.
138
138
  | `set_date` | date | `{ "op": "set_date", "fieldId": "deadline", "value": "2024-06-15" }` |
139
139
  | `set_year` | year | `{ "op": "set_year", "fieldId": "founded", "value": 2015 }` |
140
140
  | `set_table` | table | `{ "op": "set_table", "fieldId": "data", "value": [{"col1": "v1"}] }` |
141
+ | `append_table` | table | `{ "op": "append_table", "fieldId": "data", "value": [{"col1": "v2"}] }` |
142
+ | `delete_table` | table | `{ "op": "delete_table", "fieldId": "data", "value": [0, 2] }` |
143
+ | `append_string_list` | string_list | `{ "op": "append_string_list", "fieldId": "tags", "value": ["c"] }` |
144
+ | `delete_string_list` | string_list | `{ "op": "delete_string_list", "fieldId": "tags", "value": ["a"] }` |
145
+ | `append_url_list` | url_list | `{ "op": "append_url_list", "fieldId": "sources", "value": ["https://new"] }` |
146
+ | `delete_url_list` | url_list | `{ "op": "delete_url_list", "fieldId": "sources", "value": ["https://old"] }` |
141
147
  | `clear_field` | any | `{ "op": "clear_field", "fieldId": "name" }` |
142
148
  | `skip_field` | optional | `{ "op": "skip_field", "fieldId": "notes", "reason": "Not applicable" }` |
143
149
  | `abort_field` | any | `{ "op": "abort_field", "fieldId": "data", "reason": "Unable to find" }` |
@@ -233,8 +239,8 @@ const result = await fillForm({
233
239
  **Behavior:**
234
240
  - `enableParallel: false` (default): All fields filled serially, `parallel` attributes
235
241
  ignored. The `order` attribute still controls issue filtering.
236
- - `enableParallel: true`: Batch items run concurrently (up to `maxParallelAgents`).
237
- Each agent runs a multi-turn loop with rejection feedback, same as the serial path.
242
+ - `enableParallel: true`: Batch items run concurrently (up to `maxParallelAgents`). Each
243
+ agent runs a multi-turn loop with rejection feedback, same as the serial path.
238
244
  - If the form has no `parallel` batches, falls back to serial automatically.
239
245
  - `FillResult` shape is identical regardless of serial or parallel execution.
240
246
 
@@ -250,6 +256,16 @@ The `status` field in `FillResult` indicates success or failure:
250
256
  | `{ ok: false, reason: 'cancelled' }` | Aborted via signal |
251
257
  | `{ ok: false, reason: 'error' }` | Unexpected error |
252
258
 
259
+ When `ok` is `false`, the status also includes:
260
+
261
+ - `message?: string` — Human-readable error description
262
+ - `error?: Error` — The original Error object with its full cause chain preserved (when
263
+ the caught value was an Error instance).
264
+ For `MarkformLlmError` instances, this carries `.statusCode`, `.responseBody`,
265
+ `.provider`, `.model`, and `.retryable` properties.
266
+ Not serialized into FillRecord — use for in-memory diagnostics and real-time error
267
+ handling.
268
+
253
269
  ### Resumable Form Fills
254
270
 
255
271
  For orchestrated environments with timeout constraints (e.g., Convex, AWS Step
@@ -345,6 +361,7 @@ await fillForm({
345
361
  | `onLlmCallStart` | `{ model }` | Called before an LLM request |
346
362
  | `onLlmCallEnd` | `{ model, inputTokens, outputTokens }` | Called after an LLM response |
347
363
  | `onWebSearch` | `{ query, resultCount, provider }` | Called when a web search is performed |
364
+ | `onError` | `(error: Error, { turnNumber })` | Called when an error occurs during the fill loop |
348
365
 
349
366
  **TurnProgress fields:**
350
367
 
@@ -370,8 +387,9 @@ interface PatchRejection {
370
387
 
371
388
  ### FillRecord
372
389
 
373
- When `recordFill: true`, the `FillResult.record` contains a complete record of everything
374
- that happened during the fill operation. Useful for cost analysis, debugging, and auditing.
390
+ When `recordFill: true`, the `FillResult.record` contains a complete record of
391
+ everything that happened during the fill operation.
392
+ Useful for cost analysis, debugging, and auditing.
375
393
 
376
394
  ```typescript
377
395
  const result = await fillForm({
@@ -497,10 +515,10 @@ interface HeadingInfo {
497
515
 
498
516
  ### findEnclosingHeadings(markdown: string, line: number): HeadingInfo[]
499
517
 
500
- Find all headings that enclose a given line position. Returns headings from innermost
501
- (most specific) to outermost (least specific).
518
+ Find all headings that enclose a given line position.
519
+ Returns headings from innermost (most specific) to outermost (least specific).
502
520
 
503
- A heading "encloses" a line if the heading appears before the line and no heading of
521
+ A heading encloses a line if the heading appears before the line and no heading of
504
522
  equal or higher level appears between them.
505
523
 
506
524
  ### findAllCheckboxes(markdown: string): CheckboxInfo[]