skydive-cli 0.5.0-beta.31 → 0.5.0-beta.32
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/js/api-DQCaztBg.mjs +315 -0
- package/dist/js/{billing-blocked-Dgu5-oDy.mjs → billing-blocked-SE6tySLd.mjs} +1 -1
- package/dist/js/bin.mjs +34 -29
- package/dist/js/{boot-iaVSnd7h.mjs → boot-yyXrIeVy.mjs} +15 -11
- package/dist/js/chunk-BbwQpWto.mjs +33 -0
- package/dist/js/{client-DbqRBquD.mjs → client-d6K9qm6B.mjs} +70 -2
- package/dist/js/client-yz3zrpAS.mjs +5 -0
- package/dist/js/daemon-Btd2436i.mjs +7 -0
- package/dist/js/{daemon-BTyg329O.mjs → daemon-CxFxH36O.mjs} +4 -2
- package/dist/js/daemon-client-1Qfc_Y3J.mjs +8 -0
- package/dist/js/{daemon-client--A_yMKq6.mjs → daemon-client-Br1NlkRp.mjs} +1 -1
- package/dist/js/dist-CRtjM7ba.mjs +1750 -0
- package/dist/js/{forward-DL6DYqyc.mjs → forward-zwB55Bls.mjs} +25 -4
- package/dist/js/localhost-cert-Bn-UBUmj.mjs +67 -0
- package/dist/js/{print-DACzRUwQ.mjs → print-B9djx8GU.mjs} +3 -3
- package/dist/js/{print-C_TnQSPg.mjs → print-Clgq46GU.mjs} +3 -3
- package/dist/js/{print-share-BH9gvCls.mjs → print-share-BBy3OTno.mjs} +6 -2
- package/dist/js/{profiler-BVbYs_Yg.mjs → profiler-CJMnC90G.mjs} +2 -2
- package/dist/js/{raw-pty-DY4KelZW.mjs → raw-pty-B9Bue8gg.mjs} +1 -1
- package/dist/js/raw-pty-g3kATVQe.mjs +5 -0
- package/dist/js/{rest-CgfbKXst.mjs → rest-C6E4mS2A.mjs} +2 -2
- package/dist/js/rest-CaWUSrnH.mjs +6 -0
- package/dist/js/tls-cert-CLgSQALB.mjs +4 -0
- package/dist/js/tls-cert-CV-pwxVN.mjs +67 -0
- package/package.json +1 -1
- package/dist/js/api-DG5W6iwx.mjs +0 -131
- package/dist/js/client-hH2PJL8y.mjs +0 -5
- package/dist/js/daemon-SPQgtsbW.mjs +0 -6
- package/dist/js/daemon-client-C7emKKlj.mjs +0 -7
- package/dist/js/raw-pty-DmdUf4_w.mjs +0 -5
- package/dist/js/rest-VV5nc-Mn.mjs +0 -6
- /package/dist/js/{billing-blocked-2wju4gC_.mjs → billing-blocked-D3l5kJlX.mjs} +0 -0
- /package/dist/js/{client-c4c5MmgN.mjs → client-BTQ1fwzM.mjs} +0 -0
- /package/dist/js/{http-error-DzyrsLAZ.mjs → http-error-UHH3mVBF.mjs} +0 -0
- /package/dist/js/{output-DYzzdXYV.mjs → output-wY0VQDea.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as mintPortalDeviceToken, c as unifyLegacyCliGrants, i as grantPortalAccess, n as fetchPortalDevices, r as findThisDevice } from "./api-
|
|
2
|
+
import { a as mintPortalDeviceToken, c as unifyLegacyCliGrants, i as grantPortalAccess, l as startTlsForward, n as fetchPortalDevices, r as findThisDevice } from "./api-DQCaztBg.mjs";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import * as childProcess from "node:child_process";
|
|
@@ -237,10 +237,36 @@ function decodeFrame(frame) {
|
|
|
237
237
|
*/
|
|
238
238
|
var ReverseListener = class {
|
|
239
239
|
server = null;
|
|
240
|
+
tls = null;
|
|
240
241
|
conns = /* @__PURE__ */ new Set();
|
|
241
242
|
constructor(opts) {
|
|
242
243
|
this.opts = opts;
|
|
243
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* One tunnel to the sandbox target — the same per-connection edge dial the
|
|
247
|
+
* plain accept path inlines, shaped for the TLS listener's acquireTunnel
|
|
248
|
+
* seam. Resolves once the upgrade completes, with the duplex PAUSED so no
|
|
249
|
+
* early bytes drop before adoption.
|
|
250
|
+
*/
|
|
251
|
+
dialTunnel() {
|
|
252
|
+
const { dialOrigin, targetPort, token } = this.opts.target();
|
|
253
|
+
const ws = new WebSocket(`${dialOrigin.replace(/^http/, "ws")}/portal/tcp?port=${targetPort}`, { headers: { authorization: `Bearer ${token}` } });
|
|
254
|
+
return new Promise((resolve, reject) => {
|
|
255
|
+
ws.once("error", reject);
|
|
256
|
+
ws.once("unexpected-response", (_req, res) => {
|
|
257
|
+
res.destroy();
|
|
258
|
+
reject(/* @__PURE__ */ new Error(`tunnel rejected (HTTP ${res.statusCode ?? "?"})`));
|
|
259
|
+
});
|
|
260
|
+
ws.once("open", () => {
|
|
261
|
+
const stream = createWebSocketStream(ws);
|
|
262
|
+
stream.pause();
|
|
263
|
+
resolve({
|
|
264
|
+
stream,
|
|
265
|
+
close: () => stream.destroy()
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
244
270
|
start() {
|
|
245
271
|
const server = net.createServer((sock) => {
|
|
246
272
|
this.conns.add(sock);
|
|
@@ -266,12 +292,52 @@ var ReverseListener = class {
|
|
|
266
292
|
});
|
|
267
293
|
});
|
|
268
294
|
server.once("error", (err) => this.opts.onListening(err));
|
|
269
|
-
server.listen(this.opts.listenPort, "127.0.0.1", () =>
|
|
295
|
+
server.listen(this.opts.listenPort, "127.0.0.1", () => {
|
|
296
|
+
this.opts.onListening(null);
|
|
297
|
+
this.startTls();
|
|
298
|
+
});
|
|
270
299
|
this.server = server;
|
|
271
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* The additive TLS+h2 twin (fire-and-forget from start): browsers negotiate
|
|
303
|
+
* h2 there, lifting the 6-connection cap that serializes module-heavy dev
|
|
304
|
+
* servers. Every failure logs once and leaves the plain listener — the
|
|
305
|
+
* product's default behavior — untouched. The ack (`reverse_listening`)
|
|
306
|
+
* deliberately stays keyed to the plain bind: TLS is an enhancement, never
|
|
307
|
+
* a condition of "the tunnel is up".
|
|
308
|
+
*/
|
|
309
|
+
startTls() {
|
|
310
|
+
const source = this.opts.tlsCertSource;
|
|
311
|
+
if (!source) return;
|
|
312
|
+
(async () => {
|
|
313
|
+
try {
|
|
314
|
+
const cert = await source();
|
|
315
|
+
if (!cert || this.server === null) return;
|
|
316
|
+
this.tls = await startTlsForward({
|
|
317
|
+
cert,
|
|
318
|
+
localPort: this.opts.listenPort,
|
|
319
|
+
targetPort: this.opts.target().targetPort,
|
|
320
|
+
acquireTunnel: () => this.dialTunnel(),
|
|
321
|
+
log: this.opts.log
|
|
322
|
+
});
|
|
323
|
+
if (this.server === null) {
|
|
324
|
+
const straggler = this.tls;
|
|
325
|
+
this.tls = null;
|
|
326
|
+
await straggler.close();
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
this.opts.log(`expose: TLS origin up: https://${this.tls.hostname}:${this.tls.port} (HTTP/2)`);
|
|
330
|
+
} catch (error) {
|
|
331
|
+
this.opts.log(`expose: TLS origin unavailable (${error instanceof Error ? error.message : String(error)}); http listener unaffected`);
|
|
332
|
+
}
|
|
333
|
+
})();
|
|
334
|
+
}
|
|
272
335
|
stop() {
|
|
273
336
|
this.server?.close();
|
|
274
337
|
this.server = null;
|
|
338
|
+
const tls = this.tls;
|
|
339
|
+
this.tls = null;
|
|
340
|
+
if (tls) tls.close();
|
|
275
341
|
for (const sock of this.conns) sock.destroy();
|
|
276
342
|
this.conns.clear();
|
|
277
343
|
}
|
|
@@ -365,6 +431,7 @@ var JobManager = class {
|
|
|
365
431
|
listener: new ReverseListener({
|
|
366
432
|
listenPort,
|
|
367
433
|
target: () => rev.target,
|
|
434
|
+
tlsCertSource: this.opts.tlsCertSource,
|
|
368
435
|
log: (msg) => {
|
|
369
436
|
if (rev.settled) return;
|
|
370
437
|
this.opts.send(encodeData(id, STREAM.stderr, rev.seq, Buffer.from(msg)));
|
|
@@ -619,6 +686,7 @@ var PortalClient = class {
|
|
|
619
686
|
this.ws = ws;
|
|
620
687
|
const jobs = new JobManager({
|
|
621
688
|
resolveCwd: this.opts.resolveCwd,
|
|
689
|
+
tlsCertSource: this.opts.tlsCertSource,
|
|
622
690
|
send: (frame) => {
|
|
623
691
|
if (ws.readyState === WebSocket.OPEN) ws.send(frame);
|
|
624
692
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./client-d6K9qm6B.mjs";
|
|
3
|
+
import { a as runPortalDaemon, i as queryDaemonStatus, n as ensureDaemonRunning, o as startPortalDaemon, r as isDaemonListening, s as stopDaemon, t as PortalDaemon } from "./daemon-CxFxH36O.mjs";
|
|
4
|
+
import "./tls-cert-CV-pwxVN.mjs";
|
|
5
|
+
import "./api-DQCaztBg.mjs";
|
|
6
|
+
|
|
7
|
+
export { runPortalDaemon };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as isRecord, t as PortalClient } from "./client-
|
|
2
|
+
import { n as isRecord, t as PortalClient } from "./client-d6K9qm6B.mjs";
|
|
3
|
+
import { t as defaultTlsCertSource } from "./tls-cert-CV-pwxVN.mjs";
|
|
3
4
|
import os from "node:os";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import { z } from "zod";
|
|
@@ -20,7 +21,7 @@ import { access, appendFile, mkdir, readFile, unlink, writeFile } from "node:fs/
|
|
|
20
21
|
* the commit time of the built tree is one monotonic clock they share.
|
|
21
22
|
*/
|
|
22
23
|
function portalDaemonBuild() {
|
|
23
|
-
return "
|
|
24
|
+
return "1786765910";
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* Whether a client carrying `mine` should replace a running daemon carrying
|
|
@@ -500,6 +501,7 @@ var PortalDaemon = class {
|
|
|
500
501
|
deviceToken: this.deviceToken
|
|
501
502
|
}),
|
|
502
503
|
resolveCwd: (conversationId) => this.resolveCwd(conversationId),
|
|
504
|
+
tlsCertSource: defaultTlsCertSource(process.env, (msg) => this.logInfo(msg)),
|
|
503
505
|
persistedMachineName: this.persistedMachineName,
|
|
504
506
|
onMachineName: (name, source) => this.onMachineName(name, source),
|
|
505
507
|
onState: (state) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as LOCAL_PROTOCOL_VERSION, d as encodeLine, f as makeLineParser, n as ensureDaemonRunning, p as parseDaemonMessage, u as daemonPaths } from "./daemon-
|
|
2
|
+
import { c as LOCAL_PROTOCOL_VERSION, d as encodeLine, f as makeLineParser, n as ensureDaemonRunning, p as parseDaemonMessage, u as daemonPaths } from "./daemon-CxFxH36O.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { connect } from "node:net";
|
|
5
5
|
|