markform 0.1.0 → 0.1.2

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 (37) hide show
  1. package/DOCS.md +546 -0
  2. package/README.md +484 -45
  3. package/SPEC.md +2779 -0
  4. package/dist/ai-sdk.d.mts +2 -2
  5. package/dist/ai-sdk.mjs +5 -3
  6. package/dist/{apply-C0vjijlP.mjs → apply-BfAGTHMh.mjs} +1044 -593
  7. package/dist/bin.mjs +6 -3
  8. package/dist/cli-B3NVm6zL.mjs +3904 -0
  9. package/dist/cli.mjs +6 -3
  10. package/dist/{coreTypes-T7dAuewt.d.mts → coreTypes-BXhhz9Iq.d.mts} +2795 -685
  11. package/dist/coreTypes-Dful87E0.mjs +537 -0
  12. package/dist/index.d.mts +196 -18
  13. package/dist/index.mjs +5 -3
  14. package/dist/session-Bqnwi9wp.mjs +110 -0
  15. package/dist/session-DdAtY2Ni.mjs +4 -0
  16. package/dist/shared-D7gf27Tr.mjs +3 -0
  17. package/dist/shared-N_s1M-_K.mjs +176 -0
  18. package/dist/src-BXRkGFpG.mjs +7587 -0
  19. package/examples/celebrity-deep-research/celebrity-deep-research.form.md +912 -0
  20. package/examples/earnings-analysis/earnings-analysis.form.md +6 -1
  21. package/examples/earnings-analysis/earnings-analysis.valid.ts +119 -59
  22. package/examples/movie-research/movie-research-basic.form.md +164 -0
  23. package/examples/movie-research/movie-research-deep.form.md +486 -0
  24. package/examples/movie-research/movie-research-minimal.form.md +73 -0
  25. package/examples/simple/simple-mock-filled.form.md +52 -12
  26. package/examples/simple/simple-skipped-filled.form.md +170 -0
  27. package/examples/simple/simple-with-skips.session.yaml +189 -0
  28. package/examples/simple/simple.form.md +34 -12
  29. package/examples/simple/simple.session.yaml +80 -37
  30. package/examples/startup-deep-research/startup-deep-research.form.md +456 -0
  31. package/examples/startup-research/startup-research-mock-filled.form.md +307 -0
  32. package/examples/startup-research/startup-research.form.md +211 -0
  33. package/package.json +11 -5
  34. package/dist/cli-9fvFySww.mjs +0 -2564
  35. package/dist/src-DBD3Dt4f.mjs +0 -1785
  36. package/examples/political-research/political-research.form.md +0 -233
  37. package/examples/political-research/political-research.mock.lincoln.form.md +0 -355
@@ -0,0 +1,170 @@
1
+ ---
2
+ markform:
3
+ spec: "MF/0.1"
4
+ title: Simple Test Form
5
+ description: "Fully interactive demo - no LLM required. Demonstrates all Markform field types."
6
+ roles:
7
+ - user
8
+ role_instructions:
9
+ user: "Fill in all fields in this form."
10
+ ---
11
+
12
+ {% form id="simple_test" title="Simple Test Form" %}
13
+
14
+ {% description ref="simple_test" %}
15
+ A fully interactive form demonstrating all Markform v0.1 field types.
16
+ Fill all fields using interactive prompts - no LLM API key needed.
17
+ {% /description %}
18
+
19
+ {% field-group id="basic_fields" title="Basic Fields" %}
20
+
21
+ {% string-field id="name" label="Name" maxLength=50 minLength=2 required=true role="user" %}
22
+ ```value
23
+ Test User
24
+ ```
25
+ {% /string-field %}
26
+
27
+ {% instructions ref="name" %}
28
+ Enter your full name (2-50 characters).
29
+ {% /instructions %}
30
+
31
+ {% string-field id="email" label="Email" pattern="^[^@]+@[^@]+\\.[^@]+$" required=true role="user" %}
32
+ ```value
33
+ test@example.com
34
+ ```
35
+ {% /string-field %}
36
+
37
+ {% number-field id="age" integer=true label="Age" max=150 min=0 required=true role="user" %}
38
+ ```value
39
+ 25
40
+ ```
41
+ {% /number-field %}
42
+
43
+ {% number-field id="score" label="Score" max=100 min=0 role="user" state="skipped" %}
44
+ ```value
45
+ %SKIP% (Not needed for this test)
46
+ ```
47
+ {% /number-field %}
48
+
49
+ {% instructions ref="score" %}
50
+ Enter a score between 0 and 100 (optional).
51
+ {% /instructions %}
52
+
53
+ {% /field-group %}
54
+
55
+ {% field-group id="list_fields" title="List Fields" %}
56
+
57
+ {% string-list id="tags" itemMinLength=2 label="Tags" maxItems=5 minItems=1 required=true role="user" uniqueItems=true %}
58
+ ```value
59
+ typescript
60
+ testing
61
+ ```
62
+ {% /string-list %}
63
+
64
+ {% instructions ref="tags" %}
65
+ Add 1-5 unique tags (each at least 2 characters).
66
+ {% /instructions %}
67
+
68
+ {% /field-group %}
69
+
70
+ {% field-group id="selection_fields" title="Selection Fields" %}
71
+
72
+ {% single-select id="priority" label="Priority" required=true role="user" %}
73
+ - [ ] Low {% #low %}
74
+ - [ ] Medium {% #medium %}
75
+ - [x] High {% #high %}
76
+ {% /single-select %}
77
+
78
+ {% multi-select id="categories" label="Categories" maxSelections=3 minSelections=1 required=true role="user" %}
79
+ - [x] Frontend {% #frontend %}
80
+ - [x] Backend {% #backend %}
81
+ - [ ] Database {% #database %}
82
+ - [ ] DevOps {% #devops %}
83
+ {% /multi-select %}
84
+
85
+ {% /field-group %}
86
+
87
+ {% field-group id="checkbox_fields" title="Checkbox Fields" %}
88
+
89
+ {% checkboxes id="tasks_multi" label="Tasks (Multi Mode)" required=true role="user" %}
90
+ - [x] Research {% #research %}
91
+ - [x] Design {% #design %}
92
+ - [x] Implement {% #implement %}
93
+ - [-] Test {% #test %}
94
+ {% /checkboxes %}
95
+
96
+ {% instructions ref="tasks_multi" %}
97
+ Track task progress. All must reach done or na state to complete.
98
+ {% /instructions %}
99
+
100
+ {% checkboxes checkboxMode="simple" id="tasks_simple" label="Agreements (Simple Mode)" required=true role="user" %}
101
+ - [x] I have read the guidelines {% #read_guidelines %}
102
+ - [x] I agree to the terms {% #agree_terms %}
103
+ {% /checkboxes %}
104
+
105
+ {% checkboxes checkboxMode="explicit" id="confirmations" label="Confirmations (Explicit Mode)" required=true role="user" %}
106
+ - [y] Data has been backed up {% #backed_up %}
107
+ - [n] Stakeholders notified {% #notified %}
108
+ {% /checkboxes %}
109
+
110
+ {% instructions ref="confirmations" %}
111
+ Answer yes or no for each confirmation. All must be explicitly answered.
112
+ {% /instructions %}
113
+
114
+ {% /field-group %}
115
+
116
+ {% field-group id="url_fields" title="URL Fields" %}
117
+
118
+ {% url-field id="website" label="Website" required=true role="user" %}
119
+ ```value
120
+ https://test.example.com
121
+ ```
122
+ {% /url-field %}
123
+
124
+ {% instructions ref="website" %}
125
+ Enter your website URL (must be http or https).
126
+ {% /instructions %}
127
+
128
+ {% url-list id="references" label="References" maxItems=5 minItems=1 role="user" uniqueItems=true %}
129
+ ```value
130
+ https://docs.example.com
131
+ ```
132
+ {% /url-list %}
133
+
134
+ {% instructions ref="references" %}
135
+ Add 1-5 unique reference URLs for sources or documentation.
136
+ {% /instructions %}
137
+
138
+ {% /field-group %}
139
+
140
+ {% field-group id="optional_fields" title="Optional Fields" %}
141
+
142
+ {% string-field id="notes" label="Notes" role="user" state="skipped" %}
143
+ ```value
144
+ %SKIP% (No notes required)
145
+ ```
146
+ {% /string-field %}
147
+
148
+ {% instructions ref="notes" %}
149
+ Add any relevant notes or observations (optional).
150
+ {% /instructions %}
151
+
152
+ {% number-field id="optional_number" label="Optional Number" role="user" state="skipped" %}{% /number-field %}
153
+
154
+ {% url-field id="related_url" label="Related URL" role="user" state="skipped" %}
155
+ ```value
156
+ %SKIP% (No related URL needed)
157
+ ```
158
+ {% /url-field %}
159
+
160
+ {% instructions ref="related_url" %}
161
+ Optionally add a URL to related documentation or resources.
162
+ {% /instructions %}
163
+
164
+ {% /field-group %}
165
+
166
+ {% note id="note-summary" ref="simple_test" role="user" %}
167
+ All required fields completed successfully. Optional fields skipped.
168
+ {% /note %}
169
+
170
+ {% /form %}
@@ -0,0 +1,189 @@
1
+ session_version: 0.1.0
2
+ mode: mock
3
+ form:
4
+ path: simple.form.md
5
+ mock:
6
+ completed_mock: simple-skipped-filled.form.md
7
+ harness:
8
+ max_turns: 100
9
+ max_patches_per_turn: 20
10
+ max_issues_per_turn: 10
11
+ target_roles:
12
+ - '*'
13
+ fill_mode: continue
14
+ turns:
15
+ - turn: 1
16
+ inspect:
17
+ issues:
18
+ - ref: age
19
+ scope: field
20
+ reason: required_missing
21
+ message: Required field "Age" is empty
22
+ severity: required
23
+ priority: 1
24
+ - ref: categories
25
+ scope: field
26
+ reason: required_missing
27
+ message: Required field "Categories" has no selections
28
+ severity: required
29
+ priority: 1
30
+ - ref: confirmations
31
+ scope: field
32
+ reason: required_missing
33
+ message: All items in "Confirmations (Explicit Mode)" must be answered (2 unfilled)
34
+ severity: required
35
+ priority: 1
36
+ - ref: email
37
+ scope: field
38
+ reason: required_missing
39
+ message: Required field "Email" is empty
40
+ severity: required
41
+ priority: 1
42
+ - ref: name
43
+ scope: field
44
+ reason: required_missing
45
+ message: Required field "Name" is empty
46
+ severity: required
47
+ priority: 1
48
+ - ref: priority
49
+ scope: field
50
+ reason: required_missing
51
+ message: Required field "Priority" has no selection
52
+ severity: required
53
+ priority: 1
54
+ - ref: tags
55
+ scope: field
56
+ reason: required_missing
57
+ message: Required field "Tags" is empty
58
+ severity: required
59
+ priority: 1
60
+ - ref: tasks_multi
61
+ scope: field
62
+ reason: required_missing
63
+ message: All items in "Tasks (Multi Mode)" must be completed
64
+ severity: required
65
+ priority: 1
66
+ - ref: tasks_simple
67
+ scope: field
68
+ reason: required_missing
69
+ message: All items in "Agreements (Simple Mode)" must be checked (2 unchecked)
70
+ severity: required
71
+ priority: 1
72
+ - ref: website
73
+ scope: field
74
+ reason: required_missing
75
+ message: Required field "Website" is empty
76
+ severity: required
77
+ priority: 1
78
+ apply:
79
+ patches:
80
+ - op: set_number
81
+ field_id: age
82
+ value: 25
83
+ - op: set_multi_select
84
+ field_id: categories
85
+ selected:
86
+ - frontend
87
+ - backend
88
+ - op: set_checkboxes
89
+ field_id: confirmations
90
+ values:
91
+ backed_up: yes
92
+ notified: no
93
+ - op: set_string
94
+ field_id: email
95
+ value: test@example.com
96
+ - op: set_string
97
+ field_id: name
98
+ value: Test User
99
+ - op: set_single_select
100
+ field_id: priority
101
+ selected: high
102
+ - op: set_string_list
103
+ field_id: tags
104
+ items:
105
+ - typescript
106
+ - testing
107
+ - op: set_checkboxes
108
+ field_id: tasks_multi
109
+ values:
110
+ research: done
111
+ design: done
112
+ implement: done
113
+ test: na
114
+ - op: set_checkboxes
115
+ field_id: tasks_simple
116
+ values:
117
+ read_guidelines: done
118
+ agree_terms: done
119
+ - op: set_url
120
+ field_id: website
121
+ value: https://test.example.com
122
+ after:
123
+ required_issue_count: 0
124
+ markdown_sha256: 62c9aad095c2ea5c2947c308c5e4b3c4cbc677a7e481971871c5091d5ca27b02
125
+ answered_field_count: 10
126
+ skipped_field_count: 0
127
+ - turn: 2
128
+ inspect:
129
+ issues:
130
+ - ref: notes
131
+ scope: field
132
+ reason: optional_empty
133
+ message: Optional field has no value
134
+ severity: recommended
135
+ priority: 3
136
+ - ref: optional_number
137
+ scope: field
138
+ reason: optional_empty
139
+ message: Optional field has no value
140
+ severity: recommended
141
+ priority: 3
142
+ - ref: references
143
+ scope: field
144
+ reason: optional_empty
145
+ message: Optional field has no value
146
+ severity: recommended
147
+ priority: 3
148
+ - ref: related_url
149
+ scope: field
150
+ reason: optional_empty
151
+ message: Optional field has no value
152
+ severity: recommended
153
+ priority: 3
154
+ - ref: score
155
+ scope: field
156
+ reason: optional_empty
157
+ message: Optional field has no value
158
+ severity: recommended
159
+ priority: 3
160
+ apply:
161
+ patches:
162
+ - op: skip_field
163
+ field_id: notes
164
+ role: agent
165
+ reason: No value in mock form
166
+ - op: skip_field
167
+ field_id: optional_number
168
+ role: agent
169
+ reason: No value in mock form
170
+ - op: set_url_list
171
+ field_id: references
172
+ items:
173
+ - https://docs.example.com
174
+ - op: skip_field
175
+ field_id: related_url
176
+ role: agent
177
+ reason: No value in mock form
178
+ - op: skip_field
179
+ field_id: score
180
+ role: agent
181
+ reason: No value in mock form
182
+ after:
183
+ required_issue_count: 0
184
+ markdown_sha256: 5ca306e53bdb0213b0558f6132c7a5af491c40c8765f25bc7047efa0478b7876
185
+ answered_field_count: 11
186
+ skipped_field_count: 4
187
+ final:
188
+ expect_complete: true
189
+ expected_completed_form: simple-skipped-filled.form.md
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  markform:
3
- markform_version: "0.1.0"
3
+ spec: MF/0.1
4
+ title: Simple Test Form
5
+ description: "Fully interactive demo - no LLM required. Demonstrates all Markform field types."
4
6
  roles:
5
7
  - user
6
- - agent
7
8
  role_instructions:
8
- user: "Fill in the required fields in this form."
9
- agent: "Fill in the optional fields with reasonable test values."
9
+ user: "Fill in all fields in this form."
10
10
  ---
11
11
 
12
12
  {% form id="simple_test" title="Simple Test Form" %}
13
13
 
14
14
  {% description ref="simple_test" %}
15
- A form demonstrating user and agent roles. User fills required fields,
16
- agent fills optional fields. Demonstrates all Markform v0.1 field types.
15
+ A fully interactive form demonstrating all Markform v0.1 field types.
16
+ Fill all fields using interactive prompts - no LLM API key needed.
17
17
  {% /description %}
18
18
 
19
19
  {% field-group id="basic_fields" title="Basic Fields" %}
@@ -28,10 +28,10 @@ Enter your full name (2-50 characters).
28
28
 
29
29
  {% number-field id="age" label="Age" role="user" required=true min=0 max=150 integer=true %}{% /number-field %}
30
30
 
31
- {% number-field id="score" label="Score" role="agent" min=0.0 max=100.0 %}{% /number-field %}
31
+ {% number-field id="score" label="Score" role="user" min=0.0 max=100.0 %}{% /number-field %}
32
32
 
33
33
  {% instructions ref="score" %}
34
- Assign a score between 0 and 100 based on form completeness.
34
+ Enter a score between 0 and 100 (optional).
35
35
  {% /instructions %}
36
36
 
37
37
  {% /field-group %}
@@ -92,15 +92,37 @@ Answer yes or no for each confirmation. All must be explicitly answered.
92
92
 
93
93
  {% /field-group %}
94
94
 
95
- {% field-group id="optional_fields" title="Optional Fields (Agent)" %}
95
+ {% field-group id="url_fields" title="URL Fields" %}
96
96
 
97
- {% string-field id="notes" label="Notes" role="agent" %}{% /string-field %}
97
+ {% url-field id="website" label="Website" role="user" required=true %}{% /url-field %}
98
+
99
+ {% instructions ref="website" %}
100
+ Enter your website URL (must be http or https).
101
+ {% /instructions %}
102
+
103
+ {% url-list id="references" label="References" role="user" minItems=1 maxItems=5 uniqueItems=true %}{% /url-list %}
104
+
105
+ {% instructions ref="references" %}
106
+ Add 1-5 unique reference URLs for sources or documentation.
107
+ {% /instructions %}
108
+
109
+ {% /field-group %}
110
+
111
+ {% field-group id="optional_fields" title="Optional Fields" %}
112
+
113
+ {% string-field id="notes" label="Notes" role="user" %}{% /string-field %}
98
114
 
99
115
  {% instructions ref="notes" %}
100
- Add any relevant notes or observations about this test form.
116
+ Add any relevant notes or observations (optional).
101
117
  {% /instructions %}
102
118
 
103
- {% number-field id="optional_number" label="Optional Number" role="agent" %}{% /number-field %}
119
+ {% number-field id="optional_number" label="Optional Number" role="user" %}{% /number-field %}
120
+
121
+ {% url-field id="related_url" label="Related URL" role="user" %}{% /url-field %}
122
+
123
+ {% instructions ref="related_url" %}
124
+ Optionally add a URL to related documentation or resources.
125
+ {% /instructions %}
104
126
 
105
127
  {% /field-group %}
106
128
 
@@ -5,12 +5,12 @@ form:
5
5
  mock:
6
6
  completed_mock: simple-mock-filled.form.md
7
7
  harness:
8
- max_turns: 50
8
+ max_turns: 100
9
9
  max_patches_per_turn: 20
10
- max_issues: 20
10
+ max_issues_per_turn: 10
11
11
  target_roles:
12
- - user
13
- - agent
12
+ - '*'
13
+ fill_mode: continue
14
14
  turns:
15
15
  - turn: 1
16
16
  inspect:
@@ -23,70 +23,58 @@ turns:
23
23
  priority: 1
24
24
  - ref: categories
25
25
  scope: field
26
- reason: validation_error
26
+ reason: required_missing
27
27
  message: Required field "Categories" has no selections
28
28
  severity: required
29
- priority: 2
29
+ priority: 1
30
30
  - ref: confirmations
31
31
  scope: field
32
- reason: validation_error
32
+ reason: required_missing
33
33
  message: All items in "Confirmations (Explicit Mode)" must be answered (2 unfilled)
34
34
  severity: required
35
- priority: 3
35
+ priority: 1
36
36
  - ref: email
37
37
  scope: field
38
38
  reason: required_missing
39
39
  message: Required field "Email" is empty
40
40
  severity: required
41
- priority: 4
41
+ priority: 1
42
42
  - ref: name
43
43
  scope: field
44
44
  reason: required_missing
45
45
  message: Required field "Name" is empty
46
46
  severity: required
47
- priority: 5
47
+ priority: 1
48
48
  - ref: priority
49
49
  scope: field
50
- reason: validation_error
50
+ reason: required_missing
51
51
  message: Required field "Priority" has no selection
52
52
  severity: required
53
- priority: 6
53
+ priority: 1
54
54
  - ref: tags
55
55
  scope: field
56
56
  reason: required_missing
57
57
  message: Required field "Tags" is empty
58
58
  severity: required
59
- priority: 7
59
+ priority: 1
60
60
  - ref: tasks_multi
61
61
  scope: field
62
- reason: validation_error
62
+ reason: required_missing
63
63
  message: All items in "Tasks (Multi Mode)" must be completed
64
64
  severity: required
65
- priority: 8
65
+ priority: 1
66
66
  - ref: tasks_simple
67
67
  scope: field
68
- reason: validation_error
68
+ reason: required_missing
69
69
  message: All items in "Agreements (Simple Mode)" must be checked (2 unchecked)
70
70
  severity: required
71
- priority: 9
72
- - ref: notes
73
- scope: field
74
- reason: optional_empty
75
- message: Optional field has no value
76
- severity: recommended
77
- priority: 10
78
- - ref: optional_number
79
- scope: field
80
- reason: optional_empty
81
- message: Optional field has no value
82
- severity: recommended
83
- priority: 11
84
- - ref: score
71
+ priority: 1
72
+ - ref: website
85
73
  scope: field
86
- reason: optional_empty
87
- message: Optional field has no value
88
- severity: recommended
89
- priority: 12
74
+ reason: required_missing
75
+ message: Required field "Website" is empty
76
+ severity: required
77
+ priority: 1
90
78
  apply:
91
79
  patches:
92
80
  - op: set_number
@@ -129,18 +117,73 @@ turns:
129
117
  values:
130
118
  read_guidelines: done
131
119
  agree_terms: done
120
+ - op: set_url
121
+ field_id: website
122
+ value: https://alice.dev
123
+ after:
124
+ required_issue_count: 0
125
+ markdown_sha256: 82ebecc97db1321838d47491c23ab951525e1fa5fd14590cd306565faa00b05f
126
+ answered_field_count: 10
127
+ skipped_field_count: 0
128
+ - turn: 2
129
+ inspect:
130
+ issues:
131
+ - ref: notes
132
+ scope: field
133
+ reason: optional_empty
134
+ message: Optional field has no value
135
+ severity: recommended
136
+ priority: 3
137
+ - ref: optional_number
138
+ scope: field
139
+ reason: optional_empty
140
+ message: Optional field has no value
141
+ severity: recommended
142
+ priority: 3
143
+ - ref: references
144
+ scope: field
145
+ reason: optional_empty
146
+ message: Optional field has no value
147
+ severity: recommended
148
+ priority: 3
149
+ - ref: related_url
150
+ scope: field
151
+ reason: optional_empty
152
+ message: Optional field has no value
153
+ severity: recommended
154
+ priority: 3
155
+ - ref: score
156
+ scope: field
157
+ reason: optional_empty
158
+ message: Optional field has no value
159
+ severity: recommended
160
+ priority: 3
161
+ apply:
162
+ patches:
132
163
  - op: set_string
133
164
  field_id: notes
134
165
  value: This is a test note.
135
- - op: set_number
166
+ - op: skip_field
136
167
  field_id: optional_number
137
- value: null
168
+ role: agent
169
+ reason: No value in mock form
170
+ - op: set_url_list
171
+ field_id: references
172
+ items:
173
+ - https://docs.example.com/guide
174
+ - https://github.com/example/project
175
+ - https://medium.com/article-about-forms
176
+ - op: set_url
177
+ field_id: related_url
178
+ value: https://markform.dev/docs
138
179
  - op: set_number
139
180
  field_id: score
140
181
  value: 87.5
141
182
  after:
142
183
  required_issue_count: 0
143
- markdown_sha256: d633b7eaeb1be08374fd829a9865d476bf16c49292261ab3749b66855f61cdea
184
+ markdown_sha256: 09ad2c0b12f3b27505ea3fbcfd35e025e94d906c1cb9701322b793b233db54dd
185
+ answered_field_count: 14
186
+ skipped_field_count: 1
144
187
  final:
145
188
  expect_complete: true
146
189
  expected_completed_form: simple-mock-filled.form.md