nexus-agents 2.100.2 → 2.101.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/{child-mcp-config-OWCVT4NN.js → child-mcp-config-NBELOYYZ.js} +2 -2
  2. package/dist/{chunk-JW4JGJEU.js → chunk-2ETX4XQW.js} +10 -10
  3. package/dist/{chunk-P453545L.js → chunk-3GF52QPA.js} +4 -4
  4. package/dist/{chunk-DQ2YK2PI.js → chunk-3J53EAYX.js} +5 -5
  5. package/dist/{chunk-AH67WRET.js → chunk-3QFQG5QT.js} +2 -2
  6. package/dist/{chunk-5T6S6HFY.js → chunk-4IWHFMCN.js} +4 -4
  7. package/dist/{chunk-HFNHJZOK.js → chunk-4L7FH53H.js} +2 -2
  8. package/dist/{chunk-A7XUXJWL.js → chunk-4RW6OONY.js} +2 -2
  9. package/dist/{chunk-WYDK6V7W.js → chunk-5PZIMHNA.js} +3 -3
  10. package/dist/{chunk-Q3IFS7UA.js → chunk-ABGRFLJ6.js} +4 -4
  11. package/dist/{chunk-LRM5NZ2I.js → chunk-AMYO7KUK.js} +46 -34
  12. package/dist/{chunk-LRM5NZ2I.js.map → chunk-AMYO7KUK.js.map} +1 -1
  13. package/dist/{chunk-ZPCDZMLK.js → chunk-E47LOV6Y.js} +2 -2
  14. package/dist/{chunk-SU7RKNIZ.js → chunk-EKO6XAAZ.js} +3 -3
  15. package/dist/{chunk-HBZUXO4Q.js → chunk-FLUC27DF.js} +2 -2
  16. package/dist/{chunk-BO6QUVXI.js → chunk-FVWKAEYH.js} +2 -2
  17. package/dist/{chunk-BKUKBOGV.js → chunk-FZCB2P3F.js} +2 -2
  18. package/dist/{chunk-VD4TXDMR.js → chunk-GDY23NDK.js} +2 -2
  19. package/dist/{chunk-3OCQKZLC.js → chunk-KAJPY6YZ.js} +2 -2
  20. package/dist/{chunk-H4LBBFCO.js → chunk-KHEQIB6P.js} +7 -7
  21. package/dist/{chunk-M774MKHE.js → chunk-KLYBJUTK.js} +43 -4
  22. package/dist/chunk-KLYBJUTK.js.map +1 -0
  23. package/dist/{chunk-D7FORQJJ.js → chunk-KYONCTIL.js} +3 -3
  24. package/dist/{chunk-CJODZY4U.js → chunk-L2NPJRZZ.js} +2 -2
  25. package/dist/{chunk-XO25FS24.js → chunk-LVGYWJDX.js} +2 -2
  26. package/dist/{chunk-T5KDRR2I.js → chunk-LXBWH5XP.js} +3 -3
  27. package/dist/{chunk-DLNCQO6L.js → chunk-MNFEZIRI.js} +2 -2
  28. package/dist/{chunk-J545CO5K.js → chunk-MNWYIYEZ.js} +2 -2
  29. package/dist/{chunk-V2C2MC6H.js → chunk-NAKDVIXS.js} +3 -3
  30. package/dist/{chunk-EWJRZNDC.js → chunk-RIYVX4JS.js} +7 -7
  31. package/dist/{chunk-UWQ3BALH.js → chunk-S7R72HUB.js} +2 -2
  32. package/dist/{chunk-ZOBDTJNG.js → chunk-TDXLS2TY.js} +4 -4
  33. package/dist/{chunk-3XSEFOI5.js → chunk-VJR46M7L.js} +3 -3
  34. package/dist/{chunk-J76KHBF3.js → chunk-W65C5VVJ.js} +2 -2
  35. package/dist/{chunk-5WY3N7VX.js → chunk-Z7IQUUTZ.js} +2 -2
  36. package/dist/{cli-circuit-breaker-IPNNNVIT.js → cli-circuit-breaker-L647V6BR.js} +4 -4
  37. package/dist/cli.js +39 -39
  38. package/dist/{composite-router-JJNQIHX6.js → composite-router-NOTUOXFI.js} +2 -2
  39. package/dist/{consensus-vote-W6MIUFZK.js → consensus-vote-F5FEDUSU.js} +13 -13
  40. package/dist/{context-retriever-2MOJ446P.js → context-retriever-SHT7J6BT.js} +6 -6
  41. package/dist/{doctor-deep-D6E5IWXB.js → doctor-deep-REMLGFXP.js} +3 -3
  42. package/dist/{expert-bridge-L25WFHQF.js → expert-bridge-Z7XZ7ED5.js} +4 -4
  43. package/dist/{factory-UCRIJY6Y.js → factory-CYUNYEMU.js} +5 -5
  44. package/dist/{factory-PVN7DDNZ.js → factory-PPAK3TVG.js} +5 -5
  45. package/dist/{improvement-review-7OWJBTOC.js → improvement-review-BGFCQV4I.js} +4 -4
  46. package/dist/index.d.ts +7 -2
  47. package/dist/index.js +28 -28
  48. package/dist/{init-opencode-PB4G7RJR.js → init-opencode-WXY4DUFU.js} +5 -5
  49. package/dist/{issue-triage-EMYHDDTR.js → issue-triage-KGLNAJKH.js} +5 -5
  50. package/dist/{pr-reviewer-helpers-DZQDKMMF.js → pr-reviewer-helpers-2YJG6XJM.js} +4 -4
  51. package/dist/{registry-command-5L7I44JA.js → registry-command-ZFOGLBKF.js} +12 -172
  52. package/dist/registry-command-ZFOGLBKF.js.map +1 -0
  53. package/dist/{repo-security-plan-N2GNWFER.js → repo-security-plan-L47DDTAU.js} +3 -3
  54. package/dist/{research-helpers-synthesize-OKNU245Z.js → research-helpers-synthesize-IABO7LB4.js} +3 -3
  55. package/dist/{routing-memory-3QXWGWB5.js → routing-memory-2YWEWRMQ.js} +2 -2
  56. package/dist/{session-memory-AK4AJXGI.js → session-memory-YWOMPCLZ.js} +3 -3
  57. package/dist/{setup-command-V7M6BX2X.js → setup-command-DVG3EDY7.js} +11 -11
  58. package/dist/{setup-config-ANAFKZGE.js → setup-config-PYFK2GIC.js} +3 -3
  59. package/dist/{setup-custom-api-FUA2ZUDD.js → setup-custom-api-A4IZQ2Q4.js} +4 -4
  60. package/dist/{tool-memory-ZP3EMUP5.js → tool-memory-ABPSCFIH.js} +5 -5
  61. package/dist/{weather-report-54XDO6GO.js → weather-report-GXD6KGDS.js} +2 -2
  62. package/package.json +1 -1
  63. package/dist/chunk-M774MKHE.js.map +0 -1
  64. package/dist/registry-command-5L7I44JA.js.map +0 -1
  65. /package/dist/{child-mcp-config-OWCVT4NN.js.map → child-mcp-config-NBELOYYZ.js.map} +0 -0
  66. /package/dist/{chunk-JW4JGJEU.js.map → chunk-2ETX4XQW.js.map} +0 -0
  67. /package/dist/{chunk-P453545L.js.map → chunk-3GF52QPA.js.map} +0 -0
  68. /package/dist/{chunk-DQ2YK2PI.js.map → chunk-3J53EAYX.js.map} +0 -0
  69. /package/dist/{chunk-AH67WRET.js.map → chunk-3QFQG5QT.js.map} +0 -0
  70. /package/dist/{chunk-5T6S6HFY.js.map → chunk-4IWHFMCN.js.map} +0 -0
  71. /package/dist/{chunk-HFNHJZOK.js.map → chunk-4L7FH53H.js.map} +0 -0
  72. /package/dist/{chunk-A7XUXJWL.js.map → chunk-4RW6OONY.js.map} +0 -0
  73. /package/dist/{chunk-WYDK6V7W.js.map → chunk-5PZIMHNA.js.map} +0 -0
  74. /package/dist/{chunk-Q3IFS7UA.js.map → chunk-ABGRFLJ6.js.map} +0 -0
  75. /package/dist/{chunk-ZPCDZMLK.js.map → chunk-E47LOV6Y.js.map} +0 -0
  76. /package/dist/{chunk-SU7RKNIZ.js.map → chunk-EKO6XAAZ.js.map} +0 -0
  77. /package/dist/{chunk-HBZUXO4Q.js.map → chunk-FLUC27DF.js.map} +0 -0
  78. /package/dist/{chunk-BO6QUVXI.js.map → chunk-FVWKAEYH.js.map} +0 -0
  79. /package/dist/{chunk-BKUKBOGV.js.map → chunk-FZCB2P3F.js.map} +0 -0
  80. /package/dist/{chunk-VD4TXDMR.js.map → chunk-GDY23NDK.js.map} +0 -0
  81. /package/dist/{chunk-3OCQKZLC.js.map → chunk-KAJPY6YZ.js.map} +0 -0
  82. /package/dist/{chunk-H4LBBFCO.js.map → chunk-KHEQIB6P.js.map} +0 -0
  83. /package/dist/{chunk-D7FORQJJ.js.map → chunk-KYONCTIL.js.map} +0 -0
  84. /package/dist/{chunk-CJODZY4U.js.map → chunk-L2NPJRZZ.js.map} +0 -0
  85. /package/dist/{chunk-XO25FS24.js.map → chunk-LVGYWJDX.js.map} +0 -0
  86. /package/dist/{chunk-T5KDRR2I.js.map → chunk-LXBWH5XP.js.map} +0 -0
  87. /package/dist/{chunk-DLNCQO6L.js.map → chunk-MNFEZIRI.js.map} +0 -0
  88. /package/dist/{chunk-J545CO5K.js.map → chunk-MNWYIYEZ.js.map} +0 -0
  89. /package/dist/{chunk-V2C2MC6H.js.map → chunk-NAKDVIXS.js.map} +0 -0
  90. /package/dist/{chunk-EWJRZNDC.js.map → chunk-RIYVX4JS.js.map} +0 -0
  91. /package/dist/{chunk-UWQ3BALH.js.map → chunk-S7R72HUB.js.map} +0 -0
  92. /package/dist/{chunk-ZOBDTJNG.js.map → chunk-TDXLS2TY.js.map} +0 -0
  93. /package/dist/{chunk-3XSEFOI5.js.map → chunk-VJR46M7L.js.map} +0 -0
  94. /package/dist/{chunk-J76KHBF3.js.map → chunk-W65C5VVJ.js.map} +0 -0
  95. /package/dist/{chunk-5WY3N7VX.js.map → chunk-Z7IQUUTZ.js.map} +0 -0
  96. /package/dist/{cli-circuit-breaker-IPNNNVIT.js.map → cli-circuit-breaker-L647V6BR.js.map} +0 -0
  97. /package/dist/{composite-router-JJNQIHX6.js.map → composite-router-NOTUOXFI.js.map} +0 -0
  98. /package/dist/{consensus-vote-W6MIUFZK.js.map → consensus-vote-F5FEDUSU.js.map} +0 -0
  99. /package/dist/{context-retriever-2MOJ446P.js.map → context-retriever-SHT7J6BT.js.map} +0 -0
  100. /package/dist/{doctor-deep-D6E5IWXB.js.map → doctor-deep-REMLGFXP.js.map} +0 -0
  101. /package/dist/{expert-bridge-L25WFHQF.js.map → expert-bridge-Z7XZ7ED5.js.map} +0 -0
  102. /package/dist/{factory-PVN7DDNZ.js.map → factory-CYUNYEMU.js.map} +0 -0
  103. /package/dist/{factory-UCRIJY6Y.js.map → factory-PPAK3TVG.js.map} +0 -0
  104. /package/dist/{improvement-review-7OWJBTOC.js.map → improvement-review-BGFCQV4I.js.map} +0 -0
  105. /package/dist/{init-opencode-PB4G7RJR.js.map → init-opencode-WXY4DUFU.js.map} +0 -0
  106. /package/dist/{issue-triage-EMYHDDTR.js.map → issue-triage-KGLNAJKH.js.map} +0 -0
  107. /package/dist/{pr-reviewer-helpers-DZQDKMMF.js.map → pr-reviewer-helpers-2YJG6XJM.js.map} +0 -0
  108. /package/dist/{repo-security-plan-N2GNWFER.js.map → repo-security-plan-L47DDTAU.js.map} +0 -0
  109. /package/dist/{research-helpers-synthesize-OKNU245Z.js.map → research-helpers-synthesize-IABO7LB4.js.map} +0 -0
  110. /package/dist/{routing-memory-3QXWGWB5.js.map → routing-memory-2YWEWRMQ.js.map} +0 -0
  111. /package/dist/{session-memory-AK4AJXGI.js.map → session-memory-YWOMPCLZ.js.map} +0 -0
  112. /package/dist/{setup-command-V7M6BX2X.js.map → setup-command-DVG3EDY7.js.map} +0 -0
  113. /package/dist/{setup-config-ANAFKZGE.js.map → setup-config-PYFK2GIC.js.map} +0 -0
  114. /package/dist/{setup-custom-api-FUA2ZUDD.js.map → setup-custom-api-A4IZQ2Q4.js.map} +0 -0
  115. /package/dist/{tool-memory-ZP3EMUP5.js.map → tool-memory-ABPSCFIH.js.map} +0 -0
  116. /package/dist/{weather-report-54XDO6GO.js.map → weather-report-GXD6KGDS.js.map} +0 -0
@@ -1 +0,0 @@
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\nconst overCapError = (bytes: number | null): FetchResult => ({\n ok: false,\n error:\n bytes === null\n ? `payload exceeds cap ${String(MAX_REFRESH_BYTES)} bytes (stream aborted)`\n : `payload ${String(bytes)} bytes exceeds cap ${String(MAX_REFRESH_BYTES)}`,\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\n // Reject on the declared size before reading a single byte (#3354). A\n // compromised/typo'd mirror could otherwise stream gigabytes; the old\n // `response.text()` buffered the whole body before checking the cap and\n // could exhaust memory first.\n const declared = Number(response.headers.get('content-length'));\n if (Number.isFinite(declared) && declared > MAX_REFRESH_BYTES) {\n return overCapError(declared);\n }\n\n // No declared length we can trust: stream with a running cap and abort\n // the moment the accumulated bytes exceed it, so an undeclared or lying\n // Content-Length can't OOM the process.\n if (response.body === null) {\n const body = await response.text();\n return body.length > MAX_REFRESH_BYTES ? overCapError(body.length) : { ok: true, body };\n }\n return await readStreamWithCap(response.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 * Read a response body stream, aborting the moment the accumulated bytes\n * exceed {@link MAX_REFRESH_BYTES} (#3354). Keeps a hostile mirror with an\n * undeclared/lying Content-Length from buffering unbounded data into memory.\n */\nasync function readStreamWithCap(stream: ReadableStream<Uint8Array>): Promise<FetchResult> {\n const reader = stream.getReader();\n const decoder = new TextDecoder();\n let total = 0;\n let body = '';\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n total += value.byteLength;\n if (total > MAX_REFRESH_BYTES) {\n await reader.cancel();\n return overCapError(null);\n }\n body += decoder.decode(value, { stream: true });\n }\n body += decoder.decode();\n return { ok: true, body };\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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