@agentproto/corpus-cli 0.1.1 → 0.3.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.
- package/dist/cli.mjs +482 -50
- package/dist/cli.mjs.map +1 -1
- package/dist/ports/index.d.ts +34 -6
- package/dist/ports/index.mjs +53 -24
- package/dist/ports/index.mjs.map +1 -1
- package/dist/specs/resources/aip-14/draft/TOOL.schema.json +1 -1
- package/dist/specs/resources/aip-45/draft/AGENT-CLI.schema.json +62 -0
- package/dist/specs/resources/aip-52/draft/HARNESS.schema.json +254 -0
- package/package.json +3 -3
|
@@ -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"
|
|
7
|
+
"required": ["name", "id", "description", "version"],
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {
|
|
10
10
|
"name": {
|
|
@@ -104,6 +104,11 @@
|
|
|
104
104
|
"items": { "$ref": "#/$defs/option" },
|
|
105
105
|
"description": "Independent typed knobs the CLI accepts. The host picks any subset per turn via OPERATOR.runtime.config.options. Patches apply in declaration order, AFTER mode patches."
|
|
106
106
|
},
|
|
107
|
+
"presets": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"items": { "$ref": "#/$defs/preset" },
|
|
110
|
+
"description": "AIP-45 gateway presets this adapter can drive (Anthropic/OpenAI-compatible backends). Merged into the provider-preset catalog (agentproto presets list / list_provider_presets) alongside the built-in registry, deduped by id (built-in wins on collision). Lets an external adapter surface a gateway the built-in registry doesn't know about."
|
|
111
|
+
},
|
|
107
112
|
"continuation": { "$ref": "#/$defs/continuation" },
|
|
108
113
|
"requires": { "$ref": "https://agentproto.sh/docs/aip-29/CLI.schema.json#/properties/requires" },
|
|
109
114
|
"examples": {
|
|
@@ -259,6 +264,11 @@
|
|
|
259
264
|
"description": "Stable id. The operator config references this id."
|
|
260
265
|
},
|
|
261
266
|
"description": { "type": "string" },
|
|
267
|
+
"bin_args_prepend": {
|
|
268
|
+
"type": "array",
|
|
269
|
+
"items": { "type": "string" },
|
|
270
|
+
"description": "Extra argv prepended before the manifest's bin_args when this mode is active."
|
|
271
|
+
},
|
|
262
272
|
"bin_args_append": {
|
|
263
273
|
"type": "array",
|
|
264
274
|
"items": { "type": "string" },
|
|
@@ -268,6 +278,19 @@
|
|
|
268
278
|
"type": "object",
|
|
269
279
|
"additionalProperties": { "type": "string" },
|
|
270
280
|
"description": "Extra env vars merged into the spawn env when this mode is active."
|
|
281
|
+
},
|
|
282
|
+
"env_unset": {
|
|
283
|
+
"type": "array",
|
|
284
|
+
"items": { "type": "string" },
|
|
285
|
+
"description": "Env keys to DELETE from the spawn env when this mode is active. Applied at the runtime's env-merge point after ambient process.env + mode/option env are combined, so a mode can scrub a credential that must never reach a non-native endpoint (e.g. a gateway mode scrubbing ANTHROPIC_API_KEY so it can't leak to a third-party Anthropic-compatible host). Unlike `env`, deletion is the only safe semantics for scrubbing."
|
|
286
|
+
},
|
|
287
|
+
"status": {
|
|
288
|
+
"enum": ["active", "noop", "planned"],
|
|
289
|
+
"description": "Honest support status surfaced to clients. active = does what its description claims; noop = declared and accepted but measured to have no effect; planned = declared surface not wired yet. Absent ⇒ treated as active."
|
|
290
|
+
},
|
|
291
|
+
"status_note": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"description": "Human-readable reason backing `status` (e.g. what was measured)."
|
|
271
294
|
}
|
|
272
295
|
}
|
|
273
296
|
},
|
|
@@ -303,6 +326,11 @@
|
|
|
303
326
|
"type": "integer",
|
|
304
327
|
"description": "Upper bound when type=integer."
|
|
305
328
|
},
|
|
329
|
+
"bin_args_prepend": {
|
|
330
|
+
"type": "array",
|
|
331
|
+
"items": { "type": "string" },
|
|
332
|
+
"description": "Argv template prepended before the manifest's bin_args when the option has a non-default value. The literal token `{value}` is replaced with the option's value (stringified)."
|
|
333
|
+
},
|
|
306
334
|
"bin_args_template": {
|
|
307
335
|
"type": "array",
|
|
308
336
|
"items": { "type": "string" },
|
|
@@ -317,6 +345,11 @@
|
|
|
317
345
|
"type": "object",
|
|
318
346
|
"additionalProperties": { "type": "string" },
|
|
319
347
|
"description": "Env vars to merge when the option has a non-default value. Values may contain `{value}` for templating."
|
|
348
|
+
},
|
|
349
|
+
"env_unset": {
|
|
350
|
+
"type": "array",
|
|
351
|
+
"items": { "type": "string" },
|
|
352
|
+
"description": "Env keys to DELETE from the spawn env when the option has a non-default value. Symmetric with mode.env_unset and applied at the same runtime env-merge point. Lets a value-bearing option (e.g. base_url pointing at a third-party Anthropic-compatible gateway) scrub the ambient credential (ANTHROPIC_API_KEY) it must displace, without forcing the operator to also pick a preset mode."
|
|
320
353
|
}
|
|
321
354
|
},
|
|
322
355
|
"allOf": [
|
|
@@ -326,6 +359,35 @@
|
|
|
326
359
|
}
|
|
327
360
|
]
|
|
328
361
|
},
|
|
362
|
+
"preset": {
|
|
363
|
+
"type": "object",
|
|
364
|
+
"additionalProperties": false,
|
|
365
|
+
"required": ["id", "label", "schemaFlavor", "baseUrl", "keyEnv"],
|
|
366
|
+
"description": "A gateway preset this adapter can drive — a backend an Anthropic/OpenAI-compatible client can front. Declared in the manifest so the catalog surfaces adapter-contributed presets alongside the built-in registry. No adapter projection (env/env_unset/bin_args) here; that stays in modes/options.",
|
|
367
|
+
"properties": {
|
|
368
|
+
"id": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"minLength": 1,
|
|
371
|
+
"description": "Stable preset id. SHOULD equal the mode id if the adapter projects this preset as a mode. Catalog dedupes built-in vs adapter-declared by id; an adapter-declared id colliding with a built-in is ignored in favor of the built-in (registry is source of truth for canonical providers)."
|
|
372
|
+
},
|
|
373
|
+
"label": { "type": "string", "minLength": 1, "description": "Human label for the catalog UI." },
|
|
374
|
+
"description": { "type": "string" },
|
|
375
|
+
"schemaFlavor": { "enum": ["anthropic", "openai"], "description": "API schema flavor — selects which adapter family can consume the preset." },
|
|
376
|
+
"baseUrl": { "type": "string", "minLength": 1, "description": "Base URL the client hits." },
|
|
377
|
+
"keyEnv": {
|
|
378
|
+
"type": "string",
|
|
379
|
+
"minLength": 1,
|
|
380
|
+
"description": "Conventional env var holding this provider's API key. Catalog status is derived from its presence in the daemon's environment (ready vs available)."
|
|
381
|
+
},
|
|
382
|
+
"scrubEnv": {
|
|
383
|
+
"type": "array",
|
|
384
|
+
"items": { "type": "string" },
|
|
385
|
+
"description": "Env vars to scrub when this preset is active. Optional — an adapter that scrubs in code may omit it. Not surfaced to catalog clients."
|
|
386
|
+
},
|
|
387
|
+
"defaultModel": { "type": "string", "description": "Conventional default model id for this provider, if any." },
|
|
388
|
+
"homepage": { "type": "string", "description": "Optional homepage/docs URL for the catalog UI." }
|
|
389
|
+
}
|
|
390
|
+
},
|
|
329
391
|
"continuation": {
|
|
330
392
|
"type": "object",
|
|
331
393
|
"additionalProperties": false,
|
|
@@ -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.
|
|
3
|
+
"version": "0.3.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.
|
|
56
|
-
"@agentproto/corpus-presets": "0.
|
|
55
|
+
"@agentproto/corpus": "0.2.1",
|
|
56
|
+
"@agentproto/corpus-presets": "0.2.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^25.6.2",
|