@skrr-ai/cli 0.1.50 → 0.1.51
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/base-command.js +59 -2
- package/dist/commands/agents/chat.d.ts +14 -0
- package/dist/commands/agents/chat.js +37 -1
- package/dist/commands/agents/show.d.ts +9 -0
- package/dist/commands/agents/show.js +53 -0
- package/dist/commands/agents/update.d.ts +9 -0
- package/dist/commands/agents/update.js +27 -0
- package/dist/commands/balance/show.d.ts +34 -0
- package/dist/commands/balance/show.js +92 -2
- package/dist/commands/commitments/doctor.d.ts +1 -0
- package/dist/commands/commitments/doctor.js +19 -4
- package/dist/commands/commitments/effective-policy.js +15 -1
- package/dist/commands/commitments/next-tick.js +3 -1
- package/dist/commands/commitments/preflight.js +10 -0
- package/dist/commands/commitments/show.js +11 -1
- package/dist/commands/daemon/config.d.ts +15 -0
- package/dist/commands/daemon/config.js +38 -0
- package/dist/commands/daemon/index.js +1 -0
- package/dist/commands/daemon/status.js +15 -1
- package/dist/commands/harnesses/models.d.ts +54 -0
- package/dist/commands/harnesses/models.js +100 -7
- package/dist/commands/harnesses/show.d.ts +11 -0
- package/dist/commands/harnesses/show.js +35 -0
- package/dist/commands/harnesses/update.d.ts +28 -1
- package/dist/commands/harnesses/update.js +73 -10
- package/dist/commands/outbox/list.d.ts +12 -1
- package/dist/commands/outbox/list.js +31 -2
- package/dist/commands/revoke-daemon.js +9 -0
- package/dist/commands/spaces/create.d.ts +1 -0
- package/dist/commands/spaces/create.js +17 -0
- package/dist/commands/spaces/show.js +5 -0
- package/dist/commands/spaces/update.d.ts +1 -0
- package/dist/commands/spaces/update.js +16 -0
- package/dist/commands/tasks/create.d.ts +1 -0
- package/dist/commands/tasks/create.js +5 -0
- package/dist/commands/tasks/show.js +45 -0
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +21 -0
- package/dist/commands/tasks/upsert.d.ts +1 -0
- package/dist/commands/tasks/upsert.js +16 -0
- package/dist/lib/agentic-stream.d.ts +68 -1
- package/dist/lib/agentic-stream.js +294 -7
- package/dist/lib/auth-core-init.d.ts +2 -10
- package/dist/lib/auth-core-init.js +20 -67
- package/dist/lib/auth-failure.d.ts +33 -0
- package/dist/lib/auth-failure.js +65 -0
- package/dist/lib/commitments.d.ts +21 -1
- package/dist/lib/commitments.js +34 -0
- package/dist/lib/daemonBroker.d.ts +14 -0
- package/dist/lib/daemonBroker.js +64 -12
- package/dist/lib/delegated-cli.js +4 -1
- package/dist/lib/exec-runtime-binary.d.ts +3 -1
- package/dist/lib/exec-runtime-binary.js +4 -2
- package/dist/lib/first-party-harness-broker.js +4 -1
- package/dist/lib/harnesses.d.ts +10 -0
- package/dist/lib/live-runtime-binary.d.ts +40 -0
- package/dist/lib/live-runtime-binary.js +193 -0
- package/dist/lib/login.d.ts +23 -0
- package/dist/lib/login.js +44 -10
- package/dist/lib/message-intent.js +3 -1
- package/dist/lib/tasks.d.ts +20 -0
- package/dist/lib/tasks.js +54 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +26 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.d.ts +28 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +23 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +41 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +25 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loopbackHttp.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loopbackHttp.js +268 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineId.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineId.js +11 -10
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.d.ts +36 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +156 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +8 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +61 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +25 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.d.ts +28 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +22 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +41 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +10 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loopbackHttp.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loopbackHttp.js +257 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineId.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineId.js +11 -10
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.d.ts +36 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +147 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +8 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +22 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +58 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +21 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +1928 -1924
- package/oclif.manifest.json +23832 -23688
- package/package.json +1 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loopbackFetch = exports.LoopbackTargetRefusedError = exports.LOOPBACK_DEFAULT_MAX_BODY_BYTES = void 0;
|
|
7
|
+
exports.isLoopbackAddress = isLoopbackAddress;
|
|
8
|
+
exports.isLoopbackHostname = isLoopbackHostname;
|
|
9
|
+
exports.assertLoopbackHttpUrl = assertLoopbackHttpUrl;
|
|
10
|
+
/**
|
|
11
|
+
* OSK-12134 — the ONE HTTP client for talking to a process on this machine.
|
|
12
|
+
*
|
|
13
|
+
* ── Why this is not `fetch` ────────────────────────────────────────────────
|
|
14
|
+
*
|
|
15
|
+
* The compiled daemon runs on Bun, and Bun's `fetch` routes EVERY URL through
|
|
16
|
+
* `HTTP_PROXY` / `HTTPS_PROXY` unless `NO_PROXY` names it — a `127.0.0.1`
|
|
17
|
+
* target included. Node's `fetch` does the same once `NODE_USE_ENV_PROXY=1` is
|
|
18
|
+
* set (Node 22.21+/24). On a laptop with a local proxy exported in the shell
|
|
19
|
+
* (Clash, Surge, a corporate agent, …) every loopback call the daemon, a
|
|
20
|
+
* wrapper, or the CLI made with `fetch` was delivered to that proxy instead —
|
|
21
|
+
* WITH its credential: the daemon's local secret, the CLI-handoff descriptor
|
|
22
|
+
* secret, the wrapper fan-out bearer, the browser bridge token, the extension
|
|
23
|
+
* relay token. OSK-12087 found this on the `/health` probe and moved that one
|
|
24
|
+
* caller to `node:http`; this module is that fix made the only way to do it.
|
|
25
|
+
*
|
|
26
|
+
* `node:http` never consults proxy environment variables, on Node or on Bun, so
|
|
27
|
+
* a request made through it cannot be routed off the machine by environment.
|
|
28
|
+
*
|
|
29
|
+
* ── What it refuses ────────────────────────────────────────────────────────
|
|
30
|
+
*
|
|
31
|
+
* Only `http:` URLs whose host is a loopback name or address are accepted
|
|
32
|
+
* (`127.0.0.0/8`, `::1`, `localhost`). Anything else throws BEFORE a socket is
|
|
33
|
+
* opened: a caller that builds its URL from a descriptor or an environment
|
|
34
|
+
* variable must not be turned into an SSRF primitive by a hostile value, and a
|
|
35
|
+
* credential that is only meant for this machine must not be sent anywhere
|
|
36
|
+
* else. `localhost` is resolved through a lookup that rejects any non-loopback
|
|
37
|
+
* answer, so a rewritten hosts file cannot redirect it either.
|
|
38
|
+
*
|
|
39
|
+
* ── Shape ──────────────────────────────────────────────────────────────────
|
|
40
|
+
*
|
|
41
|
+
* `loopbackFetch` is a drop-in for the subset of `fetch` these callers use —
|
|
42
|
+
* method, headers, a string/bytes body, an `AbortSignal` — and returns a real
|
|
43
|
+
* `Response`, so existing callers (and their `fetchImpl` test seams) change one
|
|
44
|
+
* identifier. Transport failures reject with `TypeError('fetch failed')` whose
|
|
45
|
+
* `cause` carries the socket error (`ECONNREFUSED`, …), and aborts reject with
|
|
46
|
+
* the signal's reason, exactly as `fetch` does, so existing error handling keeps
|
|
47
|
+
* working. The response body is buffered (bounded by `maxBodyBytes`); nothing
|
|
48
|
+
* on loopback streams through this client.
|
|
49
|
+
*/
|
|
50
|
+
const node_dns_1 = __importDefault(require("node:dns"));
|
|
51
|
+
const node_http_1 = __importDefault(require("node:http"));
|
|
52
|
+
const node_net_1 = __importDefault(require("node:net"));
|
|
53
|
+
/** Loopback host names this client will connect to, besides 127/8 and ::1 literals. */
|
|
54
|
+
const LOOPBACK_NAMES = new Set(['localhost']);
|
|
55
|
+
/** Upper bound on a buffered response body. Loopback control-plane bodies are small. */
|
|
56
|
+
exports.LOOPBACK_DEFAULT_MAX_BODY_BYTES = 16 * 1024 * 1024;
|
|
57
|
+
/** Statuses a `Response` must be constructed with a null body for. */
|
|
58
|
+
const NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
|
|
59
|
+
/** Thrown (synchronously surfaced as a rejection) for a URL that is not loopback HTTP. */
|
|
60
|
+
class LoopbackTargetRefusedError extends Error {
|
|
61
|
+
code = 'LOOPBACK_TARGET_REFUSED';
|
|
62
|
+
constructor(message) {
|
|
63
|
+
super(message);
|
|
64
|
+
this.name = 'LoopbackTargetRefusedError';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.LoopbackTargetRefusedError = LoopbackTargetRefusedError;
|
|
68
|
+
function stripBrackets(hostname) {
|
|
69
|
+
return hostname.startsWith('[') && hostname.endsWith(']') ? hostname.slice(1, -1) : hostname;
|
|
70
|
+
}
|
|
71
|
+
/** True for an IP literal in 127.0.0.0/8, `::1`, or an IPv4-mapped 127/8 address. */
|
|
72
|
+
function isLoopbackAddress(address) {
|
|
73
|
+
const value = stripBrackets(address.trim().toLowerCase());
|
|
74
|
+
if (node_net_1.default.isIPv4(value))
|
|
75
|
+
return value.split('.')[0] === '127';
|
|
76
|
+
if (node_net_1.default.isIPv6(value)) {
|
|
77
|
+
if (value === '::1' || value === '0:0:0:0:0:0:0:1')
|
|
78
|
+
return true;
|
|
79
|
+
// IPv4-mapped (::ffff:127.0.0.1, which WHATWG URL normalizes to ::ffff:7f00:1).
|
|
80
|
+
if (value.startsWith('::ffff:')) {
|
|
81
|
+
const rest = value.slice('::ffff:'.length);
|
|
82
|
+
if (node_net_1.default.isIPv4(rest))
|
|
83
|
+
return isLoopbackAddress(rest);
|
|
84
|
+
const high = /^([0-9a-f]{1,4}):[0-9a-f]{1,4}$/.exec(rest);
|
|
85
|
+
return high ? parseInt(high[1], 16) >> 8 === 127 : false;
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
/** True for a host name or address this client accepts as "this machine". */
|
|
92
|
+
function isLoopbackHostname(hostname) {
|
|
93
|
+
const value = stripBrackets(hostname.trim().toLowerCase());
|
|
94
|
+
return LOOPBACK_NAMES.has(value) || isLoopbackAddress(value);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Parse and validate a loopback HTTP URL. Throws {@link LoopbackTargetRefusedError}
|
|
98
|
+
* for anything that is not `http:` to a loopback host.
|
|
99
|
+
*/
|
|
100
|
+
function assertLoopbackHttpUrl(input) {
|
|
101
|
+
let url;
|
|
102
|
+
try {
|
|
103
|
+
url = new URL(String(input));
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
throw new LoopbackTargetRefusedError('Loopback request refused: not a valid URL.');
|
|
107
|
+
}
|
|
108
|
+
if (url.protocol !== 'http:') {
|
|
109
|
+
throw new LoopbackTargetRefusedError(`Loopback request refused: only http: is allowed on loopback (got ${url.protocol}).`);
|
|
110
|
+
}
|
|
111
|
+
if (!isLoopbackHostname(url.hostname)) {
|
|
112
|
+
throw new LoopbackTargetRefusedError(`Loopback request refused: ${url.hostname} is not a loopback host.`);
|
|
113
|
+
}
|
|
114
|
+
if (url.username || url.password) {
|
|
115
|
+
throw new LoopbackTargetRefusedError('Loopback request refused: URL must not carry userinfo.');
|
|
116
|
+
}
|
|
117
|
+
return url;
|
|
118
|
+
}
|
|
119
|
+
/** A `dns.lookup` that only ever answers with a loopback address. */
|
|
120
|
+
const loopbackOnlyLookup = (hostname, options, callback) => {
|
|
121
|
+
node_dns_1.default.lookup(hostname, { ...options, all: true }, (err, addresses) => {
|
|
122
|
+
if (err) {
|
|
123
|
+
callback(err, '', 0);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const list = (Array.isArray(addresses) ? addresses : []);
|
|
127
|
+
const loopback = list.filter((entry) => isLoopbackAddress(entry.address));
|
|
128
|
+
if (loopback.length === 0) {
|
|
129
|
+
const refused = Object.assign(new Error(`${hostname} did not resolve to a loopback address`), { code: 'LOOPBACK_TARGET_REFUSED' });
|
|
130
|
+
callback(refused, '', 0);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (options?.all) {
|
|
134
|
+
callback(null, loopback);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
callback(null, loopback[0].address, loopback[0].family);
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
function abortReason(signal) {
|
|
141
|
+
return signal.reason !== undefined
|
|
142
|
+
? signal.reason
|
|
143
|
+
: new DOMException('This operation was aborted', 'AbortError');
|
|
144
|
+
}
|
|
145
|
+
function fetchFailed(cause) {
|
|
146
|
+
return new TypeError('fetch failed', { cause });
|
|
147
|
+
}
|
|
148
|
+
function toBodyBuffer(body) {
|
|
149
|
+
if (body === undefined || body === null)
|
|
150
|
+
return null;
|
|
151
|
+
if (typeof body === 'string')
|
|
152
|
+
return Buffer.from(body, 'utf8');
|
|
153
|
+
if (body instanceof ArrayBuffer)
|
|
154
|
+
return Buffer.from(body);
|
|
155
|
+
if (ArrayBuffer.isView(body))
|
|
156
|
+
return Buffer.from(body.buffer, body.byteOffset, body.byteLength);
|
|
157
|
+
throw new TypeError('loopbackFetch supports only string or byte bodies');
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* `fetch` for a loopback URL, over `node:http`, never through a proxy.
|
|
161
|
+
* Refuses (rejects with {@link LoopbackTargetRefusedError}) any other target.
|
|
162
|
+
*/
|
|
163
|
+
const loopbackFetch = (input, init = {}) => {
|
|
164
|
+
let url;
|
|
165
|
+
let payload;
|
|
166
|
+
try {
|
|
167
|
+
url = assertLoopbackHttpUrl(input);
|
|
168
|
+
payload = toBodyBuffer(init.body);
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
return Promise.reject(err);
|
|
172
|
+
}
|
|
173
|
+
const signal = init.signal ?? undefined;
|
|
174
|
+
if (signal?.aborted)
|
|
175
|
+
return Promise.reject(abortReason(signal));
|
|
176
|
+
const maxBodyBytes = init.maxBodyBytes ?? exports.LOOPBACK_DEFAULT_MAX_BODY_BYTES;
|
|
177
|
+
const method = (init.method ?? 'GET').toUpperCase();
|
|
178
|
+
const headers = {};
|
|
179
|
+
new Headers(init.headers ?? undefined).forEach((value, name) => {
|
|
180
|
+
headers[name] = value;
|
|
181
|
+
});
|
|
182
|
+
if (payload && headers['content-length'] === undefined) {
|
|
183
|
+
headers['content-length'] = String(payload.length);
|
|
184
|
+
}
|
|
185
|
+
return new Promise((resolve, reject) => {
|
|
186
|
+
let settled = false;
|
|
187
|
+
let req;
|
|
188
|
+
const onAbort = () => {
|
|
189
|
+
if (settled)
|
|
190
|
+
return;
|
|
191
|
+
settled = true;
|
|
192
|
+
req?.destroy();
|
|
193
|
+
reject(abortReason(signal));
|
|
194
|
+
};
|
|
195
|
+
const finish = (fn) => {
|
|
196
|
+
if (settled)
|
|
197
|
+
return;
|
|
198
|
+
settled = true;
|
|
199
|
+
signal?.removeEventListener('abort', onAbort);
|
|
200
|
+
fn();
|
|
201
|
+
};
|
|
202
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
203
|
+
try {
|
|
204
|
+
req = node_http_1.default.request({
|
|
205
|
+
protocol: 'http:',
|
|
206
|
+
host: stripBrackets(url.hostname),
|
|
207
|
+
port: url.port ? Number(url.port) : 80,
|
|
208
|
+
path: `${url.pathname}${url.search}`,
|
|
209
|
+
method,
|
|
210
|
+
headers,
|
|
211
|
+
// No pooled agent: a short-lived command must be able to exit as soon
|
|
212
|
+
// as it has its answer, and no socket outlives its request.
|
|
213
|
+
agent: false,
|
|
214
|
+
lookup: loopbackOnlyLookup,
|
|
215
|
+
}, (res) => {
|
|
216
|
+
const chunks = [];
|
|
217
|
+
let size = 0;
|
|
218
|
+
res.on('data', (chunk) => {
|
|
219
|
+
size += chunk.length;
|
|
220
|
+
if (size > maxBodyBytes) {
|
|
221
|
+
res.destroy();
|
|
222
|
+
finish(() => reject(fetchFailed(new Error(`response larger than ${maxBodyBytes} bytes`))));
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
chunks.push(chunk);
|
|
226
|
+
});
|
|
227
|
+
res.on('error', (err) => finish(() => reject(fetchFailed(err))));
|
|
228
|
+
res.on('aborted', () => finish(() => reject(fetchFailed(new Error('response aborted')))));
|
|
229
|
+
res.on('end', () => {
|
|
230
|
+
finish(() => {
|
|
231
|
+
const status = res.statusCode ?? 0;
|
|
232
|
+
const responseHeaders = new Headers();
|
|
233
|
+
for (const [name, value] of Object.entries(res.headers)) {
|
|
234
|
+
if (value === undefined)
|
|
235
|
+
continue;
|
|
236
|
+
if (Array.isArray(value)) {
|
|
237
|
+
for (const v of value)
|
|
238
|
+
responseHeaders.append(name, v);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
responseHeaders.set(name, String(value));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const body = NULL_BODY_STATUSES.has(status) ? null : Buffer.concat(chunks);
|
|
245
|
+
try {
|
|
246
|
+
resolve(new Response(body, {
|
|
247
|
+
status,
|
|
248
|
+
statusText: res.statusMessage ?? '',
|
|
249
|
+
headers: responseHeaders,
|
|
250
|
+
}));
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
reject(fetchFailed(err));
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
req.on('error', (err) => finish(() => reject(fetchFailed(err))));
|
|
259
|
+
if (payload)
|
|
260
|
+
req.write(payload);
|
|
261
|
+
req.end();
|
|
262
|
+
}
|
|
263
|
+
catch (err) {
|
|
264
|
+
finish(() => reject(fetchFailed(err)));
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
exports.loopbackFetch = loopbackFetch;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* with a real UUIDv7 downstream.
|
|
11
11
|
*
|
|
12
12
|
* The caller may pass `machineUuidFallback` to override the default
|
|
13
|
-
* hostname+platform fingerprint with a richer detector (e.g.
|
|
14
|
-
*
|
|
13
|
+
* hostname+platform fingerprint with a richer detector (e.g.
|
|
14
|
+
* `getMachineUuid()` from `machineUuid.ts`).
|
|
15
15
|
*/
|
|
16
16
|
export declare function ensureMachineDaemonId(machineUuidFallback?: () => string): string;
|
|
17
17
|
/**
|
|
@@ -23,11 +23,13 @@ exports.__resetCachedDaemonIdForTest = __resetCachedDaemonIdForTest;
|
|
|
23
23
|
* directory survives), and a user whose machineUuid changes can
|
|
24
24
|
* still be re-anchored via the legacy-id list.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* This id is NOT the `machineUuid` the server keys Daemon rows on. That
|
|
27
|
+
* is the hardware id from `getMachineUuid()` (`machineUuid.ts`), and the
|
|
28
|
+
* two must never be substituted for each other on the wire: OSK-12063
|
|
29
|
+
* was the CLI sending this id as `machineUuid` on device-key enrollment,
|
|
30
|
+
* which matched no Daemon row and 404'd forever. The fallback used when
|
|
31
|
+
* this file cannot be persisted is supplied by the consumer via the
|
|
32
|
+
* `machineUuidFallback` parameter (the daemon passes `getMachineUuid`).
|
|
31
33
|
*/
|
|
32
34
|
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
33
35
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
@@ -108,9 +110,8 @@ function writeDaemonIdFile(target, id) {
|
|
|
108
110
|
* SHA-256 of `os.hostname()` + `os.platform()` — better than just
|
|
109
111
|
* hostname (includes platform) but worse than a true hardware UUID.
|
|
110
112
|
*
|
|
111
|
-
* The daemon overrides this with
|
|
112
|
-
* (`
|
|
113
|
-
* no native deps for OS UUIDs and so accepts this default.
|
|
113
|
+
* The daemon overrides this with the hardware detector
|
|
114
|
+
* (`getMachineUuid()`, `machineUuid.ts`).
|
|
114
115
|
*/
|
|
115
116
|
function defaultMachineUuidFallback() {
|
|
116
117
|
const host = node_os_1.default.hostname() || 'unknown-host';
|
|
@@ -129,8 +130,8 @@ function defaultMachineUuidFallback() {
|
|
|
129
130
|
* with a real UUIDv7 downstream.
|
|
130
131
|
*
|
|
131
132
|
* The caller may pass `machineUuidFallback` to override the default
|
|
132
|
-
* hostname+platform fingerprint with a richer detector (e.g.
|
|
133
|
-
*
|
|
133
|
+
* hostname+platform fingerprint with a richer detector (e.g.
|
|
134
|
+
* `getMachineUuid()` from `machineUuid.ts`).
|
|
134
135
|
*/
|
|
135
136
|
function ensureMachineDaemonId(machineUuidFallback) {
|
|
136
137
|
if (cachedStableDaemonId !== null)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon sources whose identity is ISSUED by the control plane rather than
|
|
3
|
+
* derived from the host: the provisioner mints the daemon id and machine uuid
|
|
4
|
+
* before the daemon exists, and every binary on the runtime must use exactly
|
|
5
|
+
* those values.
|
|
6
|
+
*
|
|
7
|
+
* `dedicated-runtime` is here because the server's generation fence parses the
|
|
8
|
+
* lease generation out of the machine uuid (`dedicated-runtime:<lease>:<gen>`).
|
|
9
|
+
* A guest that fell back to `/etc/machine-id` would register under a uuid the
|
|
10
|
+
* fence cannot read, and every dispatch to it would be refused.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HOSTED_RUNTIME_MACHINE_SOURCES: ReadonlySet<string>;
|
|
13
|
+
/**
|
|
14
|
+
* The control-plane-issued value of `name` (e.g. `OVERSKY_MACHINE_UUID`), or
|
|
15
|
+
* null when this process is not on a hosted runtime or the value is absent /
|
|
16
|
+
* malformed. Only honoured under a hosted `OVERSKY_DAEMON_SOURCE`, so a stray
|
|
17
|
+
* variable on a laptop cannot rename the machine.
|
|
18
|
+
*/
|
|
19
|
+
export declare function hostedRuntimeIdOverride(name: string, env?: NodeJS.ProcessEnv): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Return a stable, machine-scoped UUID. Cached for the process lifetime.
|
|
22
|
+
*
|
|
23
|
+
* Callers should treat this as opaque: the format differs per platform
|
|
24
|
+
* (macOS IOPlatformUUID, Linux systemd machine-id, Windows MachineGuid).
|
|
25
|
+
* The guarantee is only: same machine -> same value across reboots, and the
|
|
26
|
+
* same value from every binary that calls this function.
|
|
27
|
+
*
|
|
28
|
+
* On a hosted runtime the control-plane-issued `OVERSKY_MACHINE_UUID` wins.
|
|
29
|
+
*
|
|
30
|
+
* Falls back to a deterministic hostname+username hash if the platform
|
|
31
|
+
* probe fails. This preserves server-side record continuity even on
|
|
32
|
+
* locked-down machines that refuse ioreg / registry access.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getMachineUuid(): string;
|
|
35
|
+
/** @internal test seam — forget the cached value so the next call re-probes. */
|
|
36
|
+
export declare function __resetMachineUuidCacheForTest(): void;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HOSTED_RUNTIME_MACHINE_SOURCES = void 0;
|
|
7
|
+
exports.hostedRuntimeIdOverride = hostedRuntimeIdOverride;
|
|
8
|
+
exports.getMachineUuid = getMachineUuid;
|
|
9
|
+
exports.__resetMachineUuidCacheForTest = __resetMachineUuidCacheForTest;
|
|
10
|
+
/**
|
|
11
|
+
* machineUuid.ts — the ONE hardware machine identity sent to the server as
|
|
12
|
+
* `machineUuid`, shared by the daemon and the CLI.
|
|
13
|
+
*
|
|
14
|
+
* Server Daemon rows are keyed on this value (daemon register, device-key
|
|
15
|
+
* enrollment, token mint, pairing), so every binary on one machine must
|
|
16
|
+
* compute it identically. Until OSK-12063 the CLI sent its own UUIDv7 from
|
|
17
|
+
* `~/.skrr/daemon.id` (`ensureMachineDaemonId()`, a DIFFERENT identity) as
|
|
18
|
+
* `machineUuid` on device-key enrollment while the daemon sent the hardware
|
|
19
|
+
* UUID computed here, so every CLI enrollment matched no Daemon row, got
|
|
20
|
+
* 404 DAEMON_NOT_FOUND and backed off forever. Two implementations of one
|
|
21
|
+
* identity can only agree by being edited together; this file is the one
|
|
22
|
+
* implementation, and `daemon/src/registry-lite.ts` re-exports it.
|
|
23
|
+
*
|
|
24
|
+
* Deliberately dependency-free (node builtins only) and exposed as the
|
|
25
|
+
* `@skrr-ai/auth-core/machine-uuid` subpath: the packaged desktop imports the
|
|
26
|
+
* daemon's `registry-lite.js` directly, and loading the full auth-core index
|
|
27
|
+
* there would drag in the credential stack for a one-function need.
|
|
28
|
+
*
|
|
29
|
+
* Not to be confused with `ensureMachineDaemonId()` (`machineId.ts`), the
|
|
30
|
+
* minted per-home-dir UUIDv7 that anchors the daemon's `stableDaemonId`. That
|
|
31
|
+
* one survives an OS reinstall; this one survives a home-dir wipe. They are
|
|
32
|
+
* different facts and neither may stand in for the other on the wire.
|
|
33
|
+
*/
|
|
34
|
+
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
35
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
36
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
37
|
+
const node_child_process_1 = require("node:child_process");
|
|
38
|
+
/**
|
|
39
|
+
* Daemon sources whose identity is ISSUED by the control plane rather than
|
|
40
|
+
* derived from the host: the provisioner mints the daemon id and machine uuid
|
|
41
|
+
* before the daemon exists, and every binary on the runtime must use exactly
|
|
42
|
+
* those values.
|
|
43
|
+
*
|
|
44
|
+
* `dedicated-runtime` is here because the server's generation fence parses the
|
|
45
|
+
* lease generation out of the machine uuid (`dedicated-runtime:<lease>:<gen>`).
|
|
46
|
+
* A guest that fell back to `/etc/machine-id` would register under a uuid the
|
|
47
|
+
* fence cannot read, and every dispatch to it would be refused.
|
|
48
|
+
*/
|
|
49
|
+
exports.HOSTED_RUNTIME_MACHINE_SOURCES = new Set([
|
|
50
|
+
'hosted-machine',
|
|
51
|
+
'cloud-coding',
|
|
52
|
+
'dedicated-runtime',
|
|
53
|
+
]);
|
|
54
|
+
const HOSTED_RUNTIME_ID_RE = /^[A-Za-z0-9_.:-]{1,160}$/;
|
|
55
|
+
/**
|
|
56
|
+
* The control-plane-issued value of `name` (e.g. `OVERSKY_MACHINE_UUID`), or
|
|
57
|
+
* null when this process is not on a hosted runtime or the value is absent /
|
|
58
|
+
* malformed. Only honoured under a hosted `OVERSKY_DAEMON_SOURCE`, so a stray
|
|
59
|
+
* variable on a laptop cannot rename the machine.
|
|
60
|
+
*/
|
|
61
|
+
function hostedRuntimeIdOverride(name, env = process.env) {
|
|
62
|
+
if (!exports.HOSTED_RUNTIME_MACHINE_SOURCES.has(env.OVERSKY_DAEMON_SOURCE ?? '')) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const value = env[name]?.trim();
|
|
66
|
+
if (!value || !HOSTED_RUNTIME_ID_RE.test(value))
|
|
67
|
+
return null;
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
let cachedMachineUuid = null;
|
|
71
|
+
function readMachineUuidDarwin() {
|
|
72
|
+
try {
|
|
73
|
+
const out = (0, node_child_process_1.execFileSync)('ioreg', ['-rd1', '-c', 'IOPlatformExpertDevice'], {
|
|
74
|
+
encoding: 'utf-8',
|
|
75
|
+
timeout: 2_000,
|
|
76
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
77
|
+
});
|
|
78
|
+
const match = out.match(/IOPlatformUUID"?\s*=\s*"?([0-9A-F-]{36})/i);
|
|
79
|
+
return match ? match[1].toLowerCase() : null;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function readMachineUuidLinux() {
|
|
86
|
+
for (const p of ['/etc/machine-id', '/var/lib/dbus/machine-id']) {
|
|
87
|
+
try {
|
|
88
|
+
const raw = node_fs_1.default.readFileSync(p, 'utf-8').trim();
|
|
89
|
+
if (raw)
|
|
90
|
+
return raw.toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// Try the next candidate.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
function readMachineUuidWindows() {
|
|
99
|
+
try {
|
|
100
|
+
const out = (0, node_child_process_1.execFileSync)('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Cryptography', '/v', 'MachineGuid'], { encoding: 'utf-8', timeout: 2_000, stdio: ['ignore', 'pipe', 'ignore'] });
|
|
101
|
+
const match = out.match(/MachineGuid\s+REG_SZ\s+([0-9A-Fa-f-]{36})/);
|
|
102
|
+
return match ? match[1].toLowerCase() : null;
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Return a stable, machine-scoped UUID. Cached for the process lifetime.
|
|
110
|
+
*
|
|
111
|
+
* Callers should treat this as opaque: the format differs per platform
|
|
112
|
+
* (macOS IOPlatformUUID, Linux systemd machine-id, Windows MachineGuid).
|
|
113
|
+
* The guarantee is only: same machine -> same value across reboots, and the
|
|
114
|
+
* same value from every binary that calls this function.
|
|
115
|
+
*
|
|
116
|
+
* On a hosted runtime the control-plane-issued `OVERSKY_MACHINE_UUID` wins.
|
|
117
|
+
*
|
|
118
|
+
* Falls back to a deterministic hostname+username hash if the platform
|
|
119
|
+
* probe fails. This preserves server-side record continuity even on
|
|
120
|
+
* locked-down machines that refuse ioreg / registry access.
|
|
121
|
+
*/
|
|
122
|
+
function getMachineUuid() {
|
|
123
|
+
const hostedMachineUuid = hostedRuntimeIdOverride('OVERSKY_MACHINE_UUID');
|
|
124
|
+
if (hostedMachineUuid)
|
|
125
|
+
return hostedMachineUuid;
|
|
126
|
+
if (cachedMachineUuid !== null)
|
|
127
|
+
return cachedMachineUuid;
|
|
128
|
+
let detected = null;
|
|
129
|
+
switch (process.platform) {
|
|
130
|
+
case 'darwin':
|
|
131
|
+
detected = readMachineUuidDarwin();
|
|
132
|
+
break;
|
|
133
|
+
case 'linux':
|
|
134
|
+
detected = readMachineUuidLinux();
|
|
135
|
+
break;
|
|
136
|
+
case 'win32':
|
|
137
|
+
detected = readMachineUuidWindows();
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (detected) {
|
|
141
|
+
cachedMachineUuid = detected;
|
|
142
|
+
return detected;
|
|
143
|
+
}
|
|
144
|
+
const fallback = 'fallback-' +
|
|
145
|
+
node_crypto_1.default
|
|
146
|
+
.createHash('sha256')
|
|
147
|
+
.update(`${node_os_1.default.hostname()}:${node_os_1.default.userInfo().username}`)
|
|
148
|
+
.digest('hex')
|
|
149
|
+
.slice(0, 32);
|
|
150
|
+
cachedMachineUuid = fallback;
|
|
151
|
+
return fallback;
|
|
152
|
+
}
|
|
153
|
+
/** @internal test seam — forget the cached value so the next call re-probes. */
|
|
154
|
+
function __resetMachineUuidCacheForTest() {
|
|
155
|
+
cachedMachineUuid = null;
|
|
156
|
+
}
|
|
@@ -274,6 +274,14 @@ export declare function persistReauthState(state: ReauthState): void;
|
|
|
274
274
|
export declare function needsReauthState(): {
|
|
275
275
|
needed: boolean;
|
|
276
276
|
reason?: string;
|
|
277
|
+
/**
|
|
278
|
+
* The server's own words for the refusal (`Refresh token bound to a different
|
|
279
|
+
* daemon`). The code alone collapses several distinct causes into one
|
|
280
|
+
* (`REFRESH_INVALID` is also "not recognized" and "issued without a
|
|
281
|
+
* daemonId"), and a surface that names only the code cannot tell the reader
|
|
282
|
+
* which one they hit (OSK-12116).
|
|
283
|
+
*/
|
|
284
|
+
message?: string;
|
|
277
285
|
since?: number;
|
|
278
286
|
};
|
|
279
287
|
export declare function clearReauthState(): void;
|
|
@@ -969,7 +969,14 @@ function needsReauthState() {
|
|
|
969
969
|
return { needed: false };
|
|
970
970
|
const raw = node_fs_1.default.readFileSync(flagPath, 'utf-8');
|
|
971
971
|
const state = JSON.parse(raw);
|
|
972
|
-
return {
|
|
972
|
+
return {
|
|
973
|
+
needed: true,
|
|
974
|
+
reason: state.code,
|
|
975
|
+
...(typeof state.message === 'string' && state.message.length > 0
|
|
976
|
+
? { message: state.message }
|
|
977
|
+
: {}),
|
|
978
|
+
since: state.at,
|
|
979
|
+
};
|
|
973
980
|
}
|
|
974
981
|
catch {
|
|
975
982
|
return { needed: false };
|
|
@@ -84,3 +84,25 @@ export declare const SENSITIVE_ENV_PREFIX_EXCEPTIONS: ReadonlySet<string>;
|
|
|
84
84
|
* etc.) so legitimate tools keep working.
|
|
85
85
|
*/
|
|
86
86
|
export declare function sanitizeSpawnEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
87
|
+
/**
|
|
88
|
+
* OSK-12134 — loopback names a spawned child must reach directly, never through
|
|
89
|
+
* a proxy. A harness talks to this machine constantly: the daemon's local
|
|
90
|
+
* bridges (browser, delegated CLI, message intents), the inference broker, and
|
|
91
|
+
* the engine's own loopback services (skrr Code's `session/new` reaches a local
|
|
92
|
+
* directory service and failed with "service failure" behind a shell proxy).
|
|
93
|
+
*/
|
|
94
|
+
export declare const LOOPBACK_NO_PROXY_HOSTS: readonly string[];
|
|
95
|
+
/** True when `env` names a proxy some client in the child might honour. */
|
|
96
|
+
export declare function envHasProxy(env: Readonly<Record<string, string | undefined>>): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Return `env` with the loopback hosts appended to BOTH `NO_PROXY` and
|
|
99
|
+
* `no_proxy`, when (and only when) it names a proxy. Tools disagree on which
|
|
100
|
+
* spelling they read and whether they fall back to the other, so an unset
|
|
101
|
+
* spelling is seeded from the other one before the hosts are appended —
|
|
102
|
+
* seeding only the hosts would silently drop every existing exemption for a
|
|
103
|
+
* tool that prefers the unset spelling. Existing entries keep their order.
|
|
104
|
+
*
|
|
105
|
+
* Exported for a parent that layers a proxy onto the child's env AFTER
|
|
106
|
+
* {@link sanitizeSpawnEnv}: call it again on the final map.
|
|
107
|
+
*/
|
|
108
|
+
export declare function withLoopbackNoProxy<T extends Record<string, string | undefined>>(env: T): T;
|
|
@@ -40,8 +40,10 @@
|
|
|
40
40
|
* serve that case: a deny-list with a hole is not a deny-list.
|
|
41
41
|
*/
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = void 0;
|
|
43
|
+
exports.LOOPBACK_NO_PROXY_HOSTS = exports.SENSITIVE_ENV_PREFIX_EXCEPTIONS = exports.SENSITIVE_ENV_NAME_TOKENS = exports.SENSITIVE_ENV_SUFFIXES = exports.SENSITIVE_ENV_PREFIXES = exports.SENSITIVE_ENV_VARS = void 0;
|
|
44
44
|
exports.sanitizeSpawnEnv = sanitizeSpawnEnv;
|
|
45
|
+
exports.envHasProxy = envHasProxy;
|
|
46
|
+
exports.withLoopbackNoProxy = withLoopbackNoProxy;
|
|
45
47
|
/**
|
|
46
48
|
* Env vars that must NEVER reach a spawned subprocess.
|
|
47
49
|
*
|
|
@@ -187,5 +189,62 @@ function sanitizeSpawnEnv(env) {
|
|
|
187
189
|
continue;
|
|
188
190
|
out[key] = value;
|
|
189
191
|
}
|
|
190
|
-
return out;
|
|
192
|
+
return withLoopbackNoProxy(out);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* OSK-12134 — loopback names a spawned child must reach directly, never through
|
|
196
|
+
* a proxy. A harness talks to this machine constantly: the daemon's local
|
|
197
|
+
* bridges (browser, delegated CLI, message intents), the inference broker, and
|
|
198
|
+
* the engine's own loopback services (skrr Code's `session/new` reaches a local
|
|
199
|
+
* directory service and failed with "service failure" behind a shell proxy).
|
|
200
|
+
*/
|
|
201
|
+
exports.LOOPBACK_NO_PROXY_HOSTS = ['127.0.0.1', 'localhost', '::1'];
|
|
202
|
+
const PROXY_ENV_VARS = [
|
|
203
|
+
'HTTP_PROXY',
|
|
204
|
+
'http_proxy',
|
|
205
|
+
'HTTPS_PROXY',
|
|
206
|
+
'https_proxy',
|
|
207
|
+
'ALL_PROXY',
|
|
208
|
+
'all_proxy',
|
|
209
|
+
];
|
|
210
|
+
/** True when `env` names a proxy some client in the child might honour. */
|
|
211
|
+
function envHasProxy(env) {
|
|
212
|
+
return PROXY_ENV_VARS.some((name) => typeof env[name] === 'string' && env[name].trim() !== '');
|
|
213
|
+
}
|
|
214
|
+
function appendNoProxyHosts(list, hosts) {
|
|
215
|
+
const entries = list
|
|
216
|
+
.split(',')
|
|
217
|
+
.map((entry) => entry.trim().toLowerCase())
|
|
218
|
+
.filter(Boolean);
|
|
219
|
+
// `*` already exempts everything, and some clients honour it only as the
|
|
220
|
+
// entire value, so appending to it would break them.
|
|
221
|
+
if (entries.includes('*'))
|
|
222
|
+
return list;
|
|
223
|
+
const missing = hosts.filter((host) => !entries.includes(host));
|
|
224
|
+
if (missing.length === 0)
|
|
225
|
+
return list;
|
|
226
|
+
const kept = list.replace(/[\s,]+$/, '');
|
|
227
|
+
return kept ? `${kept},${missing.join(',')}` : missing.join(',');
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Return `env` with the loopback hosts appended to BOTH `NO_PROXY` and
|
|
231
|
+
* `no_proxy`, when (and only when) it names a proxy. Tools disagree on which
|
|
232
|
+
* spelling they read and whether they fall back to the other, so an unset
|
|
233
|
+
* spelling is seeded from the other one before the hosts are appended —
|
|
234
|
+
* seeding only the hosts would silently drop every existing exemption for a
|
|
235
|
+
* tool that prefers the unset spelling. Existing entries keep their order.
|
|
236
|
+
*
|
|
237
|
+
* Exported for a parent that layers a proxy onto the child's env AFTER
|
|
238
|
+
* {@link sanitizeSpawnEnv}: call it again on the final map.
|
|
239
|
+
*/
|
|
240
|
+
function withLoopbackNoProxy(env) {
|
|
241
|
+
if (!envHasProxy(env))
|
|
242
|
+
return env;
|
|
243
|
+
const upper = env.NO_PROXY?.trim() ? env.NO_PROXY : undefined;
|
|
244
|
+
const lower = env.no_proxy?.trim() ? env.no_proxy : undefined;
|
|
245
|
+
return {
|
|
246
|
+
...env,
|
|
247
|
+
NO_PROXY: appendNoProxyHosts(upper ?? lower ?? '', exports.LOOPBACK_NO_PROXY_HOSTS),
|
|
248
|
+
no_proxy: appendNoProxyHosts(lower ?? upper ?? '', exports.LOOPBACK_NO_PROXY_HOSTS),
|
|
249
|
+
};
|
|
191
250
|
}
|
|
@@ -21,6 +21,8 @@ type DisabledReason = 'kek_unavailable' | 'init_failed' | 'platform_unsupported'
|
|
|
21
21
|
export declare function __setStateForTest(next: CredEnvelopeState): CredEnvelopeState;
|
|
22
22
|
/** @internal Test seam — read state for assertions. */
|
|
23
23
|
export declare function __getStateForTest(): CredEnvelopeState;
|
|
24
|
+
/** @internal Test seam — each spec owns its warn-dedupe horizon. */
|
|
25
|
+
export declare function __clearWarnDedupeForTest(): void;
|
|
24
26
|
/**
|
|
25
27
|
* Initialize the envelope path. Idempotent — second call when state is
|
|
26
28
|
* non-uninit returns immediately.
|