@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,169 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/docs/aip-14/TOOL.schema.json",
4
+ "title": "TOOL.md frontmatter — agenttool/v1 (abstract agent contract)",
5
+ "description": "Validates the YAML frontmatter portion of an AIP-14 TOOL.md manifest. Implementation-specific fields (code/run/runner/secrets/network/entry) are NOT part of this schema — they live on the AIP-30 PROVIDER schema.",
6
+ "type": "object",
7
+ "required": ["name", "id", "description", "version", "inputs", "outputs"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "name": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 80,
14
+ "description": "Human-readable display name."
15
+ },
16
+ "id": {
17
+ "type": "string",
18
+ "minLength": 2,
19
+ "maxLength": 80,
20
+ "pattern": "^[a-z0-9][a-z0-9.\\-]*[a-z0-9]$",
21
+ "description": "Machine identifier. Lowercase, digits, dashes, dots. Dots denote namespace."
22
+ },
23
+ "description": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "maxLength": 2000,
27
+ "description": "One-paragraph purpose, written for the LLM caller."
28
+ },
29
+ "version": {
30
+ "type": "string",
31
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.\\-]+)?$",
32
+ "description": "Spec version of THIS file. Bump on breaking change to inputs/outputs/side-effect profile."
33
+ },
34
+ "inputs": {
35
+ "description": "Defined by AIP-16 — the IO `inputs` block.",
36
+ "$ref": "https://agentproto.sh/docs/aip-16/IO.schema.json#/$defs/inputs"
37
+ },
38
+ "outputs": {
39
+ "description": "Defined by AIP-16 — the IO `outputs` block.",
40
+ "$ref": "https://agentproto.sh/docs/aip-16/IO.schema.json#/$defs/outputs"
41
+ },
42
+ "idempotent": {
43
+ "type": "boolean",
44
+ "default": false,
45
+ "description": "Logical idempotency at contract level. Network-level retry safety belongs to PROVIDER's retry_override."
46
+ },
47
+ "mutates": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string",
51
+ "pattern": "^[a-z]+:[^\\s]+$",
52
+ "description": "Format: <class>:<scope>. Examples: network:*, workspace:/path, database:invoices."
53
+ },
54
+ "default": []
55
+ },
56
+ "requires": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "network": { "type": "array", "items": { "type": "string" } },
61
+ "secrets": { "type": "array", "items": { "type": "string" } },
62
+ "tools": { "type": "array", "items": { "type": "string" } }
63
+ },
64
+ "description": "Capability requirements for governance gating per AIP-7. Providers MAY add to this set; MUST NOT remove from it."
65
+ },
66
+ "approval": {
67
+ "anyOf": [
68
+ { "enum": ["auto", "always", "on-mutate"] },
69
+ { "type": "string", "pattern": "^policy:[A-Za-z0-9_./-]+$" }
70
+ ],
71
+ "default": "auto",
72
+ "description": "Approval class. 'auto' | 'always' | 'on-mutate' | 'policy:<ref>'. Contract-level — providers can't downgrade."
73
+ },
74
+ "risk_level": {
75
+ "type": "integer",
76
+ "minimum": 0,
77
+ "maximum": 3,
78
+ "default": 0,
79
+ "description": "0=read-only, 1=scoped writes, 2=external side effects, 3=irreversible."
80
+ },
81
+ "cost_class": {
82
+ "enum": ["trivial", "metered", "expensive"],
83
+ "default": "trivial",
84
+ "description": "Baseline. Providers MAY override via cost_override.cost_class."
85
+ },
86
+ "timeout_ms": {
87
+ "type": "integer",
88
+ "minimum": 1,
89
+ "default": 30000,
90
+ "description": "Hard wall-clock contract ceiling. Providers MAY narrow via timeout_override_ms; MUST NOT widen."
91
+ },
92
+ "retry": {
93
+ "type": "object",
94
+ "required": ["max_attempts", "backoff"],
95
+ "additionalProperties": false,
96
+ "properties": {
97
+ "max_attempts": { "type": "integer", "minimum": 1, "maximum": 20 },
98
+ "backoff": { "enum": ["fixed", "exponential"] },
99
+ "initial_ms": { "type": "integer", "minimum": 0 }
100
+ },
101
+ "description": "Baseline retry policy. Providers MAY override via retry_override."
102
+ },
103
+ "default_implementation": {
104
+ "type": ["string", "null"],
105
+ "pattern": "^[a-z0-9][a-z0-9.\\-]{1,79}$",
106
+ "description": "Optional provider.id to use when the resolver has no other signal. Null = pick by resolver policy."
107
+ },
108
+ "driver_constraints": {
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "properties": {
112
+ "forbid": {
113
+ "type": "array",
114
+ "items": { "enum": ["cli", "http", "mcp", "sdk", "builtin"] },
115
+ "uniqueItems": true,
116
+ "description": "Provider kinds the contract refuses (e.g. ['http'] for self-hosted-only tools)."
117
+ },
118
+ "require_kind": {
119
+ "type": "array",
120
+ "items": { "enum": ["cli", "http", "mcp", "sdk", "builtin"] },
121
+ "uniqueItems": true,
122
+ "description": "Whitelist of allowed provider kinds. Empty = all kinds permitted (subject to forbid)."
123
+ }
124
+ }
125
+ },
126
+ "tags": {
127
+ "type": "array",
128
+ "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
129
+ "uniqueItems": true,
130
+ "default": []
131
+ },
132
+ "examples": {
133
+ "type": "array",
134
+ "items": {
135
+ "type": "object",
136
+ "required": ["name", "input"],
137
+ "additionalProperties": false,
138
+ "properties": {
139
+ "name": { "type": "string" },
140
+ "input": {},
141
+ "output": {},
142
+ "note": { "type": "string" }
143
+ }
144
+ },
145
+ "default": [],
146
+ "description": "Provider-agnostic examples. Every conformant provider MUST satisfy these. Provider-specific edge cases live on the PROVIDER's own examples."
147
+ },
148
+ "metadata": {
149
+ "type": "object",
150
+ "additionalProperties": true,
151
+ "default": {}
152
+ }
153
+ },
154
+ "allOf": [
155
+ {
156
+ "if": {
157
+ "properties": { "approval": { "const": "auto" } }
158
+ },
159
+ "then": {
160
+ "properties": {
161
+ "mutates": {
162
+ "type": "array",
163
+ "maxItems": 0
164
+ }
165
+ }
166
+ }
167
+ }
168
+ ]
169
+ }
@@ -0,0 +1,356 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-15/WORKFLOW.schema.json",
4
+ "title": "WORKFLOW.md frontmatter (AIP-15)",
5
+ "description": "Validates the YAML frontmatter portion of an AIP-15 WORKFLOW.md manifest.",
6
+ "type": "object",
7
+ "required": [
8
+ "name",
9
+ "id",
10
+ "description",
11
+ "version",
12
+ "inputs",
13
+ "outputs",
14
+ "steps"
15
+ ],
16
+ "additionalProperties": false,
17
+ "properties": {
18
+ "name": { "type": "string", "minLength": 1, "maxLength": 80 },
19
+ "id": {
20
+ "type": "string",
21
+ "minLength": 2,
22
+ "maxLength": 64,
23
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$"
24
+ },
25
+ "description": { "type": "string", "minLength": 1, "maxLength": 2000 },
26
+ "version": {
27
+ "type": "string",
28
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][a-zA-Z0-9.-]+)?$"
29
+ },
30
+ "entry": { "type": "string" },
31
+ "inputs": {
32
+ "description": "Defined by AIP-16 — the IO `inputs` block.",
33
+ "$ref": "https://agentproto.sh/schemas/aip-16/IO.schema.json#/$defs/inputs"
34
+ },
35
+ "outputs": {
36
+ "description": "Defined by AIP-16 — the IO `outputs` block.",
37
+ "$ref": "https://agentproto.sh/schemas/aip-16/IO.schema.json#/$defs/outputs"
38
+ },
39
+ "result": {
40
+ "description": "Optional value expression mapping step results to the workflow output, using the same reference grammar as a step's `inputs` ($input.*, $steps.<id>.*, literals). Omitted ⇒ the output is the final step's result. Its shape SHOULD satisfy `outputs`.",
41
+ "type": ["object", "string"]
42
+ },
43
+ "steps": {
44
+ "type": "array",
45
+ "minItems": 1,
46
+ "items": { "$ref": "#/$defs/step" }
47
+ },
48
+ "start": { "type": "string" },
49
+ "suspendable": { "type": "boolean" },
50
+ "triggers": {
51
+ "type": "array",
52
+ "items": { "$ref": "#/$defs/trigger" },
53
+ "default": []
54
+ },
55
+ "requires": {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "properties": {
59
+ "network": { "type": "array", "items": { "type": "string" } },
60
+ "fs.read": { "type": "array", "items": { "type": "string" } },
61
+ "fs.write": { "type": "array", "items": { "type": "string" } },
62
+ "env": { "type": "array", "items": { "type": "string" } },
63
+ "secrets": { "type": "array", "items": { "type": "string" } },
64
+ "tools": { "type": "array", "items": { "type": "string" } }
65
+ }
66
+ },
67
+ "approval": { "$ref": "#/$defs/approval", "default": "per-step" },
68
+ "risk_level": { "type": "integer", "minimum": 0, "maximum": 3 },
69
+ "timeout_ms": { "type": "integer", "minimum": 1, "default": 600000 },
70
+ "max_steps": { "type": "integer", "minimum": 1, "default": 100 },
71
+ "retry": { "$ref": "#/$defs/retry" },
72
+ "cost_class": {
73
+ "enum": ["trivial", "metered", "expensive"],
74
+ "default": "metered"
75
+ },
76
+ "tags": {
77
+ "type": "array",
78
+ "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
79
+ "default": []
80
+ },
81
+ "metadata": {
82
+ "type": "object",
83
+ "additionalProperties": true,
84
+ "default": {}
85
+ },
86
+ "inputsFiles": {
87
+ "description": "Defined by AIP-16 — the IO `inputsFiles` block.",
88
+ "$ref": "https://agentproto.sh/schemas/aip-16/IO.schema.json#/$defs/inputsFiles"
89
+ },
90
+ "outputsFiles": {
91
+ "description": "Defined by AIP-16 — the IO `outputsFiles` block.",
92
+ "$ref": "https://agentproto.sh/schemas/aip-16/IO.schema.json#/$defs/outputsFiles"
93
+ },
94
+ "runtime": {
95
+ "description": "Defined by AIP-17 — the runner block.",
96
+ "$ref": "https://agentproto.sh/schemas/aip-17/RUNNER.schema.json#/$defs/runner"
97
+ }
98
+ },
99
+ "$defs": {
100
+ "jsonSchema": {
101
+ "description": "Any JSON Schema draft 2020-12 document. Validation deferred to a meta-validator.",
102
+ "type": "object"
103
+ },
104
+ "approval": {
105
+ "anyOf": [
106
+ { "enum": ["auto", "always", "on-mutate", "per-step"] },
107
+ { "type": "string", "pattern": "^policy:[A-Za-z0-9_./-]+$" }
108
+ ]
109
+ },
110
+ "retry": {
111
+ "type": "object",
112
+ "required": ["max_attempts", "backoff"],
113
+ "additionalProperties": false,
114
+ "properties": {
115
+ "max_attempts": { "type": "integer", "minimum": 1, "maximum": 20 },
116
+ "backoff": { "enum": ["fixed", "exponential"] },
117
+ "initial_ms": { "type": "integer", "minimum": 0 }
118
+ }
119
+ },
120
+ "trigger": {
121
+ "oneOf": [
122
+ {
123
+ "type": "object",
124
+ "required": ["kind", "cron"],
125
+ "additionalProperties": false,
126
+ "properties": {
127
+ "kind": { "const": "schedule" },
128
+ "cron": { "type": "string" },
129
+ "timezone": { "type": "string" }
130
+ }
131
+ },
132
+ {
133
+ "type": "object",
134
+ "required": ["kind", "path"],
135
+ "additionalProperties": false,
136
+ "properties": {
137
+ "kind": { "const": "webhook" },
138
+ "path": { "type": "string", "pattern": "^/" }
139
+ }
140
+ },
141
+ {
142
+ "type": "object",
143
+ "required": ["kind", "name"],
144
+ "additionalProperties": false,
145
+ "properties": {
146
+ "kind": { "const": "event" },
147
+ "name": { "type": "string" }
148
+ }
149
+ },
150
+ {
151
+ "type": "object",
152
+ "required": ["kind"],
153
+ "additionalProperties": false,
154
+ "properties": {
155
+ "kind": { "const": "manual" },
156
+ "label": { "type": "string" }
157
+ }
158
+ }
159
+ ]
160
+ },
161
+ "stepCommon": {
162
+ "type": "object",
163
+ "required": ["id", "kind"],
164
+ "properties": {
165
+ "id": {
166
+ "type": "string",
167
+ "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$",
168
+ "minLength": 2,
169
+ "maxLength": 64
170
+ },
171
+ "name": { "type": "string", "maxLength": 80 },
172
+ "description": { "type": "string", "maxLength": 1000 },
173
+ "kind": {
174
+ "enum": [
175
+ "tool",
176
+ "branch",
177
+ "parallel",
178
+ "suspend",
179
+ "approval",
180
+ "map",
181
+ "loop",
182
+ "subworkflow"
183
+ ]
184
+ },
185
+ "inputs": { "type": "object" },
186
+ "outputs": { "$ref": "#/$defs/jsonSchema" },
187
+ "next": { "type": "string" },
188
+ "approval": { "$ref": "#/$defs/approval" },
189
+ "risk_level": { "type": "integer", "minimum": 0, "maximum": 3 },
190
+ "timeout_ms": { "type": "integer", "minimum": 1 },
191
+ "retry": { "$ref": "#/$defs/retry" },
192
+ "compensation": { "type": "string" }
193
+ }
194
+ },
195
+ "step": {
196
+ "allOf": [
197
+ { "$ref": "#/$defs/stepCommon" },
198
+ {
199
+ "oneOf": [
200
+ { "$ref": "#/$defs/stepTool" },
201
+ { "$ref": "#/$defs/stepBranch" },
202
+ { "$ref": "#/$defs/stepParallel" },
203
+ { "$ref": "#/$defs/stepSuspend" },
204
+ { "$ref": "#/$defs/stepApproval" },
205
+ { "$ref": "#/$defs/stepMap" },
206
+ { "$ref": "#/$defs/stepLoop" },
207
+ { "$ref": "#/$defs/stepSubworkflow" }
208
+ ]
209
+ }
210
+ ]
211
+ },
212
+ "stepTool": {
213
+ "type": "object",
214
+ "required": ["kind", "tool"],
215
+ "properties": {
216
+ "kind": { "const": "tool" },
217
+ "tool": {
218
+ "anyOf": [
219
+ { "type": "string" },
220
+ {
221
+ "type": "object",
222
+ "required": ["entry"],
223
+ "properties": {
224
+ "entry": { "type": "string" }
225
+ }
226
+ }
227
+ ]
228
+ }
229
+ }
230
+ },
231
+ "stepBranch": {
232
+ "type": "object",
233
+ "required": ["kind", "branches"],
234
+ "properties": {
235
+ "kind": { "const": "branch" },
236
+ "branches": {
237
+ "type": "array",
238
+ "minItems": 1,
239
+ "items": {
240
+ "type": "object",
241
+ "required": ["when", "next"],
242
+ "properties": {
243
+ "when": { "type": "string" },
244
+ "next": { "type": "string" }
245
+ }
246
+ }
247
+ },
248
+ "default": { "type": "string" }
249
+ }
250
+ },
251
+ "stepParallel": {
252
+ "type": "object",
253
+ "required": ["kind", "branches"],
254
+ "properties": {
255
+ "kind": { "const": "parallel" },
256
+ "branches": {
257
+ "type": "array",
258
+ "minItems": 2,
259
+ "items": {
260
+ "type": "object",
261
+ "required": ["id", "steps"],
262
+ "properties": {
263
+ "id": { "type": "string" },
264
+ "steps": { "type": "array", "items": { "$ref": "#/$defs/step" } },
265
+ "next": { "type": "string" }
266
+ }
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "stepSuspend": {
272
+ "type": "object",
273
+ "required": ["kind", "resume"],
274
+ "properties": {
275
+ "kind": { "const": "suspend" },
276
+ "resume": {
277
+ "type": "object",
278
+ "required": ["on"],
279
+ "properties": {
280
+ "on": {
281
+ "type": "array",
282
+ "items": { "type": "string" },
283
+ "minItems": 1
284
+ },
285
+ "timeout_ms": { "type": "integer", "minimum": 1 },
286
+ "on_timeout": { "type": "string" }
287
+ }
288
+ }
289
+ }
290
+ },
291
+ "stepApproval": {
292
+ "type": "object",
293
+ "required": ["kind", "prompt", "approvers"],
294
+ "properties": {
295
+ "kind": { "const": "approval" },
296
+ "prompt": { "type": "string" },
297
+ "artifacts": { "type": "array", "items": { "type": "string" } },
298
+ "approvers": {
299
+ "type": "array",
300
+ "minItems": 1,
301
+ "items": {
302
+ "type": "object",
303
+ "anyOf": [
304
+ {
305
+ "required": ["role"],
306
+ "properties": { "role": { "type": "string" } }
307
+ },
308
+ {
309
+ "required": ["userId"],
310
+ "properties": { "userId": { "type": "string" } }
311
+ }
312
+ ]
313
+ }
314
+ },
315
+ "timeout_ms": { "type": "integer", "minimum": 1 },
316
+ "on_approve": {
317
+ "type": "object",
318
+ "properties": { "next": { "type": "string" } }
319
+ },
320
+ "on_reject": {
321
+ "type": "object",
322
+ "properties": { "next": { "type": "string" } }
323
+ },
324
+ "on_timeout": { "type": "string" }
325
+ }
326
+ },
327
+ "stepMap": {
328
+ "type": "object",
329
+ "required": ["kind", "over", "steps"],
330
+ "properties": {
331
+ "kind": { "const": "map" },
332
+ "over": { "type": "string" },
333
+ "parallelism": { "type": "integer", "minimum": 0 },
334
+ "steps": { "type": "array", "items": { "$ref": "#/$defs/step" } }
335
+ }
336
+ },
337
+ "stepLoop": {
338
+ "type": "object",
339
+ "required": ["kind", "while", "max_iterations", "steps"],
340
+ "properties": {
341
+ "kind": { "const": "loop" },
342
+ "while": { "type": "string" },
343
+ "max_iterations": { "type": "integer", "minimum": 1, "maximum": 1000 },
344
+ "steps": { "type": "array", "items": { "$ref": "#/$defs/step" } }
345
+ }
346
+ },
347
+ "stepSubworkflow": {
348
+ "type": "object",
349
+ "required": ["kind", "workflow"],
350
+ "properties": {
351
+ "kind": { "const": "subworkflow" },
352
+ "workflow": { "type": "string" }
353
+ }
354
+ }
355
+ }
356
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-16/IO.schema.json",
4
+ "title": "IO blocks (AIP-16)",
5
+ "description": "Composable JSON Schema definitions for the four input/output blocks reused across manifest formats: inputs, outputs, inputsFiles, outputsFiles. Other AIPs reference these by $ref into their own schemas.",
6
+ "type": "object",
7
+ "$defs": {
8
+ "inputs": {
9
+ "description": "Structured arguments. Validated by the host before the body runs.",
10
+ "$ref": "#/$defs/jsonSchema"
11
+ },
12
+ "outputs": {
13
+ "description": "Structured success-case return. Errors are out-of-band per the importing manifest's error model.",
14
+ "$ref": "#/$defs/jsonSchema"
15
+ },
16
+ "inputsFiles": {
17
+ "description": "File-contract IN. Map of <key> → file entry. Host stages workspace:<path> into <fsRoot>/<key> before the run.",
18
+ "type": "object",
19
+ "additionalProperties": { "$ref": "#/$defs/fileContractEntry" },
20
+ "default": {}
21
+ },
22
+ "outputsFiles": {
23
+ "description": "File-contract OUT. Map of <key> → file entry. Host syncs <fsRoot>/<key> back to workspace:<path> after the run.",
24
+ "type": "object",
25
+ "additionalProperties": { "$ref": "#/$defs/fileContractEntry" },
26
+ "default": {}
27
+ },
28
+ "fileContractEntry": {
29
+ "description": "A single declared file in inputsFiles/outputsFiles.",
30
+ "type": "object",
31
+ "required": ["path"],
32
+ "additionalProperties": false,
33
+ "properties": {
34
+ "path": {
35
+ "description": "Workspace-relative path. outputsFiles entries MAY use the tokens <runId>, <workflowId>, <toolId>, <isoDate> for per-run path interpolation.",
36
+ "type": "string",
37
+ "minLength": 1
38
+ },
39
+ "mode": {
40
+ "description": "Convention only — not enforced by the contract. `ro` for inputs is the typical default; `rw` for outputs.",
41
+ "enum": ["ro", "rw"]
42
+ },
43
+ "contentType": {
44
+ "description": "Informational MIME type. Hosts MAY surface in audit logs / UIs.",
45
+ "type": "string"
46
+ }
47
+ }
48
+ },
49
+ "jsonSchema": {
50
+ "description": "Any JSON Schema draft 2020-12 document. Validation deferred to a meta-validator.",
51
+ "type": "object"
52
+ },
53
+ "reservedFsRootField": {
54
+ "description": "Importing manifests SHOULD include this key in their `inputs` schema's `properties` when they declare inputsFiles/outputsFiles. Hosts inject the absolute scratch-root path here before the body runs.",
55
+ "type": "object",
56
+ "properties": {
57
+ "_workflowFsRoot": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-17/RUNNER.schema.json",
4
+ "title": "Runner block (AIP-17)",
5
+ "description": "Composable JSON Schema definition for the `runner` block — process boundary, optional container image, declarative dependency needs, and resource limits. Other AIPs reference this by $ref into their own schemas.",
6
+ "type": "object",
7
+ "$defs": {
8
+ "runner": {
9
+ "description": "Process boundary that hosts the body. Engine + optional image + declarative needs + resource limits.",
10
+ "type": "object",
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "engine": {
14
+ "description": "Where the process runs. `subprocess` (default): host-local Node `--permission` child. `sandbox`: real container via the host's SandboxProviderAdapter. `in-process`: dynamic import inside the host process; reserved for trusted/vendor code, silently downgraded to `subprocess` for untrusted origins.",
15
+ "enum": ["subprocess", "sandbox", "in-process"],
16
+ "default": "subprocess"
17
+ },
18
+ "image": {
19
+ "description": "Sandbox template id from the host registry. Only meaningful for `engine: sandbox`. When omitted, the host auto-picks via `needs`.",
20
+ "type": "string",
21
+ "minLength": 1
22
+ },
23
+ "needs": {
24
+ "description": "Declarative dependency requirements. Hosts use these to auto-pick an image, install missing deps at cold-start, and surface them in trust UIs.",
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "properties": {
28
+ "language": {
29
+ "description": "Primary language runtime.",
30
+ "enum": ["node", "python", "multi"]
31
+ },
32
+ "native": {
33
+ "description": "OS-level package names. Default convention: Debian/Ubuntu apt names.",
34
+ "type": "array",
35
+ "items": { "type": "string", "minLength": 1 },
36
+ "default": []
37
+ },
38
+ "npm": {
39
+ "description": "Additional npm packages installed via `npm install` after lockfile-driven `npm ci`.",
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "pattern": "^@?[^@]+@?.*$"
45
+ },
46
+ "default": []
47
+ },
48
+ "pip": {
49
+ "description": "Additional pip packages installed via `pip install --user`.",
50
+ "type": "array",
51
+ "items": { "type": "string", "minLength": 1 },
52
+ "default": []
53
+ }
54
+ }
55
+ },
56
+ "limits": {
57
+ "description": "Resource caps. Advisory but enforceable when the isolation primitive supports it.",
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "properties": {
61
+ "memory_mb": {
62
+ "description": "Hard memory cap in MiB.",
63
+ "type": "integer",
64
+ "minimum": 1
65
+ },
66
+ "timeout_ms": {
67
+ "description": "Hard wall-clock cap in ms.",
68
+ "type": "integer",
69
+ "minimum": 1
70
+ },
71
+ "cpu_ms": {
72
+ "description": "CPU-time cap in ms. Hosts that can't enforce it ignore this field.",
73
+ "type": "integer",
74
+ "minimum": 1
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }