@zhixuan92/multi-model-agent-mcp 0.4.0 → 1.0.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/README.md +18 -27
- package/dist/cli.d.ts +16 -17
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +180 -123
- package/dist/cli.js.map +1 -1
- package/dist/routing/render-provider-routing-matrix.d.ts +1 -1
- package/dist/routing/render-provider-routing-matrix.d.ts.map +1 -1
- package/dist/routing/render-provider-routing-matrix.js +38 -67
- package/dist/routing/render-provider-routing-matrix.js.map +1 -1
- package/dist/tools/audit-document.d.ts +19 -0
- package/dist/tools/audit-document.d.ts.map +1 -0
- package/dist/tools/audit-document.js +30 -0
- package/dist/tools/audit-document.js.map +1 -0
- package/dist/tools/debug-task.d.ts +15 -0
- package/dist/tools/debug-task.d.ts.map +1 -0
- package/dist/tools/debug-task.js +33 -0
- package/dist/tools/debug-task.js.map +1 -0
- package/dist/tools/execute-plan-task.d.ts +26 -0
- package/dist/tools/execute-plan-task.d.ts.map +1 -0
- package/dist/tools/execute-plan-task.js +49 -0
- package/dist/tools/execute-plan-task.js.map +1 -0
- package/dist/tools/review-code.d.ts +19 -0
- package/dist/tools/review-code.d.ts.map +1 -0
- package/dist/tools/review-code.js +31 -0
- package/dist/tools/review-code.js.map +1 -0
- package/dist/tools/verify-work.d.ts +14 -0
- package/dist/tools/verify-work.d.ts.map +1 -0
- package/dist/tools/verify-work.js +32 -0
- package/dist/tools/verify-work.js.map +1 -0
- package/package.json +22 -2
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { findModelProfile, getEffectiveCostTier } from '@zhixuan92/multi-model-agent-core/routing/model-profiles';
|
|
1
|
+
import { findModelCapabilities, findModelProfile } from '@zhixuan92/multi-model-agent-core/routing/model-profiles';
|
|
3
2
|
const ROUTING_RECIPE = `How to route a task:
|
|
4
|
-
1.
|
|
5
|
-
2.
|
|
6
|
-
|
|
7
|
-
3. Cost preference (STRONG): among the remainder, prefer the cheapest tier.
|
|
8
|
-
If a 'free' provider qualifies, pick it. Only escalate to paid tiers when
|
|
9
|
-
the task tier or required capabilities demand it.
|
|
3
|
+
1. Select the agent type based on required capabilities.
|
|
4
|
+
2. If the selected agent lacks required capabilities, auto-escalate to the other agent type.
|
|
5
|
+
3. Among available agents, prefer the one that meets capability requirements.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
- 'trivial' — well-defined edits, lookups, formatting. One obvious answer.
|
|
7
|
+
Agent guidance:
|
|
13
8
|
- 'standard' — most code work. Clear spec, multiple valid approaches.
|
|
14
|
-
- '
|
|
15
|
-
Use when requirements are unclear or judgment is required.
|
|
9
|
+
- 'complex' — ambiguous, architectural, research, or high-stakes tasks requiring more reasoning.
|
|
16
10
|
|
|
17
11
|
Optional 'effort' knob (per task):
|
|
18
|
-
- Only
|
|
19
|
-
- Use 'high' for
|
|
12
|
+
- Only agents marked 'effort: supported' in the matrix honor this field.
|
|
13
|
+
- Use 'high' for complex tasks when you want maximum depth,
|
|
20
14
|
'medium' for balanced, 'low' for fast-but-shallow, 'none' to disable
|
|
21
|
-
thinking entirely on
|
|
22
|
-
|
|
23
|
-
const TOOL_NOTES = `Sub-agent tool notes (apply to every provider):
|
|
15
|
+
thinking entirely on agents that default it on.`;
|
|
16
|
+
const TOOL_NOTES = `Sub-agent tool notes (apply to every agent):
|
|
24
17
|
- 'grep' accepts a file OR a directory. When given a directory it searches
|
|
25
18
|
recursively (output is prefixed file:line). Prefer one recursive grep over
|
|
26
19
|
many readFile calls when the worker needs to find usages or patterns.
|
|
@@ -28,19 +21,18 @@ const TOOL_NOTES = `Sub-agent tool notes (apply to every provider):
|
|
|
28
21
|
otherwise salvaged from a running scratchpad. You ALWAYS get text back,
|
|
29
22
|
even on 'incomplete' / 'timeout' / 'api_error' / 'network_error' paths.
|
|
30
23
|
- Tasks that need shell ('pnpm', 'pytest', 'tsc', 'git') only work on
|
|
31
|
-
|
|
24
|
+
agents configured with sandboxPolicy: 'none'. Otherwise keep shell
|
|
32
25
|
work on the parent session, not in a delegated sub-agent.
|
|
33
26
|
|
|
34
27
|
Escalation, statuses, streaming, and batch helpers:
|
|
35
|
-
- Auto-routed tasks (no '
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
per-task 'escalationLog' shows every attempt.
|
|
39
|
-
('provider' set) run as a single attempt — pinning opts out.
|
|
28
|
+
- Auto-routed tasks (no 'agentType' set) use 'standard' agent.
|
|
29
|
+
- If the selected agent lacks required capabilities, auto-escalate to 'complex'.
|
|
30
|
+
- If every agent fails, the best salvage is returned and the
|
|
31
|
+
per-task 'escalationLog' shows every attempt.
|
|
40
32
|
- Status values: 'ok', 'incomplete', 'max_turns', 'timeout',
|
|
41
33
|
'api_aborted', 'api_error', 'network_error', 'error'.
|
|
42
34
|
'incomplete' = scratchpad salvage after a degenerate completion;
|
|
43
|
-
'api_aborted' =
|
|
35
|
+
'api_aborted' = agent-side abort; 'api_error' = HTTP error with
|
|
44
36
|
a numeric .status; 'network_error' = transport failure
|
|
45
37
|
(ECONNREFUSED / ENOTFOUND / /network/i).
|
|
46
38
|
- Streaming: if your MCP client passes '_meta.progressToken' on the
|
|
@@ -59,22 +51,21 @@ Escalation, statuses, streaming, and batch helpers:
|
|
|
59
51
|
shared across multiple tasks are sent to the parent session only
|
|
60
52
|
once.
|
|
61
53
|
|
|
62
|
-
RESPONSE SHAPE (
|
|
54
|
+
RESPONSE SHAPE (v1.0+): Every delegate_tasks response includes a top-level
|
|
63
55
|
batchId, mode ('full' or 'summary'), timings ({wallClockMs, sumOfTaskMs,
|
|
64
56
|
estimatedParallelSavingsMs}), batchProgress ({totalTasks, completedTasks,
|
|
65
57
|
incompleteTasks, failedTasks, successPercent}), and aggregateCost
|
|
66
|
-
({totalActualCostUSD, totalSavedCostUSD
|
|
67
|
-
savedCostUnavailableTasks}). If the combined output across tasks is small,
|
|
58
|
+
({totalActualCostUSD, totalSavedCostUSD}). If the combined output across tasks is small,
|
|
68
59
|
mode: 'full' with inline outputs; if it exceeds the server's threshold
|
|
69
60
|
(default 64 KB, configurable via env MULTI_MODEL_LARGE_RESPONSE_THRESHOLD_CHARS
|
|
70
61
|
/ config defaults.largeResponseThresholdChars / buildMcpServer option),
|
|
71
|
-
mode: 'summary' with per-task outputLength + outputSha256 +
|
|
72
|
-
hint — fetch individual outputs with
|
|
73
|
-
or per-task
|
|
62
|
+
mode: 'summary' with per-task outputLength + outputSha256 + _fetchWith
|
|
63
|
+
hint — fetch individual outputs with get_batch_slice({ batchId, slice: 'output', taskIndex }),
|
|
64
|
+
or per-task details with get_batch_slice({ batchId, slice: 'detail', taskIndex }).
|
|
74
65
|
Set responseMode: 'full' to force inline, 'summary' to force summary, or
|
|
75
66
|
omit for auto-escape.
|
|
76
67
|
|
|
77
|
-
COVERAGE DECLARATION (
|
|
68
|
+
COVERAGE DECLARATION (v1.0+): For tasks with enumerable deliverables
|
|
78
69
|
(multi-file refactors, test generation across many functions, multi-PR
|
|
79
70
|
review, per-endpoint reports, per-function test stubs, audit checklists),
|
|
80
71
|
set expectedCoverage on the task spec with either minSections: N,
|
|
@@ -86,7 +77,7 @@ Do NOT set expectedCoverage for one-shot tasks (bug fixes, single
|
|
|
86
77
|
implementations, prose, creative writing) — the field is opt-in and has
|
|
87
78
|
no meaning for deliverables you can't enumerate ahead of time.
|
|
88
79
|
|
|
89
|
-
COST + TIME VISIBILITY (
|
|
80
|
+
COST + TIME VISIBILITY (v1.0+): Set parentModel on the task spec (e.g.
|
|
90
81
|
'claude-opus-4-6') to get usage.savedCostUSD — the ESTIMATED cost
|
|
91
82
|
difference vs running the same token volume on that parent model.
|
|
92
83
|
Positive means delegation was cheaper. Both usage.costUSD (actual) and
|
|
@@ -98,39 +89,17 @@ serial for-loop. batchProgress.successPercent is a clean-success rate
|
|
|
98
89
|
(the batch is always 100% done by the time you see the response —
|
|
99
90
|
successPercent measures how many finished cleanly, NOT progress).
|
|
100
91
|
|
|
101
|
-
PROGRESS TRACE (v0.3+): Set includeProgressTrace: true on the task spec
|
|
102
|
-
to receive a bounded, priority-trimmed trace of the execution timeline
|
|
103
|
-
in the final RunResult.progressTrace. Useful for post-hoc debugging of
|
|
104
|
-
long-running tasks — did the worker loop through supervision retries,
|
|
105
|
-
where did it stall, did it escalate across providers. The trace is
|
|
106
|
-
trimmed at 80 events and 16 KB; text_emission and tool_call events are
|
|
107
|
-
dropped first under pressure (their content is already in output /
|
|
108
|
-
toolCalls). Boundary events (turn_start, turn_complete, escalation_start,
|
|
109
|
-
injection, done) are never dropped. If trimming fired, a synthetic
|
|
110
|
-
_trimmed marker at the end of the trace reports the dropped count and
|
|
111
|
-
per-kind histogram.
|
|
112
|
-
|
|
113
|
-
NOTE: progress-events at the MCP protocol level (notifications/progress)
|
|
114
|
-
are emitted correctly by the server and delivered to the MCP client.
|
|
115
|
-
Whether your client renders them live depends on the client — some
|
|
116
|
-
render them as in-flight tool-call status lines, others don't surface
|
|
117
|
-
them to the calling LLM at all. includeProgressTrace gives you the
|
|
118
|
-
full timeline post-hoc regardless of your client's live-rendering
|
|
119
|
-
behavior.
|
|
120
|
-
|
|
121
92
|
AVAILABLE TOOLS: delegate_tasks (this one), register_context_block
|
|
122
93
|
(stash reusable brief content referenced via TaskSpec.contextBlockIds),
|
|
123
94
|
retry_tasks (re-dispatch specific indices from a previous batch),
|
|
124
|
-
|
|
125
|
-
summary mode).`;
|
|
126
|
-
function
|
|
127
|
-
const cost = getEffectiveCostTier(config);
|
|
128
|
-
const costSuffix = costSource === 'config' ? ' (from config)' : '';
|
|
95
|
+
get_batch_slice (fetch outputs/details/telemetry when a response was in
|
|
96
|
+
summary mode or for per-task introspection).`;
|
|
97
|
+
function renderAgentBlock(name, config, capabilities, profile) {
|
|
129
98
|
const effortLabel = profile.supportsEffort ? 'supported' : 'not supported';
|
|
130
99
|
const lines = [
|
|
131
100
|
`${name} (${config.model})`,
|
|
132
|
-
`
|
|
133
|
-
`
|
|
101
|
+
` capabilities: ${capabilities.join(', ') || '(none)'}`,
|
|
102
|
+
` cost: ${profile.defaultCost} | effort: ${effortLabel}`,
|
|
134
103
|
` best for: ${profile.bestFor}`,
|
|
135
104
|
];
|
|
136
105
|
if (profile.notes) {
|
|
@@ -143,20 +112,22 @@ function renderProviderBlock(name, config, capabilities, profile, costSource) {
|
|
|
143
112
|
}
|
|
144
113
|
/**
|
|
145
114
|
* Renders the full routing matrix for the MCP tool description.
|
|
146
|
-
* Helps the consuming LLM understand
|
|
115
|
+
* Helps the consuming LLM understand agent capabilities and routing rules.
|
|
147
116
|
*/
|
|
148
117
|
export function renderProviderRoutingMatrix(config) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
118
|
+
if (!config.agents) {
|
|
119
|
+
return 'No agents configured.';
|
|
120
|
+
}
|
|
121
|
+
const blocks = Object.entries(config.agents).map(([name, agentConfig]) => {
|
|
122
|
+
const capabilities = agentConfig.capabilities ?? findModelCapabilities(agentConfig.model);
|
|
123
|
+
const profile = findModelProfile(agentConfig.model);
|
|
124
|
+
return renderAgentBlock(name, agentConfig, capabilities, profile);
|
|
154
125
|
});
|
|
155
126
|
return [
|
|
156
|
-
'Delegate tasks to sub-agents running on different LLM
|
|
127
|
+
'Delegate tasks to sub-agents running on different LLM models.',
|
|
157
128
|
'All tasks execute concurrently.',
|
|
158
129
|
'',
|
|
159
|
-
'Available
|
|
130
|
+
'Available agents:',
|
|
160
131
|
'',
|
|
161
132
|
blocks.join('\n\n'),
|
|
162
133
|
'',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-provider-routing-matrix.js","sourceRoot":"","sources":["../../src/routing/render-provider-routing-matrix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"render-provider-routing-matrix.js","sourceRoot":"","sources":["../../src/routing/render-provider-routing-matrix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,E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AM,YAAY,GAAG,WAAW,CAAC,YAAY,IAAI,qBAAqB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC1F,MAAM,OAAO,GAAG,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACpD,OAAO,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,+DAA+D;QAC/D,iCAAiC;QACjC,EAAE;QACF,mBAAmB;QACnB,EAAE;QACF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACnB,EAAE;QACF,cAAc;QACd,EAAE;QACF,UAAU;KACX,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import type { MultiModelConfig } from '@zhixuan92/multi-model-agent-core';
|
|
4
|
+
export declare const auditDocumentSchema: z.ZodObject<{
|
|
5
|
+
document: z.ZodString;
|
|
6
|
+
auditType: z.ZodEnum<{
|
|
7
|
+
security: "security";
|
|
8
|
+
performance: "performance";
|
|
9
|
+
correctness: "correctness";
|
|
10
|
+
style: "style";
|
|
11
|
+
}>;
|
|
12
|
+
agentType: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
standard: "standard";
|
|
14
|
+
complex: "complex";
|
|
15
|
+
}>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type AuditDocumentParams = z.infer<typeof auditDocumentSchema>;
|
|
18
|
+
export declare function registerAuditDocument(server: McpServer, config: MultiModelConfig): void;
|
|
19
|
+
//# sourceMappingURL=audit-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-document.d.ts","sourceRoot":"","sources":["../../src/tools/audit-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAI9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,QA8BhF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
|
|
3
|
+
export const auditDocumentSchema = z.object({
|
|
4
|
+
document: z.string().describe('The document to audit'),
|
|
5
|
+
auditType: z.enum(['security', 'performance', 'correctness', 'style']).describe('Type of audit'),
|
|
6
|
+
agentType: z.enum(['standard', 'complex']).optional(),
|
|
7
|
+
});
|
|
8
|
+
export function registerAuditDocument(server, config) {
|
|
9
|
+
server.tool('audit_document', 'Audit a document for security, performance, correctness, or style issues using a single agent (defaults to complex).', auditDocumentSchema.shape, async (params) => {
|
|
10
|
+
const agentType = params.agentType ?? 'complex';
|
|
11
|
+
const prompt = `Audit this document for ${params.auditType}:\n\n${params.document}\n\n` +
|
|
12
|
+
`Provide a structured audit report with findings and severity.`;
|
|
13
|
+
try {
|
|
14
|
+
const results = await runTasks([{ prompt, agentType, reviewPolicy: 'off' }], config);
|
|
15
|
+
const result = results[0];
|
|
16
|
+
return {
|
|
17
|
+
content: [
|
|
18
|
+
{ type: 'text', text: result.output },
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
return {
|
|
24
|
+
content: [{ type: 'text', text: `Error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
25
|
+
isError: true,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=audit-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-document.js","sourceRoot":"","sources":["../../src/tools/audit-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACtD,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;IAChG,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtD,CAAC,CAAC;AAIH,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,MAAwB;IAC/E,MAAM,CAAC,IAAI,CACT,gBAAgB,EAChB,sHAAsH,EACtH,mBAAmB,CAAC,KAAK,EACzB,KAAK,EAAE,MAA2B,EAAE,EAAE;QACpC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC;QAChD,MAAM,MAAM,GAAG,2BAA2B,MAAM,CAAC,SAAS,QAAQ,MAAM,CAAC,QAAQ,MAAM;YACrF,+DAA+D,CAAC;QAElE,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAC5B,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,EAC5C,MAAM,CACP,CAAC;YAEF,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,OAAO;gBACL,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE;iBAC/C;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACxG,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import type { MultiModelConfig } from '@zhixuan92/multi-model-agent-core';
|
|
4
|
+
export declare const debugTaskSchema: z.ZodObject<{
|
|
5
|
+
problem: z.ZodString;
|
|
6
|
+
context: z.ZodOptional<z.ZodString>;
|
|
7
|
+
hypothesis: z.ZodOptional<z.ZodString>;
|
|
8
|
+
agentType: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
standard: "standard";
|
|
10
|
+
complex: "complex";
|
|
11
|
+
}>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type DebugTaskParams = z.infer<typeof debugTaskSchema>;
|
|
14
|
+
export declare function registerDebugTask(server: McpServer, config: MultiModelConfig): void;
|
|
15
|
+
//# sourceMappingURL=debug-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-task.d.ts","sourceRoot":"","sources":["../../src/tools/debug-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,eAAO,MAAM,eAAe;;;;;;;;iBAK1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,QAgC5E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
|
|
3
|
+
export const debugTaskSchema = z.object({
|
|
4
|
+
problem: z.string().describe('Description of the problem to debug'),
|
|
5
|
+
context: z.string().optional().describe('Additional context about the problem'),
|
|
6
|
+
hypothesis: z.string().optional().describe('Initial hypothesis about the cause'),
|
|
7
|
+
agentType: z.enum(['standard', 'complex']).optional(),
|
|
8
|
+
});
|
|
9
|
+
export function registerDebugTask(server, config) {
|
|
10
|
+
server.tool('debug_task', 'Debug a problem using hypothesis-driven approach with two attempts.', debugTaskSchema.shape, async (params) => {
|
|
11
|
+
const agentType = params.agentType ?? 'complex';
|
|
12
|
+
const prompt = `Debug this problem:\n\n${params.problem}\n\n` +
|
|
13
|
+
(params.context ? `Context: ${params.context}\n\n` : '') +
|
|
14
|
+
(params.hypothesis ? `Initial hypothesis: ${params.hypothesis}\n\n` : '') +
|
|
15
|
+
`Use hypothesis-driven debugging: identify root cause, propose fix, verify.`;
|
|
16
|
+
try {
|
|
17
|
+
const results = await runTasks([{ prompt, agentType, maxReviewRounds: 1 }], config);
|
|
18
|
+
const result = results[0];
|
|
19
|
+
return {
|
|
20
|
+
content: [
|
|
21
|
+
{ type: 'text', text: result.output },
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: 'text', text: `Error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
28
|
+
isError: true,
|
|
29
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CAAC;YACzE,4EAA4E,CAAC;QAE/E,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAC5B,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC,EAC3C,MAAM,CACP,CAAC;YAEF,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,OAAO;gBACL,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE;iBAC/C;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACxG,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import type { MultiModelConfig } from '@zhixuan92/multi-model-agent-core';
|
|
4
|
+
export declare const executePlanTaskSchema: z.ZodObject<{
|
|
5
|
+
prompt: z.ZodString;
|
|
6
|
+
agentType: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
standard: "standard";
|
|
8
|
+
complex: "complex";
|
|
9
|
+
}>>;
|
|
10
|
+
requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
11
|
+
web_search: "web_search";
|
|
12
|
+
web_fetch: "web_fetch";
|
|
13
|
+
}>>>;
|
|
14
|
+
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
17
|
+
reviewPolicy: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
full: "full";
|
|
19
|
+
spec_only: "spec_only";
|
|
20
|
+
off: "off";
|
|
21
|
+
}>>;
|
|
22
|
+
maxReviewRounds: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type ExecutePlanTaskParams = z.infer<typeof executePlanTaskSchema>;
|
|
25
|
+
export declare function registerExecutePlanTask(server: McpServer, config: MultiModelConfig): void;
|
|
26
|
+
//# sourceMappingURL=execute-plan-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-plan-task.d.ts","sourceRoot":"","sources":["../../src/tools/execute-plan-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;iBAShC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,QA2ClF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
|
|
3
|
+
export const executePlanTaskSchema = z.object({
|
|
4
|
+
prompt: z.string().describe('Task prompt for the sub-agent'),
|
|
5
|
+
agentType: z.enum(['standard', 'complex']).optional().describe('Which labor agent to use'),
|
|
6
|
+
requiredCapabilities: z.array(z.enum(['web_search', 'web_fetch'])).optional(),
|
|
7
|
+
maxTurns: z.number().optional(),
|
|
8
|
+
timeoutMs: z.number().optional(),
|
|
9
|
+
cwd: z.string().optional(),
|
|
10
|
+
reviewPolicy: z.enum(['full', 'spec_only', 'off']).optional(),
|
|
11
|
+
maxReviewRounds: z.number().optional(),
|
|
12
|
+
});
|
|
13
|
+
export function registerExecutePlanTask(server, config) {
|
|
14
|
+
server.tool('execute_plan_task', 'Execute a single task with optional TDD awareness. ' +
|
|
15
|
+
'The task is run through the reviewed execution pipeline.', executePlanTaskSchema.shape, async (params) => {
|
|
16
|
+
try {
|
|
17
|
+
const results = await runTasks([{
|
|
18
|
+
prompt: params.prompt,
|
|
19
|
+
agentType: params.agentType ?? 'standard',
|
|
20
|
+
requiredCapabilities: params.requiredCapabilities,
|
|
21
|
+
maxTurns: params.maxTurns,
|
|
22
|
+
timeoutMs: params.timeoutMs,
|
|
23
|
+
cwd: params.cwd,
|
|
24
|
+
reviewPolicy: params.reviewPolicy,
|
|
25
|
+
maxReviewRounds: params.maxReviewRounds,
|
|
26
|
+
}], config);
|
|
27
|
+
const result = results[0];
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{ type: 'text', text: result.output },
|
|
31
|
+
{ type: 'text', text: JSON.stringify({
|
|
32
|
+
status: result.status,
|
|
33
|
+
workerStatus: result.workerStatus,
|
|
34
|
+
specReviewStatus: result.specReviewStatus,
|
|
35
|
+
qualityReviewStatus: result.qualityReviewStatus,
|
|
36
|
+
usage: result.usage,
|
|
37
|
+
}, null, 2) },
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
return {
|
|
43
|
+
content: [{ type: 'text', text: `Error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=execute-plan-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-plan-task.js","sourceRoot":"","s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ultiModelConfig } from '@zhixuan92/multi-model-agent-core';
|
|
4
|
+
export declare const reviewCodeSchema: z.ZodObject<{
|
|
5
|
+
code: z.ZodString;
|
|
6
|
+
focus: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
7
|
+
security: "security";
|
|
8
|
+
performance: "performance";
|
|
9
|
+
correctness: "correctness";
|
|
10
|
+
style: "style";
|
|
11
|
+
}>>>;
|
|
12
|
+
agentType: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
standard: "standard";
|
|
14
|
+
complex: "complex";
|
|
15
|
+
}>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type ReviewCodeParams = z.infer<typeof reviewCodeSchema>;
|
|
18
|
+
export declare function registerReviewCode(server: McpServer, config: MultiModelConfig): void;
|
|
19
|
+
//# sourceMappingURL=review-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-code.d.ts","sourceRoot":"","sources":["../../src/tools/review-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;iBAI3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,QA+B7E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
|
|
3
|
+
export const reviewCodeSchema = z.object({
|
|
4
|
+
code: z.string().describe('The code to review'),
|
|
5
|
+
focus: z.array(z.enum(['security', 'performance', 'correctness', 'style'])).optional(),
|
|
6
|
+
agentType: z.enum(['standard', 'complex']).optional(),
|
|
7
|
+
});
|
|
8
|
+
export function registerReviewCode(server, config) {
|
|
9
|
+
server.tool('review_code', 'Review code using a cross-model approach (standard agent implements, complex agent reviews).', reviewCodeSchema.shape, async (params) => {
|
|
10
|
+
const agentType = params.agentType ?? 'complex';
|
|
11
|
+
const focusText = params.focus ? `Focus areas: ${params.focus.join(', ')}.` : '';
|
|
12
|
+
const prompt = `Review this code:\n\n\`\`\`\n${params.code}\n\`\`\`\n\n${focusText}\n\n` +
|
|
13
|
+
`Provide a structured review with findings and recommendations.`;
|
|
14
|
+
try {
|
|
15
|
+
const results = await runTasks([{ prompt, agentType, reviewPolicy: 'full' }], config);
|
|
16
|
+
const result = results[0];
|
|
17
|
+
return {
|
|
18
|
+
content: [
|
|
19
|
+
{ type: 'text', text: result.output },
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: 'text', text: `Error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
26
|
+
isError: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=review-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-code.js","sourceRoot":"","sources":["../../src/tools/review-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,aAA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ACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import type { MultiModelConfig } from '@zhixuan92/multi-model-agent-core';
|
|
4
|
+
export declare const verifyWorkSchema: z.ZodObject<{
|
|
5
|
+
work: z.ZodString;
|
|
6
|
+
checklist: z.ZodArray<z.ZodString>;
|
|
7
|
+
agentType: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
standard: "standard";
|
|
9
|
+
complex: "complex";
|
|
10
|
+
}>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type VerifyWorkParams = z.infer<typeof verifyWorkSchema>;
|
|
13
|
+
export declare function registerVerifyWork(server: McpServer, config: MultiModelConfig): void;
|
|
14
|
+
//# sourceMappingURL=verify-work.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-work.d.ts","sourceRoot":"","sources":["../../src/tools/verify-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,eAAO,MAAM,gBAAgB;;;;;;;iBAI3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,QAgC7E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
|
|
3
|
+
export const verifyWorkSchema = z.object({
|
|
4
|
+
work: z.string().describe('The work product to verify'),
|
|
5
|
+
checklist: z.array(z.string()).describe('Verification checklist items'),
|
|
6
|
+
agentType: z.enum(['standard', 'complex']).optional(),
|
|
7
|
+
});
|
|
8
|
+
export function registerVerifyWork(server, config) {
|
|
9
|
+
server.tool('verify_work', 'Verify work product against a checklist using structured review.', verifyWorkSchema.shape, async (params) => {
|
|
10
|
+
const agentType = params.agentType ?? 'standard';
|
|
11
|
+
const checklistText = params.checklist.map((item, i) => `${i + 1}. ${item}`).join('\n');
|
|
12
|
+
const prompt = `Verify this work:\n\n${params.work}\n\n` +
|
|
13
|
+
`Checklist:\n${checklistText}\n\n` +
|
|
14
|
+
`For each checklist item, indicate pass/fail and provide evidence.`;
|
|
15
|
+
try {
|
|
16
|
+
const results = await runTasks([{ prompt, agentType, reviewPolicy: 'spec_only' }], config);
|
|
17
|
+
const result = results[0];
|
|
18
|
+
return {
|
|
19
|
+
content: [
|
|
20
|
+
{ type: 'text', text: result.output },
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: 'text', text: `Error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=verify-work.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-work.js","sourceRoot":"","sources":["../../src/tools/verify-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,KAAK,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AAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACxG,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhixuan92/multi-model-agent-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "MCP server for multi-model-agent. Exposes a delegate_tasks tool that routes work to Claude, Codex, or OpenAI-compatible sub-agents based on capability, quality tier, and cost.",
|
|
@@ -39,6 +39,26 @@
|
|
|
39
39
|
"./routing/render-provider-routing-matrix": {
|
|
40
40
|
"types": "./dist/routing/render-provider-routing-matrix.d.ts",
|
|
41
41
|
"import": "./dist/routing/render-provider-routing-matrix.js"
|
|
42
|
+
},
|
|
43
|
+
"./tools/execute-plan-task": {
|
|
44
|
+
"types": "./dist/tools/execute-plan-task.d.ts",
|
|
45
|
+
"import": "./dist/tools/execute-plan-task.js"
|
|
46
|
+
},
|
|
47
|
+
"./tools/audit-document": {
|
|
48
|
+
"types": "./dist/tools/audit-document.d.ts",
|
|
49
|
+
"import": "./dist/tools/audit-document.js"
|
|
50
|
+
},
|
|
51
|
+
"./tools/debug-task": {
|
|
52
|
+
"types": "./dist/tools/debug-task.d.ts",
|
|
53
|
+
"import": "./dist/tools/debug-task.js"
|
|
54
|
+
},
|
|
55
|
+
"./tools/review-code": {
|
|
56
|
+
"types": "./dist/tools/review-code.d.ts",
|
|
57
|
+
"import": "./dist/tools/review-code.js"
|
|
58
|
+
},
|
|
59
|
+
"./tools/verify-work": {
|
|
60
|
+
"types": "./dist/tools/verify-work.d.ts",
|
|
61
|
+
"import": "./dist/tools/verify-work.js"
|
|
42
62
|
}
|
|
43
63
|
},
|
|
44
64
|
"scripts": {
|
|
@@ -50,7 +70,7 @@
|
|
|
50
70
|
},
|
|
51
71
|
"dependencies": {
|
|
52
72
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
53
|
-
"@zhixuan92/multi-model-agent-core": "^0.
|
|
73
|
+
"@zhixuan92/multi-model-agent-core": "^1.0.0",
|
|
54
74
|
"zod": "^4.0.0"
|
|
55
75
|
}
|
|
56
76
|
}
|