markform 0.1.24 → 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 (44) hide show
  1. package/README.md +54 -31
  2. package/dist/ai-sdk.d.mts +1 -1
  3. package/dist/ai-sdk.mjs +2 -2
  4. package/dist/bin.mjs +1 -1
  5. package/dist/{cli-B1DhFYBS.mjs → cli-B1T8kMFt.mjs} +85 -40
  6. package/dist/cli-B1T8kMFt.mjs.map +1 -0
  7. package/dist/cli.mjs +1 -1
  8. package/dist/{coreTypes-GxzWNXap.d.mts → coreTypes-CxpqKpBA.d.mts} +45 -2
  9. package/dist/{coreTypes-CctFK6uE.mjs → coreTypes-DIv9Aabl.mjs} +19 -5
  10. package/dist/coreTypes-DIv9Aabl.mjs.map +1 -0
  11. package/dist/{fillRecord-DeqI2pQ5.d.mts → fillRecord-V3vlyobd.d.mts} +5 -1
  12. package/dist/{fillRecordRenderer-VBQ2vwPV.mjs → fillRecordRenderer-BqRPHPmE.mjs} +47 -15
  13. package/dist/fillRecordRenderer-BqRPHPmE.mjs.map +1 -0
  14. package/dist/index.d.mts +32 -4
  15. package/dist/index.mjs +4 -4
  16. package/dist/{prompts-BCnYaH4_.mjs → prompts-DaPKumGY.mjs} +114 -11
  17. package/dist/prompts-DaPKumGY.mjs.map +1 -0
  18. package/dist/render.d.mts +2 -2
  19. package/dist/render.mjs +1 -1
  20. package/dist/{session-BLjN3BkJ.mjs → session-BW9jtYNV.mjs} +2 -2
  21. package/dist/{session-BLjN3BkJ.mjs.map → session-BW9jtYNV.mjs.map} +1 -1
  22. package/dist/{session-D7C7IlEv.mjs → session-DHyTMP67.mjs} +1 -1
  23. package/dist/{shared-DtorFV21.mjs → shared-BLh342F5.mjs} +1 -1
  24. package/dist/{shared-CuSRYcIB.mjs → shared-BszoSkAO.mjs} +8 -8
  25. package/dist/{shared-CuSRYcIB.mjs.map → shared-BszoSkAO.mjs.map} +1 -1
  26. package/dist/{src-C5OWf1dL.mjs → src-DrXmaOWl.mjs} +155 -27
  27. package/dist/src-DrXmaOWl.mjs.map +1 -0
  28. package/docs/markform-apis.md +19 -7
  29. package/docs/markform-reference.md +247 -178
  30. package/docs/markform-spec.md +81 -33
  31. package/docs/skill/SKILL.md +62 -20
  32. package/examples/markform-demo-playbook.md +342 -0
  33. package/examples/parallel/parallel-research.form.md +2 -6
  34. package/examples/simple/simple-mock-filled.report.md +2 -2
  35. package/examples/simple/simple-skipped-filled.report.md +2 -2
  36. package/examples/twitter-thread/twitter-thread.form.md +5 -5
  37. package/package.json +1 -1
  38. package/dist/cli-B1DhFYBS.mjs.map +0 -1
  39. package/dist/coreTypes-CctFK6uE.mjs.map +0 -1
  40. package/dist/fillRecordRenderer-VBQ2vwPV.mjs.map +0 -1
  41. package/dist/prompts-BCnYaH4_.mjs.map +0 -1
  42. package/dist/src-C5OWf1dL.mjs.map +0 -1
  43. package/examples/startup-research/startup-research-mock-filled.form.md +0 -297
  44. package/examples/startup-research/startup-research.form.md +0 -181
@@ -239,8 +239,8 @@ const result = await fillForm({
239
239
  **Behavior:**
240
240
  - `enableParallel: false` (default): All fields filled serially, `parallel` attributes
241
241
  ignored. The `order` attribute still controls issue filtering.
242
- - `enableParallel: true`: Batch items run concurrently (up to `maxParallelAgents`).
243
- 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.
244
244
  - If the form has no `parallel` batches, falls back to serial automatically.
245
245
  - `FillResult` shape is identical regardless of serial or parallel execution.
246
246
 
@@ -256,6 +256,16 @@ The `status` field in `FillResult` indicates success or failure:
256
256
  | `{ ok: false, reason: 'cancelled' }` | Aborted via signal |
257
257
  | `{ ok: false, reason: 'error' }` | Unexpected error |
258
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
+
259
269
  ### Resumable Form Fills
260
270
 
261
271
  For orchestrated environments with timeout constraints (e.g., Convex, AWS Step
@@ -351,6 +361,7 @@ await fillForm({
351
361
  | `onLlmCallStart` | `{ model }` | Called before an LLM request |
352
362
  | `onLlmCallEnd` | `{ model, inputTokens, outputTokens }` | Called after an LLM response |
353
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 |
354
365
 
355
366
  **TurnProgress fields:**
356
367
 
@@ -376,8 +387,9 @@ interface PatchRejection {
376
387
 
377
388
  ### FillRecord
378
389
 
379
- When `recordFill: true`, the `FillResult.record` contains a complete record of everything
380
- 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.
381
393
 
382
394
  ```typescript
383
395
  const result = await fillForm({
@@ -503,10 +515,10 @@ interface HeadingInfo {
503
515
 
504
516
  ### findEnclosingHeadings(markdown: string, line: number): HeadingInfo[]
505
517
 
506
- Find all headings that enclose a given line position. Returns headings from innermost
507
- (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).
508
520
 
509
- 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
510
522
  equal or higher level appears between them.
511
523
 
512
524
  ### findAllCheckboxes(markdown: string): CheckboxInfo[]