markform 0.1.4 → 0.1.6

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 +110 -100
  2. package/dist/ai-sdk.d.mts +1 -1
  3. package/dist/ai-sdk.mjs +1 -1
  4. package/dist/{apply-C54EMAJ1.mjs → apply-DMQl-VVd.mjs} +6 -26
  5. package/dist/bin.mjs +4 -4
  6. package/dist/{cli-BhWhn6L9.mjs → cli-CXjkdym_.mjs} +83 -21
  7. package/dist/cli.mjs +4 -4
  8. package/dist/{coreTypes-cbNTYAcb.d.mts → coreTypes-9XZSNOv6.d.mts} +2 -2
  9. package/dist/index.d.mts +61 -7
  10. package/dist/index.mjs +2 -2
  11. package/dist/{shared-BqPnYXrn.mjs → shared-DRlgu2ZJ.mjs} +1 -1
  12. package/dist/{shared-CZsyShck.mjs → shared-u22MtBRo.mjs} +1 -1
  13. package/dist/{src-BNh7Cx9P.mjs → src-o_5TSoHQ.mjs} +105 -23
  14. package/docs/markform-apis.md +52 -1
  15. package/docs/markform-reference.md +19 -19
  16. package/docs/markform-spec.md +29 -20
  17. package/examples/earnings-analysis/earnings-analysis.form.md +86 -808
  18. package/examples/earnings-analysis/earnings-analysis.valid.ts +16 -148
  19. package/examples/movie-research/movie-research-basic.form.md +16 -16
  20. package/examples/movie-research/movie-research-deep.form.md +36 -36
  21. package/examples/movie-research/movie-research-minimal.form.md +4 -4
  22. package/examples/simple/simple-mock-filled.form.md +16 -16
  23. package/examples/simple/simple-skipped-filled.form.md +16 -16
  24. package/examples/simple/simple-with-skips.session.yaml +3 -3
  25. package/examples/simple/simple.form.md +16 -16
  26. package/examples/simple/simple.session.yaml +3 -3
  27. package/examples/startup-deep-research/startup-deep-research.form.md +22 -22
  28. package/examples/startup-research/startup-research-mock-filled.form.md +12 -12
  29. package/examples/startup-research/startup-research.form.md +12 -12
  30. package/package.json +1 -1
  31. package/examples/celebrity-deep-research/celebrity-deep-research.form.md +0 -967
@@ -118,12 +118,20 @@ Built on [Markdoc’s tag syntax specification][markdoc-spec] and
118
118
  ---
119
119
  markform:
120
120
  spec: MF/0.1
121
+ run_mode: research # optional: interactive | fill | research
121
122
  form_summary: { ... } # derived: structure summary
122
123
  form_progress: { ... } # derived: progress summary
123
124
  form_state: complete|incomplete|invalid|empty # derived: overall progress state
124
125
  ---
125
126
  ```
126
127
 
128
+ **Optional metadata fields:**
129
+
130
+ - `run_mode` (*recommended*): Suggests how CLI tools should execute this form. Values:
131
+ `interactive` (user fills via prompts), `fill` (agent fills), or `research` (agent
132
+ fills with web search). When omitted, tools may infer from field roles or require
133
+ explicit selection. This is a hint for tooling, not enforced by the engine.
134
+
127
135
  **Behavioral rules (*required*):**
128
136
 
129
137
  - *required:* `form_summary`, `form_progress`, and `form_state` are derived,
@@ -143,7 +151,7 @@ Data Model section for complete type definitions.
143
151
 
144
152
  IDs are organized into **two scoping levels** with different uniqueness requirements:
145
153
 
146
- **1. Structural IDs** (form, field-group, field):
154
+ **1. Structural IDs** (form, group, field):
147
155
 
148
156
  - *required:* Must be globally unique across the entire document
149
157
 
@@ -196,7 +204,7 @@ Markform defines its own scoping rules where option IDs are field-scoped.
196
204
 
197
205
  - `form` — the root container
198
206
 
199
- - `field-group` — containers for fields or nested groups
207
+ - `group` — containers for fields or nested groups
200
208
 
201
209
  #### Field Tags
202
210
 
@@ -494,7 +502,7 @@ Example values or usage...
494
502
 
495
503
  **Placement rules (MF/0.1):**
496
504
 
497
- - Doc blocks MAY appear inside `form` and `field-group` as direct children
505
+ - Doc blocks MAY appear inside `form` and `group` as direct children
498
506
 
499
507
  - *required:* Parser will reject doc blocks that appear inside field tag bodies (doc
500
508
  blocks MUST NOT be nested inside a field tag)
@@ -770,12 +778,12 @@ Analysis completed with partial data due to API limitations.
770
778
  ````md
771
779
  {% form id="quarterly_earnings" title="Quarterly Earnings Analysis" %}
772
780
 
773
- {% field-group id="company_info" title="Company Info" %}
781
+ {% group id="company_info" title="Company Info" %}
774
782
  {% field kind="string" id="company_name" label="Company name" state="skipped" %}
775
783
  ```value
776
784
  %SKIP% (Not applicable for this analysis type)
777
785
  ````
778
- {% /field %} {% /field-group %}
786
+ {% /field %} {% /group %}
779
787
 
780
788
  {% note id="n1" ref="quarterly_earnings" role="agent" %} Analysis completed with partial
781
789
  data due to API limitations.
@@ -846,35 +854,35 @@ markform:
846
854
  Prepare an earnings-call brief by extracting key financials and writing a thesis.
847
855
  {% /description %}
848
856
 
849
- {% field-group id="company_info" title="Company Info" %}
857
+ {% group id="company_info" title="Company Info" %}
850
858
  {% field kind="string" id="company_name" label="Company name" required=true %}{% /field %}
851
859
  {% field kind="string" id="ticker" label="Ticker" required=true %}{% /field %}
852
860
  {% field kind="string" id="fiscal_period" label="Fiscal period" required=true %}{% /field %}
853
- {% /field-group %}
861
+ {% /group %}
854
862
 
855
- {% field-group id="source_docs" title="Source Documents" %}
863
+ {% group id="source_docs" title="Source Documents" %}
856
864
  {% field kind="checkboxes" id="docs_reviewed" label="Documents reviewed" required=true %}
857
865
  - [ ] 10-K {% #ten_k %}
858
866
  - [ ] 10-Q {% #ten_q %}
859
867
  - [ ] Earnings release {% #earnings_release %}
860
868
  - [ ] Earnings call transcript {% #call_transcript %}
861
869
  {% /field %}
862
- {% /field-group %}
870
+ {% /group %}
863
871
 
864
- {% field-group id="financials" title="Key Financials" %}
872
+ {% group id="financials" title="Key Financials" %}
865
873
  {% field kind="number" id="revenue_m" label="Revenue (USD millions)" required=true %}{% /field %}
866
874
  {% field kind="number" id="gross_margin_pct" label="Gross margin (%)" %}{% /field %}
867
875
  {% field kind="number" id="eps_diluted" label="Diluted EPS" required=true %}{% /field %}
868
- {% /field-group %}
876
+ {% /group %}
869
877
 
870
- {% field-group id="analysis" title="Analysis" %}
878
+ {% group id="analysis" title="Analysis" %}
871
879
  {% field kind="single_select" id="rating" label="Overall rating" required=true %}
872
880
  - [ ] Bullish {% #bullish %}
873
881
  - [ ] Neutral {% #neutral %}
874
882
  - [ ] Bearish {% #bearish %}
875
883
  {% /field %}
876
884
  {% field kind="string" id="thesis" label="Investment thesis" required=true %}{% /field %}
877
- {% /field-group %}
885
+ {% /group %}
878
886
 
879
887
  {% /form %}
880
888
  ````
@@ -886,7 +894,7 @@ Hand-authored forms only need the `spec` field.
886
894
  #### Example: Incomplete Form
887
895
 
888
896
  ````md
889
- {% field-group id="company_info" title="Company Info" %}
897
+ {% group id="company_info" title="Company Info" %}
890
898
  {% field kind="string" id="company_name" label="Company name" required=true %}
891
899
  ```value
892
900
  ACME Corp
@@ -896,9 +904,9 @@ ACME Corp
896
904
  ACME
897
905
  ```
898
906
  {% /field %} {% field kind="string" id="fiscal_period" label="Fiscal period"
899
- required=true %}{% /field %} {% /field-group %}
907
+ required=true %}{% /field %} {% /group %}
900
908
 
901
- {% field-group id="source_docs" title="Source Documents" %} {% checkboxes
909
+ {% group id="source_docs" title="Source Documents" %} {% checkboxes
902
910
  id="docs_reviewed" label="Documents reviewed" required=true %}
903
911
 
904
912
  - [x] 10-K {% #ten_k %}
@@ -907,7 +915,7 @@ id="docs_reviewed" label="Documents reviewed" required=true %}
907
915
 
908
916
  - [/] Earnings release {% #earnings_release %}
909
917
 
910
- - [ ] Earnings call transcript {% #call_transcript %} {% /field %} {% /field-group
918
+ - [ ] Earnings call transcript {% #call_transcript %} {% /field %} {% /group
911
919
  %}
912
920
  ````
913
921
 
@@ -1343,6 +1351,7 @@ interface FormMetadata {
1343
1351
  markformVersion: string;
1344
1352
  roles: string[]; // available roles for field assignment
1345
1353
  roleInstructions: Record<string, string>; // instructions per role
1354
+ runMode?: 'interactive' | 'fill' | 'research'; // optional: hint for CLI tools
1346
1355
  }
1347
1356
 
1348
1357
  // ParsedForm: canonical internal representation returned by parseForm()
@@ -1399,7 +1408,7 @@ Describes the static structure of the form schema:
1399
1408
  type FieldKind = 'string' | 'number' | 'string_list' | 'checkboxes' | 'single_select' | 'multi_select' | 'url' | 'url_list';
1400
1409
 
1401
1410
  interface StructureSummary {
1402
- groupCount: number; // total field-groups
1411
+ groupCount: number; // total groups
1403
1412
  fieldCount: number; // total fields (all kinds)
1404
1413
  optionCount: number; // total options across all select/checkbox fields
1405
1414
 
@@ -2051,7 +2060,7 @@ A completed form must have all checkbox options resolved to either `done` or `na
2051
2060
 
2052
2061
  **Field group `required` attribute:**
2053
2062
 
2054
- The `required` attribute on `field-group` is **not supported in MF/0.1**. Groups may
2063
+ The `required` attribute on `group` is **not supported in MF/0.1**. Groups may
2055
2064
  have `validate` references for custom validation, but the `required` attribute should
2056
2065
  not be used on groups.
2057
2066
  If present, it is ignored with a warning.
@@ -2165,7 +2174,7 @@ export const validators: Record<string, (ctx: ValidatorContext) => ValidationIss
2165
2174
 
2166
2175
  <!-- Sum-to validator with configurable target -->
2167
2176
 
2168
- {% field-group id="scenarios" validate=[{id: "sum_to", fields: ["base_prob", "bull_prob", "bear_prob"], target: 100}] %}
2177
+ {% group id="scenarios" validate=[{id: "sum_to", fields: ["base_prob", "bull_prob", "bear_prob"], target: 100}] %}
2169
2178
  ```
2170
2179
 
2171
2180
  **Runtime loading (engine):**