markform 0.1.20 → 0.1.22

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 (58) hide show
  1. package/README.md +44 -12
  2. package/dist/ai-sdk.d.mts +1 -1
  3. package/dist/ai-sdk.mjs +2 -2
  4. package/dist/{apply-DIvm1b1s.mjs → apply-C7mO7VkZ.mjs} +158 -95
  5. package/dist/apply-C7mO7VkZ.mjs.map +1 -0
  6. package/dist/bin.mjs +1 -1
  7. package/dist/{cli-FFMoEhFS.mjs → cli-C8F9yDsv.mjs} +102 -1225
  8. package/dist/cli-C8F9yDsv.mjs.map +1 -0
  9. package/dist/cli.mjs +1 -1
  10. package/dist/{coreTypes-CkxML8g2.d.mts → coreTypes-BlsJkU1w.d.mts} +28 -2
  11. package/dist/{coreTypes-CPKXf2dc.mjs → coreTypes-CTLr-NGd.mjs} +24 -3
  12. package/dist/coreTypes-CTLr-NGd.mjs.map +1 -0
  13. package/dist/fillRecord-DTl5lnK0.d.mts +345 -0
  14. package/dist/fillRecordRenderer-CruJrLkj.mjs +1256 -0
  15. package/dist/fillRecordRenderer-CruJrLkj.mjs.map +1 -0
  16. package/dist/index.d.mts +22 -342
  17. package/dist/index.mjs +5 -5
  18. package/dist/render.d.mts +74 -0
  19. package/dist/render.mjs +4 -0
  20. package/dist/{session-CK0x28RO.mjs → session-BCcltrLA.mjs} +2 -2
  21. package/dist/{session-CK0x28RO.mjs.map → session-BCcltrLA.mjs.map} +1 -1
  22. package/dist/{session-ZHBi3LVQ.mjs → session-VeSkVrck.mjs} +1 -1
  23. package/dist/{shared-DwdyWmvE.mjs → shared-CsdT2T7k.mjs} +1 -1
  24. package/dist/{shared-DwdyWmvE.mjs.map → shared-CsdT2T7k.mjs.map} +1 -1
  25. package/dist/{shared-BTR35aMz.mjs → shared-fb0nkzQi.mjs} +1 -1
  26. package/dist/{src-wR7GoftB.mjs → src-CbRnGzMK.mjs} +205 -138
  27. package/dist/src-CbRnGzMK.mjs.map +1 -0
  28. package/dist/urlFormat-lls7CsEP.mjs +71 -0
  29. package/dist/urlFormat-lls7CsEP.mjs.map +1 -0
  30. package/docs/markform-apis.md +53 -0
  31. package/examples/movie-research/movie-deep-research-mock-filled.form.md +320 -343
  32. package/examples/movie-research/movie-deep-research.form.md +273 -308
  33. package/examples/movie-research/movie-research-demo.form.md +27 -41
  34. package/examples/parallel/parallel-research.form.md +33 -29
  35. package/examples/parallel/parallel-research.mock.filled.form.md +88 -0
  36. package/examples/rejection-test/rejection-test-mock-filled.form.md +21 -16
  37. package/examples/rejection-test/rejection-test-mock-filled.schema.json +1 -1
  38. package/examples/rejection-test/rejection-test.form.md +17 -15
  39. package/examples/rejection-test/rejection-test.session.yaml +88 -60
  40. package/examples/simple/simple-mock-filled.form.md +113 -126
  41. package/examples/simple/simple-mock-filled.schema.json +2 -3
  42. package/examples/simple/simple-skipped-filled.form.md +112 -129
  43. package/examples/simple/simple-skipped-filled.report.md +8 -8
  44. package/examples/simple/simple-skipped-filled.schema.json +2 -3
  45. package/examples/simple/simple-tags-syntax.form.md +32 -0
  46. package/examples/simple/simple-with-skips.session.yaml +663 -627
  47. package/examples/simple/simple.form.md +97 -113
  48. package/examples/simple/simple.schema.json +2 -3
  49. package/examples/simple/simple.session.yaml +663 -627
  50. package/examples/startup-deep-research/startup-deep-research.form.md +191 -235
  51. package/examples/startup-research/startup-research-mock-filled.form.md +128 -147
  52. package/examples/startup-research/startup-research.form.md +90 -129
  53. package/examples/twitter-thread/twitter-thread.form.md +373 -0
  54. package/package.json +5 -1
  55. package/dist/apply-DIvm1b1s.mjs.map +0 -1
  56. package/dist/cli-FFMoEhFS.mjs.map +0 -1
  57. package/dist/coreTypes-CPKXf2dc.mjs.map +0 -1
  58. package/dist/src-wR7GoftB.mjs.map +0 -1
@@ -1,244 +1,227 @@
1
1
  ---
2
2
  markform:
3
- spec: "MF/0.1"
3
+ spec: MF/0.1
4
4
  title: Simple Test Form
5
- description: "Fully interactive demo - no LLM required. Demonstrates all Markform field types."
5
+ description: Fully interactive demo - no LLM required. Demonstrates all Markform field types.
6
6
  roles:
7
7
  - user
8
8
  role_instructions:
9
- user: "Fill in all fields in this form."
9
+ user: Fill in all fields in this form.
10
10
  ---
11
- {% form id="simple_test" title="Simple Test Form" %}
12
11
 
13
- {% description ref="simple_test" %}
12
+ <!-- form id="simple_test" title="Simple Test Form" -->
13
+
14
+ <!-- description ref="simple_test" -->
14
15
  A fully interactive form demonstrating all Markform v0.1 field types.
15
16
  Fill all fields using interactive prompts - no LLM API key needed.
16
- {% /description %}
17
+ <!-- /description -->
17
18
 
18
- {% group id="basic_fields" title="Basic Fields" %}
19
+ <!-- group id="basic_fields" title="Basic Fields" -->
19
20
 
20
- {% field kind="string" id="name" label="Name" maxLength=50 minLength=2 required=true role="user" placeholder="Enter your name" examples=["John Smith", "Jane Doe"] %}
21
+ <!-- field kind="string" id="name" role="user" examples=["John Smith", "Jane Doe"] label="Name" maxLength=50 minLength=2 placeholder="Enter your name" required=true -->
21
22
  ```value
22
23
  Test User
23
24
  ```
24
- {% /field %}
25
+ <!-- /field -->
25
26
 
26
- {% instructions ref="name" %}
27
+ <!-- instructions ref="name" -->
27
28
  Enter your full name (2-50 characters).
28
- {% /instructions %}
29
+ <!-- /instructions -->
29
30
 
30
- {% field kind="string" id="email" label="Email" pattern="^[^@]+@[^@]+\\.[^@]+$" required=true role="user" placeholder="email@example.com" examples=["alice@company.com", "bob@example.org"] %}
31
+ <!-- field kind="string" id="email" role="user" examples=["alice@company.com", "bob@example.org"] label="Email" pattern="^[^@]+@[^@]+\\.[^@]+$" placeholder="email@example.com" required=true -->
31
32
  ```value
32
33
  test@example.com
33
34
  ```
34
- {% /field %}
35
+ <!-- /field -->
35
36
 
36
- {% field kind="number" id="age" integer=true label="Age" max=150 min=0 required=true role="user" placeholder="25" examples=["18", "30", "45"] %}
37
+ <!-- field kind="number" id="age" role="user" examples=["18", "30", "45"] integer=true label="Age" max=150 min=0 placeholder="25" required=true -->
37
38
  ```value
38
39
  25
39
40
  ```
40
- {% /field %}
41
+ <!-- /field -->
41
42
 
42
- {% field kind="number" id="score" label="Score" max=100 min=0 role="user" state="skipped" placeholder="85.5" examples=["75.0", "90.5", "100.0"] %}
43
+ <!-- field kind="number" id="score" role="user" examples=["75.0", "90.5", "100.0"] label="Score" max=100 min=0 placeholder="85.5" state="skipped" -->
43
44
  ```value
44
45
  %SKIP% (Not needed for this test)
45
46
  ```
46
- {% /field %}
47
+ <!-- /field -->
47
48
 
48
- {% instructions ref="score" %}
49
+ <!-- instructions ref="score" -->
49
50
  Enter a score between 0 and 100 (optional).
50
- {% /instructions %}
51
+ <!-- /instructions -->
51
52
 
52
- {% /group %}
53
+ <!-- /group -->
53
54
 
54
- {% group id="list_fields" title="List Fields" %}
55
+ <!-- group id="list_fields" title="List Fields" -->
55
56
 
56
- {% field kind="string_list" id="tags" itemMinLength=2 label="Tags" maxItems=5 minItems=1 required=true role="user" uniqueItems=true %}
57
+ <!-- field kind="string_list" id="tags" role="user" itemMinLength=2 label="Tags" maxItems=5 minItems=1 required=true uniqueItems=true -->
57
58
  ```value
58
59
  typescript
59
60
  testing
60
61
  ```
61
- {% /field %}
62
+ <!-- /field -->
62
63
 
63
- {% instructions ref="tags" %}
64
+ <!-- instructions ref="tags" -->
64
65
  Add 1-5 unique tags (each at least 2 characters).
65
- {% /instructions %}
66
-
67
- {% /group %}
68
-
69
- {% group id="selection_fields" title="Selection Fields" %}
70
-
71
- {% field kind="single_select" id="priority" label="Priority" required=true role="user" %}
72
-
73
- - [ ] Low {% #low %}
74
- - [ ] Medium {% #medium %}
75
- - [x] High {% #high %}
66
+ <!-- /instructions -->
76
67
 
77
- {% /field %}
68
+ <!-- /group -->
78
69
 
79
- {% field kind="multi_select" id="categories" label="Categories" maxSelections=3 minSelections=1 required=true role="user" %}
70
+ <!-- group id="selection_fields" title="Selection Fields" -->
80
71
 
81
- - [x] Frontend {% #frontend %}
82
- - [x] Backend {% #backend %}
83
- - [ ] Database {% #database %}
84
- - [ ] DevOps {% #devops %}
72
+ <!-- field kind="single_select" id="priority" role="user" label="Priority" required=true -->
73
+ - [ ] Low <!-- #low -->
74
+ - [ ] Medium <!-- #medium -->
75
+ - [x] High <!-- #high -->
76
+ <!-- /field -->
85
77
 
86
- {% /field %}
78
+ <!-- field kind="multi_select" id="categories" role="user" label="Categories" maxSelections=3 minSelections=1 required=true -->
79
+ - [x] Frontend <!-- #frontend -->
80
+ - [x] Backend <!-- #backend -->
81
+ - [ ] Database <!-- #database -->
82
+ - [ ] DevOps <!-- #devops -->
83
+ <!-- /field -->
87
84
 
88
- {% /group %}
85
+ <!-- /group -->
89
86
 
90
- {% group id="checkbox_fields" title="Checkbox Fields" %}
87
+ <!-- group id="checkbox_fields" title="Checkbox Fields" -->
91
88
 
92
- {% field kind="checkboxes" id="tasks_multi" label="Tasks (Multi Mode)" required=true role="user" %}
89
+ <!-- field kind="checkboxes" id="tasks_multi" role="user" label="Tasks (Multi Mode)" required=true -->
90
+ - [x] Research <!-- #research -->
91
+ - [x] Design <!-- #design -->
92
+ - [x] Implement <!-- #implement -->
93
+ - [-] Test <!-- #test -->
94
+ <!-- /field -->
93
95
 
94
- - [x] Research {% #research %}
95
- - [x] Design {% #design %}
96
- - [x] Implement {% #implement %}
97
- - [-] Test {% #test %}
98
-
99
- {% /field %}
100
-
101
- {% instructions ref="tasks_multi" %}
96
+ <!-- instructions ref="tasks_multi" -->
102
97
  Track task progress.
103
98
  All must reach done or na state to complete.
104
- {% /instructions %}
105
-
106
- {% field kind="checkboxes" checkboxMode="simple" id="tasks_simple" label="Agreements (Simple Mode)" required=true role="user" %}
107
-
108
- - [x] I have read the guidelines {% #read_guidelines %}
109
- - [x] I agree to the terms {% #agree_terms %}
99
+ <!-- /instructions -->
110
100
 
111
- {% /field %}
101
+ <!-- field kind="checkboxes" id="tasks_simple" role="user" checkboxMode="simple" label="Agreements (Simple Mode)" required=true -->
102
+ - [x] I have read the guidelines <!-- #read_guidelines -->
103
+ - [x] I agree to the terms <!-- #agree_terms -->
104
+ <!-- /field -->
112
105
 
113
- {% field kind="checkboxes" checkboxMode="explicit" id="confirmations" label="Confirmations (Explicit Mode)" required=true role="user" %}
106
+ <!-- field kind="checkboxes" id="confirmations" role="user" checkboxMode="explicit" label="Confirmations (Explicit Mode)" required=true -->
107
+ - [y] Data has been backed up <!-- #backed_up -->
108
+ - [n] Stakeholders notified <!-- #notified -->
109
+ <!-- /field -->
114
110
 
115
- - [y] Data has been backed up {% #backed_up %}
116
- - [n] Stakeholders notified {% #notified %}
117
-
118
- {% /field %}
119
-
120
- {% instructions ref="confirmations" %}
111
+ <!-- instructions ref="confirmations" -->
121
112
  Answer yes or no for each confirmation.
122
113
  All must be explicitly answered.
123
- {% /instructions %}
114
+ <!-- /instructions -->
124
115
 
125
- {% /group %}
116
+ <!-- /group -->
126
117
 
127
- {% group id="url_fields" title="URL Fields" %}
118
+ <!-- group id="url_fields" title="URL Fields" -->
128
119
 
129
- {% field kind="url" id="website" label="Website" required=true role="user" placeholder="https://example.com" examples=["https://github.com/user/repo", "https://company.com"] %}
120
+ <!-- field kind="url" id="website" role="user" examples=["https://github.com/user/repo", "https://company.com"] label="Website" placeholder="https://example.com" required=true -->
130
121
  ```value
131
122
  https://test.example.com
132
123
  ```
133
- {% /field %}
124
+ <!-- /field -->
134
125
 
135
- {% instructions ref="website" %}
126
+ <!-- instructions ref="website" -->
136
127
  Enter your website URL (must be http or https).
137
- {% /instructions %}
128
+ <!-- /instructions -->
138
129
 
139
- {% field kind="url_list" id="references" label="References" maxItems=5 minItems=1 role="user" uniqueItems=true placeholder="https://docs.example.com" examples=["https://wikipedia.org/wiki/Example", "https://docs.github.com/en"] %}
130
+ <!-- field kind="url_list" id="references" role="user" examples=["https://wikipedia.org/wiki/Example", "https://docs.github.com/en"] label="References" maxItems=5 minItems=1 placeholder="https://docs.example.com" uniqueItems=true -->
140
131
  ```value
141
132
  https://docs.example.com
142
133
  ```
143
- {% /field %}
134
+ <!-- /field -->
144
135
 
145
- {% instructions ref="references" %}
136
+ <!-- instructions ref="references" -->
146
137
  Add 1-5 unique reference URLs for sources or documentation.
147
- {% /instructions %}
138
+ <!-- /instructions -->
148
139
 
149
- {% /group %}
140
+ <!-- /group -->
150
141
 
151
- {% group id="date_fields" title="Date and Year Fields" %}
142
+ <!-- group id="date_fields" title="Date and Year Fields" -->
152
143
 
153
- {% field kind="date" id="event_date" label="Event Date" max="2030-12-31" min="2020-01-01" required=true role="user" %}
144
+ <!-- field kind="date" id="event_date" role="user" label="Event Date" max="2030-12-31" min="2020-01-01" required=true -->
154
145
  ```value
155
146
  2025-03-15
156
147
  ```
157
- {% /field %}
148
+ <!-- /field -->
158
149
 
159
- {% instructions ref="event_date" %}
150
+ <!-- instructions ref="event_date" -->
160
151
  Enter the event date (YYYY-MM-DD format, between 2020 and 2030).
161
- {% /instructions %}
152
+ <!-- /instructions -->
162
153
 
163
- {% field kind="year" id="founded_year" label="Founded Year" max=2030 min=1900 required=true role="user" %}
154
+ <!-- field kind="year" id="founded_year" role="user" label="Founded Year" max=2030 min=1900 required=true -->
164
155
  ```value
165
156
  2021
166
157
  ```
167
- {% /field %}
158
+ <!-- /field -->
168
159
 
169
- {% instructions ref="founded_year" %}
160
+ <!-- instructions ref="founded_year" -->
170
161
  Enter the year the company was founded (1900-2030).
171
- {% /instructions %}
172
-
173
- {% /group %}
162
+ <!-- /instructions -->
174
163
 
175
- {% group id="table_fields" title="Table Fields" %}
164
+ <!-- /group -->
176
165
 
177
- {% field kind="table" id="team_members" label="Team Members" role="user" minRows=0 maxRows=5 state="skipped" columnIds=["name", "role", "start_date"] columnTypes=[{type: "string", required: true}, "string", "date"] %}
166
+ <!-- group id="table_fields" title="Table Fields" -->
178
167
 
179
- | Name | Role | Start Date |
180
- |------|------|------------|
168
+ <!-- field kind="table" id="team_members" role="user" columnIds=["name", "role", "start_date"] columnLabels=["Name", "Role", "Start Date"] columnTypes=[{type: "string", required: true}, "string", "date"] label="Team Members" maxRows=5 minRows=0 state="skipped" --><!-- /field -->
181
169
 
182
- {% /field %}
183
-
184
- {% instructions ref="team_members" %}
170
+ <!-- instructions ref="team_members" -->
185
171
  Add team members with their name (required), role, and start date.
186
- {% /instructions %}
187
-
188
- {% field kind="table" id="project_tasks" label="Project Tasks" role="user" minRows=0 maxRows=10 state="skipped" columnIds=["task", "estimate_hrs", "link"] columnTypes=[{type: "string", required: true}, "number", "url"] %}
172
+ <!-- /instructions -->
189
173
 
190
- | Task | Estimate (hrs) | Link |
191
- |------|----------------|------|
174
+ <!-- field kind="table" id="project_tasks" role="user" columnIds=["task", "estimate_hrs", "link"] columnLabels=["Task", "Estimate (hrs)", "Link"] columnTypes=[{type: "string", required: true}, "number", "url"] label="Project Tasks" maxRows=10 minRows=0 state="skipped" --><!-- /field -->
192
175
 
193
- {% /field %}
194
-
195
- {% instructions ref="project_tasks" %}
176
+ <!-- instructions ref="project_tasks" -->
196
177
  Optionally add project tasks with estimated hours and reference links.
197
- {% /instructions %}
178
+ <!-- /instructions -->
198
179
 
199
- {% /group %}
180
+ <!-- /group -->
200
181
 
201
- {% group id="optional_fields" title="Optional Fields" %}
182
+ <!-- group id="optional_fields" title="Optional Fields" -->
202
183
 
203
- {% field kind="string" id="notes" label="Notes" role="user" state="skipped" %}
184
+ <!-- field kind="string" id="notes" role="user" label="Notes" state="skipped" -->
204
185
  ```value
205
186
  %SKIP% (No notes required)
206
187
  ```
207
- {% /field %}
188
+ <!-- /field -->
208
189
 
209
- {% instructions ref="notes" %}
190
+ <!-- instructions ref="notes" -->
210
191
  Add any relevant notes or observations (optional).
211
- {% /instructions %}
192
+ <!-- /instructions -->
212
193
 
213
- {% field kind="number" id="optional_number" label="Optional Number" role="user" state="skipped" %}{% /field %}
194
+ <!-- field kind="number" id="optional_number" role="user" label="Optional Number" state="skipped" --><!-- /field -->
214
195
 
215
- {% field kind="url" id="related_url" label="Related URL" role="user" state="skipped" %}
196
+ <!-- field kind="url" id="related_url" role="user" label="Related URL" state="skipped" -->
216
197
  ```value
217
198
  %SKIP% (No related URL needed)
218
199
  ```
219
- {% /field %}
200
+ <!-- /field -->
220
201
 
221
- {% instructions ref="related_url" %}
202
+ <!-- instructions ref="related_url" -->
222
203
  Optionally add a URL to related documentation or resources.
223
- {% /instructions %}
204
+ <!-- /instructions -->
224
205
 
225
- {% field kind="date" id="optional_date" label="Optional Date" role="user" state="skipped" %}{% /field %}
206
+ <!-- field kind="date" id="optional_date" role="user" label="Optional Date" state="skipped" --><!-- /field -->
226
207
 
227
- {% instructions ref="optional_date" %}
208
+ <!-- instructions ref="optional_date" -->
228
209
  Optionally add a date (YYYY-MM-DD format).
229
- {% /instructions %}
210
+ <!-- /instructions -->
230
211
 
231
- {% field kind="year" id="optional_year" label="Optional Year" role="user" state="skipped" %}{% /field %}
212
+ <!-- field kind="year" id="optional_year" role="user" label="Optional Year" state="skipped" --><!-- /field -->
232
213
 
233
- {% instructions ref="optional_year" %}
214
+ <!-- instructions ref="optional_year" -->
234
215
  Optionally add a year.
235
- {% /instructions %}
216
+ <!-- /instructions -->
217
+
218
+ <!-- /group -->
219
+
220
+ <!-- note id="note-summary" role="user" ref="simple_test" -->
221
+ All required fields completed successfully.Optional fields skipped.
222
+ <!-- /note -->
223
+
224
+ <!-- /form -->
236
225
 
237
- {% /group %}
238
226
 
239
- {% note id="note-summary" ref="simple_test" role="user" %}
240
- All required fields completed successfully.
241
- Optional fields skipped.
242
- {% /note %}
243
227
 
244
- {% /form %}
@@ -19,7 +19,7 @@ test@example.com
19
19
 
20
20
  **Score:**
21
21
 
22
- _(empty)_
22
+ _(skipped: Not needed for this test)_
23
23
 
24
24
  ## List Fields
25
25
 
@@ -84,30 +84,30 @@ High
84
84
 
85
85
  **Team Members:**
86
86
 
87
- _(empty)_
87
+ _(skipped)_
88
88
 
89
89
  **Project Tasks:**
90
90
 
91
- _(empty)_
91
+ _(skipped)_
92
92
 
93
93
  ## Optional Fields
94
94
 
95
95
  **Notes:**
96
96
 
97
- _(empty)_
97
+ _(skipped: No notes required)_
98
98
 
99
99
  **Optional Number:**
100
100
 
101
- _(empty)_
101
+ _(skipped)_
102
102
 
103
103
  **Related URL:**
104
104
 
105
- _(empty)_
105
+ _(skipped: No related URL needed)_
106
106
 
107
107
  **Optional Date:**
108
108
 
109
- _(empty)_
109
+ _(skipped)_
110
110
 
111
111
  **Optional Year:**
112
112
 
113
- _(empty)_
113
+ _(skipped)_
@@ -387,10 +387,9 @@
387
387
  ],
388
388
  "x-markform": {
389
389
  "spec": "MF/0.1",
390
- "roles": ["user", "agent"],
390
+ "roles": ["user"],
391
391
  "roleInstructions": {
392
- "user": "Fill in the fields you have direct knowledge of.",
393
- "agent": "Complete the remaining fields based on the provided context."
392
+ "user": "Fill in all fields in this form."
394
393
  },
395
394
  "groups": [
396
395
  {
@@ -0,0 +1,32 @@
1
+ ---
2
+ markform:
3
+ spec: MF/0.1
4
+ title: Simple Form (Tags Syntax)
5
+ description: "Same as simple.form.md but using Markdoc tag syntax for testing purposes."
6
+ run_mode: interactive
7
+ roles:
8
+ - user
9
+ role_instructions:
10
+ user: "Fill in all fields in this form."
11
+ ---
12
+
13
+ {% form id="simple_test" title="Simple Test Form" %}
14
+
15
+ {% description ref="simple_test" %}
16
+ A simple form demonstrating Markdoc tag syntax.
17
+ This file is used for testing the --syntax=tags validation option.
18
+ {% /description %}
19
+
20
+ {% group id="basic_fields" title="Basic Fields" %}
21
+
22
+ {% field kind="string" id="name" role="user" examples=["John Smith", "Jane Doe"] label="Name" maxLength=50 minLength=2 placeholder="Enter your name" required=true %}{% /field %}
23
+
24
+ {% instructions ref="name" %}
25
+ Enter your full name as you want it to appear.
26
+ {% /instructions %}
27
+
28
+ {% field kind="string" id="email" role="user" label="Email" pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" placeholder="user@example.com" required=true %}{% /field %}
29
+
30
+ {% /group %}
31
+
32
+ {% /form %}