@signetai/connector-base 0.200.4 → 0.200.6
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/index.js +11 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -12406,7 +12406,12 @@ function expandHome(p, home = homedir2()) {
|
|
|
12406
12406
|
return join2(home, p.slice(2));
|
|
12407
12407
|
return p;
|
|
12408
12408
|
}
|
|
12409
|
-
var
|
|
12409
|
+
var LOOPBACK_HOST = "127.0.0.1";
|
|
12410
|
+
function normalizeLoopbackHost(host) {
|
|
12411
|
+
const normalized = host.trim().toLowerCase().replace(/^\[|\]$/g, "");
|
|
12412
|
+
return normalized === "localhost" || normalized === "::1" || normalized === "0:0:0:0:0:0:0:1" ? LOOPBACK_HOST : host;
|
|
12413
|
+
}
|
|
12414
|
+
var LOCAL_BINDS = new Set([LOOPBACK_HOST, "localhost", "::1", "::ffff:127.0.0.1"]);
|
|
12410
12415
|
var import_yaml2 = __toESM2(require_dist(), 1);
|
|
12411
12416
|
function readEnv(env, name) {
|
|
12412
12417
|
const value = env[name];
|
|
@@ -12465,18 +12470,21 @@ function normalizeDaemonUrl(raw, source) {
|
|
|
12465
12470
|
if (parsed.pathname !== "/" && parsed.pathname !== "") {
|
|
12466
12471
|
throw new Error(`${source} must point at the daemon origin, not a path: ${raw}`);
|
|
12467
12472
|
}
|
|
12473
|
+
if (normalizeLoopbackHost(parsed.hostname) !== parsed.hostname) {
|
|
12474
|
+
parsed.hostname = LOOPBACK_HOST;
|
|
12475
|
+
}
|
|
12468
12476
|
return parsed.toString().replace(/\/$/, "");
|
|
12469
12477
|
}
|
|
12470
12478
|
function resolveSignetDaemonUrl(opts = {}) {
|
|
12471
12479
|
const env = opts.env ?? process.env;
|
|
12472
|
-
const fallbackHost = opts.defaultHost ??
|
|
12480
|
+
const fallbackHost = opts.defaultHost ?? LOOPBACK_HOST;
|
|
12473
12481
|
const fallbackPort = opts.defaultPort ?? 3850;
|
|
12474
12482
|
const explicit = readEnv(env, "SIGNET_DAEMON_URL");
|
|
12475
12483
|
if (explicit)
|
|
12476
12484
|
return normalizeDaemonUrl(explicit, "SIGNET_DAEMON_URL");
|
|
12477
12485
|
if (opts.configUrl)
|
|
12478
12486
|
return normalizeDaemonUrl(opts.configUrl, "daemon.url");
|
|
12479
|
-
const host = readEnv(env, "SIGNET_HOST") ?? fallbackHost;
|
|
12487
|
+
const host = normalizeLoopbackHost(readEnv(env, "SIGNET_HOST") ?? fallbackHost);
|
|
12480
12488
|
assertPlainHost(host);
|
|
12481
12489
|
const port = normalizePort(readEnv(env, "SIGNET_PORT"), fallbackPort);
|
|
12482
12490
|
return normalizeDaemonUrl(`http://${bracketIpv6Host(host)}:${port}`, "SIGNET_HOST/SIGNET_PORT");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-base",
|
|
3
|
-
"version": "0.200.
|
|
3
|
+
"version": "0.200.6",
|
|
4
4
|
"description": "Base class for Signet harness connectors",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@signetai/core": "0.200.
|
|
29
|
+
"@signetai/core": "0.200.6",
|
|
30
30
|
"json5": "^2.2.3",
|
|
31
31
|
"jsonc-parser": "3.3.1"
|
|
32
32
|
},
|