nexus-agents 2.97.1 → 2.99.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/dist/{child-mcp-config-WVPJIK2J.js → child-mcp-config-OWCVT4NN.js} +2 -2
- package/dist/{chunk-D3OT7TOA.js → chunk-3XSEFOI5.js} +3 -3
- package/dist/{chunk-KKVH3PDK.js → chunk-5T6S6HFY.js} +4 -4
- package/dist/{chunk-T5TYWM5S.js → chunk-5WY3N7VX.js} +2 -2
- package/dist/{chunk-6IN4MKDA.js → chunk-6IHEDRKI.js} +7 -7
- package/dist/{chunk-674NONPG.js → chunk-A7XUXJWL.js} +2 -2
- package/dist/{chunk-HZGHPBTV.js → chunk-AH67WRET.js} +2 -2
- package/dist/{chunk-T7IIFT3B.js → chunk-AN3IGMJT.js} +10 -10
- package/dist/{chunk-WXDWDGVL.js → chunk-BKUKBOGV.js} +2 -2
- package/dist/{chunk-GERVGPTF.js → chunk-BO6QUVXI.js} +2 -2
- package/dist/{chunk-OSHCOBDK.js → chunk-CJODZY4U.js} +2 -2
- package/dist/{chunk-HIWO2WWP.js → chunk-DLNCQO6L.js} +2 -2
- package/dist/{chunk-ML4IF3PS.js → chunk-EM7NUGMG.js} +22 -5
- package/dist/{chunk-ML4IF3PS.js.map → chunk-EM7NUGMG.js.map} +1 -1
- package/dist/{chunk-N5656LE3.js → chunk-HBZUXO4Q.js} +2 -2
- package/dist/{chunk-NTBVUWU4.js → chunk-HFNHJZOK.js} +2 -2
- package/dist/{chunk-EY7LL4F4.js → chunk-J545CO5K.js} +2 -2
- package/dist/{chunk-65LE457J.js → chunk-J76KHBF3.js} +2 -2
- package/dist/{chunk-5LGAPYX7.js → chunk-JFFI54DW.js} +12 -2
- package/dist/{chunk-5LGAPYX7.js.map → chunk-JFFI54DW.js.map} +1 -1
- package/dist/{chunk-JTQLV374.js → chunk-M774MKHE.js} +3 -2
- package/dist/chunk-M774MKHE.js.map +1 -0
- package/dist/{chunk-FB6AQ2SF.js → chunk-O6EXYWHP.js} +428 -212
- package/dist/chunk-O6EXYWHP.js.map +1 -0
- package/dist/{chunk-SAUBPHQ7.js → chunk-Q3IFS7UA.js} +4 -4
- package/dist/{chunk-HWCMNFIS.js → chunk-SU7RKNIZ.js} +3 -3
- package/dist/{chunk-7BLBXITB.js → chunk-T5KDRR2I.js} +3 -3
- package/dist/{chunk-FDTIRCSL.js → chunk-UWQ3BALH.js} +2 -2
- package/dist/{chunk-E43RUPLP.js → chunk-V2C2MC6H.js} +3 -3
- package/dist/{chunk-SZNNT2DH.js → chunk-VD4TXDMR.js} +2 -2
- package/dist/{chunk-5F7LHFAU.js → chunk-VPH2M5H7.js} +7 -7
- package/dist/{chunk-Y4TTYQUK.js → chunk-WHFCVKAV.js} +5 -5
- package/dist/{chunk-JX6VL7JF.js → chunk-WYDK6V7W.js} +3 -3
- package/dist/{chunk-UNOOL6EN.js → chunk-XO25FS24.js} +2 -2
- package/dist/{chunk-P2BKWVKF.js → chunk-YREYQSYA.js} +3 -3
- package/dist/chunk-YREYQSYA.js.map +1 -0
- package/dist/{chunk-IHKPGTF3.js → chunk-ZOBDTJNG.js} +4 -4
- package/dist/{chunk-OKRTOMKX.js → chunk-ZPCDZMLK.js} +2 -2
- package/dist/{cli-circuit-breaker-STKW4DTL.js → cli-circuit-breaker-IPNNNVIT.js} +4 -4
- package/dist/cli.js +41 -39
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-POFAM7T4.js → composite-router-JJNQIHX6.js} +2 -2
- package/dist/{consensus-vote-F6HORSU6.js → consensus-vote-5D7FNWYM.js} +13 -13
- package/dist/{context-retriever-H22L3WFV.js → context-retriever-2MOJ446P.js} +6 -6
- package/dist/{doctor-deep-HGAC6N5Y.js → doctor-deep-D6E5IWXB.js} +3 -3
- package/dist/{expert-bridge-IAQPOJAQ.js → expert-bridge-EOVHUCJ4.js} +4 -4
- package/dist/{factory-ZIZYUDKH.js → factory-NJRJAZKK.js} +5 -5
- package/dist/{factory-P2SQS7UM.js → factory-UCRIJY6Y.js} +5 -5
- package/dist/{improvement-review-G2HAMGZP.js → improvement-review-IWV2BMR7.js} +4 -4
- package/dist/index.js +28 -28
- package/dist/{init-opencode-RHCYZDZW.js → init-opencode-PB4G7RJR.js} +5 -5
- package/dist/{issue-triage-VVNQIQW5.js → issue-triage-EMYHDDTR.js} +5 -5
- package/dist/{pr-reviewer-helpers-UN7RDPDN.js → pr-reviewer-helpers-DZQDKMMF.js} +4 -4
- package/dist/{registry-command-OVRRKYHO.js → registry-command-AX7Z4K4W.js} +47 -243
- package/dist/registry-command-AX7Z4K4W.js.map +1 -0
- package/dist/{repo-security-plan-X74TBYOV.js → repo-security-plan-N2GNWFER.js} +3 -3
- package/dist/{research-helpers-synthesize-OSP6FGNV.js → research-helpers-synthesize-OKNU245Z.js} +3 -3
- package/dist/{routing-memory-5T5QJF47.js → routing-memory-3QXWGWB5.js} +2 -2
- package/dist/{session-memory-X7CJ6X4A.js → session-memory-AK4AJXGI.js} +3 -3
- package/dist/{setup-command-7KP3O3P3.js → setup-command-PHTP43V7.js} +11 -11
- package/dist/{setup-config-YVIKUNOB.js → setup-config-ANAFKZGE.js} +3 -3
- package/dist/{setup-custom-api-FLV4SELI.js → setup-custom-api-FUA2ZUDD.js} +4 -4
- package/dist/{tool-memory-QNEAKRKV.js → tool-memory-ZP3EMUP5.js} +5 -5
- package/dist/{weather-report-SUVIXWKI.js → weather-report-54XDO6GO.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-FB6AQ2SF.js.map +0 -1
- package/dist/chunk-JTQLV374.js.map +0 -1
- package/dist/chunk-P2BKWVKF.js.map +0 -1
- package/dist/registry-command-OVRRKYHO.js.map +0 -1
- /package/dist/{child-mcp-config-WVPJIK2J.js.map → child-mcp-config-OWCVT4NN.js.map} +0 -0
- /package/dist/{chunk-D3OT7TOA.js.map → chunk-3XSEFOI5.js.map} +0 -0
- /package/dist/{chunk-KKVH3PDK.js.map → chunk-5T6S6HFY.js.map} +0 -0
- /package/dist/{chunk-T5TYWM5S.js.map → chunk-5WY3N7VX.js.map} +0 -0
- /package/dist/{chunk-6IN4MKDA.js.map → chunk-6IHEDRKI.js.map} +0 -0
- /package/dist/{chunk-674NONPG.js.map → chunk-A7XUXJWL.js.map} +0 -0
- /package/dist/{chunk-HZGHPBTV.js.map → chunk-AH67WRET.js.map} +0 -0
- /package/dist/{chunk-T7IIFT3B.js.map → chunk-AN3IGMJT.js.map} +0 -0
- /package/dist/{chunk-WXDWDGVL.js.map → chunk-BKUKBOGV.js.map} +0 -0
- /package/dist/{chunk-GERVGPTF.js.map → chunk-BO6QUVXI.js.map} +0 -0
- /package/dist/{chunk-OSHCOBDK.js.map → chunk-CJODZY4U.js.map} +0 -0
- /package/dist/{chunk-HIWO2WWP.js.map → chunk-DLNCQO6L.js.map} +0 -0
- /package/dist/{chunk-N5656LE3.js.map → chunk-HBZUXO4Q.js.map} +0 -0
- /package/dist/{chunk-NTBVUWU4.js.map → chunk-HFNHJZOK.js.map} +0 -0
- /package/dist/{chunk-EY7LL4F4.js.map → chunk-J545CO5K.js.map} +0 -0
- /package/dist/{chunk-65LE457J.js.map → chunk-J76KHBF3.js.map} +0 -0
- /package/dist/{chunk-SAUBPHQ7.js.map → chunk-Q3IFS7UA.js.map} +0 -0
- /package/dist/{chunk-HWCMNFIS.js.map → chunk-SU7RKNIZ.js.map} +0 -0
- /package/dist/{chunk-7BLBXITB.js.map → chunk-T5KDRR2I.js.map} +0 -0
- /package/dist/{chunk-FDTIRCSL.js.map → chunk-UWQ3BALH.js.map} +0 -0
- /package/dist/{chunk-E43RUPLP.js.map → chunk-V2C2MC6H.js.map} +0 -0
- /package/dist/{chunk-SZNNT2DH.js.map → chunk-VD4TXDMR.js.map} +0 -0
- /package/dist/{chunk-5F7LHFAU.js.map → chunk-VPH2M5H7.js.map} +0 -0
- /package/dist/{chunk-Y4TTYQUK.js.map → chunk-WHFCVKAV.js.map} +0 -0
- /package/dist/{chunk-JX6VL7JF.js.map → chunk-WYDK6V7W.js.map} +0 -0
- /package/dist/{chunk-UNOOL6EN.js.map → chunk-XO25FS24.js.map} +0 -0
- /package/dist/{chunk-IHKPGTF3.js.map → chunk-ZOBDTJNG.js.map} +0 -0
- /package/dist/{chunk-OKRTOMKX.js.map → chunk-ZPCDZMLK.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-STKW4DTL.js.map → cli-circuit-breaker-IPNNNVIT.js.map} +0 -0
- /package/dist/{composite-router-POFAM7T4.js.map → composite-router-JJNQIHX6.js.map} +0 -0
- /package/dist/{consensus-vote-F6HORSU6.js.map → consensus-vote-5D7FNWYM.js.map} +0 -0
- /package/dist/{context-retriever-H22L3WFV.js.map → context-retriever-2MOJ446P.js.map} +0 -0
- /package/dist/{doctor-deep-HGAC6N5Y.js.map → doctor-deep-D6E5IWXB.js.map} +0 -0
- /package/dist/{expert-bridge-IAQPOJAQ.js.map → expert-bridge-EOVHUCJ4.js.map} +0 -0
- /package/dist/{factory-P2SQS7UM.js.map → factory-NJRJAZKK.js.map} +0 -0
- /package/dist/{factory-ZIZYUDKH.js.map → factory-UCRIJY6Y.js.map} +0 -0
- /package/dist/{improvement-review-G2HAMGZP.js.map → improvement-review-IWV2BMR7.js.map} +0 -0
- /package/dist/{init-opencode-RHCYZDZW.js.map → init-opencode-PB4G7RJR.js.map} +0 -0
- /package/dist/{issue-triage-VVNQIQW5.js.map → issue-triage-EMYHDDTR.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-UN7RDPDN.js.map → pr-reviewer-helpers-DZQDKMMF.js.map} +0 -0
- /package/dist/{repo-security-plan-X74TBYOV.js.map → repo-security-plan-N2GNWFER.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-OSP6FGNV.js.map → research-helpers-synthesize-OKNU245Z.js.map} +0 -0
- /package/dist/{routing-memory-5T5QJF47.js.map → routing-memory-3QXWGWB5.js.map} +0 -0
- /package/dist/{session-memory-X7CJ6X4A.js.map → session-memory-AK4AJXGI.js.map} +0 -0
- /package/dist/{setup-command-7KP3O3P3.js.map → setup-command-PHTP43V7.js.map} +0 -0
- /package/dist/{setup-config-YVIKUNOB.js.map → setup-config-ANAFKZGE.js.map} +0 -0
- /package/dist/{setup-custom-api-FLV4SELI.js.map → setup-custom-api-FUA2ZUDD.js.map} +0 -0
- /package/dist/{tool-memory-QNEAKRKV.js.map → tool-memory-ZP3EMUP5.js.map} +0 -0
- /package/dist/{weather-report-SUVIXWKI.js.map → weather-report-54XDO6GO.js.map} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelCapabilitySchema,
|
|
3
3
|
createLogger,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
getDefaultRegistry,
|
|
5
|
+
loadGeneratedRegistryEntries
|
|
6
|
+
} from "./chunk-M774MKHE.js";
|
|
6
7
|
import {
|
|
7
8
|
nexusDataPath
|
|
8
9
|
} from "./chunk-CH7QIDHQ.js";
|
|
@@ -10,14 +11,8 @@ import "./chunk-PR4QN5HX.js";
|
|
|
10
11
|
|
|
11
12
|
// src/cli/registry-command.ts
|
|
12
13
|
import { createHash } from "crypto";
|
|
13
|
-
import { existsSync as
|
|
14
|
-
import { dirname
|
|
15
|
-
|
|
16
|
-
// src/config/capability-discovery.ts
|
|
17
|
-
import { readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
18
|
-
import { fileURLToPath } from "url";
|
|
19
|
-
import { dirname, join } from "path";
|
|
20
|
-
import { z } from "zod";
|
|
14
|
+
import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
15
|
+
import { dirname } from "path";
|
|
21
16
|
|
|
22
17
|
// src/config/capability-overlay.ts
|
|
23
18
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
@@ -179,208 +174,6 @@ function validateEntries(rawEntries, log, path) {
|
|
|
179
174
|
return { entries, rejections };
|
|
180
175
|
}
|
|
181
176
|
|
|
182
|
-
// src/config/capability-discovery.ts
|
|
183
|
-
var GeneratedProvenanceSchema = z.object({
|
|
184
|
-
source: z.enum(["models.dev", "litellm"]),
|
|
185
|
-
fetchedAt: z.string(),
|
|
186
|
-
upstreamUrl: z.string()
|
|
187
|
-
});
|
|
188
|
-
var GeneratedModelEntrySchema = z.object({
|
|
189
|
-
id: z.string().min(1),
|
|
190
|
-
displayName: z.string().min(1),
|
|
191
|
-
provider: z.string().min(1),
|
|
192
|
-
contextWindow: z.number().int().positive(),
|
|
193
|
-
pricing: z.object({
|
|
194
|
-
inputPer1M: z.number().nonnegative(),
|
|
195
|
-
outputPer1M: z.number().nonnegative()
|
|
196
|
-
}).optional(),
|
|
197
|
-
maxOutputTokens: z.number().int().positive().optional(),
|
|
198
|
-
deprecated: z.boolean().optional(),
|
|
199
|
-
provenance: GeneratedProvenanceSchema
|
|
200
|
-
});
|
|
201
|
-
var GeneratedRegistrySchema = z.object({
|
|
202
|
-
version: z.literal(1),
|
|
203
|
-
generatedAt: z.string(),
|
|
204
|
-
entryCount: z.number().int().nonnegative(),
|
|
205
|
-
entries: z.array(GeneratedModelEntrySchema)
|
|
206
|
-
});
|
|
207
|
-
var LEGACY_200K_DEFAULT = { contextWindow: 2e5 };
|
|
208
|
-
var FAIL_CLOSED_DEFAULT = { contextWindow: 8192 };
|
|
209
|
-
var CapabilityDiscovery = class {
|
|
210
|
-
canonical;
|
|
211
|
-
generated;
|
|
212
|
-
overlay;
|
|
213
|
-
fallback;
|
|
214
|
-
logger;
|
|
215
|
-
generatedById;
|
|
216
|
-
constructor(config = {}) {
|
|
217
|
-
this.canonical = config.canonical ?? getInTreeCapabilitiesMatrix();
|
|
218
|
-
this.generated = config.generated ?? null;
|
|
219
|
-
this.overlay = config.overlay ?? [];
|
|
220
|
-
this.fallback = config.conservativeDefault ?? LEGACY_200K_DEFAULT;
|
|
221
|
-
this.logger = config.logger ?? createLogger({ component: "capability-discovery" });
|
|
222
|
-
this.generatedById = /* @__PURE__ */ new Map();
|
|
223
|
-
if (this.generated !== null) {
|
|
224
|
-
for (const entry of this.generated.entries) {
|
|
225
|
-
this.generatedById.set(entry.id, entry);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
/** Synchronously resolve a model id through the four-tier chain. */
|
|
230
|
-
resolve(modelId) {
|
|
231
|
-
const t3 = this.lookupOverlay(modelId);
|
|
232
|
-
if (t3 !== void 0) return this.fromCanonical("t3", t3);
|
|
233
|
-
const t1 = this.lookupCanonical(modelId);
|
|
234
|
-
if (t1 !== void 0) return this.fromCanonical("t1", t1);
|
|
235
|
-
const t2 = this.lookupGenerated(modelId);
|
|
236
|
-
if (t2 !== void 0) return this.fromGenerated("t2", t2);
|
|
237
|
-
return this.fromFallback(modelId);
|
|
238
|
-
}
|
|
239
|
-
/** Exposes the configured fallback for testing / doctor command. */
|
|
240
|
-
getConservativeDefault() {
|
|
241
|
-
return this.fallback;
|
|
242
|
-
}
|
|
243
|
-
/** Count of entries per tier — used by `registry doctor` (#2179). */
|
|
244
|
-
getTierCounts() {
|
|
245
|
-
return {
|
|
246
|
-
t3: this.overlay.length,
|
|
247
|
-
t1: this.canonical.models.length,
|
|
248
|
-
t2: this.generatedById.size,
|
|
249
|
-
t4: 0
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
// -------------------------------------------------------------------------
|
|
253
|
-
// Tier lookups
|
|
254
|
-
// -------------------------------------------------------------------------
|
|
255
|
-
lookupOverlay(modelId) {
|
|
256
|
-
return this.overlay.find((m) => m.id === modelId);
|
|
257
|
-
}
|
|
258
|
-
lookupCanonical(modelId) {
|
|
259
|
-
return this.canonical.models.find((m) => m.id === modelId);
|
|
260
|
-
}
|
|
261
|
-
lookupGenerated(modelId) {
|
|
262
|
-
const direct = this.generatedById.get(modelId);
|
|
263
|
-
if (direct !== void 0) return direct;
|
|
264
|
-
for (const candidate of buildAliasCandidates(modelId)) {
|
|
265
|
-
const hit = this.generatedById.get(candidate);
|
|
266
|
-
if (hit !== void 0) return hit;
|
|
267
|
-
}
|
|
268
|
-
return void 0;
|
|
269
|
-
}
|
|
270
|
-
// -------------------------------------------------------------------------
|
|
271
|
-
// Result shaping
|
|
272
|
-
// -------------------------------------------------------------------------
|
|
273
|
-
fromCanonical(tier, entry) {
|
|
274
|
-
const base = {
|
|
275
|
-
tier,
|
|
276
|
-
id: entry.id,
|
|
277
|
-
displayName: entry.displayName,
|
|
278
|
-
provider: entry.provider,
|
|
279
|
-
contextWindow: entry.contextWindow,
|
|
280
|
-
canonical: entry,
|
|
281
|
-
...entry.pricing !== void 0 ? { pricing: entry.pricing } : {},
|
|
282
|
-
...entry.maxOutputTokens !== void 0 ? { maxOutputTokens: entry.maxOutputTokens } : {},
|
|
283
|
-
...entry.deprecated !== void 0 ? { deprecated: entry.deprecated } : {}
|
|
284
|
-
};
|
|
285
|
-
return base;
|
|
286
|
-
}
|
|
287
|
-
fromGenerated(tier, entry) {
|
|
288
|
-
return {
|
|
289
|
-
tier,
|
|
290
|
-
id: entry.id,
|
|
291
|
-
displayName: entry.displayName,
|
|
292
|
-
provider: entry.provider,
|
|
293
|
-
contextWindow: entry.contextWindow,
|
|
294
|
-
provenance: entry.provenance,
|
|
295
|
-
...entry.pricing !== void 0 ? { pricing: entry.pricing } : {},
|
|
296
|
-
...entry.maxOutputTokens !== void 0 ? { maxOutputTokens: entry.maxOutputTokens } : {},
|
|
297
|
-
...entry.deprecated !== void 0 ? { deprecated: entry.deprecated } : {}
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
fromFallback(modelId) {
|
|
301
|
-
this.logger.warn("Model resolved at T4 conservative default", {
|
|
302
|
-
modelId,
|
|
303
|
-
contextWindow: this.fallback.contextWindow
|
|
304
|
-
});
|
|
305
|
-
return {
|
|
306
|
-
tier: "t4",
|
|
307
|
-
id: modelId,
|
|
308
|
-
displayName: modelId,
|
|
309
|
-
provider: "unknown",
|
|
310
|
-
contextWindow: this.fallback.contextWindow,
|
|
311
|
-
...this.fallback.maxOutputTokens !== void 0 ? { maxOutputTokens: this.fallback.maxOutputTokens } : {}
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
var KNOWN_PROVIDER_PREFIXES = [
|
|
316
|
-
"amazon-bedrock",
|
|
317
|
-
"google-vertex",
|
|
318
|
-
"azure-openai",
|
|
319
|
-
"openrouter",
|
|
320
|
-
"anthropic",
|
|
321
|
-
"openai",
|
|
322
|
-
"google",
|
|
323
|
-
"deepseek"
|
|
324
|
-
];
|
|
325
|
-
function buildAliasCandidates(modelId) {
|
|
326
|
-
const seen = /* @__PURE__ */ new Set([modelId]);
|
|
327
|
-
for (const prefix of KNOWN_PROVIDER_PREFIXES) {
|
|
328
|
-
seen.add(`${prefix}/${modelId}`);
|
|
329
|
-
}
|
|
330
|
-
const slash = modelId.indexOf("/");
|
|
331
|
-
if (slash !== -1) {
|
|
332
|
-
const tail = modelId.slice(slash + 1);
|
|
333
|
-
for (const prefix of KNOWN_PROVIDER_PREFIXES) {
|
|
334
|
-
seen.add(`${prefix}/${tail}`);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
seen.delete(modelId);
|
|
338
|
-
return [...seen];
|
|
339
|
-
}
|
|
340
|
-
function defaultGeneratedRegistryPath() {
|
|
341
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
342
|
-
return join(here, "model-registry.generated.json");
|
|
343
|
-
}
|
|
344
|
-
function loadBundledGeneratedRegistry(path = defaultGeneratedRegistryPath(), logger) {
|
|
345
|
-
const log = logger ?? createLogger({ component: "capability-discovery" });
|
|
346
|
-
if (!existsSync2(path)) {
|
|
347
|
-
log.warn("T2 generated registry file missing; falling back to T1 + T4", { path });
|
|
348
|
-
return null;
|
|
349
|
-
}
|
|
350
|
-
let raw;
|
|
351
|
-
try {
|
|
352
|
-
raw = JSON.parse(readFileSync2(path, "utf-8"));
|
|
353
|
-
} catch (err) {
|
|
354
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
355
|
-
log.warn("T2 generated registry JSON parse failed; falling back to T1 + T4", {
|
|
356
|
-
path,
|
|
357
|
-
errorMessage: error.message
|
|
358
|
-
});
|
|
359
|
-
return null;
|
|
360
|
-
}
|
|
361
|
-
const parsed = GeneratedRegistrySchema.safeParse(raw);
|
|
362
|
-
if (!parsed.success) {
|
|
363
|
-
log.warn("T2 generated registry schema validation failed; falling back to T1 + T4", {
|
|
364
|
-
path,
|
|
365
|
-
errorMessage: parsed.error.message
|
|
366
|
-
});
|
|
367
|
-
return null;
|
|
368
|
-
}
|
|
369
|
-
return parsed.data;
|
|
370
|
-
}
|
|
371
|
-
var globalDiscovery;
|
|
372
|
-
function getCapabilityDiscovery() {
|
|
373
|
-
globalDiscovery ??= new CapabilityDiscovery({
|
|
374
|
-
generated: loadBundledGeneratedRegistry(),
|
|
375
|
-
overlay: loadCapabilityOverlay().entries,
|
|
376
|
-
// Fail-closed default (#2177): unknown models get 8 K context and a
|
|
377
|
-
// structured warn instead of the silent 200 K fall-through the legacy
|
|
378
|
-
// getModelContextWindow used to return.
|
|
379
|
-
conservativeDefault: FAIL_CLOSED_DEFAULT
|
|
380
|
-
});
|
|
381
|
-
return globalDiscovery;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
177
|
// src/cli/registry-command.ts
|
|
385
178
|
var VALID_SUBCOMMANDS = ["doctor", "refresh"];
|
|
386
179
|
function isValidRegistrySubcommand(v) {
|
|
@@ -390,6 +183,14 @@ async function registryCommand(subcommand, options = {}) {
|
|
|
390
183
|
if (subcommand === "doctor") return doctorCommand(options);
|
|
391
184
|
return refreshCommand(options);
|
|
392
185
|
}
|
|
186
|
+
var UNKNOWN_MODEL_CONTEXT_WINDOW = 8192;
|
|
187
|
+
var ENTRY_SOURCES = [
|
|
188
|
+
"in-tree",
|
|
189
|
+
"models-dev",
|
|
190
|
+
"manifest",
|
|
191
|
+
"derived",
|
|
192
|
+
"generated"
|
|
193
|
+
];
|
|
393
194
|
function doctorCommand(options) {
|
|
394
195
|
const report = buildDoctorReport(options);
|
|
395
196
|
if (options.json === true) {
|
|
@@ -398,18 +199,26 @@ function doctorCommand(options) {
|
|
|
398
199
|
return { text: formatDoctorReport(report), exitCode: 0 };
|
|
399
200
|
}
|
|
400
201
|
function buildDoctorReport(options) {
|
|
401
|
-
const
|
|
402
|
-
const
|
|
202
|
+
const entries = getDefaultRegistry().allEntries();
|
|
203
|
+
const sourceCounts = {
|
|
204
|
+
"in-tree": 0,
|
|
205
|
+
"models-dev": 0,
|
|
206
|
+
manifest: 0,
|
|
207
|
+
derived: 0,
|
|
208
|
+
generated: 0
|
|
209
|
+
};
|
|
210
|
+
for (const entry of entries) {
|
|
211
|
+
sourceCounts[entry.source] += 1;
|
|
212
|
+
}
|
|
213
|
+
const generated = loadGeneratedRegistryEntries();
|
|
403
214
|
const overlay = loadCapabilityOverlay(options.overlayPath ?? process.env);
|
|
404
|
-
const discovery = getCapabilityDiscovery();
|
|
405
|
-
const fallback = discovery.getConservativeDefault();
|
|
406
215
|
return {
|
|
407
|
-
|
|
216
|
+
sourceCounts,
|
|
217
|
+
totalEntries: entries.length,
|
|
408
218
|
bundled: {
|
|
409
|
-
path:
|
|
410
|
-
|
|
411
|
-
entryCount:
|
|
412
|
-
generatedAt: bundled !== null ? bundled.generatedAt : null
|
|
219
|
+
path: generated.path,
|
|
220
|
+
status: generated.status,
|
|
221
|
+
entryCount: generated.entries.length
|
|
413
222
|
},
|
|
414
223
|
overlay: {
|
|
415
224
|
path: overlay.path,
|
|
@@ -422,9 +231,8 @@ function buildDoctorReport(options) {
|
|
|
422
231
|
})),
|
|
423
232
|
envOverride: process.env[OVERLAY_ENV_VAR]
|
|
424
233
|
},
|
|
425
|
-
|
|
426
|
-
contextWindow:
|
|
427
|
-
maxOutputTokens: fallback.maxOutputTokens ?? null
|
|
234
|
+
unknownIdFallback: {
|
|
235
|
+
contextWindow: UNKNOWN_MODEL_CONTEXT_WINDOW
|
|
428
236
|
}
|
|
429
237
|
};
|
|
430
238
|
}
|
|
@@ -433,20 +241,17 @@ function formatDoctorReport(r) {
|
|
|
433
241
|
lines.push("nexus-agents registry doctor");
|
|
434
242
|
lines.push("============================");
|
|
435
243
|
lines.push("");
|
|
436
|
-
lines.push(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
244
|
+
lines.push(`Registry entries by source (total ${String(r.totalEntries)}):`);
|
|
245
|
+
for (const source of ENTRY_SOURCES) {
|
|
246
|
+
lines.push(` ${source.padEnd(11)}: ${String(r.sourceCounts[source])}`);
|
|
247
|
+
}
|
|
440
248
|
lines.push("");
|
|
441
|
-
lines.push("
|
|
249
|
+
lines.push("Bundled generated registry (long-tail breadth tier):");
|
|
442
250
|
lines.push(` path : ${r.bundled.path}`);
|
|
443
|
-
lines.push(`
|
|
444
|
-
|
|
445
|
-
lines.push(` entryCount : ${String(r.bundled.entryCount ?? "?")}`);
|
|
446
|
-
lines.push(` generatedAt : ${r.bundled.generatedAt ?? "?"}`);
|
|
447
|
-
}
|
|
251
|
+
lines.push(` status : ${r.bundled.status}`);
|
|
252
|
+
lines.push(` entryCount : ${String(r.bundled.entryCount)}`);
|
|
448
253
|
lines.push("");
|
|
449
|
-
lines.push("T3 user overlay:");
|
|
254
|
+
lines.push("T3 user overlay (reported for inspection):");
|
|
450
255
|
lines.push(` path : ${r.overlay.path}`);
|
|
451
256
|
lines.push(` status : ${r.overlay.status}`);
|
|
452
257
|
lines.push(` entryCount : ${String(r.overlay.entryCount)}`);
|
|
@@ -459,11 +264,8 @@ function formatDoctorReport(r) {
|
|
|
459
264
|
}
|
|
460
265
|
}
|
|
461
266
|
lines.push("");
|
|
462
|
-
lines.push("
|
|
463
|
-
lines.push(` contextWindow : ${String(r.
|
|
464
|
-
if (r.conservativeDefault.maxOutputTokens !== null) {
|
|
465
|
-
lines.push(` maxOutputTokens: ${String(r.conservativeDefault.maxOutputTokens)}`);
|
|
466
|
-
}
|
|
267
|
+
lines.push("Unknown-id fallback (id resolves in no source):");
|
|
268
|
+
lines.push(` contextWindow : ${String(r.unknownIdFallback.contextWindow)}`);
|
|
467
269
|
return lines.join("\n");
|
|
468
270
|
}
|
|
469
271
|
var MAX_REFRESH_BYTES = 5 * 1024 * 1024;
|
|
@@ -525,7 +327,7 @@ async function refreshCommand(options) {
|
|
|
525
327
|
if (options.dryRun === true) {
|
|
526
328
|
return { text: formatRefreshReport("would write to", source, artifact, dest), exitCode: 0 };
|
|
527
329
|
}
|
|
528
|
-
mkdirSync(
|
|
330
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
529
331
|
writeFileSync(dest, artifact.body, "utf-8");
|
|
530
332
|
return {
|
|
531
333
|
text: formatRefreshReport("wrote to", source, artifact, dest, [
|
|
@@ -559,7 +361,9 @@ function formatRegistryUsage() {
|
|
|
559
361
|
return [
|
|
560
362
|
"Usage:",
|
|
561
363
|
" nexus-agents registry doctor [--json]",
|
|
562
|
-
" Inspect the
|
|
364
|
+
" Inspect the merged ModelRegistry: per-source entry counts, the",
|
|
365
|
+
" bundled generated registry, the user overlay, and the unknown-id",
|
|
366
|
+
" fallback contextWindow.",
|
|
563
367
|
"",
|
|
564
368
|
" nexus-agents registry refresh --source=<url> [--dry-run]",
|
|
565
369
|
" Download a signed model-registry.generated.json from <url>,",
|
|
@@ -575,4 +379,4 @@ export {
|
|
|
575
379
|
isValidRegistrySubcommand,
|
|
576
380
|
registryCommand
|
|
577
381
|
};
|
|
578
|
-
//# sourceMappingURL=registry-command-
|
|
382
|
+
//# sourceMappingURL=registry-command-AX7Z4K4W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/registry-command.ts","../src/config/capability-overlay.ts"],"sourcesContent":["/**\n * `nexus-agents registry` CLI subcommands (epic #2174 / issue #2179).\n *\n * Two subcommands:\n *\n * - `doctor` — inspect the ModelRegistry: effective per-source entry counts,\n * the bundled generated registry path/status, the user overlay (reported for\n * inspection), and the unknown-id fallback contextWindow. Surfaces whatever\n * overlay parse rejections occurred at load. Read-only. (#3293 migrated this\n * off the deleted CapabilityDiscovery four-tier chain.)\n *\n * - `refresh` — download a signed `model-registry.generated.json` from a\n * URL, SHA256-verify against a `.sha256` sidecar, write to the user's\n * overlay location. Requires `--source=<url>` today; the GitHub-latest-\n * release automation is #2180's concern.\n *\n * No runtime hot path touches the network — refresh is a one-shot,\n * user-initiated operation.\n *\n * @module cli/registry-command\n */\n\nimport { createHash } from 'node:crypto';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { nexusDataPath } from '../config/nexus-data-dir.js';\n\nimport { getDefaultRegistry, type EntrySource } from '../config/model-registry.js';\nimport { loadGeneratedRegistryEntries } from '../config/models-generated-loader.js';\nimport {\n OVERLAY_ENV_VAR,\n OVERLAY_MAX_BYTES,\n defaultOverlayPath,\n loadCapabilityOverlay,\n resolveOverlayPath,\n} from '../config/capability-overlay.js';\n\n// ---------------------------------------------------------------------------\n// Dispatch\n// ---------------------------------------------------------------------------\n\nexport type RegistrySubcommand = 'doctor' | 'refresh';\n\nconst VALID_SUBCOMMANDS: readonly RegistrySubcommand[] = ['doctor', 'refresh'];\n\nexport function isValidRegistrySubcommand(v: string | undefined): v is RegistrySubcommand {\n return v !== undefined && (VALID_SUBCOMMANDS as readonly string[]).includes(v);\n}\n\nexport interface RegistryCommandOptions {\n readonly json?: boolean;\n readonly source?: string;\n readonly dryRun?: boolean;\n readonly overlayPath?: string;\n /** For tests: a fetch function. Defaults to `globalThis.fetch`. */\n readonly fetchImpl?: typeof fetch;\n /** For tests: override the default destination path. */\n readonly destPath?: string;\n}\n\nexport interface RegistryCommandResult {\n readonly text: string;\n readonly exitCode: number;\n}\n\nexport async function registryCommand(\n subcommand: RegistrySubcommand,\n options: RegistryCommandOptions = {}\n): Promise<RegistryCommandResult> {\n if (subcommand === 'doctor') return doctorCommand(options);\n return refreshCommand(options);\n}\n\n// ---------------------------------------------------------------------------\n// doctor\n// ---------------------------------------------------------------------------\n\n/**\n * ContextWindow returned for an id no registry source resolves. This is the\n * old `FAIL_CLOSED_DEFAULT.contextWindow` value (#2177), preserved here after\n * the CapabilityDiscovery four-tier chain was deleted in #3293.\n */\nconst UNKNOWN_MODEL_CONTEXT_WINDOW = 8192;\n\n/** Every registry source, in report order. */\nconst ENTRY_SOURCES: readonly EntrySource[] = [\n 'in-tree',\n 'models-dev',\n 'manifest',\n 'derived',\n 'generated',\n];\n\ninterface DoctorReport {\n /** Effective per-source counts over `getDefaultRegistry().allEntries()`. */\n readonly sourceCounts: Record<EntrySource, number>;\n readonly totalEntries: number;\n readonly bundled: {\n readonly path: string;\n readonly status: 'loaded' | 'missing' | 'malformed';\n readonly entryCount: number;\n };\n readonly overlay: {\n readonly path: string;\n readonly status: 'missing' | 'empty' | 'malformed' | 'too-large' | 'loaded';\n readonly entryCount: number;\n readonly rejections: readonly { index: number; id?: string; reason: string }[];\n readonly envOverride: string | undefined;\n };\n readonly unknownIdFallback: {\n readonly contextWindow: number;\n };\n}\n\nfunction doctorCommand(options: RegistryCommandOptions): RegistryCommandResult {\n const report = buildDoctorReport(options);\n if (options.json === true) {\n return { text: JSON.stringify(report, null, 2), exitCode: 0 };\n }\n return { text: formatDoctorReport(report), exitCode: 0 };\n}\n\nfunction buildDoctorReport(options: RegistryCommandOptions): DoctorReport {\n // Effective per-source counts over the fully-merged registry: dedup/override\n // across tiers has already happened, so `allEntries()` reflects what actually\n // wins, grouped by the surviving entry's `source`.\n const entries = getDefaultRegistry().allEntries();\n const sourceCounts: Record<EntrySource, number> = {\n 'in-tree': 0,\n 'models-dev': 0,\n manifest: 0,\n derived: 0,\n generated: 0,\n };\n for (const entry of entries) {\n sourceCounts[entry.source] += 1;\n }\n\n // The bundled generated catalog (long-tail breadth tier) — reported from the\n // same loader the registry ingests, so the path/status here matches reality.\n const generated = loadGeneratedRegistryEntries();\n\n // User overlay is reported for inspection only; the registry consumes the\n // operator manifest, not this YAML overlay (kept by manifest-overlay.ts).\n const overlay = loadCapabilityOverlay(options.overlayPath ?? process.env);\n\n return {\n sourceCounts,\n totalEntries: entries.length,\n bundled: {\n path: generated.path,\n status: generated.status,\n entryCount: generated.entries.length,\n },\n overlay: {\n path: overlay.path,\n status: overlay.status,\n entryCount: overlay.entries.length,\n rejections: overlay.rejections.map((r) => ({\n index: r.index,\n ...(r.id !== undefined ? { id: r.id } : {}),\n reason: r.reason,\n })),\n envOverride: process.env[OVERLAY_ENV_VAR],\n },\n unknownIdFallback: {\n contextWindow: UNKNOWN_MODEL_CONTEXT_WINDOW,\n },\n };\n}\n\nfunction formatDoctorReport(r: DoctorReport): string {\n const lines: string[] = [];\n lines.push('nexus-agents registry doctor');\n lines.push('============================');\n lines.push('');\n lines.push(`Registry entries by source (total ${String(r.totalEntries)}):`);\n for (const source of ENTRY_SOURCES) {\n lines.push(` ${source.padEnd(11)}: ${String(r.sourceCounts[source])}`);\n }\n lines.push('');\n lines.push('Bundled generated registry (long-tail breadth tier):');\n lines.push(` path : ${r.bundled.path}`);\n lines.push(` status : ${r.bundled.status}`);\n lines.push(` entryCount : ${String(r.bundled.entryCount)}`);\n lines.push('');\n // User overlay reported for inspection; not consumed by the merged registry.\n lines.push('T3 user overlay (reported for inspection):');\n lines.push(` path : ${r.overlay.path}`);\n lines.push(` status : ${r.overlay.status}`);\n lines.push(` entryCount : ${String(r.overlay.entryCount)}`);\n lines.push(` env override: ${r.overlay.envOverride ?? '(not set)'}`);\n if (r.overlay.rejections.length > 0) {\n lines.push(' rejections :');\n for (const rej of r.overlay.rejections) {\n const idPart = rej.id !== undefined ? ` id=${rej.id}` : '';\n lines.push(` - [${String(rej.index)}]${idPart} ${rej.reason}`);\n }\n }\n lines.push('');\n lines.push('Unknown-id fallback (id resolves in no source):');\n lines.push(` contextWindow : ${String(r.unknownIdFallback.contextWindow)}`);\n return lines.join('\\n');\n}\n\n// ---------------------------------------------------------------------------\n// refresh\n// ---------------------------------------------------------------------------\n\nconst MAX_REFRESH_BYTES = 5 * 1024 * 1024;\n\nfunction missingSourceResult(): RegistryCommandResult {\n return {\n text: [\n 'registry refresh requires --source=<url>.',\n '',\n 'The url should point at a model-registry.generated.json file with a',\n 'matching <url>.sha256 sidecar (single line containing the SHA256 hash).',\n '',\n 'A signed GitHub release artifact is a planned default but not wired yet;',\n `that is tracked in #2180. Use --source=<your-mirror-url> in the meantime.`,\n ].join('\\n'),\n exitCode: 2,\n };\n}\n\ninterface VerifiedArtifact {\n readonly body: string;\n readonly sha256: string;\n}\n\nasync function fetchAndVerify(\n source: string,\n fetchImpl: typeof fetch\n): Promise<VerifiedArtifact | RegistryCommandResult> {\n const body = await fetchWithCap(source, fetchImpl);\n if (!body.ok || body.body === undefined) {\n return { text: `Failed to fetch ${source}: ${body.error ?? 'unknown'}`, exitCode: 1 };\n }\n const sha = await fetchWithCap(`${source}.sha256`, fetchImpl);\n if (!sha.ok || sha.body === undefined) {\n return {\n text: `Failed to fetch ${source}.sha256 for integrity check: ${sha.error ?? 'unknown'}`,\n exitCode: 1,\n };\n }\n const expected = sha.body.trim().split(/\\s+/)[0] ?? '';\n if (expected === '') {\n return { text: `SHA256 sidecar at ${source}.sha256 is empty`, exitCode: 1 };\n }\n const actual = createHash('sha256').update(body.body, 'utf-8').digest('hex');\n if (actual.toLowerCase() !== expected.toLowerCase()) {\n return {\n text: `SHA256 mismatch: expected ${expected}, got ${actual}. Aborting write.`,\n exitCode: 1,\n };\n }\n return { body: body.body, sha256: actual };\n}\n\nfunction formatRefreshReport(\n verb: 'would write to' | 'wrote to',\n source: string,\n artifact: VerifiedArtifact,\n dest: string,\n extraTail: readonly string[] = []\n): string {\n return [\n `registry refresh${verb.startsWith('would') ? ' --dry-run' : ''}`,\n `source : ${source}`,\n `sha256 : ${artifact.sha256} (verified)`,\n `bytes : ${String(artifact.body.length)}`,\n `${verb}: ${dest}`,\n ...extraTail,\n ].join('\\n');\n}\n\nasync function refreshCommand(options: RegistryCommandOptions): Promise<RegistryCommandResult> {\n const source = options.source;\n if (source === undefined || source === '') return missingSourceResult();\n\n const artifact = await fetchAndVerify(source, options.fetchImpl ?? fetch);\n if ('text' in artifact) return artifact;\n\n const dest = options.destPath ?? nexusDataPath('model-registry.generated.json');\n if (options.dryRun === true) {\n return { text: formatRefreshReport('would write to', source, artifact, dest), exitCode: 0 };\n }\n\n mkdirSync(dirname(dest), { recursive: true });\n writeFileSync(dest, artifact.body, 'utf-8');\n return {\n text: formatRefreshReport('wrote to', source, artifact, dest, [\n '',\n 'The refreshed file takes precedence over the bundled registry on the next',\n 'run. Restart any running CLI / MCP server for the change to take effect.',\n ]),\n exitCode: 0,\n };\n}\n\ninterface FetchResult {\n readonly ok: boolean;\n readonly body?: string;\n readonly error?: string;\n}\n\nasync function fetchWithCap(url: string, fetchImpl: typeof fetch): Promise<FetchResult> {\n try {\n const response = await fetchImpl(url, { signal: AbortSignal.timeout(30_000) });\n if (!response.ok) {\n return { ok: false, error: `HTTP ${String(response.status)}` };\n }\n const body = await response.text();\n if (body.length > MAX_REFRESH_BYTES) {\n return {\n ok: false,\n error: `payload ${String(body.length)} bytes exceeds cap ${String(MAX_REFRESH_BYTES)}`,\n };\n }\n return { ok: true, body };\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : String(err);\n return { ok: false, error: message };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Usage\n// ---------------------------------------------------------------------------\n\nexport function formatRegistryUsage(): string {\n return [\n 'Usage:',\n ' nexus-agents registry doctor [--json]',\n ' Inspect the merged ModelRegistry: per-source entry counts, the',\n ' bundled generated registry, the user overlay, and the unknown-id',\n ' fallback contextWindow.',\n '',\n ' nexus-agents registry refresh --source=<url> [--dry-run]',\n ' Download a signed model-registry.generated.json from <url>,',\n ' SHA256-verify against <url>.sha256, and write to:',\n ` ${nexusDataPath('model-registry.generated.json')}`,\n '',\n `Overlay path (T3) is ${defaultOverlayPath()} by default,`,\n `or whatever ${OVERLAY_ENV_VAR} points to. Overlay max size is ${String(OVERLAY_MAX_BYTES)} bytes.`,\n ].join('\\n');\n}\n\n// Dummy references to satisfy unused-var lint when destructuring is conditional.\nvoid existsSync;\nvoid readFileSync;\nvoid resolveOverlayPath;\n","/**\n * User YAML overlay loader for user model overrides (#2178).\n *\n * NOTE (#3293): the legacy CapabilityDiscovery resolver that consumed this\n * overlay was removed. This loader is retained — `registry doctor` reports\n * the overlay file for inspection, and `manifest-overlay.ts` reuses its\n * parsing helpers — but the overlay is NOT yet wired into the live\n * ModelRegistry. Wiring it in (so `models.yaml` actually affects resolution)\n * is tracked in #3351.\n *\n * Reads user-supplied model capability overrides from a YAML file. Fully\n * optional — missing file, empty file, malformed YAML, and schema-invalid\n * entries all return the empty overlay with structured warnings instead of\n * throwing. Operators use this to fix broken bundled / canonical entries\n * without needing an npm release, or to declare models the curated T1 /\n * generated T2 tiers don't cover.\n *\n * Precedent: LiteLLM's `register_model({...})` + aider's\n * `aider/resources/model-settings.yml`.\n *\n * @module config/capability-overlay\n */\n\nimport { existsSync, readFileSync, statSync } from 'node:fs';\nimport { parse as parseYaml } from 'yaml';\nimport { nexusDataPath } from './nexus-data-dir.js';\n\nimport type { ILogger } from '../core/index.js';\nimport { createLogger } from '../core/index.js';\nimport { ModelCapabilitySchema } from './model-capabilities-types.js';\nimport type { ModelCapability } from './model-capabilities-types.js';\n\n/** Environment variable an operator can set to override the default path. */\nexport const OVERLAY_ENV_VAR = 'NEXUS_MODEL_REGISTRY_OVERLAY';\n\n/** Max file size accepted for the overlay (1 MB — far larger than expected). */\nexport const OVERLAY_MAX_BYTES = 1 * 1024 * 1024;\n\n/**\n * Default overlay location: `<NEXUS_DATA_DIR>/models.yaml`. Returns the\n * absolute path without checking if it exists.\n */\nexport function defaultOverlayPath(): string {\n return nexusDataPath('models.yaml');\n}\n\n/**\n * Resolves the overlay path: `$NEXUS_MODEL_REGISTRY_OVERLAY` wins if set,\n * otherwise the default `~/.nexus-agents/models.yaml`.\n */\nexport function resolveOverlayPath(env: NodeJS.ProcessEnv = process.env): string {\n const override = env[OVERLAY_ENV_VAR];\n if (override !== undefined && override !== '') return override;\n return defaultOverlayPath();\n}\n\n// ---------------------------------------------------------------------------\n// Result shape\n// ---------------------------------------------------------------------------\n\n/** Structured reason for a rejected or skipped entry. */\nexport interface OverlayRejection {\n readonly index: number;\n readonly id?: string;\n readonly reason: string;\n}\n\nexport interface OverlayLoadResult {\n readonly entries: readonly ModelCapability[];\n readonly rejections: readonly OverlayRejection[];\n readonly path: string;\n readonly status: 'missing' | 'empty' | 'malformed' | 'too-large' | 'loaded';\n}\n\n// ---------------------------------------------------------------------------\n// Loader\n// ---------------------------------------------------------------------------\n\n/**\n * Expected YAML root shape:\n *\n * version: 1\n * models:\n * - id: claude-opus\n * displayName: \"Claude Opus (overridden)\"\n * provider: anthropic\n * contextWindow: 1000000\n * ...\n * - ...\n *\n * or simply:\n *\n * - id: ...\n * ...\n *\n * Both a top-level array and an object with `models:` are accepted for\n * ergonomics; everything else is rejected with a structured reason.\n */\nexport function loadCapabilityOverlay(\n pathOrEnv?: string | NodeJS.ProcessEnv,\n logger?: ILogger\n): OverlayLoadResult {\n const log = logger ?? createLogger({ component: 'capability-overlay' });\n const path = resolvePath(pathOrEnv);\n\n if (!existsSync(path)) {\n return { entries: [], rejections: [], path, status: 'missing' };\n }\n\n const sizeStatus = checkSize(path, log);\n if (sizeStatus !== undefined) return sizeStatus;\n\n const bodyResult = readBody(path, log);\n if ('result' in bodyResult) return bodyResult.result;\n const body = bodyResult.body;\n if (body === '') {\n log.info('Model registry overlay file is empty', { path });\n return { entries: [], rejections: [], path, status: 'empty' };\n }\n\n const parseResult = parseBody(body, path, log);\n if ('result' in parseResult) return parseResult.result;\n const parsed = parseResult.parsed;\n\n const rawEntries = extractEntries(parsed);\n if (rawEntries === undefined) {\n log.warn('Model registry overlay has unrecognized shape; treated as empty', {\n path,\n });\n return {\n entries: [],\n rejections: [{ index: -1, reason: 'Expected array or { models: [...] }' }],\n path,\n status: 'malformed',\n };\n }\n\n const { entries, rejections } = validateEntries(rawEntries, log, path);\n return { entries, rejections, path, status: 'loaded' };\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction resolvePath(pathOrEnv: string | NodeJS.ProcessEnv | undefined): string {\n if (typeof pathOrEnv === 'string') return pathOrEnv;\n if (pathOrEnv !== undefined) return resolveOverlayPath(pathOrEnv);\n return resolveOverlayPath();\n}\n\ntype ReadBodyResult = { body: string } | { result: OverlayLoadResult };\nfunction readBody(path: string, log: ILogger): ReadBodyResult {\n try {\n return { body: readFileSync(path, 'utf-8').trim() };\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : String(err);\n log.warn('Model registry overlay file read failed; treated as empty', {\n path,\n errorMessage: message,\n });\n return {\n result: {\n entries: [],\n rejections: [{ index: -1, reason: `file read error: ${message}` }],\n path,\n status: 'malformed',\n },\n };\n }\n}\n\ntype ParseBodyResult = { parsed: unknown } | { result: OverlayLoadResult };\nfunction parseBody(body: string, path: string, log: ILogger): ParseBodyResult {\n try {\n return { parsed: parseYaml(body) };\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : String(err);\n log.warn('Model registry overlay YAML parse failed; treated as empty', {\n path,\n errorMessage: message,\n });\n return {\n result: {\n entries: [],\n rejections: [{ index: -1, reason: `YAML parse error: ${message}` }],\n path,\n status: 'malformed',\n },\n };\n }\n}\n\nfunction checkSize(path: string, log: ILogger): OverlayLoadResult | undefined {\n let size: number;\n try {\n size = statSync(path).size;\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : String(err);\n log.warn('Model registry overlay statSync failed; treated as missing', {\n path,\n errorMessage: message,\n });\n return { entries: [], rejections: [], path, status: 'missing' };\n }\n if (size <= OVERLAY_MAX_BYTES) return undefined;\n log.warn('Model registry overlay exceeds size cap; refusing to load', {\n path,\n size,\n maxBytes: OVERLAY_MAX_BYTES,\n });\n return {\n entries: [],\n rejections: [\n {\n index: -1,\n reason: `file size ${String(size)} exceeds cap ${String(OVERLAY_MAX_BYTES)}`,\n },\n ],\n path,\n status: 'too-large',\n };\n}\n\nfunction extractIdForError(raw: unknown): string | undefined {\n if (raw === null || typeof raw !== 'object' || !('id' in raw)) return undefined;\n const idValue = raw.id;\n if (typeof idValue === 'string' && idValue !== '') return idValue;\n return undefined;\n}\n\nfunction extractEntries(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) return parsed as unknown[];\n if (parsed !== null && typeof parsed === 'object') {\n const obj = parsed as { models?: unknown };\n if (Array.isArray(obj.models)) return obj.models as unknown[];\n }\n return undefined;\n}\n\ninterface ValidatedEntries {\n readonly entries: readonly ModelCapability[];\n readonly rejections: readonly OverlayRejection[];\n}\n\nfunction validateEntries(\n rawEntries: readonly unknown[],\n log: ILogger,\n path: string\n): ValidatedEntries {\n const entries: ModelCapability[] = [];\n const rejections: OverlayRejection[] = [];\n for (let i = 0; i < rawEntries.length; i++) {\n const raw = rawEntries[i];\n const idCandidate = extractIdForError(raw);\n const parsed = ModelCapabilitySchema.safeParse(raw);\n if (!parsed.success) {\n const rejection: OverlayRejection = {\n index: i,\n ...(idCandidate !== undefined && idCandidate !== '' ? { id: idCandidate } : {}),\n reason: parsed.error.message,\n };\n rejections.push(rejection);\n log.warn('Model registry overlay entry rejected by schema', {\n path,\n index: i,\n id: idCandidate,\n errorMessage: parsed.error.message,\n });\n continue;\n }\n entries.push(parsed.data);\n }\n return { entries, rejections };\n}\n"],"mappings":";;;;;;;;;;;;AAsBA,SAAS,kBAAkB;AAC3B,SAAS,cAAAA,aAAY,WAAW,gBAAAC,eAAc,qBAAqB;AACnE,SAAS,eAAe;;;ACDxB,SAAS,YAAY,cAAc,gBAAgB;AACnD,SAAS,SAAS,iBAAiB;AAS5B,IAAM,kBAAkB;AAGxB,IAAM,oBAAoB,IAAI,OAAO;AAMrC,SAAS,qBAA6B;AAC3C,SAAO,cAAc,aAAa;AACpC;AAMO,SAAS,mBAAmB,MAAyB,QAAQ,KAAa;AAC/E,QAAM,WAAW,IAAI,eAAe;AACpC,MAAI,aAAa,UAAa,aAAa,GAAI,QAAO;AACtD,SAAO,mBAA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AQ,YAAY,QAAQ,GAAM,EAAE,CAAC;AAC7E,QAAI,CAAC,SAAS,IAAI;AAChB,aAAO,EAAE,IAAI,OAAO,OAAO,QAAQ,OAAO,SAAS,MAAM,CAAC,GAAG;AAAA,IAC/D;AACA,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,QAAI,KAAK,SAAS,mBAAmB;AACnC,aAAO;AAAA,QACL,IAAI;AAAA,QACJ,OAAO,WAAW,OAAO,KAAK,MAAM,CAAC,sBAAsB,OAAO,iBAAiB,CAAC;AAAA,MACtF;AAAA,IACF;AACA,WAAO,EAAE,IAAI,MAAM,KAAK;AAAA,EAC1B,SAAS,KAAc;AACrB,UAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC/D,WAAO,EAAE,IAAI,OAAO,OAAO,QAAQ;AAAA,EACrC;AACF;AAMO,SAAS,sBAA8B;AAC5C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,cAAc,+BAA+B,CAAC;AAAA,IACvD;AAAA,IACA,wBAAwB,mBAAmB,CAAC;AAAA,IAC5C,eAAe,eAAe,mCAAmC,OAAO,iBAAiB,CAAC;AAAA,EAC5F,EAAE,KAAK,IAAI;AACb;","names":["existsSync","readFileSync"]}
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
buildPlanFromAnalysis,
|
|
4
4
|
generateSecurityPlan,
|
|
5
5
|
resolveScannerData
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BKUKBOGV.js";
|
|
7
7
|
import "./chunk-HFOQKCD2.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-M774MKHE.js";
|
|
9
9
|
import "./chunk-CH7QIDHQ.js";
|
|
10
10
|
import "./chunk-PR4QN5HX.js";
|
|
11
11
|
export {
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
generateSecurityPlan,
|
|
15
15
|
resolveScannerData
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=repo-security-plan-
|
|
17
|
+
//# sourceMappingURL=repo-security-plan-N2GNWFER.js.map
|
package/dist/{research-helpers-synthesize-OSP6FGNV.js → research-helpers-synthesize-OKNU245Z.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AttributedInsightSchema,
|
|
3
3
|
synthesizeResearch
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5WY3N7VX.js";
|
|
5
5
|
import "./chunk-NUBSJGQZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-M774MKHE.js";
|
|
7
7
|
import "./chunk-CH7QIDHQ.js";
|
|
8
8
|
import "./chunk-PR4QN5HX.js";
|
|
9
9
|
export {
|
|
10
10
|
AttributedInsightSchema,
|
|
11
11
|
synthesizeResearch
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=research-helpers-synthesize-
|
|
13
|
+
//# sourceMappingURL=research-helpers-synthesize-OKNU245Z.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DEFAULT_ROUTING_MEMORY_CONFIG,
|
|
3
3
|
RoutingMemory,
|
|
4
4
|
createRoutingMemory
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-M774MKHE.js";
|
|
6
6
|
import "./chunk-CH7QIDHQ.js";
|
|
7
7
|
import "./chunk-PR4QN5HX.js";
|
|
8
8
|
export {
|
|
@@ -10,4 +10,4 @@ export {
|
|
|
10
10
|
RoutingMemory,
|
|
11
11
|
createRoutingMemory
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=routing-memory-
|
|
13
|
+
//# sourceMappingURL=routing-memory-3QXWGWB5.js.map
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
SessionMemory,
|
|
7
7
|
SessionMemoryError,
|
|
8
8
|
createSessionMemory
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-DLNCQO6L.js";
|
|
10
|
+
import "./chunk-M774MKHE.js";
|
|
11
11
|
import "./chunk-CH7QIDHQ.js";
|
|
12
12
|
import "./chunk-PR4QN5HX.js";
|
|
13
13
|
export {
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
SessionMemoryError,
|
|
20
20
|
createSessionMemory
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=session-memory-
|
|
22
|
+
//# sourceMappingURL=session-memory-AK4AJXGI.js.map
|
|
@@ -8,19 +8,19 @@ import {
|
|
|
8
8
|
runWizard,
|
|
9
9
|
setupCommand,
|
|
10
10
|
setupCommandAsync
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-WHFCVKAV.js";
|
|
12
|
+
import "./chunk-HFNHJZOK.js";
|
|
13
|
+
import "./chunk-VPH2M5H7.js";
|
|
14
|
+
import "./chunk-HBZUXO4Q.js";
|
|
15
|
+
import "./chunk-CJODZY4U.js";
|
|
16
|
+
import "./chunk-XO25FS24.js";
|
|
17
17
|
import "./chunk-NUBSJGQZ.js";
|
|
18
18
|
import "./chunk-6T3EPABN.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-EM7NUGMG.js";
|
|
20
|
+
import "./chunk-A7XUXJWL.js";
|
|
21
|
+
import "./chunk-AH67WRET.js";
|
|
22
22
|
import "./chunk-ZM4O442V.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-M774MKHE.js";
|
|
24
24
|
import "./chunk-CH7QIDHQ.js";
|
|
25
25
|
import "./chunk-PR4QN5HX.js";
|
|
26
26
|
export {
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
setupCommand,
|
|
35
35
|
setupCommandAsync
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=setup-command-
|
|
37
|
+
//# sourceMappingURL=setup-command-PHTP43V7.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runConfigInitSync
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-HFNHJZOK.js";
|
|
4
|
+
import "./chunk-M774MKHE.js";
|
|
5
5
|
import "./chunk-CH7QIDHQ.js";
|
|
6
6
|
import "./chunk-PR4QN5HX.js";
|
|
7
7
|
export {
|
|
8
8
|
runConfigInitSync
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=setup-config-
|
|
10
|
+
//# sourceMappingURL=setup-config-ANAFKZGE.js.map
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
CUSTOM_API_ALLOW_PRIVATE_ENV,
|
|
3
3
|
CUSTOM_API_BASE_URL_ENV,
|
|
4
4
|
validateCustomApiBaseUrl
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-J76KHBF3.js";
|
|
6
6
|
import {
|
|
7
7
|
CUSTOM_API_DEFAULT_MODEL
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XO25FS24.js";
|
|
9
9
|
import {
|
|
10
10
|
err,
|
|
11
11
|
ok
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M774MKHE.js";
|
|
13
13
|
import "./chunk-CH7QIDHQ.js";
|
|
14
14
|
import "./chunk-PR4QN5HX.js";
|
|
15
15
|
|
|
@@ -106,4 +106,4 @@ function buildShellFragment(params) {
|
|
|
106
106
|
export {
|
|
107
107
|
configureCustomApi
|
|
108
108
|
};
|
|
109
|
-
//# sourceMappingURL=setup-custom-api-
|
|
109
|
+
//# sourceMappingURL=setup-custom-api-FUA2ZUDD.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
getToolMemory,
|
|
4
4
|
reinitializeMemoryBackends,
|
|
5
5
|
shutdownToolMemory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZOBDTJNG.js";
|
|
7
7
|
import "./chunk-6T3EPABN.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-AH67WRET.js";
|
|
9
9
|
import "./chunk-PQHVC4BD.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-DLNCQO6L.js";
|
|
11
|
+
import "./chunk-M774MKHE.js";
|
|
12
12
|
import "./chunk-CH7QIDHQ.js";
|
|
13
13
|
import "./chunk-PR4QN5HX.js";
|
|
14
14
|
export {
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
reinitializeMemoryBackends,
|
|
18
18
|
shutdownToolMemory
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=tool-memory-
|
|
20
|
+
//# sourceMappingURL=tool-memory-ZP3EMUP5.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getAdaptiveBonus,
|
|
4
4
|
queryWithLookback,
|
|
5
5
|
shouldExplore
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M774MKHE.js";
|
|
7
7
|
import "./chunk-CH7QIDHQ.js";
|
|
8
8
|
import "./chunk-PR4QN5HX.js";
|
|
9
9
|
export {
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
queryWithLookback,
|
|
13
13
|
shouldExplore
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=weather-report-
|
|
15
|
+
//# sourceMappingURL=weather-report-54XDO6GO.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexus-agents",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.99.0",
|
|
4
4
|
"description": "Governance substrate for AI coding agents — adversarial PR review, drift-detected rules, immutable audit, and closed-loop outcome routing for Claude, Codex, Gemini, and OpenCode",
|
|
5
5
|
"mcpName": "io.github.nexus-substrate/nexus-agents",
|
|
6
6
|
"license": "MIT",
|