@agentproto/corpus-cli 0.1.0 → 0.2.0

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.
@@ -4,7 +4,7 @@
4
4
  "title": "TOOL.md frontmatter — agenttool/v1 (abstract agent contract)",
5
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
6
  "type": "object",
7
- "required": ["name", "id", "description", "version", "inputs", "outputs"],
7
+ "required": ["name", "id", "description", "version"],
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
10
  "name": {
@@ -0,0 +1,254 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentproto.sh/schemas/aip-52/HARNESS.schema.json",
4
+ "title": "HarnessDefinition",
5
+ "description": "Validates the YAML frontmatter of a .harness/<slug>.md file. A Harness is a stateful conversational shell with modes, threads, tool-approval gates, subagents, and observational memory. Today the canonical runtime is Mastra's Harness class (@mastra/core/harness); the spec is implementation-agnostic.",
6
+ "$comment": "Relationship to other AIPs: a Harness HAS agents (via modes[].agent and HarnessConfig.agent) but IS NOT a subtype of AIP-42. AIP-42 agents are referenced from harness manifests via $resolver. See also AIP-12 for agent pack ingestion — packs can auto-generate .harness/ manifests from modes/*.md files.",
7
+ "type": "object",
8
+ "required": ["spec", "id", "name", "version", "storage", "modes", "models"],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "spec": {
12
+ "const": "harness/v1",
13
+ "description": "Pins the spec version this manifest conforms to."
14
+ },
15
+ "id": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "pattern": "^[a-z][a-z0-9-]*$",
19
+ "description": "Unique harness identifier (kebab-case). Used as the $id in the resolver registry."
20
+ },
21
+ "name": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 80,
25
+ "description": "Human-readable harness name."
26
+ },
27
+ "description": {
28
+ "type": "string",
29
+ "description": "One-sentence description of this harness's purpose."
30
+ },
31
+ "version": {
32
+ "type": "string",
33
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
34
+ "description": "Manifest semver. Bump on breaking mode/subagent changes."
35
+ },
36
+ "storage": {
37
+ "$ref": "#/$defs/refOrString",
38
+ "description": "Storage backend resolver. Must resolve to a MastraCompositeStore."
39
+ },
40
+ "stateSchema": {
41
+ "$ref": "#/$defs/refOrString",
42
+ "description": "Optional JSON Schema defining the conversation state shape (validated by the Harness)."
43
+ },
44
+ "initialState": {
45
+ "description": "Default values for the state schema fields."
46
+ },
47
+ "modes": {
48
+ "type": "array",
49
+ "minItems": 1,
50
+ "items": { "$ref": "#/$defs/mode" },
51
+ "description": "Operational modes (e.g. plan/execute, brief/draft/review). At least one required."
52
+ },
53
+ "memory": {
54
+ "$ref": "#/$defs/refOrString",
55
+ "description": "Optional memory resolver. Observational Memory is configured via omConfig on the Harness constructor, not here."
56
+ },
57
+ "workspace": {
58
+ "$ref": "#/$defs/refOrString",
59
+ "description": "Optional workspace resolver (Mastra Workspace or WorkspaceConfig)."
60
+ },
61
+ "models": {
62
+ "type": "object",
63
+ "required": ["resolver"],
64
+ "properties": {
65
+ "resolver": {
66
+ "$ref": "#/$defs/refOrString",
67
+ "description": "Resolver for (modelId: string) => LanguageModel. Used as Harness.resolveModel."
68
+ },
69
+ "access": {
70
+ "$ref": "#/$defs/refOrString",
71
+ "description": "Optional model access checker resolver (ModelAuthChecker)."
72
+ }
73
+ },
74
+ "additionalProperties": false
75
+ },
76
+ "subagents": {
77
+ "type": "array",
78
+ "default": [],
79
+ "items": { "$ref": "#/$defs/subagent" },
80
+ "description": "Child agents that can be spawned by the builtin subagent tool."
81
+ },
82
+ "extensions": {
83
+ "type": "object",
84
+ "properties": {
85
+ "consumes": {
86
+ "type": "array",
87
+ "items": { "type": "string" },
88
+ "default": [],
89
+ "description": "Extension slugs this harness consumes from the host (e.g. 'workspace:files')."
90
+ },
91
+ "exposes": {
92
+ "type": "array",
93
+ "items": { "type": "string" },
94
+ "default": [],
95
+ "description": "Extension slugs this harness makes available to subagents."
96
+ }
97
+ },
98
+ "additionalProperties": false
99
+ },
100
+ "heartbeats": {
101
+ "type": "array",
102
+ "items": { "$ref": "#/$defs/refOrString" },
103
+ "default": [],
104
+ "description": "Periodic background handlers (e.g. OM reflector, progress reporter)."
105
+ },
106
+ "observability": {
107
+ "$ref": "#/$defs/refOrString",
108
+ "description": "Optional observability entrypoint resolver."
109
+ }
110
+ },
111
+ "$defs": {
112
+ "refOrString": {
113
+ "oneOf": [
114
+ {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "description": "Inline string value."
118
+ },
119
+ {
120
+ "type": "object",
121
+ "required": ["$ref"],
122
+ "properties": {
123
+ "$ref": { "type": "string", "minLength": 1 }
124
+ },
125
+ "additionalProperties": false,
126
+ "description": "Reference to a named value in the resolver registry."
127
+ },
128
+ {
129
+ "type": "object",
130
+ "required": ["$resolver"],
131
+ "properties": {
132
+ "$resolver": { "type": "string", "minLength": 1 },
133
+ "input": {}
134
+ },
135
+ "additionalProperties": false,
136
+ "description": "Dynamic resolver invocation with optional typed input."
137
+ }
138
+ ]
139
+ },
140
+ "mode": {
141
+ "type": "object",
142
+ "required": ["id", "agent", "model"],
143
+ "additionalProperties": true,
144
+ "properties": {
145
+ "id": {
146
+ "type": "string",
147
+ "minLength": 1,
148
+ "description": "Unique mode identifier within this harness (e.g. 'plan', 'execute', 'review')."
149
+ },
150
+ "name": { "type": "string", "description": "Human-readable mode label." },
151
+ "description": { "type": "string" },
152
+ "default": {
153
+ "type": "boolean",
154
+ "description": "If true, this mode is activated on new sessions."
155
+ },
156
+ "color": {
157
+ "type": "string",
158
+ "description": "UI hint — hex or CSS color name."
159
+ },
160
+ "transitionsTo": {
161
+ "type": "string",
162
+ "description": "Mode id to switch to after submit_plan approval completes."
163
+ },
164
+ "defaultModelId": {
165
+ "type": "string",
166
+ "description": "Bootstrap model id for this mode. Falls back to the harness-level resolveModel."
167
+ },
168
+ "agent": {
169
+ "$ref": "#/$defs/refOrString",
170
+ "description": "Backing Mastra Agent. Prefer a single shared agent on HarnessConfig.agent with per-mode instructions layered on top."
171
+ },
172
+ "model": {
173
+ "$ref": "#/$defs/refOrString",
174
+ "description": "Model resolution config for this mode. Resolver must produce a { modelId, defaultModelId?, allowed? } object."
175
+ },
176
+ "tools": {
177
+ "$ref": "#/$defs/refOrString",
178
+ "description": "Tools for this mode. Mutually exclusive with additionalTools — setting this REPLACES agent tools."
179
+ },
180
+ "prompt": {
181
+ "type": "object",
182
+ "properties": {
183
+ "blocks": {
184
+ "type": "array",
185
+ "items": { "$ref": "#/$defs/refOrString" },
186
+ "default": [],
187
+ "description": "Ordered instruction blocks. Resolved to strings and concatenated for the mode's instructions field."
188
+ }
189
+ }
190
+ },
191
+ "builtins": {
192
+ "type": "object",
193
+ "additionalProperties": true,
194
+ "properties": {
195
+ "ask_user": { "type": "boolean", "default": true },
196
+ "submit_plan": {
197
+ "oneOf": [{ "type": "boolean" }, { "const": "required" }],
198
+ "default": false
199
+ },
200
+ "task_write": { "type": "boolean", "default": true },
201
+ "task_check": { "type": "boolean", "default": true },
202
+ "subagent": { "type": "boolean", "default": false }
203
+ }
204
+ },
205
+ "permissions": {
206
+ "$ref": "#/$defs/refOrString",
207
+ "description": "Default permission rules for this mode (PermissionRules from @mastra/core/harness)."
208
+ }
209
+ }
210
+ },
211
+ "subagent": {
212
+ "type": "object",
213
+ "required": ["id", "name", "description", "agent"],
214
+ "additionalProperties": true,
215
+ "properties": {
216
+ "id": { "type": "string", "minLength": 1 },
217
+ "name": { "type": "string" },
218
+ "description": { "type": "string" },
219
+ "agent": {
220
+ "$ref": "#/$defs/refOrString",
221
+ "description": "Backing agent resolver. The bridge instantiateHarness() derives instructions from prompt.blocks."
222
+ },
223
+ "model": { "$ref": "#/$defs/refOrString" },
224
+ "tools": { "$ref": "#/$defs/refOrString" },
225
+ "forked": {
226
+ "type": "boolean",
227
+ "default": false,
228
+ "description": "If true, inherits parent thread + prompt cache (cheaper). If false, gets a fresh isolated thread."
229
+ },
230
+ "maxSteps": { "type": "integer", "minimum": 1 },
231
+ "allowedHarnessTools": {
232
+ "type": "array",
233
+ "items": { "type": "string" },
234
+ "description": "Subset of parent harness builtin tools available to this subagent."
235
+ },
236
+ "allowedWorkspaceTools": {
237
+ "type": "array",
238
+ "items": { "type": "string" },
239
+ "description": "Subset of workspace tools available to this subagent."
240
+ },
241
+ "prompt": {
242
+ "type": "object",
243
+ "properties": {
244
+ "blocks": {
245
+ "type": "array",
246
+ "items": { "$ref": "#/$defs/refOrString" },
247
+ "description": "Instruction blocks. Flattened to a string and passed as HarnessSubagent.instructions (required by Mastra API)."
248
+ }
249
+ }
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentproto/corpus-cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "@agentproto/corpus-cli — the `corpus` binary. Validate, lint, and operate an AIP-10 corpus workspace from the command line. Local-topology host for @agentproto/corpus — pair with a local backing engine (qdrant docker / gbrain) for a fully offline corpus runtime.",
5
5
  "keywords": [
6
6
  "agentproto",
@@ -52,8 +52,8 @@
52
52
  "gray-matter": "^4.0.3",
53
53
  "zod": "^4.4.3",
54
54
  "@agentproto/cli-exec": "0.1.0-alpha.1",
55
- "@agentproto/corpus": "0.1.0",
56
- "@agentproto/corpus-presets": "0.1.0"
55
+ "@agentproto/corpus": "0.2.0",
56
+ "@agentproto/corpus-presets": "0.2.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/node": "^25.6.2",