@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,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-34/EXPORT.schema.json",
4
+ "title": "EXPORT.md frontmatter — workspace-export/v1 (sealed/hard node digest)",
5
+ "description": "Validates the YAML frontmatter portion of an EXPORT.md manifest. A `wall: sealed` or `wall: hard` node's ONLY readable surface for its ancestors: the body is free-form prose (summaries), never raw files.",
6
+ "type": "object",
7
+ "required": ["schema", "from", "generated_at"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "schema": { "const": "workspace-export/v1" },
11
+ "from": {
12
+ "type": "string",
13
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
14
+ "description": "Id of the sealed/hard workspace this export speaks for."
15
+ },
16
+ "generated_at": { "type": "string", "format": "date-time" },
17
+ "generated_by": {
18
+ "type": "string",
19
+ "description": "Agent slug that wrote this export, if any."
20
+ },
21
+ "sections": {
22
+ "type": "array",
23
+ "items": { "type": "string" },
24
+ "default": [],
25
+ "description": "Informational table of contents for the body's `##` headings. Not enforced."
26
+ },
27
+ "metadata": { "type": "object", "additionalProperties": true }
28
+ }
29
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-34/LOCK.schema.json",
4
+ "title": "agentproto.lock — agentproto-lock/v1 (tree-wide app/pack lockfile)",
5
+ "description": "Validates agentproto.lock, a plain YAML file (NOT frontmatter — no markdown body) at the tree root. Pins every AIP-53 app and AIP-64 pack installed anywhere in the tree to the exact version, source and attach point it resolved to, so `agentproto workspace check` can flag drift between WORKSPACE.md `apps:` version ranges and what is actually installed.",
6
+ "type": "object",
7
+ "required": ["lockfile", "generated"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "lockfile": { "const": "agentproto-lock/v1" },
11
+ "generated": { "type": "string", "format": "date-time" },
12
+ "apps": {
13
+ "type": "array",
14
+ "items": { "$ref": "#/$defs/lockedApp" },
15
+ "default": []
16
+ },
17
+ "packs": {
18
+ "type": "array",
19
+ "items": { "$ref": "#/$defs/lockedPack" },
20
+ "default": []
21
+ }
22
+ },
23
+ "$defs": {
24
+ "lockedApp": {
25
+ "type": "object",
26
+ "required": ["id", "version", "attach", "dataDir"],
27
+ "additionalProperties": false,
28
+ "properties": {
29
+ "id": {
30
+ "type": "string",
31
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$"
32
+ },
33
+ "version": {
34
+ "type": "string",
35
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.\\-]+)?$",
36
+ "description": "Exact resolved version — never a range. The range lives in the consuming WORKSPACE.md's `apps[].version`."
37
+ },
38
+ "source": {
39
+ "type": "string",
40
+ "description": "Where the .agentapp came from (file: path, registry URL, ...)."
41
+ },
42
+ "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
43
+ "attach": {
44
+ "type": "string",
45
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
46
+ "description": "Workspace id this install is scoped to (the `scopeId` passed to app_apply)."
47
+ },
48
+ "dataDir": {
49
+ "type": "string",
50
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$)).+$",
51
+ "description": "Tree-relative path to this ATTACH's own data directory — one per attach point, never shared across attaches of the same app. Path confinement applies (AIP-34 §Path confinement): no leading `/`, no `..` segment; hosts MUST ALSO realpath-verify containment."
52
+ }
53
+ }
54
+ },
55
+ "lockedPack": {
56
+ "type": "object",
57
+ "required": ["name", "version", "digest", "attach"],
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "name": { "type": "string" },
61
+ "version": {
62
+ "type": "string",
63
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.\\-]+)?$"
64
+ },
65
+ "digest": {
66
+ "type": "string",
67
+ "pattern": "^agentproto-pack-digest/v1:.+$"
68
+ },
69
+ "attach": {
70
+ "type": "string",
71
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$"
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-34/TYPES.schema.json",
4
+ "title": "TYPES.md frontmatter — workspace-types/v1 (tree node-type registry)",
5
+ "description": "Validates the YAML frontmatter portion of a TYPES.md manifest. Exactly one per tree, at the root. Declares the node `type` values a workspace/v2 WORKSPACE.md may use, their allowed parent types, their default wall level, required sibling files, and a 'starter' shape a `ws new` command materializes. Each entry conceptually compiles to an AIP-40 EXTENSION.md; this file is the authoring surface.",
6
+ "type": "object",
7
+ "required": ["schema", "types"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "schema": { "const": "workspace-types/v1" },
11
+ "types": {
12
+ "type": "object",
13
+ "minProperties": 1,
14
+ "propertyNames": { "pattern": "^[a-z][a-z0-9-]*$" },
15
+ "additionalProperties": { "$ref": "#/$defs/typeEntry" }
16
+ }
17
+ },
18
+ "$defs": {
19
+ "typeEntry": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "parents": {
24
+ "type": "array",
25
+ "items": { "type": "string" },
26
+ "description": "Type names this node MAY nest under (nearest ancestor WITH a WORKSPACE.md). Empty array = root-only type."
27
+ },
28
+ "extends": {
29
+ "type": "string",
30
+ "description": "Another type this one inherits unset fields from (e.g. a `client` type extending `project`)."
31
+ },
32
+ "default_wall": {
33
+ "enum": ["shared", "isolated", "sealed", "hard"],
34
+ "description": "Wall level a node of this type gets when its own WORKSPACE.md omits `wall`. A node MAY tighten, MUST NOT loosen below this."
35
+ },
36
+ "max_per_tree": {
37
+ "type": "integer",
38
+ "minimum": 1,
39
+ "description": "Cap on how many nodes of this type may exist in one tree (e.g. root: 1)."
40
+ },
41
+ "requires_files": {
42
+ "type": "array",
43
+ "items": { "type": "string" },
44
+ "default": [],
45
+ "description": "Sibling files `agentproto workspace check` requires at a node of this type (e.g. company → [COMPANY.md]). A project node's status is checked via its `work:` field (AIP-20 WORK.md), not a requires_files entry."
46
+ },
47
+ "starter": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "agents": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "properties": { "template": { "type": "string" } }
57
+ }
58
+ },
59
+ "routines": {
60
+ "type": "array",
61
+ "items": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "properties": { "template": { "type": "string" } }
65
+ }
66
+ }
67
+ },
68
+ "description": "What `ws new <type>` seeds by default. Informational to the spec; normative to the CLI that implements `ws new`."
69
+ },
70
+ "adds_fields": {
71
+ "type": "object",
72
+ "additionalProperties": { "type": "string" },
73
+ "description": "Extra frontmatter fields a node of this type MAY carry beyond the base workspace/v2 shape, as a field-name → type-hint map. Validated loosely here; a host MAY compile this into a stricter per-type JSON Schema."
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
@@ -1,35 +1,33 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://agentproto.sh/docs/aip-34/WORKSPACE.schema.json",
4
- "title": "WORKSPACE.md frontmatter — agentworkspace/v1 (workspace identity)",
5
- "description": "Validates the YAML frontmatter portion of an AIP-34 WORKSPACE.md manifest. Composes the AIP-35 STORAGE block (required), AIP-36 SANDBOX block (optional), AIP-26 CODE block (optional), AIP-23 identity-ref block (optional).",
3
+ "$id": "https://agentproto.sh/schemas/aip-34/WORKSPACE.schema.json",
4
+ "title": "WORKSPACE.md frontmatter — agentworkspace/v2 (workspace tree node — THE canonical AIP-34 schema; supersedes v1 outright)",
5
+ "description": "Validates the YAML frontmatter portion of an AIP-34 WORKSPACE.md manifest — the canonical workspace/v2 tree-node shape: node `type` (resolved against a sibling TYPES.md), `wall` (visibility level), `includes`/`exports` (two-sided consent doors), `agents`/`routines` (declared manifests this node hosts), `secrets`/`uses_secrets` (never-inherited secret grants), `apps`/`accepted_apps` (versioned app attachments with two-sided consent), `work` (AIP-20 status/board), and `policy.limits` budget aggregation. Supersedes the original workspace/v1 identity-only draft outright — there is no parallel v1 schema; see AIP-34 §Migrating from workspace/v1.",
6
6
  "type": "object",
7
- "required": ["schema", "id", "version", "name", "owner", "storage"],
7
+ "required": ["schema", "id", "version", "name", "type", "owner", "storage"],
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
- "schema": {
11
- "const": "workspace/v1"
12
- },
10
+ "schema": { "const": "workspace/v2" },
13
11
  "id": {
14
12
  "type": "string",
15
13
  "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
16
- "description": "Globally addressable id `@<owner-slug>/<workspace-slug>`. Lowercase kebab-case, immutable across the workspace's lifetime."
14
+ "description": "Globally addressable, FLAT id `@<owner-slug>/<workspace-slug>`. Immutable even if the node moves to a different folder (`ws mv` rewrites the path, never the id)."
17
15
  },
18
16
  "version": {
19
17
  "type": "string",
20
- "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.\\-]+)?$",
21
- "description": "Spec version of THIS file. Bump on breaking shape change."
18
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.\\-]+)?$"
22
19
  },
23
- "name": {
20
+ "name": { "type": "string", "minLength": 1, "maxLength": 80 },
21
+ "description": { "type": "string", "maxLength": 2000 },
22
+ "type": {
24
23
  "type": "string",
25
- "minLength": 1,
26
- "maxLength": 80,
27
- "description": "Human-readable display name."
24
+ "pattern": "^[a-z][a-z0-9-]*$",
25
+ "description": "Node kind. MUST be a key declared in the nearest ancestor TYPES.md (walking up through folders with no WORKSPACE.md). Day-1 vocabulary: root | perso | company | project | initiative. Hosts/trees MAY register more under TYPES.md; this field stays an open string so the registry — not this schema — is the extension point."
28
26
  },
29
- "description": {
30
- "type": "string",
31
- "maxLength": 2000,
32
- "description": "One-paragraph purpose."
27
+ "status": {
28
+ "enum": ["active", "paused", "archived"],
29
+ "default": "active",
30
+ "description": "active: runs normally. paused: keeps declarations/data but runs nothing — hosts MUST NOT start agents or fire routines at or below this node, excluded from budget/heartbeat checks like archived, stays writable and resumes by flipping back to active. archived: read-only, excluded from budget/heartbeat checks, never runs anything. A node's EFFECTIVE status is the most restrictive value along its ancestor chain (archived > paused > active) — a child is never more active than an ancestor; the field itself always holds only this node's own declared value."
33
31
  },
34
32
  "owner": {
35
33
  "type": "object",
@@ -40,38 +38,69 @@
40
38
  "id": { "type": "string", "minLength": 1 },
41
39
  "slug": {
42
40
  "type": "string",
43
- "minLength": 1,
44
- "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$",
45
- "description": "Owner-side slug. MUST match the slug suffix of the workspace `id`."
41
+ "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$"
46
42
  }
47
43
  }
48
44
  },
49
- "storage": {
50
- "$ref": "#/$defs/storageRef",
51
- "description": "AIP-35 STORAGE block. Required. Inline / ref / file."
45
+ "storage": { "$ref": "#/$defs/storageRef" },
46
+ "sandbox": { "$ref": "#/$defs/sandboxRef" },
47
+ "code": { "$ref": "#/$defs/codeRef" },
48
+ "work": {
49
+ "$ref": "#/$defs/workRef",
50
+ "description": "AIP-20 WORK.md block. Optional — when present, this node's status/board is tracked there (items are AIP-18 ITEM.md records under the collection(s) WORK.md declares), not in a flat status file. Same inline/ref/file union shape as `code`."
51
+ },
52
+ "identity": { "$ref": "#/$defs/identityRefBlock" },
53
+ "wall": {
54
+ "enum": ["shared", "isolated", "sealed", "hard"],
55
+ "default": "isolated",
56
+ "description": "Visibility level toward sibling/ancestor nodes. shared: siblings read the whole node (implicit export `to: \"children\"` of the PARENT). isolated (default): nothing crosses without an explicit includes/exports door; ancestors still see everything. sealed: as isolated, PLUS ancestors see only this node's EXPORT.md, never raw files; inbound includes require host-side approval (AIP-7). hard: as sealed, PLUS enforced by a separate process/identity — no shared daemon, no shared auth profile, no shared MCP surface; the only traffic in or out is the declared exports, delivered by message, never by mount. A child MAY raise its own wall (shared→isolated→sealed→hard) but MUST NOT set a level looser than its parent's or its TYPES.md entry's `default_wall`."
57
+ },
58
+ "includes": {
59
+ "type": "array",
60
+ "items": { "$ref": "#/$defs/includeEntry" },
61
+ "default": []
62
+ },
63
+ "exports": {
64
+ "type": "array",
65
+ "items": { "$ref": "#/$defs/exportEntry" },
66
+ "default": []
67
+ },
68
+ "agents": {
69
+ "type": "array",
70
+ "items": { "$ref": "#/$defs/agentRef" },
71
+ "default": []
72
+ },
73
+ "routines": {
74
+ "type": "array",
75
+ "items": { "$ref": "#/$defs/fileRef" },
76
+ "default": []
52
77
  },
53
- "sandbox": {
54
- "$ref": "#/$defs/sandboxRef",
55
- "description": "AIP-36 SANDBOX block. Optional — when absent, command-execution tools MUST be unavailable."
78
+ "secrets": {
79
+ "$ref": "#/$defs/fileRef",
80
+ "description": "Ref to this node's OWN .secrets/SECRETS.md inventory (AIP-19). Never inherited — a node with no `secrets` block has no secrets of its own, full stop."
56
81
  },
57
- "code": {
58
- "$ref": "#/$defs/codeRef",
59
- "description": "AIP-26 CODE block. Optional — when present, the workspace IS a code-workspace / repo (codespace pattern)."
82
+ "uses_secrets": {
83
+ "type": "array",
84
+ "items": { "$ref": "#/$defs/usesSecretEntry" },
85
+ "default": [],
86
+ "description": "Consumer-side declaration of a secret grant this node expects. Only effective if the named provider workspace's SECRETS.md carries a matching `access.bind[].workspace` (or `.reveal[].workspace`) grant for this node's id — consent MUST exist on both sides, same rule as includes/exports."
60
87
  },
61
- "identity": {
62
- "$ref": "#/$defs/identityRefBlock",
63
- "description": "AIP-23 identity-ref — default identity for sub-blocks. Sub-blocks (storage, sandbox, code) may override."
88
+ "apps": {
89
+ "type": "array",
90
+ "items": { "$ref": "#/$defs/appRef" },
91
+ "default": []
64
92
  },
65
- "policy": {
66
- "$ref": "#/$defs/policyRefBlock",
67
- "description": "AIP-38 POLICY block — access grants, defaults, limits, requirements. Composable inline / ref / file / array."
93
+ "accepted_apps": {
94
+ "type": "array",
95
+ "items": { "$ref": "#/$defs/acceptedAppEntry" },
96
+ "default": [],
97
+ "description": "Provider-side consent for an `apps[].attach` pointed at THIS node by another node — same two-sided-consent shape as `exports`/`uses_secrets`. An attach with no matching entry here is a conformance error, never silently honoured."
68
98
  },
99
+ "policy": { "$ref": "#/$defs/policyRefBlock" },
69
100
  "defaults": {
70
101
  "type": "object",
71
102
  "additionalProperties": true,
72
- "properties": {
73
- "read_only": { "type": "boolean" }
74
- }
103
+ "properties": { "read_only": { "type": "boolean" } }
75
104
  },
76
105
  "publish": {
77
106
  "type": "object",
@@ -85,21 +114,148 @@
85
114
  }
86
115
  }
87
116
  },
88
- "tags": {
89
- "type": "array",
90
- "items": { "type": "string" },
91
- "default": []
92
- },
93
- "created_at": {
117
+ "tags": { "type": "array", "items": { "type": "string" }, "default": [] },
118
+ "created_at": { "type": "string", "format": "date-time" },
119
+ "lock": {
94
120
  "type": "string",
95
- "format": "date-time"
121
+ "default": "agentproto.lock",
122
+ "description": "Workspace-relative path to this node's apps/packs lockfile (see AIP-34 §agentproto.lock). Only meaningful on nodes that install apps/packs directly; a node that attaches nothing MAY omit it."
96
123
  },
97
- "metadata": {
98
- "type": "object",
99
- "additionalProperties": true
100
- }
124
+ "metadata": { "type": "object", "additionalProperties": true }
101
125
  },
102
126
  "$defs": {
127
+ "safeRelativePath": {
128
+ "type": "string",
129
+ "minLength": 1,
130
+ "pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$)).+$",
131
+ "description": "Path confinement (see §Path confinement): tree-relative (no leading `/`), no `..` path segment anywhere. Schema-level best effort — hosts MUST ALSO realpath-resolve and verify containment to catch a symlink escape the string alone can't reveal."
132
+ },
133
+ "acceptedAppEntry": {
134
+ "type": "object",
135
+ "required": ["from"],
136
+ "additionalProperties": false,
137
+ "properties": {
138
+ "from": {
139
+ "type": "string",
140
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
141
+ "description": "Id of the workspace whose `apps[].attach` this grant honours."
142
+ },
143
+ "app": {
144
+ "type": "string",
145
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
146
+ "description": "Restrict the grant to one app id. Omitted = any app `from` attaches."
147
+ }
148
+ }
149
+ },
150
+ "fileRef": {
151
+ "type": "object",
152
+ "required": ["file"],
153
+ "additionalProperties": false,
154
+ "properties": { "file": { "$ref": "#/$defs/safeRelativePath" } }
155
+ },
156
+ "agentRef": {
157
+ "type": "object",
158
+ "required": ["file"],
159
+ "additionalProperties": false,
160
+ "properties": {
161
+ "file": { "$ref": "#/$defs/safeRelativePath" },
162
+ "share": {
163
+ "type": "array",
164
+ "items": {
165
+ "type": "string",
166
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$"
167
+ },
168
+ "description": "Other workspace ids this agent is also declared transverse to (AIP-34 §Specification (workspace/v2) exception 3). The agent always runs scoped to whichever of these ids is the live caller — never a union of several at once."
169
+ }
170
+ }
171
+ },
172
+ "includeEntry": {
173
+ "type": "object",
174
+ "required": ["ref"],
175
+ "additionalProperties": false,
176
+ "properties": {
177
+ "ref": {
178
+ "type": "string",
179
+ "pattern": "^ws://workspaces/@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*(#(?!.*\\.\\.)[^\\s]+)?$",
180
+ "description": "AIP-54 ws:// ref: `ws://workspaces/<provider-id>[#<subpath>]`. No subpath = the whole node. The `#<subpath>` fragment is path confinement scope (see §Path confinement): no `..` anywhere in it."
181
+ },
182
+ "mode": { "enum": ["read", "write", "append"], "default": "read" }
183
+ }
184
+ },
185
+ "exportEntry": {
186
+ "type": "object",
187
+ "required": ["path", "to"],
188
+ "additionalProperties": false,
189
+ "properties": {
190
+ "path": {
191
+ "allOf": [{ "$ref": "#/$defs/safeRelativePath" }],
192
+ "description": "Path (relative to this node) made available to the grantee(s). Path confinement applies — see §Path confinement."
193
+ },
194
+ "to": {
195
+ "oneOf": [
196
+ {
197
+ "const": "children",
198
+ "description": "Sentinel: every node nested, in the folder tree, under whichever workspace DECLARES this export entry — regardless of id. For an explicit entry, that's whoever wrote it. For the IMPLICIT grant `wall: shared` synthesizes, the declaring node is the PARENT, not the shared node itself — so the grant reaches the shared node's SIBLINGS (the parent's other children), not merely its own descendants. See AIP-34 §The four wall levels."
199
+ },
200
+ {
201
+ "type": "string",
202
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
203
+ "description": "A single named workspace id — the explicit two-sided door case."
204
+ },
205
+ {
206
+ "type": "array",
207
+ "items": {
208
+ "type": "string",
209
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$"
210
+ },
211
+ "minItems": 1
212
+ }
213
+ ]
214
+ },
215
+ "mode": { "enum": ["read", "write"], "default": "read" }
216
+ }
217
+ },
218
+ "usesSecretEntry": {
219
+ "type": "object",
220
+ "required": ["from", "slug"],
221
+ "additionalProperties": false,
222
+ "properties": {
223
+ "from": {
224
+ "type": "string",
225
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
226
+ "description": "Id of the workspace whose SECRETS.md owns this slug."
227
+ },
228
+ "slug": { "type": "string", "minLength": 1 },
229
+ "mode": { "enum": ["bind", "reveal"], "default": "bind" }
230
+ }
231
+ },
232
+ "appRef": {
233
+ "type": "object",
234
+ "required": ["id", "version"],
235
+ "additionalProperties": false,
236
+ "properties": {
237
+ "id": {
238
+ "type": "string",
239
+ "pattern": "^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$",
240
+ "description": "AIP-53 APP id."
241
+ },
242
+ "version": {
243
+ "type": "string",
244
+ "minLength": 1,
245
+ "description": "Semver or semver-range (`^0.1.0`, `~1.2.0`, `1.2.3`). Resolved against the installed app store at attach time; the resolved exact version is what lands in agentproto.lock."
246
+ },
247
+ "expose": {
248
+ "type": "array",
249
+ "items": { "enum": ["agents", "tools", "ui", "data"] },
250
+ "default": []
251
+ },
252
+ "attach": {
253
+ "type": "string",
254
+ "default": "self",
255
+ "description": "`\"self\"` (default): this node and its subtree — no consent needed, the declaring node can only ever restrict itself. Otherwise a workspace id the app is attached to instead — effective ONLY if that target node's WORKSPACE.md declares a matching `accepted_apps` entry granting this node (and optionally this app id); see §Apps and consent. An unconsented cross-node attach is a conformance error, not a silent no-op."
256
+ }
257
+ }
258
+ },
103
259
  "storageRef": {
104
260
  "anyOf": [
105
261
  {
@@ -158,9 +314,7 @@
158
314
  "type": "object",
159
315
  "required": ["inline"],
160
316
  "additionalProperties": false,
161
- "properties": {
162
- "inline": { "type": "object" }
163
- }
317
+ "properties": { "inline": { "type": "object" } }
164
318
  },
165
319
  {
166
320
  "type": "object",
@@ -176,19 +330,14 @@
176
330
  }
177
331
  ]
178
332
  },
179
- "identityRefBlock": {
333
+ "workRef": {
180
334
  "anyOf": [
181
- { "$ref": "#/$defs/identityRefEntry" },
182
335
  {
183
- "type": "array",
184
- "items": { "$ref": "#/$defs/identityRefEntry" },
185
- "minItems": 1
186
- }
187
- ]
188
- },
189
- "policyRefEntry": {
190
- "anyOf": [
191
- { "$ref": "https://agentproto.sh/schemas/aip-38/POLICY.schema.json" },
336
+ "type": "object",
337
+ "required": ["inline"],
338
+ "additionalProperties": false,
339
+ "properties": { "inline": { "type": "object" } }
340
+ },
192
341
  {
193
342
  "type": "object",
194
343
  "required": ["ref"],
@@ -203,50 +352,32 @@
203
352
  }
204
353
  ]
205
354
  },
355
+ "identityRefBlock": {
356
+ "description": "AIP-23 identity-ref. Single entry or multi-attribution array. Left permissive here; AIP-23 owns the normative shape."
357
+ },
206
358
  "policyRefBlock": {
207
- "anyOf": [
208
- { "$ref": "#/$defs/policyRefEntry" },
209
- {
359
+ "type": "object",
360
+ "additionalProperties": true,
361
+ "properties": {
362
+ "limits": {
210
363
  "type": "array",
211
- "items": { "$ref": "#/$defs/policyRefEntry" },
212
- "minItems": 1
213
- }
214
- ]
215
- },
216
- "identityRefEntry": {
217
- "anyOf": [
218
- {
219
- "type": "object",
220
- "required": ["name", "email"],
221
- "additionalProperties": true,
222
- "properties": {
223
- "name": { "type": "string", "minLength": 1 },
224
- "email": { "type": "string", "minLength": 1 },
225
- "avatar": { "type": "string" },
226
- "gpg_key": { "type": "string" },
227
- "role": { "type": "string" },
228
- "metadata": { "type": "object" }
229
- }
230
- },
231
- {
232
- "type": "object",
233
- "required": ["ref"],
234
- "additionalProperties": true,
235
- "properties": {
236
- "ref": { "type": "string", "minLength": 1 },
237
- "role": { "type": "string" }
238
- }
239
- },
240
- {
241
- "type": "object",
242
- "required": ["file"],
243
- "additionalProperties": true,
244
- "properties": {
245
- "file": { "type": "string", "minLength": 1 },
246
- "role": { "type": "string" }
247
- }
364
+ "items": {
365
+ "type": "object",
366
+ "required": ["kind", "value"],
367
+ "additionalProperties": true,
368
+ "properties": {
369
+ "kind": {
370
+ "type": "string",
371
+ "description": "AIP-38 limit kind. Budget kinds added by AIP-34 v2: budget-usd-per-month | budget-usd-per-day. Also any AIP-38 kind (max-concurrent-sessions, rate-tool-calls, ...)."
372
+ },
373
+ "value": { "type": "number" },
374
+ "scope": { "type": "string" },
375
+ "per": { "type": "string" }
376
+ }
377
+ },
378
+ "default": []
248
379
  }
249
- ]
380
+ }
250
381
  }
251
382
  }
252
383
  }
@@ -244,6 +244,11 @@
244
244
  "type": "object",
245
245
  "additionalProperties": false,
246
246
  "properties": {
247
+ "enabled": {
248
+ "type": "boolean",
249
+ "default": true,
250
+ "description": "When false, the agent MUST NOT write anything to MEMORY.md files (no item is created, updated, or tombstoned)."
251
+ },
247
252
  "scope": {
248
253
  "enum": ["per-conversation", "per-thread", "per-workspace", "none"],
249
254
  "default": "per-conversation"
@@ -126,6 +126,16 @@
126
126
  "categories": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Narrows payable categories (∩ with the asset's spendableOn)." }
127
127
  }
128
128
  },
129
+ {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": ["kind", "key", "allow"],
133
+ "properties": {
134
+ "kind": { "const": "qualify" },
135
+ "key": { "type": "string", "minLength": 1, "description": "Qualifier name looked up in the spend context's `qualifiers` (e.g. `channel`)." },
136
+ "allow": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Qualifier values that may spend this value. `*` = any value, but the qualifier must still be present. A spend that omits the qualifier is ineligible; a pure balance read is unaffected." }
137
+ }
138
+ },
129
139
  {
130
140
  "type": "object",
131
141
  "additionalProperties": false,