opencode-swarm 7.181.2 → 7.181.4
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/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/cli/{coder-settlement-993vdsd2.js → coder-settlement-vbs5rj3z.js} +10 -10
- package/dist/cli/{config-doctor-nr27vfv6.js → config-doctor-3cb51z08.js} +2 -2
- package/dist/cli/{core-t3tg4397.js → core-0h7y8z0s.js} +2 -2
- package/dist/cli/{curation-policy-m3x9mkj9.js → curation-policy-r4dkajw9.js} +4 -4
- package/dist/cli/{curator-gk392717.js → curator-9sn55eyk.js} +34 -34
- package/dist/cli/curator-drift-d4jkgrba.js +37 -0
- package/dist/cli/{curator-llm-factory-n01we8pa.js → curator-llm-factory-zwc2gpe7.js} +34 -34
- package/dist/cli/{evidence-summary-service-fkvj8ct1.js → evidence-summary-service-sb5seqs3.js} +14 -14
- package/dist/cli/{gate-evidence-1n6zffzb.js → gate-evidence-emq2y7kz.js} +5 -5
- package/dist/cli/{guardrail-explain-81jvm99e.js → guardrail-explain-a3hcrpwv.js} +35 -35
- package/dist/cli/{guardrail-log-mw9x5j8g.js → guardrail-log-ftv03v4x.js} +6 -6
- package/dist/cli/{guardrail-reset-6thsn6ad.js → guardrail-reset-d6qmnvff.js} +34 -34
- package/dist/cli/{hive-promoter-pym6se37.js → hive-promoter-pktjn46n.js} +34 -34
- package/dist/cli/{index-m65tnv4j.js → index-01r2wrwa.js} +1 -1
- package/dist/cli/{index-txx2mrsk.js → index-0ea0c676.js} +25 -11
- package/dist/cli/{index-gmqf6bjj.js → index-12fxtcce.js} +36 -36
- package/dist/cli/{index-cr61qv27.js → index-1epynxc4.js} +2 -2
- package/dist/cli/{index-1wpnt86a.js → index-1msszzg2.js} +5 -5
- package/dist/cli/{index-12ewkms0.js → index-23mdeh2a.js} +1 -1
- package/dist/cli/{index-5hxv1er2.js → index-3ga3ts3h.js} +56 -3
- package/dist/cli/{index-38cfx8g8.js → index-427x3j6p.js} +2 -2
- package/dist/cli/{index-wph45kyb.js → index-4qpz7mpn.js} +4 -4
- package/dist/cli/{index-7nr9p5bd.js → index-54sd9bbn.js} +5 -5
- package/dist/cli/{index-fmhd3zc8.js → index-68ben2q8.js} +2 -2
- package/dist/cli/{index-n5a9dq5s.js → index-6jrn46zy.js} +1 -1
- package/dist/cli/{index-ernt0wrg.js → index-9eg8f4zm.js} +4306 -1504
- package/dist/cli/{index-hbe56wtn.js → index-9s2rp2j5.js} +2 -2
- package/dist/cli/{index-gc6h1fmf.js → index-a2hvmc3a.js} +1 -1
- package/dist/cli/{index-ea9fk6v0.js → index-ap6hs8fj.js} +1 -1
- package/dist/cli/{index-92m05mew.js → index-by9wfeja.js} +1 -1
- package/dist/cli/{index-et28q7cp.js → index-dkprb20b.js} +1 -1
- package/dist/cli/{index-qw9aqays.js → index-dwc1wztn.js} +6 -6
- package/dist/cli/{index-0h39trak.js → index-enmvd9ap.js} +1 -1
- package/dist/cli/{index-kzmd4gs7.js → index-epq8am78.js} +1 -1
- package/dist/cli/{index-pqtmzee6.js → index-fsye9ygy.js} +4 -4
- package/dist/cli/{index-5q3xsqwm.js → index-gtpq64q7.js} +3 -3
- package/dist/cli/{index-5v8zws0s.js → index-hqa71xfm.js} +140 -9
- package/dist/cli/{index-5zy5k5w0.js → index-j97nc02q.js} +4 -4
- package/dist/cli/{index-bdpgfep1.js → index-jrxrjz89.js} +1 -1
- package/dist/cli/{index-516j9vsk.js → index-kkrbybgt.js} +27 -2
- package/dist/cli/{index-6mwha20t.js → index-mkpdcbye.js} +3 -3
- package/dist/cli/{index-6x36hhd3.js → index-myacmqmf.js} +34 -34
- package/dist/cli/{index-t93cp2tz.js → index-nw3z614g.js} +4 -4
- package/dist/cli/{index-ehvkz2zv.js → index-r4vve32m.js} +7 -7
- package/dist/cli/{index-m779twtf.js → index-rgfz80gt.js} +1 -1
- package/dist/cli/{index-6gcxgx84.js → index-s34y6gbh.js} +1 -1
- package/dist/cli/{index-s0zgz4p1.js → index-sf51gh68.js} +1 -1
- package/dist/cli/{index-2sqfrvxj.js → index-v4h99xhr.js} +2 -2
- package/dist/cli/{index-vmwmwahh.js → index-x4am0jxt.js} +3 -3
- package/dist/cli/{index-et7tg13p.js → index-y03jadcy.js} +269 -9
- package/dist/cli/{index-dpxg347z.js → index-y28np6j9.js} +3 -3
- package/dist/cli/{index-xz4q5vcg.js → index-zp6fss8c.js} +3 -3
- package/dist/cli/index.js +35 -35
- package/dist/cli/{knowledge-escalator-jmqbmfbf.js → knowledge-escalator-5q4y97e4.js} +11 -11
- package/dist/cli/{knowledge-events-5ksqpf4g.js → knowledge-events-x7q8yepd.js} +9 -9
- package/dist/cli/{knowledge-link-s2qs178z.js → knowledge-link-655xa3db.js} +3 -3
- package/dist/cli/{knowledge-store-q3yy56sc.js → knowledge-store-r7ng2nf8.js} +4 -4
- package/dist/cli/{knowledge-validator-r5kaz53f.js → knowledge-validator-e78m6cqe.js} +6 -6
- package/dist/cli/{mcp-h82hxnxr.js → mcp-208jwxps.js} +1 -1
- package/dist/cli/model-preflight-xakn1356.js +359 -0
- package/dist/cli/{pending-delegations-e4h6vjeb.js → pending-delegations-w4a5tg11.js} +7 -7
- package/dist/cli/{pr-subscriptions-j7hw3k6x.js → pr-subscriptions-8289esc9.js} +7 -7
- package/dist/cli/{pr-workflow-gate-js8dcry2.js → pr-workflow-gate-b7yx0x21.js} +34 -34
- package/dist/cli/{runner-tzgwvvn1.js → runner-b5vt1any.js} +4 -4
- package/dist/cli/{scan-cursor-yhf58mq2.js → scan-cursor-edpbzp72.js} +5 -5
- package/dist/cli/{schema-0k4st1qt.js → schema-dnsxhyr3.js} +1 -1
- package/dist/cli/{scope-persistence-bpptmh1e.js → scope-persistence-z1f7d4tw.js} +10 -10
- package/dist/cli/{server-axnran6h.js → server-t2edntv4.js} +69 -599
- package/dist/cli/{skill-generator-n2w032d1.js → skill-generator-5n7vf0s3.js} +13 -13
- package/dist/cli/{snapshot-coordination-init-kyf50x12.js → snapshot-coordination-init-t14dk9je.js} +34 -34
- package/dist/cli/{speckit-checkoff-m4184e1x.js → speckit-checkoff-4ws84g13.js} +3 -3
- package/dist/cli/{telemetry-zhcgfe70.js → telemetry-6k8t2mrw.js} +1 -1
- package/dist/cli/{workspace-snapshot-4m2ex1ey.js → workspace-snapshot-hsssm50w.js} +2 -2
- package/dist/cli/{worktree-collision-ownership-1g2414pf.js → worktree-collision-ownership-wj6337ec.js} +8 -8
- package/dist/cli/{worktree-isolation-x07f7cfp.js → worktree-isolation-9fyj85tc.js} +34 -34
- package/dist/commands/registry.d.ts +1 -1
- package/dist/config/agent-model.d.ts +14 -0
- package/dist/config/bundled-skill-dispositions.d.ts +29 -0
- package/dist/hooks/delegation-gate.d.ts +10 -8
- package/dist/hooks/task-id-resolver.d.ts +7 -0
- package/dist/index.js +285 -269
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/instruction-pairing.d.ts +112 -0
- package/dist/services/model-preflight.d.ts +103 -21
- package/package.json +1 -1
- package/dist/cli/curator-drift-hz3j3fad.js +0 -297
- package/dist/cli/model-preflight-5b81adsj.js +0 -170
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
resolveConfiguredAgentModel,
|
|
4
|
+
resolveEffectiveAgentOverride,
|
|
5
|
+
resolvePrimaryAgentNames,
|
|
6
|
+
resolveRegisteredAgentModel
|
|
7
|
+
} from "./index-9eg8f4zm.js";
|
|
8
|
+
import"./index-gtpq64q7.js";
|
|
9
|
+
import"./index-hamqvzqn.js";
|
|
10
|
+
import"./index-01r2wrwa.js";
|
|
11
|
+
import"./index-y03jadcy.js";
|
|
12
|
+
import"./index-dkprb20b.js";
|
|
13
|
+
import"./index-0ea0c676.js";
|
|
14
|
+
import"./index-sf51gh68.js";
|
|
15
|
+
import"./index-txdagbh7.js";
|
|
16
|
+
import"./index-rgfz80gt.js";
|
|
17
|
+
import"./index-6b295cas.js";
|
|
18
|
+
import"./index-x4am0jxt.js";
|
|
19
|
+
import"./index-54sd9bbn.js";
|
|
20
|
+
import"./index-1epynxc4.js";
|
|
21
|
+
import"./index-rdec0y3z.js";
|
|
22
|
+
import"./index-nw3z614g.js";
|
|
23
|
+
import"./index-cjapb4hy.js";
|
|
24
|
+
import"./index-zsrtt42s.js";
|
|
25
|
+
import"./index-r4vve32m.js";
|
|
26
|
+
import"./index-jrxrjz89.js";
|
|
27
|
+
import"./index-by9wfeja.js";
|
|
28
|
+
import"./index-pt7h91zc.js";
|
|
29
|
+
import"./index-q7sjgr1y.js";
|
|
30
|
+
import"./index-epq8am78.js";
|
|
31
|
+
import"./index-j97nc02q.js";
|
|
32
|
+
import"./index-v4h99xhr.js";
|
|
33
|
+
import"./index-1msszzg2.js";
|
|
34
|
+
import"./index-hqa71xfm.js";
|
|
35
|
+
import"./index-a2hvmc3a.js";
|
|
36
|
+
import"./index-2s7dvzff.js";
|
|
37
|
+
import"./index-4qpz7mpn.js";
|
|
38
|
+
import"./index-s34y6gbh.js";
|
|
39
|
+
import"./index-rtry5xyf.js";
|
|
40
|
+
import"./index-9s2rp2j5.js";
|
|
41
|
+
import"./index-frcemc0b.js";
|
|
42
|
+
import"./index-0725jpp7.js";
|
|
43
|
+
import"./index-y28np6j9.js";
|
|
44
|
+
import"./index-fsye9ygy.js";
|
|
45
|
+
import"./index-427x3j6p.js";
|
|
46
|
+
import"./index-ved1325w.js";
|
|
47
|
+
import"./index-w1ydvzef.js";
|
|
48
|
+
import"./index-vvgpgcyn.js";
|
|
49
|
+
import"./index-rdm3px0g.js";
|
|
50
|
+
import"./index-ry16d01s.js";
|
|
51
|
+
import"./index-kkrbybgt.js";
|
|
52
|
+
import"./index-dwc1wztn.js";
|
|
53
|
+
import"./index-vzm6zre7.js";
|
|
54
|
+
import"./index-ae75rja9.js";
|
|
55
|
+
import"./index-23mdeh2a.js";
|
|
56
|
+
import"./index-ap6hs8fj.js";
|
|
57
|
+
import"./index-mkpdcbye.js";
|
|
58
|
+
import"./index-1xnse449.js";
|
|
59
|
+
import"./index-c1ggtmpm.js";
|
|
60
|
+
import"./index-ejhxgyvm.js";
|
|
61
|
+
import"./index-7g4c7s5r.js";
|
|
62
|
+
import"./index-989v83pb.js";
|
|
63
|
+
import"./index-gx2vp8gx.js";
|
|
64
|
+
import"./index-6jrn46zy.js";
|
|
65
|
+
import"./index-zxdawwc7.js";
|
|
66
|
+
import {
|
|
67
|
+
init_schema,
|
|
68
|
+
stripKnownSwarmPrefix
|
|
69
|
+
} from "./index-3ga3ts3h.js";
|
|
70
|
+
import {
|
|
71
|
+
ALL_AGENT_NAMES,
|
|
72
|
+
DEFAULT_MODELS,
|
|
73
|
+
init_constants
|
|
74
|
+
} from "./index-2t21pv2v.js";
|
|
75
|
+
import"./index-bk5tah7q.js";
|
|
76
|
+
import"./index-gknz3bv1.js";
|
|
77
|
+
import"./index-zpsr8rpc.js";
|
|
78
|
+
import"./index-wvghb3x6.js";
|
|
79
|
+
import"./index-9rwhas09.js";
|
|
80
|
+
import"./index-zgwm4ryv.js";
|
|
81
|
+
import"./index-a76rekgs.js";
|
|
82
|
+
|
|
83
|
+
// src/services/model-preflight.ts
|
|
84
|
+
init_constants();
|
|
85
|
+
init_schema();
|
|
86
|
+
var PROVIDER_LIST_TIMEOUT_MS = 2000;
|
|
87
|
+
function splitModelId(model) {
|
|
88
|
+
const separator = model.indexOf("/");
|
|
89
|
+
if (separator <= 0 || separator === model.length - 1)
|
|
90
|
+
return null;
|
|
91
|
+
return {
|
|
92
|
+
provider: model.slice(0, separator),
|
|
93
|
+
model: model.slice(separator + 1)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function collectConfiguredAgentModels(config) {
|
|
97
|
+
const collected = [];
|
|
98
|
+
const overriddenAgents = new Set;
|
|
99
|
+
const overrides = config?.agents ?? {};
|
|
100
|
+
for (const [agent, override] of Object.entries(overrides)) {
|
|
101
|
+
if (typeof override?.model === "string" && override.model.trim()) {
|
|
102
|
+
collected.push({
|
|
103
|
+
agent,
|
|
104
|
+
model: override.model.trim(),
|
|
105
|
+
source: "override"
|
|
106
|
+
});
|
|
107
|
+
overriddenAgents.add(agent);
|
|
108
|
+
}
|
|
109
|
+
for (const fallback of override?.fallback_models ?? []) {
|
|
110
|
+
if (typeof fallback === "string" && fallback.trim()) {
|
|
111
|
+
collected.push({
|
|
112
|
+
agent,
|
|
113
|
+
model: fallback.trim(),
|
|
114
|
+
source: "fallback"
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
for (const [agent, model] of Object.entries(DEFAULT_MODELS)) {
|
|
120
|
+
if (overriddenAgents.has(agent))
|
|
121
|
+
continue;
|
|
122
|
+
collected.push({ agent, model, source: "default" });
|
|
123
|
+
}
|
|
124
|
+
return collected;
|
|
125
|
+
}
|
|
126
|
+
var FEATURE_GATED_ROLES = new Map([
|
|
127
|
+
["council_generalist", (c) => c?.council?.general?.enabled === true],
|
|
128
|
+
["council_skeptic", (c) => c?.council?.general?.enabled === true],
|
|
129
|
+
["council_domain_expert", (c) => c?.council?.general?.enabled === true],
|
|
130
|
+
["docs_design", (c) => c?.design_docs?.enabled === true],
|
|
131
|
+
["designer", (c) => c?.ui_review?.enabled === true]
|
|
132
|
+
]);
|
|
133
|
+
var ALWAYS_ON_ROLES = ALL_AGENT_NAMES.filter((role) => !FEATURE_GATED_ROLES.has(role));
|
|
134
|
+
function enumerateEnabledAgentRoles(config) {
|
|
135
|
+
const names = [];
|
|
136
|
+
const emitSwarm = (swarmId, isDefault) => {
|
|
137
|
+
const prefix = isDefault ? "" : `${swarmId}_`;
|
|
138
|
+
const swarmAgents = config?.swarms?.[swarmId]?.agents;
|
|
139
|
+
const merged = config?.agents ? { ...config.agents, ...swarmAgents ?? {} } : swarmAgents ?? {};
|
|
140
|
+
for (const role of ALWAYS_ON_ROLES) {
|
|
141
|
+
if (merged?.[role]?.disabled === true)
|
|
142
|
+
continue;
|
|
143
|
+
names.push(`${prefix}${role}`);
|
|
144
|
+
}
|
|
145
|
+
for (const [role, flagEnabled] of FEATURE_GATED_ROLES) {
|
|
146
|
+
if (!flagEnabled(config))
|
|
147
|
+
continue;
|
|
148
|
+
if (merged?.[role]?.disabled === true)
|
|
149
|
+
continue;
|
|
150
|
+
names.push(`${prefix}${role}`);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const swarms = config?.swarms;
|
|
154
|
+
if (swarms && Object.keys(swarms).length > 0) {
|
|
155
|
+
for (const swarmId of Object.keys(swarms)) {
|
|
156
|
+
emitSwarm(swarmId, swarmId === "default");
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
emitSwarm("default", true);
|
|
160
|
+
}
|
|
161
|
+
return names;
|
|
162
|
+
}
|
|
163
|
+
function collectEnabledAgentModels(config, opts) {
|
|
164
|
+
const names = opts?.generatedAgentNames && opts.generatedAgentNames.length > 0 ? [...opts.generatedAgentNames] : enumerateEnabledAgentRoles(config);
|
|
165
|
+
const primaryNames = opts?.registeredAgents ? new Set(Object.entries(opts.registeredAgents).filter(([, value]) => value?.mode === "primary").map(([name]) => name)) : resolvePrimaryAgentNames(names, config?.default_agent).primaryNames;
|
|
166
|
+
const collected = [];
|
|
167
|
+
for (const name of names) {
|
|
168
|
+
const mode = primaryNames.has(name) ? "primary" : "subagent";
|
|
169
|
+
const effective = config ? resolveEffectiveAgentOverride(config, name) : undefined;
|
|
170
|
+
const configuredModel = config ? resolveConfiguredAgentModel(config, name) : undefined;
|
|
171
|
+
const finalModel = config ? resolveRegisteredAgentModel(config, name) : DEFAULT_MODELS[stripKnownSwarmPrefix(name)] ?? DEFAULT_MODELS.default;
|
|
172
|
+
if (effective && typeof effective.model === "string" && effective.model.trim() === "") {
|
|
173
|
+
collected.push({ agent: name, model: "", source: "override", mode });
|
|
174
|
+
} else {
|
|
175
|
+
collected.push({
|
|
176
|
+
agent: name,
|
|
177
|
+
model: finalModel ?? "",
|
|
178
|
+
source: configuredModel !== undefined ? "override" : "default",
|
|
179
|
+
mode
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
for (const fallback of effective?.fallbackModels ?? []) {
|
|
183
|
+
if (typeof fallback === "string" && fallback.trim()) {
|
|
184
|
+
collected.push({
|
|
185
|
+
agent: name,
|
|
186
|
+
model: fallback.trim(),
|
|
187
|
+
source: "fallback",
|
|
188
|
+
mode
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return collected;
|
|
194
|
+
}
|
|
195
|
+
var CATALOG_CACHE_TTL_MS = 30000;
|
|
196
|
+
var catalogCacheByClient = new WeakMap;
|
|
197
|
+
var catalogCacheEpoch = 0;
|
|
198
|
+
function invalidateProviderCatalogCache() {
|
|
199
|
+
catalogCacheEpoch++;
|
|
200
|
+
catalogCacheByClient = new WeakMap;
|
|
201
|
+
}
|
|
202
|
+
function sanitizePreflightText(value) {
|
|
203
|
+
return value.replace(/[\x00-\x1f\x7f]+/g, " ");
|
|
204
|
+
}
|
|
205
|
+
async function fetchProviderCatalog(client) {
|
|
206
|
+
if (!client)
|
|
207
|
+
return null;
|
|
208
|
+
const cached = catalogCacheByClient.get(client);
|
|
209
|
+
if (cached && Date.now() - cached.fetchedAt < CATALOG_CACHE_TTL_MS) {
|
|
210
|
+
return cached.catalog;
|
|
211
|
+
}
|
|
212
|
+
const epochAtFetchStart = catalogCacheEpoch;
|
|
213
|
+
let response;
|
|
214
|
+
try {
|
|
215
|
+
response = await _internals.providerList(client);
|
|
216
|
+
} catch {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
const all = response?.data?.all;
|
|
220
|
+
if (!Array.isArray(all))
|
|
221
|
+
return null;
|
|
222
|
+
const catalog = new Map;
|
|
223
|
+
for (const provider of all) {
|
|
224
|
+
if (typeof provider?.id !== "string")
|
|
225
|
+
continue;
|
|
226
|
+
const models = new Set;
|
|
227
|
+
if (provider.models && typeof provider.models === "object" && !Array.isArray(provider.models)) {
|
|
228
|
+
for (const modelKey of Object.keys(provider.models)) {
|
|
229
|
+
models.add(modelKey);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
catalog.set(provider.id, models);
|
|
233
|
+
}
|
|
234
|
+
if (epochAtFetchStart === catalogCacheEpoch) {
|
|
235
|
+
catalogCacheByClient.set(client, { fetchedAt: Date.now(), catalog });
|
|
236
|
+
}
|
|
237
|
+
return catalog;
|
|
238
|
+
}
|
|
239
|
+
function resolveAgainstCatalog(models, catalog) {
|
|
240
|
+
const classifySelection = (entry) => {
|
|
241
|
+
if (entry.model.trim() === "") {
|
|
242
|
+
return {
|
|
243
|
+
...entry,
|
|
244
|
+
status: "missing-selection",
|
|
245
|
+
detail: "enabled role has no final model selection: the exact agent target resolved to no configured model and no default (blank model override or a stale swarm registry entry). Fix agents.<role>.model in opencode-swarm.json \u2014 the matching swarm override wins over the top-level entry."
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
if (entry.mode === "primary") {
|
|
249
|
+
return {
|
|
250
|
+
...entry,
|
|
251
|
+
status: "host-controlled",
|
|
252
|
+
detail: "primary agent: OpenCode UI owns the model selection; the registered model is intentionally not applied"
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
const split = splitModelId(entry.model);
|
|
256
|
+
if (!split) {
|
|
257
|
+
return {
|
|
258
|
+
...entry,
|
|
259
|
+
status: "unknown",
|
|
260
|
+
detail: "model id has no provider prefix; resolution not checked against the catalog"
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const providerModels = catalog?.get(split.provider);
|
|
264
|
+
if (providerModels === undefined) {
|
|
265
|
+
return {
|
|
266
|
+
...entry,
|
|
267
|
+
status: "unresolved",
|
|
268
|
+
detail: `provider "${split.provider}" is not present in the provider catalog`
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (!providerModels.has(split.model)) {
|
|
272
|
+
return {
|
|
273
|
+
...entry,
|
|
274
|
+
status: "unresolved",
|
|
275
|
+
detail: `provider "${split.provider}" does not list model "${split.model}"`
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
return { ...entry, status: "ok" };
|
|
279
|
+
};
|
|
280
|
+
if (catalog === null) {
|
|
281
|
+
return {
|
|
282
|
+
catalogAvailable: false,
|
|
283
|
+
resolutions: models.map((entry) => entry.model.trim() === "" ? classifySelection(entry) : {
|
|
284
|
+
...entry,
|
|
285
|
+
status: "unknown",
|
|
286
|
+
detail: "provider catalog unavailable; model resolution not checked"
|
|
287
|
+
})
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
catalogAvailable: true,
|
|
292
|
+
resolutions: models.map(classifySelection)
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
function formatModelPreflightWarning(result) {
|
|
296
|
+
const reportable = result.resolutions.filter((resolution) => resolution.status === "unresolved" || resolution.status === "missing-selection");
|
|
297
|
+
if (reportable.length === 0)
|
|
298
|
+
return null;
|
|
299
|
+
const lines = reportable.map((resolution) => {
|
|
300
|
+
const label = resolution.source === "fallback" ? `${sanitizePreflightText(resolution.agent)} (fallback entry)` : sanitizePreflightText(resolution.agent);
|
|
301
|
+
if (resolution.status === "missing-selection") {
|
|
302
|
+
return ` ${label}: no final model selection \u2014 ${sanitizePreflightText(resolution.detail ?? "")}`;
|
|
303
|
+
}
|
|
304
|
+
return ` ${label}: ${sanitizePreflightText(resolution.model)} (${sanitizePreflightText(resolution.detail ?? "does not resolve")})`;
|
|
305
|
+
});
|
|
306
|
+
return `[opencode-swarm] WARNING: ${reportable.length} enabled agent model selection(s) failed preflight:
|
|
307
|
+
` + `${lines.join(`
|
|
308
|
+
`)}
|
|
309
|
+
` + 'Dispatching these roles will fail permanently ("Model not found"/"Forbidden"). ' + "Fix the effective model configuration in opencode-swarm.json \u2014 the matching swarm override wins over top-level agents.<role>.model. " + "fallback_models entries only serve transient runtime failures; configure a resolvable primary model for the affected role.";
|
|
310
|
+
}
|
|
311
|
+
async function runModelPreflight(config, client, opts) {
|
|
312
|
+
const models = collectEnabledAgentModels(config, opts);
|
|
313
|
+
const catalog = await fetchProviderCatalog(client);
|
|
314
|
+
return resolveAgainstCatalog(models, catalog);
|
|
315
|
+
}
|
|
316
|
+
async function checkSingleModelResolution(model, client) {
|
|
317
|
+
const catalog = await fetchProviderCatalog(client);
|
|
318
|
+
if (catalog === null)
|
|
319
|
+
return "unknown";
|
|
320
|
+
const split = splitModelId(model);
|
|
321
|
+
if (!split)
|
|
322
|
+
return "unknown";
|
|
323
|
+
const providerModels = catalog.get(split.provider);
|
|
324
|
+
if (providerModels === undefined || !providerModels.has(split.model)) {
|
|
325
|
+
return "unresolved";
|
|
326
|
+
}
|
|
327
|
+
return "ok";
|
|
328
|
+
}
|
|
329
|
+
var _internals = {
|
|
330
|
+
providerList: async (client) => {
|
|
331
|
+
let timer;
|
|
332
|
+
try {
|
|
333
|
+
return await Promise.race([
|
|
334
|
+
client.provider.list(),
|
|
335
|
+
new Promise((_, reject) => {
|
|
336
|
+
timer = setTimeout(() => reject(new Error("provider list timed out")), PROVIDER_LIST_TIMEOUT_MS);
|
|
337
|
+
})
|
|
338
|
+
]);
|
|
339
|
+
} finally {
|
|
340
|
+
if (timer)
|
|
341
|
+
clearTimeout(timer);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
export {
|
|
346
|
+
splitModelId,
|
|
347
|
+
sanitizePreflightText,
|
|
348
|
+
runModelPreflight,
|
|
349
|
+
resolveAgainstCatalog,
|
|
350
|
+
invalidateProviderCatalogCache,
|
|
351
|
+
formatModelPreflightWarning,
|
|
352
|
+
fetchProviderCatalog,
|
|
353
|
+
enumerateEnabledAgentRoles,
|
|
354
|
+
collectEnabledAgentModels,
|
|
355
|
+
collectConfiguredAgentModels,
|
|
356
|
+
checkSingleModelResolution,
|
|
357
|
+
_internals,
|
|
358
|
+
PROVIDER_LIST_TIMEOUT_MS
|
|
359
|
+
};
|
|
@@ -71,21 +71,21 @@ import {
|
|
|
71
71
|
sweepStaleDelegations,
|
|
72
72
|
updateCoderSettlement,
|
|
73
73
|
writeDelegationFallback
|
|
74
|
-
} from "./index-
|
|
75
|
-
import"./index-
|
|
74
|
+
} from "./index-1msszzg2.js";
|
|
75
|
+
import"./index-a2hvmc3a.js";
|
|
76
76
|
import"./index-2s7dvzff.js";
|
|
77
77
|
import"./index-ved1325w.js";
|
|
78
78
|
import"./index-w1ydvzef.js";
|
|
79
79
|
import"./index-vvgpgcyn.js";
|
|
80
80
|
import"./index-rdm3px0g.js";
|
|
81
81
|
import"./index-ry16d01s.js";
|
|
82
|
-
import"./index-
|
|
83
|
-
import"./index-
|
|
82
|
+
import"./index-kkrbybgt.js";
|
|
83
|
+
import"./index-dwc1wztn.js";
|
|
84
84
|
import"./index-vzm6zre7.js";
|
|
85
85
|
import"./index-ae75rja9.js";
|
|
86
|
-
import"./index-
|
|
87
|
-
import"./index-
|
|
88
|
-
import"./index-
|
|
86
|
+
import"./index-23mdeh2a.js";
|
|
87
|
+
import"./index-ap6hs8fj.js";
|
|
88
|
+
import"./index-mkpdcbye.js";
|
|
89
89
|
import"./index-1xnse449.js";
|
|
90
90
|
import"./index-c1ggtmpm.js";
|
|
91
91
|
import"./index-ejhxgyvm.js";
|
|
@@ -19,21 +19,21 @@ import {
|
|
|
19
19
|
sweepStale,
|
|
20
20
|
unsubscribe,
|
|
21
21
|
updateSnapshot
|
|
22
|
-
} from "./index-
|
|
23
|
-
import"./index-
|
|
22
|
+
} from "./index-nw3z614g.js";
|
|
23
|
+
import"./index-a2hvmc3a.js";
|
|
24
24
|
import"./index-2s7dvzff.js";
|
|
25
25
|
import"./index-ved1325w.js";
|
|
26
26
|
import"./index-w1ydvzef.js";
|
|
27
27
|
import"./index-vvgpgcyn.js";
|
|
28
28
|
import"./index-rdm3px0g.js";
|
|
29
29
|
import"./index-ry16d01s.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
30
|
+
import"./index-kkrbybgt.js";
|
|
31
|
+
import"./index-dwc1wztn.js";
|
|
32
32
|
import"./index-vzm6zre7.js";
|
|
33
33
|
import"./index-ae75rja9.js";
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
34
|
+
import"./index-23mdeh2a.js";
|
|
35
|
+
import"./index-ap6hs8fj.js";
|
|
36
|
+
import"./index-mkpdcbye.js";
|
|
37
37
|
import"./index-1xnse449.js";
|
|
38
38
|
import"./index-c1ggtmpm.js";
|
|
39
39
|
import"./index-ejhxgyvm.js";
|
|
@@ -83,68 +83,68 @@ import {
|
|
|
83
83
|
withPrWorkflowCheckoutMutationLock,
|
|
84
84
|
withPrWorkflowCheckoutPreparationLock,
|
|
85
85
|
writePrWorkflowAtomicJson
|
|
86
|
-
} from "./index-
|
|
87
|
-
import"./index-
|
|
86
|
+
} from "./index-9eg8f4zm.js";
|
|
87
|
+
import"./index-gtpq64q7.js";
|
|
88
88
|
import"./index-hamqvzqn.js";
|
|
89
|
-
import"./index-
|
|
90
|
-
import"./index-
|
|
91
|
-
import"./index-
|
|
92
|
-
import"./index-
|
|
93
|
-
import"./index-
|
|
89
|
+
import"./index-01r2wrwa.js";
|
|
90
|
+
import"./index-y03jadcy.js";
|
|
91
|
+
import"./index-dkprb20b.js";
|
|
92
|
+
import"./index-0ea0c676.js";
|
|
93
|
+
import"./index-sf51gh68.js";
|
|
94
94
|
import"./index-txdagbh7.js";
|
|
95
|
-
import"./index-
|
|
95
|
+
import"./index-rgfz80gt.js";
|
|
96
96
|
import"./index-6b295cas.js";
|
|
97
|
-
import"./index-
|
|
98
|
-
import"./index-
|
|
99
|
-
import"./index-
|
|
97
|
+
import"./index-x4am0jxt.js";
|
|
98
|
+
import"./index-54sd9bbn.js";
|
|
99
|
+
import"./index-1epynxc4.js";
|
|
100
100
|
import"./index-rdec0y3z.js";
|
|
101
|
-
import"./index-
|
|
101
|
+
import"./index-nw3z614g.js";
|
|
102
102
|
import"./index-cjapb4hy.js";
|
|
103
103
|
import"./index-zsrtt42s.js";
|
|
104
|
-
import"./index-
|
|
105
|
-
import"./index-
|
|
106
|
-
import"./index-
|
|
104
|
+
import"./index-r4vve32m.js";
|
|
105
|
+
import"./index-jrxrjz89.js";
|
|
106
|
+
import"./index-by9wfeja.js";
|
|
107
107
|
import"./index-pt7h91zc.js";
|
|
108
108
|
import"./index-q7sjgr1y.js";
|
|
109
|
-
import"./index-
|
|
110
|
-
import"./index-
|
|
111
|
-
import"./index-
|
|
109
|
+
import"./index-epq8am78.js";
|
|
110
|
+
import"./index-j97nc02q.js";
|
|
111
|
+
import"./index-v4h99xhr.js";
|
|
112
112
|
import {
|
|
113
113
|
PR_REVIEW_BASE_DIMENSION_IDS
|
|
114
|
-
} from "./index-
|
|
115
|
-
import"./index-
|
|
116
|
-
import"./index-
|
|
114
|
+
} from "./index-1msszzg2.js";
|
|
115
|
+
import"./index-hqa71xfm.js";
|
|
116
|
+
import"./index-a2hvmc3a.js";
|
|
117
117
|
import"./index-2s7dvzff.js";
|
|
118
|
-
import"./index-
|
|
119
|
-
import"./index-
|
|
118
|
+
import"./index-4qpz7mpn.js";
|
|
119
|
+
import"./index-s34y6gbh.js";
|
|
120
120
|
import"./index-rtry5xyf.js";
|
|
121
|
-
import"./index-
|
|
121
|
+
import"./index-9s2rp2j5.js";
|
|
122
122
|
import"./index-frcemc0b.js";
|
|
123
123
|
import"./index-0725jpp7.js";
|
|
124
|
-
import"./index-
|
|
125
|
-
import"./index-
|
|
126
|
-
import"./index-
|
|
124
|
+
import"./index-y28np6j9.js";
|
|
125
|
+
import"./index-fsye9ygy.js";
|
|
126
|
+
import"./index-427x3j6p.js";
|
|
127
127
|
import"./index-ved1325w.js";
|
|
128
128
|
import"./index-w1ydvzef.js";
|
|
129
129
|
import"./index-vvgpgcyn.js";
|
|
130
130
|
import"./index-rdm3px0g.js";
|
|
131
131
|
import"./index-ry16d01s.js";
|
|
132
|
-
import"./index-
|
|
133
|
-
import"./index-
|
|
132
|
+
import"./index-kkrbybgt.js";
|
|
133
|
+
import"./index-dwc1wztn.js";
|
|
134
134
|
import"./index-vzm6zre7.js";
|
|
135
135
|
import"./index-ae75rja9.js";
|
|
136
|
-
import"./index-
|
|
137
|
-
import"./index-
|
|
138
|
-
import"./index-
|
|
136
|
+
import"./index-23mdeh2a.js";
|
|
137
|
+
import"./index-ap6hs8fj.js";
|
|
138
|
+
import"./index-mkpdcbye.js";
|
|
139
139
|
import"./index-1xnse449.js";
|
|
140
140
|
import"./index-c1ggtmpm.js";
|
|
141
141
|
import"./index-ejhxgyvm.js";
|
|
142
142
|
import"./index-7g4c7s5r.js";
|
|
143
143
|
import"./index-989v83pb.js";
|
|
144
144
|
import"./index-gx2vp8gx.js";
|
|
145
|
-
import"./index-
|
|
145
|
+
import"./index-6jrn46zy.js";
|
|
146
146
|
import"./index-zxdawwc7.js";
|
|
147
|
-
import"./index-
|
|
147
|
+
import"./index-3ga3ts3h.js";
|
|
148
148
|
import"./index-2t21pv2v.js";
|
|
149
149
|
import"./index-bk5tah7q.js";
|
|
150
150
|
import"./index-gknz3bv1.js";
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
_internals,
|
|
4
4
|
createModelEvaluationExecutor,
|
|
5
5
|
runEvaluation
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
6
|
+
} from "./index-01r2wrwa.js";
|
|
7
|
+
import"./index-sf51gh68.js";
|
|
8
8
|
import"./index-txdagbh7.js";
|
|
9
9
|
import"./index-2s7dvzff.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
import"./index-ap6hs8fj.js";
|
|
11
|
+
import"./index-mkpdcbye.js";
|
|
12
12
|
import"./index-1xnse449.js";
|
|
13
13
|
import"./index-c1ggtmpm.js";
|
|
14
14
|
import"./index-ejhxgyvm.js";
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
alreadyCuratedThisGeneration,
|
|
5
5
|
claimNextScanBatch,
|
|
6
6
|
getScanStatus
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-1epynxc4.js";
|
|
8
|
+
import"./index-dwc1wztn.js";
|
|
9
9
|
import"./index-vzm6zre7.js";
|
|
10
10
|
import"./index-ae75rja9.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
import"./index-23mdeh2a.js";
|
|
12
|
+
import"./index-ap6hs8fj.js";
|
|
13
|
+
import"./index-mkpdcbye.js";
|
|
14
14
|
import"./index-1xnse449.js";
|
|
15
15
|
import"./index-c1ggtmpm.js";
|
|
16
16
|
import"./index-ejhxgyvm.js";
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
resolveGeneratedAgentRole,
|
|
116
116
|
resolveGuardrailsConfig,
|
|
117
117
|
stripKnownSwarmPrefix
|
|
118
|
-
} from "./index-
|
|
118
|
+
} from "./index-3ga3ts3h.js";
|
|
119
119
|
import"./index-2t21pv2v.js";
|
|
120
120
|
import"./index-bk5tah7q.js";
|
|
121
121
|
import"./index-gknz3bv1.js";
|
|
@@ -25,30 +25,30 @@ import {
|
|
|
25
25
|
tombstoneScopeBinding,
|
|
26
26
|
writeScopeBindingToDisk,
|
|
27
27
|
writeScopeToDisk
|
|
28
|
-
} from "./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
28
|
+
} from "./index-y28np6j9.js";
|
|
29
|
+
import"./index-fsye9ygy.js";
|
|
30
|
+
import"./index-427x3j6p.js";
|
|
31
31
|
import"./index-ved1325w.js";
|
|
32
32
|
import"./index-w1ydvzef.js";
|
|
33
33
|
import"./index-vvgpgcyn.js";
|
|
34
34
|
import"./index-rdm3px0g.js";
|
|
35
35
|
import"./index-ry16d01s.js";
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
36
|
+
import"./index-kkrbybgt.js";
|
|
37
|
+
import"./index-dwc1wztn.js";
|
|
38
38
|
import"./index-vzm6zre7.js";
|
|
39
39
|
import"./index-ae75rja9.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
40
|
+
import"./index-23mdeh2a.js";
|
|
41
|
+
import"./index-ap6hs8fj.js";
|
|
42
|
+
import"./index-mkpdcbye.js";
|
|
43
43
|
import"./index-1xnse449.js";
|
|
44
44
|
import"./index-c1ggtmpm.js";
|
|
45
45
|
import"./index-ejhxgyvm.js";
|
|
46
46
|
import"./index-7g4c7s5r.js";
|
|
47
47
|
import"./index-989v83pb.js";
|
|
48
48
|
import"./index-gx2vp8gx.js";
|
|
49
|
-
import"./index-
|
|
49
|
+
import"./index-6jrn46zy.js";
|
|
50
50
|
import"./index-zxdawwc7.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-3ga3ts3h.js";
|
|
52
52
|
import"./index-2t21pv2v.js";
|
|
53
53
|
import"./index-bk5tah7q.js";
|
|
54
54
|
import"./index-gknz3bv1.js";
|