@agentproto/corpus-cli 0.1.0-alpha.1 → 0.1.0-alpha.3

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 +43 -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 +2 -2
@@ -0,0 +1,149 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-11/LESSON.schema.json",
4
+ "title": "LESSON.md frontmatter (AIP-11)",
5
+ "description": "Validates the YAML frontmatter portion of an AIP-11 LESSON.md file — one transferable lesson distilled from a completed run.",
6
+ "type": "object",
7
+ "required": ["schema", "slug", "title", "trigger", "outcome", "evidence"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "schema": {
11
+ "const": "learning/v1",
12
+ "description": "Spec identifier. Must be the literal string 'learning/v1'."
13
+ },
14
+ "slug": {
15
+ "type": "string",
16
+ "minLength": 2,
17
+ "maxLength": 80,
18
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$",
19
+ "description": "Machine identifier, also the filename. Lowercase, digits, dashes. Imperative voice recommended."
20
+ },
21
+ "title": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 200,
25
+ "description": "One-sentence imperative title — what to do or avoid."
26
+ },
27
+ "trigger": {
28
+ "type": "object",
29
+ "required": ["description"],
30
+ "additionalProperties": false,
31
+ "properties": {
32
+ "description": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 1000,
36
+ "description": "Plain-text description of when this lesson applies."
37
+ },
38
+ "tags": {
39
+ "type": "array",
40
+ "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
41
+ "maxItems": 12,
42
+ "default": [],
43
+ "description": "Retrieval keywords. Keep narrow; three is usually enough."
44
+ },
45
+ "targets": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "operator": { "type": "string" },
52
+ "role": { "type": "string" },
53
+ "skill": { "type": "string" }
54
+ },
55
+ "minProperties": 1
56
+ },
57
+ "default": [],
58
+ "description": "Operator / role / skill globs that scope retrieval. Empty means anyone."
59
+ },
60
+ "metadata": {
61
+ "type": "object",
62
+ "additionalProperties": true,
63
+ "default": {},
64
+ "description": "Vendor-specific trigger predicates. Standard fields above MUST NOT be redefined here."
65
+ }
66
+ }
67
+ },
68
+ "outcome": {
69
+ "enum": ["success", "failure", "mixed"],
70
+ "description": "Whether the source run succeeded, failed, or the lesson is conditional across runs."
71
+ },
72
+ "evidence": {
73
+ "type": "array",
74
+ "minItems": 1,
75
+ "items": {
76
+ "type": "object",
77
+ "required": ["kind", "ref"],
78
+ "additionalProperties": false,
79
+ "properties": {
80
+ "kind": {
81
+ "enum": ["run", "conversation", "work-item", "audit", "wiki-page"],
82
+ "description": "What the evidence reference points to. 'audit' = AIP-7 governance record."
83
+ },
84
+ "ref": {
85
+ "type": "string",
86
+ "minLength": 1,
87
+ "maxLength": 256,
88
+ "description": "Opaque id or path the host can resolve. Never free text."
89
+ },
90
+ "note": {
91
+ "type": "string",
92
+ "maxLength": 500,
93
+ "description": "One-line factual note about the event — not the lesson."
94
+ }
95
+ }
96
+ },
97
+ "description": "Provenance — at least one evidence entry MUST resolve to a real run, conversation, work item, audit, or wiki page in the host's indices."
98
+ },
99
+ "confidence": {
100
+ "type": "number",
101
+ "minimum": 0,
102
+ "maximum": 1,
103
+ "default": 0.5,
104
+ "description": "Author's confidence in [0,1]. Default 0.5 at first sighting. Runtimes weigh this against observed counts."
105
+ },
106
+ "success_count": {
107
+ "type": "integer",
108
+ "minimum": 0,
109
+ "default": 0,
110
+ "description": "Times the lesson 'worked' when applied. Maintained by the runtime; author-supplied values are initial only."
111
+ },
112
+ "failure_count": {
113
+ "type": "integer",
114
+ "minimum": 0,
115
+ "default": 0,
116
+ "description": "Times the lesson's claim was contradicted. Maintained by the runtime; author-supplied values are initial only."
117
+ },
118
+ "supersedes": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "string",
122
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$"
123
+ },
124
+ "default": [],
125
+ "description": "Slugs of lessons this lesson replaces. Supersession is explicit, never silent. Each cited slug MUST exist on disk."
126
+ },
127
+ "expires_at": {
128
+ "type": "string",
129
+ "format": "date-time",
130
+ "description": "Soft TTL (ISO 8601). Past this instant, retrieval treats the lesson as absent by default."
131
+ },
132
+ "metadata": {
133
+ "type": "object",
134
+ "additionalProperties": true,
135
+ "default": {},
136
+ "description": "Vendor-specific extensions under namespaced keys (metadata.<vendor>.<field>). Standard fields MUST NOT be redefined."
137
+ }
138
+ },
139
+ "allOf": [
140
+ {
141
+ "if": {
142
+ "properties": { "outcome": { "const": "failure" } }
143
+ },
144
+ "then": {
145
+ "description": "A failure-only lesson is permitted with success_count=0 and failure_count>=1, but at least one evidence entry MUST be present (covered by the global minItems constraint)."
146
+ }
147
+ }
148
+ ]
149
+ }
@@ -0,0 +1,349 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-12/PLAYBOOK.schema.json",
4
+ "title": "PLAYBOOK.md frontmatter (AIP-12)",
5
+ "description": "Validates the YAML frontmatter portion of an AIP-12 PLAYBOOK.md overlay manifest.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema",
9
+ "slug",
10
+ "title",
11
+ "kind",
12
+ "lock_check",
13
+ "evidence",
14
+ "status"
15
+ ],
16
+ "additionalProperties": false,
17
+ "properties": {
18
+ "schema": {
19
+ "const": "playbooks/v1"
20
+ },
21
+ "slug": {
22
+ "type": "string",
23
+ "minLength": 2,
24
+ "maxLength": 80,
25
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$"
26
+ },
27
+ "title": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "maxLength": 200
31
+ },
32
+ "entry": {
33
+ "type": "string",
34
+ "description": "Optional path to the entry file exposing definePlaybook. Defaults to playbook.ts."
35
+ },
36
+ "targets": {
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "items": {
40
+ "$ref": "#/$defs/target"
41
+ },
42
+ "deprecated": true,
43
+ "description": "DEPRECATED in favor of `selector`. Legacy axis-ambiguous binding: runtimes compile each entry into a selector (kind 'operator' refs match BOTH the identity and the role axis — see AIP-12 §Selector binding). Kept valid forever; new files SHOULD declare `selector` instead."
44
+ },
45
+ "selector": {
46
+ "$ref": "#/$defs/selector",
47
+ "description": "Typed attachment binding evaluated against the subject's dimensions. Wins over `targets`/`binds_operator` when present."
48
+ },
49
+ "kind": {
50
+ "enum": [
51
+ "overlay",
52
+ "block-replacement"
53
+ ],
54
+ "default": "overlay"
55
+ },
56
+ "block": {
57
+ "type": "string",
58
+ "description": "Required when kind is 'block-replacement' — the named persona block to swap.",
59
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)*$"
60
+ },
61
+ "priority": {
62
+ "type": "integer",
63
+ "minimum": 0,
64
+ "maximum": 100,
65
+ "default": 50
66
+ },
67
+ "lock_check": {
68
+ "type": "array",
69
+ "description": "Locked persona traits this overlay MUST NOT modify. Author intent — runtime enforces independently.",
70
+ "items": {
71
+ "$ref": "#/$defs/traitId"
72
+ },
73
+ "default": []
74
+ },
75
+ "ttl": {
76
+ "type": "string",
77
+ "description": "Optional ISO 8601 duration. Auto-archives at updated_at + ttl.",
78
+ "pattern": "^P(?:\\d+Y)?(?:\\d+M)?(?:\\d+W)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+S)?)?$"
79
+ },
80
+ "evidence": {
81
+ "type": "array",
82
+ "minItems": 1,
83
+ "items": {
84
+ "$ref": "#/$defs/evidenceItem"
85
+ }
86
+ },
87
+ "status": {
88
+ "enum": [
89
+ "shadow",
90
+ "active",
91
+ "archived"
92
+ ],
93
+ "default": "shadow"
94
+ },
95
+ "supersedes": {
96
+ "type": "array",
97
+ "items": {
98
+ "$ref": "#/$defs/slug"
99
+ },
100
+ "default": []
101
+ },
102
+ "history": {
103
+ "type": "array",
104
+ "description": "Append-only audit trail of deltas, promotions, and archivals applied to this playbook.",
105
+ "items": {
106
+ "$ref": "#/$defs/historyEntry"
107
+ },
108
+ "default": []
109
+ },
110
+ "binds_operator": {
111
+ "type": "string",
112
+ "description": "DEPRECATED as a binding — provenance only when `selector` is present. Without `selector`, runtimes compile it like a kind 'operator' target (matches BOTH identity and role axes).",
113
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$",
114
+ "deprecated": true
115
+ },
116
+ "created_at": {
117
+ "type": "string",
118
+ "format": "date-time"
119
+ },
120
+ "updated_at": {
121
+ "type": "string",
122
+ "format": "date-time"
123
+ },
124
+ "tags": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "string",
128
+ "pattern": "^[a-z][a-z0-9-]*$"
129
+ },
130
+ "default": []
131
+ },
132
+ "metadata": {
133
+ "type": "object",
134
+ "additionalProperties": true,
135
+ "default": {},
136
+ "description": "Vendor extensions go under metadata.<vendor>."
137
+ }
138
+ },
139
+ "allOf": [
140
+ {
141
+ "if": {
142
+ "properties": {
143
+ "kind": {
144
+ "const": "block-replacement"
145
+ }
146
+ },
147
+ "required": [
148
+ "kind"
149
+ ]
150
+ },
151
+ "then": {
152
+ "required": [
153
+ "block"
154
+ ]
155
+ }
156
+ },
157
+ {
158
+ "anyOf": [
159
+ {
160
+ "required": [
161
+ "targets"
162
+ ]
163
+ },
164
+ {
165
+ "required": [
166
+ "selector"
167
+ ]
168
+ }
169
+ ]
170
+ }
171
+ ],
172
+ "$defs": {
173
+ "slug": {
174
+ "type": "string",
175
+ "minLength": 2,
176
+ "maxLength": 80,
177
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$"
178
+ },
179
+ "traitId": {
180
+ "type": "string",
181
+ "minLength": 2,
182
+ "maxLength": 64,
183
+ "pattern": "^[a-z][a-z0-9-]*$"
184
+ },
185
+ "target": {
186
+ "type": "object",
187
+ "required": [
188
+ "kind",
189
+ "ref"
190
+ ],
191
+ "additionalProperties": false,
192
+ "properties": {
193
+ "kind": {
194
+ "enum": [
195
+ "operator",
196
+ "role",
197
+ "skill",
198
+ "runtime"
199
+ ]
200
+ },
201
+ "ref": {
202
+ "type": "string",
203
+ "minLength": 1,
204
+ "maxLength": 200,
205
+ "description": "Slug, glob, or qualified path. Examples: 'role/companion', 'operator/alice', 'skill/research', 'operator/*'."
206
+ }
207
+ }
208
+ },
209
+ "evidenceItem": {
210
+ "type": "object",
211
+ "required": [
212
+ "kind",
213
+ "ref"
214
+ ],
215
+ "additionalProperties": false,
216
+ "properties": {
217
+ "kind": {
218
+ "enum": [
219
+ "run",
220
+ "conversation",
221
+ "work-item",
222
+ "reflection",
223
+ "human"
224
+ ]
225
+ },
226
+ "ref": {
227
+ "type": "string",
228
+ "minLength": 1,
229
+ "maxLength": 500
230
+ },
231
+ "note": {
232
+ "type": "string",
233
+ "maxLength": 1000
234
+ }
235
+ }
236
+ },
237
+ "historyEntry": {
238
+ "type": "object",
239
+ "required": [
240
+ "at",
241
+ "kind",
242
+ "summary"
243
+ ],
244
+ "additionalProperties": false,
245
+ "properties": {
246
+ "at": {
247
+ "type": "string",
248
+ "format": "date-time"
249
+ },
250
+ "kind": {
251
+ "enum": [
252
+ "created",
253
+ "delta",
254
+ "promoted",
255
+ "archived",
256
+ "superseded",
257
+ "lock-violation"
258
+ ]
259
+ },
260
+ "summary": {
261
+ "type": "string",
262
+ "minLength": 1,
263
+ "maxLength": 1000
264
+ },
265
+ "source": {
266
+ "type": "string",
267
+ "description": "Pointer to the run/reflection/governance ticket that produced this entry."
268
+ },
269
+ "by": {
270
+ "type": "string",
271
+ "description": "User id, agent id, or system identifier responsible for the entry."
272
+ },
273
+ "gate": {
274
+ "enum": [
275
+ "a-b",
276
+ "scorer",
277
+ "human",
278
+ "governance"
279
+ ],
280
+ "description": "For kind='promoted', the gate that passed."
281
+ }
282
+ }
283
+ },
284
+ "selector": {
285
+ "type": "object",
286
+ "minProperties": 1,
287
+ "description": "Short form: axis keys (identity, role, position, capability, or host-registered) mapping to a ref or ref list — AND across keys, OR within a list. Long form: explicit `allOf`/`anyOf` selector-term lists for OR across axes. An asset that wants every subject in scope says so explicitly with `\"*\"`; an empty selector matches nothing.",
288
+ "properties": {
289
+ "allOf": {
290
+ "type": "array",
291
+ "items": {
292
+ "$ref": "#/$defs/selectorTerm"
293
+ }
294
+ },
295
+ "anyOf": {
296
+ "type": "array",
297
+ "items": {
298
+ "$ref": "#/$defs/selectorTerm"
299
+ }
300
+ }
301
+ },
302
+ "additionalProperties": {
303
+ "$ref": "#/$defs/selectorRefs"
304
+ }
305
+ },
306
+ "selectorTerm": {
307
+ "type": "object",
308
+ "required": [
309
+ "axis",
310
+ "anyOf"
311
+ ],
312
+ "additionalProperties": false,
313
+ "properties": {
314
+ "axis": {
315
+ "type": "string",
316
+ "minLength": 1,
317
+ "maxLength": 64
318
+ },
319
+ "anyOf": {
320
+ "type": "array",
321
+ "minItems": 1,
322
+ "items": {
323
+ "$ref": "#/$defs/selectorRef"
324
+ }
325
+ }
326
+ }
327
+ },
328
+ "selectorRefs": {
329
+ "oneOf": [
330
+ {
331
+ "$ref": "#/$defs/selectorRef"
332
+ },
333
+ {
334
+ "type": "array",
335
+ "minItems": 1,
336
+ "items": {
337
+ "$ref": "#/$defs/selectorRef"
338
+ }
339
+ }
340
+ ]
341
+ },
342
+ "selectorRef": {
343
+ "type": "string",
344
+ "minLength": 1,
345
+ "maxLength": 200,
346
+ "description": "Axis value slug, prefixed ref (e.g. 'role/sales-rep'), or '*' (any present value)."
347
+ }
348
+ }
349
+ }