markform 0.1.17 → 0.1.18

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 (31) hide show
  1. package/README.md +2 -2
  2. package/dist/ai-sdk.d.mts +1 -1
  3. package/dist/ai-sdk.mjs +2 -2
  4. package/dist/{apply-DgDJBscb.mjs → apply-BYgtU64w.mjs} +29 -3
  5. package/dist/apply-BYgtU64w.mjs.map +1 -0
  6. package/dist/bin.mjs +1 -1
  7. package/dist/{cli-DAl8LQzI.mjs → cli-D9w0Bp4J.mjs} +192 -6
  8. package/dist/cli-D9w0Bp4J.mjs.map +1 -0
  9. package/dist/cli.mjs +1 -1
  10. package/dist/{coreTypes-CnEea7Kh.d.mts → coreTypes-BMEs8h_2.d.mts} +125 -2
  11. package/dist/{coreTypes-DiCddBKu.mjs → coreTypes-SDB3KRRJ.mjs} +9 -4
  12. package/dist/coreTypes-SDB3KRRJ.mjs.map +1 -0
  13. package/dist/index.d.mts +129 -2
  14. package/dist/index.mjs +5 -5
  15. package/dist/{session-B7aR6hno.mjs → session-CW9AQw6i.mjs} +1 -1
  16. package/dist/{session-XDrocA3j.mjs → session-Ci4B0Pna.mjs} +2 -2
  17. package/dist/{session-XDrocA3j.mjs.map → session-Ci4B0Pna.mjs.map} +1 -1
  18. package/dist/{src-CHVJLGKt.mjs → src-DDxi-2ne.mjs} +495 -14
  19. package/dist/src-DDxi-2ne.mjs.map +1 -0
  20. package/docs/markform-apis.md +31 -0
  21. package/docs/markform-reference.md +27 -0
  22. package/docs/markform-spec.md +115 -0
  23. package/examples/movie-research/movie-deep-research-mock-filled.form.md +1 -1
  24. package/examples/movie-research/movie-deep-research.form.md +1 -1
  25. package/examples/parallel/parallel-research.form.md +57 -0
  26. package/examples/startup-deep-research/startup-deep-research.form.md +1 -1
  27. package/package.json +1 -1
  28. package/dist/apply-DgDJBscb.mjs.map +0 -1
  29. package/dist/cli-DAl8LQzI.mjs.map +0 -1
  30. package/dist/coreTypes-DiCddBKu.mjs.map +0 -1
  31. package/dist/src-CHVJLGKt.mjs.map +0 -1
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Markform
2
2
 
3
- [![CI](https://github.com/jlevy/markform/actions/workflows/ci.yml/badge.svg)](https://github.com/jlevy/markform/actions/runs/21348509287)
4
- [![Coverage](https://raw.githubusercontent.com/jlevy/markform/main/badges/packages/markform/coverage-total.svg)](https://github.com/jlevy/markform/actions/runs/21348509287)
3
+ [![CI](https://github.com/jlevy/markform/actions/workflows/ci.yml/badge.svg)](https://github.com/jlevy/markform/actions/runs/21430430567)
4
+ [![Coverage](https://raw.githubusercontent.com/jlevy/markform/main/badges/packages/markform/coverage-total.svg)](https://github.com/jlevy/markform/actions/runs/21430430567)
5
5
  [![npm version](https://img.shields.io/npm/v/markform)](https://www.npmjs.com/package/markform)
6
6
  [![X Follow](https://img.shields.io/twitter/follow/ojoshe)](https://x.com/ojoshe)
7
7
 
package/dist/ai-sdk.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { At as PatchSchema, Dt as ParsedForm, Ot as Patch, Q as Id, V as FieldResponse, fr as ValidatorRegistry, q as FormSchema, r as ApplyResult, rt as InspectResult } from "./coreTypes-CnEea7Kh.mjs";
2
+ import { At as Patch, Mt as PatchSchema, U as FieldResponse, Y as FormSchema, at as InspectResult, et as Id, kt as ParsedForm, mr as ValidatorRegistry, r as ApplyResult } from "./coreTypes-BMEs8h_2.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 { L as PatchSchema } from "./coreTypes-DiCddBKu.mjs";
3
- import { d as serializeForm, i as inspect, t as applyPatches } from "./apply-DgDJBscb.mjs";
2
+ import { L as PatchSchema } from "./coreTypes-SDB3KRRJ.mjs";
3
+ import { d as serializeForm, i as inspect, t as applyPatches } from "./apply-BYgtU64w.mjs";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/integrations/vercelAiSdkTools.ts
@@ -2,7 +2,7 @@
2
2
  import YAML from "yaml";
3
3
 
4
4
  //#region src/errors.ts
5
- const VERSION = "0.1.17";
5
+ const VERSION = "0.1.18";
6
6
  /**
7
7
  * Base error class for all markform errors.
8
8
  * Consumers can catch this to handle any markform error.
@@ -373,6 +373,11 @@ const DEFAULT_MAX_PATCHES_PER_TURN = 20;
373
373
  */
374
374
  const DEFAULT_MAX_ISSUES_PER_TURN = 10;
375
375
  /**
376
+ * Default maximum concurrent agents for parallel batches.
377
+ * When parallel batches are executed, this limits how many agents run simultaneously.
378
+ */
379
+ const DEFAULT_MAX_PARALLEL_AGENTS = 4;
380
+ /**
376
381
  * Default maximum AI SDK steps (tool call rounds) per harness turn.
377
382
  * Matches AI SDK's ToolLoopAgent default of 20.
378
383
  * @see https://ai-sdk.dev/docs/agents/loop-control
@@ -1236,6 +1241,13 @@ function getMarker(state) {
1236
1241
  return STATE_TO_MARKER[state] ?? " ";
1237
1242
  }
1238
1243
  /**
1244
+ * Add parallel and order attributes to a field's attrs object if defined.
1245
+ */
1246
+ function addParallelOrderAttrs(attrs, field) {
1247
+ if (field.parallel !== void 0) attrs.parallel = field.parallel;
1248
+ if (field.order !== void 0) attrs.order = field.order;
1249
+ }
1250
+ /**
1239
1251
  * Serialize a string field.
1240
1252
  */
1241
1253
  function serializeStringField(field, response) {
@@ -1253,6 +1265,7 @@ function serializeStringField(field, response) {
1253
1265
  if (field.maxLength !== void 0) attrs.maxLength = field.maxLength;
1254
1266
  if (field.validate) attrs.validate = field.validate;
1255
1267
  if (field.report !== void 0) attrs.report = field.report;
1268
+ addParallelOrderAttrs(attrs, field);
1256
1269
  if (field.placeholder) attrs.placeholder = field.placeholder;
1257
1270
  if (field.examples && field.examples.length > 0) attrs.examples = field.examples;
1258
1271
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
@@ -1283,6 +1296,7 @@ function serializeNumberField(field, response) {
1283
1296
  if (field.integer) attrs.integer = field.integer;
1284
1297
  if (field.validate) attrs.validate = field.validate;
1285
1298
  if (field.report !== void 0) attrs.report = field.report;
1299
+ addParallelOrderAttrs(attrs, field);
1286
1300
  if (field.placeholder) attrs.placeholder = field.placeholder;
1287
1301
  if (field.examples && field.examples.length > 0) attrs.examples = field.examples;
1288
1302
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
@@ -1315,6 +1329,7 @@ function serializeStringListField(field, response) {
1315
1329
  if (field.uniqueItems) attrs.uniqueItems = field.uniqueItems;
1316
1330
  if (field.validate) attrs.validate = field.validate;
1317
1331
  if (field.report !== void 0) attrs.report = field.report;
1332
+ addParallelOrderAttrs(attrs, field);
1318
1333
  if (field.placeholder) attrs.placeholder = field.placeholder;
1319
1334
  if (field.examples && field.examples.length > 0) attrs.examples = field.examples;
1320
1335
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
@@ -1353,6 +1368,7 @@ function serializeSingleSelectField(field, response) {
1353
1368
  if (field.role !== AGENT_ROLE) attrs.role = field.role;
1354
1369
  if (field.validate) attrs.validate = field.validate;
1355
1370
  if (field.report !== void 0) attrs.report = field.report;
1371
+ addParallelOrderAttrs(attrs, field);
1356
1372
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
1357
1373
  const attrStr = serializeAttrs(attrs);
1358
1374
  let value;
@@ -1377,6 +1393,7 @@ function serializeMultiSelectField(field, response) {
1377
1393
  if (field.maxSelections !== void 0) attrs.maxSelections = field.maxSelections;
1378
1394
  if (field.validate) attrs.validate = field.validate;
1379
1395
  if (field.report !== void 0) attrs.report = field.report;
1396
+ addParallelOrderAttrs(attrs, field);
1380
1397
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
1381
1398
  const attrStr = serializeAttrs(attrs);
1382
1399
  let value;
@@ -1403,6 +1420,7 @@ function serializeCheckboxesField(field, response) {
1403
1420
  if (field.approvalMode !== "none") attrs.approvalMode = field.approvalMode;
1404
1421
  if (field.validate) attrs.validate = field.validate;
1405
1422
  if (field.report !== void 0) attrs.report = field.report;
1423
+ addParallelOrderAttrs(attrs, field);
1406
1424
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
1407
1425
  const attrStr = serializeAttrs(attrs);
1408
1426
  let value;
@@ -1423,6 +1441,7 @@ function serializeUrlField(field, response) {
1423
1441
  if (field.role !== AGENT_ROLE) attrs.role = field.role;
1424
1442
  if (field.validate) attrs.validate = field.validate;
1425
1443
  if (field.report !== void 0) attrs.report = field.report;
1444
+ addParallelOrderAttrs(attrs, field);
1426
1445
  if (field.placeholder) attrs.placeholder = field.placeholder;
1427
1446
  if (field.examples && field.examples.length > 0) attrs.examples = field.examples;
1428
1447
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
@@ -1453,6 +1472,7 @@ function serializeUrlListField(field, response) {
1453
1472
  if (field.uniqueItems) attrs.uniqueItems = field.uniqueItems;
1454
1473
  if (field.validate) attrs.validate = field.validate;
1455
1474
  if (field.report !== void 0) attrs.report = field.report;
1475
+ addParallelOrderAttrs(attrs, field);
1456
1476
  if (field.placeholder) attrs.placeholder = field.placeholder;
1457
1477
  if (field.examples && field.examples.length > 0) attrs.examples = field.examples;
1458
1478
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
@@ -1482,6 +1502,7 @@ function serializeDateField(field, response) {
1482
1502
  if (field.max !== void 0) attrs.max = field.max;
1483
1503
  if (field.validate) attrs.validate = field.validate;
1484
1504
  if (field.report !== void 0) attrs.report = field.report;
1505
+ addParallelOrderAttrs(attrs, field);
1485
1506
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
1486
1507
  const attrStr = serializeAttrs(attrs);
1487
1508
  let content = "";
@@ -1509,6 +1530,7 @@ function serializeYearField(field, response) {
1509
1530
  if (field.max !== void 0) attrs.max = field.max;
1510
1531
  if (field.validate) attrs.validate = field.validate;
1511
1532
  if (field.report !== void 0) attrs.report = field.report;
1533
+ addParallelOrderAttrs(attrs, field);
1512
1534
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
1513
1535
  const attrStr = serializeAttrs(attrs);
1514
1536
  let content = "";
@@ -1578,6 +1600,7 @@ function serializeTableField(field, response) {
1578
1600
  if (field.maxRows !== void 0) attrs.maxRows = field.maxRows;
1579
1601
  if (field.validate) attrs.validate = field.validate;
1580
1602
  if (field.report !== void 0) attrs.report = field.report;
1603
+ addParallelOrderAttrs(attrs, field);
1581
1604
  if (response?.state === "skipped" || response?.state === "aborted") attrs.state = response.state;
1582
1605
  const attrStr = serializeAttrs(attrs);
1583
1606
  let content = "";
@@ -1654,6 +1677,8 @@ function serializeFieldGroup(group, responses, docs) {
1654
1677
  if (group.title) attrs.title = group.title;
1655
1678
  if (group.validate) attrs.validate = group.validate;
1656
1679
  if (group.report !== void 0) attrs.report = group.report;
1680
+ if (group.parallel !== void 0) attrs.parallel = group.parallel;
1681
+ if (group.order !== void 0) attrs.order = group.order;
1657
1682
  const attrStr = serializeAttrs(attrs);
1658
1683
  lines.push(`{% group ${attrStr} %}`);
1659
1684
  }
@@ -1717,6 +1742,7 @@ function buildHarnessConfig(config) {
1717
1742
  if (config.maxTurns !== void 0) result.max_turns = config.maxTurns;
1718
1743
  if (config.maxPatchesPerTurn !== void 0) result.max_patches_per_turn = config.maxPatchesPerTurn;
1719
1744
  if (config.maxIssuesPerTurn !== void 0) result.max_issues_per_turn = config.maxIssuesPerTurn;
1745
+ if (config.maxParallelAgents !== void 0) result.max_parallel_agents = config.maxParallelAgents;
1720
1746
  return result;
1721
1747
  }
1722
1748
  /**
@@ -3868,5 +3894,5 @@ function applyPatches(form, patches) {
3868
3894
  }
3869
3895
 
3870
3896
  //#endregion
3871
- export { isConfigError as $, MAX_FORMS_IN_MENU as A, formatSuggestedLlms as B, DEFAULT_MAX_TURNS as C, DEFAULT_RESEARCH_MAX_PATCHES_PER_TURN as D, DEFAULT_RESEARCH_MAX_ISSUES_PER_TURN as E, deriveSchemaPath as F, MarkformConfigError as G, hasWebSearchSupport as H, detectFileType as I, MarkformParseError as J, MarkformError as K, parseRolesFlag as L, USER_ROLE as M, deriveExportPath as N, DEFAULT_ROLES as O, deriveReportPath as P, isAbortError as Q, SUGGESTED_LLMS as R, DEFAULT_MAX_STEPS_PER_TURN as S, DEFAULT_PRIORITY as T, parseModelIdForDisplay as U, getWebSearchConfig as V, MarkformAbortError as W, MarkformValidationError as X, MarkformPatchError as Y, ParseError as Z, validateSyntaxConsistency as _, validate as a, isValidationError as at, DEFAULT_MAX_ISSUES_PER_TURN as b, computeProgressSummary as c, serializeForm as d, isLlmError as et, serializeRawMarkdown as f, preprocessCommentSyntax as g, detectSyntaxStyle as h, inspect as i, isRetryableError as it, REPORT_EXTENSION as j, DEFAULT_ROLE_INSTRUCTIONS as k, computeStructureSummary as l, friendlyUrlAbbrev as m, getAllFields as n, isParseError as nt, computeAllSummaries as o, serializeReport as p, MarkformLlmError as q, getFieldsForRoles as r, isPatchError as rt, computeFormState as s, applyPatches as t, isMarkformError as tt, isFormComplete as u, AGENT_ROLE as v, DEFAULT_PORT as w, DEFAULT_MAX_PATCHES_PER_TURN as x, DEFAULT_FORMS_DIR as y, WEB_SEARCH_CONFIG as z };
3872
- //# sourceMappingURL=apply-DgDJBscb.mjs.map
3897
+ export { isAbortError as $, DEFAULT_ROLE_INSTRUCTIONS as A, WEB_SEARCH_CONFIG as B, DEFAULT_MAX_STEPS_PER_TURN as C, DEFAULT_RESEARCH_MAX_ISSUES_PER_TURN as D, DEFAULT_PRIORITY as E, deriveReportPath as F, MarkformAbortError as G, getWebSearchConfig as H, deriveSchemaPath as I, MarkformLlmError as J, MarkformConfigError as K, detectFileType as L, REPORT_EXTENSION as M, USER_ROLE as N, DEFAULT_RESEARCH_MAX_PATCHES_PER_TURN as O, deriveExportPath as P, ParseError as Q, parseRolesFlag as R, DEFAULT_MAX_PATCHES_PER_TURN as S, DEFAULT_PORT as T, hasWebSearchSupport as U, formatSuggestedLlms as V, parseModelIdForDisplay as W, MarkformPatchError as X, MarkformParseError as Y, MarkformValidationError as Z, validateSyntaxConsistency as _, validate as a, isRetryableError as at, DEFAULT_MAX_ISSUES_PER_TURN as b, computeProgressSummary as c, serializeForm as d, isConfigError as et, serializeRawMarkdown as f, preprocessCommentSyntax as g, detectSyntaxStyle as h, inspect as i, isPatchError as it, MAX_FORMS_IN_MENU as j, DEFAULT_ROLES as k, computeStructureSummary as l, friendlyUrlAbbrev as m, getAllFields as n, isMarkformError as nt, computeAllSummaries as o, isValidationError as ot, serializeReport as p, MarkformError as q, getFieldsForRoles as r, isParseError as rt, computeFormState as s, applyPatches as t, isLlmError as tt, isFormComplete as u, AGENT_ROLE as v, DEFAULT_MAX_TURNS as w, DEFAULT_MAX_PARALLEL_AGENTS as x, DEFAULT_FORMS_DIR as y, SUGGESTED_LLMS as z };
3898
+ //# sourceMappingURL=apply-BYgtU64w.mjs.map