@asterdoc/schemas 0.0.0-stage → 0.10.0

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 (42) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +76 -2
  3. package/dist/index.d.ts +3040 -0
  4. package/dist/index.js +2096 -0
  5. package/package.json +82 -3
  6. package/schemas/2026-10-28/address.json +53 -0
  7. package/schemas/2026-10-28/attachment.json +31 -0
  8. package/schemas/2026-10-28/bbox.json +22 -0
  9. package/schemas/2026-10-28/bundle-content-item.json +122 -0
  10. package/schemas/2026-10-28/bundle.json +267 -0
  11. package/schemas/2026-10-28/checklist-item.json +113 -0
  12. package/schemas/2026-10-28/checklist.json +300 -0
  13. package/schemas/2026-10-28/cond-expr.json +18 -0
  14. package/schemas/2026-10-28/content-ref.json +76 -0
  15. package/schemas/2026-10-28/coordinate.json +26 -0
  16. package/schemas/2026-10-28/defs-section.json +862 -0
  17. package/schemas/2026-10-28/document.json +292 -0
  18. package/schemas/2026-10-28/duration.json +8 -0
  19. package/schemas/2026-10-28/fieldset-field.json +49 -0
  20. package/schemas/2026-10-28/form-annex.json +33 -0
  21. package/schemas/2026-10-28/form-field.json +1037 -0
  22. package/schemas/2026-10-28/form-party.json +150 -0
  23. package/schemas/2026-10-28/form.json +369 -0
  24. package/schemas/2026-10-28/identification.json +44 -0
  25. package/schemas/2026-10-28/layer.json +556 -0
  26. package/schemas/2026-10-28/list-field.json +51 -0
  27. package/schemas/2026-10-28/metadata.json +35 -0
  28. package/schemas/2026-10-28/money.json +25 -0
  29. package/schemas/2026-10-28/organization.json +49 -0
  30. package/schemas/2026-10-28/person.json +49 -0
  31. package/schemas/2026-10-28/phone.json +32 -0
  32. package/schemas/2026-10-28/rule-severity.json +11 -0
  33. package/schemas/2026-10-28/rules-section.json +46 -0
  34. package/schemas/2026-10-28/signature.json +68 -0
  35. package/schemas/2026-10-28/validation-rule.json +34 -0
  36. package/schemas/2026-10-28.json +4636 -0
  37. package/schemas/config.json +174 -0
  38. package/schemas/lock.json +151 -0
  39. package/schemas/manifest.json +184 -0
  40. package/schemas/registry-item.json +488 -0
  41. package/schemas/registry.json +281 -0
  42. package/schemas/schema.json +4636 -0
@@ -0,0 +1,292 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/2026-10-28/document.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string",
8
+ "format": "uri",
9
+ "description": "JSON Schema URI for this artifact instance."
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 128,
15
+ "pattern": "^[A-Za-z0-9]([A-Za-z0-9]|-[A-Za-z0-9])*$",
16
+ "description": "Artifact identifier. Must start with a letter or digit, can contain letters, numbers, and hyphens (no leading/trailing/consecutive hyphens). Every edition of one artifact shares the same name."
17
+ },
18
+ "version": {
19
+ "type": "string",
20
+ "minLength": 1,
21
+ "maxLength": 200,
22
+ "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
23
+ "description": "Artifact version (SemVer 2.0.0, such as 1.2.3 or 1.3.0-beta.1). It counts the publisher's own changes, never the issuer's edition; each edition has its own version line. Required for publishing to registry."
24
+ },
25
+ "title": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 200,
29
+ "description": "Human-readable title. Recommended for published/shared artifacts and directory browsing."
30
+ },
31
+ "description": {
32
+ "type": "string",
33
+ "minLength": 0,
34
+ "maxLength": 2000,
35
+ "description": "Detailed description or context for the artifact."
36
+ },
37
+ "code": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "maxLength": 200,
41
+ "description": "The form number as printed by its issuer, such as W-9 or ACORD 25, or a self-issued form's own number."
42
+ },
43
+ "issuer": {
44
+ "type": "string",
45
+ "minLength": 1,
46
+ "maxLength": 200,
47
+ "description": "The organization that issues the form, such as U.S. Internal Revenue Service."
48
+ },
49
+ "edition": {
50
+ "type": "object",
51
+ "properties": {
52
+ "key": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "maxLength": 64,
56
+ "pattern": "^(?!(?:current|latest|editions|tags|diff)$)[a-z0-9]([a-z0-9]|-[a-z0-9])*$",
57
+ "description": "Stable edition identifier, unique among the editions of one artifact (for example 2024-03 or 3b). Lowercase letters and digits with single hyphens, and not current, latest, editions, tags or diff. It is the edition segment of a coordinate such as @org/repo/w-9/2024-03 and never changes once published."
58
+ },
59
+ "label": {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "maxLength": 200,
63
+ "description": "The issuer's edition text exactly as printed, such as \"Rev. March 2024\". For display only."
64
+ },
65
+ "date": {
66
+ "type": "string",
67
+ "pattern": "^(?:\\d{4}(?:-(?:0[1-9]|1[0-2]))?|(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8]))))$",
68
+ "description": "When the issuer released the edition, at the precision the issuer gives: YYYY, YYYY-MM or YYYY-MM-DD."
69
+ },
70
+ "effectiveFrom": {
71
+ "type": "string",
72
+ "format": "date",
73
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
74
+ "description": "The date the edition takes effect. Only when the issuer prints one."
75
+ }
76
+ },
77
+ "required": [
78
+ "key",
79
+ "label"
80
+ ],
81
+ "additionalProperties": false,
82
+ "title": "ArtifactEdition",
83
+ "description": "The issuer's edition this artifact encodes. Omitted for artifacts that are not issued in editions."
84
+ },
85
+ "language": {
86
+ "type": "string",
87
+ "minLength": 2,
88
+ "maxLength": 35,
89
+ "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
90
+ "description": "BCP 47-style source language tag for this artifact. Defaults to en when omitted."
91
+ },
92
+ "metadata": {
93
+ "description": "Custom key-value pairs for storing domain-specific or organizational metadata",
94
+ "$ref": "https://schema.asterdoc.com/2026-10-28.json#/$defs/Metadata"
95
+ },
96
+ "instructions": {
97
+ "oneOf": [
98
+ {
99
+ "type": "object",
100
+ "properties": {
101
+ "kind": {
102
+ "type": "string",
103
+ "const": "inline"
104
+ },
105
+ "text": {
106
+ "type": "string",
107
+ "minLength": 1,
108
+ "maxLength": 1000000,
109
+ "description": "Inline text content"
110
+ }
111
+ },
112
+ "required": [
113
+ "kind",
114
+ "text"
115
+ ],
116
+ "additionalProperties": false,
117
+ "title": "InlineContentRef",
118
+ "description": "Inline content reference with embedded text"
119
+ },
120
+ {
121
+ "type": "object",
122
+ "properties": {
123
+ "kind": {
124
+ "type": "string",
125
+ "const": "file"
126
+ },
127
+ "path": {
128
+ "type": "string",
129
+ "minLength": 1,
130
+ "maxLength": 1000,
131
+ "description": "Path to the content file"
132
+ },
133
+ "mimeType": {
134
+ "type": "string",
135
+ "minLength": 1,
136
+ "maxLength": 100,
137
+ "description": "MIME type of the file content"
138
+ },
139
+ "title": {
140
+ "type": "string",
141
+ "minLength": 1,
142
+ "maxLength": 200,
143
+ "description": "Human-readable title"
144
+ },
145
+ "description": {
146
+ "type": "string",
147
+ "minLength": 1,
148
+ "maxLength": 2000,
149
+ "description": "Description of the content"
150
+ },
151
+ "checksum": {
152
+ "type": "string",
153
+ "pattern": "^sha256:[a-f0-9]{64}$",
154
+ "description": "SHA-256 checksum for integrity verification"
155
+ }
156
+ },
157
+ "required": [
158
+ "kind",
159
+ "path",
160
+ "mimeType"
161
+ ],
162
+ "additionalProperties": false,
163
+ "title": "FileContentRef",
164
+ "description": "File content reference with path and metadata"
165
+ }
166
+ ],
167
+ "title": "ContentRef",
168
+ "description": "Domain or compliance reference content (e.g., IRS instructions, regulatory guidance)"
169
+ },
170
+ "agentInstructions": {
171
+ "oneOf": [
172
+ {
173
+ "type": "object",
174
+ "properties": {
175
+ "kind": {
176
+ "type": "string",
177
+ "const": "inline"
178
+ },
179
+ "text": {
180
+ "type": "string",
181
+ "minLength": 1,
182
+ "maxLength": 1000000,
183
+ "description": "Inline text content"
184
+ }
185
+ },
186
+ "required": [
187
+ "kind",
188
+ "text"
189
+ ],
190
+ "additionalProperties": false,
191
+ "title": "InlineContentRef",
192
+ "description": "Inline content reference with embedded text"
193
+ },
194
+ {
195
+ "type": "object",
196
+ "properties": {
197
+ "kind": {
198
+ "type": "string",
199
+ "const": "file"
200
+ },
201
+ "path": {
202
+ "type": "string",
203
+ "minLength": 1,
204
+ "maxLength": 1000,
205
+ "description": "Path to the content file"
206
+ },
207
+ "mimeType": {
208
+ "type": "string",
209
+ "minLength": 1,
210
+ "maxLength": 100,
211
+ "description": "MIME type of the file content"
212
+ },
213
+ "title": {
214
+ "type": "string",
215
+ "minLength": 1,
216
+ "maxLength": 200,
217
+ "description": "Human-readable title"
218
+ },
219
+ "description": {
220
+ "type": "string",
221
+ "minLength": 1,
222
+ "maxLength": 2000,
223
+ "description": "Description of the content"
224
+ },
225
+ "checksum": {
226
+ "type": "string",
227
+ "pattern": "^sha256:[a-f0-9]{64}$",
228
+ "description": "SHA-256 checksum for integrity verification"
229
+ }
230
+ },
231
+ "required": [
232
+ "kind",
233
+ "path",
234
+ "mimeType"
235
+ ],
236
+ "additionalProperties": false,
237
+ "title": "FileContentRef",
238
+ "description": "File content reference with path and metadata"
239
+ }
240
+ ],
241
+ "title": "ContentRef",
242
+ "description": "LLM/agent prompts for field ordering, grouping, tone, and presentation guidance"
243
+ },
244
+ "kind": {
245
+ "type": "string",
246
+ "const": "document"
247
+ },
248
+ "layers": {
249
+ "type": "object",
250
+ "propertyNames": {
251
+ "type": "string",
252
+ "minLength": 1,
253
+ "maxLength": 100,
254
+ "pattern": "^[a-z][a-zA-Z0-9_]*$",
255
+ "description": "Layer identifier (camelCase, starts with lowercase letter)"
256
+ },
257
+ "additionalProperties": {
258
+ "$ref": "https://schema.asterdoc.com/2026-10-28.json#/$defs/Layer"
259
+ },
260
+ "description": "Named layers for rendering this document into different formats. Keys are user-defined identifiers (e.g., markdown, pdf, html)",
261
+ "allOf": [
262
+ {
263
+ "additionalProperties": {
264
+ "not": {
265
+ "properties": {
266
+ "mimeType": {
267
+ "pattern": "^(?:[tT][eE][xX][tT]/[tT][sS][xX]|[tT][eE][xX][tT]/[jJ][sS][xX])$"
268
+ }
269
+ },
270
+ "required": [
271
+ "mimeType"
272
+ ]
273
+ }
274
+ }
275
+ }
276
+ ]
277
+ },
278
+ "defaultLayer": {
279
+ "type": "string",
280
+ "minLength": 1,
281
+ "maxLength": 100,
282
+ "description": "Key of the default layer to use when none specified at render time"
283
+ }
284
+ },
285
+ "required": [
286
+ "name",
287
+ "kind"
288
+ ],
289
+ "additionalProperties": false,
290
+ "description": "A document artifact representing static content with no inputs. Documents can have multiple layers for rendering to different output formats (e.g., PDF, Markdown, HTML).",
291
+ "title": "Document"
292
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/2026-10-28/duration.json",
4
+ "type": "string",
5
+ "pattern": "^P(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?=\\d)(\\d+H)?(\\d+M)?(\\d+(?:\\.\\d+)?S)?)?$",
6
+ "description": "ISO 8601 duration string representing a time period. Format: P[n]Y[n]M[n]W[n]DT[n]H[n]M[n]S where P indicates period, T separates date and time components. Examples: P1Y (1 year), P3M (3 months), P2W (2 weeks), P1DT12H (1 day 12 hours), PT30M (30 minutes), PT5S (5 seconds)",
7
+ "title": "Duration"
8
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/2026-10-28/fieldset-field.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "label": {
7
+ "type": "string",
8
+ "minLength": 1,
9
+ "maxLength": 200,
10
+ "description": "Display label for the field"
11
+ },
12
+ "description": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "maxLength": 1000,
16
+ "description": "Description or help text for the field"
17
+ },
18
+ "required": {
19
+ "$ref": "https://schema.asterdoc.com/2026-10-28.json#/$defs/CondExpr"
20
+ },
21
+ "visible": {
22
+ "$ref": "https://schema.asterdoc.com/2026-10-28.json#/$defs/CondExpr"
23
+ },
24
+ "type": {
25
+ "type": "string",
26
+ "const": "fieldset"
27
+ },
28
+ "fields": {
29
+ "type": "object",
30
+ "propertyNames": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 100,
34
+ "pattern": "^[a-z][a-zA-Z0-9_]*$",
35
+ "description": "Nested field identifier (camelCase, starts with lowercase letter)"
36
+ },
37
+ "additionalProperties": {
38
+ "$ref": "https://schema.asterdoc.com/2026-10-28.json#/$defs/FormField"
39
+ }
40
+ }
41
+ },
42
+ "required": [
43
+ "type",
44
+ "fields"
45
+ ],
46
+ "additionalProperties": false,
47
+ "description": "Field that groups nested fields under one key",
48
+ "title": "FieldsetField"
49
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.asterdoc.com/2026-10-28/form-annex.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "title": {
7
+ "type": "string",
8
+ "minLength": 1,
9
+ "maxLength": 200,
10
+ "description": "Title or heading for the annex slot"
11
+ },
12
+ "description": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "maxLength": 1000,
16
+ "description": "Description of what document should be attached"
17
+ },
18
+ "required": {
19
+ "$ref": "https://schema.asterdoc.com/2026-10-28.json#/$defs/CondExpr"
20
+ },
21
+ "visible": {
22
+ "$ref": "https://schema.asterdoc.com/2026-10-28.json#/$defs/CondExpr"
23
+ },
24
+ "order": {
25
+ "type": "number",
26
+ "minimum": 0,
27
+ "description": "Display order for rendering"
28
+ }
29
+ },
30
+ "additionalProperties": false,
31
+ "description": "Defines an annex slot where a document must or may be attached at runtime",
32
+ "title": "FormAnnex"
33
+ }