nexus-agents 2.55.0 → 2.56.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/{chunk-HQ43NDJW.js → chunk-BPMQRYGU.js} +6 -109
- package/dist/chunk-BPMQRYGU.js.map +1 -0
- package/dist/chunk-C3FGEDD7.js +2520 -0
- package/dist/chunk-C3FGEDD7.js.map +1 -0
- package/dist/{chunk-KTJIEY77.js → chunk-EJLWDYK7.js} +1985 -3653
- package/dist/chunk-EJLWDYK7.js.map +1 -0
- package/dist/{chunk-JEKPVSC4.js → chunk-KGMC6F5D.js} +357 -13
- package/dist/chunk-KGMC6F5D.js.map +1 -0
- package/dist/chunk-NUBSJGQZ.js +14 -0
- package/dist/chunk-NUBSJGQZ.js.map +1 -0
- package/dist/{chunk-JERFBN73.js → chunk-PCMWLXT4.js} +6 -16
- package/dist/chunk-PCMWLXT4.js.map +1 -0
- package/dist/chunk-R66AWJJ7.js +120 -0
- package/dist/chunk-R66AWJJ7.js.map +1 -0
- package/dist/cli.d.ts +9 -1
- package/dist/cli.js +337 -213
- package/dist/cli.js.map +1 -1
- package/dist/{consensus-vote-NRPXA57O.js → consensus-vote-G6H532ME.js} +3 -2
- package/dist/index.js +35 -32
- package/dist/index.js.map +1 -1
- package/dist/{research-helpers-synthesize-TFZIXBX3.js → research-helpers-synthesize-E6WQLQKP.js} +3 -2
- package/dist/{setup-command-NGAJEWE4.js → setup-command-AV4MODEL.js} +5 -3
- package/dist/setup-custom-api-XAWKRDWV.js +107 -0
- package/dist/setup-custom-api-XAWKRDWV.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-HQ43NDJW.js.map +0 -1
- package/dist/chunk-JEKPVSC4.js.map +0 -1
- package/dist/chunk-JERFBN73.js.map +0 -1
- package/dist/chunk-KTJIEY77.js.map +0 -1
- package/dist/chunk-SY344FS5.js +0 -839
- package/dist/chunk-SY344FS5.js.map +0 -1
- /package/dist/{consensus-vote-NRPXA57O.js.map → consensus-vote-G6H532ME.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-TFZIXBX3.js.map → research-helpers-synthesize-E6WQLQKP.js.map} +0 -0
- /package/dist/{setup-command-NGAJEWE4.js.map → setup-command-AV4MODEL.js.map} +0 -0
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CUSTOM_API_BASE_URL_ENV,
|
|
3
|
+
PROVIDER_ENV_KEYS,
|
|
4
|
+
validateCustomApiBaseUrl
|
|
5
|
+
} from "./chunk-R66AWJJ7.js";
|
|
1
6
|
import {
|
|
2
7
|
SessionMemory
|
|
3
8
|
} from "./chunk-NYNBDP7M.js";
|
|
@@ -2788,113 +2793,6 @@ function createClaudeAdapter(config) {
|
|
|
2788
2793
|
return new ClaudeAdapter(config);
|
|
2789
2794
|
}
|
|
2790
2795
|
|
|
2791
|
-
// src/adapters/sdk/types.ts
|
|
2792
|
-
var PROVIDER_ENV_KEYS = {
|
|
2793
|
-
anthropic: "ANTHROPIC_API_KEY",
|
|
2794
|
-
openai: "OPENAI_API_KEY",
|
|
2795
|
-
google: "GOOGLE_AI_API_KEY",
|
|
2796
|
-
"custom-openai": "NEXUS_CUSTOM_API_KEY"
|
|
2797
|
-
};
|
|
2798
|
-
var CUSTOM_API_BASE_URL_ENV = "NEXUS_CUSTOM_API_BASE_URL";
|
|
2799
|
-
var CUSTOM_API_ALLOW_PRIVATE_ENV = "NEXUS_CUSTOM_API_ALLOW_PRIVATE";
|
|
2800
|
-
|
|
2801
|
-
// src/adapters/sdk/custom-api-validation.ts
|
|
2802
|
-
import { isIPv4, isIPv6 } from "net";
|
|
2803
|
-
function validateCustomApiBaseUrl(raw, opts = {}) {
|
|
2804
|
-
if (raw === void 0 || raw.trim() === "") {
|
|
2805
|
-
return err(
|
|
2806
|
-
new ConfigError(
|
|
2807
|
-
"Custom API base URL is required but missing. Set NEXUS_CUSTOM_API_BASE_URL or pass `baseUrl` in config."
|
|
2808
|
-
)
|
|
2809
|
-
);
|
|
2810
|
-
}
|
|
2811
|
-
let url;
|
|
2812
|
-
try {
|
|
2813
|
-
url = new URL(raw);
|
|
2814
|
-
} catch {
|
|
2815
|
-
return err(new ConfigError(`Custom API base URL is not a valid URL: ${raw}`));
|
|
2816
|
-
}
|
|
2817
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
2818
|
-
return err(
|
|
2819
|
-
new ConfigError(`Custom API base URL must use http or https, got "${url.protocol}" in ${raw}`)
|
|
2820
|
-
);
|
|
2821
|
-
}
|
|
2822
|
-
const allowPrivate = opts.allowPrivate === true || resolveAllowPrivateFromEnv();
|
|
2823
|
-
if (!allowPrivate) {
|
|
2824
|
-
const rejection = classifyPrivateHost(url.hostname);
|
|
2825
|
-
if (rejection !== null) {
|
|
2826
|
-
return err(
|
|
2827
|
-
new ConfigError(
|
|
2828
|
-
`Custom API base URL rejected (SSRF guard, reason="${rejection.reason}"): ${rejection.message}. Set ${CUSTOM_API_ALLOW_PRIVATE_ENV}=1 to bypass if the gateway runs on a trusted internal host.`
|
|
2829
|
-
)
|
|
2830
|
-
);
|
|
2831
|
-
}
|
|
2832
|
-
}
|
|
2833
|
-
return ok(url);
|
|
2834
|
-
}
|
|
2835
|
-
function resolveAllowPrivateFromEnv() {
|
|
2836
|
-
const v = process.env[CUSTOM_API_ALLOW_PRIVATE_ENV];
|
|
2837
|
-
return v === "1" || v === "true";
|
|
2838
|
-
}
|
|
2839
|
-
function classifyPrivateHost(hostname) {
|
|
2840
|
-
const stripped = hostname.startsWith("[") && hostname.endsWith("]") ? hostname.slice(1, -1) : hostname;
|
|
2841
|
-
const normalized = stripped.toLowerCase();
|
|
2842
|
-
if (isIPv4(normalized)) {
|
|
2843
|
-
return classifyIPv4(normalized);
|
|
2844
|
-
}
|
|
2845
|
-
if (isIPv6(normalized)) {
|
|
2846
|
-
return classifyIPv6(normalized);
|
|
2847
|
-
}
|
|
2848
|
-
if (normalized === "localhost" || normalized.endsWith(".localhost") || normalized.endsWith(".local")) {
|
|
2849
|
-
return {
|
|
2850
|
-
reason: "loopback",
|
|
2851
|
-
message: `hostname "${hostname}" resolves to loopback/mDNS`
|
|
2852
|
-
};
|
|
2853
|
-
}
|
|
2854
|
-
return null;
|
|
2855
|
-
}
|
|
2856
|
-
var IPV4_RULES = [
|
|
2857
|
-
{ match: (a) => a === 127, reason: "loopback", label: "IPv4 loopback" },
|
|
2858
|
-
{ match: (a) => a === 10, reason: "private_range", label: "IPv4 private (10/8)" },
|
|
2859
|
-
{
|
|
2860
|
-
match: (a, b) => a === 172 && b >= 16 && b <= 31,
|
|
2861
|
-
reason: "private_range",
|
|
2862
|
-
label: "IPv4 private (172.16/12)"
|
|
2863
|
-
},
|
|
2864
|
-
{
|
|
2865
|
-
match: (a, b) => a === 192 && b === 168,
|
|
2866
|
-
reason: "private_range",
|
|
2867
|
-
label: "IPv4 private (192.168/16)"
|
|
2868
|
-
},
|
|
2869
|
-
{
|
|
2870
|
-
match: (a, b) => a === 169 && b === 254,
|
|
2871
|
-
reason: "link_local",
|
|
2872
|
-
label: "IPv4 link-local (169.254/16 \u2014 AWS IMDS)"
|
|
2873
|
-
},
|
|
2874
|
-
{ match: (a) => a === 0, reason: "reserved", label: "IPv4 reserved (0/8)" }
|
|
2875
|
-
];
|
|
2876
|
-
function classifyIPv4(ip) {
|
|
2877
|
-
const parts = ip.split(".").map((p) => Number.parseInt(p, 10));
|
|
2878
|
-
if (parts.length !== 4 || parts.some((n) => Number.isNaN(n))) return null;
|
|
2879
|
-
const [a, b] = parts;
|
|
2880
|
-
for (const rule of IPV4_RULES) {
|
|
2881
|
-
if (rule.match(a, b)) {
|
|
2882
|
-
return { reason: rule.reason, message: `${rule.label} (${ip})` };
|
|
2883
|
-
}
|
|
2884
|
-
}
|
|
2885
|
-
return null;
|
|
2886
|
-
}
|
|
2887
|
-
function classifyIPv6(ip) {
|
|
2888
|
-
const lower = ip.toLowerCase();
|
|
2889
|
-
if (lower === "::1") return { reason: "loopback", message: `IPv6 loopback (${ip})` };
|
|
2890
|
-
if (lower.startsWith("fe80:"))
|
|
2891
|
-
return { reason: "link_local", message: `IPv6 link-local (${ip})` };
|
|
2892
|
-
if (/^fc|^fd/.test(lower)) {
|
|
2893
|
-
return { reason: "private_range", message: `IPv6 unique-local (${ip}, fc00::/7)` };
|
|
2894
|
-
}
|
|
2895
|
-
return null;
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
2796
|
// src/adapters/sdk/sdk-adapter.ts
|
|
2899
2797
|
function extractProviderFactory(mod, factoryName) {
|
|
2900
2798
|
const factory = mod[factoryName];
|
|
@@ -12968,7 +12866,6 @@ export {
|
|
|
12968
12866
|
CLAUDE_MODEL_ALIASES,
|
|
12969
12867
|
ClaudeAdapter,
|
|
12970
12868
|
createClaudeAdapter,
|
|
12971
|
-
PROVIDER_ENV_KEYS,
|
|
12972
12869
|
SdkAdapter,
|
|
12973
12870
|
getGlobalEventBus,
|
|
12974
12871
|
createEvent,
|
|
@@ -13079,4 +12976,4 @@ export {
|
|
|
13079
12976
|
CONSENSUS_VOTE_OUTPUT_SCHEMA,
|
|
13080
12977
|
registerConsensusVoteTool
|
|
13081
12978
|
};
|
|
13082
|
-
//# sourceMappingURL=chunk-
|
|
12979
|
+
//# sourceMappingURL=chunk-BPMQRYGU.js.map
|