@agentproto/corpus-cli 0.1.0-alpha.1 → 0.1.0-alpha.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 (48) hide show
  1. package/dist/cli.mjs +26 -8
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/index.d.ts +1 -5
  4. package/dist/index.mjs +15 -4
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/specs/resources/aip-10/draft/KNOWLEDGE.schema.json +457 -0
  7. package/dist/specs/resources/aip-11/draft/LESSON.schema.json +149 -0
  8. package/dist/specs/resources/aip-12/draft/PLAYBOOK.schema.json +349 -0
  9. package/dist/specs/resources/aip-13/draft/WORK_ITEM.schema.json +547 -0
  10. package/dist/specs/resources/aip-14/draft/TOOL.schema.json +169 -0
  11. package/dist/specs/resources/aip-15/draft/WORKFLOW.schema.json +356 -0
  12. package/dist/specs/resources/aip-16/draft/IO.schema.json +64 -0
  13. package/dist/specs/resources/aip-17/draft/RUNNER.schema.json +81 -0
  14. package/dist/specs/resources/aip-18/draft/COLLECTION.schema.json +436 -0
  15. package/dist/specs/resources/aip-19/draft/SECRETS.schema.json +261 -0
  16. package/dist/specs/resources/aip-20/draft/WORK.schema.json +371 -0
  17. package/dist/specs/resources/aip-21/draft/AGENCY.schema.json +454 -0
  18. package/dist/specs/resources/aip-22/draft/OFFICE.schema.json +390 -0
  19. package/dist/specs/resources/aip-23/draft/IDENTITY.schema.json +358 -0
  20. package/dist/specs/resources/aip-24/draft/ASSEMBLY.schema.json +411 -0
  21. package/dist/specs/resources/aip-25/draft/PERSONA.schema.json +257 -0
  22. package/dist/specs/resources/aip-26/draft/CODE.schema.json +172 -0
  23. package/dist/specs/resources/aip-28/draft/INTENT.schema.json +215 -0
  24. package/dist/specs/resources/aip-29/draft/CLI.schema.json +339 -0
  25. package/dist/specs/resources/aip-3/draft/SKILL.schema.json +206 -0
  26. package/dist/specs/resources/aip-30/draft/DRIVER.schema.json +237 -0
  27. package/dist/specs/resources/aip-31/draft/HTTP.schema.json +80 -0
  28. package/dist/specs/resources/aip-32/draft/MCP.schema.json +88 -0
  29. package/dist/specs/resources/aip-33/draft/SDK.schema.json +60 -0
  30. package/dist/specs/resources/aip-34/draft/WORKSPACE.schema.json +252 -0
  31. package/dist/specs/resources/aip-35/draft/STORAGE.schema.json +237 -0
  32. package/dist/specs/resources/aip-36/draft/SANDBOX.schema.json +246 -0
  33. package/dist/specs/resources/aip-38/draft/POLICY.schema.json +217 -0
  34. package/dist/specs/resources/aip-39/draft/ACTION.schema.json +134 -0
  35. package/dist/specs/resources/aip-4/draft/DESIGN.schema.json +189 -0
  36. package/dist/specs/resources/aip-40/draft/EXTENSION.schema.json +116 -0
  37. package/dist/specs/resources/aip-41/draft/ROUTINE.schema.json +345 -0
  38. package/dist/specs/resources/aip-42/draft/AGENT.schema.json +268 -0
  39. package/dist/specs/resources/aip-44/draft/ACP.schema.json +170 -0
  40. package/dist/specs/resources/aip-45/draft/AGENT-CLI.schema.json +371 -0
  41. package/dist/specs/resources/aip-47/draft/ROLE.schema.json +199 -0
  42. package/dist/specs/resources/aip-48/draft/MultiAgentRuntime.schema.json +108 -0
  43. package/dist/specs/resources/aip-5/draft/TEMPLATE.schema.json +231 -0
  44. package/dist/specs/resources/aip-6/draft/COMPANY.schema.json +268 -0
  45. package/dist/specs/resources/aip-7/draft/GOVERNANCE.schema.json +581 -0
  46. package/dist/specs/resources/aip-8/draft/AGENCY.schema.json +518 -0
  47. package/dist/specs/resources/aip-9/draft/OPERATOR.schema.json +297 -0
  48. package/package.json +4 -4
@@ -0,0 +1,436 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-18/COLLECTION.schema.json",
4
+ "title": "collections/v1 frontmatter (AIP-18)",
5
+ "description": "Validates the YAML frontmatter portion of an AIP-18 collection schema or item. The doctype is selected via the `schema` discriminator: 'collection.schema/v1' (a COLLECTION.md, the schema for a class of records) or 'collection.item/v1' (an instance of one record validated against a named collection).",
6
+ "oneOf": [{ "$ref": "#/$defs/schema" }, { "$ref": "#/$defs/item" }],
7
+ "$defs": {
8
+ "schema": {
9
+ "type": "object",
10
+ "required": ["schema", "name", "title", "description", "version"],
11
+ "additionalProperties": false,
12
+ "description": "Collection schema doctype. Declares the shape of items (fields, statuses, ownership, deadline, lints, identity). Composes via `extends:` against another COLLECTION.md.",
13
+ "properties": {
14
+ "schema": {
15
+ "const": "collection.schema/v1",
16
+ "description": "Discriminator for a collection definition."
17
+ },
18
+ "name": {
19
+ "type": "string",
20
+ "minLength": 2,
21
+ "maxLength": 96,
22
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$",
23
+ "description": "Stable kebab-case identifier. Items reference this name via their `collection:` field."
24
+ },
25
+ "title": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 200,
29
+ "description": "Human-readable collection title."
30
+ },
31
+ "description": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "maxLength": 2000,
35
+ "description": "One-paragraph statement of purpose: what this collection captures and when an item belongs here vs another collection."
36
+ },
37
+ "version": {
38
+ "type": "string",
39
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[A-Za-z0-9.-]+)?$",
40
+ "description": "Semantic version of the SHAPE. Bump on field/status/lint changes. Independent of the collection's content."
41
+ },
42
+ "extends": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "maxLength": 512,
46
+ "pattern": "^(\\.\\./|\\./)[^\\s]+/COLLECTION\\.md$",
47
+ "description": "OPTIONAL — relative path to a parent COLLECTION.md. Recursive composition; maximum chain depth is 8."
48
+ },
49
+ "appliesTo": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "string",
53
+ "pattern": "^(ws://(workspaces|wikis|companies|operators|skills)/[a-z][a-z0-9-]*|\\.\\./[^\\s]+)$",
54
+ "description": "Either a ws:// ref to an AIP-20 work workspace, AIP-10 wiki, AIP-6 company, AIP-9 operator, or AIP-3 skill — or a relative path to a consumer workspace folder."
55
+ },
56
+ "uniqueItems": true,
57
+ "description": "OPTIONAL — list of consumers this collection adapts for. Hosts MUST refuse if any binding does not resolve. Not inherited; each child declares its own scope."
58
+ },
59
+ "fields": {
60
+ "type": "array",
61
+ "items": {
62
+ "$ref": "#/$defs/fieldDef"
63
+ },
64
+ "default": [],
65
+ "description": "Item field schema. Merge-by-name vs parent: a child entry with the same `name` replaces the parent's (subject to type-drift refusal); new names are appended."
66
+ },
67
+ "statuses": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "object",
71
+ "required": ["id", "label"],
72
+ "additionalProperties": false,
73
+ "properties": {
74
+ "id": {
75
+ "type": "string",
76
+ "pattern": "^[a-z][a-z0-9-]*$",
77
+ "description": "Stable kebab-case status id. Merge key when composing."
78
+ },
79
+ "label": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "maxLength": 60,
83
+ "description": "Human-readable status label."
84
+ },
85
+ "terminal": {
86
+ "type": "boolean",
87
+ "default": false,
88
+ "description": "Whether items in this status are considered closed. Lints like `overdue` typically skip terminal statuses."
89
+ },
90
+ "transitionsTo": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "string",
94
+ "pattern": "^[a-z][a-z0-9-]*$"
95
+ },
96
+ "uniqueItems": true,
97
+ "description": "OPTIONAL — allowed next status ids. If omitted, all transitions are permitted."
98
+ }
99
+ }
100
+ },
101
+ "default": [],
102
+ "description": "Status state machine. Merge-by-id vs parent. Children may add statuses, mark inherited statuses terminal, or narrow `transitionsTo`; they MUST NOT remove an inherited status."
103
+ },
104
+ "initialStatus": {
105
+ "type": "string",
106
+ "pattern": "^[a-z][a-z0-9-]*$",
107
+ "description": "OPTIONAL — default status assigned to new items. MUST refer to a status declared (locally or inherited) by this collection."
108
+ },
109
+ "ownership": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "cardinality": {
114
+ "enum": ["none", "single", "multiple"],
115
+ "default": "single",
116
+ "description": "How many owners an item may carry. `none` = no ownership concept; `single` = one owner; `multiple` = list of owners."
117
+ },
118
+ "role": {
119
+ "type": "string",
120
+ "pattern": "^[a-z][a-zA-Z0-9_]*$",
121
+ "default": "owner",
122
+ "description": "Item field name that holds the owner ref."
123
+ },
124
+ "required": {
125
+ "type": "boolean",
126
+ "default": false,
127
+ "description": "Whether items MUST declare an owner."
128
+ }
129
+ },
130
+ "description": "Ownership rules. Each leaf field overrides independently across the chain."
131
+ },
132
+ "deadline": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "properties": {
136
+ "kind": {
137
+ "enum": ["none", "target-date", "window", "recurrent"],
138
+ "default": "none",
139
+ "description": "Deadline shape. `none` = no deadline concept; `target-date` = single date; `window` = start+end; `recurrent` = repeating."
140
+ },
141
+ "required": {
142
+ "type": "boolean",
143
+ "default": false,
144
+ "description": "Whether items MUST declare a deadline value."
145
+ },
146
+ "fieldName": {
147
+ "type": "string",
148
+ "pattern": "^[a-z][a-zA-Z0-9_]*$",
149
+ "default": "dueAt",
150
+ "description": "Item field name that holds the deadline value."
151
+ }
152
+ },
153
+ "description": "Deadline rules. Each leaf field overrides independently."
154
+ },
155
+ "lints": {
156
+ "type": "array",
157
+ "items": {
158
+ "type": "object",
159
+ "required": ["id", "kind", "appliesTo", "severity"],
160
+ "additionalProperties": false,
161
+ "properties": {
162
+ "id": {
163
+ "type": "string",
164
+ "pattern": "^[a-z][a-z0-9-]*$",
165
+ "description": "Stable kebab-case lint id. Merge key when composing."
166
+ },
167
+ "kind": {
168
+ "enum": [
169
+ "missing-owner",
170
+ "overdue",
171
+ "orphan",
172
+ "broken-ref",
173
+ "stale",
174
+ "required-field",
175
+ "custom"
176
+ ],
177
+ "description": "Lint algorithm. `custom` delegates to a host-defined check identified by `id`."
178
+ },
179
+ "appliesTo": {
180
+ "type": "string",
181
+ "const": "*",
182
+ "description": "Always '*' — items belong to one collection, so the lint always applies to all items of this collection. The field is preserved for symmetry with AIP-10's lint shape."
183
+ },
184
+ "severity": {
185
+ "enum": ["error", "warn", "info"],
186
+ "description": "Lint severity. Children may soften; governance policies MAY forbid softening below `error`."
187
+ },
188
+ "params": {
189
+ "type": "object",
190
+ "additionalProperties": true,
191
+ "default": {},
192
+ "description": "Kind-specific parameters. e.g. { days: 30 } for `stale`; { field: 'severity' } for `required-field`."
193
+ }
194
+ }
195
+ },
196
+ "default": [],
197
+ "description": "Lint rules. Merge-by-id vs parent."
198
+ },
199
+ "identity": {
200
+ "type": "object",
201
+ "additionalProperties": false,
202
+ "properties": {
203
+ "slugSource": {
204
+ "type": "string",
205
+ "minLength": 1,
206
+ "maxLength": 200,
207
+ "description": "How to derive an item's slug. Either a field name (e.g. 'title'), the literal 'random', the literal 'sequence', or 'hash:<comma-separated-source-fields>' (e.g. 'hash:title,createdAt')."
208
+ },
209
+ "filingPath": {
210
+ "type": "string",
211
+ "minLength": 1,
212
+ "maxLength": 512,
213
+ "description": "Template for where items are filed on disk. Tokens: {collection}, {slug}, {year}, {month}. e.g. 'items/{collection}/{slug}.md'."
214
+ }
215
+ },
216
+ "description": "Item identity & filing rules."
217
+ },
218
+ "metadata": {
219
+ "type": "object",
220
+ "additionalProperties": true,
221
+ "default": {},
222
+ "description": "Vendor-specific extensions, namespaced under <vendor>. Deep-merged across the extends chain."
223
+ }
224
+ },
225
+ "allOf": [
226
+ {
227
+ "description": "A collection that binds to a consumer (any non-empty appliesTo) MUST extend a parent. A standalone collection has neither field, or has extends without appliesTo.",
228
+ "if": {
229
+ "required": ["appliesTo"],
230
+ "properties": {
231
+ "appliesTo": { "type": "array", "minItems": 1 }
232
+ }
233
+ },
234
+ "then": {
235
+ "required": ["extends"]
236
+ }
237
+ }
238
+ ]
239
+ },
240
+ "fieldDef": {
241
+ "type": "object",
242
+ "required": ["name", "type"],
243
+ "additionalProperties": false,
244
+ "description": "Definition of one field on a collection's item schema. Merge-by-name. Type drift between parent and child is HARD refused.",
245
+ "properties": {
246
+ "name": {
247
+ "type": "string",
248
+ "pattern": "^[a-z][a-zA-Z0-9_]*$",
249
+ "minLength": 1,
250
+ "maxLength": 64,
251
+ "description": "kebab-or-camel-case field name. Merge key when composing."
252
+ },
253
+ "type": {
254
+ "enum": [
255
+ "string",
256
+ "number",
257
+ "boolean",
258
+ "enum",
259
+ "date",
260
+ "datetime",
261
+ "text",
262
+ "url",
263
+ "ref",
264
+ "array"
265
+ ],
266
+ "description": "Field type. Drift across composition (parent string -> child number) is HARD refused (`collection_field_type_drift`)."
267
+ },
268
+ "required": {
269
+ "type": "boolean",
270
+ "default": false,
271
+ "description": "Whether items MUST declare this field. A child may narrow false -> true; loosening true -> false is permitted (it removes a constraint without invalidating instances)."
272
+ },
273
+ "description": {
274
+ "type": "string",
275
+ "maxLength": 1000,
276
+ "description": "Prose describing what the field captures."
277
+ },
278
+ "enum": {
279
+ "type": "array",
280
+ "items": { "type": "string" },
281
+ "uniqueItems": true,
282
+ "description": "Required when type=enum. Children may narrow to a subset; widening to a superset is permitted (it does not invalidate instances)."
283
+ },
284
+ "items": {
285
+ "$ref": "#/$defs/fieldDef",
286
+ "description": "Required when type=array. Recursive shape — describes the inner item type."
287
+ },
288
+ "refKind": {
289
+ "type": "string",
290
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$",
291
+ "description": "Required when type=ref. The target collection's `name`. Hosts validate that ref values point at items of this collection."
292
+ },
293
+ "pattern": {
294
+ "type": "string",
295
+ "description": "OPTIONAL regex constraint. Only valid when type=string."
296
+ },
297
+ "min": {
298
+ "type": "number",
299
+ "description": "OPTIONAL minimum. For type=number: minimum value. For type=array: minimum length."
300
+ },
301
+ "max": {
302
+ "type": "number",
303
+ "description": "OPTIONAL maximum. For type=number: maximum value. For type=array: maximum length."
304
+ },
305
+ "format": {
306
+ "type": "string",
307
+ "description": "OPTIONAL named format. Common values: email, uri, semver, uuid, slug. Only valid when type=string. Hosts MAY interpret unknown formats as advisory."
308
+ },
309
+ "enabled": {
310
+ "type": "boolean",
311
+ "default": true,
312
+ "description": "OPTIONAL deprecation flag. A child may set false to mark an inherited field deprecated; the host preserves the field in the resolved schema (so existing items still validate) but flags new uses via lint. Setting enabled:false on a field a child does not inherit is invalid."
313
+ }
314
+ }
315
+ },
316
+ "item": {
317
+ "type": "object",
318
+ "required": ["schema", "collection", "id", "title"],
319
+ "additionalProperties": true,
320
+ "description": "Item instance doctype. Universal core (schema, collection, id, title) is the only set of MUST fields. Every other field shown here is OPTIONAL at the AIP-18 level — the resolved collection schema decides which become required for this collection's items. additionalProperties is true because collection-specific fields (declared in COLLECTION.md fields[]) appear flat at the item's top level.",
321
+ "properties": {
322
+ "schema": {
323
+ "const": "collection.item/v1",
324
+ "description": "Discriminator for an item instance."
325
+ },
326
+ "collection": {
327
+ "oneOf": [
328
+ {
329
+ "type": "string",
330
+ "minLength": 2,
331
+ "maxLength": 96,
332
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$",
333
+ "description": "Canonical 99% form — just the collection's name. Host floats to the current resolved schema; drift surfaces as collection_item_schema_drift (warn)."
334
+ },
335
+ {
336
+ "type": "object",
337
+ "required": ["name"],
338
+ "additionalProperties": false,
339
+ "properties": {
340
+ "name": {
341
+ "type": "string",
342
+ "minLength": 2,
343
+ "maxLength": 96,
344
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$"
345
+ },
346
+ "version": {
347
+ "type": "string",
348
+ "description": "Semver range (e.g. \"1.x\", \"^1.2\", \"1.2.0\"). When set, schema bumps outside the range fail with collection_item_schema_pinned_drift (HARD)."
349
+ }
350
+ },
351
+ "description": "Object form — pin a specific schema range. Power-user escape hatch for archival snapshots, cross-team publishing, third-party imports."
352
+ }
353
+ ],
354
+ "description": "Reference to the COLLECTION.md this item validates against. Resolution order: inline (workspace root) → local file (<workspace>/collections/<name>/COLLECTION.md) → registry (ws://collections/<name>). Unresolvable → collection_unresolvable (HARD)."
355
+ },
356
+ "id": {
357
+ "type": "string",
358
+ "minLength": 1,
359
+ "maxLength": 96,
360
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_:-]*$",
361
+ "description": "Unique identifier within the collection. May be kebab-case, prefixed (BUG-1234), or hashed; the collection's identity.slugSource controls how it's derived for new items."
362
+ },
363
+ "title": {
364
+ "type": "string",
365
+ "minLength": 1,
366
+ "maxLength": 200,
367
+ "description": "Human-readable item title."
368
+ },
369
+ "parent": {
370
+ "type": "string",
371
+ "description": "OPTIONAL — containment ref. May target another item or another collection."
372
+ },
373
+ "owner": {
374
+ "oneOf": [
375
+ { "type": "string" },
376
+ {
377
+ "type": "array",
378
+ "items": { "type": "string" },
379
+ "uniqueItems": true
380
+ }
381
+ ],
382
+ "description": "OPTIONAL — owner ref(s). Single string or array depending on collection.ownership.cardinality."
383
+ },
384
+ "status": {
385
+ "type": "string",
386
+ "pattern": "^[a-z][a-z0-9-]*$",
387
+ "description": "OPTIONAL — current status. MUST be a status id declared (locally or inherited) by the collection."
388
+ },
389
+ "dueAt": {
390
+ "type": "string",
391
+ "description": "OPTIONAL — deadline value. Format depends on collection.deadline.kind: ISO date for target-date, ISO datetime for window, RRULE-like for recurrent."
392
+ },
393
+ "attachments": {
394
+ "type": "array",
395
+ "items": { "type": "string" },
396
+ "uniqueItems": true,
397
+ "default": [],
398
+ "description": "OPTIONAL — list of attachment refs. Hosts resolve refs against the workspace's file registry."
399
+ },
400
+ "links": {
401
+ "type": "array",
402
+ "items": { "type": "string" },
403
+ "uniqueItems": true,
404
+ "default": [],
405
+ "description": "OPTIONAL — list of cross-references to other items, knowledge entries, or external URLs."
406
+ },
407
+ "tags": {
408
+ "type": "array",
409
+ "items": {
410
+ "type": "string",
411
+ "pattern": "^[a-z][a-z0-9-]*$"
412
+ },
413
+ "uniqueItems": true,
414
+ "default": [],
415
+ "description": "OPTIONAL — free-form tags consumed by retrieval, search, and grouping."
416
+ },
417
+ "createdAt": {
418
+ "type": "string",
419
+ "format": "date-time",
420
+ "description": "OPTIONAL — ISO 8601 creation timestamp."
421
+ },
422
+ "updatedAt": {
423
+ "type": "string",
424
+ "format": "date-time",
425
+ "description": "OPTIONAL — ISO 8601 last-update timestamp."
426
+ },
427
+ "metadata": {
428
+ "type": "object",
429
+ "additionalProperties": true,
430
+ "default": {},
431
+ "description": "Vendor-specific extensions, namespaced under <vendor>. Hosts MUST tolerate unknown keys; the spec's normative fields MUST NOT change meaning."
432
+ }
433
+ }
434
+ }
435
+ }
436
+ }