nexus-agents 2.92.5 → 2.94.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-PIDVHWJ7.js → child-mcp-config-PPFHJZSO.js} +2 -2
- package/dist/{chunk-MBK6P4VV.js → chunk-24WC4XO2.js} +2 -2
- package/dist/{chunk-G55LVPNH.js → chunk-2YMRRZRM.js} +9 -12
- package/dist/chunk-2YMRRZRM.js.map +1 -0
- package/dist/{chunk-PIDABDFE.js → chunk-43UDRX3N.js} +9 -127
- package/dist/chunk-43UDRX3N.js.map +1 -0
- package/dist/{chunk-DNSBKQ7I.js → chunk-4QESFYGV.js} +4 -4
- package/dist/{chunk-QQMYKFG7.js → chunk-5B4VLSMP.js} +3 -3
- package/dist/{chunk-3TU3RJNK.js → chunk-5ZB3MTA7.js} +3 -3
- package/dist/{chunk-FL3AXIUL.js → chunk-63OGXDHS.js} +4 -4
- package/dist/{chunk-BG4WK4UP.js → chunk-76535ZNP.js} +15 -6
- package/dist/chunk-76535ZNP.js.map +1 -0
- package/dist/{chunk-QXGLZETS.js → chunk-77JUKFTG.js} +7 -7
- package/dist/{chunk-GKFFRRS4.js → chunk-ADRTAUJA.js} +4 -4
- package/dist/{chunk-VBIAMMZZ.js → chunk-EB43BGAR.js} +2 -2
- package/dist/{chunk-EI2E43HI.js → chunk-EDPDH5YT.js} +3 -3
- package/dist/{chunk-YQAS2EGR.js → chunk-EJR6U67L.js} +2 -2
- package/dist/{chunk-2QJJYCPD.js → chunk-FUGPKYEJ.js} +2 -2
- package/dist/{chunk-P646QQYW.js → chunk-G5EBHQ2L.js} +5 -5
- package/dist/chunk-G5EBHQ2L.js.map +1 -0
- package/dist/{chunk-YJUHVQSG.js → chunk-GMZDRTVJ.js} +20 -3
- package/dist/chunk-GMZDRTVJ.js.map +1 -0
- package/dist/{chunk-U4RLBLNO.js → chunk-KSJPDQSG.js} +2 -2
- package/dist/{chunk-DSERRMPX.js → chunk-L7I55FAN.js} +2 -2
- package/dist/{chunk-OXLXVSN3.js → chunk-LCLVSNST.js} +2 -2
- package/dist/{chunk-VU54VB6K.js → chunk-OKGHHCS5.js} +3 -3
- package/dist/{chunk-DQEREDUW.js → chunk-OSSGG7KW.js} +2 -2
- package/dist/{chunk-L5BXCSMP.js → chunk-OT6V5ROA.js} +406 -16
- package/dist/chunk-OT6V5ROA.js.map +1 -0
- package/dist/{chunk-TOQJ3UN5.js → chunk-Q3NUA7CW.js} +3 -3
- package/dist/{chunk-QADQ4LN4.js → chunk-R2NKJPUX.js} +2 -2
- package/dist/{chunk-WXEMTPML.js → chunk-ROAANOOB.js} +2 -2
- package/dist/{chunk-NYWZI46K.js → chunk-TNBWHOPY.js} +52 -132
- package/dist/chunk-TNBWHOPY.js.map +1 -0
- package/dist/{chunk-KTJUMU2A.js → chunk-UC3PVIN4.js} +179 -48
- package/dist/chunk-UC3PVIN4.js.map +1 -0
- package/dist/{chunk-ZYYU26YH.js → chunk-XBPFVWA2.js} +2 -2
- package/dist/{chunk-SIICMKBA.js → chunk-YDXGYKZJ.js} +2 -2
- package/dist/chunk-YDXGYKZJ.js.map +1 -0
- package/dist/{chunk-3XC5LFWH.js → chunk-ZY2EMD72.js} +5 -5
- package/dist/{cli-circuit-breaker-HFSOBCPK.js → cli-circuit-breaker-BAERQZ3H.js} +4 -4
- package/dist/cli.js +135 -38
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-T2XYCQOU.js → composite-router-EONKFRDD.js} +2 -2
- package/dist/{consensus-vote-IDHQVKX2.js → consensus-vote-TO5575P3.js} +12 -12
- package/dist/{context-retriever-5BJYPAX7.js → context-retriever-JM564MOV.js} +6 -6
- package/dist/{doctor-deep-OVGRBG3Z.js → doctor-deep-VFBQ7TY4.js} +3 -3
- package/dist/{expert-bridge-JPTHFWPW.js → expert-bridge-OXME7FES.js} +4 -4
- package/dist/{factory-734UWF4C.js → factory-FVZLVIYH.js} +5 -5
- package/dist/{factory-NE7SNW7V.js → factory-MDT5CFA5.js} +5 -5
- package/dist/index.d.ts +240 -189
- package/dist/index.js +198 -55
- package/dist/index.js.map +1 -1
- package/dist/{init-opencode-2ZBDJILW.js → init-opencode-Y6XKR6WS.js} +5 -5
- package/dist/{issue-triage-AGGTH767.js → issue-triage-2XVD4JQ7.js} +5 -5
- package/dist/{pr-reviewer-helpers-WGPLUXPU.js → pr-reviewer-helpers-JLWEQIN6.js} +4 -4
- package/dist/{registry-command-CZZM5SF2.js → registry-command-FYVOMCBG.js} +2 -2
- package/dist/{repo-security-plan-X42KXHT2.js → repo-security-plan-JRDHWI2R.js} +3 -3
- package/dist/{research-helpers-synthesize-C7YGRQI6.js → research-helpers-synthesize-F7L7M7FJ.js} +3 -3
- package/dist/{routing-memory-2FYZDQUC.js → routing-memory-JAV2ICXR.js} +2 -2
- package/dist/{session-memory-53NZRZB6.js → session-memory-2XAGY3PX.js} +3 -3
- package/dist/{setup-command-ZV6VZLP4.js → setup-command-6WVEOE4Q.js} +11 -11
- package/dist/{setup-config-CYRK4UFF.js → setup-config-KUZU2GFI.js} +3 -3
- package/dist/{setup-custom-api-GXHPYLDR.js → setup-custom-api-3M7CU3TF.js} +4 -4
- package/dist/{tool-memory-AX5G67J6.js → tool-memory-YWX4FTIQ.js} +5 -5
- package/dist/{weather-report-AUMNGHYZ.js → weather-report-ZZM5EU7N.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-BG4WK4UP.js.map +0 -1
- package/dist/chunk-G55LVPNH.js.map +0 -1
- package/dist/chunk-KTJUMU2A.js.map +0 -1
- package/dist/chunk-L5BXCSMP.js.map +0 -1
- package/dist/chunk-NYWZI46K.js.map +0 -1
- package/dist/chunk-P646QQYW.js.map +0 -1
- package/dist/chunk-PIDABDFE.js.map +0 -1
- package/dist/chunk-SIICMKBA.js.map +0 -1
- package/dist/chunk-YJUHVQSG.js.map +0 -1
- /package/dist/{child-mcp-config-PIDVHWJ7.js.map → child-mcp-config-PPFHJZSO.js.map} +0 -0
- /package/dist/{chunk-MBK6P4VV.js.map → chunk-24WC4XO2.js.map} +0 -0
- /package/dist/{chunk-DNSBKQ7I.js.map → chunk-4QESFYGV.js.map} +0 -0
- /package/dist/{chunk-QQMYKFG7.js.map → chunk-5B4VLSMP.js.map} +0 -0
- /package/dist/{chunk-3TU3RJNK.js.map → chunk-5ZB3MTA7.js.map} +0 -0
- /package/dist/{chunk-FL3AXIUL.js.map → chunk-63OGXDHS.js.map} +0 -0
- /package/dist/{chunk-QXGLZETS.js.map → chunk-77JUKFTG.js.map} +0 -0
- /package/dist/{chunk-GKFFRRS4.js.map → chunk-ADRTAUJA.js.map} +0 -0
- /package/dist/{chunk-VBIAMMZZ.js.map → chunk-EB43BGAR.js.map} +0 -0
- /package/dist/{chunk-EI2E43HI.js.map → chunk-EDPDH5YT.js.map} +0 -0
- /package/dist/{chunk-YQAS2EGR.js.map → chunk-EJR6U67L.js.map} +0 -0
- /package/dist/{chunk-2QJJYCPD.js.map → chunk-FUGPKYEJ.js.map} +0 -0
- /package/dist/{chunk-U4RLBLNO.js.map → chunk-KSJPDQSG.js.map} +0 -0
- /package/dist/{chunk-DSERRMPX.js.map → chunk-L7I55FAN.js.map} +0 -0
- /package/dist/{chunk-OXLXVSN3.js.map → chunk-LCLVSNST.js.map} +0 -0
- /package/dist/{chunk-VU54VB6K.js.map → chunk-OKGHHCS5.js.map} +0 -0
- /package/dist/{chunk-DQEREDUW.js.map → chunk-OSSGG7KW.js.map} +0 -0
- /package/dist/{chunk-TOQJ3UN5.js.map → chunk-Q3NUA7CW.js.map} +0 -0
- /package/dist/{chunk-QADQ4LN4.js.map → chunk-R2NKJPUX.js.map} +0 -0
- /package/dist/{chunk-WXEMTPML.js.map → chunk-ROAANOOB.js.map} +0 -0
- /package/dist/{chunk-ZYYU26YH.js.map → chunk-XBPFVWA2.js.map} +0 -0
- /package/dist/{chunk-3XC5LFWH.js.map → chunk-ZY2EMD72.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-HFSOBCPK.js.map → cli-circuit-breaker-BAERQZ3H.js.map} +0 -0
- /package/dist/{composite-router-T2XYCQOU.js.map → composite-router-EONKFRDD.js.map} +0 -0
- /package/dist/{consensus-vote-IDHQVKX2.js.map → consensus-vote-TO5575P3.js.map} +0 -0
- /package/dist/{context-retriever-5BJYPAX7.js.map → context-retriever-JM564MOV.js.map} +0 -0
- /package/dist/{doctor-deep-OVGRBG3Z.js.map → doctor-deep-VFBQ7TY4.js.map} +0 -0
- /package/dist/{expert-bridge-JPTHFWPW.js.map → expert-bridge-OXME7FES.js.map} +0 -0
- /package/dist/{factory-734UWF4C.js.map → factory-FVZLVIYH.js.map} +0 -0
- /package/dist/{factory-NE7SNW7V.js.map → factory-MDT5CFA5.js.map} +0 -0
- /package/dist/{init-opencode-2ZBDJILW.js.map → init-opencode-Y6XKR6WS.js.map} +0 -0
- /package/dist/{issue-triage-AGGTH767.js.map → issue-triage-2XVD4JQ7.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-WGPLUXPU.js.map → pr-reviewer-helpers-JLWEQIN6.js.map} +0 -0
- /package/dist/{registry-command-CZZM5SF2.js.map → registry-command-FYVOMCBG.js.map} +0 -0
- /package/dist/{repo-security-plan-X42KXHT2.js.map → repo-security-plan-JRDHWI2R.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-C7YGRQI6.js.map → research-helpers-synthesize-F7L7M7FJ.js.map} +0 -0
- /package/dist/{routing-memory-2FYZDQUC.js.map → routing-memory-JAV2ICXR.js.map} +0 -0
- /package/dist/{session-memory-53NZRZB6.js.map → session-memory-2XAGY3PX.js.map} +0 -0
- /package/dist/{setup-command-ZV6VZLP4.js.map → setup-command-6WVEOE4Q.js.map} +0 -0
- /package/dist/{setup-config-CYRK4UFF.js.map → setup-config-KUZU2GFI.js.map} +0 -0
- /package/dist/{setup-custom-api-GXHPYLDR.js.map → setup-custom-api-3M7CU3TF.js.map} +0 -0
- /package/dist/{tool-memory-AX5G67J6.js.map → tool-memory-YWX4FTIQ.js.map} +0 -0
- /package/dist/{weather-report-AUMNGHYZ.js.map → weather-report-ZZM5EU7N.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRandomProvider,
|
|
3
3
|
getTimeProvider
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OT6V5ROA.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/id-utils.ts
|
|
7
7
|
import { randomUUID } from "crypto";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
generateHyphenId,
|
|
25
25
|
generateUUID
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-XBPFVWA2.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ConfigError,
|
|
3
3
|
err,
|
|
4
4
|
ok
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OT6V5ROA.js";
|
|
6
6
|
|
|
7
7
|
// src/adapters/sdk/types.ts
|
|
8
8
|
var PROVIDER_ENV_KEYS = {
|
|
@@ -117,4 +117,4 @@ export {
|
|
|
117
117
|
CUSTOM_API_ALLOW_PRIVATE_ENV,
|
|
118
118
|
validateCustomApiBaseUrl
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-YDXGYKZJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/sdk/types.ts","../src/adapters/sdk/custom-api-validation.ts"],"sourcesContent":["/**\n * nexus-agents/adapters/sdk - Shared Types\n *\n * Type definitions for AI SDK adapter layer.\n *\n * @module adapters/sdk/types\n * (Source: Issue #1123 — AI SDK provider layer)\n */\n\n/**\n * Supported AI SDK provider identifiers.\n *\n * `custom-openai` is for OpenAI-compatible gateways (multi-vendor proxies,\n * self-hosted LLM servers, corporate model gateways) — uses the same\n * @ai-sdk/openai package but with a configurable `baseURL`.\n */\nexport type SdkProviderId = 'anthropic' | 'openai' | 'google' | 'custom-openai';\n\n/**\n * Configuration for creating an AI SDK adapter.\n */\nexport interface SdkAdapterConfig {\n /** Provider identifier */\n providerId: SdkProviderId;\n /** Model to use (e.g., 'claude-sonnet-4-6', 'gpt-4o') */\n modelId: string;\n /** API key (falls back to environment variable) */\n apiKey?: string;\n /**\n * Base URL for OpenAI-compatible gateways. Required when\n * `providerId === 'custom-openai'`, ignored otherwise. Falls back to\n * the `NEXUS_CUSTOM_API_BASE_URL` environment variable.\n */\n baseUrl?: string;\n /** Request timeout in milliseconds */\n timeout?: number;\n /** Maximum retries on transient failures */\n maxRetries?: number;\n}\n\n/**\n * Maps provider IDs to their environment variable names.\n */\nexport const PROVIDER_ENV_KEYS: Record<SdkProviderId, string> = {\n anthropic: 'ANTHROPIC_API_KEY',\n openai: 'OPENAI_API_KEY',\n google: 'GOOGLE_AI_API_KEY',\n 'custom-openai': 'NEXUS_CUSTOM_API_KEY',\n};\n\n/**\n * Environment variable name for the custom gateway base URL.\n * Keep in sync with `SdkAdapterConfig.baseUrl`.\n */\nexport const CUSTOM_API_BASE_URL_ENV = 'NEXUS_CUSTOM_API_BASE_URL';\n\n/**\n * Escape hatch: set to `1`/`true` to allow the custom gateway base URL to\n * resolve to a loopback or RFC 1918 private address. Default is DENY —\n * SSRF defense. Only disable this when you know the gateway runs on a\n * trusted internal host and you accept the risk.\n */\nexport const CUSTOM_API_ALLOW_PRIVATE_ENV = 'NEXUS_CUSTOM_API_ALLOW_PRIVATE';\n","/**\n * Validation for the `custom-openai` SDK adapter's gateway URL.\n *\n * The base URL is user-provided, so without validation the adapter becomes\n * an SSRF vector: a malicious prompt that reshaped env vars, or a typo in\n * the config, could point nexus-agents at `http://169.254.169.254/` (AWS\n * metadata) or `http://localhost:5432/` (internal services). This module\n * rejects such URLs unless the user explicitly opts in via\n * `NEXUS_CUSTOM_API_ALLOW_PRIVATE=1`.\n *\n * Called out in the #2119 consensus vote by the Security Engineer role.\n *\n * @module adapters/sdk/custom-api-validation\n */\n\nimport { isIPv4, isIPv6 } from 'node:net';\nimport { ConfigError, ok, err, type Result } from '../../core/index.js';\nimport { CUSTOM_API_ALLOW_PRIVATE_ENV } from './types.js';\n\n/**\n * Why a given URL was rejected. Machine-readable so error messages can\n * distinguish root causes in downstream tooling.\n */\nexport type BaseUrlRejectionReason =\n | 'empty'\n | 'not_a_url'\n | 'not_http_https'\n | 'loopback'\n | 'link_local'\n | 'private_range'\n | 'reserved';\n\ninterface RejectionDetail {\n readonly reason: BaseUrlRejectionReason;\n readonly message: string;\n}\n\n/**\n * Validates a user-provided custom-gateway base URL. Returns the URL as an\n * `ok` Result if it passes, or a `ConfigError` with a machine-readable\n * reason if it fails.\n *\n * Pass `{ allowPrivate: true }` (or set the env var) to bypass the SSRF\n * checks — use this only when the gateway is on a trusted internal host\n * and you accept the risk.\n */\nexport function validateCustomApiBaseUrl(\n raw: string | undefined,\n opts: { readonly allowPrivate?: boolean } = {}\n): Result<URL, ConfigError> {\n if (raw === undefined || raw.trim() === '') {\n return err(\n new ConfigError(\n 'Custom API base URL is required but missing. Set NEXUS_CUSTOM_API_BASE_URL or pass `baseUrl` in config.'\n )\n );\n }\n\n let url: URL;\n try {\n url = new URL(raw);\n } catch {\n return err(new ConfigError(`Custom API base URL is not a valid URL: ${raw}`));\n }\n\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n return err(\n new ConfigError(`Custom API base URL must use http or https, got \"${url.protocol}\" in ${raw}`)\n );\n }\n\n const allowPrivate = opts.allowPrivate === true || resolveAllowPrivateFromEnv();\n if (!allowPrivate) {\n const rejection = classifyPrivateHost(url.hostname);\n if (rejection !== null) {\n return err(\n new ConfigError(\n `Custom API base URL rejected (SSRF guard, reason=\"${rejection.reason}\"): ${rejection.message}. ` +\n `Set ${CUSTOM_API_ALLOW_PRIVATE_ENV}=1 to bypass if the gateway runs on a trusted internal host.`\n )\n );\n }\n }\n\n return ok(url);\n}\n\nfunction resolveAllowPrivateFromEnv(): boolean {\n // Deliberately strict (case-sensitive, not parseBoolEnv): this disables an\n // SSRF guard, so we don't want extra case variants (e.g. `TRUE`) to loosen\n // the control. Fail-closed on anything but exact `1`/`true` (#3297).\n const v = process.env[CUSTOM_API_ALLOW_PRIVATE_ENV];\n return v === '1' || v === 'true';\n}\n\n/**\n * Returns a rejection reason if the hostname resolves (by string form) to\n * a loopback, link-local, or RFC 1918 private address; `null` otherwise.\n *\n * Note: this is a string-level check. It does NOT perform DNS resolution,\n * so a public DNS name that secretly resolves to a private IP will pass.\n * Callers who need that level of defense should add a runtime connect\n * check and validate the socket peer address.\n */\nfunction classifyPrivateHost(hostname: string): RejectionDetail | null {\n // URL.hostname wraps IPv6 literals in brackets (e.g. \"[::1]\"); strip them\n // before the net-module checks, which expect bare forms.\n const stripped =\n hostname.startsWith('[') && hostname.endsWith(']') ? hostname.slice(1, -1) : hostname;\n const normalized = stripped.toLowerCase();\n\n // Literal IPv4 loopback or private-range address\n if (isIPv4(normalized)) {\n return classifyIPv4(normalized);\n }\n\n // Literal IPv6 loopback (::1), link-local (fe80::/10), unique-local (fc00::/7)\n if (isIPv6(normalized)) {\n return classifyIPv6(normalized);\n }\n\n // Hostname literals that resolve to loopback without needing DNS\n if (\n normalized === 'localhost' ||\n normalized.endsWith('.localhost') ||\n normalized.endsWith('.local') // mDNS\n ) {\n return {\n reason: 'loopback',\n message: `hostname \"${hostname}\" resolves to loopback/mDNS`,\n };\n }\n\n return null;\n}\n\n/** IPv4 ranges the SSRF guard rejects, in order of specificity. */\nconst IPV4_RULES: ReadonlyArray<{\n readonly match: (a: number, b: number) => boolean;\n readonly reason: BaseUrlRejectionReason;\n readonly label: string;\n}> = [\n { match: (a) => a === 127, reason: 'loopback', label: 'IPv4 loopback' },\n { match: (a) => a === 10, reason: 'private_range', label: 'IPv4 private (10/8)' },\n {\n match: (a, b) => a === 172 && b >= 16 && b <= 31,\n reason: 'private_range',\n label: 'IPv4 private (172.16/12)',\n },\n {\n match: (a, b) => a === 192 && b === 168,\n reason: 'private_range',\n label: 'IPv4 private (192.168/16)',\n },\n {\n match: (a, b) => a === 169 && b === 254,\n reason: 'link_local',\n label: 'IPv4 link-local (169.254/16 — AWS IMDS)',\n },\n { match: (a) => a === 0, reason: 'reserved', label: 'IPv4 reserved (0/8)' },\n];\n\nfunction classifyIPv4(ip: string): RejectionDetail | null {\n const parts = ip.split('.').map((p) => Number.parseInt(p, 10));\n if (parts.length !== 4 || parts.some((n) => Number.isNaN(n))) return null;\n const [a, b] = parts as [number, number, number, number];\n for (const rule of IPV4_RULES) {\n if (rule.match(a, b)) {\n return { reason: rule.reason, message: `${rule.label} (${ip})` };\n }\n }\n return null;\n}\n\nfunction classifyIPv6(ip: string): RejectionDetail | null {\n const lower = ip.toLowerCase();\n if (lower === '::1') return { reason: 'loopback', message: `IPv6 loopback (${ip})` };\n if (lower.startsWith('fe80:'))\n return { reason: 'link_local', message: `IPv6 link-local (${ip})` };\n // Unique-local: fc00::/7 → first byte has high bit set and second-high bit set\n if (/^fc|^fd/.test(lower)) {\n return { reason: 'private_range', message: `IPv6 unique-local (${ip}, fc00::/7)` };\n }\n return null;\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runConfigInitSync
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ROAANOOB.js";
|
|
4
4
|
import {
|
|
5
5
|
VERSION,
|
|
6
6
|
checkApiKeys,
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
checkSqlite,
|
|
9
9
|
defaultConfig,
|
|
10
10
|
initDataDirectories
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-77JUKFTG.js";
|
|
12
12
|
import {
|
|
13
13
|
probeAllClis
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4QESFYGV.js";
|
|
15
15
|
import {
|
|
16
16
|
BUILT_IN_EXPERTS
|
|
17
17
|
} from "./chunk-ZM4O442V.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getErrorMessage,
|
|
26
26
|
getTimeProvider,
|
|
27
27
|
symbols
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-OT6V5ROA.js";
|
|
29
29
|
import {
|
|
30
30
|
ensureGitignored,
|
|
31
31
|
findRepoRoot
|
|
@@ -1987,4 +1987,4 @@ export {
|
|
|
1987
1987
|
setupCommand,
|
|
1988
1988
|
setupCommandAsync
|
|
1989
1989
|
};
|
|
1990
|
-
//# sourceMappingURL=chunk-
|
|
1990
|
+
//# sourceMappingURL=chunk-ZY2EMD72.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CliCircuitBreakerIntegration,
|
|
3
3
|
createCliCircuitBreakerIntegration
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-EDPDH5YT.js";
|
|
5
|
+
import "./chunk-24WC4XO2.js";
|
|
6
|
+
import "./chunk-OT6V5ROA.js";
|
|
7
7
|
import "./chunk-CH7QIDHQ.js";
|
|
8
8
|
import "./chunk-PR4QN5HX.js";
|
|
9
9
|
export {
|
|
10
10
|
CliCircuitBreakerIntegration,
|
|
11
11
|
createCliCircuitBreakerIntegration
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=cli-circuit-breaker-
|
|
13
|
+
//# sourceMappingURL=cli-circuit-breaker-BAERQZ3H.js.map
|
package/dist/cli.js
CHANGED
|
@@ -13,19 +13,19 @@ import {
|
|
|
13
13
|
generateSummary,
|
|
14
14
|
parseFindings,
|
|
15
15
|
sumFindings
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-5ZB3MTA7.js";
|
|
17
|
+
import "./chunk-R2NKJPUX.js";
|
|
18
18
|
import {
|
|
19
19
|
buildOpenAICompatAdapters,
|
|
20
20
|
loadUsageEvents,
|
|
21
21
|
readOpenAICompatEnv,
|
|
22
22
|
rollupByModel
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5B4VLSMP.js";
|
|
24
24
|
import {
|
|
25
25
|
setupCommandAsync,
|
|
26
26
|
verifyCommand
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-ZY2EMD72.js";
|
|
28
|
+
import "./chunk-ROAANOOB.js";
|
|
29
29
|
import {
|
|
30
30
|
AuthHandler,
|
|
31
31
|
DEFAULT_EXPERTS,
|
|
@@ -158,25 +158,29 @@ import {
|
|
|
158
158
|
runImprovementReview,
|
|
159
159
|
saveSourcesRegistry,
|
|
160
160
|
setGlobalToolRateLimiterFactory,
|
|
161
|
+
shutdownFailoverSignals,
|
|
161
162
|
shutdownFeedbackSubscriber,
|
|
163
|
+
shutdownSwarmHealthSignals,
|
|
164
|
+
startFailoverSignals,
|
|
162
165
|
startFeedbackSubscriber,
|
|
166
|
+
startSwarmHealthSignals,
|
|
163
167
|
validateArgs,
|
|
164
168
|
validateCommand,
|
|
165
169
|
validateWorkflow,
|
|
166
170
|
wrapInMarkdownFence
|
|
167
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-UC3PVIN4.js";
|
|
168
172
|
import {
|
|
169
173
|
resolveToken
|
|
170
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-OSSGG7KW.js";
|
|
171
175
|
import {
|
|
172
176
|
CATEGORY_DISPLAY_NAMES,
|
|
173
177
|
DEFAULT_PR_REVIEW_CONFIG
|
|
174
178
|
} from "./chunk-OK6U5N5Y.js";
|
|
175
|
-
import "./chunk-
|
|
176
|
-
import "./chunk-
|
|
179
|
+
import "./chunk-Q3NUA7CW.js";
|
|
180
|
+
import "./chunk-EDPDH5YT.js";
|
|
177
181
|
import {
|
|
178
182
|
shutdownExpertBridge
|
|
179
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-2YMRRZRM.js";
|
|
180
184
|
import {
|
|
181
185
|
DEFAULT_VOTE_TIMEOUT_MS,
|
|
182
186
|
ErrorPolicySchema,
|
|
@@ -194,34 +198,34 @@ import {
|
|
|
194
198
|
toolSuccessStructured,
|
|
195
199
|
warnIfSimulatedOutsideTests,
|
|
196
200
|
wrapToolWithTimeout
|
|
197
|
-
} from "./chunk-
|
|
198
|
-
import "./chunk-
|
|
199
|
-
import "./chunk-
|
|
201
|
+
} from "./chunk-TNBWHOPY.js";
|
|
202
|
+
import "./chunk-L7I55FAN.js";
|
|
203
|
+
import "./chunk-YDXGYKZJ.js";
|
|
200
204
|
import {
|
|
201
205
|
loadPapersRegistry,
|
|
202
206
|
loadTechniquesRegistry,
|
|
203
207
|
savePapersRegistry,
|
|
204
208
|
synthesizeResearch
|
|
205
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-G5EBHQ2L.js";
|
|
206
210
|
import {
|
|
207
211
|
classifyTrust,
|
|
208
212
|
createFullGitHubProvider,
|
|
209
213
|
evaluatePolicy,
|
|
210
214
|
parsePRUrl
|
|
211
|
-
} from "./chunk-
|
|
212
|
-
import "./chunk-
|
|
215
|
+
} from "./chunk-76535ZNP.js";
|
|
216
|
+
import "./chunk-EJR6U67L.js";
|
|
213
217
|
import {
|
|
214
218
|
ReputationCache,
|
|
215
219
|
sanitizeInput
|
|
216
|
-
} from "./chunk-
|
|
217
|
-
import "./chunk-
|
|
220
|
+
} from "./chunk-EB43BGAR.js";
|
|
221
|
+
import "./chunk-FUGPKYEJ.js";
|
|
218
222
|
import "./chunk-HFOQKCD2.js";
|
|
219
223
|
import "./chunk-3ACDP4E6.js";
|
|
220
|
-
import "./chunk-
|
|
224
|
+
import "./chunk-OKGHHCS5.js";
|
|
221
225
|
import {
|
|
222
226
|
MemoryError,
|
|
223
227
|
shutdownToolMemory
|
|
224
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-63OGXDHS.js";
|
|
225
229
|
import {
|
|
226
230
|
CustomExpertDefinitionSchema,
|
|
227
231
|
DATA_SUBDIRECTORIES,
|
|
@@ -240,12 +244,12 @@ import {
|
|
|
240
244
|
loadConfig,
|
|
241
245
|
runDoctor,
|
|
242
246
|
validateNexusEnv
|
|
243
|
-
} from "./chunk-
|
|
244
|
-
import "./chunk-
|
|
245
|
-
import "./chunk-
|
|
247
|
+
} from "./chunk-77JUKFTG.js";
|
|
248
|
+
import "./chunk-GMZDRTVJ.js";
|
|
249
|
+
import "./chunk-KSJPDQSG.js";
|
|
246
250
|
import {
|
|
247
251
|
DEFAULTS
|
|
248
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-43UDRX3N.js";
|
|
249
253
|
import "./chunk-NUBSJGQZ.js";
|
|
250
254
|
import {
|
|
251
255
|
capitalize,
|
|
@@ -257,12 +261,12 @@ import {
|
|
|
257
261
|
getAvailableClis,
|
|
258
262
|
isRecord,
|
|
259
263
|
probeAllClis
|
|
260
|
-
} from "./chunk-
|
|
261
|
-
import "./chunk-
|
|
262
|
-
import "./chunk-
|
|
264
|
+
} from "./chunk-4QESFYGV.js";
|
|
265
|
+
import "./chunk-24WC4XO2.js";
|
|
266
|
+
import "./chunk-XBPFVWA2.js";
|
|
263
267
|
import "./chunk-ZM4O442V.js";
|
|
264
268
|
import "./chunk-PQHVC4BD.js";
|
|
265
|
-
import "./chunk-
|
|
269
|
+
import "./chunk-LCLVSNST.js";
|
|
266
270
|
import {
|
|
267
271
|
API_TIMEOUTS,
|
|
268
272
|
AgentCapability,
|
|
@@ -314,9 +318,11 @@ import {
|
|
|
314
318
|
getPipelineEventBus,
|
|
315
319
|
getRandomProvider,
|
|
316
320
|
getTimeProvider,
|
|
321
|
+
getTuneAdjustmentStore,
|
|
317
322
|
logger,
|
|
318
323
|
lookupInTreeCapability,
|
|
319
324
|
ok,
|
|
325
|
+
parseBoolEnv,
|
|
320
326
|
parseTierOverrides,
|
|
321
327
|
resetOutcomeStore,
|
|
322
328
|
runWarmUp,
|
|
@@ -330,7 +336,7 @@ import {
|
|
|
330
336
|
validateTimeout,
|
|
331
337
|
writeEmptyLine,
|
|
332
338
|
writeLine
|
|
333
|
-
} from "./chunk-
|
|
339
|
+
} from "./chunk-OT6V5ROA.js";
|
|
334
340
|
import {
|
|
335
341
|
applyPortableMode,
|
|
336
342
|
detectSandbox,
|
|
@@ -3109,7 +3115,7 @@ ${file.patch}
|
|
|
3109
3115
|
violations: policyResult.violations
|
|
3110
3116
|
});
|
|
3111
3117
|
}
|
|
3112
|
-
const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-
|
|
3118
|
+
const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-JLWEQIN6.js");
|
|
3113
3119
|
const body = formatReviewComment2(result);
|
|
3114
3120
|
const postResult = await provider.createReview(pr.prNumber, body, result.decision);
|
|
3115
3121
|
if (!postResult.ok) {
|
|
@@ -12419,8 +12425,7 @@ var HookEnvVars = {
|
|
|
12419
12425
|
NEXUS_DISABLE_METRICS: "NEXUS_DISABLE_METRICS"
|
|
12420
12426
|
};
|
|
12421
12427
|
function isFeatureDisabled(envVar) {
|
|
12422
|
-
|
|
12423
|
-
return value === "1" || value === "true";
|
|
12428
|
+
return parseBoolEnv(envVar, false);
|
|
12424
12429
|
}
|
|
12425
12430
|
function getDbPathFromEnv() {
|
|
12426
12431
|
return process.env[HookEnvVars.NEXUS_SESSIONS_DB] ?? getDefaultDbPath2();
|
|
@@ -17426,6 +17431,92 @@ function runStpaSafetyAnalysis(logger18, failOnHighSeverity) {
|
|
|
17426
17431
|
}
|
|
17427
17432
|
}
|
|
17428
17433
|
|
|
17434
|
+
// src/pipeline/tune-stage.ts
|
|
17435
|
+
var defaultLogger = createLogger({ component: "TuneStage" });
|
|
17436
|
+
var TUNE_ENFORCE_ENV = "NEXUS_TUNE_ENFORCE";
|
|
17437
|
+
var TUNE_ENFORCE_DEMOTION = 0.15;
|
|
17438
|
+
var TUNE_SIGNAL_TYPES = [
|
|
17439
|
+
"signal.fitness_declined",
|
|
17440
|
+
"signal.swarm_unhealthy",
|
|
17441
|
+
"signal.vote_rejected"
|
|
17442
|
+
];
|
|
17443
|
+
function intendedActionFor(event) {
|
|
17444
|
+
switch (event.type) {
|
|
17445
|
+
case "signal.fitness_declined":
|
|
17446
|
+
return {
|
|
17447
|
+
kind: "flag_tech_debt",
|
|
17448
|
+
detail: `fitness ${String(event.score)} below floor ${String(event.floor)}${event.dimension !== void 0 ? ` (dimension: ${event.dimension})` : ""} \u2014 would surface a tech-debt remediation signal`,
|
|
17449
|
+
signal: event.type
|
|
17450
|
+
};
|
|
17451
|
+
case "signal.swarm_unhealthy":
|
|
17452
|
+
return {
|
|
17453
|
+
kind: "downweight_agent",
|
|
17454
|
+
detail: `agent ${event.agentId} unhealthy (${event.reason}) \u2014 would downweight it for routing (bounded, never zeroed)`,
|
|
17455
|
+
signal: event.type
|
|
17456
|
+
};
|
|
17457
|
+
case "signal.vote_rejected":
|
|
17458
|
+
return {
|
|
17459
|
+
kind: "record_rejection",
|
|
17460
|
+
detail: `proposal ${event.proposalId} rejected at ${String(event.approvalPercentage)}% \u2014 would record a rejection signal for review`,
|
|
17461
|
+
signal: event.type
|
|
17462
|
+
};
|
|
17463
|
+
default:
|
|
17464
|
+
return void 0;
|
|
17465
|
+
}
|
|
17466
|
+
}
|
|
17467
|
+
function createTuneStage(bus, options = {}) {
|
|
17468
|
+
const enabled = options.enabled ?? false;
|
|
17469
|
+
const log = options.logger ?? defaultLogger;
|
|
17470
|
+
return bus.subscribe({ type: [...TUNE_SIGNAL_TYPES] }, (event) => {
|
|
17471
|
+
try {
|
|
17472
|
+
const action = intendedActionFor(event);
|
|
17473
|
+
if (action === void 0) return;
|
|
17474
|
+
if (enabled) {
|
|
17475
|
+
if (event.type === "signal.swarm_unhealthy") {
|
|
17476
|
+
const adjustment = getTuneAdjustmentStore().demote(
|
|
17477
|
+
event.agentId,
|
|
17478
|
+
TUNE_ENFORCE_DEMOTION,
|
|
17479
|
+
`swarm_unhealthy: ${event.reason}`
|
|
17480
|
+
);
|
|
17481
|
+
log.info("TuneStage (enforce) \u2014 applied bounded routing demotion", {
|
|
17482
|
+
kind: action.kind,
|
|
17483
|
+
signal: action.signal,
|
|
17484
|
+
agentId: event.agentId,
|
|
17485
|
+
reason: event.reason,
|
|
17486
|
+
multiplier: adjustment?.multiplier
|
|
17487
|
+
});
|
|
17488
|
+
return;
|
|
17489
|
+
}
|
|
17490
|
+
log.info("TuneStage (enforce) \u2014 non-routing action, shadow-only", {
|
|
17491
|
+
kind: action.kind,
|
|
17492
|
+
signal: action.signal,
|
|
17493
|
+
detail: action.detail
|
|
17494
|
+
});
|
|
17495
|
+
return;
|
|
17496
|
+
}
|
|
17497
|
+
log.info("TuneStage (shadow) \u2014 intended action", {
|
|
17498
|
+
kind: action.kind,
|
|
17499
|
+
signal: action.signal,
|
|
17500
|
+
detail: action.detail
|
|
17501
|
+
});
|
|
17502
|
+
} catch (e) {
|
|
17503
|
+
log.warn("TuneStage handler error", { error: getErrorMessage(e) });
|
|
17504
|
+
}
|
|
17505
|
+
});
|
|
17506
|
+
}
|
|
17507
|
+
var cachedTuneUnsubscribe = null;
|
|
17508
|
+
function startTuneStage(bus, options) {
|
|
17509
|
+
if (cachedTuneUnsubscribe !== null) return;
|
|
17510
|
+
const enabled = options?.enabled ?? parseBoolEnv(TUNE_ENFORCE_ENV, false);
|
|
17511
|
+
cachedTuneUnsubscribe = createTuneStage(bus, { ...options, enabled });
|
|
17512
|
+
}
|
|
17513
|
+
function shutdownTuneStage() {
|
|
17514
|
+
if (cachedTuneUnsubscribe !== null) {
|
|
17515
|
+
cachedTuneUnsubscribe();
|
|
17516
|
+
cachedTuneUnsubscribe = null;
|
|
17517
|
+
}
|
|
17518
|
+
}
|
|
17519
|
+
|
|
17429
17520
|
// src/mcp/gateway/upstream-client.ts
|
|
17430
17521
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
17431
17522
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
@@ -17951,6 +18042,9 @@ function initV2PipelineSubsystems(logger18) {
|
|
|
17951
18042
|
const pipelineEventBus = getPipelineEventBus();
|
|
17952
18043
|
const bridge = createEventBusBridge({ source: pipelineEventBus });
|
|
17953
18044
|
startFeedbackSubscriber(pipelineEventBus, getOutcomeStore());
|
|
18045
|
+
startTuneStage(pipelineEventBus);
|
|
18046
|
+
startSwarmHealthSignals(getSwarmObserver(), pipelineEventBus);
|
|
18047
|
+
startFailoverSignals({ pipelineBus: pipelineEventBus });
|
|
17954
18048
|
const policyEngine = createDefaultPolicyEngine();
|
|
17955
18049
|
const v2Config = resolveV2Config();
|
|
17956
18050
|
logger18.info("V2 Pipeline OS initialized", {
|
|
@@ -19276,7 +19370,7 @@ function adaptConfigToLibrary(config) {
|
|
|
19276
19370
|
}
|
|
19277
19371
|
function createBeliefPromoter() {
|
|
19278
19372
|
return async (event) => {
|
|
19279
|
-
const { getToolMemory } = await import("./tool-memory-
|
|
19373
|
+
const { getToolMemory } = await import("./tool-memory-YWX4FTIQ.js");
|
|
19280
19374
|
const tm = getToolMemory();
|
|
19281
19375
|
await tm.recordBelief(
|
|
19282
19376
|
`skill:${event.name}`,
|
|
@@ -19590,6 +19684,9 @@ function createShutdownCleanup(options) {
|
|
|
19590
19684
|
shutdownToolMemory();
|
|
19591
19685
|
await shutdownExpertBridge();
|
|
19592
19686
|
shutdownFeedbackSubscriber();
|
|
19687
|
+
shutdownTuneStage();
|
|
19688
|
+
shutdownSwarmHealthSignals();
|
|
19689
|
+
shutdownFailoverSignals();
|
|
19593
19690
|
const closeResult = await closeServer(server, serverLogger);
|
|
19594
19691
|
if (!closeResult.ok) {
|
|
19595
19692
|
throw new Error(closeResult.error.message);
|
|
@@ -20139,7 +20236,7 @@ async function handleResearchCommand(args) {
|
|
|
20139
20236
|
}
|
|
20140
20237
|
}
|
|
20141
20238
|
async function handleRegistryCommand(args) {
|
|
20142
|
-
const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-
|
|
20239
|
+
const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-FYVOMCBG.js");
|
|
20143
20240
|
const subcommand = args.subcommand;
|
|
20144
20241
|
if (!isValidRegistrySubcommand(subcommand)) {
|
|
20145
20242
|
process.stdout.write(`${formatRegistryUsage()}
|
|
@@ -20187,7 +20284,7 @@ async function handleVerifyCommand(args) {
|
|
|
20187
20284
|
async function handleDoctorCommand(args) {
|
|
20188
20285
|
const exitCode = await doctorCommand({ fix: args.options.fix });
|
|
20189
20286
|
if (args.options.deep) {
|
|
20190
|
-
const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-
|
|
20287
|
+
const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-VFBQ7TY4.js");
|
|
20191
20288
|
const diag = runDeepDiagnostics2();
|
|
20192
20289
|
process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
|
|
20193
20290
|
}
|
|
@@ -20231,7 +20328,7 @@ async function handleInitCommand(args) {
|
|
|
20231
20328
|
process.exit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
|
|
20232
20329
|
}
|
|
20233
20330
|
async function runInitOpencodeFlow(args) {
|
|
20234
|
-
const { runInitOpencode } = await import("./init-opencode-
|
|
20331
|
+
const { runInitOpencode } = await import("./init-opencode-Y6XKR6WS.js");
|
|
20235
20332
|
const opencodePath = args.options.opencode;
|
|
20236
20333
|
if (opencodePath === void 0 || opencodePath === "") {
|
|
20237
20334
|
process.stderr.write("Error: --opencode requires a path argument.\n");
|
|
@@ -20258,7 +20355,7 @@ async function runInitOpencodeFlow(args) {
|
|
|
20258
20355
|
process.exit(EXIT_CODES.SUCCESS);
|
|
20259
20356
|
}
|
|
20260
20357
|
async function renderOpencodeValidate(opencodePath) {
|
|
20261
|
-
const { runOpencodeValidate } = await import("./init-opencode-
|
|
20358
|
+
const { runOpencodeValidate } = await import("./init-opencode-Y6XKR6WS.js");
|
|
20262
20359
|
const result = await runOpencodeValidate(opencodePath);
|
|
20263
20360
|
if (!result.ok) {
|
|
20264
20361
|
process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
|
|
@@ -20298,7 +20395,7 @@ async function handleSetupCommandAsync(args) {
|
|
|
20298
20395
|
process.exit(exitCode === 0 ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
|
|
20299
20396
|
}
|
|
20300
20397
|
async function runCustomApiSetup(args) {
|
|
20301
|
-
const { configureCustomApi } = await import("./setup-custom-api-
|
|
20398
|
+
const { configureCustomApi } = await import("./setup-custom-api-3M7CU3TF.js");
|
|
20302
20399
|
const baseUrl = args.options.customApi;
|
|
20303
20400
|
if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
|
|
20304
20401
|
const input = {
|