@aiwg/cli 2026.10.5 → 2026.10.6
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/agentic/code/addons/composition-engine/lib/runtime.mjs +1401 -0
- package/agentic/code/addons/composition-engine/lib/validator.mjs +513 -0
- package/agentic/code/addons/composition-engine/schemas/flow-graph.schema.json +372 -0
- package/agentic/code/providers/model-capabilities.v1.json +74 -50
- package/bin/aiwg.mjs +3 -1
- package/dist/src/artifacts/browser-export.js +1 -0
- package/dist/src/artifacts/citation-parser.js +8 -1
- package/dist/src/artifacts/cli.js +57 -6
- package/dist/src/artifacts/fortemi-core-query-adapter.js +2 -0
- package/dist/src/artifacts/fortemi-core-sync.js +26 -8
- package/dist/src/artifacts/graph-query.js +18 -8
- package/dist/src/artifacts/index-adapters.js +339 -0
- package/dist/src/artifacts/index-builder.js +143 -14
- package/dist/src/artifacts/index-files.js +15 -4
- package/dist/src/artifacts/index-reader.js +44 -0
- package/dist/src/artifacts/index-refresh.js +114 -55
- package/dist/src/artifacts/index-status.js +20 -5
- package/dist/src/artifacts/memory-maintenance.js +503 -0
- package/dist/src/artifacts/prebuilt-relations.js +3 -1
- package/dist/src/artifacts/query-engine.js +263 -108
- package/dist/src/artifacts/relations-builder.js +2 -2
- package/dist/src/artifacts/source-graph.js +2 -2
- package/dist/src/artifacts/types.js +9 -1
- package/dist/src/cli/handlers/decision.js +19 -1
- package/dist/src/cli/handlers/guided-setup.js +470 -0
- package/dist/src/cli/handlers/help.js +2 -2
- package/dist/src/cli/handlers/housekeeper.js +1110 -0
- package/dist/src/cli/handlers/index.js +4 -2
- package/dist/src/cli/handlers/init.js +41 -6
- package/dist/src/cli/handlers/local-executor.js +5 -3
- package/dist/src/cli/handlers/mc.js +509 -53
- package/dist/src/cli/handlers/models.js +32 -2
- package/dist/src/cli/handlers/ralph-launcher.js +76 -4
- package/dist/src/cli/handlers/rules.js +1 -1
- package/dist/src/cli/handlers/script-runner.js +73 -2
- package/dist/src/cli/handlers/serve.js +5 -3
- package/dist/src/cli/handlers/sessions.js +1 -0
- package/dist/src/cli/handlers/setup.js +428 -1
- package/dist/src/cli/handlers/skill-lint.js +1 -1
- package/dist/src/cli/handlers/subcommands.js +118 -8
- package/dist/src/cli/handlers/use.js +279 -93
- package/dist/src/cli/handlers/workspace.js +3 -1
- package/dist/src/cli/prompt-utils.js +8 -0
- package/dist/src/cli/router.js +16 -1
- package/dist/src/config/aiwg-config.js +42 -0
- package/dist/src/config/cli.js +7 -3
- package/dist/src/config/decision-config.js +14 -1
- package/dist/src/config/native-sandbox-warnings.js +25 -0
- package/dist/src/contributors/validation.js +6 -5
- package/dist/src/decision/admission.js +7 -3
- package/dist/src/decision/benchmark.js +469 -0
- package/dist/src/decision/ledger.js +22 -3
- package/dist/src/decision/pricing.js +147 -0
- package/dist/src/decision/qualification/gate-evidence.js +18 -15
- package/dist/src/decision/qualification/load-staged.js +539 -0
- package/dist/src/decision/qualification/load.js +109 -33
- package/dist/src/decision/qualification/runner.js +5 -2
- package/dist/src/decision/review/service.js +6 -4
- package/dist/src/decision/review/validate.js +23 -2
- package/dist/src/decision/savings.js +8 -3
- package/dist/src/discovery/index.js +492 -0
- package/dist/src/discovery/interview.js +233 -0
- package/dist/src/discovery/plan-apply.js +571 -0
- package/dist/src/discovery/plan-store.js +171 -0
- package/dist/src/discovery/plan-types.js +2 -0
- package/dist/src/discovery/plan-validation.js +139 -0
- package/dist/src/discovery/types.js +2 -0
- package/dist/src/extensions/commands/definitions.js +49 -9
- package/dist/src/extensions/manifest.js +71 -44
- package/dist/src/extensions/project-local-discovery.js +1 -1
- package/dist/src/extensions/project-quickref.js +18 -17
- package/dist/src/extensions/validation.js +32 -29
- package/dist/src/housekeeper/daemon-config.js +148 -0
- package/dist/src/housekeeper/ipc.js +84 -0
- package/dist/src/housekeeper/lifecycle.js +148 -0
- package/dist/src/housekeeper/platform.js +35 -0
- package/dist/src/housekeeper/status.js +70 -0
- package/dist/src/housekeeper/units.js +114 -0
- package/dist/src/jobs/flow.js +22 -21
- package/dist/src/lint/rule-activation.js +20 -5
- package/dist/src/lint/runner.js +1 -1
- package/dist/src/mcp/cli.mjs +5 -6
- package/dist/src/mcp/config-file.mjs +6 -2
- package/dist/src/mcp/config-layers.mjs +23 -7
- package/dist/src/mcp/profiles.js +18 -31
- package/dist/src/mcp/profiles.mjs +18 -32
- package/dist/src/mcp/registry.js +7 -27
- package/dist/src/mcp/registry.mjs +7 -28
- package/dist/src/mcp/server.mjs +34 -1
- package/dist/src/mcp/tools/agentic-sandbox.mjs +8 -7
- package/dist/src/mcp/tools/command-run.mjs +3 -2
- package/dist/src/mcp/tools/decision.mjs +49 -48
- package/dist/src/mcp/tools/discovery.mjs +46 -21
- package/dist/src/mcp/tools/orchestration.mjs +22 -22
- package/dist/src/mcp/tools/subsystems.mjs +9 -8
- package/dist/src/mcp/tools/worker-invoke.mjs +17 -4
- package/dist/src/mcp/tools/writer-profiles.mjs +1 -1
- package/dist/src/memory/audit.js +719 -0
- package/dist/src/memory/canonical-context.js +392 -13
- package/dist/src/memory/canonical-maintenance.js +95 -0
- package/dist/src/memory/cli-result.js +22 -0
- package/dist/src/memory/cli.js +176 -0
- package/dist/src/memory/context-pack.js +57 -6
- package/dist/src/memory/cost.js +512 -0
- package/dist/src/memory/firewall-classification.d.mts +7 -0
- package/dist/src/memory/firewall-classification.mjs +32 -0
- package/dist/src/memory/index.js +8 -0
- package/dist/src/memory/line-maintenance.js +68 -0
- package/dist/src/memory/maintenance-cli.js +286 -0
- package/dist/src/memory/maintenance-contract.js +136 -0
- package/dist/src/memory/maintenance-index.js +18 -0
- package/dist/src/memory/maintenance-owner.js +2 -0
- package/dist/src/memory/maintenance-record.js +138 -0
- package/dist/src/memory/maintenance.js +254 -0
- package/dist/src/memory/provider-memory-adapter.js +154 -0
- package/dist/src/memory/recommend-cli.js +83 -0
- package/dist/src/memory/recommend.js +269 -0
- package/dist/src/memory/scheduled.js +81 -0
- package/dist/src/memory/taxonomy.js +44 -0
- package/dist/src/mission-protocol/codecs.js +19 -9
- package/dist/src/models/config-loader.js +11 -1
- package/dist/src/models/model-capabilities.v1.json +74 -50
- package/dist/src/models/provider-policy.js +125 -62
- package/dist/src/models/resolver.js +45 -8
- package/dist/src/models/worker-installation.d.mts +7 -0
- package/dist/src/models/worker-installation.mjs +169 -37
- package/dist/src/models/wrapper-route.js +1 -1
- package/dist/src/output-modes/registry.js +8 -7
- package/dist/src/plugin/metadata-validator.js +1 -1
- package/dist/src/providers/deploy-version.d.mts +1 -0
- package/dist/src/providers/deploy-version.mjs +17 -0
- package/dist/src/providers/provider-definitions.js +19 -16
- package/dist/src/providers/skill-ownership.d.mts +11 -2
- package/dist/src/providers/skill-ownership.mjs +35 -17
- package/dist/src/rules/activation.d.mts +11 -2
- package/dist/src/rules/activation.mjs +82 -6
- package/dist/src/rules/inventory.js +1 -1
- package/dist/src/rules/rule-frontmatter.schema.json +2 -0
- package/dist/src/schema/zod-validation.d.mts +6 -0
- package/dist/src/schema/zod-validation.mjs +50 -0
- package/dist/src/serve/executor-registry.js +297 -20
- package/dist/src/serve/executor-token.d.mts +1 -0
- package/dist/src/serve/executor-token.mjs +8 -0
- package/dist/src/serve/shared-host-scheduler.js +1102 -31
- package/dist/src/serve/worker-invocation.js +114 -15
- package/dist/src/sessions/adapters/claude.js +19 -18
- package/dist/src/sessions/adapters/codex.js +10 -9
- package/dist/src/sessions/adapters/copilot.js +14 -13
- package/dist/src/sessions/adapters/cursor.js +19 -18
- package/dist/src/sessions/adapters/deepseek-harness.js +9 -8
- package/dist/src/sessions/adapters/factory.js +11 -10
- package/dist/src/sessions/adapters/generic.js +32 -23
- package/dist/src/sessions/adapters/grokbot.js +35 -35
- package/dist/src/sessions/adapters/hermes.js +20 -19
- package/dist/src/sessions/adapters/muse.js +50 -49
- package/dist/src/sessions/adapters/omp.js +5 -4
- package/dist/src/sessions/adapters/openclaw.js +30 -29
- package/dist/src/sessions/adapters/opencode.js +26 -26
- package/dist/src/sessions/adapters/openhuman.js +24 -23
- package/dist/src/sessions/adapters/pi.js +5 -4
- package/dist/src/sessions/adapters/windsurf.js +8 -8
- package/dist/src/sessions/analytics.js +10 -9
- package/dist/src/sessions/candidates.js +7 -6
- package/dist/src/sessions/contracts.js +63 -53
- package/dist/src/sessions/output-registration.js +11 -10
- package/dist/src/sessions/workspace-discovery.js +3 -4
- package/dist/src/smiths/context-pipeline/aiwg-md.js +18 -1
- package/dist/src/smiths/context-pipeline/claude-hook.js +42 -6
- package/dist/src/smiths/context-pipeline/parallelism-section.js +72 -5
- package/dist/src/smiths/context-pipeline/workspace-context.js +106 -10
- package/dist/src/update/checker.d.mts +4 -0
- package/dist/src/update/checker.mjs +14 -0
- package/dist/src/writing/exemplar-selection.js +6 -6
- package/dist/src/writing/voice-evaluation.js +24 -23
- package/dist/src/writing/writer-migration.js +14 -13
- package/dist/src/writing/writer-profile.js +19 -18
- package/dist/src/writing/writing-brief.js +18 -17
- package/dist/src/writing/writing-receipt.js +47 -46
- package/package.json +5 -2
- package/schemas/decision/DecisionReview.schema.json +78 -1
- package/schemas/mission-v1.schema.json +3 -0
- package/tools/agents/deploy-agents.mjs +67 -39
- package/tools/agents/providers/antigravity.mjs +6 -1
- package/tools/agents/providers/base.mjs +19 -13
- package/tools/agents/providers/claude.mjs +1 -1
- package/tools/agents/providers/codex.mjs +50 -56
- package/tools/agents/providers/copilot.mjs +8 -2
- package/tools/agents/providers/cursor.mjs +1 -1
- package/tools/agents/providers/deepseek-harness.mjs +1 -1
- package/tools/agents/providers/factory.mjs +7 -1
- package/tools/agents/providers/grok-build.mjs +18 -2
- package/tools/agents/providers/grokbot.mjs +1 -1
- package/tools/agents/providers/hermes.mjs +7 -13
- package/tools/agents/providers/muse-hooks.mjs +21 -14
- package/tools/agents/providers/muse.mjs +7 -2
- package/tools/agents/providers/omp.mjs +28 -4
- package/tools/agents/providers/opencode.mjs +14 -5
- package/tools/agents/providers/openhuman.mjs +1 -1
- package/tools/agents/providers/pi.mjs +1 -1
- package/tools/agents/providers/provider-prepare-coordinator.mjs +29 -9
- package/tools/agents/providers/rule-delivery.mjs +263 -71
- package/tools/agents/providers/windsurf.mjs +7 -0
- package/tools/cli/workspace-status.mjs +5 -0
- package/tools/commands/deploy-prompts-codex.mjs +11 -8
- package/tools/ralph-external/lib/codex-adapter.mjs +6 -2
- package/tools/ralph-external/lib/muse-adapter.mjs +12 -2
- package/tools/ralph-external/lib/worker-health.mjs +1 -1
- package/tools/ralph-external/lib/worker-isolation.mjs +65 -9
- package/tools/ralph-external/process-monitor.mjs +7 -4
- package/tools/ralph-external/session-launcher.mjs +280 -32
- package/tools/skills/deploy-skills-codex.mjs +11 -7
- package/vscode-extension/schemas/aiwg.config.v1.json +11 -1
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
* - discover (cross-type ranked search)
|
|
8
8
|
* - skill-list (enumerate canonical skill corpus)
|
|
9
|
-
* - skill-show (
|
|
9
|
+
* - skill-show (metadata card + drill-ins)
|
|
10
10
|
* - command-list (enumerate CLI commands)
|
|
11
|
-
* - command-show (
|
|
11
|
+
* - command-show (metadata card + drill-ins)
|
|
12
12
|
* - rule-list (enumerate rules)
|
|
13
|
-
* - rule-show (
|
|
14
|
-
* - agent-show (
|
|
13
|
+
* - rule-show (metadata card + drill-ins)
|
|
14
|
+
* - agent-show (metadata card + drill-ins; agent-list pre-exists)
|
|
15
15
|
* - template-list (enumerate templates)
|
|
16
16
|
* - template-show (fetch raw template body)
|
|
17
17
|
*
|
|
@@ -22,10 +22,33 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { z } from 'zod';
|
|
25
|
+
import { integer } from '../../schema/zod-validation.mjs';
|
|
25
26
|
import { runAiwgCli, mcpError, mcpJson, AIWG_ROOT } from '../helpers.mjs';
|
|
26
27
|
import path from 'node:path';
|
|
27
28
|
import { pinContainedRoot, readContainedFile, listContainedFiles, validateContainedPath } from '../../utils/contained-filesystem.mjs';
|
|
28
29
|
|
|
30
|
+
/** Shared CLI/MCP drill-in vocabulary for all discovery cards. */
|
|
31
|
+
export const showDrillInSchema = {
|
|
32
|
+
body: z.boolean().optional().describe('Fetch the full authored body'),
|
|
33
|
+
section: z.array(z.string()).optional().describe('Exact headings (case-insensitive fallback); repeatable'),
|
|
34
|
+
rules: z.boolean().optional().describe('Show governing rule summaries and required checks'),
|
|
35
|
+
with_rule_bodies: z.boolean().optional().describe('Include full governing rule bodies'),
|
|
36
|
+
bound_rule_bodies: z.boolean().optional().describe('Legacy alias for with_rule_bodies'),
|
|
37
|
+
resources: z.boolean().optional().describe('List companion resources'),
|
|
38
|
+
resource: z.string().optional().describe('Fetch one resource path from the card'),
|
|
39
|
+
};
|
|
40
|
+
export function showDrillInArgs(input) {
|
|
41
|
+
return [
|
|
42
|
+
...(input.body ? ['--body'] : []),
|
|
43
|
+
...(input.section ?? []).flatMap(heading => ['--section', heading]),
|
|
44
|
+
...(input.rules ? ['--rules'] : []),
|
|
45
|
+
...(input.with_rule_bodies ? ['--with-rule-bodies'] : []),
|
|
46
|
+
...(input.bound_rule_bodies ? ['--bound-rule-bodies'] : []),
|
|
47
|
+
...(input.resources ? ['--resources'] : []),
|
|
48
|
+
...(input.resource ? ['--resource', input.resource] : []),
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
|
|
29
52
|
/**
|
|
30
53
|
* Register discovery tools on the MCP server.
|
|
31
54
|
*
|
|
@@ -42,7 +65,7 @@ export function registerDiscoveryTools(server, { corpusStore } = {}) {
|
|
|
42
65
|
inputSchema: {
|
|
43
66
|
phrase: z.string().describe('Natural-language capability description (e.g. "create intake form")'),
|
|
44
67
|
type: z.enum(['skill', 'agent', 'command', 'rule', 'flow', 'runbook', 'template', 'behavior']).optional().describe('Restrict to one artifact type'),
|
|
45
|
-
limit:
|
|
68
|
+
limit: integer().min(1).max(50).default(5).describe('Maximum results (default 5)'),
|
|
46
69
|
},
|
|
47
70
|
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
48
71
|
}, async ({ phrase, type, limit }) => {
|
|
@@ -67,7 +90,7 @@ export function registerDiscoveryTools(server, { corpusStore } = {}) {
|
|
|
67
90
|
description: 'Enumerate available AIWG skills from the canonical corpus. Optional filter by name pattern.',
|
|
68
91
|
inputSchema: {
|
|
69
92
|
filter: z.string().optional().describe('Substring or glob filter on skill name'),
|
|
70
|
-
limit:
|
|
93
|
+
limit: integer().min(1).max(500).default(50).describe('Maximum results'),
|
|
71
94
|
},
|
|
72
95
|
annotations: { readOnlyHint: true },
|
|
73
96
|
}, async ({ filter, limit }) => {
|
|
@@ -83,15 +106,15 @@ export function registerDiscoveryTools(server, { corpusStore } = {}) {
|
|
|
83
106
|
|
|
84
107
|
server.registerTool('skill-show', {
|
|
85
108
|
title: 'Show AIWG Skill',
|
|
86
|
-
description: '
|
|
109
|
+
description: 'Return the AIWG metadata card with governing rules, outline, resources, and drill-in guidance. Use body/section for authored content.',
|
|
87
110
|
inputSchema: {
|
|
88
|
-
|
|
111
|
+
...showDrillInSchema,
|
|
89
112
|
name: z.string().describe('Skill name (slug; e.g. "intake-wizard")'),
|
|
90
113
|
},
|
|
91
114
|
annotations: { readOnlyHint: true },
|
|
92
|
-
}, async ({ name,
|
|
115
|
+
}, async ({ name, ...drillIn }) => {
|
|
93
116
|
try {
|
|
94
|
-
const { stdout, code, stderr } = await runAiwgCli(['show', 'skill', name, '--json', ...(
|
|
117
|
+
const { stdout, code, stderr } = await runAiwgCli(['show', 'skill', name, '--json', ...showDrillInArgs(drillIn)]);
|
|
95
118
|
if (code !== 0) return mcpError(`skill-show failed: ${stderr}`);
|
|
96
119
|
return mcpJson(stdout);
|
|
97
120
|
} catch (err) {
|
|
@@ -122,14 +145,15 @@ export function registerDiscoveryTools(server, { corpusStore } = {}) {
|
|
|
122
145
|
|
|
123
146
|
server.registerTool('command-show', {
|
|
124
147
|
title: 'Show AIWG CLI Command Definition',
|
|
125
|
-
description: '
|
|
148
|
+
description: 'Return the AIWG metadata card with governing rules, outline, resources, and drill-in guidance. Use body/section for authored content.',
|
|
126
149
|
inputSchema: {
|
|
150
|
+
...showDrillInSchema,
|
|
127
151
|
name: z.string().describe('Command name (e.g. "use", "discover", "ralph")'),
|
|
128
152
|
},
|
|
129
153
|
annotations: { readOnlyHint: true },
|
|
130
|
-
}, async ({ name }) => {
|
|
154
|
+
}, async ({ name, ...drillIn }) => {
|
|
131
155
|
try {
|
|
132
|
-
const { stdout, code, stderr } = await runAiwgCli(['show', 'command', name, '--json']);
|
|
156
|
+
const { stdout, code, stderr } = await runAiwgCli(['show', 'command', name, '--json', ...showDrillInArgs(drillIn)]);
|
|
133
157
|
if (code !== 0) return mcpError(`command-show failed: ${stderr}`);
|
|
134
158
|
return mcpJson(stdout);
|
|
135
159
|
} catch (err) {
|
|
@@ -166,7 +190,7 @@ export function registerDiscoveryTools(server, { corpusStore } = {}) {
|
|
|
166
190
|
description: 'Enumerate AIWG enforcement rules (e.g. skill-discovery, no-attribution, anti-laziness, citation-policy). Top-7 CRITICAL/HIGH rules are inlined into Hermes AGENTS.md priming (skill-discovery added #1347); this tool reaches the rest.',
|
|
167
191
|
inputSchema: {
|
|
168
192
|
filter: z.string().optional().describe('Substring filter on rule name'),
|
|
169
|
-
limit:
|
|
193
|
+
limit: integer().min(1).max(200).default(50),
|
|
170
194
|
},
|
|
171
195
|
annotations: { readOnlyHint: true },
|
|
172
196
|
}, async ({ filter, limit }) => {
|
|
@@ -182,14 +206,15 @@ export function registerDiscoveryTools(server, { corpusStore } = {}) {
|
|
|
182
206
|
|
|
183
207
|
server.registerTool('rule-show', {
|
|
184
208
|
title: 'Show AIWG Rule',
|
|
185
|
-
description: '
|
|
209
|
+
description: 'Return the AIWG metadata card with governing rules, outline, resources, and drill-in guidance. Use body/section for authored content.',
|
|
186
210
|
inputSchema: {
|
|
211
|
+
...showDrillInSchema,
|
|
187
212
|
name: z.string().describe('Rule name (e.g. "no-attribution", "anti-laziness")'),
|
|
188
213
|
},
|
|
189
214
|
annotations: { readOnlyHint: true },
|
|
190
|
-
}, async ({ name }) => {
|
|
215
|
+
}, async ({ name, ...drillIn }) => {
|
|
191
216
|
try {
|
|
192
|
-
const { stdout, code, stderr } = await runAiwgCli(['show', 'rule', name, '--json']);
|
|
217
|
+
const { stdout, code, stderr } = await runAiwgCli(['show', 'rule', name, '--json', ...showDrillInArgs(drillIn)]);
|
|
193
218
|
if (code !== 0) return mcpError(`rule-show failed: ${stderr}`);
|
|
194
219
|
return mcpJson(stdout);
|
|
195
220
|
} catch (err) {
|
|
@@ -202,15 +227,15 @@ export function registerDiscoveryTools(server, { corpusStore } = {}) {
|
|
|
202
227
|
// ============================================================
|
|
203
228
|
server.registerTool('agent-show', {
|
|
204
229
|
title: 'Show AIWG Agent Definition',
|
|
205
|
-
description: '
|
|
230
|
+
description: 'Return the AIWG metadata card with governing rules, outline, resources, and drill-in guidance. Use body/section for authored content.',
|
|
206
231
|
inputSchema: {
|
|
207
|
-
|
|
232
|
+
...showDrillInSchema,
|
|
208
233
|
name: z.string().describe('Agent name (e.g. "test-engineer", "security-auditor")'),
|
|
209
234
|
},
|
|
210
235
|
annotations: { readOnlyHint: true },
|
|
211
|
-
}, async ({ name,
|
|
236
|
+
}, async ({ name, ...drillIn }) => {
|
|
212
237
|
try {
|
|
213
|
-
const { stdout, code, stderr } = await runAiwgCli(['show', 'agent', name, '--json', ...(
|
|
238
|
+
const { stdout, code, stderr } = await runAiwgCli(['show', 'agent', name, '--json', ...showDrillInArgs(drillIn)]);
|
|
214
239
|
if (code !== 0) return mcpError(`agent-show failed: ${stderr}`);
|
|
215
240
|
return mcpJson(stdout);
|
|
216
241
|
} catch (err) {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
+
import { integer } from '../../schema/zod-validation.mjs';
|
|
13
|
+
import { showDrillInSchema, showDrillInArgs } from './discovery.mjs';
|
|
12
14
|
import { parse as parseYaml } from 'yaml';
|
|
13
15
|
import fs from 'node:fs/promises';
|
|
14
16
|
import path from 'node:path';
|
|
@@ -157,28 +159,23 @@ export function registerFlowToolset(server) {
|
|
|
157
159
|
|
|
158
160
|
server.registerTool('flow-show', {
|
|
159
161
|
title: 'Show AIWG Flow',
|
|
160
|
-
description: '
|
|
162
|
+
description: 'Return the same metadata card as aiwg show flow, with optional body, section, rules, and resource drill-ins.',
|
|
161
163
|
inputSchema: {
|
|
164
|
+
...showDrillInSchema,
|
|
162
165
|
name: z.string().describe('Flow name or playbook file name (e.g. flow-release)'),
|
|
163
|
-
bound_rule_bodies: z.boolean().optional().describe('Include full bound rule bodies'),
|
|
164
166
|
framework: z.string().optional().describe('Optional framework disambiguator'),
|
|
165
167
|
},
|
|
166
168
|
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
167
|
-
}, async ({ name, framework,
|
|
169
|
+
}, async ({ name, framework, ...drillIn }) => {
|
|
168
170
|
try {
|
|
169
|
-
const flow = await findFlow(name, framework);
|
|
170
|
-
if (!flow) return mcpError(`flow-show: flow not found: ${name}`);
|
|
171
|
-
flow.wrapper_skill.exists = await pathExists(flow.wrapper_skill.path);
|
|
171
|
+
const flow = framework ? await findFlow(name, framework) : null;
|
|
172
|
+
if (framework && !flow) return mcpError(`flow-show: flow not found: ${name}`);
|
|
172
173
|
const { stdout, stderr, code } = await runAiwgCli([
|
|
173
|
-
'show', 'flow', flow
|
|
174
|
-
...(
|
|
174
|
+
'show', 'flow', flow?.path ?? name, '--json',
|
|
175
|
+
...showDrillInArgs(drillIn),
|
|
175
176
|
]);
|
|
176
|
-
if (code !== 0) return mcpError(`flow-show
|
|
177
|
-
|
|
178
|
-
return mcpJson({ ...flow, ...(shown.bound_rules ? { bound_rules: shown.bound_rules,
|
|
179
|
-
...(shown.required_rule_checks ? { required_rule_checks: shown.required_rule_checks } : {}),
|
|
180
|
-
...(shown.rule_stats ? { rule_stats: shown.rule_stats } : {}),
|
|
181
|
-
...(shown.rule_check_obligation ? { rule_check_obligation: shown.rule_check_obligation } : {}) } : {}) });
|
|
177
|
+
if (code !== 0) return mcpError(`flow-show lookup failed: ${stderr}`);
|
|
178
|
+
return mcpJson(stdout);
|
|
182
179
|
} catch (err) {
|
|
183
180
|
return mcpError(`flow-show: ${err.message}`);
|
|
184
181
|
}
|
|
@@ -191,7 +188,7 @@ export function registerFlowToolset(server) {
|
|
|
191
188
|
name: z.string().describe('Flow name (e.g. flow-release)'),
|
|
192
189
|
framework: z.string().optional().describe('Optional framework disambiguator'),
|
|
193
190
|
project_dir: z.string().optional().describe('Project directory where the Flow should operate'),
|
|
194
|
-
args: z.array(z.string()).
|
|
191
|
+
args: z.array(z.string()).prefault([]).describe('Operator arguments to pass conceptually to the wrapper skill'),
|
|
195
192
|
confirmed: z.boolean().default(false).describe('Required because Flows can run shell commands and write artifacts'),
|
|
196
193
|
},
|
|
197
194
|
annotations: { destructiveHint: true, openWorldHint: true },
|
|
@@ -246,15 +243,16 @@ export function registerMissionToolset(server) {
|
|
|
246
243
|
session_id: z.string().describe('Existing Mission Control session id from mc-start / mc-list'),
|
|
247
244
|
objective: z.string().describe('Mission objective'),
|
|
248
245
|
completion: z.string().describe('Measurable completion criterion'),
|
|
249
|
-
max_iterations:
|
|
250
|
-
max_total_tokens:
|
|
251
|
-
max_output_tokens:
|
|
252
|
-
max_tool_calls:
|
|
246
|
+
max_iterations: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Ralph iteration cap'),
|
|
247
|
+
max_total_tokens: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Hard cumulative token ceiling'),
|
|
248
|
+
max_output_tokens: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Hard cumulative output-token ceiling'),
|
|
249
|
+
max_tool_calls: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Hard cumulative tool-call ceiling'),
|
|
253
250
|
max_total_cost: z.number().positive().finite().optional().describe('Hard cumulative provider-reported spend ceiling'),
|
|
254
251
|
max_wall_clock_minutes: z.number().positive().finite().optional().describe('Hard cumulative runtime ceiling'),
|
|
255
|
-
exploration_quota:
|
|
252
|
+
exploration_quota: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Require structural variant after this many flat cycles (off unless declared; no default K)'),
|
|
256
253
|
budget_stop_policy: z.enum(['completion-wins', 'budget-wins']).optional().describe('Stop semantics when the completing iteration crosses a ceiling (default: completion-wins)'),
|
|
257
254
|
project_dir: z.string().optional().describe('Project directory for CLI dispatch'),
|
|
255
|
+
worker_dispatch: z.string().optional().describe('Absolute prepared managed worker dispatch JSON path inside the project'),
|
|
258
256
|
confirmed: z.boolean().default(false).describe('Required for durable/long-running mission dispatch'),
|
|
259
257
|
},
|
|
260
258
|
annotations: { destructiveHint: true, openWorldHint: true },
|
|
@@ -270,6 +268,7 @@ export function registerMissionToolset(server) {
|
|
|
270
268
|
max_wall_clock_minutes,
|
|
271
269
|
exploration_quota,
|
|
272
270
|
budget_stop_policy,
|
|
271
|
+
worker_dispatch,
|
|
273
272
|
project_dir,
|
|
274
273
|
confirmed,
|
|
275
274
|
}) => {
|
|
@@ -289,6 +288,7 @@ export function registerMissionToolset(server) {
|
|
|
289
288
|
if (max_wall_clock_minutes) cliArgs.push('--max-wall-clock-minutes', String(max_wall_clock_minutes));
|
|
290
289
|
if (exploration_quota) cliArgs.push('--exploration-quota', String(exploration_quota));
|
|
291
290
|
if (budget_stop_policy) cliArgs.push('--budget-stop-policy', budget_stop_policy);
|
|
291
|
+
if (worker_dispatch) cliArgs.push('--worker-dispatch', worker_dispatch);
|
|
292
292
|
const { stdout, stderr, code } = await runAiwgCli(
|
|
293
293
|
cliArgs,
|
|
294
294
|
{ cwd: project_dir, timeoutMs: 30_000 },
|
|
@@ -335,7 +335,7 @@ export function registerWorkerResolveTool(server) {
|
|
|
335
335
|
server.registerTool('worker-resolve', {
|
|
336
336
|
title: 'Resolve Worker Invocation',
|
|
337
337
|
description: 'Resolve a nonlaunching qualified worker plan without Mission or MC state.',
|
|
338
|
-
inputSchema: z.
|
|
338
|
+
inputSchema: z.strictObject({
|
|
339
339
|
role: z.enum(['efficiency', 'coding', 'reasoning']),
|
|
340
340
|
task: z.string().min(1),
|
|
341
341
|
group: z.string().min(1).regex(/^[a-z][a-z0-9-]{0,62}$/),
|
|
@@ -345,7 +345,7 @@ export function registerWorkerResolveTool(server) {
|
|
|
345
345
|
transport: z.enum(['shell', 'mcp']).default('shell'),
|
|
346
346
|
format: z.enum(['shell', 'json']).optional(),
|
|
347
347
|
project_dir: z.string().min(1).optional(),
|
|
348
|
-
})
|
|
348
|
+
}),
|
|
349
349
|
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
350
350
|
}, async input => {
|
|
351
351
|
try {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { z } from 'zod';
|
|
18
|
+
import { integer } from '../../schema/zod-validation.mjs';
|
|
18
19
|
import { runAiwgCli, mcpError, mcpJson } from '../helpers.mjs';
|
|
19
20
|
import { registerFlowToolset, registerMissionToolset } from './orchestration.mjs';
|
|
20
21
|
import { registerWorkerInvokeToolset, WORKERS_TOOLSET_NAME } from './worker-invoke.mjs';
|
|
@@ -187,7 +188,7 @@ function registerActivityLogToolset(server) {
|
|
|
187
188
|
inputSchema: {
|
|
188
189
|
since: z.string().optional().describe('Filter by date YYYY-MM-DD'),
|
|
189
190
|
operation: z.string().optional().describe('Filter by operation token (e.g. "create", "deploy")'),
|
|
190
|
-
limit:
|
|
191
|
+
limit: integer().min(1).max(1000).default(100),
|
|
191
192
|
},
|
|
192
193
|
readOnly: true,
|
|
193
194
|
buildArgs: ({ since, operation, limit }) => {
|
|
@@ -256,7 +257,7 @@ function registerIndexToolset(server) {
|
|
|
256
257
|
inputSchema: {
|
|
257
258
|
keyword: z.string().optional().describe('Keyword query'),
|
|
258
259
|
type: z.string().optional().describe('Artifact type filter'),
|
|
259
|
-
limit:
|
|
260
|
+
limit: integer().min(1).max(500).default(50),
|
|
260
261
|
},
|
|
261
262
|
readOnly: true,
|
|
262
263
|
buildArgs: ({ keyword, type, limit }) => {
|
|
@@ -310,7 +311,7 @@ function registerRalphToolset(server) {
|
|
|
310
311
|
inputSchema: {
|
|
311
312
|
task: z.string().describe('Task description'),
|
|
312
313
|
completion: z.string().describe('Measurable completion criteria (verification command)'),
|
|
313
|
-
max_cycles:
|
|
314
|
+
max_cycles: integer().min(1).max(500).default(20),
|
|
314
315
|
confirmed: z.boolean().default(false).describe('Required (Ralph is long-running)'),
|
|
315
316
|
},
|
|
316
317
|
annotations: { destructiveHint: true },
|
|
@@ -415,13 +416,13 @@ function registerMcToolset(server) {
|
|
|
415
416
|
session_id: z.string().describe('Session id'),
|
|
416
417
|
objective: z.string().describe('Mission objective'),
|
|
417
418
|
completion: z.string().optional().describe('Completion criteria'),
|
|
418
|
-
max_iterations:
|
|
419
|
-
max_total_tokens:
|
|
420
|
-
max_output_tokens:
|
|
421
|
-
max_tool_calls:
|
|
419
|
+
max_iterations: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Ralph iteration cap'),
|
|
420
|
+
max_total_tokens: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Hard cumulative token ceiling'),
|
|
421
|
+
max_output_tokens: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Hard cumulative output-token ceiling'),
|
|
422
|
+
max_tool_calls: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Hard cumulative tool-call ceiling'),
|
|
422
423
|
max_total_cost: z.number().positive().finite().optional().describe('Hard cumulative provider-reported spend ceiling'),
|
|
423
424
|
max_wall_clock_minutes: z.number().positive().finite().optional().describe('Hard cumulative runtime ceiling'),
|
|
424
|
-
exploration_quota:
|
|
425
|
+
exploration_quota: integer().positive().max(Number.MAX_SAFE_INTEGER).optional().describe('Require structural variant after this many flat cycles (off unless declared; no default K)'),
|
|
425
426
|
budget_stop_policy: z.enum(['completion-wins', 'budget-wins']).optional().describe('Stop semantics when the completing iteration crosses a ceiling (default: completion-wins)'),
|
|
426
427
|
},
|
|
427
428
|
buildArgs: ({
|
|
@@ -159,6 +159,13 @@
|
|
|
159
159
|
|
|
160
160
|
import { signalChild } from '../../process/signal-child.mjs';
|
|
161
161
|
import { z } from 'zod';
|
|
162
|
+
|
|
163
|
+
// Keep accepting existing UUID-shaped identifiers regardless of version bits.
|
|
164
|
+
const invocationUuid = () => z.string().check(ctx => {
|
|
165
|
+
if (!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(ctx.value)) {
|
|
166
|
+
ctx.issues.push({ code: 'invalid_format', format: 'uuid', input: ctx.value, message: 'Invalid uuid' });
|
|
167
|
+
}
|
|
168
|
+
}).meta({ format: 'uuid' });
|
|
162
169
|
import { createHash, randomUUID } from 'node:crypto';
|
|
163
170
|
import {
|
|
164
171
|
realpath, readlink as fsReadlink, open as fsOpen, lstat, unlink,
|
|
@@ -1532,12 +1539,12 @@ function publicStatus(entry, healthHook) {
|
|
|
1532
1539
|
// Tool registration.
|
|
1533
1540
|
// ===========================================================================
|
|
1534
1541
|
|
|
1535
|
-
const inputSchema = z.
|
|
1542
|
+
const inputSchema = z.strictObject({
|
|
1536
1543
|
// #2915 round 8 (D4): `reconcile_stopped` is an explicit operator-
|
|
1537
1544
|
// authorized reconciliation operation on this SAME handler (never a
|
|
1538
1545
|
// mailbox file, never a new breaker) — see `reconcileStopped` below.
|
|
1539
1546
|
operation: z.enum(['run', 'status', 'cancel', 'reconcile_stopped', 'reset_recovery_scope']),
|
|
1540
|
-
invocation_id:
|
|
1547
|
+
invocation_id: invocationUuid().optional(),
|
|
1541
1548
|
scope_id: z.string().min(1).max(512).optional(),
|
|
1542
1549
|
request_id: z.string().min(1).max(128).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),
|
|
1543
1550
|
role: z.enum(['efficiency', 'coding', 'reasoning']).optional(),
|
|
@@ -1553,8 +1560,8 @@ const inputSchema = z.object({
|
|
|
1553
1560
|
// configuration exists yet for the MCP shell-launch path — see
|
|
1554
1561
|
// session-launcher.mjs `verifyRetryPredecessor`, which the CLI entry
|
|
1555
1562
|
// point already uses). Omission is unrelated work, as always.
|
|
1556
|
-
retry_of:
|
|
1557
|
-
})
|
|
1563
|
+
retry_of: invocationUuid().optional(),
|
|
1564
|
+
});
|
|
1558
1565
|
|
|
1559
1566
|
/**
|
|
1560
1567
|
* #2892 B1: `options.projectRoot` is REQUIRED — the caller (`server.mjs`,
|
|
@@ -1726,6 +1733,12 @@ export async function registerWorkerInvokeToolset(server, options = {}) {
|
|
|
1726
1733
|
if (plan.invocation?.readiness !== 'launchable') {
|
|
1727
1734
|
return markTerminal({ status: 'blocked', termination: 'confirmed', diagnostics: plan.diagnostics ?? [] });
|
|
1728
1735
|
}
|
|
1736
|
+
if (plan.invocation.isolation === 'native-sandbox') {
|
|
1737
|
+
return markTerminal({ status: 'blocked', termination: 'confirmed', diagnostics: [{
|
|
1738
|
+
code: 'OG_POLICY_RELAXATION', pointer: '/worker/isolation',
|
|
1739
|
+
message: 'MCP worker-invoke run does not support pinned native-sandbox isolation',
|
|
1740
|
+
}] });
|
|
1741
|
+
}
|
|
1729
1742
|
prefix = { root, snapshot, drivers, invocation: plan.invocation };
|
|
1730
1743
|
} catch (error) {
|
|
1731
1744
|
return markTerminal({ status: 'blocked', termination: 'confirmed', diagnostics: [error.message] });
|
|
@@ -32,7 +32,7 @@ export function registerWriterProfileResources(server, options = {}) {
|
|
|
32
32
|
server.registerResource('writer-profile', new ResourceTemplate('aiwg://writer-profiles/{scope}/{id}', { list: undefined }), {
|
|
33
33
|
title: 'Shared Writer Profile', description: 'Explicit scoped read using profile sharing approvals; private exports are unavailable through this resource.', mimeType: 'application/json',
|
|
34
34
|
}, async (uri, variables) => {
|
|
35
|
-
const selection = z.
|
|
35
|
+
const selection = z.strictObject({ scope: z.enum(['project', 'user']), id: z.string().regex(/^[a-z0-9][a-z0-9.-]{0,79}$/) }).parse(variables);
|
|
36
36
|
const cwd = await projectRoot(); const { WriterProfileStore, exportWriterProfile } = await api();
|
|
37
37
|
const profile = await new WriterProfileStore({ cwd, scope: selection.scope }).read(selection.id);
|
|
38
38
|
return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(exportWriterProfile(profile, 'shared')) }] };
|