@agentproto/corpus-cli 0.10.2 → 0.11.1

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 (25) hide show
  1. package/dist/cli.mjs +164 -93
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/ports/index.d.ts +37 -1
  4. package/dist/ports/index.mjs +141 -74
  5. package/dist/ports/index.mjs.map +1 -1
  6. package/dist/specs/resources/aip-10/draft/KNOWLEDGE.schema.json +2 -2
  7. package/dist/specs/resources/aip-18/draft/COLLECTION.schema.json +9 -2
  8. package/dist/specs/resources/aip-19/draft/SECRETS.schema.json +8 -2
  9. package/dist/specs/resources/aip-20/draft/WORK.schema.json +232 -206
  10. package/dist/specs/resources/aip-34/draft/EXPORT.schema.json +29 -0
  11. package/dist/specs/resources/aip-34/draft/LOCK.schema.json +76 -0
  12. package/dist/specs/resources/aip-34/draft/TYPES.schema.json +78 -0
  13. package/dist/specs/resources/aip-34/draft/WORKSPACE.schema.json +236 -105
  14. package/dist/specs/resources/aip-42/draft/AGENT.schema.json +5 -0
  15. package/dist/specs/resources/aip-49/draft/ASSET.schema.json +10 -0
  16. package/dist/specs/resources/aip-53/draft/APP.schema.json +862 -43
  17. package/dist/specs/resources/aip-58/draft/event.schema.json +3 -2
  18. package/dist/specs/resources/aip-62/draft/ATTESTATION.schema.json +368 -62
  19. package/dist/specs/resources/aip-62/draft/REVIEW.schema.json +201 -43
  20. package/dist/specs/resources/aip-63/draft/BROWSER.schema.json +427 -0
  21. package/dist/specs/resources/aip-63/draft/RECORDING.schema.json +292 -0
  22. package/dist/specs/resources/aip-7/draft/GOVERNANCE.schema.json +2 -2
  23. package/dist/specs/resources/pending/memory/draft/MEMORY.schema.json +321 -0
  24. package/dist/specs/resources/pending/services/SERVICES.schema.json +35 -0
  25. package/package.json +7 -7
@@ -0,0 +1,427 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/docs/aip-63/BROWSER.schema.json",
4
+ "title": "BROWSER.md frontmatter, agentbrowser/v1",
5
+ "description": "JSON Schema for the YAML frontmatter of an AIP-63 browser provider manifest. A browser manifest is ANY-kind AIP-30 DRIVER frontmatter plus a `browser:` block: the AIP-30 schema applies unchanged (via allOf), and the kind's own subtype schema (for example AIP-29 for kind cli) still applies in addition. The $defs also carry the consent grant record (`grant`) and the consent ledger record (`ledgerRecord`), validated by `$ref` to `#/$defs/grant` and `#/$defs/ledgerRecord`.",
6
+ "type": "object",
7
+ "required": ["browser"],
8
+ "allOf": [
9
+ { "$ref": "https://agentproto.sh/docs/aip-30/DRIVER.schema.json" },
10
+ {
11
+ "properties": {
12
+ "browser": { "$ref": "#/$defs/browser" }
13
+ }
14
+ },
15
+ {
16
+ "description": "M4: a tool in implements[] whose capability gate is closed is a manifest error.",
17
+ "if": {
18
+ "required": ["implements"],
19
+ "properties": {
20
+ "implements": {
21
+ "contains": {
22
+ "required": ["tool"],
23
+ "properties": { "tool": { "enum": ["browser.list_requests", "browser.get_request_body", "browser.cdp_send"] } }
24
+ }
25
+ }
26
+ }
27
+ },
28
+ "then": {
29
+ "properties": {
30
+ "browser": {
31
+ "required": ["capabilities"],
32
+ "properties": {
33
+ "capabilities": { "required": ["cdp"], "properties": { "cdp": { "const": true } } }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ },
39
+ {
40
+ "if": {
41
+ "required": ["implements"],
42
+ "properties": {
43
+ "implements": { "contains": { "required": ["tool"], "properties": { "tool": { "const": "browser.download" } } } }
44
+ }
45
+ },
46
+ "then": {
47
+ "properties": {
48
+ "browser": {
49
+ "required": ["capabilities"],
50
+ "properties": {
51
+ "capabilities": { "required": ["downloads"], "properties": { "downloads": { "const": true } } }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ },
57
+ {
58
+ "if": {
59
+ "required": ["implements"],
60
+ "properties": {
61
+ "implements": { "contains": { "required": ["tool"], "properties": { "tool": { "const": "browser.act" } } } }
62
+ }
63
+ },
64
+ "then": {
65
+ "properties": {
66
+ "browser": {
67
+ "required": ["capabilities"],
68
+ "properties": {
69
+ "capabilities": { "required": ["aiActions"], "properties": { "aiActions": { "const": true } } }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ ],
76
+ "$defs": {
77
+ "domain": {
78
+ "type": "string",
79
+ "maxLength": 253,
80
+ "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+([a-z]{2,63}|xn--[a-z0-9-]{1,59})$",
81
+ "description": "An explicit lowercase registrable domain or host (at least two labels, ASCII or punycode). No wildcard, no leading dot, no bare TLD. A schema cannot see the Public Suffix List, so a host MUST additionally reject public suffixes (for example co.uk) at runtime (C2)."
82
+ },
83
+ "sha256Hex": {
84
+ "type": "string",
85
+ "pattern": "^[0-9a-f]{64}$"
86
+ },
87
+ "conformanceLevel": {
88
+ "type": "string",
89
+ "enum": ["core", "interaction", "network", "download", "profile", "recording"]
90
+ },
91
+ "capabilities": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "description": "Absent boolean = false. Absent recording = none. A closed gate makes the dependent tools return browser:unsupported naming the capability (T3).",
95
+ "properties": {
96
+ "cdp": { "type": "boolean", "description": "A Chrome DevTools Protocol endpoint is available (browser.endpoints.cdp)." },
97
+ "downloads": { "type": "boolean" },
98
+ "recording": { "type": "string", "enum": ["none", "screencast", "video"] },
99
+ "stealth": { "type": "boolean", "description": "A declared design goal, not a guarantee of undetectability." },
100
+ "fullPageScreenshot": { "type": "boolean" },
101
+ "trustedInput": { "type": "boolean", "description": "Input events are produced at the browser or OS level and are indistinguishable from user input to page script (isTrusted true)." },
102
+ "multiTarget": { "type": "boolean", "description": "More than one tab or page target per instance." },
103
+ "aiActions": { "type": "boolean", "description": "Natural-language actions (browser.act) are served by the provider." },
104
+ "cookies": { "type": "boolean", "description": "Cookies can be set on and read from a context by the host." },
105
+ "storageState": { "type": "boolean", "description": "A full storage state (cookies plus origin storage) can be loaded into a context." },
106
+ "persistentProfile": { "type": "boolean", "description": "A named profile survives instance stop." }
107
+ }
108
+ },
109
+ "endpoint": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "url": { "type": "string", "description": "Default endpoint. A local provider SHOULD default to a loopback address." },
114
+ "discovered": { "type": "boolean", "description": "true when the endpoint is only known after launch (for example a remote session's CDP URL)." }
115
+ },
116
+ "anyOf": [{ "required": ["url"] }, { "required": ["discovered"] }]
117
+ },
118
+ "sink": {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": ["id", "kind"],
122
+ "properties": {
123
+ "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9.\\-]{1,79}$" },
124
+ "kind": { "type": "string", "enum": ["local", "remote"] },
125
+ "operator": { "type": "string", "description": "Who receives session material at this sink (informational, shown in the acknowledgement prompt)." },
126
+ "region": { "type": "array", "items": { "type": "string" } },
127
+ "ack": { "type": "string", "enum": ["none", "required"], "default": "none" }
128
+ },
129
+ "if": { "properties": { "kind": { "const": "remote" } } },
130
+ "then": { "required": ["ack"], "properties": { "ack": { "const": "required" } } }
131
+ },
132
+ "lifecycle": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "properties": {
136
+ "launch": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "properties": {
140
+ "idempotent": { "const": true },
141
+ "budgetMs": { "type": "integer", "minimum": 1000, "default": 120000 },
142
+ "progressWindowMs": { "type": "integer", "minimum": 100, "default": 10000 },
143
+ "hardCeilingMs": { "type": "integer", "minimum": 1000 }
144
+ }
145
+ },
146
+ "health": {
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "properties": {
150
+ "path": { "type": "string", "pattern": "^/" },
151
+ "intervalMs": { "type": "integer", "minimum": 100, "default": 10000 },
152
+ "timeoutMs": { "type": "integer", "minimum": 100, "default": 5000 }
153
+ }
154
+ },
155
+ "stop": {
156
+ "type": "object",
157
+ "additionalProperties": false,
158
+ "properties": {
159
+ "graceMs": { "type": "integer", "minimum": 0, "default": 5000 }
160
+ }
161
+ },
162
+ "supervision": {
163
+ "type": "object",
164
+ "additionalProperties": false,
165
+ "properties": {
166
+ "crashLoop": {
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "properties": {
170
+ "maxFailures": { "type": "integer", "minimum": 2, "default": 3 },
171
+ "windowMs": { "type": "integer", "minimum": 1000, "default": 300000 }
172
+ }
173
+ },
174
+ "orphanMarker": { "type": "string", "minLength": 1, "description": "Process marker (for example an argv token) carried by every process the instance spawns; the orphan sweep terminates only processes that carry it." },
175
+ "idleReapMs": { "type": "integer", "minimum": 0, "description": "Idle timeout after which a non-keepAlive target may be closed. 0 or absent = no idle reaping." }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "browser": {
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "required": ["location", "display", "instances", "capabilities", "profiles"],
184
+ "properties": {
185
+ "location": { "type": "string", "enum": ["local", "remote"] },
186
+ "display": {
187
+ "type": "array",
188
+ "minItems": 1,
189
+ "uniqueItems": true,
190
+ "items": { "type": "string", "enum": ["headless", "headed"] }
191
+ },
192
+ "instances": { "type": "string", "enum": ["single", "multi"] },
193
+ "endpoints": {
194
+ "type": "object",
195
+ "additionalProperties": false,
196
+ "properties": {
197
+ "rest": { "$ref": "#/$defs/endpoint" },
198
+ "cdp": { "$ref": "#/$defs/endpoint" }
199
+ }
200
+ },
201
+ "capabilities": { "$ref": "#/$defs/capabilities" },
202
+ "profiles": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "required": ["modes"],
206
+ "properties": {
207
+ "modes": {
208
+ "type": "array",
209
+ "minItems": 1,
210
+ "uniqueItems": true,
211
+ "items": { "type": "string", "enum": ["ephemeral", "persistent", "import", "native-login", "clone"] }
212
+ },
213
+ "storedBy": { "type": "string", "enum": ["host", "provider"], "description": "Who persists session material between instance runs. provider means the provider keeps its own jar, outside the host store and outside the host's at-rest protections." }
214
+ }
215
+ },
216
+ "lifecycle": { "$ref": "#/$defs/lifecycle" },
217
+ "sinks": {
218
+ "type": "array",
219
+ "minItems": 1,
220
+ "items": { "$ref": "#/$defs/sink" }
221
+ },
222
+ "conformance": {
223
+ "type": "array",
224
+ "uniqueItems": true,
225
+ "items": { "$ref": "#/$defs/conformanceLevel" },
226
+ "contains": { "const": "core" },
227
+ "description": "Levels the provider claims. core is always required. A claimed level MUST pass the conformance suite for it (section Conformance)."
228
+ }
229
+ },
230
+ "allOf": [
231
+ {
232
+ "description": "M2: a remote provider is a credential sink and MUST declare at least one remote sink.",
233
+ "if": { "properties": { "location": { "const": "remote" } } },
234
+ "then": {
235
+ "required": ["sinks"],
236
+ "properties": { "sinks": { "contains": { "required": ["kind"], "properties": { "kind": { "const": "remote" } } } } }
237
+ }
238
+ },
239
+ {
240
+ "description": "M3: capabilities.cdp and endpoints.cdp go together.",
241
+ "if": { "required": ["capabilities"], "properties": { "capabilities": { "required": ["cdp"], "properties": { "cdp": { "const": true } } } } },
242
+ "then": { "required": ["endpoints"], "properties": { "endpoints": { "required": ["cdp"] } } }
243
+ },
244
+ {
245
+ "if": { "required": ["endpoints"], "properties": { "endpoints": { "required": ["cdp"] } } },
246
+ "then": { "properties": { "capabilities": { "required": ["cdp"], "properties": { "cdp": { "const": true } } } } }
247
+ },
248
+ {
249
+ "description": "M5: persistent profile mode needs the persistentProfile capability.",
250
+ "if": { "properties": { "profiles": { "properties": { "modes": { "contains": { "const": "persistent" } } } } } },
251
+ "then": { "properties": { "capabilities": { "required": ["persistentProfile"], "properties": { "persistentProfile": { "const": true } } } } }
252
+ },
253
+ {
254
+ "description": "M5: import and clone need a way to seed a context (cookies or storageState).",
255
+ "if": { "properties": { "profiles": { "properties": { "modes": { "contains": { "enum": ["import", "clone"] } } } } } },
256
+ "then": {
257
+ "properties": {
258
+ "capabilities": {
259
+ "anyOf": [
260
+ { "required": ["cookies"], "properties": { "cookies": { "const": true } } },
261
+ { "required": ["storageState"], "properties": { "storageState": { "const": true } } }
262
+ ]
263
+ }
264
+ }
265
+ }
266
+ },
267
+ {
268
+ "description": "M6: a claimed level needs the capability it tests.",
269
+ "if": { "required": ["conformance"], "properties": { "conformance": { "contains": { "const": "network" } } } },
270
+ "then": { "properties": { "capabilities": { "required": ["cdp"], "properties": { "cdp": { "const": true } } } } }
271
+ },
272
+ {
273
+ "if": { "required": ["conformance"], "properties": { "conformance": { "contains": { "const": "download" } } } },
274
+ "then": { "properties": { "capabilities": { "required": ["downloads"], "properties": { "downloads": { "const": true } } } } }
275
+ },
276
+ {
277
+ "if": { "required": ["conformance"], "properties": { "conformance": { "contains": { "const": "profile" } } } },
278
+ "then": {
279
+ "properties": {
280
+ "capabilities": {
281
+ "anyOf": [
282
+ { "required": ["cookies"], "properties": { "cookies": { "const": true } } },
283
+ { "required": ["storageState"], "properties": { "storageState": { "const": true } } }
284
+ ]
285
+ }
286
+ }
287
+ }
288
+ },
289
+ {
290
+ "if": { "required": ["conformance"], "properties": { "conformance": { "contains": { "const": "recording" } } } },
291
+ "then": { "properties": { "capabilities": { "required": ["recording"], "properties": { "recording": { "enum": ["screencast", "video"] } } } } }
292
+ }
293
+ ]
294
+ },
295
+ "grantSink": {
296
+ "oneOf": [
297
+ {
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "required": ["kind"],
301
+ "properties": { "kind": { "const": "local" } }
302
+ },
303
+ {
304
+ "type": "object",
305
+ "additionalProperties": false,
306
+ "required": ["kind", "providerId", "ackSeq"],
307
+ "properties": {
308
+ "kind": { "const": "remote" },
309
+ "providerId": { "type": "string" },
310
+ "ackSeq": { "type": "integer", "minimum": 0, "description": "Ledger seq of the sink-ack record that authorised this remote sink (C6)." }
311
+ }
312
+ }
313
+ ]
314
+ },
315
+ "grant": {
316
+ "type": "object",
317
+ "additionalProperties": false,
318
+ "description": "A consent grant. The only way session material enters a store or a remote instance (C1). The scope is EITHER an explicit domain list OR fullProfile true: a wildcard is not a value of domains.",
319
+ "required": ["id", "sessionId", "source", "sinks", "grantedAt", "grantedVia", "cookieCount"],
320
+ "properties": {
321
+ "id": { "type": "string", "minLength": 1 },
322
+ "sessionId": { "type": "string", "minLength": 1 },
323
+ "deviceId": { "type": "string", "minLength": 1, "description": "Paired device (AIP-59) this grant is scoped to. Absent = usable by any device the host serves (C12)." },
324
+ "source": {
325
+ "type": "object",
326
+ "additionalProperties": false,
327
+ "required": ["kind", "profile"],
328
+ "properties": {
329
+ "kind": { "type": "string", "enum": ["chrome", "firefox", "file", "native-login"] },
330
+ "profile": { "type": "string", "minLength": 1 }
331
+ }
332
+ },
333
+ "domains": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/domain" } },
334
+ "fullProfile": { "const": true, "description": "The recorded full-profile grant (C3). Not a wildcard domain." },
335
+ "sinks": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/grantSink" } },
336
+ "grantedAt": { "type": "string", "format": "date-time" },
337
+ "grantedVia": { "type": "string", "enum": ["interactive", "flag"] },
338
+ "expiresAt": { "type": "string", "format": "date-time" },
339
+ "cookieCount": { "type": "integer", "minimum": 0 },
340
+ "revokedAt": { "type": "string", "format": "date-time" }
341
+ },
342
+ "oneOf": [
343
+ { "required": ["domains"], "not": { "required": ["fullProfile"] } },
344
+ { "required": ["fullProfile"], "not": { "required": ["domains"] } }
345
+ ],
346
+ "if": { "required": ["fullProfile"] },
347
+ "then": { "properties": { "sinks": { "items": { "properties": { "kind": { "const": "local" } } } } } }
348
+ },
349
+ "ledgerRecord": {
350
+ "type": "object",
351
+ "additionalProperties": false,
352
+ "description": "One line of the append-only consent ledger. The property set is closed on purpose: there is no field a cookie value or storage value could be placed in (C9, C10).",
353
+ "required": ["seq", "at", "event", "actor"],
354
+ "properties": {
355
+ "seq": { "type": "integer", "minimum": 0 },
356
+ "at": { "type": "string", "format": "date-time" },
357
+ "event": { "type": "string", "enum": ["grant", "refresh", "revoke", "sink-ack", "deny"] },
358
+ "actor": {
359
+ "type": "object",
360
+ "additionalProperties": false,
361
+ "required": ["kind"],
362
+ "properties": {
363
+ "kind": { "type": "string", "enum": ["human", "agent", "system"] },
364
+ "via": { "type": "string", "description": "Channel, for example cli, ui, mcp." },
365
+ "deviceId": { "type": "string", "minLength": 1 }
366
+ }
367
+ },
368
+ "grantId": { "type": "string", "minLength": 1 },
369
+ "sessionId": { "type": "string", "minLength": 1 },
370
+ "domains": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/domain" } },
371
+ "fullProfile": { "const": true },
372
+ "cookieCount": { "type": "integer", "minimum": 0 },
373
+ "nameHashes": {
374
+ "type": "array",
375
+ "items": { "$ref": "#/$defs/sha256Hex" },
376
+ "description": "SHA-256 of the grantId, a NUL byte and a cookie name, lowercase hex. Never a value."
377
+ },
378
+ "sinkId": { "type": "string" },
379
+ "derived": {
380
+ "type": "object",
381
+ "additionalProperties": false,
382
+ "required": ["local", "remote"],
383
+ "properties": {
384
+ "local": { "type": "string", "enum": ["deleted", "none"] },
385
+ "remote": { "type": "string", "enum": ["confirmed", "unavailable", "failed", "not-applicable"] }
386
+ }
387
+ },
388
+ "reason": { "type": "string", "maxLength": 500 },
389
+ "prev": { "$ref": "#/$defs/sha256Hex", "description": "SHA-256 of the previous line, for a tamper-evident chain (SHOULD)." }
390
+ },
391
+ "allOf": [
392
+ {
393
+ "description": "C7: an agent may refresh, revoke or be denied. It cannot grant or acknowledge a sink.",
394
+ "if": { "properties": { "actor": { "properties": { "kind": { "const": "agent" } } } } },
395
+ "then": { "properties": { "event": { "enum": ["refresh", "revoke", "deny"] } } }
396
+ },
397
+ {
398
+ "if": { "properties": { "event": { "const": "grant" } } },
399
+ "then": {
400
+ "required": ["grantId", "sessionId", "cookieCount"],
401
+ "oneOf": [
402
+ { "required": ["domains"], "not": { "required": ["fullProfile"] } },
403
+ { "required": ["fullProfile"], "not": { "required": ["domains"] } }
404
+ ],
405
+ "properties": { "domains": { "minItems": 1 } }
406
+ }
407
+ },
408
+ {
409
+ "if": { "properties": { "event": { "const": "refresh" } } },
410
+ "then": { "required": ["grantId", "domains", "cookieCount"], "properties": { "domains": { "minItems": 1 } } }
411
+ },
412
+ {
413
+ "if": { "properties": { "event": { "const": "revoke" } } },
414
+ "then": { "required": ["grantId", "derived"] }
415
+ },
416
+ {
417
+ "if": { "properties": { "event": { "const": "sink-ack" } } },
418
+ "then": { "required": ["grantId", "sinkId"], "properties": { "actor": { "properties": { "kind": { "const": "human" } } } } }
419
+ },
420
+ {
421
+ "if": { "properties": { "event": { "const": "deny" } } },
422
+ "then": { "required": ["reason"] }
423
+ }
424
+ ]
425
+ }
426
+ }
427
+ }