@zhixuan92/multi-model-agent-mcp 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -5
- package/dist/cli.d.ts +25 -7
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +254 -42
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/routing/render-provider-routing-matrix.d.ts.map +1 -1
- package/dist/routing/render-provider-routing-matrix.js +65 -1
- package/dist/routing/render-provider-routing-matrix.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
# @zhixuan92/multi-model-agent-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Delegate work from your expensive parent-session model to a fleet of cheaper sub-agents, in parallel, from a single MCP tool call.**
|
|
4
|
+
|
|
5
|
+
This is the MCP stdio server for [`multi-model-agent`](https://github.com/zhixuan312/multi-model-agent). Your MCP client (Claude Code, Claude Desktop, Codex CLI, Cursor, …) spawns it on demand and gets four tools: `delegate_tasks`, `register_context_block`, `retry_tasks`, and `get_task_output`. Each `delegate_tasks` call runs the supplied tasks in parallel across the providers you configured, auto-routing each to the cheapest one that has the required capabilities and quality tier — or pinning to a specific provider when you want control.
|
|
6
|
+
|
|
7
|
+
## Why use it
|
|
8
|
+
|
|
9
|
+
- **Cut cost and context.** Mechanical work (file edits, search, doc lookups) runs on cheap providers in a clean worker context. Your parent session's window stays lean and its judgment unblocked.
|
|
10
|
+
- **Run tasks in parallel.** Independent tasks in one call execute concurrently; wall-clock time drops with task count.
|
|
11
|
+
- **Mix providers in one config.** Claude, Codex, and any OpenAI-compatible endpoint (MiniMax, DeepSeek, Groq, local vLLM, …) live side-by-side.
|
|
12
|
+
- **Auto-route and escalate.** Capability filter → tier filter → cheapest qualifying provider; on failure the chain is walked automatically, stopping at the first success.
|
|
13
|
+
- **No bare failures.** Every termination path (incomplete, max_turns, timeout, error) populates `output` from the runner's scratchpad.
|
|
14
|
+
- **Sandboxed by default.** `cwd-only` file tool confinement and shell-disabled by default. Opt out per-task only when needed.
|
|
15
|
+
- **Visible ROI.** Every response surfaces `aggregateCost`, `timings`, and per-task `savedCostUSD` for delegation savings.
|
|
4
16
|
|
|
5
17
|
## How it works
|
|
6
18
|
|
|
7
|
-
You don't run this server yourself. Your MCP client
|
|
19
|
+
You don't run this server yourself. Your MCP client spawns it over stdio whenever a session starts, using the config snippets below. No install step, no long-running process to manage — `npx` fetches the latest version on demand each time.
|
|
8
20
|
|
|
9
21
|
Requires Node `>= 22`.
|
|
10
22
|
|
|
@@ -72,6 +84,23 @@ claude mcp add multi-model-agent -s user \
|
|
|
72
84
|
|
|
73
85
|
Without `-s user`, `claude mcp add` defaults to local scope and only registers the server in the current project.
|
|
74
86
|
|
|
87
|
+
### Codex CLI
|
|
88
|
+
|
|
89
|
+
Codex CLI reads MCP servers from `~/.codex/config.toml`. Add this block:
|
|
90
|
+
|
|
91
|
+
```toml
|
|
92
|
+
[mcp_servers.multi-model-agent]
|
|
93
|
+
command = "npx"
|
|
94
|
+
args = ["-y", "@zhixuan92/multi-model-agent-mcp", "serve"]
|
|
95
|
+
|
|
96
|
+
[mcp_servers.multi-model-agent.env]
|
|
97
|
+
OPENAI_API_KEY = "sk-..."
|
|
98
|
+
ANTHROPIC_API_KEY = "sk-ant-..."
|
|
99
|
+
MINIMAX_API_KEY = "..."
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Only set the env keys for the providers you actually configured. If you use `codex login`, the `codex` provider inside `multi-model-agent` reuses that auth automatically — but Claude, MiniMax, and other API-key providers still need to be passed through `[mcp_servers.multi-model-agent.env]` because the spawned MCP process does not inherit your shell environment. Restart `codex` after editing the file.
|
|
103
|
+
|
|
75
104
|
### Claude Desktop
|
|
76
105
|
|
|
77
106
|
Add to `claude_desktop_config.json`:
|
|
@@ -94,6 +123,26 @@ Add to `claude_desktop_config.json`:
|
|
|
94
123
|
|
|
95
124
|
Restart your MCP client after changing config.
|
|
96
125
|
|
|
126
|
+
## Updating
|
|
127
|
+
|
|
128
|
+
`npx -y @zhixuan92/multi-model-agent-mcp serve` **always fetches the latest published version** on each spawn — you never need to run `npm update` or re-register the server to pick up a release.
|
|
129
|
+
|
|
130
|
+
To apply an update: **fully quit** your MCP client (⌘Q on macOS — just closing the window is not enough for Claude Code / Codex CLI because the MCP process lives with the session), then reopen. The next `delegate_tasks` call will spawn a fresh server from the latest npm version.
|
|
131
|
+
|
|
132
|
+
**Pinning a version** — if you need reproducibility (CI, shared team config, debugging a regression), add an explicit version tag to the spawn command:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
claude mcp add multi-model-agent -s user -- npx -y @zhixuan92/multi-model-agent-mcp@0.3.0 serve
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
or in `config.toml` / `claude_desktop_config.json`:
|
|
139
|
+
|
|
140
|
+
```toml
|
|
141
|
+
args = ["-y", "@zhixuan92/multi-model-agent-mcp@0.3.0", "serve"]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Breaking changes** — this project is on 0.x semver. MINOR bumps (`0.2.x → 0.3.0`) may change the config schema or the `delegate_tasks` tool input. PATCH bumps (`0.3.0 → 0.3.1`) are strictly backwards-compatible bug fixes. Skim the [CHANGELOG](https://github.com/zhixuan312/multi-model-agent/blob/HEAD/CHANGELOG.md) before adopting a new MINOR version and update `~/.multi-model/config.json` (and any stored `delegate_tasks` call shapes in your rules/prompts) if the changelog calls out a schema change. Provider auth, the config file path, and the MCP tool names themselves are stable across all 0.x releases.
|
|
145
|
+
|
|
97
146
|
## Recommended: delegation rule for Claude Code
|
|
98
147
|
|
|
99
148
|
Claude Code's native `Task` / `Agent` subagents inherit your parent session's expensive model and eat its context window. We ship a drop-in rule file that teaches Claude Code **when** to delegate work through `delegate_tasks` instead — mechanical edits go to free providers, reasoning-tier work escalates only when needed, and independent tasks run in parallel.
|
|
@@ -121,20 +170,29 @@ Accepts an array of tasks and runs them concurrently. Auto-routes each task by c
|
|
|
121
170
|
"tier": "reasoning",
|
|
122
171
|
"requiredCapabilities": ["file_read", "file_write"],
|
|
123
172
|
"tools": "full",
|
|
124
|
-
"cwd": "/path/to/project"
|
|
173
|
+
"cwd": "/path/to/project",
|
|
174
|
+
"parentModel": "claude-sonnet-4-5",
|
|
175
|
+
"includeProgressTrace": true
|
|
125
176
|
},
|
|
126
177
|
{
|
|
127
178
|
"prompt": "Write tests for the auth module.",
|
|
128
179
|
"tier": "standard",
|
|
129
180
|
"requiredCapabilities": ["file_read", "file_write", "grep"],
|
|
130
181
|
"tools": "full",
|
|
131
|
-
"cwd": "/path/to/project"
|
|
182
|
+
"cwd": "/path/to/project",
|
|
183
|
+
"expectedCoverage": {
|
|
184
|
+
"minSections": 3,
|
|
185
|
+
"sectionPattern": "^Test \\d+:",
|
|
186
|
+
"requiredMarkers": ["happy path", "edge case"]
|
|
187
|
+
}
|
|
132
188
|
}
|
|
133
189
|
]
|
|
134
190
|
}
|
|
135
191
|
```
|
|
136
192
|
|
|
137
|
-
Per-task fields: `prompt`, `tier`, `requiredCapabilities`, `provider?`, `tools?`, `maxTurns?`, `timeoutMs?`, `cwd?`, `effort?`, `sandboxPolicy?`.
|
|
193
|
+
Per-task fields: `prompt`, `tier`, `requiredCapabilities`, `provider?`, `tools?`, `maxTurns?`, `timeoutMs?`, `cwd?`, `effort?`, `sandboxPolicy?`, `contextBlockIds?`, `expectedCoverage?`, `includeProgressTrace?`, `parentModel?`.
|
|
194
|
+
|
|
195
|
+
`expectedCoverage` supports `minSections?`, `sectionPattern?`, and `requiredMarkers?`. `includeProgressTrace` opts a task into returning its bounded post-hoc progress trace. `parentModel` lets the server estimate `savedCostUSD` relative to the calling model.
|
|
138
196
|
|
|
139
197
|
Capabilities: `file_read`, `file_write`, `grep`, `glob`, `shell`, `web_search`, `web_fetch`.
|
|
140
198
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
|
|
5
|
-
import type { MultiModelConfig } from '@zhixuan92/multi-model-agent-core';
|
|
5
|
+
import type { MultiModelConfig, RunResult, BatchTimings, BatchProgress, BatchAggregateCost } from '@zhixuan92/multi-model-agent-core';
|
|
6
6
|
export declare const SERVER_NAME = "multi-model-agent";
|
|
7
|
+
export declare function computeTimings(wallClockMs: number, results: RunResult[]): BatchTimings;
|
|
8
|
+
export declare function computeBatchProgress(results: RunResult[]): BatchProgress;
|
|
9
|
+
export declare function computeAggregateCost(results: RunResult[]): BatchAggregateCost;
|
|
7
10
|
export declare const SERVER_VERSION: string;
|
|
8
11
|
export declare function buildTaskSchema(availableProviders: [string, ...string[]]): z.ZodObject<{
|
|
9
12
|
prompt: z.ZodString;
|
|
@@ -11,9 +14,9 @@ export declare function buildTaskSchema(availableProviders: [string, ...string[]
|
|
|
11
14
|
[x: string]: string;
|
|
12
15
|
}>>;
|
|
13
16
|
tier: z.ZodEnum<{
|
|
14
|
-
trivial: "trivial";
|
|
15
|
-
standard: "standard";
|
|
16
17
|
reasoning: "reasoning";
|
|
18
|
+
standard: "standard";
|
|
19
|
+
trivial: "trivial";
|
|
17
20
|
}>;
|
|
18
21
|
requiredCapabilities: z.ZodArray<z.ZodEnum<{
|
|
19
22
|
file_read: "file_read";
|
|
@@ -25,16 +28,16 @@ export declare function buildTaskSchema(availableProviders: [string, ...string[]
|
|
|
25
28
|
web_fetch: "web_fetch";
|
|
26
29
|
}>>;
|
|
27
30
|
tools: z.ZodOptional<z.ZodEnum<{
|
|
28
|
-
none: "none";
|
|
29
31
|
full: "full";
|
|
32
|
+
none: "none";
|
|
30
33
|
}>>;
|
|
31
34
|
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
32
35
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
33
36
|
cwd: z.ZodOptional<z.ZodString>;
|
|
34
37
|
effort: z.ZodOptional<z.ZodEnum<{
|
|
35
|
-
low: "low";
|
|
36
|
-
medium: "medium";
|
|
37
38
|
high: "high";
|
|
39
|
+
medium: "medium";
|
|
40
|
+
low: "low";
|
|
38
41
|
none: "none";
|
|
39
42
|
}>>;
|
|
40
43
|
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
@@ -42,8 +45,23 @@ export declare function buildTaskSchema(availableProviders: [string, ...string[]
|
|
|
42
45
|
"cwd-only": "cwd-only";
|
|
43
46
|
}>>;
|
|
44
47
|
contextBlockIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
expectedCoverage: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
minSections: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
sectionPattern: z.ZodOptional<z.ZodString>;
|
|
51
|
+
requiredMarkers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
includeProgressTrace: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
parentModel: z.ZodOptional<z.ZodString>;
|
|
45
55
|
}, z.core.$strip>;
|
|
46
|
-
export declare function buildMcpServer(config: Parameters<typeof runTasks>[1]
|
|
56
|
+
export declare function buildMcpServer(config: Parameters<typeof runTasks>[1], options?: {
|
|
57
|
+
/** Character threshold that triggers auto-switch from 'full' to
|
|
58
|
+
* 'summary' response mode when the caller uses `responseMode: 'auto'`
|
|
59
|
+
* (the default). Defaults to 65_536, tuned for Claude Code's inline
|
|
60
|
+
* rendering limit. Precedence (highest first): env var
|
|
61
|
+
* MULTI_MODEL_LARGE_RESPONSE_THRESHOLD_CHARS > config file
|
|
62
|
+
* defaults.largeResponseThresholdChars > this option > default. */
|
|
63
|
+
largeResponseThresholdChars?: number;
|
|
64
|
+
}): McpServer;
|
|
47
65
|
/**
|
|
48
66
|
* MCP CLI config discovery (owned by MCP, not core):
|
|
49
67
|
* 1. --config <path> argument (explicit)
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,OAAO,KAAK,EACV,gBAAgB,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,OAAO,KAAK,EACV,gBAAgB,EAGhB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAG3C,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAc/C,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,YAAY,CAItF;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,CAgBxE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,kBAAkB,CAyB7E;AAwFD,eAAO,MAAM,cAAc,QAAc,CAAC;AAE1C,wBAAgB,eAAe,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwCxE;AAkCD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,EACtC,OAAO,CAAC,EAAE;IACR;;;;;wEAKoE;IACpE,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC,aAoXF;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAuBhE"}
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import os from 'os';
|
|
5
|
-
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { randomUUID, createHash } from 'node:crypto';
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
@@ -14,6 +14,114 @@ import { runTasks } from '@zhixuan92/multi-model-agent-core/run-tasks';
|
|
|
14
14
|
import { InMemoryContextBlockStore } from '@zhixuan92/multi-model-agent-core';
|
|
15
15
|
import { renderProviderRoutingMatrix } from './routing/render-provider-routing-matrix.js';
|
|
16
16
|
export const SERVER_NAME = 'multi-model-agent';
|
|
17
|
+
const DEFAULT_LARGE_RESPONSE_THRESHOLD_CHARS = 65_536;
|
|
18
|
+
function parsePositiveInt(s) {
|
|
19
|
+
if (!s)
|
|
20
|
+
return undefined;
|
|
21
|
+
const n = Number.parseInt(s, 10);
|
|
22
|
+
if (Number.isFinite(n) && n > 0 && String(n) === s.trim())
|
|
23
|
+
return n;
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
function sha256Hex(text) {
|
|
27
|
+
return createHash('sha256').update(text).digest('hex');
|
|
28
|
+
}
|
|
29
|
+
export function computeTimings(wallClockMs, results) {
|
|
30
|
+
const sumOfTaskMs = results.reduce((sum, r) => sum + (r.durationMs ?? 0), 0);
|
|
31
|
+
const estimatedParallelSavingsMs = Math.max(0, sumOfTaskMs - wallClockMs);
|
|
32
|
+
return { wallClockMs, sumOfTaskMs, estimatedParallelSavingsMs };
|
|
33
|
+
}
|
|
34
|
+
export function computeBatchProgress(results) {
|
|
35
|
+
const totalTasks = results.length;
|
|
36
|
+
const completedTasks = results.filter((r) => r.status === 'ok').length;
|
|
37
|
+
const incompleteTasks = results.filter((r) => r.status === 'incomplete' || r.status === 'max_turns' || r.status === 'timeout').length;
|
|
38
|
+
const failedTasks = results.filter((r) => r.status === 'error' ||
|
|
39
|
+
r.status === 'api_aborted' ||
|
|
40
|
+
r.status === 'api_error' ||
|
|
41
|
+
r.status === 'network_error').length;
|
|
42
|
+
const successPercent = totalTasks === 0 ? 0 : Math.round((completedTasks / totalTasks) * 1000) / 10;
|
|
43
|
+
return { totalTasks, completedTasks, incompleteTasks, failedTasks, successPercent };
|
|
44
|
+
}
|
|
45
|
+
export function computeAggregateCost(results) {
|
|
46
|
+
let totalActualCostUSD = 0;
|
|
47
|
+
let totalSavedCostUSD = 0;
|
|
48
|
+
let actualCostUnavailableTasks = 0;
|
|
49
|
+
let savedCostUnavailableTasks = 0;
|
|
50
|
+
for (const r of results) {
|
|
51
|
+
if (r.usage.costUSD === null || r.usage.costUSD === undefined) {
|
|
52
|
+
actualCostUnavailableTasks += 1;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
totalActualCostUSD += r.usage.costUSD;
|
|
56
|
+
}
|
|
57
|
+
if (r.usage.savedCostUSD === null || r.usage.savedCostUSD === undefined) {
|
|
58
|
+
savedCostUnavailableTasks += 1;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
totalSavedCostUSD += r.usage.savedCostUSD;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
totalActualCostUSD,
|
|
66
|
+
totalSavedCostUSD,
|
|
67
|
+
actualCostUnavailableTasks,
|
|
68
|
+
savedCostUnavailableTasks,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildFullResponse(batchId, tasks, results, aggregates) {
|
|
72
|
+
return {
|
|
73
|
+
batchId,
|
|
74
|
+
mode: 'full',
|
|
75
|
+
timings: aggregates.timings,
|
|
76
|
+
batchProgress: aggregates.batchProgress,
|
|
77
|
+
aggregateCost: aggregates.aggregateCost,
|
|
78
|
+
results: results.map((r, i) => ({
|
|
79
|
+
provider: tasks[i].provider ?? '(auto)',
|
|
80
|
+
status: r.status,
|
|
81
|
+
output: r.output,
|
|
82
|
+
turns: r.turns,
|
|
83
|
+
durationMs: r.durationMs,
|
|
84
|
+
filesRead: r.filesRead,
|
|
85
|
+
filesWritten: r.filesWritten,
|
|
86
|
+
directoriesListed: r.directoriesListed,
|
|
87
|
+
toolCalls: r.toolCalls,
|
|
88
|
+
escalationLog: r.escalationLog,
|
|
89
|
+
usage: r.usage,
|
|
90
|
+
...(r.progressTrace && { progressTrace: r.progressTrace }),
|
|
91
|
+
...(r.error && { error: r.error }),
|
|
92
|
+
})),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function buildSummaryResponse(batchId, tasks, results, opts) {
|
|
96
|
+
return {
|
|
97
|
+
batchId,
|
|
98
|
+
mode: 'summary',
|
|
99
|
+
...(opts.autoEscaped && {
|
|
100
|
+
note: `Combined output was ${opts.totalOutputChars} chars (threshold: ${opts.threshold}). Auto-switched to summary mode. Use get_task_output({ batchId, taskIndex }) to fetch individual task outputs.`,
|
|
101
|
+
}),
|
|
102
|
+
timings: opts.timings,
|
|
103
|
+
batchProgress: opts.batchProgress,
|
|
104
|
+
aggregateCost: opts.aggregateCost,
|
|
105
|
+
results: results.map((r, i) => ({
|
|
106
|
+
taskIndex: i,
|
|
107
|
+
provider: tasks[i].provider ?? '(auto)',
|
|
108
|
+
status: r.status,
|
|
109
|
+
outputLength: r.output.length,
|
|
110
|
+
outputSha256: sha256Hex(r.output),
|
|
111
|
+
turns: r.turns,
|
|
112
|
+
durationMs: r.durationMs,
|
|
113
|
+
filesRead: r.filesRead,
|
|
114
|
+
filesWritten: r.filesWritten,
|
|
115
|
+
directoriesListed: r.directoriesListed,
|
|
116
|
+
toolCalls: r.toolCalls,
|
|
117
|
+
escalationLog: r.escalationLog,
|
|
118
|
+
usage: r.usage,
|
|
119
|
+
...(r.progressTrace && { progressTrace: r.progressTrace }),
|
|
120
|
+
...(r.error && { error: r.error }),
|
|
121
|
+
_fetchWith: `get_task_output({ batchId: "${batchId}", taskIndex: ${i} })`,
|
|
122
|
+
})),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
17
125
|
// Read the version from package.json at module load so the MCP server
|
|
18
126
|
// metadata (and tests that assert against it) stays in lockstep with the
|
|
19
127
|
// published npm package version. `createRequire` keeps the JSON read
|
|
@@ -46,6 +154,16 @@ export function buildTaskSchema(availableProviders) {
|
|
|
46
154
|
'The server resolves each id to its stored content and prepends the blocks ' +
|
|
47
155
|
'(in order, separated by "\\n\\n---\\n\\n") to `prompt` before dispatch. ' +
|
|
48
156
|
'Use this to avoid re-transmitting long briefs across multiple calls.'),
|
|
157
|
+
expectedCoverage: z.object({
|
|
158
|
+
minSections: z.number().int().positive().optional()
|
|
159
|
+
.describe('Minimum section count expected in the output.'),
|
|
160
|
+
sectionPattern: z.string().optional()
|
|
161
|
+
.describe('Regex for section headings, applied with the multiline flag.'),
|
|
162
|
+
requiredMarkers: z.array(z.string()).optional()
|
|
163
|
+
.describe('Substrings that must all appear somewhere in the output.'),
|
|
164
|
+
}).optional().describe('Optional caller-declared output expectations used for semantic incompleteness detection.'),
|
|
165
|
+
includeProgressTrace: z.boolean().optional().describe('Opt in to returning the bounded post-hoc progress trace for this task.'),
|
|
166
|
+
parentModel: z.string().optional().describe('Optional parent-session model identifier used to estimate savedCostUSD.'),
|
|
49
167
|
});
|
|
50
168
|
}
|
|
51
169
|
/**
|
|
@@ -79,11 +197,20 @@ export function buildTaskSchema(availableProviders) {
|
|
|
79
197
|
*/
|
|
80
198
|
const BATCH_TTL_MS = 30 * 60 * 1000;
|
|
81
199
|
const BATCH_MAX = 100;
|
|
82
|
-
export function buildMcpServer(config) {
|
|
200
|
+
export function buildMcpServer(config, options) {
|
|
83
201
|
const providerKeys = Object.keys(config.providers);
|
|
84
202
|
if (providerKeys.length === 0) {
|
|
85
203
|
throw new Error('buildMcpServer requires at least one configured provider.');
|
|
86
204
|
}
|
|
205
|
+
// Resolve the threshold once at server startup
|
|
206
|
+
const envThreshold = parsePositiveInt(process.env.MULTI_MODEL_LARGE_RESPONSE_THRESHOLD_CHARS);
|
|
207
|
+
if (process.env.MULTI_MODEL_LARGE_RESPONSE_THRESHOLD_CHARS !== undefined && envThreshold === undefined) {
|
|
208
|
+
process.stderr.write(`[multi-model-agent] warning: MULTI_MODEL_LARGE_RESPONSE_THRESHOLD_CHARS=${process.env.MULTI_MODEL_LARGE_RESPONSE_THRESHOLD_CHARS} is not a positive integer, ignoring\n`);
|
|
209
|
+
}
|
|
210
|
+
const resolvedThreshold = envThreshold
|
|
211
|
+
?? config.defaults.largeResponseThresholdChars
|
|
212
|
+
?? options?.largeResponseThresholdChars
|
|
213
|
+
?? DEFAULT_LARGE_RESPONSE_THRESHOLD_CHARS;
|
|
87
214
|
const server = new McpServer({
|
|
88
215
|
name: SERVER_NAME,
|
|
89
216
|
version: SERVER_VERSION,
|
|
@@ -124,7 +251,12 @@ export function buildMcpServer(config) {
|
|
|
124
251
|
const availableProviders = providerKeys;
|
|
125
252
|
server.tool('delegate_tasks', renderProviderRoutingMatrix(config), {
|
|
126
253
|
tasks: z.array(buildTaskSchema(availableProviders)).describe('Array of tasks to execute in parallel'),
|
|
127
|
-
|
|
254
|
+
responseMode: z.enum(['full', 'summary', 'auto']).optional().describe(`How to shape the response envelope. 'full' (default via 'auto') includes each task's output inline. ` +
|
|
255
|
+
`'summary' returns per-task metadata + outputLength + outputSha256, with full outputs fetchable via ` +
|
|
256
|
+
`get_task_output. 'auto' (the default) returns 'full' when combined output fits under the server's ` +
|
|
257
|
+
`threshold (default 65 KB; configurable via env / config / buildMcpServer option), otherwise 'summary' ` +
|
|
258
|
+
`with an auto-escape note.`),
|
|
259
|
+
}, async ({ tasks, responseMode = 'auto' }, extra) => {
|
|
128
260
|
// --- OQ#6 resolution: MCP SDK progress notification API ---
|
|
129
261
|
//
|
|
130
262
|
// The @modelcontextprotocol/sdk >= 1.x exposes progress notifications
|
|
@@ -201,25 +333,45 @@ export function buildMcpServer(config) {
|
|
|
201
333
|
// through `runTasks` again, which re-expands against the current
|
|
202
334
|
// (possibly updated) context-block store.
|
|
203
335
|
const batchId = rememberBatch(tasks);
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
336
|
+
const batchStartMs = Date.now();
|
|
337
|
+
let results = [];
|
|
338
|
+
try {
|
|
339
|
+
results = await runTasks(tasks, config, {
|
|
340
|
+
onProgress: sendProgress,
|
|
341
|
+
runtime: { contextBlockStore },
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
finally {
|
|
345
|
+
// Always attach `results ?? []` so a mid-flight throw does not leave
|
|
346
|
+
// a dangling batchCache entry that `get_task_output` can't distinguish
|
|
347
|
+
// from "dispatch still in progress". Per spec §3.5 / §3.9 item 3.
|
|
348
|
+
const batchEntry = batchCache.get(batchId);
|
|
349
|
+
if (batchEntry)
|
|
350
|
+
batchEntry.results = results;
|
|
351
|
+
}
|
|
352
|
+
const wallClockMs = Date.now() - batchStartMs;
|
|
353
|
+
// Determine effective response mode based on the configurable threshold
|
|
354
|
+
const totalOutputChars = results.reduce((sum, r) => sum + r.output.length, 0);
|
|
355
|
+
const effectiveMode = responseMode === 'full'
|
|
356
|
+
? 'full'
|
|
357
|
+
: responseMode === 'summary'
|
|
358
|
+
? 'summary'
|
|
359
|
+
: totalOutputChars > resolvedThreshold
|
|
360
|
+
? 'summary'
|
|
361
|
+
: 'full';
|
|
362
|
+
const timings = computeTimings(wallClockMs, results);
|
|
363
|
+
const batchProgress = computeBatchProgress(results);
|
|
364
|
+
const aggregateCost = computeAggregateCost(results);
|
|
365
|
+
const response = effectiveMode === 'full'
|
|
366
|
+
? buildFullResponse(batchId, tasks, results, { timings, batchProgress, aggregateCost })
|
|
367
|
+
: buildSummaryResponse(batchId, tasks, results, {
|
|
368
|
+
autoEscaped: responseMode === 'auto' && totalOutputChars > resolvedThreshold,
|
|
369
|
+
totalOutputChars,
|
|
370
|
+
threshold: resolvedThreshold,
|
|
371
|
+
timings,
|
|
372
|
+
batchProgress,
|
|
373
|
+
aggregateCost,
|
|
374
|
+
});
|
|
223
375
|
return {
|
|
224
376
|
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
225
377
|
};
|
|
@@ -246,7 +398,9 @@ export function buildMcpServer(config) {
|
|
|
246
398
|
taskIndices: z
|
|
247
399
|
.array(z.number().int().nonnegative())
|
|
248
400
|
.describe('Zero-based indices (into the original batch) of the tasks to re-run'),
|
|
249
|
-
|
|
401
|
+
responseMode: z.enum(['full', 'summary', 'auto']).optional().describe(`How to shape the response envelope for the retry batch. 'full' returns inline outputs. ` +
|
|
402
|
+
`'summary' returns outputLength + outputSha256. 'auto' (default) auto-escapes based on threshold.`),
|
|
403
|
+
}, async ({ batchId, taskIndices, responseMode = 'auto' }) => {
|
|
250
404
|
const batch = batchCache.get(batchId);
|
|
251
405
|
if (!batch || batch.expiresAt < Date.now()) {
|
|
252
406
|
// Proactively drop the expired entry so subsequent lookups see
|
|
@@ -267,29 +421,87 @@ export function buildMcpServer(config) {
|
|
|
267
421
|
}
|
|
268
422
|
}
|
|
269
423
|
const subset = taskIndices.map((i) => batch.tasks[i]);
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
424
|
+
// Create a fresh batch for the retried tasks so the original batch
|
|
425
|
+
// entry is preserved and get_task_output can still retrieve it.
|
|
426
|
+
const retryBatchId = rememberBatch(subset);
|
|
427
|
+
const batchStartMs = Date.now();
|
|
428
|
+
let results = [];
|
|
429
|
+
try {
|
|
430
|
+
results = await runTasks(subset, config, {
|
|
431
|
+
runtime: { contextBlockStore },
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
finally {
|
|
435
|
+
const retryEntry = batchCache.get(retryBatchId);
|
|
436
|
+
if (retryEntry)
|
|
437
|
+
retryEntry.results = results;
|
|
438
|
+
}
|
|
439
|
+
const wallClockMs = Date.now() - batchStartMs;
|
|
440
|
+
// Determine effective response mode
|
|
441
|
+
const totalOutputChars = results.reduce((sum, r) => sum + r.output.length, 0);
|
|
442
|
+
const effectiveMode = responseMode === 'full'
|
|
443
|
+
? 'full'
|
|
444
|
+
: responseMode === 'summary'
|
|
445
|
+
? 'summary'
|
|
446
|
+
: totalOutputChars > resolvedThreshold
|
|
447
|
+
? 'summary'
|
|
448
|
+
: 'full';
|
|
449
|
+
const timings = computeTimings(wallClockMs, results);
|
|
450
|
+
const batchProgress = computeBatchProgress(results);
|
|
451
|
+
const aggregateCost = computeAggregateCost(results);
|
|
452
|
+
const response = effectiveMode === 'full'
|
|
453
|
+
? {
|
|
454
|
+
...buildFullResponse(retryBatchId, subset, results, { timings, batchProgress, aggregateCost }),
|
|
455
|
+
originalBatchId: batchId,
|
|
456
|
+
originalIndices: taskIndices,
|
|
457
|
+
}
|
|
458
|
+
: {
|
|
459
|
+
...buildSummaryResponse(retryBatchId, subset, results, {
|
|
460
|
+
autoEscaped: responseMode === 'auto' && totalOutputChars > resolvedThreshold,
|
|
461
|
+
totalOutputChars,
|
|
462
|
+
threshold: resolvedThreshold,
|
|
463
|
+
timings,
|
|
464
|
+
batchProgress,
|
|
465
|
+
aggregateCost,
|
|
466
|
+
}),
|
|
467
|
+
originalBatchId: batchId,
|
|
468
|
+
originalIndices: taskIndices,
|
|
469
|
+
};
|
|
289
470
|
return {
|
|
290
471
|
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
291
472
|
};
|
|
292
473
|
});
|
|
474
|
+
server.tool('get_task_output', `Retrieve the full text output of a specific task from a previous delegate_tasks batch.
|
|
475
|
+
|
|
476
|
+
Use this when a prior delegate_tasks response came back with mode: 'summary' and you
|
|
477
|
+
need the actual output of one specific task. The batchId is the one returned at the
|
|
478
|
+
top of that response; taskIndex is 0-based into the original tasks array.
|
|
479
|
+
|
|
480
|
+
Batches are cached in memory per MCP server instance with a 30-minute TTL from creation
|
|
481
|
+
and a 100-entry LRU cap. Access touches the LRU order but does not refresh TTL. If the
|
|
482
|
+
batch is expired or evicted, re-dispatch via delegate_tasks with the full specs.`, {
|
|
483
|
+
batchId: z.string().describe('Batch id returned from a previous delegate_tasks call'),
|
|
484
|
+
taskIndex: z.number().int().nonnegative().describe('Zero-based index of the task within the batch'),
|
|
485
|
+
}, async ({ batchId, taskIndex }) => {
|
|
486
|
+
const batch = batchCache.get(batchId);
|
|
487
|
+
if (!batch || batch.expiresAt < Date.now()) {
|
|
488
|
+
if (batch)
|
|
489
|
+
batchCache.delete(batchId);
|
|
490
|
+
throw new Error(`batch "${batchId}" is unknown or expired — re-dispatch with full task specs via delegate_tasks`);
|
|
491
|
+
}
|
|
492
|
+
// Touch LRU order but NOT TTL
|
|
493
|
+
touchBatch(batchId, batch);
|
|
494
|
+
if (batch.results === undefined) {
|
|
495
|
+
throw new Error(`batch "${batchId}" has no stored results — this may indicate a dispatch failure`);
|
|
496
|
+
}
|
|
497
|
+
if (taskIndex < 0 || taskIndex >= batch.results.length) {
|
|
498
|
+
throw new Error(`index ${taskIndex} is out of range for batch ${batchId} (size ${batch.results.length})`);
|
|
499
|
+
}
|
|
500
|
+
const result = batch.results[taskIndex];
|
|
501
|
+
return {
|
|
502
|
+
content: [{ type: 'text', text: JSON.stringify({ output: result.output }, null, 2) }],
|
|
503
|
+
};
|
|
504
|
+
});
|
|
293
505
|
return server;
|
|
294
506
|
}
|
|
295
507
|
/**
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAM9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAE1F,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAC/C,sEAAsE;AACtE,yEAAyE;AACzE,qEAAqE;AACrE,uEAAuE;AACvE,kEAAkE;AAClE,wEAAwE;AACxE,uEAAuE;AACvE,+BAA+B;AAC/B,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtD,MAAM,GAAG,GAA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IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AACL,IAAI,WAAW,EAAE,CAAC;IAChB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { buildMcpServer, buildTaskSchema, SERVER_NAME, SERVER_VERSION } from './cli.js';
|
|
1
|
+
export { buildMcpServer, buildTaskSchema, SERVER_NAME, SERVER_VERSION, computeTimings, computeBatchProgress, computeAggregateCost } from './cli.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { buildMcpServer, buildTaskSchema, SERVER_NAME, SERVER_VERSION } from './cli.js';
|
|
1
|
+
export { buildMcpServer, buildTaskSchema, SERVER_NAME, SERVER_VERSION, computeTimings, computeBatchProgress, computeAggregateCost } from './cli.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-provider-routing-matrix.d.ts","sourceRoot":"","sources":["../../src/routing/render-provider-routing-matrix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,gBAAgB,EAAkB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"render-provider-routing-matrix.d.ts","sourceRoot":"","sources":["../../src/routing/render-provider-routing-matrix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,gBAAgB,EAAkB,MAAM,mCAAmC,CAAC;AA0JtG;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAoB5E"}
|
|
@@ -57,7 +57,71 @@ Escalation, statuses, streaming, and batch helpers:
|
|
|
57
57
|
'contextBlockIds' on any task (alongside 'prompt') and the server
|
|
58
58
|
prepends the blob to the prompt before dispatch — so long briefs
|
|
59
59
|
shared across multiple tasks are sent to the parent session only
|
|
60
|
-
once
|
|
60
|
+
once.
|
|
61
|
+
|
|
62
|
+
RESPONSE SHAPE (v0.3+): Every delegate_tasks response includes a top-level
|
|
63
|
+
batchId, mode ('full' or 'summary'), timings ({wallClockMs, sumOfTaskMs,
|
|
64
|
+
estimatedParallelSavingsMs}), batchProgress ({totalTasks, completedTasks,
|
|
65
|
+
incompleteTasks, failedTasks, successPercent}), and aggregateCost
|
|
66
|
+
({totalActualCostUSD, totalSavedCostUSD, actualCostUnavailableTasks,
|
|
67
|
+
savedCostUnavailableTasks}). If the combined output across tasks is small,
|
|
68
|
+
mode: 'full' with inline outputs; if it exceeds the server's threshold
|
|
69
|
+
(default 64 KB, configurable via env MULTI_MODEL_LARGE_RESPONSE_THRESHOLD_CHARS
|
|
70
|
+
/ config defaults.largeResponseThresholdChars / buildMcpServer option),
|
|
71
|
+
mode: 'summary' with per-task outputLength + outputSha256 + _fetchWith
|
|
72
|
+
hint — fetch individual outputs with get_task_output({ batchId, taskIndex }).
|
|
73
|
+
Set responseMode: 'full' to force inline, 'summary' to force summary, or
|
|
74
|
+
omit for auto-escape.
|
|
75
|
+
|
|
76
|
+
COVERAGE DECLARATION (v0.3+): For tasks with enumerable deliverables
|
|
77
|
+
(multi-file refactors, test generation across many functions, multi-PR
|
|
78
|
+
review, per-endpoint reports, per-function test stubs, audit checklists),
|
|
79
|
+
set expectedCoverage on the task spec with either minSections: N,
|
|
80
|
+
sectionPattern: '<regex>' (default ^##), or requiredMarkers: [...] — the
|
|
81
|
+
identifier strings that must all appear in the output. The supervision
|
|
82
|
+
layer will re-prompt the model with specific missing items and classify
|
|
83
|
+
thin responses as insufficient_coverage instead of silently accepting them.
|
|
84
|
+
Do NOT set expectedCoverage for one-shot tasks (bug fixes, single
|
|
85
|
+
implementations, prose, creative writing) — the field is opt-in and has
|
|
86
|
+
no meaning for deliverables you can't enumerate ahead of time.
|
|
87
|
+
|
|
88
|
+
COST + TIME VISIBILITY (v0.3+): Set parentModel on the task spec (e.g.
|
|
89
|
+
'claude-opus-4-6') to get usage.savedCostUSD — the ESTIMATED cost
|
|
90
|
+
difference vs running the same token volume on that parent model.
|
|
91
|
+
Positive means delegation was cheaper. Both usage.costUSD (actual) and
|
|
92
|
+
usage.savedCostUSD (estimate) are estimates for budgeting and debugging,
|
|
93
|
+
not accounting numbers. Per-task durationMs is always populated.
|
|
94
|
+
Batch-level timings.estimatedParallelSavingsMs tells you how much
|
|
95
|
+
wall-clock time concurrent dispatch bought back vs a hypothetical
|
|
96
|
+
serial for-loop. batchProgress.successPercent is a clean-success rate
|
|
97
|
+
(the batch is always 100% done by the time you see the response —
|
|
98
|
+
successPercent measures how many finished cleanly, NOT progress).
|
|
99
|
+
|
|
100
|
+
PROGRESS TRACE (v0.3+): Set includeProgressTrace: true on the task spec
|
|
101
|
+
to receive a bounded, priority-trimmed trace of the execution timeline
|
|
102
|
+
in the final RunResult.progressTrace. Useful for post-hoc debugging of
|
|
103
|
+
long-running tasks — did the worker loop through supervision retries,
|
|
104
|
+
where did it stall, did it escalate across providers. The trace is
|
|
105
|
+
trimmed at 80 events and 16 KB; text_emission and tool_call events are
|
|
106
|
+
dropped first under pressure (their content is already in output /
|
|
107
|
+
toolCalls). Boundary events (turn_start, turn_complete, escalation_start,
|
|
108
|
+
injection, done) are never dropped. If trimming fired, a synthetic
|
|
109
|
+
_trimmed marker at the end of the trace reports the dropped count and
|
|
110
|
+
per-kind histogram.
|
|
111
|
+
|
|
112
|
+
NOTE: progress-events at the MCP protocol level (notifications/progress)
|
|
113
|
+
are emitted correctly by the server and delivered to the MCP client.
|
|
114
|
+
Whether your client renders them live depends on the client — some
|
|
115
|
+
render them as in-flight tool-call status lines, others don't surface
|
|
116
|
+
them to the calling LLM at all. includeProgressTrace gives you the
|
|
117
|
+
full timeline post-hoc regardless of your client's live-rendering
|
|
118
|
+
behavior.
|
|
119
|
+
|
|
120
|
+
AVAILABLE TOOLS: delegate_tasks (this one), register_context_block
|
|
121
|
+
(stash reusable brief content referenced via TaskSpec.contextBlockIds),
|
|
122
|
+
retry_tasks (re-dispatch specific indices from a previous batch),
|
|
123
|
+
get_task_output (fetch individual task outputs when a response was in
|
|
124
|
+
summary mode).`;
|
|
61
125
|
function renderProviderBlock(name, config, capabilities, profile, costSource) {
|
|
62
126
|
const cost = getEffectiveCostTier(config);
|
|
63
127
|
const costSuffix = costSource === 'config' ? ' (from config)' : '';
|
|
@@ -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,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAGlH,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;oCAmBa,CAAC;AAErC,MAAM,UAAU,GAAG
|
|
1
|
+
{"version":3,"file":"render-provider-routing-matrix.js","sourceRoot":"","sources":["../../src/routing/render-provider-routing-matrix.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAGlH,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;oCAmBa,CAAC;AAErC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAqGJ,CAAC;AAEhB,SAAS,mBAAmB,CAC1B,IAAY,EACZ,MAAsB,EACtB,YAA0B,EAC1B,OAAqB,EACrB,UAAgC;IAEhC,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC;IAC3E,MAAM,KAAK,GAAG;QACZ,GAAG,IAAI,KAAK,MAAM,CAAC,KAAK,GAAG;QAC3B,YAAY,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACrC,WAAW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|
{
|
|
2
2
|
"name": "@zhixuan92/multi-model-agent-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
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.",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"node": ">=22.0.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@zhixuan92/multi-model-agent-core": "^0.2.0",
|
|
53
52
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
53
|
+
"@zhixuan92/multi-model-agent-core": "^0.3.1",
|
|
54
54
|
"zod": "^4.0.0"
|
|
55
55
|
}
|
|
56
56
|
}
|