@zhixuan92/multi-model-agent-core 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -6
- package/dist/config/schema.d.ts +73 -45
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +14 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/context/context-block-store.d.ts +75 -0
- package/dist/context/context-block-store.d.ts.map +1 -0
- package/dist/context/context-block-store.js +82 -0
- package/dist/context/context-block-store.js.map +1 -0
- package/dist/context/expand-context-blocks.d.ts +20 -0
- package/dist/context/expand-context-blocks.d.ts.map +1 -0
- package/dist/context/expand-context-blocks.js +46 -0
- package/dist/context/expand-context-blocks.js.map +1 -0
- package/dist/delegate-with-escalation.d.ts +34 -0
- package/dist/delegate-with-escalation.d.ts.map +1 -0
- package/dist/delegate-with-escalation.js +172 -0
- package/dist/delegate-with-escalation.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/model-profiles.json +42 -4
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +7 -1
- package/dist/provider.js.map +1 -1
- package/dist/routing/model-profiles.d.ts +9 -4
- package/dist/routing/model-profiles.d.ts.map +1 -1
- package/dist/routing/model-profiles.js +8 -0
- package/dist/routing/model-profiles.js.map +1 -1
- package/dist/run-tasks.d.ts +26 -2
- package/dist/run-tasks.d.ts.map +1 -1
- package/dist/run-tasks.js +61 -19
- package/dist/run-tasks.js.map +1 -1
- package/dist/runners/claude-runner.d.ts.map +1 -1
- package/dist/runners/claude-runner.js +721 -32
- package/dist/runners/claude-runner.js.map +1 -1
- package/dist/runners/codex-runner.d.ts.map +1 -1
- package/dist/runners/codex-runner.js +541 -48
- package/dist/runners/codex-runner.js.map +1 -1
- package/dist/runners/error-classification.d.ts +30 -0
- package/dist/runners/error-classification.d.ts.map +1 -0
- package/dist/runners/error-classification.js +72 -0
- package/dist/runners/error-classification.js.map +1 -0
- package/dist/runners/injection-type.d.ts +22 -0
- package/dist/runners/injection-type.d.ts.map +1 -0
- package/dist/runners/injection-type.js +34 -0
- package/dist/runners/injection-type.js.map +1 -0
- package/dist/runners/openai-runner.d.ts +5 -0
- package/dist/runners/openai-runner.d.ts.map +1 -1
- package/dist/runners/openai-runner.js +608 -36
- package/dist/runners/openai-runner.js.map +1 -1
- package/dist/runners/prevention.d.ts +41 -0
- package/dist/runners/prevention.d.ts.map +1 -0
- package/dist/runners/prevention.js +68 -0
- package/dist/runners/prevention.js.map +1 -0
- package/dist/runners/supervision.d.ts +137 -0
- package/dist/runners/supervision.d.ts.map +1 -0
- package/dist/runners/supervision.js +345 -0
- package/dist/runners/supervision.js.map +1 -0
- package/dist/tools/claude-adapter.d.ts.map +1 -1
- package/dist/tools/claude-adapter.js +6 -3
- package/dist/tools/claude-adapter.js.map +1 -1
- package/dist/tools/definitions.d.ts +3 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +57 -5
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/openai-adapter.d.ts.map +1 -1
- package/dist/tools/openai-adapter.js +6 -3
- package/dist/tools/openai-adapter.js.map +1 -1
- package/dist/tools/scratchpad.d.ts +28 -0
- package/dist/tools/scratchpad.d.ts.map +1 -0
- package/dist/tools/scratchpad.js +49 -0
- package/dist/tools/scratchpad.js.map +1 -0
- package/dist/tools/tracker.d.ts +42 -2
- package/dist/tools/tracker.d.ts.map +1 -1
- package/dist/tools/tracker.js +63 -5
- package/dist/tools/tracker.js.map +1 -1
- package/dist/types.d.ts +261 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +43 -1
- package/dist/types.js.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { createProvider } from './provider.js';
|
|
2
|
+
import { getProviderEligibility } from './routing/get-provider-eligibility.js';
|
|
3
|
+
import { getEffectiveCostTier } from './routing/model-profiles.js';
|
|
4
|
+
// NOTE: must stay byte-identical to the ordering in
|
|
5
|
+
// routing/select-provider-for-task.ts so the head of the escalation chain is
|
|
6
|
+
// the same provider auto-routing would have picked. If you change one, change
|
|
7
|
+
// both.
|
|
8
|
+
const COST_ORDER = { free: 0, low: 1, medium: 2, high: 3 };
|
|
9
|
+
/**
|
|
10
|
+
* Build the escalation chain for an auto-routed task. Returns all eligible
|
|
11
|
+
* providers sorted cheapest-first with alphabetical tiebreak — this mirrors
|
|
12
|
+
* `selectProviderForTask`'s ordering so the first element of the chain is the
|
|
13
|
+
* same provider auto-routing would have picked.
|
|
14
|
+
*
|
|
15
|
+
* Eligibility (capability + tier filters) is handled entirely by
|
|
16
|
+
* `getProviderEligibility`; we just drop the ineligible entries.
|
|
17
|
+
*/
|
|
18
|
+
export function buildEscalationChain(task, config) {
|
|
19
|
+
const eligibility = getProviderEligibility(task, config);
|
|
20
|
+
const eligible = eligibility.filter((e) => e.eligible);
|
|
21
|
+
eligible.sort((a, b) => {
|
|
22
|
+
const aTier = COST_ORDER[getEffectiveCostTier(a.config)] ?? 3;
|
|
23
|
+
const bTier = COST_ORDER[getEffectiveCostTier(b.config)] ?? 3;
|
|
24
|
+
if (aTier !== bTier)
|
|
25
|
+
return aTier - bTier;
|
|
26
|
+
return a.name.localeCompare(b.name);
|
|
27
|
+
});
|
|
28
|
+
return eligible.map((e) => createProvider(e.name, config));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Walks the provider chain for an auto-routed task. Returns the first
|
|
32
|
+
* successful result; if all attempts fail, returns the best salvageable
|
|
33
|
+
* output (longest non-empty) with status 'incomplete' and the full
|
|
34
|
+
* escalation log.
|
|
35
|
+
*
|
|
36
|
+
* For explicitly-pinned tasks, the chain has length 1 and there is no
|
|
37
|
+
* walking — the pinned provider's result is returned as-is. See spec
|
|
38
|
+
* Part A.4.
|
|
39
|
+
*/
|
|
40
|
+
export async function delegateWithEscalation(task, chain, options = {}) {
|
|
41
|
+
if (chain.length === 0) {
|
|
42
|
+
throw new Error('delegateWithEscalation called with empty chain');
|
|
43
|
+
}
|
|
44
|
+
// Wrap the user-supplied sink with try/catch so a throwing callback can
|
|
45
|
+
// never corrupt a task. The contract says callbacks MUST NOT throw, but
|
|
46
|
+
// Tasks 9-11 will call this from hot runner loops — defense in depth.
|
|
47
|
+
// This wrapper is also the callback handed to `provider.run`, so runner
|
|
48
|
+
// emissions are covered by the same guard.
|
|
49
|
+
const safeSink = options.onProgress
|
|
50
|
+
? (event) => {
|
|
51
|
+
try {
|
|
52
|
+
options.onProgress(event);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Swallow — a broken sink must not affect dispatch.
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
: undefined;
|
|
59
|
+
const attempts = [];
|
|
60
|
+
for (let i = 0; i < chain.length; i++) {
|
|
61
|
+
const provider = chain[i];
|
|
62
|
+
// Emit one `escalation_start` between attempts (never before the first).
|
|
63
|
+
// The previous attempt's record is guaranteed to exist here because i>0.
|
|
64
|
+
if (i > 0 && safeSink) {
|
|
65
|
+
const prev = attempts[attempts.length - 1].record;
|
|
66
|
+
safeSink({
|
|
67
|
+
kind: 'escalation_start',
|
|
68
|
+
previousProvider: prev.provider,
|
|
69
|
+
previousReason: prev.reason ?? `status=${prev.status}`,
|
|
70
|
+
nextProvider: provider.name,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// Per-attempt metadata captured via the runner's `onInitialRequest`
|
|
74
|
+
// callback. Reset inside the loop so a subsequent escalation hop
|
|
75
|
+
// starts fresh. The runner invokes this exactly once per attempt
|
|
76
|
+
// (Task 12). We wrap assignment in try/catch at the runner site, but
|
|
77
|
+
// assigning to these locals cannot itself throw.
|
|
78
|
+
let initialPromptLengthChars = 0;
|
|
79
|
+
let initialPromptHash = '';
|
|
80
|
+
const result = await provider.run(task.prompt, {
|
|
81
|
+
tools: task.tools,
|
|
82
|
+
maxTurns: task.maxTurns,
|
|
83
|
+
timeoutMs: task.timeoutMs,
|
|
84
|
+
cwd: task.cwd,
|
|
85
|
+
effort: task.effort,
|
|
86
|
+
sandboxPolicy: task.sandboxPolicy,
|
|
87
|
+
expectedCoverage: task.expectedCoverage,
|
|
88
|
+
includeProgressTrace: task.includeProgressTrace,
|
|
89
|
+
parentModel: task.parentModel,
|
|
90
|
+
onProgress: safeSink,
|
|
91
|
+
onInitialRequest: (meta) => {
|
|
92
|
+
initialPromptLengthChars = meta.lengthChars;
|
|
93
|
+
initialPromptHash = meta.sha256;
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
const record = {
|
|
97
|
+
provider: provider.name,
|
|
98
|
+
status: result.status,
|
|
99
|
+
turns: result.turns,
|
|
100
|
+
inputTokens: result.usage.inputTokens,
|
|
101
|
+
outputTokens: result.usage.outputTokens,
|
|
102
|
+
costUSD: result.usage.costUSD,
|
|
103
|
+
initialPromptLengthChars,
|
|
104
|
+
initialPromptHash,
|
|
105
|
+
// Use `||` (not `??`) so an empty-string error falls through to the
|
|
106
|
+
// status sentinel — an empty `reason` would be indistinguishable from
|
|
107
|
+
// an `ok` row in the escalation log.
|
|
108
|
+
reason: result.status === 'ok'
|
|
109
|
+
? undefined
|
|
110
|
+
: (result.error || `status=${result.status}`),
|
|
111
|
+
...(result.progressTrace && { progressTrace: result.progressTrace }),
|
|
112
|
+
};
|
|
113
|
+
attempts.push({ result, record });
|
|
114
|
+
if (result.status === 'ok') {
|
|
115
|
+
return {
|
|
116
|
+
...result,
|
|
117
|
+
escalationLog: attempts.map((a) => a.record),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
// Pinned: stop after the first attempt regardless of status.
|
|
121
|
+
if (options.explicitlyPinned) {
|
|
122
|
+
return {
|
|
123
|
+
...result,
|
|
124
|
+
escalationLog: attempts.map((a) => a.record),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// All providers failed. Return the best salvageable output.
|
|
129
|
+
//
|
|
130
|
+
// Two-tier selection based on `RunResult.outputIsDiagnostic`:
|
|
131
|
+
//
|
|
132
|
+
// Tier 1 (preferred): attempts whose `output` contains real
|
|
133
|
+
// model-produced content — a clean final answer (on `ok`, but
|
|
134
|
+
// `ok` short-circuits above so we never see one here) or
|
|
135
|
+
// `scratchpad.latest()` text that the runner actually buffered
|
|
136
|
+
// before termination. These are flagged `outputIsDiagnostic: false`.
|
|
137
|
+
//
|
|
138
|
+
// Tier 2 (fallback): attempts whose `output` is a runner-synthesized
|
|
139
|
+
// diagnostic template (`"Sub-agent error: …"`, `"Agent timed out…"`,
|
|
140
|
+
// `buildXxxIncompleteDiagnostic(...)`, etc.) because the scratchpad
|
|
141
|
+
// was empty at termination. These are `outputIsDiagnostic: true`.
|
|
142
|
+
//
|
|
143
|
+
// Why: status alone is NOT enough. Two `incomplete` attempts can both
|
|
144
|
+
// exist where one has genuine scratchpad content and the other has
|
|
145
|
+
// just the diagnostic template — picking by raw output length would
|
|
146
|
+
// silently discard the real work in favor of a longer diagnostic.
|
|
147
|
+
// Likewise a late `api_error` attempt with a long
|
|
148
|
+
// `"Sub-agent error: <stack trace>"` would beat an earlier
|
|
149
|
+
// `incomplete` attempt with a shorter genuine partial.
|
|
150
|
+
//
|
|
151
|
+
// Within each tier we still pick the longest output, because a
|
|
152
|
+
// longer genuine salvage is usually more useful than a shorter one,
|
|
153
|
+
// and among pure-diagnostic attempts a longer diagnostic usually
|
|
154
|
+
// carries more debugging signal than a shorter one.
|
|
155
|
+
//
|
|
156
|
+
// Note: the `ok` short-circuit above means every entry here is non-ok,
|
|
157
|
+
// so the status-remap below is defensive only.
|
|
158
|
+
const realContentAttempts = attempts.filter((a) => !a.result.outputIsDiagnostic);
|
|
159
|
+
const pool = realContentAttempts.length > 0 ? realContentAttempts : attempts;
|
|
160
|
+
let best = pool[0].result;
|
|
161
|
+
for (const a of pool) {
|
|
162
|
+
if (a.result.output.length > best.output.length) {
|
|
163
|
+
best = a.result;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
...best,
|
|
168
|
+
status: best.status === 'ok' ? 'incomplete' : best.status,
|
|
169
|
+
escalationLog: attempts.map((a) => a.record),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=delegate-with-escalation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate-with-escalation.js","sourceRoot":"","sources":["../src/delegate-with-escalation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAcnE,oDAAoD;AACpD,6EAA6E;AAC7E,8EAA8E;AAC9E,QAAQ;AACR,MAAM,UAAU,GAA6B,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAGrF;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAc,EACd,MAAwB;IAExB,MAAM,WAAW,GAAG,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAEvD,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACrB,MAAM,KAAK,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,KAAK,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9D,IAAI,KAAK,KAAK,KAAK;YAAE,OA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AuE;IACvE,+CAA+C;IAC/C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACjF,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE7E,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1B,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAChD,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;QACzD,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { loadConfigFromFile } from './config/load.js';
|
|
2
2
|
export { parseConfig, multiModelConfigSchema } from './config/schema.js';
|
|
3
|
-
export type { Tier, Capability, ToolMode, SandboxPolicy, Effort, CostTier, RunStatus, TaskSpec, ProviderConfig, CodexProviderConfig, ClaudeProviderConfig, OpenAICompatibleProviderConfig, MultiModelConfig, TokenUsage, RunResult, Provider, RunOptions, EligibilityFailureCheck, EligibilityFailure, ProviderEligibility, } from './types.js';
|
|
3
|
+
export type { Tier, Capability, ToolMode, SandboxPolicy, Effort, CostTier, RunStatus, TaskSpec, ProviderConfig, CodexProviderConfig, ClaudeProviderConfig, OpenAICompatibleProviderConfig, MultiModelConfig, TokenUsage, RunResult, ProgressTraceEntry, BatchTimings, BatchProgress, BatchAggregateCost, Provider, RunOptions, RunTasksRuntime, ProgressEvent, EligibilityFailureCheck, EligibilityFailure, ProviderEligibility, } from './types.js';
|
|
4
|
+
export { InMemoryContextBlockStore, ContextBlockNotFoundError, } from './context/context-block-store.js';
|
|
5
|
+
export type { ContextBlockStore, RegisteredBlock, InMemoryContextBlockStoreOptions, } from './context/context-block-store.js';
|
|
6
|
+
export { expandContextBlocks } from './context/expand-context-blocks.js';
|
|
4
7
|
export { createProvider } from './provider.js';
|
|
5
8
|
export { runTasks } from './run-tasks.js';
|
|
6
9
|
export { getBaseCapabilities } from './routing/capabilities.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGzE,YAAY,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,aAAa,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,EAC9B,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAg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AC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// Config
|
|
2
2
|
export { loadConfigFromFile } from './config/load.js';
|
|
3
3
|
export { parseConfig, multiModelConfigSchema } from './config/schema.js';
|
|
4
|
+
// Context blocks
|
|
5
|
+
export { InMemoryContextBlockStore, ContextBlockNotFoundError, } from './context/context-block-store.js';
|
|
6
|
+
export { expandContextBlocks } from './context/expand-context-blocks.js';
|
|
4
7
|
// Provider
|
|
5
8
|
export { createProvider } from './provider.js';
|
|
6
9
|
// Run tasks
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAgCzE,iBAAiB;AACjB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,kCAAkC,CAAC;AAM1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,WAAW;AACX,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,YAAY;AACZ,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC"}
|
package/dist/model-profiles.json
CHANGED
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
"defaultCost": "high",
|
|
6
6
|
"bestFor": "high-ambiguity tasks where the cost of error is high",
|
|
7
7
|
"avoidFor": "routine implementation or batch transformations as the default choice",
|
|
8
|
-
"
|
|
8
|
+
"notes": "Family profile pegged to the latest generally available Opus pricing as of 2026-04-11.",
|
|
9
|
+
"supportsEffort": true,
|
|
10
|
+
"inputCostPerMTok": 5,
|
|
11
|
+
"outputCostPerMTok": 25,
|
|
12
|
+
"rateSource": "https://claude.com/pricing",
|
|
13
|
+
"rateLookupDate": "2026-04-11",
|
|
14
|
+
"inputTokenSoftLimit": 150000
|
|
9
15
|
},
|
|
10
16
|
{
|
|
11
17
|
"prefix": "claude-sonnet",
|
|
@@ -13,7 +19,27 @@
|
|
|
13
19
|
"defaultCost": "medium",
|
|
14
20
|
"bestFor": "most professional coding and tool-using tasks",
|
|
15
21
|
"avoidFor": "the hardest architectural decisions or highly ambiguous judgment calls",
|
|
16
|
-
"
|
|
22
|
+
"notes": "Family profile pegged to the latest generally available Sonnet pricing as of 2026-04-11.",
|
|
23
|
+
"supportsEffort": true,
|
|
24
|
+
"inputCostPerMTok": 3,
|
|
25
|
+
"outputCostPerMTok": 15,
|
|
26
|
+
"rateSource": "https://claude.com/pricing",
|
|
27
|
+
"rateLookupDate": "2026-04-11",
|
|
28
|
+
"inputTokenSoftLimit": 150000
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"prefix": "claude-haiku",
|
|
32
|
+
"tier": "standard",
|
|
33
|
+
"defaultCost": "low",
|
|
34
|
+
"bestFor": "fast low-cost coding, batch transformations, and routine implementation work",
|
|
35
|
+
"avoidFor": "high-stakes reasoning or ambiguous tasks where deeper judgment matters",
|
|
36
|
+
"notes": "Family profile pegged to the latest generally available Haiku pricing as of 2026-04-11.",
|
|
37
|
+
"supportsEffort": true,
|
|
38
|
+
"inputCostPerMTok": 1,
|
|
39
|
+
"outputCostPerMTok": 5,
|
|
40
|
+
"rateSource": "https://claude.com/pricing",
|
|
41
|
+
"rateLookupDate": "2026-04-11",
|
|
42
|
+
"inputTokenSoftLimit": 150000
|
|
17
43
|
},
|
|
18
44
|
{
|
|
19
45
|
"prefix": "gpt-5",
|
|
@@ -21,7 +47,13 @@
|
|
|
21
47
|
"defaultCost": "medium",
|
|
22
48
|
"bestFor": "reasoning-tier coding, agentic workflows, and tool use",
|
|
23
49
|
"avoidFor": "cases where you explicitly prefer premium escalation over cost or latency",
|
|
24
|
-
"
|
|
50
|
+
"notes": "Family profile pegged to the latest generally available GPT-5 pricing as of 2026-04-11.",
|
|
51
|
+
"supportsEffort": true,
|
|
52
|
+
"inputCostPerMTok": 2.5,
|
|
53
|
+
"outputCostPerMTok": 15,
|
|
54
|
+
"rateSource": "https://openai.com/api/pricing/",
|
|
55
|
+
"rateLookupDate": "2026-04-11",
|
|
56
|
+
"inputTokenSoftLimit": 1000000
|
|
25
57
|
},
|
|
26
58
|
{
|
|
27
59
|
"prefix": "MiniMax-M2",
|
|
@@ -29,6 +61,12 @@
|
|
|
29
61
|
"defaultCost": "low",
|
|
30
62
|
"bestFor": "well-scoped coding and agent loops where cost matters",
|
|
31
63
|
"avoidFor": "highest-stakes ambiguous work that needs top-tier judgment",
|
|
32
|
-
"
|
|
64
|
+
"notes": "Family profile pegged to the latest generally available MiniMax-M2 pricing as of 2026-04-11.",
|
|
65
|
+
"supportsEffort": true,
|
|
66
|
+
"inputCostPerMTok": 0.3,
|
|
67
|
+
"outputCostPerMTok": 1.2,
|
|
68
|
+
"rateSource": "https://platform.minimax.io/docs/guides/pricing-paygo",
|
|
69
|
+
"rateLookupDate": "2026-04-11",
|
|
70
|
+
"inputTokenSoftLimit": 200000
|
|
33
71
|
}
|
|
34
72
|
]
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAyB,gBAAgB,EAAkB,MAAM,YAAY,CAAC;AAGpG,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAyB,gBAAgB,EAAkB,MAAM,YAAY,CAAC;AAGpG,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,QAAQ,CA2D/E"}
|
package/dist/provider.js
CHANGED
|
@@ -40,7 +40,13 @@ export function createProvider(name, config) {
|
|
|
40
40
|
status: 'error',
|
|
41
41
|
usage: { inputTokens: 0, outputTokens: 0, totalTokens: 0, costUSD: null },
|
|
42
42
|
turns: 0,
|
|
43
|
-
|
|
43
|
+
filesRead: [],
|
|
44
|
+
filesWritten: [],
|
|
45
|
+
toolCalls: [],
|
|
46
|
+
// Fallback error wrapper around a thrown runner — no scratchpad
|
|
47
|
+
// involved, just the raw error message.
|
|
48
|
+
outputIsDiagnostic: true,
|
|
49
|
+
escalationLog: [],
|
|
44
50
|
error: err instanceof Error ? err.message : String(err),
|
|
45
51
|
};
|
|
46
52
|
}
|
package/dist/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,MAAwB;IACnE,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,CAA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AO,EAAE,UAAU,CAAC,CAAC;gBACtD,CAAC;gBAED,OAAO,CAAC,CAAC,CAAC;oBACR,mEAAmE;oBACnE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;gBACxD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,MAAM,EAAE,oBAAoB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;gBAC9E,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;gBACzE,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,EAAE;gBACb,YAAY,EAAE,EAAE;gBAChB,SAAS,EAAE,EAAE;gBACb,gEAAgE;gBAChE,wCAAwC;gBACxC,kBAAkB,EAAE,IAAI;gBACxB,aAAa,EAAE,EAAE;gBACjB,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACxD,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -3,20 +3,25 @@ import type { CostTier, ProviderConfig } from '../types.js';
|
|
|
3
3
|
export declare const modelProfileSchema: z.ZodObject<{
|
|
4
4
|
prefix: z.ZodString;
|
|
5
5
|
tier: z.ZodEnum<{
|
|
6
|
-
trivial: "trivial";
|
|
7
|
-
standard: "standard";
|
|
8
6
|
reasoning: "reasoning";
|
|
7
|
+
standard: "standard";
|
|
8
|
+
trivial: "trivial";
|
|
9
9
|
}>;
|
|
10
10
|
defaultCost: z.ZodEnum<{
|
|
11
|
-
low: "low";
|
|
12
|
-
medium: "medium";
|
|
13
11
|
high: "high";
|
|
12
|
+
medium: "medium";
|
|
13
|
+
low: "low";
|
|
14
14
|
free: "free";
|
|
15
15
|
}>;
|
|
16
16
|
bestFor: z.ZodString;
|
|
17
17
|
avoidFor: z.ZodOptional<z.ZodString>;
|
|
18
18
|
notes: z.ZodOptional<z.ZodString>;
|
|
19
19
|
supportsEffort: z.ZodBoolean;
|
|
20
|
+
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
rateSource: z.ZodOptional<z.ZodString>;
|
|
23
|
+
rateLookupDate: z.ZodOptional<z.ZodString>;
|
|
24
|
+
inputTokenSoftLimit: z.ZodNumber;
|
|
20
25
|
}, z.core.$strip>;
|
|
21
26
|
export type ModelProfile = z.infer<typeof modelProfileSchema>;
|
|
22
27
|
export declare function findModelProfile(modelId: string): ModelProfile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-profiles.d.ts","sourceRoot":"","sources":["../../src/routing/model-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAQ,MAAM,aAAa,CAAC;AAMlE,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"model-profiles.d.ts","sourceRoot":"","sources":["../../src/routing/model-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAQ,MAAM,aAAa,CAAC;AAMlE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;iBAe7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAoB9D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAQ9D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,CAErE"}
|
|
@@ -10,6 +10,13 @@ export const modelProfileSchema = z.object({
|
|
|
10
10
|
avoidFor: z.string().optional(),
|
|
11
11
|
notes: z.string().optional(),
|
|
12
12
|
supportsEffort: z.boolean(),
|
|
13
|
+
inputCostPerMTok: z.number().finite().nonnegative().optional(),
|
|
14
|
+
outputCostPerMTok: z.number().finite().nonnegative().optional(),
|
|
15
|
+
rateSource: z.string().min(1).optional(),
|
|
16
|
+
rateLookupDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
17
|
+
/** Per-model-family default for the watchdog input-token soft limit.
|
|
18
|
+
* See spec A.1.4. */
|
|
19
|
+
inputTokenSoftLimit: z.number().int().positive(),
|
|
13
20
|
});
|
|
14
21
|
const DEFAULT_PROFILE = {
|
|
15
22
|
prefix: '',
|
|
@@ -17,6 +24,7 @@ const DEFAULT_PROFILE = {
|
|
|
17
24
|
defaultCost: 'medium',
|
|
18
25
|
bestFor: 'general tasks (unprofiled model — defaults applied)',
|
|
19
26
|
supportsEffort: false,
|
|
27
|
+
inputTokenSoftLimit: 100_000,
|
|
20
28
|
};
|
|
21
29
|
// Validate and sort once at module load — longest prefix wins
|
|
22
30
|
const PROFILE_ENTRIES = (() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-profiles.js","sourceRoot":"","sources":["../../src/routing/model-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,WAAW,MAAM,wBAAwB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEvE,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;AAChE,MAAM,cAAc,GAAG,CAAC,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MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACvE,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;YACtD,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,GAAG,eAAe,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAsB;IACzD,OAAO,MAAM,CAAC,QAAQ,IAAI,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC;AACvE,CAAC"}
|
package/dist/run-tasks.d.ts
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
|
-
import type { RunResult, TaskSpec, MultiModelConfig } from './types.js';
|
|
1
|
+
import type { RunResult, TaskSpec, MultiModelConfig, ProgressEvent, RunTasksRuntime } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Per-task progress sink. `runTasks` invokes this for every
|
|
4
|
+
* `ProgressEvent` emitted while working on task at `taskIndex`. The caller
|
|
5
|
+
* (today: the MCP cli bridge) is responsible for disambiguating which task
|
|
6
|
+
* emitted which event — this is the cheapest contract: the orchestrator
|
|
7
|
+
* already knows each task's position in the input array, so the caller
|
|
8
|
+
* doesn't have to wrap N closures.
|
|
9
|
+
*/
|
|
10
|
+
export type RunTasksProgressCallback = (taskIndex: number, event: ProgressEvent) => void;
|
|
11
|
+
export interface RunTasksOptions {
|
|
12
|
+
/** Optional progress sink. See `RunTasksProgressCallback`. When omitted,
|
|
13
|
+
* no progress events are produced — backward-compatible with callers
|
|
14
|
+
* that predate Task 8. */
|
|
15
|
+
onProgress?: RunTasksProgressCallback;
|
|
16
|
+
/** Runtime dependencies the orchestrator needs at dispatch time. Today
|
|
17
|
+
* this is just the context-block store used to expand
|
|
18
|
+
* `TaskSpec.contextBlockIds`. Kept as a nested field so existing callers
|
|
19
|
+
* that only pass `onProgress` don't break. */
|
|
20
|
+
runtime?: RunTasksRuntime;
|
|
21
|
+
}
|
|
2
22
|
/**
|
|
3
23
|
* Run tasks concurrently. Each RunResult corresponds to the matching TaskSpec
|
|
4
24
|
* at the same index. One task failing does not affect others.
|
|
25
|
+
*
|
|
26
|
+
* When `options.onProgress` is supplied, it is called with `(taskIndex, event)`
|
|
27
|
+
* for every progress event emitted by that task's provider run or the
|
|
28
|
+
* escalation orchestrator. See `ProgressEvent` for variants.
|
|
5
29
|
*/
|
|
6
|
-
export declare function runTasks(tasks: TaskSpec[], config: MultiModelConfig): Promise<RunResult[]>;
|
|
30
|
+
export declare function runTasks(tasks: TaskSpec[], config: MultiModelConfig, options?: RunTasksOptions): Promise<RunResult[]>;
|
|
7
31
|
//# sourceMappingURL=run-tasks.d.ts.map
|
package/dist/run-tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-tasks.d.ts","sourceRoot":"","sources":["../src/run-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"run-tasks.d.ts","sourceRoot":"","sources":["../src/run-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,YAAY,CAAC;AAOpB;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,KACjB,IAAI,CAAC;AAEV,MAAM,WAAW,eAAe;IAC9B;;+BAE2B;IAC3B,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC;;;mDAG+C;IAC/C,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAoDD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,QAAQ,EAAE,EACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,SAAS,EAAE,CAAC,CA4EtB"}
|
package/dist/run-tasks.js
CHANGED
|
@@ -1,26 +1,39 @@
|
|
|
1
1
|
import { createProvider } from './provider.js';
|
|
2
2
|
import { getProviderEligibility } from './routing/get-provider-eligibility.js';
|
|
3
3
|
import { selectProviderForTask } from './routing/select-provider-for-task.js';
|
|
4
|
+
import { buildEscalationChain, delegateWithEscalation } from './delegate-with-escalation.js';
|
|
5
|
+
import { expandContextBlocks } from './context/expand-context-blocks.js';
|
|
4
6
|
function errorResult(error) {
|
|
5
7
|
return {
|
|
6
8
|
output: `Sub-agent error: ${error}`,
|
|
7
9
|
status: 'error',
|
|
8
10
|
usage: { inputTokens: 0, outputTokens: 0, totalTokens: 0, costUSD: null },
|
|
9
11
|
turns: 0,
|
|
10
|
-
|
|
12
|
+
filesRead: [],
|
|
13
|
+
filesWritten: [],
|
|
14
|
+
toolCalls: [],
|
|
15
|
+
// Orchestrator-level error wrapper (e.g. "no eligible provider",
|
|
16
|
+
// contextBlockIds expansion failure) — pure diagnostic, no salvage.
|
|
17
|
+
outputIsDiagnostic: true,
|
|
18
|
+
escalationLog: [],
|
|
11
19
|
error,
|
|
12
20
|
};
|
|
13
21
|
}
|
|
14
|
-
async function executeTask(
|
|
22
|
+
async function executeTask(resolved, config, onProgress) {
|
|
15
23
|
try {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
if (resolved.pinned) {
|
|
25
|
+
// Explicit pin: chain of length 1, no escalation.
|
|
26
|
+
return await delegateWithEscalation(resolved.task, [resolved.provider], { explicitlyPinned: true, onProgress });
|
|
27
|
+
}
|
|
28
|
+
// Auto-routed: walk all eligible providers cheapest-first.
|
|
29
|
+
const chain = buildEscalationChain(resolved.task, config);
|
|
30
|
+
if (chain.length === 0) {
|
|
31
|
+
// Defensive: selectProviderForTask succeeded earlier so eligibility
|
|
32
|
+
// existed at resolution time. If the chain is somehow empty now we
|
|
33
|
+
// surface a structured error rather than throwing.
|
|
34
|
+
return errorResult('No eligible provider found for task at dispatch time.');
|
|
35
|
+
}
|
|
36
|
+
return await delegateWithEscalation(resolved.task, chain, { onProgress });
|
|
24
37
|
}
|
|
25
38
|
catch (err) {
|
|
26
39
|
return errorResult(err instanceof Error ? err.message : String(err));
|
|
@@ -29,11 +42,34 @@ async function executeTask(task, provider, config) {
|
|
|
29
42
|
/**
|
|
30
43
|
* Run tasks concurrently. Each RunResult corresponds to the matching TaskSpec
|
|
31
44
|
* at the same index. One task failing does not affect others.
|
|
45
|
+
*
|
|
46
|
+
* When `options.onProgress` is supplied, it is called with `(taskIndex, event)`
|
|
47
|
+
* for every progress event emitted by that task's provider run or the
|
|
48
|
+
* escalation orchestrator. See `ProgressEvent` for variants.
|
|
32
49
|
*/
|
|
33
|
-
export async function runTasks(tasks, config) {
|
|
50
|
+
export async function runTasks(tasks, config, options = {}) {
|
|
34
51
|
if (tasks.length === 0)
|
|
35
52
|
return [];
|
|
36
|
-
|
|
53
|
+
// Expand context blocks up-front so the rest of the pipeline sees a
|
|
54
|
+
// self-contained prompt. `expandContextBlocks` is a no-op for tasks
|
|
55
|
+
// without `contextBlockIds` and for calls that omit `runtime`, so
|
|
56
|
+
// existing callers are unaffected. A missing block id throws
|
|
57
|
+
// `ContextBlockNotFoundError` synchronously — we convert it to an
|
|
58
|
+
// error-result for the specific task so the rest of the batch still
|
|
59
|
+
// runs.
|
|
60
|
+
const expandedTasks = tasks.map((task) => {
|
|
61
|
+
try {
|
|
62
|
+
return expandContextBlocks(task, options.runtime?.contextBlockStore);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const resolved = expandedTasks.map((entry, idx) => {
|
|
69
|
+
if ('error' in entry) {
|
|
70
|
+
return { task: tasks[idx], error: entry.error };
|
|
71
|
+
}
|
|
72
|
+
const task = entry;
|
|
37
73
|
// If provider specified, validate and use it
|
|
38
74
|
if (task.provider) {
|
|
39
75
|
const eligibility = getProviderEligibility(task, config);
|
|
@@ -54,10 +90,13 @@ export async function runTasks(tasks, config) {
|
|
|
54
90
|
}
|
|
55
91
|
return {
|
|
56
92
|
task,
|
|
93
|
+
pinned: true,
|
|
57
94
|
provider: createProvider(task.provider, config),
|
|
58
95
|
};
|
|
59
96
|
}
|
|
60
|
-
// Auto-routing
|
|
97
|
+
// Auto-routing — selectProviderForTask is still used here so the "no
|
|
98
|
+
// eligible provider" error path stays identical to pre-escalation
|
|
99
|
+
// behavior. The actual chain is constructed inside executeTask.
|
|
61
100
|
const selected = selectProviderForTask(task, config);
|
|
62
101
|
if (!selected) {
|
|
63
102
|
const available = Object.keys(config.providers);
|
|
@@ -66,16 +105,19 @@ export async function runTasks(tasks, config) {
|
|
|
66
105
|
error: `No eligible provider found for task (required tier: ${task.tier}, capabilities: ${task.requiredCapabilities.join(', ') || 'none'}). Available providers: ${available.join(', ') || 'none'}.`,
|
|
67
106
|
};
|
|
68
107
|
}
|
|
69
|
-
return {
|
|
70
|
-
task,
|
|
71
|
-
provider: createProvider(selected.name, config),
|
|
72
|
-
};
|
|
108
|
+
return { task, pinned: false };
|
|
73
109
|
});
|
|
74
|
-
return Promise.all(resolved.map((r) => {
|
|
110
|
+
return Promise.all(resolved.map((r, index) => {
|
|
75
111
|
if ('error' in r) {
|
|
76
112
|
return Promise.resolve(errorResult(r.error));
|
|
77
113
|
}
|
|
78
|
-
|
|
114
|
+
// Bind the task index into a per-task sink so the caller can
|
|
115
|
+
// disambiguate which task an event belongs to without threading
|
|
116
|
+
// extra fields through the orchestrator.
|
|
117
|
+
const taskProgress = options.onProgress
|
|
118
|
+
? (event) => options.onProgress(index, event)
|
|
119
|
+
: undefined;
|
|
120
|
+
return executeTask(r, config, taskProgress);
|
|
79
121
|
}));
|
|
80
122
|
}
|
|
81
123
|
//# sourceMappingURL=run-tasks.js.map
|
package/dist/run-tasks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-tasks.js","sourceRoot":"","sources":["../src/run-tasks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-tasks.js","sourceRoot":"","sources":["../src/run-tasks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AA2BzE,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO;QACL,MAAM,EAAE,oBAAoB,KAAK,EAAE;QACnC,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;QACzE,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,EAAE;QACb,iEAAiE;QACjE,oEAAoE;QACpE,kBAAkB,EAAE,IAAI;QACxB,aAAa,EAAE,EAAE;QACjB,KAAK;KACN,CAAC;AACJ,CAAC;AAOD,KAAK,UAAU,WAAW,CACxB,QAAkD,EAClD,MAAwB,EACxB,UAA2C;IAE3C,IAAI,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,kDAA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"","sources":["../../src/runners/claude-runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-runner.d.ts","sourceRoot":"","sources":["../../src/runners/claude-runner.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,cAAc,EAEpB,MAAM,aAAa,CAAC;AAuGrB,wBAAsB,SAAS,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACxE,OAAO,CAAC,SAAS,CAAC,CAilBpB"}
|