@boxes-dev/dvb-runtime 1.0.1110 → 1.0.1111
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/bin/dvb.mjs +1113 -582
- package/dist/bin/dvbd.mjs +4515 -608
- package/dist/product-docs/references/agent-tools.md +18 -0
- package/dist/product-docs/references/automations.md +9 -0
- package/dist/product-docs/references/aws.md +21 -0
- package/dist/product-docs/references/desktop-workbench.md +17 -0
- package/dist/product-docs/references/google-cloud.md +8 -0
- package/dist/product-docs/references/mobile.md +14 -4
- package/dist/product-docs/references/onbox-agent-tools.md +134 -4
- package/dist/product-docs/references/tailscale.md +14 -0
- package/dist/product-docs/references/team-template.md +27 -9
- package/dist/product-docs/references/threads-and-agents.md +22 -8
- package/dist/product-docs/references/troubleshooting.md +27 -0
- package/dist/product-docs/references/unattended-work.md +10 -3
- package/package.json +2 -2
package/dist/bin/dvb.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a9a5ab0a-d34f-5b1c-afa5-ae1d2d484362")}catch(e){}}();
|
|
4
4
|
import { createRequire as __dvbCreateRequire } from "node:module";
|
|
5
5
|
import { dirname as __dvbDirname } from "node:path";
|
|
6
6
|
import { fileURLToPath as __dvbFileURLToPath } from "node:url";
|
|
@@ -2300,7 +2300,7 @@ var require_websocket = __commonJS({
|
|
|
2300
2300
|
var https4 = __require("https");
|
|
2301
2301
|
var http11 = __require("http");
|
|
2302
2302
|
var net6 = __require("net");
|
|
2303
|
-
var
|
|
2303
|
+
var tls4 = __require("tls");
|
|
2304
2304
|
var { randomBytes: randomBytes15, createHash: createHash29 } = __require("crypto");
|
|
2305
2305
|
var { Duplex, Readable: Readable3 } = __require("stream");
|
|
2306
2306
|
var { URL: URL3 } = __require("url");
|
|
@@ -3050,7 +3050,7 @@ var require_websocket = __commonJS({
|
|
|
3050
3050
|
if (!options.servername && options.servername !== "") {
|
|
3051
3051
|
options.servername = net6.isIP(options.host) ? "" : options.host;
|
|
3052
3052
|
}
|
|
3053
|
-
return
|
|
3053
|
+
return tls4.connect(options);
|
|
3054
3054
|
}
|
|
3055
3055
|
function abortHandshake(websocket, stream, message) {
|
|
3056
3056
|
websocket._readyState = WebSocket4.CLOSING;
|
|
@@ -22803,10 +22803,10 @@ var init_ajvProvider_97rDpkRx = __esm({
|
|
|
22803
22803
|
error() {
|
|
22804
22804
|
}
|
|
22805
22805
|
};
|
|
22806
|
-
function getLogger(
|
|
22807
|
-
if (
|
|
22808
|
-
if (
|
|
22809
|
-
if (
|
|
22806
|
+
function getLogger(logger13) {
|
|
22807
|
+
if (logger13 === false) return noLogs;
|
|
22808
|
+
if (logger13 === void 0) return console;
|
|
22809
|
+
if (logger13.log && logger13.warn && logger13.error) return logger13;
|
|
22810
22810
|
throw new Error("logger must implement log, warn and error methods");
|
|
22811
22811
|
}
|
|
22812
22812
|
const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
|
|
@@ -29982,6 +29982,171 @@ var init_logger = __esm({
|
|
|
29982
29982
|
}
|
|
29983
29983
|
});
|
|
29984
29984
|
|
|
29985
|
+
// ../../../../shared/devboxCore/dist/systemTrust.js
|
|
29986
|
+
import tls from "node:tls";
|
|
29987
|
+
import { Worker } from "node:worker_threads";
|
|
29988
|
+
var logger, SYSTEM_ROOT_LOAD_TIMEOUT_MS, READ_SYSTEM_ROOTS_SOURCE, CERTIFICATE_FAILURE_KINDS, findCertificateFailure, isUntrustedCertificateError, describeCertificateFailure, keepSystemRoot, systemRootLoad, systemRootsApplied, setSystemRootFilter, readSystemRoots, applySystemRoots, loadAndApplySystemRoots, loadSystemRoots, waitForSystemRoots, withSystemTrustRetry, fetchWithSystemTrust, observeWebSocketErrors, withSystemTrustWebSocket;
|
|
29989
|
+
var init_systemTrust = __esm({
|
|
29990
|
+
"../../../../shared/devboxCore/dist/systemTrust.js"() {
|
|
29991
|
+
"use strict";
|
|
29992
|
+
init_logger();
|
|
29993
|
+
logger = createLogger("system-trust");
|
|
29994
|
+
SYSTEM_ROOT_LOAD_TIMEOUT_MS = 12e4;
|
|
29995
|
+
READ_SYSTEM_ROOTS_SOURCE = `
|
|
29996
|
+
const { parentPort } = process.getBuiltinModule("node:worker_threads");
|
|
29997
|
+
const tls = process.getBuiltinModule("node:tls");
|
|
29998
|
+
parentPort.postMessage(tls.getCACertificates("system"));
|
|
29999
|
+
`;
|
|
30000
|
+
CERTIFICATE_FAILURE_KINDS = /* @__PURE__ */ new Map([
|
|
30001
|
+
["CERT_HAS_EXPIRED", "expired"],
|
|
30002
|
+
["CERT_NOT_YET_VALID", "expired"],
|
|
30003
|
+
["CERT_REVOKED", "revoked"],
|
|
30004
|
+
["ERR_TLS_CERT_ALTNAME_INVALID", "hostname"],
|
|
30005
|
+
["CERT_UNTRUSTED", "untrusted"],
|
|
30006
|
+
["DEPTH_ZERO_SELF_SIGNED_CERT", "untrusted"],
|
|
30007
|
+
["SELF_SIGNED_CERT_IN_CHAIN", "untrusted"],
|
|
30008
|
+
["UNABLE_TO_GET_ISSUER_CERT", "untrusted"],
|
|
30009
|
+
["UNABLE_TO_GET_ISSUER_CERT_LOCALLY", "untrusted"],
|
|
30010
|
+
["UNABLE_TO_VERIFY_LEAF_SIGNATURE", "untrusted"]
|
|
30011
|
+
]);
|
|
30012
|
+
findCertificateFailure = (error55) => {
|
|
30013
|
+
let current = error55;
|
|
30014
|
+
while (current && typeof current === "object") {
|
|
30015
|
+
const { cause, code: code2 } = current;
|
|
30016
|
+
const kind = typeof code2 === "string" ? CERTIFICATE_FAILURE_KINDS.get(code2) : null;
|
|
30017
|
+
if (kind && typeof code2 === "string") {
|
|
30018
|
+
return { code: code2, kind };
|
|
30019
|
+
}
|
|
30020
|
+
current = cause;
|
|
30021
|
+
}
|
|
30022
|
+
return null;
|
|
30023
|
+
};
|
|
30024
|
+
isUntrustedCertificateError = (error55) => findCertificateFailure(error55)?.kind === "untrusted";
|
|
30025
|
+
describeCertificateFailure = (error55, nextStep) => {
|
|
30026
|
+
switch (findCertificateFailure(error55)?.kind) {
|
|
30027
|
+
case "untrusted":
|
|
30028
|
+
return `boxes.dev couldn't verify this network's security certificate. If your company inspects network traffic, ask your IT team to install its certificate on this computer, then ${nextStep}.`;
|
|
30029
|
+
case "expired":
|
|
30030
|
+
return "The security certificate used to reach boxes.dev has expired or isn't valid yet. Check this computer's date and time, then try again.";
|
|
30031
|
+
case "hostname":
|
|
30032
|
+
return "This network's security certificate doesn't match boxes.dev, so the connection was blocked. Try another network, or ask your IT team to allow boxes.dev.";
|
|
30033
|
+
case "revoked":
|
|
30034
|
+
return "The security certificate used to reach boxes.dev has been revoked, so the connection was blocked. Try another network, or ask your IT team to replace the certificate.";
|
|
30035
|
+
default:
|
|
30036
|
+
return null;
|
|
30037
|
+
}
|
|
30038
|
+
};
|
|
30039
|
+
keepSystemRoot = () => true;
|
|
30040
|
+
systemRootLoad = null;
|
|
30041
|
+
systemRootsApplied = false;
|
|
30042
|
+
setSystemRootFilter = (keep) => {
|
|
30043
|
+
keepSystemRoot = keep;
|
|
30044
|
+
};
|
|
30045
|
+
readSystemRoots = async () => await new Promise((resolve3, reject) => {
|
|
30046
|
+
const worker = new Worker(READ_SYSTEM_ROOTS_SOURCE, { eval: true });
|
|
30047
|
+
const timeout = setTimeout(() => {
|
|
30048
|
+
worker.unref();
|
|
30049
|
+
void worker.terminate();
|
|
30050
|
+
reject(new Error(`System certificates took longer than ${SYSTEM_ROOT_LOAD_TIMEOUT_MS} ms to load.`));
|
|
30051
|
+
}, SYSTEM_ROOT_LOAD_TIMEOUT_MS);
|
|
30052
|
+
worker.once("message", (roots) => {
|
|
30053
|
+
clearTimeout(timeout);
|
|
30054
|
+
void worker.terminate();
|
|
30055
|
+
resolve3(roots);
|
|
30056
|
+
});
|
|
30057
|
+
worker.once("error", (error55) => {
|
|
30058
|
+
clearTimeout(timeout);
|
|
30059
|
+
reject(error55);
|
|
30060
|
+
});
|
|
30061
|
+
});
|
|
30062
|
+
applySystemRoots = (roots) => {
|
|
30063
|
+
const current = tls.getCACertificates("default");
|
|
30064
|
+
const known = new Set(current);
|
|
30065
|
+
const added = [...new Set(roots)].filter((pem) => !known.has(pem) && keepSystemRoot(pem));
|
|
30066
|
+
if (added.length === 0) {
|
|
30067
|
+
return "unchanged";
|
|
30068
|
+
}
|
|
30069
|
+
tls.setDefaultCACertificates([...current, ...added]);
|
|
30070
|
+
systemRootsApplied = true;
|
|
30071
|
+
return "added";
|
|
30072
|
+
};
|
|
30073
|
+
loadAndApplySystemRoots = async () => {
|
|
30074
|
+
if (typeof tls.getCACertificates !== "function" || typeof tls.setDefaultCACertificates !== "function") {
|
|
30075
|
+
return "unavailable";
|
|
30076
|
+
}
|
|
30077
|
+
const startedAt2 = performance.now();
|
|
30078
|
+
try {
|
|
30079
|
+
const result = applySystemRoots(await readSystemRoots());
|
|
30080
|
+
logger.info("system_roots_loaded", {
|
|
30081
|
+
result,
|
|
30082
|
+
durationMs: Math.round(performance.now() - startedAt2)
|
|
30083
|
+
});
|
|
30084
|
+
return result;
|
|
30085
|
+
} catch (error55) {
|
|
30086
|
+
logger.warn("system_roots_load_failed", {
|
|
30087
|
+
durationMs: Math.round(performance.now() - startedAt2),
|
|
30088
|
+
error: error55 instanceof Error ? error55.message : String(error55)
|
|
30089
|
+
});
|
|
30090
|
+
return "failed";
|
|
30091
|
+
}
|
|
30092
|
+
};
|
|
30093
|
+
loadSystemRoots = async () => await (systemRootLoad ??= loadAndApplySystemRoots());
|
|
30094
|
+
waitForSystemRoots = async (signal) => {
|
|
30095
|
+
if (!signal) {
|
|
30096
|
+
return await loadSystemRoots();
|
|
30097
|
+
}
|
|
30098
|
+
signal.throwIfAborted();
|
|
30099
|
+
let handleAbort = () => {
|
|
30100
|
+
};
|
|
30101
|
+
const aborted3 = new Promise((_resolve, reject) => {
|
|
30102
|
+
handleAbort = () => reject(signal.reason);
|
|
30103
|
+
signal.addEventListener("abort", handleAbort, { once: true });
|
|
30104
|
+
});
|
|
30105
|
+
try {
|
|
30106
|
+
return await Promise.race([loadSystemRoots(), aborted3]);
|
|
30107
|
+
} finally {
|
|
30108
|
+
signal.removeEventListener("abort", handleAbort);
|
|
30109
|
+
}
|
|
30110
|
+
};
|
|
30111
|
+
withSystemTrustRetry = async (attempt, { signal = null } = {}) => {
|
|
30112
|
+
const hadSystemRoots = systemRootsApplied;
|
|
30113
|
+
try {
|
|
30114
|
+
return await attempt();
|
|
30115
|
+
} catch (error55) {
|
|
30116
|
+
if (hadSystemRoots || !isUntrustedCertificateError(error55)) {
|
|
30117
|
+
throw error55;
|
|
30118
|
+
}
|
|
30119
|
+
if (await waitForSystemRoots(signal) !== "added") {
|
|
30120
|
+
throw error55;
|
|
30121
|
+
}
|
|
30122
|
+
return await attempt();
|
|
30123
|
+
}
|
|
30124
|
+
};
|
|
30125
|
+
fetchWithSystemTrust = async (url3, init3) => await withSystemTrustRetry(() => fetch(url3, init3), {
|
|
30126
|
+
signal: init3?.signal ?? null
|
|
30127
|
+
});
|
|
30128
|
+
observeWebSocketErrors = (socket, onCertificateFailure) => {
|
|
30129
|
+
const hadSystemRoots = systemRootsApplied;
|
|
30130
|
+
socket.on("error", (error55) => {
|
|
30131
|
+
if (!findCertificateFailure(error55)) {
|
|
30132
|
+
return;
|
|
30133
|
+
}
|
|
30134
|
+
onCertificateFailure?.(error55);
|
|
30135
|
+
if (!hadSystemRoots && isUntrustedCertificateError(error55)) {
|
|
30136
|
+
void loadSystemRoots();
|
|
30137
|
+
}
|
|
30138
|
+
});
|
|
30139
|
+
};
|
|
30140
|
+
withSystemTrustWebSocket = (base, { onCertificateFailure = null } = {}) => new Proxy(base, {
|
|
30141
|
+
construct(target, args, newTarget) {
|
|
30142
|
+
const socket = Reflect.construct(target, args, newTarget);
|
|
30143
|
+
observeWebSocketErrors(socket, onCertificateFailure);
|
|
30144
|
+
return socket;
|
|
30145
|
+
}
|
|
30146
|
+
});
|
|
30147
|
+
}
|
|
30148
|
+
});
|
|
30149
|
+
|
|
29985
30150
|
// ../../../../node_modules/@sentry/core/build/esm/debug-build.js
|
|
29986
30151
|
var DEBUG_BUILD;
|
|
29987
30152
|
var init_debug_build = __esm({
|
|
@@ -44025,11 +44190,11 @@ var require_ComponentLogger = __commonJS({
|
|
|
44025
44190
|
};
|
|
44026
44191
|
exports.DiagComponentLogger = DiagComponentLogger;
|
|
44027
44192
|
function logProxy(funcName, namespace, args) {
|
|
44028
|
-
const
|
|
44029
|
-
if (!
|
|
44193
|
+
const logger13 = (0, global_utils_1.getGlobal)("diag");
|
|
44194
|
+
if (!logger13) {
|
|
44030
44195
|
return;
|
|
44031
44196
|
}
|
|
44032
|
-
return
|
|
44197
|
+
return logger13[funcName](namespace, ...args);
|
|
44033
44198
|
}
|
|
44034
44199
|
}
|
|
44035
44200
|
});
|
|
@@ -44060,17 +44225,17 @@ var require_logLevelLogger = __commonJS({
|
|
|
44060
44225
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44061
44226
|
exports.createLogLevelDiagLogger = void 0;
|
|
44062
44227
|
var types_1 = require_types2();
|
|
44063
|
-
function createLogLevelDiagLogger(maxLevel,
|
|
44228
|
+
function createLogLevelDiagLogger(maxLevel, logger13) {
|
|
44064
44229
|
if (maxLevel < types_1.DiagLogLevel.NONE) {
|
|
44065
44230
|
maxLevel = types_1.DiagLogLevel.NONE;
|
|
44066
44231
|
} else if (maxLevel > types_1.DiagLogLevel.ALL) {
|
|
44067
44232
|
maxLevel = types_1.DiagLogLevel.ALL;
|
|
44068
44233
|
}
|
|
44069
|
-
|
|
44234
|
+
logger13 = logger13 || {};
|
|
44070
44235
|
function _filterFunc(funcName, theLevel) {
|
|
44071
|
-
const theFunc =
|
|
44236
|
+
const theFunc = logger13[funcName];
|
|
44072
44237
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
44073
|
-
return theFunc.bind(
|
|
44238
|
+
return theFunc.bind(logger13);
|
|
44074
44239
|
}
|
|
44075
44240
|
return function() {
|
|
44076
44241
|
};
|
|
@@ -44113,16 +44278,16 @@ var require_diag = __commonJS({
|
|
|
44113
44278
|
constructor() {
|
|
44114
44279
|
function _logProxy(funcName) {
|
|
44115
44280
|
return function(...args) {
|
|
44116
|
-
const
|
|
44117
|
-
if (!
|
|
44281
|
+
const logger13 = (0, global_utils_1.getGlobal)("diag");
|
|
44282
|
+
if (!logger13)
|
|
44118
44283
|
return;
|
|
44119
|
-
return
|
|
44284
|
+
return logger13[funcName](...args);
|
|
44120
44285
|
};
|
|
44121
44286
|
}
|
|
44122
44287
|
const self2 = this;
|
|
44123
|
-
const setLogger = (
|
|
44288
|
+
const setLogger = (logger13, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => {
|
|
44124
44289
|
var _a7, _b3, _c;
|
|
44125
|
-
if (
|
|
44290
|
+
if (logger13 === self2) {
|
|
44126
44291
|
const err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
44127
44292
|
self2.error((_a7 = err.stack) !== null && _a7 !== void 0 ? _a7 : err.message);
|
|
44128
44293
|
return false;
|
|
@@ -44133,7 +44298,7 @@ var require_diag = __commonJS({
|
|
|
44133
44298
|
};
|
|
44134
44299
|
}
|
|
44135
44300
|
const oldLogger = (0, global_utils_1.getGlobal)("diag");
|
|
44136
|
-
const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b3 = optionsOrLogLevel.logLevel) !== null && _b3 !== void 0 ? _b3 : types_1.DiagLogLevel.INFO,
|
|
44301
|
+
const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b3 = optionsOrLogLevel.logLevel) !== null && _b3 !== void 0 ? _b3 : types_1.DiagLogLevel.INFO, logger13);
|
|
44137
44302
|
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
44138
44303
|
const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
44139
44304
|
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
@@ -45713,11 +45878,11 @@ var require_ProxyLogger = __commonJS({
|
|
|
45713
45878
|
if (this._delegate) {
|
|
45714
45879
|
return this._delegate;
|
|
45715
45880
|
}
|
|
45716
|
-
const
|
|
45717
|
-
if (!
|
|
45881
|
+
const logger13 = this._provider._getDelegateLogger(this.name, this.version, this.options);
|
|
45882
|
+
if (!logger13) {
|
|
45718
45883
|
return NoopLogger_1.NOOP_LOGGER;
|
|
45719
45884
|
}
|
|
45720
|
-
this._delegate =
|
|
45885
|
+
this._delegate = logger13;
|
|
45721
45886
|
return this._delegate;
|
|
45722
45887
|
}
|
|
45723
45888
|
};
|
|
@@ -46271,7 +46436,7 @@ var require_shimmer = __commonJS({
|
|
|
46271
46436
|
"use strict";
|
|
46272
46437
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46273
46438
|
exports.massUnwrap = exports.unwrap = exports.massWrap = exports.wrap = void 0;
|
|
46274
|
-
var
|
|
46439
|
+
var logger13 = console.error.bind(console);
|
|
46275
46440
|
function defineProperty(obj, name, value) {
|
|
46276
46441
|
const enumerable = !!obj[name] && Object.prototype.propertyIsEnumerable.call(obj, name);
|
|
46277
46442
|
Object.defineProperty(obj, name, {
|
|
@@ -46283,17 +46448,17 @@ var require_shimmer = __commonJS({
|
|
|
46283
46448
|
}
|
|
46284
46449
|
var wrap = (nodule, name, wrapper) => {
|
|
46285
46450
|
if (!nodule || !nodule[name]) {
|
|
46286
|
-
|
|
46451
|
+
logger13("no original function " + String(name) + " to wrap");
|
|
46287
46452
|
return;
|
|
46288
46453
|
}
|
|
46289
46454
|
if (!wrapper) {
|
|
46290
|
-
|
|
46291
|
-
|
|
46455
|
+
logger13("no wrapper function");
|
|
46456
|
+
logger13(new Error().stack);
|
|
46292
46457
|
return;
|
|
46293
46458
|
}
|
|
46294
46459
|
const original = nodule[name];
|
|
46295
46460
|
if (typeof original !== "function" || typeof wrapper !== "function") {
|
|
46296
|
-
|
|
46461
|
+
logger13("original object and wrapper must be functions");
|
|
46297
46462
|
return;
|
|
46298
46463
|
}
|
|
46299
46464
|
const wrapped = wrapper(original, name);
|
|
@@ -46310,14 +46475,14 @@ var require_shimmer = __commonJS({
|
|
|
46310
46475
|
exports.wrap = wrap;
|
|
46311
46476
|
var massWrap = (nodules, names, wrapper) => {
|
|
46312
46477
|
if (!nodules) {
|
|
46313
|
-
|
|
46314
|
-
|
|
46478
|
+
logger13("must provide one or more modules to patch");
|
|
46479
|
+
logger13(new Error().stack);
|
|
46315
46480
|
return;
|
|
46316
46481
|
} else if (!Array.isArray(nodules)) {
|
|
46317
46482
|
nodules = [nodules];
|
|
46318
46483
|
}
|
|
46319
46484
|
if (!(names && Array.isArray(names))) {
|
|
46320
|
-
|
|
46485
|
+
logger13("must provide one or more functions to wrap on modules");
|
|
46321
46486
|
return;
|
|
46322
46487
|
}
|
|
46323
46488
|
nodules.forEach((nodule) => {
|
|
@@ -46329,13 +46494,13 @@ var require_shimmer = __commonJS({
|
|
|
46329
46494
|
exports.massWrap = massWrap;
|
|
46330
46495
|
var unwrap = (nodule, name) => {
|
|
46331
46496
|
if (!nodule || !nodule[name]) {
|
|
46332
|
-
|
|
46333
|
-
|
|
46497
|
+
logger13("no function to unwrap.");
|
|
46498
|
+
logger13(new Error().stack);
|
|
46334
46499
|
return;
|
|
46335
46500
|
}
|
|
46336
46501
|
const wrapped = nodule[name];
|
|
46337
46502
|
if (!wrapped.__unwrap) {
|
|
46338
|
-
|
|
46503
|
+
logger13("no original to unwrap to -- has " + String(name) + " already been unwrapped?");
|
|
46339
46504
|
} else {
|
|
46340
46505
|
wrapped.__unwrap();
|
|
46341
46506
|
return;
|
|
@@ -46344,14 +46509,14 @@ var require_shimmer = __commonJS({
|
|
|
46344
46509
|
exports.unwrap = unwrap;
|
|
46345
46510
|
var massUnwrap = (nodules, names) => {
|
|
46346
46511
|
if (!nodules) {
|
|
46347
|
-
|
|
46348
|
-
|
|
46512
|
+
logger13("must provide one or more modules to patch");
|
|
46513
|
+
logger13(new Error().stack);
|
|
46349
46514
|
return;
|
|
46350
46515
|
} else if (!Array.isArray(nodules)) {
|
|
46351
46516
|
nodules = [nodules];
|
|
46352
46517
|
}
|
|
46353
46518
|
if (!(names && Array.isArray(names))) {
|
|
46354
|
-
|
|
46519
|
+
logger13("must provide one or more functions to unwrap on modules");
|
|
46355
46520
|
return;
|
|
46356
46521
|
}
|
|
46357
46522
|
nodules.forEach((nodule) => {
|
|
@@ -46364,9 +46529,9 @@ var require_shimmer = __commonJS({
|
|
|
46364
46529
|
function shimmer(options) {
|
|
46365
46530
|
if (options && options.logger) {
|
|
46366
46531
|
if (typeof options.logger !== "function") {
|
|
46367
|
-
|
|
46532
|
+
logger13("new logger isn't a function, not replacing");
|
|
46368
46533
|
} else {
|
|
46369
|
-
|
|
46534
|
+
logger13 = options.logger;
|
|
46370
46535
|
}
|
|
46371
46536
|
}
|
|
46372
46537
|
}
|
|
@@ -57070,7 +57235,7 @@ var init_common = __esm({
|
|
|
57070
57235
|
});
|
|
57071
57236
|
|
|
57072
57237
|
// ../../../../node_modules/@sentry/node-core/build/esm/integrations/local-variables/local-variables-async.js
|
|
57073
|
-
import { Worker } from "node:worker_threads";
|
|
57238
|
+
import { Worker as Worker2 } from "node:worker_threads";
|
|
57074
57239
|
function log2(...args) {
|
|
57075
57240
|
debug.log("[LocalVariables]", ...args);
|
|
57076
57241
|
}
|
|
@@ -57118,7 +57283,7 @@ var init_local_variables_async = __esm({
|
|
|
57118
57283
|
}
|
|
57119
57284
|
}
|
|
57120
57285
|
function startWorker(options) {
|
|
57121
|
-
const worker = new
|
|
57286
|
+
const worker = new Worker2(new URL(`data:application/javascript;base64,${base64WorkerScript}`), {
|
|
57122
57287
|
workerData: options,
|
|
57123
57288
|
// We don't want any Node args to be passed to the worker
|
|
57124
57289
|
execArgv: [],
|
|
@@ -58238,7 +58403,7 @@ var init_parse_proxy_response = __esm({
|
|
|
58238
58403
|
|
|
58239
58404
|
// ../../../../node_modules/@sentry/node-core/build/esm/proxy/index.js
|
|
58240
58405
|
import * as net2 from "node:net";
|
|
58241
|
-
import * as
|
|
58406
|
+
import * as tls2 from "node:tls";
|
|
58242
58407
|
function debugLog2(...args) {
|
|
58243
58408
|
debug.log("[https-proxy-agent]", ...args);
|
|
58244
58409
|
}
|
|
@@ -58291,7 +58456,7 @@ var init_proxy = __esm({
|
|
|
58291
58456
|
if (proxy.protocol === "https:") {
|
|
58292
58457
|
debugLog2("Creating `tls.Socket`: %o", this.connectOpts);
|
|
58293
58458
|
const servername = this.connectOpts.servername || this.connectOpts.host;
|
|
58294
|
-
socket =
|
|
58459
|
+
socket = tls2.connect({
|
|
58295
58460
|
...this.connectOpts,
|
|
58296
58461
|
servername: servername && net2.isIP(servername) ? void 0 : servername
|
|
58297
58462
|
});
|
|
@@ -58326,7 +58491,7 @@ var init_proxy = __esm({
|
|
|
58326
58491
|
if (opts.secureEndpoint) {
|
|
58327
58492
|
debugLog2("Upgrading socket connection to TLS");
|
|
58328
58493
|
const servername = opts.servername || opts.host;
|
|
58329
|
-
return
|
|
58494
|
+
return tls2.connect({
|
|
58330
58495
|
...omit2(opts, "host", "path", "port"),
|
|
58331
58496
|
socket,
|
|
58332
58497
|
servername: net2.isIP(servername) ? void 0 : servername
|
|
@@ -64499,7 +64664,7 @@ var init_redis_instrumentation = __esm({
|
|
|
64499
64664
|
};
|
|
64500
64665
|
}
|
|
64501
64666
|
_getPatchCreateClient() {
|
|
64502
|
-
return function
|
|
64667
|
+
return function createClient2(original) {
|
|
64503
64668
|
return getTracedCreateClient(original);
|
|
64504
64669
|
};
|
|
64505
64670
|
}
|
|
@@ -70400,9 +70565,9 @@ var init_sentry = __esm({
|
|
|
70400
70565
|
uncaughtExceptionMonitorInstalled = false;
|
|
70401
70566
|
currentDevboxSentryUser = null;
|
|
70402
70567
|
readBuildMetadata = () => {
|
|
70403
|
-
const rawPackageVersion = "1.0.
|
|
70404
|
-
const rawGitSha = "
|
|
70405
|
-
const rawSentryRelease = "boxes-dev-dvb@1.0.
|
|
70568
|
+
const rawPackageVersion = "1.0.1111";
|
|
70569
|
+
const rawGitSha = "5759d9e04c92cddf2fd051b9c9be0d4fb20b7ce9";
|
|
70570
|
+
const rawSentryRelease = "boxes-dev-dvb@1.0.1111+5759d9e04c92cddf2fd051b9c9be0d4fb20b7ce9";
|
|
70406
70571
|
const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
|
|
70407
70572
|
const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
|
|
70408
70573
|
const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
|
|
@@ -71985,14 +72150,16 @@ var init_ports = __esm({
|
|
|
71985
72150
|
});
|
|
71986
72151
|
|
|
71987
72152
|
// ../../../../shared/devboxCore/dist/managedDaemonControlAuth.js
|
|
71988
|
-
var MANAGED_DAEMON_CONTROL_AUTH_VERSION, MANAGED_DAEMON_CONTROL_AUTH_CHALLENGE_BYTES, MANAGED_DAEMON_CONTROL_AUTH_MAC_BYTES, MANAGED_DAEMON_CONTROL_AUTH_MAX_IDENTITY_LENGTH, MAX_CAPABILITY_COUNT, MAX_CAPABILITY_LENGTH, MAX_PATH_LENGTH, BASE64URL_PATTERN, E2B_SANDBOX_ID_PATTERN, textEncoder, isRecord, hasExactKeys, readBoundedString, readCapabilities, encodeBase64Url, decodeBase64UrlExact, constantTimeEqualBase64Url, requireIdentity, buildManagedDaemonControlAuthInitMessage, parseManagedDaemonControlAuthChallengeMessage, buildManagedDaemonDirectWebSocketUrl;
|
|
72153
|
+
var MANAGED_DAEMON_CONTROL_AUTH_VERSION, MANAGED_DAEMON_CONTROL_AUTH_SIGNED_CAPABILITY, MANAGED_DAEMON_CONTROL_AUTH_CHALLENGE_BYTES, MANAGED_DAEMON_CONTROL_AUTH_MAC_BYTES, MANAGED_DAEMON_CONTROL_AUTH_SIGNATURE_BYTES, MANAGED_DAEMON_CONTROL_AUTH_MAX_IDENTITY_LENGTH, MAX_CAPABILITY_COUNT, MAX_CAPABILITY_LENGTH, MAX_PATH_LENGTH, BASE64URL_PATTERN, E2B_SANDBOX_ID_PATTERN, textEncoder, isRecord, hasExactKeys, readBoundedString, readCapabilities, encodeBase64Url, decodeBase64UrlExact, constantTimeEqualBase64Url, requireIdentity, buildManagedDaemonControlAuthInitMessage, parseManagedDaemonControlAuthChallengeMessage, buildManagedDaemonDirectWebSocketUrl;
|
|
71989
72154
|
var init_managedDaemonControlAuth = __esm({
|
|
71990
72155
|
"../../../../shared/devboxCore/dist/managedDaemonControlAuth.js"() {
|
|
71991
72156
|
"use strict";
|
|
71992
72157
|
init_ports();
|
|
71993
72158
|
MANAGED_DAEMON_CONTROL_AUTH_VERSION = 1;
|
|
72159
|
+
MANAGED_DAEMON_CONTROL_AUTH_SIGNED_CAPABILITY = "control_auth_ed25519_v2";
|
|
71994
72160
|
MANAGED_DAEMON_CONTROL_AUTH_CHALLENGE_BYTES = 32;
|
|
71995
72161
|
MANAGED_DAEMON_CONTROL_AUTH_MAC_BYTES = 32;
|
|
72162
|
+
MANAGED_DAEMON_CONTROL_AUTH_SIGNATURE_BYTES = 64;
|
|
71996
72163
|
MANAGED_DAEMON_CONTROL_AUTH_MAX_IDENTITY_LENGTH = 256;
|
|
71997
72164
|
MAX_CAPABILITY_COUNT = 64;
|
|
71998
72165
|
MAX_CAPABILITY_LENGTH = 128;
|
|
@@ -72093,7 +72260,7 @@ var init_managedDaemonControlAuth = __esm({
|
|
|
72093
72260
|
"provider",
|
|
72094
72261
|
"providerInstanceId",
|
|
72095
72262
|
"challenge"
|
|
72096
|
-
]) || value.type !== "control_auth_challenge" || value.version !==
|
|
72263
|
+
]) || value.type !== "control_auth_challenge" || value.version !== 1 && value.version !== 2 || value.audience !== "session" && value.audience !== "exec" || value.provider !== "e2b") {
|
|
72097
72264
|
return null;
|
|
72098
72265
|
}
|
|
72099
72266
|
const instanceId = readBoundedString(value.instanceId, MANAGED_DAEMON_CONTROL_AUTH_MAX_IDENTITY_LENGTH);
|
|
@@ -72104,7 +72271,7 @@ var init_managedDaemonControlAuth = __esm({
|
|
|
72104
72271
|
}
|
|
72105
72272
|
return {
|
|
72106
72273
|
type: "control_auth_challenge",
|
|
72107
|
-
version:
|
|
72274
|
+
version: value.version,
|
|
72108
72275
|
audience: value.audience,
|
|
72109
72276
|
instanceId,
|
|
72110
72277
|
provider: value.provider,
|
|
@@ -72237,7 +72404,13 @@ var init_managedDaemonControlAuthClient = __esm({
|
|
|
72237
72404
|
let stage = "awaiting_challenge";
|
|
72238
72405
|
let expectedConfirmation = null;
|
|
72239
72406
|
return {
|
|
72240
|
-
|
|
72407
|
+
// Older daemons require exact init keys but accept additional capabilities.
|
|
72408
|
+
initMessage: buildManagedDaemonControlAuthInitMessage([
|
|
72409
|
+
.../* @__PURE__ */ new Set([
|
|
72410
|
+
...capabilities,
|
|
72411
|
+
MANAGED_DAEMON_CONTROL_AUTH_SIGNED_CAPABILITY
|
|
72412
|
+
])
|
|
72413
|
+
]),
|
|
72241
72414
|
issueGrantForChallenge: async (value) => {
|
|
72242
72415
|
if (stage !== "awaiting_challenge") {
|
|
72243
72416
|
throw new ManagedDaemonControlAuthClientError("Managed daemon sent an authorization challenge in an invalid state.", "invalid_state");
|
|
@@ -72256,19 +72429,20 @@ var init_managedDaemonControlAuthClient = __esm({
|
|
|
72256
72429
|
...target,
|
|
72257
72430
|
audience,
|
|
72258
72431
|
challenge: challenge.challenge,
|
|
72259
|
-
requestId: requestId2
|
|
72432
|
+
requestId: requestId2,
|
|
72433
|
+
...challenge.version === 2 ? { protocolVersion: 2 } : {}
|
|
72260
72434
|
});
|
|
72261
72435
|
} catch (error55) {
|
|
72262
72436
|
throw new ManagedDaemonControlAuthClientError(error55 instanceof Error ? error55.message : "Managed daemon authorization was rejected.", "grant_rejected", error55);
|
|
72263
72437
|
}
|
|
72264
|
-
if (issued.protocolVersion !==
|
|
72438
|
+
if (issued.protocolVersion !== challenge.version || issued.requestId !== requestId2 || !decodeBase64UrlExact(issued.grant, challenge.version === 2 ? MANAGED_DAEMON_CONTROL_AUTH_SIGNATURE_BYTES : MANAGED_DAEMON_CONTROL_AUTH_MAC_BYTES) || !decodeBase64UrlExact(issued.expectedConfirmation, MANAGED_DAEMON_CONTROL_AUTH_MAC_BYTES)) {
|
|
72265
72439
|
throw new ManagedDaemonControlAuthClientError("Managed daemon authorization response is invalid.", "grant_rejected");
|
|
72266
72440
|
}
|
|
72267
72441
|
expectedConfirmation = issued.expectedConfirmation;
|
|
72268
72442
|
stage = "awaiting_confirmation";
|
|
72269
72443
|
return {
|
|
72270
72444
|
type: "control_auth_grant",
|
|
72271
|
-
version:
|
|
72445
|
+
version: challenge.version,
|
|
72272
72446
|
grant: issued.grant
|
|
72273
72447
|
};
|
|
72274
72448
|
},
|
|
@@ -73297,12 +73471,12 @@ var init_gitSigning = __esm({
|
|
|
73297
73471
|
});
|
|
73298
73472
|
|
|
73299
73473
|
// ../../../../shared/devboxCore/dist/sessions.js
|
|
73300
|
-
var
|
|
73474
|
+
var logger2, resolveSessionMapPathForWrite, readSpriteSessions, writeSpriteSessions;
|
|
73301
73475
|
var init_sessions = __esm({
|
|
73302
73476
|
"../../../../shared/devboxCore/dist/sessions.js"() {
|
|
73303
73477
|
"use strict";
|
|
73304
73478
|
init_logger();
|
|
73305
|
-
|
|
73479
|
+
logger2 = createLogger("sessions");
|
|
73306
73480
|
resolveSessionMapPathForWrite = async (client, name) => {
|
|
73307
73481
|
const result = await client.exec(name, [
|
|
73308
73482
|
"/bin/bash",
|
|
@@ -73348,7 +73522,7 @@ var init_sessions = __esm({
|
|
|
73348
73522
|
}
|
|
73349
73523
|
return entries;
|
|
73350
73524
|
} catch {
|
|
73351
|
-
|
|
73525
|
+
logger2.warn("sessions_parse_failed", { name });
|
|
73352
73526
|
return {};
|
|
73353
73527
|
}
|
|
73354
73528
|
};
|
|
@@ -73571,15 +73745,17 @@ var init_loopbackHttpAuthority = __esm({
|
|
|
73571
73745
|
|
|
73572
73746
|
// ../../../../shared/devboxCore/dist/portProxying.js
|
|
73573
73747
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
73574
|
-
var DIRECT_DAEMON_PROXY_CONNECT_TIMEOUT_MS, DIRECT_DAEMON_PROXY_OPEN_TIMEOUT_MS, buildDirectDaemonProxyWebSocketUrl, parseJsonRecord, parseControlError, decodeBase64, toSocketBuffer, DirectDaemonProxyExecSocket, bridgeExecSocketToLocalSocket;
|
|
73748
|
+
var SystemTrustWebSocket, DIRECT_DAEMON_PROXY_CONNECT_TIMEOUT_MS, DIRECT_DAEMON_PROXY_OPEN_TIMEOUT_MS, buildDirectDaemonProxyWebSocketUrl, parseJsonRecord, parseControlError, decodeBase64, toSocketBuffer, DirectDaemonProxyExecSocket, bridgeExecSocketToLocalSocket;
|
|
73575
73749
|
var init_portProxying = __esm({
|
|
73576
73750
|
"../../../../shared/devboxCore/dist/portProxying.js"() {
|
|
73577
73751
|
"use strict";
|
|
73578
73752
|
init_wrapper();
|
|
73579
73753
|
init_loopbackHttpAuthority();
|
|
73580
73754
|
init_managedDaemonControlAuth();
|
|
73755
|
+
init_systemTrust();
|
|
73581
73756
|
init_managedDaemonControlAuthClient();
|
|
73582
73757
|
init_ttyControlProtocol();
|
|
73758
|
+
SystemTrustWebSocket = withSystemTrustWebSocket(wrapper_default);
|
|
73583
73759
|
DIRECT_DAEMON_PROXY_CONNECT_TIMEOUT_MS = 12e3;
|
|
73584
73760
|
DIRECT_DAEMON_PROXY_OPEN_TIMEOUT_MS = 12e3;
|
|
73585
73761
|
buildDirectDaemonProxyWebSocketUrl = (target) => buildManagedDaemonDirectWebSocketUrl({
|
|
@@ -73822,7 +73998,7 @@ var init_portProxying = __esm({
|
|
|
73822
73998
|
requestId: randomUUID4(),
|
|
73823
73999
|
allowWake: this.allowWake
|
|
73824
74000
|
});
|
|
73825
|
-
await this.
|
|
74001
|
+
await this.connectWithSystemTrust(true);
|
|
73826
74002
|
} catch (error55) {
|
|
73827
74003
|
if (!this.closed) {
|
|
73828
74004
|
this.fail(error55);
|
|
@@ -73896,13 +74072,18 @@ var init_portProxying = __esm({
|
|
|
73896
74072
|
}
|
|
73897
74073
|
async start() {
|
|
73898
74074
|
try {
|
|
73899
|
-
await this.
|
|
74075
|
+
await this.connectWithSystemTrust(false);
|
|
73900
74076
|
} catch (error55) {
|
|
73901
74077
|
this.clearConnectTimer();
|
|
73902
74078
|
this.clearOpenTimer();
|
|
73903
|
-
this.
|
|
74079
|
+
if (!this.closed) {
|
|
74080
|
+
this.fail(error55);
|
|
74081
|
+
}
|
|
73904
74082
|
}
|
|
73905
74083
|
}
|
|
74084
|
+
async connectWithSystemTrust(recoveryAttempted) {
|
|
74085
|
+
await withSystemTrustRetry(() => this.connect(recoveryAttempted));
|
|
74086
|
+
}
|
|
73906
74087
|
async connect(recoveryAttempted) {
|
|
73907
74088
|
if (this.closed) {
|
|
73908
74089
|
return;
|
|
@@ -73922,58 +74103,71 @@ var init_portProxying = __esm({
|
|
|
73922
74103
|
requestId: this.requestId,
|
|
73923
74104
|
target: connectInfo.target
|
|
73924
74105
|
});
|
|
73925
|
-
const ws = new
|
|
74106
|
+
const ws = new SystemTrustWebSocket(connectInfo.wsUrl);
|
|
73926
74107
|
this.ws = ws;
|
|
73927
74108
|
this.authStage = "awaiting_challenge";
|
|
73928
74109
|
this.startConnectTimer();
|
|
73929
|
-
|
|
73930
|
-
|
|
73931
|
-
|
|
73932
|
-
|
|
73933
|
-
|
|
73934
|
-
|
|
73935
|
-
|
|
73936
|
-
|
|
73937
|
-
|
|
73938
|
-
|
|
73939
|
-
|
|
73940
|
-
|
|
73941
|
-
|
|
73942
|
-
|
|
73943
|
-
|
|
73944
|
-
|
|
73945
|
-
|
|
73946
|
-
|
|
73947
|
-
|
|
74110
|
+
await new Promise((resolve3, reject) => {
|
|
74111
|
+
ws.on("open", () => {
|
|
74112
|
+
resolve3();
|
|
74113
|
+
try {
|
|
74114
|
+
this.sendJson(handshake.initMessage);
|
|
74115
|
+
} catch (error55) {
|
|
74116
|
+
this.fail(error55);
|
|
74117
|
+
}
|
|
74118
|
+
});
|
|
74119
|
+
ws.on("message", (raw) => {
|
|
74120
|
+
const parsed = parseJsonRecord(raw);
|
|
74121
|
+
if (!parsed) {
|
|
74122
|
+
return;
|
|
74123
|
+
}
|
|
74124
|
+
if (!this.authenticated) {
|
|
74125
|
+
this.handleAuthMessage({
|
|
74126
|
+
ws,
|
|
74127
|
+
message: parsed,
|
|
74128
|
+
handshake,
|
|
74129
|
+
connectInfo,
|
|
74130
|
+
recoveryAttempted
|
|
74131
|
+
});
|
|
74132
|
+
return;
|
|
74133
|
+
}
|
|
74134
|
+
this.handleDaemonMessage(parsed);
|
|
74135
|
+
});
|
|
74136
|
+
ws.on("pong", () => {
|
|
74137
|
+
this.emitPong();
|
|
74138
|
+
});
|
|
74139
|
+
ws.on("error", (error55) => {
|
|
74140
|
+
if (!this.authenticated && !this.closed && isUntrustedCertificateError(error55)) {
|
|
74141
|
+
this.clearConnectTimer();
|
|
74142
|
+
this.detachWebSocket(ws);
|
|
74143
|
+
if (this.ws === ws) {
|
|
74144
|
+
this.ws = null;
|
|
74145
|
+
}
|
|
74146
|
+
reject(error55);
|
|
74147
|
+
return;
|
|
74148
|
+
}
|
|
74149
|
+
if (!this.authenticated && !recoveryAttempted) {
|
|
74150
|
+
return;
|
|
74151
|
+
}
|
|
74152
|
+
this.emit("error", {
|
|
74153
|
+
data: error55 instanceof Error ? error55 : new Error(String(error55))
|
|
73948
74154
|
});
|
|
73949
|
-
return;
|
|
73950
|
-
}
|
|
73951
|
-
this.handleDaemonMessage(parsed);
|
|
73952
|
-
});
|
|
73953
|
-
ws.on("pong", () => {
|
|
73954
|
-
this.emitPong();
|
|
73955
|
-
});
|
|
73956
|
-
ws.on("error", (error55) => {
|
|
73957
|
-
if (!this.authenticated && !recoveryAttempted) {
|
|
73958
|
-
return;
|
|
73959
|
-
}
|
|
73960
|
-
this.emit("error", {
|
|
73961
|
-
data: error55 instanceof Error ? error55 : new Error(String(error55))
|
|
73962
74155
|
});
|
|
73963
|
-
|
|
73964
|
-
|
|
73965
|
-
|
|
73966
|
-
|
|
73967
|
-
|
|
73968
|
-
|
|
73969
|
-
|
|
73970
|
-
|
|
73971
|
-
|
|
73972
|
-
|
|
73973
|
-
|
|
73974
|
-
|
|
73975
|
-
|
|
73976
|
-
|
|
74156
|
+
ws.on("close", (code2) => {
|
|
74157
|
+
resolve3();
|
|
74158
|
+
this.clearConnectTimer();
|
|
74159
|
+
this.clearOpenTimer();
|
|
74160
|
+
if (this.closed) {
|
|
74161
|
+
return;
|
|
74162
|
+
}
|
|
74163
|
+
if (!this.authenticated && !recoveryAttempted && this.ws === ws) {
|
|
74164
|
+
void this.recoverAndReconnect(ws, connectInfo);
|
|
74165
|
+
return;
|
|
74166
|
+
}
|
|
74167
|
+
this.closed = true;
|
|
74168
|
+
this.readyState = 3;
|
|
74169
|
+
this.emit("close", { code: code2 });
|
|
74170
|
+
});
|
|
73977
74171
|
});
|
|
73978
74172
|
}
|
|
73979
74173
|
send(data, cb) {
|
|
@@ -76046,7 +76240,7 @@ var init_packageVersion = __esm({
|
|
|
76046
76240
|
return path18.join(process.cwd(), "dvb");
|
|
76047
76241
|
};
|
|
76048
76242
|
readEmbeddedPackageVersion = () => {
|
|
76049
|
-
const raw = "1.0.
|
|
76243
|
+
const raw = "1.0.1111";
|
|
76050
76244
|
return trimVersion(raw);
|
|
76051
76245
|
};
|
|
76052
76246
|
readNearestPackageMetadata = (basePath) => {
|
|
@@ -76306,6 +76500,7 @@ var init_dist3 = __esm({
|
|
|
76306
76500
|
init_accountScope();
|
|
76307
76501
|
init_accountMigration();
|
|
76308
76502
|
init_logger();
|
|
76503
|
+
init_systemTrust();
|
|
76309
76504
|
init_sentry();
|
|
76310
76505
|
init_paths();
|
|
76311
76506
|
init_localPortLeases();
|
|
@@ -76364,6 +76559,7 @@ var LOGIN_REQUIRED_MESSAGES, ControlPlaneLoginRequiredError, ControlPlaneAuthUna
|
|
|
76364
76559
|
var init_authErrors = __esm({
|
|
76365
76560
|
"src/devbox/authErrors.ts"() {
|
|
76366
76561
|
"use strict";
|
|
76562
|
+
init_devboxCore();
|
|
76367
76563
|
LOGIN_REQUIRED_MESSAGES = {
|
|
76368
76564
|
signed_out: "Not logged in to boxes.dev. Run `dvb setup` in an interactive terminal first.",
|
|
76369
76565
|
session_invalid: "Your saved boxes.dev login is no longer valid. Run `dvb setup` in an interactive terminal to log in again."
|
|
@@ -76379,7 +76575,7 @@ var init_authErrors = __esm({
|
|
|
76379
76575
|
ControlPlaneAuthUnavailableError = class extends Error {
|
|
76380
76576
|
constructor(options) {
|
|
76381
76577
|
super(
|
|
76382
|
-
"Couldn't check your boxes.dev login. Check your network connection, or try again in a few minutes.",
|
|
76578
|
+
describeCertificateFailure(options.cause, "try again") ?? "Couldn't check your boxes.dev login. Check your network connection, or try again in a few minutes.",
|
|
76383
76579
|
options
|
|
76384
76580
|
);
|
|
76385
76581
|
this.name = "ControlPlaneAuthUnavailableError";
|
|
@@ -81543,7 +81739,7 @@ var require_websocket2 = __commonJS({
|
|
|
81543
81739
|
var https4 = __require("https");
|
|
81544
81740
|
var http11 = __require("http");
|
|
81545
81741
|
var net6 = __require("net");
|
|
81546
|
-
var
|
|
81742
|
+
var tls4 = __require("tls");
|
|
81547
81743
|
var { randomBytes: randomBytes15, createHash: createHash29 } = __require("crypto");
|
|
81548
81744
|
var { Duplex, Readable: Readable3 } = __require("stream");
|
|
81549
81745
|
var { URL: URL3 } = __require("url");
|
|
@@ -82293,7 +82489,7 @@ var require_websocket2 = __commonJS({
|
|
|
82293
82489
|
if (!options.servername && options.servername !== "") {
|
|
82294
82490
|
options.servername = net6.isIP(options.host) ? "" : options.host;
|
|
82295
82491
|
}
|
|
82296
|
-
return
|
|
82492
|
+
return tls4.connect(options);
|
|
82297
82493
|
}
|
|
82298
82494
|
function abortHandshake(websocket, stream, message) {
|
|
82299
82495
|
websocket._readyState = WebSocket4.CLOSING;
|
|
@@ -83078,15 +83274,15 @@ var init_browser = __esm({
|
|
|
83078
83274
|
});
|
|
83079
83275
|
|
|
83080
83276
|
// src/devbox/logger.ts
|
|
83081
|
-
var
|
|
83277
|
+
var logger3, writeCliStartupTrace;
|
|
83082
83278
|
var init_logger3 = __esm({
|
|
83083
83279
|
"src/devbox/logger.ts"() {
|
|
83084
83280
|
"use strict";
|
|
83085
83281
|
init_devboxCore();
|
|
83086
|
-
|
|
83282
|
+
logger3 = createLogger("devbox");
|
|
83087
83283
|
writeCliStartupTrace = (message, fields) => {
|
|
83088
83284
|
if (process.env.DEVBOX_STARTUP_TRACE !== "1") {
|
|
83089
|
-
|
|
83285
|
+
logger3.debug(message, fields);
|
|
83090
83286
|
return;
|
|
83091
83287
|
}
|
|
83092
83288
|
process.stderr.write(
|
|
@@ -83133,8 +83329,8 @@ function prefix_for_source(source) {
|
|
|
83133
83329
|
}
|
|
83134
83330
|
}
|
|
83135
83331
|
function instantiateDefaultLogger(options) {
|
|
83136
|
-
const
|
|
83137
|
-
|
|
83332
|
+
const logger13 = new DefaultLogger(options);
|
|
83333
|
+
logger13.addLogLineListener((level, ...args) => {
|
|
83138
83334
|
switch (level) {
|
|
83139
83335
|
case "debug":
|
|
83140
83336
|
console.debug(...args);
|
|
@@ -83154,12 +83350,12 @@ function instantiateDefaultLogger(options) {
|
|
|
83154
83350
|
}
|
|
83155
83351
|
}
|
|
83156
83352
|
});
|
|
83157
|
-
return
|
|
83353
|
+
return logger13;
|
|
83158
83354
|
}
|
|
83159
83355
|
function instantiateNoopLogger(options) {
|
|
83160
83356
|
return new DefaultLogger(options);
|
|
83161
83357
|
}
|
|
83162
|
-
function logForFunction(
|
|
83358
|
+
function logForFunction(logger13, type, source, udfPath, message) {
|
|
83163
83359
|
const prefix = prefix_for_source(source);
|
|
83164
83360
|
if (typeof message === "object") {
|
|
83165
83361
|
message = `ConvexError ${JSON.stringify(message.errorData, null, 2)}`;
|
|
@@ -83167,21 +83363,21 @@ function logForFunction(logger12, type, source, udfPath, message) {
|
|
|
83167
83363
|
if (type === "info") {
|
|
83168
83364
|
const match = message.match(/^\[.*?\] /);
|
|
83169
83365
|
if (match === null) {
|
|
83170
|
-
|
|
83366
|
+
logger13.error(
|
|
83171
83367
|
`[CONVEX ${prefix}(${udfPath})] Could not parse console.log`
|
|
83172
83368
|
);
|
|
83173
83369
|
return;
|
|
83174
83370
|
}
|
|
83175
83371
|
const level = message.slice(1, match[0].length - 2);
|
|
83176
83372
|
const args = message.slice(match[0].length);
|
|
83177
|
-
|
|
83373
|
+
logger13.log(`%c[CONVEX ${prefix}(${udfPath})] [${level}]`, INFO_COLOR, args);
|
|
83178
83374
|
} else {
|
|
83179
|
-
|
|
83375
|
+
logger13.error(`[CONVEX ${prefix}(${udfPath})] ${message}`);
|
|
83180
83376
|
}
|
|
83181
83377
|
}
|
|
83182
|
-
function logFatalError(
|
|
83378
|
+
function logFatalError(logger13, message) {
|
|
83183
83379
|
const errorMessage2 = `[CONVEX FATAL ERROR] ${message}`;
|
|
83184
|
-
|
|
83380
|
+
logger13.error(errorMessage2);
|
|
83185
83381
|
return new Error(errorMessage2);
|
|
83186
83382
|
}
|
|
83187
83383
|
function createHybridErrorStacktrace(source, udfPath, result) {
|
|
@@ -83600,8 +83796,8 @@ var init_request_manager = __esm({
|
|
|
83600
83796
|
__defNormalProp6 = (obj, key, value) => key in obj ? __defProp8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
83601
83797
|
__publicField6 = (obj, key, value) => __defNormalProp6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
83602
83798
|
RequestManager = class {
|
|
83603
|
-
constructor(
|
|
83604
|
-
this.logger =
|
|
83799
|
+
constructor(logger13, markConnectionStateDirty) {
|
|
83800
|
+
this.logger = logger13;
|
|
83605
83801
|
this.markConnectionStateDirty = markConnectionStateDirty;
|
|
83606
83802
|
__publicField6(this, "inflightRequests");
|
|
83607
83803
|
__publicField6(this, "requestsOlderThanRestart");
|
|
@@ -84065,7 +84261,7 @@ var init_remote_query_set = __esm({
|
|
|
84065
84261
|
__defNormalProp9 = (obj, key, value) => key in obj ? __defProp11(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
84066
84262
|
__publicField9 = (obj, key, value) => __defNormalProp9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
84067
84263
|
RemoteQuerySet = class {
|
|
84068
|
-
constructor(queryPath,
|
|
84264
|
+
constructor(queryPath, logger13) {
|
|
84069
84265
|
__publicField9(this, "version");
|
|
84070
84266
|
__publicField9(this, "remoteQuerySet");
|
|
84071
84267
|
__publicField9(this, "queryPath");
|
|
@@ -84073,7 +84269,7 @@ var init_remote_query_set = __esm({
|
|
|
84073
84269
|
this.version = { querySet: 0, ts: Long.fromNumber(0), identity: 0 };
|
|
84074
84270
|
this.remoteQuerySet = /* @__PURE__ */ new Map();
|
|
84075
84271
|
this.queryPath = queryPath;
|
|
84076
|
-
this.logger =
|
|
84272
|
+
this.logger = logger13;
|
|
84077
84273
|
}
|
|
84078
84274
|
transition(transition) {
|
|
84079
84275
|
const start = transition.startVersion;
|
|
@@ -84271,7 +84467,7 @@ var init_web_socket_manager = __esm({
|
|
|
84271
84467
|
TooManyWritesInTimePeriod: { timeout: 3e3 }
|
|
84272
84468
|
};
|
|
84273
84469
|
WebSocketManager = class {
|
|
84274
|
-
constructor(uri, callbacks, webSocketConstructor,
|
|
84470
|
+
constructor(uri, callbacks, webSocketConstructor, logger13, markConnectionStateDirty, debug4) {
|
|
84275
84471
|
this.markConnectionStateDirty = markConnectionStateDirty;
|
|
84276
84472
|
this.debug = debug4;
|
|
84277
84473
|
__publicField10(this, "socket");
|
|
@@ -84308,7 +84504,7 @@ var init_web_socket_manager = __esm({
|
|
|
84308
84504
|
this.onResume = callbacks.onResume;
|
|
84309
84505
|
this.onMessage = callbacks.onMessage;
|
|
84310
84506
|
this.onServerDisconnectError = callbacks.onServerDisconnectError;
|
|
84311
|
-
this.logger =
|
|
84507
|
+
this.logger = logger13;
|
|
84312
84508
|
this.setupNetworkListener();
|
|
84313
84509
|
this.connect();
|
|
84314
84510
|
}
|
|
@@ -89794,7 +89990,7 @@ var init_simple_client_node = __esm({
|
|
|
89794
89990
|
var https4 = __require2("https");
|
|
89795
89991
|
var http11 = __require2("http");
|
|
89796
89992
|
var net6 = __require2("net");
|
|
89797
|
-
var
|
|
89993
|
+
var tls4 = __require2("tls");
|
|
89798
89994
|
var { randomBytes: randomBytes15, createHash: createHash29 } = __require2("crypto");
|
|
89799
89995
|
var { Duplex, Readable: Readable3 } = __require2("stream");
|
|
89800
89996
|
var { URL: URL3 } = __require2("url");
|
|
@@ -90531,7 +90727,7 @@ var init_simple_client_node = __esm({
|
|
|
90531
90727
|
if (!options.servername && options.servername !== "") {
|
|
90532
90728
|
options.servername = net6.isIP(options.host) ? "" : options.host;
|
|
90533
90729
|
}
|
|
90534
|
-
return
|
|
90730
|
+
return tls4.connect(options);
|
|
90535
90731
|
}
|
|
90536
90732
|
function abortHandshake(websocket, stream, message) {
|
|
90537
90733
|
websocket._readyState = WebSocket22.CLOSING;
|
|
@@ -91126,7 +91322,7 @@ var init_index_node2 = __esm({
|
|
|
91126
91322
|
// src/devbox/controlPlane.ts
|
|
91127
91323
|
import http7 from "node:http";
|
|
91128
91324
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
91129
|
-
var MANAGED_DAEMON_NOT_READY_CODE, CONVEX_INFLIGHT_ACTION_DISCONNECTED_MESSAGE, CONTROL_PLANE_ACTION_RETRY_MAX_ATTEMPTS, CONTROL_PLANE_ACTION_RETRY_BASE_DELAY_MS, MANAGED_DAEMON_RECOVERY_WAKING_TIMEOUT_MS, CONTROL_PLANE_CHECKPOINT_RECOVERY_MAX_ATTEMPTS, CONTROL_PLANE_CHECKPOINT_RECOVERY_POLL_MS, ManagedDaemonNotReadyError, isManagedDaemonNotReadyError, isManagedDaemonSleepingError, sleep2, isRetryableTransientConvexActionError, buildTransientConvexActionRetryMessage, announceTransientConvexActionRetry, retryTransientConvexAction, normalizeStringRecord, E2B_DEVBOX_ALIAS_EXISTS_CODE, isRecord3, maybeMapE2bProvisionControlPlaneError, mapE2bProvisionControlPlaneError, LOGIN_CODE_REJECTIONS, resolveControlPlaneUrl, resolveConvexUrl, CONTROL_PLANE_REQUEST_UNAVAILABLE_CODE, ControlPlaneRequestUnavailableError, isControlPlaneRequestUnavailableError, requestJson, ControlPlaneRequestError, isControlPlaneAuthRejectionError, isControlPlaneSessionRefreshRejectionError, startCallbackServer, getControlPlaneUrl, getConvexUrl, createDefaultBrowserSignInDeps, signInWithBrowser, claudeTokenGet, claudeTokenSet, claudeLoginSave, claudeTokenClear, agentAuthCredentialsList, fetchAgentCredentialRows, codexAuthCacheGet, codexAuthCacheSet, codexAuthCacheClear, claudeTokenReportRuntimeAuthFailureForViewer, claudeTokenReportRuntimeValidatedForViewer, e2bTokenResolvedGet, userSettingsGet, userSettingsSet, projectInstanceTypeOptionsGet, e2bDevboxRemove, e2bDevboxGet, e2bDevboxStatusesList, e2bDevboxDestroy, e2bDevboxProvision, e2bDevboxPause, e2bDevboxEnsureActive, e2bDevboxKeepAlive, e2bDevboxReset, e2bDevboxIssueBootstrapConnectInfo, e2bDevboxBootstrapDaemon, managedDaemonRecoverForInstance, managedDaemonControlGrantIssueForViewer, managedDevboxCreateCheckpoint, managedDevboxListRemoteStates, clientThreadsListForPrimaryInstance, threadTitleGenerationStatesListForPrimaryInstance, spriteDaemonSessionsList, clientThreadsUpsertRemoteInitCodexThread, clientThreadsDiscardRemoteInitCodexThread, projectInitJobsGetActiveForProject, agentInitProgressReportCliStep, instancesList, helloViewerGet, billingSummaryGet, convexBrowserModulePromise, loadConvexBrowserModule, buildConvexClientOptions, configureAuthenticatedConvexClient, createAuthenticatedConvexClient, withConvexClient, resolveInstanceIdForAlias, resolveManagedDaemonControlTargetWithClient, issueManagedDaemonControlGrantWithClient, resolveSpriteInstanceId, fetchClaudeTokenStatus, fetchResolvedE2bCredentials, VIEWER_LOOKUP_TIMEOUT_MS, fetchViewerIdentity, BILLING_ACTIVATION_STATES, readBillingActivationBoolean, parseBillingActivationDecision, parseBillingActivationSummary, fetchTeamBillingActivationForViewer, fetchActiveDesktopInitJobForProject, AGENT_INIT_STEP_REPORT_TIMEOUT_MS, reportAgentInitStep, fetchViewerCodingAgentPreference, fetchProjectInstanceTypeOptionsForViewer, storeViewerCodingAgentPreference, storeClaudeCodeOauthToken, storeClaudeLogin, clearClaudeCodeOauthToken, reportClaudeRuntimeAuthFailureForViewer, reportClaudeRuntimeValidatedForViewer, fetchCodexAuthCacheStatus, storeCodexAuthCache, clearCodexAuthCache, normalizeE2bDevboxRecord, fetchE2bDevboxLifecycle, listE2bDevboxStatuses, destroyE2bDevbox, provisionE2bDevbox, pauseE2bDevbox, ensureE2bDevboxActive, keepAliveE2bDevbox, resetE2bDevbox, bootstrapE2bDaemon, throwManagedDaemonNotReady, normalizeOptionalString2, normalizeAliasForLookup, validateManagedDaemonRecoveryResponse, normalizeManagedCheckpointResponse, buildRecoveredManagedCheckpointResponse, readManagedCheckpointRecoveryState, recoverManagedCheckpointAfterDisconnect, recoverManagedDaemonForInit, recoverManagedDaemonControlTargetWithClient, verifyManagedDaemonAccessForInit, fetchE2bBootstrapConnectInfo, createManagedCheckpoint, listManagedRemoteStates, listViewerInstances, listSpriteDaemonSessions, upsertRemoteInitCodexThread, discardRemoteInitCodexThread, signOutControlPlane, REFRESH_SESSION_TIMEOUT_MS, refreshControlPlaneSession, readLoginCodeRejection, exchangeLoginCode, createCliInitResponsesRelayTokenForViewer;
|
|
91325
|
+
var MANAGED_DAEMON_NOT_READY_CODE, CONVEX_INFLIGHT_ACTION_DISCONNECTED_MESSAGE, CONTROL_PLANE_ACTION_RETRY_MAX_ATTEMPTS, CONTROL_PLANE_ACTION_RETRY_BASE_DELAY_MS, MANAGED_DAEMON_RECOVERY_WAKING_TIMEOUT_MS, CONTROL_PLANE_CHECKPOINT_RECOVERY_MAX_ATTEMPTS, CONTROL_PLANE_CHECKPOINT_RECOVERY_POLL_MS, ManagedDaemonNotReadyError, isManagedDaemonNotReadyError, isManagedDaemonSleepingError, sleep2, isRetryableTransientConvexActionError, buildTransientConvexActionRetryMessage, announceTransientConvexActionRetry, retryTransientConvexAction, normalizeStringRecord, E2B_DEVBOX_ALIAS_EXISTS_CODE, isRecord3, maybeMapE2bProvisionControlPlaneError, mapE2bProvisionControlPlaneError, LOGIN_CODE_REJECTIONS, resolveControlPlaneUrl, resolveConvexUrl, CONTROL_PLANE_REQUEST_UNAVAILABLE_CODE, ControlPlaneRequestUnavailableError, isControlPlaneRequestUnavailableError, requestJson, ControlPlaneRequestError, isControlPlaneAuthRejectionError, isControlPlaneSessionRefreshRejectionError, startCallbackServer, getControlPlaneUrl, getConvexUrl, createDefaultBrowserSignInDeps, signInWithBrowser, claudeTokenGet, claudeTokenSet, claudeLoginSave, claudeTokenClear, agentAuthCredentialsList, fetchAgentCredentialRows, codexAuthCacheGet, codexAuthCacheSet, codexAuthCacheClear, claudeTokenReportRuntimeAuthFailureForViewer, claudeTokenReportRuntimeValidatedForViewer, e2bTokenResolvedGet, userSettingsGet, userSettingsSet, projectInstanceTypeOptionsGet, e2bDevboxRemove, e2bDevboxGet, e2bDevboxStatusesList, e2bDevboxDestroy, e2bDevboxProvision, e2bDevboxPause, e2bDevboxEnsureActive, e2bDevboxKeepAlive, e2bDevboxReset, e2bDevboxIssueBootstrapConnectInfo, e2bDevboxBootstrapDaemon, managedDaemonRecoverForInstance, managedDaemonControlGrantIssueForViewer, managedDevboxCreateCheckpoint, managedDevboxListRemoteStates, clientThreadsListForPrimaryInstance, threadTitleGenerationStatesListForPrimaryInstance, spriteDaemonSessionsList, clientThreadsUpsertRemoteInitCodexThread, clientThreadsDiscardRemoteInitCodexThread, projectInitJobsGetActiveForProject, agentInitProgressReportCliStep, instancesList, helloViewerGet, billingSummaryGet, convexBrowserModulePromise, loadConvexBrowserModule, buildConvexClientOptions, configureAuthenticatedConvexClient, createAuthenticatedConvexClient, withConvexClient, resolveInstanceIdForAlias, resolveManagedDaemonControlTargetWithClient, issueManagedDaemonControlGrantWithClient, resolveSpriteInstanceId, fetchClaudeTokenStatus, fetchResolvedE2bCredentials, VIEWER_LOOKUP_TIMEOUT_MS, fetchViewerIdentityOnce, fetchViewerIdentity, BILLING_ACTIVATION_STATES, readBillingActivationBoolean, parseBillingActivationDecision, parseBillingActivationSummary, fetchTeamBillingActivationForViewer, fetchActiveDesktopInitJobForProject, AGENT_INIT_STEP_REPORT_TIMEOUT_MS, reportAgentInitStep, fetchViewerCodingAgentPreference, fetchProjectInstanceTypeOptionsForViewer, storeViewerCodingAgentPreference, storeClaudeCodeOauthToken, storeClaudeLogin, clearClaudeCodeOauthToken, reportClaudeRuntimeAuthFailureForViewer, reportClaudeRuntimeValidatedForViewer, fetchCodexAuthCacheStatus, storeCodexAuthCache, clearCodexAuthCache, normalizeE2bDevboxRecord, fetchE2bDevboxLifecycle, listE2bDevboxStatuses, destroyE2bDevbox, provisionE2bDevbox, pauseE2bDevbox, ensureE2bDevboxActive, keepAliveE2bDevbox, resetE2bDevbox, bootstrapE2bDaemon, throwManagedDaemonNotReady, normalizeOptionalString2, normalizeAliasForLookup, validateManagedDaemonRecoveryResponse, normalizeManagedCheckpointResponse, buildRecoveredManagedCheckpointResponse, readManagedCheckpointRecoveryState, recoverManagedCheckpointAfterDisconnect, recoverManagedDaemonForInit, recoverManagedDaemonControlTargetWithClient, verifyManagedDaemonAccessForInit, fetchE2bBootstrapConnectInfo, createManagedCheckpoint, listManagedRemoteStates, listViewerInstances, listSpriteDaemonSessions, upsertRemoteInitCodexThread, discardRemoteInitCodexThread, signOutControlPlane, REFRESH_SESSION_TIMEOUT_MS, refreshControlPlaneSession, readLoginCodeRejection, exchangeLoginCode, createCliInitResponsesRelayTokenForViewer;
|
|
91130
91326
|
var init_controlPlane = __esm({
|
|
91131
91327
|
"src/devbox/controlPlane.ts"() {
|
|
91132
91328
|
"use strict";
|
|
@@ -91219,7 +91415,7 @@ var init_controlPlane = __esm({
|
|
|
91219
91415
|
delayMs,
|
|
91220
91416
|
error: error55.message
|
|
91221
91417
|
};
|
|
91222
|
-
|
|
91418
|
+
logger3.warn("control_plane_action_retry", {
|
|
91223
91419
|
action: options.actionName,
|
|
91224
91420
|
attempt,
|
|
91225
91421
|
maxAttempts,
|
|
@@ -91315,9 +91511,10 @@ var init_controlPlane = __esm({
|
|
|
91315
91511
|
method;
|
|
91316
91512
|
path;
|
|
91317
91513
|
constructor(args) {
|
|
91318
|
-
super(
|
|
91319
|
-
cause
|
|
91320
|
-
|
|
91514
|
+
super(
|
|
91515
|
+
describeCertificateFailure(args.cause, "try again") ?? "The boxes.dev request could not be completed.",
|
|
91516
|
+
{ cause: args.cause }
|
|
91517
|
+
);
|
|
91321
91518
|
this.name = "ControlPlaneRequestUnavailableError";
|
|
91322
91519
|
this.requestId = args.requestId;
|
|
91323
91520
|
this.method = args.method;
|
|
@@ -91338,7 +91535,7 @@ var init_controlPlane = __esm({
|
|
|
91338
91535
|
if (body) {
|
|
91339
91536
|
headers["content-type"] = "application/json";
|
|
91340
91537
|
}
|
|
91341
|
-
|
|
91538
|
+
logger3.info("control_plane_request", {
|
|
91342
91539
|
requestId: requestId2,
|
|
91343
91540
|
method,
|
|
91344
91541
|
path: url3.pathname
|
|
@@ -91351,12 +91548,13 @@ var init_controlPlane = __esm({
|
|
|
91351
91548
|
init3.signal = signal;
|
|
91352
91549
|
}
|
|
91353
91550
|
const unavailable2 = (error55) => {
|
|
91354
|
-
|
|
91551
|
+
logger3.warn("control_plane_request_failed", {
|
|
91355
91552
|
requestId: requestId2,
|
|
91356
91553
|
method,
|
|
91357
91554
|
path: url3.pathname,
|
|
91358
91555
|
status: "unavailable",
|
|
91359
|
-
error: error55 instanceof Error ? error55.message : String(error55)
|
|
91556
|
+
error: error55 instanceof Error ? error55.message : String(error55),
|
|
91557
|
+
tlsCode: findCertificateFailure(error55)?.code ?? null
|
|
91360
91558
|
});
|
|
91361
91559
|
return new ControlPlaneRequestUnavailableError({
|
|
91362
91560
|
requestId: requestId2,
|
|
@@ -91367,11 +91565,11 @@ var init_controlPlane = __esm({
|
|
|
91367
91565
|
};
|
|
91368
91566
|
let response;
|
|
91369
91567
|
try {
|
|
91370
|
-
response = await
|
|
91568
|
+
response = await fetchWithSystemTrust(url3, init3);
|
|
91371
91569
|
} catch (error55) {
|
|
91372
91570
|
throw unavailable2(error55);
|
|
91373
91571
|
}
|
|
91374
|
-
|
|
91572
|
+
logger3.info("control_plane_response", {
|
|
91375
91573
|
requestId: requestId2,
|
|
91376
91574
|
method,
|
|
91377
91575
|
path: url3.pathname,
|
|
@@ -91569,7 +91767,7 @@ var init_controlPlane = __esm({
|
|
|
91569
91767
|
throw new Error("Login failed to complete.");
|
|
91570
91768
|
}
|
|
91571
91769
|
const viewer = await browserSignInDeps.fetchViewerIdentity(finish.token).catch((error55) => {
|
|
91572
|
-
|
|
91770
|
+
logger3.warn("control_plane_viewer_identity_failed", {
|
|
91573
91771
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
91574
91772
|
});
|
|
91575
91773
|
return null;
|
|
@@ -91641,18 +91839,22 @@ var init_controlPlane = __esm({
|
|
|
91641
91839
|
}
|
|
91642
91840
|
return await convexBrowserModulePromise;
|
|
91643
91841
|
};
|
|
91644
|
-
buildConvexClientOptions = (
|
|
91842
|
+
buildConvexClientOptions = ({
|
|
91843
|
+
onCertificateFailure
|
|
91844
|
+
}) => ({
|
|
91645
91845
|
logger: false,
|
|
91646
91846
|
// Force the stable `ws` transport in Node. Letting Convex pick the global
|
|
91647
91847
|
// WebSocket uses Node's experimental Undici implementation on Node 22+,
|
|
91648
91848
|
// which is the path that crashed `dvb setup` in the shipped runtime.
|
|
91649
|
-
webSocketConstructor: wrapper_default2
|
|
91849
|
+
webSocketConstructor: withSystemTrustWebSocket(wrapper_default2, {
|
|
91850
|
+
onCertificateFailure: onCertificateFailure ?? null
|
|
91851
|
+
})
|
|
91650
91852
|
});
|
|
91651
91853
|
configureAuthenticatedConvexClient = (client, getToken) => {
|
|
91652
91854
|
client.setAuth(getToken);
|
|
91653
91855
|
return client;
|
|
91654
91856
|
};
|
|
91655
|
-
createAuthenticatedConvexClient = async (getToken) => {
|
|
91857
|
+
createAuthenticatedConvexClient = async (getToken, connectionOptions = {}) => {
|
|
91656
91858
|
const convexUrl = resolveConvexUrl();
|
|
91657
91859
|
if (!convexUrl) {
|
|
91658
91860
|
throw new Error(
|
|
@@ -91660,12 +91862,18 @@ var init_controlPlane = __esm({
|
|
|
91660
91862
|
);
|
|
91661
91863
|
}
|
|
91662
91864
|
const { ConvexClient: ConvexClient2 } = await loadConvexBrowserModule();
|
|
91663
|
-
const client = new ConvexClient2(
|
|
91865
|
+
const client = new ConvexClient2(
|
|
91866
|
+
convexUrl,
|
|
91867
|
+
buildConvexClientOptions(connectionOptions)
|
|
91868
|
+
);
|
|
91664
91869
|
configureAuthenticatedConvexClient(client, getToken);
|
|
91665
91870
|
return client;
|
|
91666
91871
|
};
|
|
91667
|
-
withConvexClient = async (token, handler) => {
|
|
91668
|
-
const client = await createAuthenticatedConvexClient(
|
|
91872
|
+
withConvexClient = async (token, handler, connectionOptions = {}) => {
|
|
91873
|
+
const client = await createAuthenticatedConvexClient(
|
|
91874
|
+
async () => token,
|
|
91875
|
+
connectionOptions
|
|
91876
|
+
);
|
|
91669
91877
|
try {
|
|
91670
91878
|
try {
|
|
91671
91879
|
return await handler(client);
|
|
@@ -91749,30 +91957,55 @@ var init_controlPlane = __esm({
|
|
|
91749
91957
|
});
|
|
91750
91958
|
};
|
|
91751
91959
|
VIEWER_LOOKUP_TIMEOUT_MS = 15e3;
|
|
91752
|
-
|
|
91753
|
-
|
|
91754
|
-
|
|
91755
|
-
|
|
91756
|
-
|
|
91757
|
-
|
|
91758
|
-
|
|
91960
|
+
fetchViewerIdentityOnce = async (token) => {
|
|
91961
|
+
let rejectOnCertificateFailure = () => {
|
|
91962
|
+
};
|
|
91963
|
+
const certificateFailure = new Promise((_resolve, reject) => {
|
|
91964
|
+
rejectOnCertificateFailure = reject;
|
|
91965
|
+
});
|
|
91966
|
+
certificateFailure.catch(() => {
|
|
91967
|
+
});
|
|
91968
|
+
return await withConvexClient(
|
|
91969
|
+
token,
|
|
91970
|
+
async (client) => {
|
|
91971
|
+
let timeout;
|
|
91972
|
+
const timedOut = new Promise((_resolve, reject) => {
|
|
91973
|
+
timeout = setTimeout(() => {
|
|
91974
|
+
logger3.warn("control_plane_viewer_lookup_timed_out", {
|
|
91975
|
+
timeoutMs: VIEWER_LOOKUP_TIMEOUT_MS
|
|
91976
|
+
});
|
|
91977
|
+
reject(
|
|
91978
|
+
new ControlPlaneAuthUnavailableError({
|
|
91979
|
+
cause: new Error(
|
|
91980
|
+
`hello:getViewer did not answer within ${VIEWER_LOOKUP_TIMEOUT_MS} ms.`
|
|
91981
|
+
)
|
|
91982
|
+
})
|
|
91983
|
+
);
|
|
91984
|
+
}, VIEWER_LOOKUP_TIMEOUT_MS);
|
|
91985
|
+
});
|
|
91986
|
+
try {
|
|
91987
|
+
return await Promise.race([
|
|
91988
|
+
client.query(helloViewerGet, {}),
|
|
91989
|
+
timedOut,
|
|
91990
|
+
certificateFailure
|
|
91991
|
+
]);
|
|
91992
|
+
} finally {
|
|
91993
|
+
clearTimeout(timeout);
|
|
91994
|
+
}
|
|
91995
|
+
},
|
|
91996
|
+
{
|
|
91997
|
+
onCertificateFailure: (error55) => {
|
|
91998
|
+
logger3.warn("control_plane_viewer_lookup_certificate_failed", {
|
|
91999
|
+
tlsCode: findCertificateFailure(error55)?.code ?? null
|
|
91759
92000
|
});
|
|
91760
|
-
|
|
91761
|
-
new ControlPlaneAuthUnavailableError({
|
|
91762
|
-
cause: new Error(
|
|
91763
|
-
`hello:getViewer did not answer within ${VIEWER_LOOKUP_TIMEOUT_MS} ms.`
|
|
91764
|
-
)
|
|
91765
|
-
})
|
|
92001
|
+
rejectOnCertificateFailure(
|
|
92002
|
+
new ControlPlaneAuthUnavailableError({ cause: error55 })
|
|
91766
92003
|
);
|
|
91767
|
-
}
|
|
91768
|
-
});
|
|
91769
|
-
try {
|
|
91770
|
-
return await Promise.race([client.query(helloViewerGet, {}), timedOut]);
|
|
91771
|
-
} finally {
|
|
91772
|
-
clearTimeout(timeout);
|
|
92004
|
+
}
|
|
91773
92005
|
}
|
|
91774
|
-
|
|
92006
|
+
);
|
|
91775
92007
|
};
|
|
92008
|
+
fetchViewerIdentity = async (token) => await withSystemTrustRetry(() => fetchViewerIdentityOnce(token));
|
|
91776
92009
|
BILLING_ACTIVATION_STATES = /* @__PURE__ */ new Set([
|
|
91777
92010
|
"not_required",
|
|
91778
92011
|
"legacy_free",
|
|
@@ -92377,7 +92610,7 @@ var init_controlPlane = __esm({
|
|
|
92377
92610
|
current
|
|
92378
92611
|
});
|
|
92379
92612
|
if (recovered) {
|
|
92380
|
-
|
|
92613
|
+
logger3.warn("control_plane_checkpoint_recovered_after_disconnect", {
|
|
92381
92614
|
alias: baseline.alias,
|
|
92382
92615
|
provider: baseline.provider,
|
|
92383
92616
|
attempt,
|
|
@@ -92386,7 +92619,7 @@ var init_controlPlane = __esm({
|
|
|
92386
92619
|
return recovered;
|
|
92387
92620
|
}
|
|
92388
92621
|
} catch (error55) {
|
|
92389
|
-
|
|
92622
|
+
logger3.warn("control_plane_checkpoint_recovery_poll_failed", {
|
|
92390
92623
|
alias: baseline.alias,
|
|
92391
92624
|
provider: baseline.provider,
|
|
92392
92625
|
attempt,
|
|
@@ -92511,7 +92744,7 @@ var init_controlPlane = __esm({
|
|
|
92511
92744
|
createManagedCheckpoint = async (token, alias) => {
|
|
92512
92745
|
const baseline = await readManagedCheckpointRecoveryState(token, alias).catch(
|
|
92513
92746
|
(error55) => {
|
|
92514
|
-
|
|
92747
|
+
logger3.warn("control_plane_checkpoint_recovery_baseline_failed", {
|
|
92515
92748
|
alias: normalizeAliasForLookup(alias),
|
|
92516
92749
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
92517
92750
|
});
|
|
@@ -92580,7 +92813,7 @@ var init_controlPlane = __esm({
|
|
|
92580
92813
|
};
|
|
92581
92814
|
listSpriteDaemonSessions = async (token, spriteAlias) => {
|
|
92582
92815
|
const requestId2 = randomUUID5();
|
|
92583
|
-
|
|
92816
|
+
logger3.info("control_plane_query", {
|
|
92584
92817
|
requestId: requestId2,
|
|
92585
92818
|
action: "spriteDaemonSessions:listForInstance",
|
|
92586
92819
|
spriteAlias
|
|
@@ -92590,7 +92823,7 @@ var init_controlPlane = __esm({
|
|
|
92590
92823
|
const instanceId = await resolveInstanceIdForAlias(client, spriteAlias);
|
|
92591
92824
|
return await client.query(spriteDaemonSessionsList, { instanceId });
|
|
92592
92825
|
});
|
|
92593
|
-
|
|
92826
|
+
logger3.info("control_plane_query_result", {
|
|
92594
92827
|
requestId: requestId2,
|
|
92595
92828
|
action: "spriteDaemonSessions:listForInstance",
|
|
92596
92829
|
status: "ok",
|
|
@@ -92598,7 +92831,7 @@ var init_controlPlane = __esm({
|
|
|
92598
92831
|
});
|
|
92599
92832
|
return result;
|
|
92600
92833
|
} catch (error55) {
|
|
92601
|
-
|
|
92834
|
+
logger3.info("control_plane_query_result", {
|
|
92602
92835
|
requestId: requestId2,
|
|
92603
92836
|
action: "spriteDaemonSessions:listForInstance",
|
|
92604
92837
|
status: "error",
|
|
@@ -94824,12 +95057,13 @@ var init_help = __esm({
|
|
|
94824
95057
|
|
|
94825
95058
|
// ../daemon/src/spritesRegistry.ts
|
|
94826
95059
|
import { createHash as createHash6, randomUUID as randomUUID6 } from "node:crypto";
|
|
94827
|
-
var MANAGED_DAEMON_NOT_READY_CODE2, MANAGED_DAEMON_WAKING_TIMEOUT_MS, ManagedDaemonNotReadyError2, delay, registryGet, registryUpsert, registryUsage, registryRemoveChunked, instancesList2, helloViewerGet2, managedDaemonControlGrantIssue, managedDaemonRecoverForInstance2,
|
|
95060
|
+
var MANAGED_DAEMON_NOT_READY_CODE2, MANAGED_DAEMON_WAKING_TIMEOUT_MS, ManagedDaemonNotReadyError2, delay, registryGet, registryUpsert, registryUsage, registryRemoveChunked, instancesList2, helloViewerGet2, managedDaemonControlGrantIssue, managedDaemonRecoverForInstance2, logger4, TOKEN_REFRESH_BUFFER_MS, CONVEX_REQUEST_TIMEOUT_MS, MANAGED_DAEMON_HOT_PATH_CONVEX_REQUEST_TIMEOUT_MS, clientCache, clientCacheAuthFingerprint, clientCacheViewerAuthFingerprint, trimEnv, fingerprintToken, resolveConvexUrl2, resolveControlPlaneUrl2, requireConvexConfig, decodeJwtPayload2, parseTokenExpiresAt, shouldRefreshToken, isUnauthorizedError, clearControlPlaneAccessToken, resetClientCache, forceReconnectControlPlaneClient, getControlPlaneConnectionState, subscribeToControlPlaneConnectionState, handleUnauthorized, refreshSession, discardInvalidControlPlaneRefreshToken, loadControlPlaneToken, DaemonNotLoggedInError, requireControlPlaneToken, createClient, connectClient, getClient2, boxPortsList, logRequest, logResponse, withConvexRequestTimeout, resolveInstanceIdFromEntries, loadViewerIdentity, ensureViewerIdentity, resolveProjectCanonical, normalizeOptionalString3, resolveProjectForInstance, resolveProjectForInstanceLineage, toLegacyRegistry, resolveInstanceIdForAlias2, getRegistryFromConvex, fetchRegistry, listViewerInstances2, subscribeViewerInstancesWithClient, subscribePortsForInstanceWithClient, subscribeViewerInstances, upsertRegistry, recordRegistryUsage, removeRegistryEntry, resolveManagedDaemonControlTarget, recoverManagedDaemonControlTarget, resolveManagedDaemonProxyConnectInfo, subscribeBoxPorts, subscribeInstancePorts, fetchBoxPorts, fetchInstancePorts;
|
|
94828
95061
|
var init_spritesRegistry = __esm({
|
|
94829
95062
|
"../daemon/src/spritesRegistry.ts"() {
|
|
94830
95063
|
"use strict";
|
|
94831
95064
|
init_index_node2();
|
|
94832
95065
|
init_server();
|
|
95066
|
+
init_wrapper2();
|
|
94833
95067
|
init_devboxCore();
|
|
94834
95068
|
init_devboxCore();
|
|
94835
95069
|
MANAGED_DAEMON_NOT_READY_CODE2 = "managed_daemon_not_ready";
|
|
@@ -94862,7 +95096,7 @@ var init_spritesRegistry = __esm({
|
|
|
94862
95096
|
helloViewerGet2 = makeFunctionReference("hello:getViewer");
|
|
94863
95097
|
managedDaemonControlGrantIssue = makeFunctionReference("managedDaemonControlGrants:issueForViewer");
|
|
94864
95098
|
managedDaemonRecoverForInstance2 = makeFunctionReference("managedDaemonTickets:recoverForInstanceForViewer");
|
|
94865
|
-
|
|
95099
|
+
logger4 = createLogger("sprites-registry");
|
|
94866
95100
|
TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
|
|
94867
95101
|
CONVEX_REQUEST_TIMEOUT_MS = 4e3;
|
|
94868
95102
|
MANAGED_DAEMON_HOT_PATH_CONVEX_REQUEST_TIMEOUT_MS = 12e4;
|
|
@@ -94965,7 +95199,7 @@ var init_spritesRegistry = __esm({
|
|
|
94965
95199
|
if (!isUnauthorizedError(error55)) return;
|
|
94966
95200
|
await clearControlPlaneAccessToken();
|
|
94967
95201
|
await resetClientCache();
|
|
94968
|
-
|
|
95202
|
+
logger4.warn("control_plane_session_cleared", { error: String(error55) });
|
|
94969
95203
|
};
|
|
94970
95204
|
refreshSession = async (refreshToken) => {
|
|
94971
95205
|
const baseUrl = resolveControlPlaneUrl2();
|
|
@@ -94974,12 +95208,12 @@ var init_spritesRegistry = __esm({
|
|
|
94974
95208
|
}
|
|
94975
95209
|
const requestId2 = randomUUID6();
|
|
94976
95210
|
const url3 = new URL("/auth/refresh", baseUrl);
|
|
94977
|
-
|
|
95211
|
+
logger4.info("control_plane_request", {
|
|
94978
95212
|
requestId: requestId2,
|
|
94979
95213
|
method: "POST",
|
|
94980
95214
|
path: url3.pathname
|
|
94981
95215
|
});
|
|
94982
|
-
const response = await
|
|
95216
|
+
const response = await fetchWithSystemTrust(url3, {
|
|
94983
95217
|
method: "POST",
|
|
94984
95218
|
headers: (() => {
|
|
94985
95219
|
const headers = {
|
|
@@ -94991,7 +95225,7 @@ var init_spritesRegistry = __esm({
|
|
|
94991
95225
|
})(),
|
|
94992
95226
|
body: JSON.stringify({ refresh_token: refreshToken })
|
|
94993
95227
|
});
|
|
94994
|
-
|
|
95228
|
+
logger4.info("control_plane_response", {
|
|
94995
95229
|
requestId: requestId2,
|
|
94996
95230
|
method: "POST",
|
|
94997
95231
|
path: url3.pathname,
|
|
@@ -95026,12 +95260,12 @@ var init_spritesRegistry = __esm({
|
|
|
95026
95260
|
discardInvalidControlPlaneRefreshToken = async (store, failedRefreshToken) => {
|
|
95027
95261
|
const current = await store.getControlPlaneRefreshToken();
|
|
95028
95262
|
if (current !== failedRefreshToken) {
|
|
95029
|
-
|
|
95263
|
+
logger4.warn("control_plane_refresh_token_invalid_superseded");
|
|
95030
95264
|
return;
|
|
95031
95265
|
}
|
|
95032
95266
|
await store.clearControlPlaneSession();
|
|
95033
95267
|
syncDevboxSentryUserFromControlPlaneToken(null);
|
|
95034
|
-
|
|
95268
|
+
logger4.warn("control_plane_refresh_token_invalid_session_cleared");
|
|
95035
95269
|
};
|
|
95036
95270
|
loadControlPlaneToken = async () => {
|
|
95037
95271
|
const homeDir2 = process.env.HOME;
|
|
@@ -95059,7 +95293,7 @@ var init_spritesRegistry = __esm({
|
|
|
95059
95293
|
await discardInvalidControlPlaneRefreshToken(store, refreshToken);
|
|
95060
95294
|
token = null;
|
|
95061
95295
|
} else {
|
|
95062
|
-
|
|
95296
|
+
logger4.warn("control_plane_refresh_failed", {
|
|
95063
95297
|
error: String(error55)
|
|
95064
95298
|
});
|
|
95065
95299
|
}
|
|
@@ -95082,7 +95316,7 @@ var init_spritesRegistry = __esm({
|
|
|
95082
95316
|
if (isInvalidRefreshTokenError(error55)) {
|
|
95083
95317
|
await discardInvalidControlPlaneRefreshToken(store, refreshToken);
|
|
95084
95318
|
} else {
|
|
95085
|
-
|
|
95319
|
+
logger4.warn("control_plane_refresh_failed", {
|
|
95086
95320
|
error: String(error55)
|
|
95087
95321
|
});
|
|
95088
95322
|
}
|
|
@@ -95105,35 +95339,52 @@ var init_spritesRegistry = __esm({
|
|
|
95105
95339
|
}
|
|
95106
95340
|
return token;
|
|
95107
95341
|
};
|
|
95108
|
-
|
|
95342
|
+
createClient = (url3) => {
|
|
95343
|
+
let rejectOnCertificateFailure = () => {
|
|
95344
|
+
};
|
|
95345
|
+
const certificateFailure = new Promise((_resolve, reject) => {
|
|
95346
|
+
rejectOnCertificateFailure = reject;
|
|
95347
|
+
});
|
|
95348
|
+
certificateFailure.catch(() => {
|
|
95349
|
+
});
|
|
95350
|
+
const client = new ConvexClient(url3, {
|
|
95351
|
+
// The global WebSocket doesn't report why a connection failed.
|
|
95352
|
+
webSocketConstructor: withSystemTrustWebSocket(wrapper_default2, {
|
|
95353
|
+
onCertificateFailure: rejectOnCertificateFailure
|
|
95354
|
+
})
|
|
95355
|
+
});
|
|
95356
|
+
client.setAuth(loadControlPlaneToken);
|
|
95357
|
+
return { url: url3, client, certificateFailure };
|
|
95358
|
+
};
|
|
95359
|
+
connectClient = async () => {
|
|
95109
95360
|
const controlPlaneToken = await requireControlPlaneToken();
|
|
95110
95361
|
const convexUrl = requireConvexConfig();
|
|
95111
95362
|
const authFingerprint = fingerprintToken(controlPlaneToken);
|
|
95112
95363
|
if (clientCache && clientCache.url === convexUrl && clientCacheAuthFingerprint === authFingerprint) {
|
|
95113
95364
|
if (clientCacheViewerAuthFingerprint !== authFingerprint) {
|
|
95114
|
-
await ensureViewerIdentity(clientCache
|
|
95365
|
+
await ensureViewerIdentity(clientCache, authFingerprint);
|
|
95115
95366
|
}
|
|
95116
95367
|
return clientCache.client;
|
|
95117
95368
|
}
|
|
95118
95369
|
if (clientCache) {
|
|
95119
95370
|
await clientCache.client.close();
|
|
95120
95371
|
}
|
|
95121
|
-
const
|
|
95122
|
-
|
|
95123
|
-
clientCache = { url: convexUrl, client };
|
|
95372
|
+
const created = createClient(convexUrl);
|
|
95373
|
+
clientCache = created;
|
|
95124
95374
|
clientCacheAuthFingerprint = authFingerprint;
|
|
95125
95375
|
clientCacheViewerAuthFingerprint = null;
|
|
95126
|
-
await ensureViewerIdentity(
|
|
95127
|
-
return client;
|
|
95376
|
+
await ensureViewerIdentity(created, authFingerprint);
|
|
95377
|
+
return created.client;
|
|
95128
95378
|
};
|
|
95379
|
+
getClient2 = async () => await withSystemTrustRetry(connectClient);
|
|
95129
95380
|
boxPortsList = makeFunctionReference("spriteDaemonPorts:listForInstance");
|
|
95130
95381
|
logRequest = (method, fn) => {
|
|
95131
95382
|
const requestId2 = randomUUID6();
|
|
95132
|
-
|
|
95383
|
+
logger4.info("convex_request", { requestId: requestId2, method, path: fn });
|
|
95133
95384
|
return requestId2;
|
|
95134
95385
|
};
|
|
95135
95386
|
logResponse = (requestId2, method, fn, status, error55) => {
|
|
95136
|
-
|
|
95387
|
+
logger4.info("convex_response", {
|
|
95137
95388
|
requestId: requestId2,
|
|
95138
95389
|
method,
|
|
95139
95390
|
path: fn,
|
|
@@ -95185,13 +95436,19 @@ var init_spritesRegistry = __esm({
|
|
|
95185
95436
|
}
|
|
95186
95437
|
return instanceId;
|
|
95187
95438
|
};
|
|
95188
|
-
loadViewerIdentity = async (
|
|
95439
|
+
loadViewerIdentity = async ({
|
|
95440
|
+
client,
|
|
95441
|
+
certificateFailure
|
|
95442
|
+
}) => {
|
|
95189
95443
|
const requestId2 = logRequest("query", "hello:getViewer");
|
|
95190
95444
|
try {
|
|
95191
|
-
const viewer = await
|
|
95192
|
-
|
|
95193
|
-
|
|
95194
|
-
|
|
95445
|
+
const viewer = await Promise.race([
|
|
95446
|
+
withConvexRequestTimeout(
|
|
95447
|
+
"hello:getViewer",
|
|
95448
|
+
client.query(helloViewerGet2, {})
|
|
95449
|
+
),
|
|
95450
|
+
certificateFailure
|
|
95451
|
+
]);
|
|
95195
95452
|
if (!viewer) {
|
|
95196
95453
|
logResponse(requestId2, "query", "hello:getViewer", "error", "no_viewer");
|
|
95197
95454
|
return null;
|
|
@@ -95203,21 +95460,24 @@ var init_spritesRegistry = __esm({
|
|
|
95203
95460
|
throw error55;
|
|
95204
95461
|
}
|
|
95205
95462
|
};
|
|
95206
|
-
ensureViewerIdentity = async (
|
|
95463
|
+
ensureViewerIdentity = async (cached3, authFingerprint) => {
|
|
95207
95464
|
if (clientCacheViewerAuthFingerprint === authFingerprint) {
|
|
95208
95465
|
return;
|
|
95209
95466
|
}
|
|
95210
95467
|
let viewer;
|
|
95211
95468
|
try {
|
|
95212
|
-
viewer = await loadViewerIdentity(
|
|
95469
|
+
viewer = await loadViewerIdentity(cached3);
|
|
95213
95470
|
} catch (error55) {
|
|
95471
|
+
if (findCertificateFailure(error55) && clientCache === cached3) {
|
|
95472
|
+
await resetClientCache();
|
|
95473
|
+
}
|
|
95214
95474
|
await handleUnauthorized(error55);
|
|
95215
95475
|
throw error55;
|
|
95216
95476
|
}
|
|
95217
95477
|
if (!viewer) {
|
|
95218
95478
|
await clearControlPlaneAccessToken();
|
|
95219
95479
|
await resetClientCache();
|
|
95220
|
-
|
|
95480
|
+
logger4.warn("control_plane_session_cleared", { error: "no_viewer" });
|
|
95221
95481
|
throw new DaemonNotLoggedInError();
|
|
95222
95482
|
}
|
|
95223
95483
|
syncDevboxSentryUserFromViewerIdentity(viewer);
|
|
@@ -95762,13 +96022,13 @@ var init_spritesRegistry = __esm({
|
|
|
95762
96022
|
|
|
95763
96023
|
// ../daemon/src/ports.ts
|
|
95764
96024
|
import { createHash as createHash7, randomUUID as randomUUID7 } from "node:crypto";
|
|
95765
|
-
var
|
|
96025
|
+
var logger5, MAX_PORT3, MAX_PORT_SHIFT, MIN_UNPRIVILEGED_PORT, SUBSCRIPTION_RETRY_DELAY_MS, SUBSCRIPTION_RETRY_MAX_DELAY_MS, SUBSCRIPTION_STALE_DISCONNECT_MS, PORT_LEASE_REFRESH_MS, PORT_LEASE_STALE_AFTER_MS, CONNECT_OWNER_PRUNE_INTERVAL_MS, CONNECT_OWNER_STALE_AFTER_MS, createControlPlanePortDiscoveryAdapter, createControlPlaneKnownBoxDiscoveryAdapter, loadControlPlaneAuthFingerprint, nextCandidatePort2, PortManager;
|
|
95766
96026
|
var init_ports2 = __esm({
|
|
95767
96027
|
"../daemon/src/ports.ts"() {
|
|
95768
96028
|
"use strict";
|
|
95769
96029
|
init_devboxCore();
|
|
95770
96030
|
init_spritesRegistry();
|
|
95771
|
-
|
|
96031
|
+
logger5 = createLogger("ports");
|
|
95772
96032
|
MAX_PORT3 = 65535;
|
|
95773
96033
|
MAX_PORT_SHIFT = 50;
|
|
95774
96034
|
MIN_UNPRIVILEGED_PORT = 1024;
|
|
@@ -96220,7 +96480,7 @@ var init_ports2 = __esm({
|
|
|
96220
96480
|
await this.handleControlPlaneConnectionStateChange(current);
|
|
96221
96481
|
}
|
|
96222
96482
|
} catch (error55) {
|
|
96223
|
-
|
|
96483
|
+
logger5.warn("ports_control_plane_state_subscription_failed", {
|
|
96224
96484
|
error: String(error55)
|
|
96225
96485
|
});
|
|
96226
96486
|
this.scheduleControlPlaneStateSubscriptionRetry();
|
|
@@ -96359,7 +96619,7 @@ var init_ports2 = __esm({
|
|
|
96359
96619
|
if (!this.started) {
|
|
96360
96620
|
return;
|
|
96361
96621
|
}
|
|
96362
|
-
|
|
96622
|
+
logger5.warn("ports_control_plane_reconnect", {
|
|
96363
96623
|
connected: state.isWebSocketConnected,
|
|
96364
96624
|
hasEverConnected: state.hasEverConnected,
|
|
96365
96625
|
connectionCount: state.connectionCount,
|
|
@@ -96387,7 +96647,7 @@ var init_ports2 = __esm({
|
|
|
96387
96647
|
await this.reconcileAllTracking();
|
|
96388
96648
|
this.disconnectedControlPlaneSince = null;
|
|
96389
96649
|
} catch (error55) {
|
|
96390
|
-
|
|
96650
|
+
logger5.warn("ports_control_plane_reconnect_failed", {
|
|
96391
96651
|
error: String(error55)
|
|
96392
96652
|
});
|
|
96393
96653
|
}
|
|
@@ -96396,7 +96656,7 @@ var init_ports2 = __esm({
|
|
|
96396
96656
|
if (!this.started) {
|
|
96397
96657
|
return;
|
|
96398
96658
|
}
|
|
96399
|
-
|
|
96659
|
+
logger5.warn("ports_control_plane_resubscribe_after_reconnect", {
|
|
96400
96660
|
connected: state.isWebSocketConnected,
|
|
96401
96661
|
hasEverConnected: state.hasEverConnected,
|
|
96402
96662
|
connectionCount: state.connectionCount,
|
|
@@ -96413,7 +96673,7 @@ var init_ports2 = __esm({
|
|
|
96413
96673
|
}
|
|
96414
96674
|
await this.reconcileAllTracking();
|
|
96415
96675
|
} catch (error55) {
|
|
96416
|
-
|
|
96676
|
+
logger5.warn("ports_control_plane_resubscribe_after_reconnect_failed", {
|
|
96417
96677
|
error: String(error55)
|
|
96418
96678
|
});
|
|
96419
96679
|
}
|
|
@@ -96504,7 +96764,7 @@ var init_ports2 = __esm({
|
|
|
96504
96764
|
}
|
|
96505
96765
|
if (!entry.forward) {
|
|
96506
96766
|
void this.ensureForward(entry).catch((error55) => {
|
|
96507
|
-
|
|
96767
|
+
logger5.warn("port_forward_failed", {
|
|
96508
96768
|
box: entry.box,
|
|
96509
96769
|
remotePort: entry.port,
|
|
96510
96770
|
error: String(error55)
|
|
@@ -96752,7 +97012,7 @@ var init_ports2 = __esm({
|
|
|
96752
97012
|
}
|
|
96753
97013
|
owners.delete(ownerKey);
|
|
96754
97014
|
boxesToReconcile.add(box);
|
|
96755
|
-
|
|
97015
|
+
logger5.info("connect_port_owner_expired", {
|
|
96756
97016
|
box,
|
|
96757
97017
|
ownerKey,
|
|
96758
97018
|
staleAfterMs: this.connectOwnerStaleAfterMs
|
|
@@ -96787,7 +97047,7 @@ var init_ports2 = __esm({
|
|
|
96787
97047
|
this.syncKnownBoxes(entries);
|
|
96788
97048
|
},
|
|
96789
97049
|
onError: (error55) => {
|
|
96790
|
-
|
|
97050
|
+
logger5.warn("ports_known_boxes_subscription_error", {
|
|
96791
97051
|
error: String(error55)
|
|
96792
97052
|
});
|
|
96793
97053
|
if (subscription) {
|
|
@@ -96810,7 +97070,7 @@ var init_ports2 = __esm({
|
|
|
96810
97070
|
this.syncKnownBoxes(current);
|
|
96811
97071
|
}
|
|
96812
97072
|
} catch (error55) {
|
|
96813
|
-
|
|
97073
|
+
logger5.warn("ports_known_boxes_subscription_failed", {
|
|
96814
97074
|
error: String(error55)
|
|
96815
97075
|
});
|
|
96816
97076
|
this.scheduleKnownBoxSubscriptionRetry();
|
|
@@ -96854,7 +97114,7 @@ var init_ports2 = __esm({
|
|
|
96854
97114
|
});
|
|
96855
97115
|
this.syncFromSnapshot(box, entries);
|
|
96856
97116
|
} catch (error55) {
|
|
96857
|
-
|
|
97117
|
+
logger5.warn("ports_snapshot_refresh_failed", {
|
|
96858
97118
|
box,
|
|
96859
97119
|
error: String(error55)
|
|
96860
97120
|
});
|
|
@@ -96948,7 +97208,7 @@ var init_ports2 = __esm({
|
|
|
96948
97208
|
this.buildLeaseRecord(entry, forward.localPort)
|
|
96949
97209
|
);
|
|
96950
97210
|
} catch (error55) {
|
|
96951
|
-
|
|
97211
|
+
logger5.warn("port_forward_lease_refresh_failed", {
|
|
96952
97212
|
box: entry.box,
|
|
96953
97213
|
remotePort: entry.port,
|
|
96954
97214
|
localPort: forward.localPort,
|
|
@@ -96977,7 +97237,7 @@ var init_ports2 = __esm({
|
|
|
96977
97237
|
staleAfterMs: this.portLeaseStaleAfterMs
|
|
96978
97238
|
});
|
|
96979
97239
|
if (leaseResult.kind === "occupied") {
|
|
96980
|
-
|
|
97240
|
+
logger5.info("port_forward_lease_conflict", {
|
|
96981
97241
|
box: entry.box,
|
|
96982
97242
|
remotePort: entry.port,
|
|
96983
97243
|
desiredLocalPort: targetPort,
|
|
@@ -97022,7 +97282,7 @@ var init_ports2 = __esm({
|
|
|
97022
97282
|
} catch (error55) {
|
|
97023
97283
|
await leaseResult.handle.release();
|
|
97024
97284
|
const listenError = error55;
|
|
97025
|
-
|
|
97285
|
+
logger5.info("port_forward_bind_conflict", {
|
|
97026
97286
|
box: entry.box,
|
|
97027
97287
|
remotePort: entry.port,
|
|
97028
97288
|
desiredLocalPort: targetPort,
|
|
@@ -97093,7 +97353,7 @@ var init_ports2 = __esm({
|
|
|
97093
97353
|
this.syncFromSnapshot(box, entries);
|
|
97094
97354
|
},
|
|
97095
97355
|
onError: (error55) => {
|
|
97096
|
-
|
|
97356
|
+
logger5.warn("ports_subscription_error", {
|
|
97097
97357
|
box,
|
|
97098
97358
|
error: String(error55)
|
|
97099
97359
|
});
|
|
@@ -97124,7 +97384,7 @@ var init_ports2 = __esm({
|
|
|
97124
97384
|
this.syncFromSnapshot(box, current);
|
|
97125
97385
|
}
|
|
97126
97386
|
} catch (error55) {
|
|
97127
|
-
|
|
97387
|
+
logger5.warn("ports_subscription_failed", { box, error: String(error55) });
|
|
97128
97388
|
this.scheduleSubscriptionRetry(box);
|
|
97129
97389
|
} finally {
|
|
97130
97390
|
if (promise3 !== null && this.subscriptionPromises.get(box) === promise3) {
|
|
@@ -97304,7 +97564,7 @@ var init_ports2 = __esm({
|
|
|
97304
97564
|
}
|
|
97305
97565
|
if (!record3.forward) {
|
|
97306
97566
|
void this.ensureForward(record3).catch((error55) => {
|
|
97307
|
-
|
|
97567
|
+
logger5.warn("port_forward_failed", {
|
|
97308
97568
|
box: record3.box,
|
|
97309
97569
|
remotePort: record3.port,
|
|
97310
97570
|
error: String(error55)
|
|
@@ -97368,7 +97628,7 @@ var init_ports2 = __esm({
|
|
|
97368
97628
|
entry.forward = forward;
|
|
97369
97629
|
this.startLeaseHeartbeat(entry, forward);
|
|
97370
97630
|
if (heldElsewhereSameTarget) {
|
|
97371
|
-
|
|
97631
|
+
logger5.info("port_forward_same_target_deduped", {
|
|
97372
97632
|
box: entry.box,
|
|
97373
97633
|
remotePort: entry.port,
|
|
97374
97634
|
localPort,
|
|
@@ -97377,7 +97637,7 @@ var init_ports2 = __esm({
|
|
|
97377
97637
|
});
|
|
97378
97638
|
return forward;
|
|
97379
97639
|
}
|
|
97380
|
-
|
|
97640
|
+
logger5.info("port_forward_start", {
|
|
97381
97641
|
box: entry.box,
|
|
97382
97642
|
remotePort: entry.port,
|
|
97383
97643
|
localPort,
|
|
@@ -97398,7 +97658,7 @@ var init_ports2 = __esm({
|
|
|
97398
97658
|
});
|
|
97399
97659
|
});
|
|
97400
97660
|
server?.on("error", (error55) => {
|
|
97401
|
-
|
|
97661
|
+
logger5.error("port_forward_error", {
|
|
97402
97662
|
box: entry.box,
|
|
97403
97663
|
remotePort: entry.port,
|
|
97404
97664
|
localPort,
|
|
@@ -97419,7 +97679,7 @@ var init_ports2 = __esm({
|
|
|
97419
97679
|
try {
|
|
97420
97680
|
proxy = await this.openProxySocketForBox(box);
|
|
97421
97681
|
} catch (error55) {
|
|
97422
|
-
|
|
97682
|
+
logger5.warn("proxy_socket_open_failed", {
|
|
97423
97683
|
connectionId,
|
|
97424
97684
|
box,
|
|
97425
97685
|
remotePort,
|
|
@@ -97441,7 +97701,7 @@ var init_ports2 = __esm({
|
|
|
97441
97701
|
localSocket: socket,
|
|
97442
97702
|
remotePort,
|
|
97443
97703
|
onConnected: () => {
|
|
97444
|
-
|
|
97704
|
+
logger5.info("proxy_connected", {
|
|
97445
97705
|
connectionId,
|
|
97446
97706
|
box,
|
|
97447
97707
|
remotePort,
|
|
@@ -97450,7 +97710,7 @@ var init_ports2 = __esm({
|
|
|
97450
97710
|
});
|
|
97451
97711
|
},
|
|
97452
97712
|
onDisconnected: () => {
|
|
97453
|
-
|
|
97713
|
+
logger5.info("proxy_disconnected", {
|
|
97454
97714
|
connectionId,
|
|
97455
97715
|
box,
|
|
97456
97716
|
remotePort,
|
|
@@ -97516,7 +97776,7 @@ var init_ports2 = __esm({
|
|
|
97516
97776
|
forward.leaseRefreshTimer = null;
|
|
97517
97777
|
}
|
|
97518
97778
|
if (forward.heldElsewhereSameTarget) {
|
|
97519
|
-
|
|
97779
|
+
logger5.info("port_forward_same_target_reference_released", {
|
|
97520
97780
|
box: entry.box,
|
|
97521
97781
|
remotePort: entry.port,
|
|
97522
97782
|
localPort: forward.localPort,
|
|
@@ -97535,14 +97795,14 @@ var init_ports2 = __esm({
|
|
|
97535
97795
|
}
|
|
97536
97796
|
});
|
|
97537
97797
|
await forward.leaseHandle?.release().catch((error55) => {
|
|
97538
|
-
|
|
97798
|
+
logger5.warn("port_forward_lease_release_failed", {
|
|
97539
97799
|
box: entry.box,
|
|
97540
97800
|
remotePort: entry.port,
|
|
97541
97801
|
localPort: forward.localPort,
|
|
97542
97802
|
error: String(error55)
|
|
97543
97803
|
});
|
|
97544
97804
|
});
|
|
97545
|
-
|
|
97805
|
+
logger5.info("port_forward_stop", {
|
|
97546
97806
|
box: entry.box,
|
|
97547
97807
|
remotePort: entry.port,
|
|
97548
97808
|
localPort: forward.localPort,
|
|
@@ -97576,7 +97836,7 @@ import { existsSync as existsSync5 } from "node:fs";
|
|
|
97576
97836
|
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
97577
97837
|
import net4 from "node:net";
|
|
97578
97838
|
import path21 from "node:path";
|
|
97579
|
-
var readPackageVersion,
|
|
97839
|
+
var readPackageVersion, logger6, startedAt, daemonVersion, DAEMON_API_VERSION, DAEMON_FEATURES, PACKAGE_UPDATE_NAME, PACKAGE_UPDATE_URL, PACKAGE_UPDATE_CHECK_TIMEOUT_MS, PACKAGE_UPDATE_CHECK_INTERVAL_MS, INSTALL_OWNER_CHECK_INTERVAL_MS, allowShutdown, normalizeOptionalString4, resolveRegistryProjectByAlias, buildBoxSummaries, seedPortManagerFromBoxes, primePortManagerFromBoxes, readBody, readRequestPath, decodeJwtPayload3, readStringClaim2, readControlPlaneEmail, isTermsteadAdminEmail, writeJson, classifyRequestError, handleRequestError, fetchLatestPackageVersion, refreshPackageVersionCache, startPackageVersionRefreshLoop, startInstallOwnerMonitor, isSocketAlive, waitForSocketAlive, ensureRuntimeDir, startDaemon, DAEMON_SIGNAL_SHUTDOWN_TIMEOUT_MS, runDaemon;
|
|
97580
97840
|
var init_src = __esm({
|
|
97581
97841
|
"../daemon/src/index.ts"() {
|
|
97582
97842
|
init_devboxCore();
|
|
@@ -97585,7 +97845,7 @@ var init_src = __esm({
|
|
|
97585
97845
|
readPackageVersion = () => {
|
|
97586
97846
|
return readCurrentPackageVersion() ?? "unknown";
|
|
97587
97847
|
};
|
|
97588
|
-
|
|
97848
|
+
logger6 = createLogger("devboxd");
|
|
97589
97849
|
startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
97590
97850
|
daemonVersion = readPackageVersion();
|
|
97591
97851
|
DAEMON_API_VERSION = 4;
|
|
@@ -97843,7 +98103,7 @@ var init_src = __esm({
|
|
|
97843
98103
|
}
|
|
97844
98104
|
const classified = classifyRequestError(errorType, error55);
|
|
97845
98105
|
if (classified.error === "client_upgrade_required") {
|
|
97846
|
-
|
|
98106
|
+
logger6.warn(errorType, {
|
|
97847
98107
|
error: String(error55),
|
|
97848
98108
|
statusCode: classified.statusCode
|
|
97849
98109
|
});
|
|
@@ -97855,7 +98115,7 @@ var init_src = __esm({
|
|
|
97855
98115
|
return;
|
|
97856
98116
|
}
|
|
97857
98117
|
if (classified.error === "control_plane_auth_invalid") {
|
|
97858
|
-
|
|
98118
|
+
logger6.warn(errorType, {
|
|
97859
98119
|
error: String(error55),
|
|
97860
98120
|
statusCode: classified.statusCode
|
|
97861
98121
|
});
|
|
@@ -97865,7 +98125,7 @@ var init_src = __esm({
|
|
|
97865
98125
|
});
|
|
97866
98126
|
return;
|
|
97867
98127
|
}
|
|
97868
|
-
|
|
98128
|
+
logger6.error(errorType, { error: String(error55) });
|
|
97869
98129
|
captureDevboxException(error55, {
|
|
97870
98130
|
tags: {
|
|
97871
98131
|
handled: "true",
|
|
@@ -97882,19 +98142,21 @@ var init_src = __esm({
|
|
|
97882
98142
|
fetchLatestPackageVersion = async () => {
|
|
97883
98143
|
const requestId2 = randomUUID8();
|
|
97884
98144
|
const url3 = new URL(PACKAGE_UPDATE_URL);
|
|
97885
|
-
|
|
98145
|
+
logger6.info("npm_package_version_request", {
|
|
97886
98146
|
requestId: requestId2,
|
|
97887
98147
|
requestUrl: PACKAGE_UPDATE_URL,
|
|
97888
98148
|
requestPath: url3.pathname,
|
|
97889
98149
|
packageName: PACKAGE_UPDATE_NAME
|
|
97890
98150
|
});
|
|
97891
|
-
const response = await
|
|
97892
|
-
|
|
97893
|
-
|
|
97894
|
-
|
|
97895
|
-
|
|
97896
|
-
|
|
97897
|
-
|
|
98151
|
+
const response = await withSystemTrustRetry(
|
|
98152
|
+
() => fetch(PACKAGE_UPDATE_URL, {
|
|
98153
|
+
headers: {
|
|
98154
|
+
accept: "application/json"
|
|
98155
|
+
},
|
|
98156
|
+
signal: AbortSignal.timeout(PACKAGE_UPDATE_CHECK_TIMEOUT_MS)
|
|
98157
|
+
})
|
|
98158
|
+
);
|
|
98159
|
+
logger6.info("npm_package_version_response", {
|
|
97898
98160
|
requestId: requestId2,
|
|
97899
98161
|
requestUrl: PACKAGE_UPDATE_URL,
|
|
97900
98162
|
requestPath: url3.pathname,
|
|
@@ -97920,7 +98182,7 @@ var init_src = __esm({
|
|
|
97920
98182
|
await writeCachedPackageVersion(PACKAGE_UPDATE_NAME, latestVersion, {
|
|
97921
98183
|
...homeDir2 ? { homeDir: homeDir2 } : {}
|
|
97922
98184
|
});
|
|
97923
|
-
|
|
98185
|
+
logger6.info("npm_package_version_updated", {
|
|
97924
98186
|
packageName: PACKAGE_UPDATE_NAME,
|
|
97925
98187
|
latestVersion
|
|
97926
98188
|
});
|
|
@@ -97934,7 +98196,7 @@ var init_src = __esm({
|
|
|
97934
98196
|
try {
|
|
97935
98197
|
await refreshPackageVersionCache();
|
|
97936
98198
|
} catch (error55) {
|
|
97937
|
-
|
|
98199
|
+
logger6.warn("npm_package_version_check_failed", {
|
|
97938
98200
|
packageName: PACKAGE_UPDATE_NAME,
|
|
97939
98201
|
error: String(error55)
|
|
97940
98202
|
});
|
|
@@ -98021,7 +98283,7 @@ var init_src = __esm({
|
|
|
98021
98283
|
const portManager = new PortManager({ runtimeDir });
|
|
98022
98284
|
portManager.start();
|
|
98023
98285
|
const portManagerReady = buildBoxSummaries().then((boxes) => primePortManagerFromBoxes(portManager, boxes)).catch((error55) => {
|
|
98024
|
-
|
|
98286
|
+
logger6.warn("ports_registry_seed_failed", {
|
|
98025
98287
|
error: String(error55)
|
|
98026
98288
|
});
|
|
98027
98289
|
});
|
|
@@ -98029,7 +98291,7 @@ var init_src = __esm({
|
|
|
98029
98291
|
const requestId2 = req.headers["x-request-id"] ?? randomUUID8();
|
|
98030
98292
|
const path108 = readRequestPath(req);
|
|
98031
98293
|
res.on("finish", () => {
|
|
98032
|
-
|
|
98294
|
+
logger6.info("daemon_request", {
|
|
98033
98295
|
requestId: requestId2,
|
|
98034
98296
|
method: req.method,
|
|
98035
98297
|
path: path108,
|
|
@@ -98311,7 +98573,7 @@ var init_src = __esm({
|
|
|
98311
98573
|
writeJson(res, 404, { error: "not_found" });
|
|
98312
98574
|
});
|
|
98313
98575
|
server.on("error", (error55) => {
|
|
98314
|
-
|
|
98576
|
+
logger6.error("daemon_error", { error: String(error55) });
|
|
98315
98577
|
captureDevboxException(error55, {
|
|
98316
98578
|
tags: {
|
|
98317
98579
|
handled: "false",
|
|
@@ -98323,7 +98585,7 @@ var init_src = __esm({
|
|
|
98323
98585
|
});
|
|
98324
98586
|
await new Promise((resolve3, reject) => {
|
|
98325
98587
|
server.once("listening", () => {
|
|
98326
|
-
|
|
98588
|
+
logger6.info("daemon_listening", { socketPath });
|
|
98327
98589
|
resolve3();
|
|
98328
98590
|
});
|
|
98329
98591
|
server.once("error", reject);
|
|
@@ -98356,7 +98618,7 @@ var init_src = __esm({
|
|
|
98356
98618
|
stopInstallOwnerMonitor = startInstallOwnerMonitor(
|
|
98357
98619
|
ownerPaths,
|
|
98358
98620
|
(missingOwners) => {
|
|
98359
|
-
|
|
98621
|
+
logger6.warn("daemon_owner_paths_missing", {
|
|
98360
98622
|
socketPath,
|
|
98361
98623
|
ownerPaths,
|
|
98362
98624
|
missingOwners
|
|
@@ -98384,7 +98646,7 @@ var init_src = __esm({
|
|
|
98384
98646
|
};
|
|
98385
98647
|
const handleSignal = () => {
|
|
98386
98648
|
const forceExitTimer = setTimeout(() => {
|
|
98387
|
-
|
|
98649
|
+
logger6.warn("daemon_shutdown_force_exit", {
|
|
98388
98650
|
timeoutMs: DAEMON_SIGNAL_SHUTDOWN_TIMEOUT_MS
|
|
98389
98651
|
});
|
|
98390
98652
|
process.exit(0);
|
|
@@ -98455,7 +98717,7 @@ var init_auth = __esm({
|
|
|
98455
98717
|
try {
|
|
98456
98718
|
const token = await refreshToken();
|
|
98457
98719
|
if (retryCount > 0) {
|
|
98458
|
-
|
|
98720
|
+
logger3.info("control_plane_auth_refresh_recovered", {
|
|
98459
98721
|
retryCount
|
|
98460
98722
|
});
|
|
98461
98723
|
}
|
|
@@ -98466,7 +98728,7 @@ var init_auth = __esm({
|
|
|
98466
98728
|
}
|
|
98467
98729
|
const retryDelayMs = retryDelaysMs[Math.min(retryCount, retryDelaysMs.length - 1)];
|
|
98468
98730
|
retryCount += 1;
|
|
98469
|
-
|
|
98731
|
+
logger3.warn("control_plane_auth_refresh_unavailable_retrying", {
|
|
98470
98732
|
requestId: error55.requestId,
|
|
98471
98733
|
method: error55.method,
|
|
98472
98734
|
path: error55.path,
|
|
@@ -98590,7 +98852,7 @@ var init_auth = __esm({
|
|
|
98590
98852
|
stage?.("Checking boxes.dev login");
|
|
98591
98853
|
const viewer = await authApi.fetchViewerIdentity(token);
|
|
98592
98854
|
if (!viewer) {
|
|
98593
|
-
|
|
98855
|
+
logger3.warn("control_plane_viewer_missing");
|
|
98594
98856
|
return null;
|
|
98595
98857
|
}
|
|
98596
98858
|
syncDevboxSentryUserFromViewerIdentity(viewer);
|
|
@@ -98601,14 +98863,14 @@ var init_auth = __esm({
|
|
|
98601
98863
|
return await refreshControlPlaneToken(store, authApi, stage);
|
|
98602
98864
|
} catch (error55) {
|
|
98603
98865
|
if (isControlPlaneSessionRefreshRejectionError(error55)) {
|
|
98604
|
-
|
|
98866
|
+
logger3.warn("control_plane_refresh_rejected", { error: String(error55) });
|
|
98605
98867
|
await clearControlPlaneSession(store);
|
|
98606
98868
|
throw new ControlPlaneLoginRequiredError("session_invalid", {
|
|
98607
98869
|
cause: error55
|
|
98608
98870
|
});
|
|
98609
98871
|
}
|
|
98610
98872
|
if (isControlPlaneRequestUnavailableError(error55) || error55 instanceof ControlPlaneRequestError && (error55.statusCode === 429 || error55.statusCode >= 500)) {
|
|
98611
|
-
|
|
98873
|
+
logger3.warn("control_plane_refresh_unavailable", {
|
|
98612
98874
|
error: String(error55)
|
|
98613
98875
|
});
|
|
98614
98876
|
throw new ControlPlaneAuthUnavailableError({ cause: error55 });
|
|
@@ -98690,7 +98952,7 @@ var init_auth = __esm({
|
|
|
98690
98952
|
stage?.(CONTROL_PLANE_INTERACTIVE_SIGNIN_STAGE);
|
|
98691
98953
|
const tokens = await authApi.signInWithBrowser();
|
|
98692
98954
|
await updateControlPlaneSession(store, tokens.token, tokens.refreshToken);
|
|
98693
|
-
|
|
98955
|
+
logger3.info("control_plane_signed_in");
|
|
98694
98956
|
return await resolveStoredControlPlaneSession(store, stage, authApi);
|
|
98695
98957
|
};
|
|
98696
98958
|
ensureControlPlaneToken = async (store, stage, authApi = defaultControlPlaneAuthApi) => {
|
|
@@ -98734,7 +98996,7 @@ var init_auth = __esm({
|
|
|
98734
98996
|
throw new ControlPlaneAuthRefreshError({ cause: error55 });
|
|
98735
98997
|
}
|
|
98736
98998
|
if (existing && !isTokenExpired(existing)) {
|
|
98737
|
-
|
|
98999
|
+
logger3.warn("control_plane_refresh_unavailable_using_existing_token", {
|
|
98738
99000
|
error: String(error55)
|
|
98739
99001
|
});
|
|
98740
99002
|
return existing;
|
|
@@ -99160,7 +99422,7 @@ var init_daemonClient = __esm({
|
|
|
99160
99422
|
if (exitedGracefully) {
|
|
99161
99423
|
return;
|
|
99162
99424
|
}
|
|
99163
|
-
|
|
99425
|
+
logger3.warn("daemon_force_kill", {
|
|
99164
99426
|
socketPath,
|
|
99165
99427
|
pid,
|
|
99166
99428
|
reason
|
|
@@ -99187,7 +99449,7 @@ var init_daemonClient = __esm({
|
|
|
99187
99449
|
};
|
|
99188
99450
|
requestJson2 = async (socketPath, method, requestPath, timeoutMs, body) => {
|
|
99189
99451
|
const requestId2 = randomUUID9();
|
|
99190
|
-
|
|
99452
|
+
logger3.info("daemon_request", {
|
|
99191
99453
|
requestId: requestId2,
|
|
99192
99454
|
method,
|
|
99193
99455
|
path: requestPath
|
|
@@ -99222,7 +99484,7 @@ var init_daemonClient = __esm({
|
|
|
99222
99484
|
parsedBody = JSON.parse(payload2);
|
|
99223
99485
|
} catch (error55) {
|
|
99224
99486
|
parseError = error55 instanceof Error ? error55.message : "invalid_json";
|
|
99225
|
-
|
|
99487
|
+
logger3.warn("daemon_response_invalid_json", {
|
|
99226
99488
|
requestId: requestId2,
|
|
99227
99489
|
method,
|
|
99228
99490
|
path: requestPath,
|
|
@@ -99231,7 +99493,7 @@ var init_daemonClient = __esm({
|
|
|
99231
99493
|
});
|
|
99232
99494
|
}
|
|
99233
99495
|
}
|
|
99234
|
-
|
|
99496
|
+
logger3.info("daemon_response", {
|
|
99235
99497
|
requestId: requestId2,
|
|
99236
99498
|
method,
|
|
99237
99499
|
path: requestPath,
|
|
@@ -99342,7 +99604,7 @@ var init_daemonClient = __esm({
|
|
|
99342
99604
|
} catch {
|
|
99343
99605
|
logFd = null;
|
|
99344
99606
|
}
|
|
99345
|
-
|
|
99607
|
+
logger3.info("daemon_spawn", {
|
|
99346
99608
|
socketPath,
|
|
99347
99609
|
command: command.command,
|
|
99348
99610
|
args: command.args,
|
|
@@ -99398,7 +99660,7 @@ var init_daemonClient = __esm({
|
|
|
99398
99660
|
candidates.delete(primary);
|
|
99399
99661
|
return [...candidates].filter((socketPath) => {
|
|
99400
99662
|
if (!isSocketPathTooLong(socketPath)) return true;
|
|
99401
|
-
|
|
99663
|
+
logger3.warn("daemon_duplicate_check_skipped", {
|
|
99402
99664
|
socketPath,
|
|
99403
99665
|
reason: "socket_path_too_long"
|
|
99404
99666
|
});
|
|
@@ -99416,7 +99678,7 @@ var init_daemonClient = __esm({
|
|
|
99416
99678
|
DAEMON_TIMEOUT_MS.health
|
|
99417
99679
|
);
|
|
99418
99680
|
if (health.status === 200 && health.body.ok) {
|
|
99419
|
-
|
|
99681
|
+
logger3.warn("daemon_duplicate_detected", {
|
|
99420
99682
|
socketPath,
|
|
99421
99683
|
pid: health.body.pid
|
|
99422
99684
|
});
|
|
@@ -99424,7 +99686,7 @@ var init_daemonClient = __esm({
|
|
|
99424
99686
|
}
|
|
99425
99687
|
} catch (error55) {
|
|
99426
99688
|
if (!isConnectionError(error55)) {
|
|
99427
|
-
|
|
99689
|
+
logger3.warn("daemon_duplicate_check_failed", {
|
|
99428
99690
|
socketPath,
|
|
99429
99691
|
error: String(error55)
|
|
99430
99692
|
});
|
|
@@ -99459,7 +99721,7 @@ var init_daemonClient = __esm({
|
|
|
99459
99721
|
const pids = listDaemonPidsForSocket(socketPath);
|
|
99460
99722
|
for (const pid of pids) {
|
|
99461
99723
|
if (pid === keepPid) continue;
|
|
99462
|
-
|
|
99724
|
+
logger3.warn("daemon_duplicate_same_socket_detected", {
|
|
99463
99725
|
socketPath,
|
|
99464
99726
|
keepPid,
|
|
99465
99727
|
duplicatePid: pid
|
|
@@ -99469,7 +99731,7 @@ var init_daemonClient = __esm({
|
|
|
99469
99731
|
} catch (error55) {
|
|
99470
99732
|
const code2 = error55?.code;
|
|
99471
99733
|
if (code2 !== "ESRCH") {
|
|
99472
|
-
|
|
99734
|
+
logger3.warn("daemon_duplicate_same_socket_stop_failed", {
|
|
99473
99735
|
socketPath,
|
|
99474
99736
|
duplicatePid: pid,
|
|
99475
99737
|
error: String(error55)
|
|
@@ -99498,7 +99760,7 @@ var init_daemonClient = __esm({
|
|
|
99498
99760
|
startedAtMs
|
|
99499
99761
|
});
|
|
99500
99762
|
if (!mismatch.shouldRestart) return health;
|
|
99501
|
-
|
|
99763
|
+
logger3.warn(
|
|
99502
99764
|
mismatch.versionMismatch ? "daemon_version_mismatch" : "daemon_script_stale",
|
|
99503
99765
|
{
|
|
99504
99766
|
socketPath,
|
|
@@ -99512,7 +99774,7 @@ var init_daemonClient = __esm({
|
|
|
99512
99774
|
try {
|
|
99513
99775
|
await stopDaemon(socketPath);
|
|
99514
99776
|
} catch (error55) {
|
|
99515
|
-
|
|
99777
|
+
logger3.warn("daemon_restart_failed", {
|
|
99516
99778
|
socketPath,
|
|
99517
99779
|
pid: health.pid,
|
|
99518
99780
|
error: String(error55)
|
|
@@ -99562,7 +99824,7 @@ var init_daemonClient = __esm({
|
|
|
99562
99824
|
const existingDaemonPids = listDaemonPidsForSocket(socketPath);
|
|
99563
99825
|
const socketExists = await hasSocketPath(socketPath);
|
|
99564
99826
|
if (existingDaemonPids.length > 0 && !socketExists) {
|
|
99565
|
-
|
|
99827
|
+
logger3.warn("daemon_orphan_detected", {
|
|
99566
99828
|
socketPath,
|
|
99567
99829
|
pids: existingDaemonPids
|
|
99568
99830
|
});
|
|
@@ -99588,7 +99850,7 @@ var init_daemonClient = __esm({
|
|
|
99588
99850
|
} catch {
|
|
99589
99851
|
}
|
|
99590
99852
|
if (existingDaemonPids.length > 0) {
|
|
99591
|
-
|
|
99853
|
+
logger3.warn("daemon_unhealthy_reaping_before_restart", {
|
|
99592
99854
|
socketPath,
|
|
99593
99855
|
pids: existingDaemonPids
|
|
99594
99856
|
});
|
|
@@ -99646,7 +99908,7 @@ var init_daemonClient = __esm({
|
|
|
99646
99908
|
if (existingDaemonPids.length === 0) {
|
|
99647
99909
|
return false;
|
|
99648
99910
|
}
|
|
99649
|
-
|
|
99911
|
+
logger3.warn("daemon_orphan_detected", {
|
|
99650
99912
|
socketPath,
|
|
99651
99913
|
pids: existingDaemonPids
|
|
99652
99914
|
});
|
|
@@ -99656,7 +99918,7 @@ var init_daemonClient = __esm({
|
|
|
99656
99918
|
"stop_daemon_orphan"
|
|
99657
99919
|
);
|
|
99658
99920
|
if (await hasSocketPath(socketPath)) {
|
|
99659
|
-
|
|
99921
|
+
logger3.warn("daemon_socket_still_present_after_stop", {
|
|
99660
99922
|
socketPath
|
|
99661
99923
|
});
|
|
99662
99924
|
}
|
|
@@ -103811,7 +104073,7 @@ var init_sessionProtocol = __esm({
|
|
|
103811
104073
|
}
|
|
103812
104074
|
if (!opened) {
|
|
103813
104075
|
pendingInput.push(nextChunk);
|
|
103814
|
-
|
|
104076
|
+
logger3.debug("connect_stdin_buffered_preopen", {
|
|
103815
104077
|
...summarizeInputChunk(nextChunk),
|
|
103816
104078
|
pendingInputCount: pendingInput.length
|
|
103817
104079
|
});
|
|
@@ -103819,7 +104081,7 @@ var init_sessionProtocol = __esm({
|
|
|
103819
104081
|
}
|
|
103820
104082
|
if (options.tty && nextChunk.length === 1 && nextChunk[0] === detachControl.byte) {
|
|
103821
104083
|
stderr.write("\r\nDetached.\r\n");
|
|
103822
|
-
|
|
104084
|
+
logger3.info("connect_stdin_detach_key", {
|
|
103823
104085
|
opened,
|
|
103824
104086
|
readyState: ws.readyState,
|
|
103825
104087
|
key: detachControl.label
|
|
@@ -103828,7 +104090,7 @@ var init_sessionProtocol = __esm({
|
|
|
103828
104090
|
return;
|
|
103829
104091
|
}
|
|
103830
104092
|
if (typeof ws.readyState === "number" && ws.readyState !== WS_OPEN_STATE) {
|
|
103831
|
-
|
|
104093
|
+
logger3.warn("connect_stdin_socket_not_open", {
|
|
103832
104094
|
readyState: ws.readyState,
|
|
103833
104095
|
opened,
|
|
103834
104096
|
...summarizeInputChunk(nextChunk)
|
|
@@ -103847,7 +104109,7 @@ var init_sessionProtocol = __esm({
|
|
|
103847
104109
|
startInputProbe();
|
|
103848
104110
|
}
|
|
103849
104111
|
if (hasRecoveryKey) {
|
|
103850
|
-
|
|
104112
|
+
logger3.info("connect_stdin_recovery_key", {
|
|
103851
104113
|
...summarizeInputChunk(nextChunk),
|
|
103852
104114
|
ageMs,
|
|
103853
104115
|
streamProbeMisses,
|
|
@@ -103867,7 +104129,7 @@ var init_sessionProtocol = __esm({
|
|
|
103867
104129
|
try {
|
|
103868
104130
|
sendInput(nextChunk);
|
|
103869
104131
|
} catch {
|
|
103870
|
-
|
|
104132
|
+
logger3.warn("connect_stdin_send_failed", {
|
|
103871
104133
|
...summarizeInputChunk(nextChunk),
|
|
103872
104134
|
ageMs,
|
|
103873
104135
|
readyState: ws.readyState
|
|
@@ -103979,10 +104241,10 @@ var init_sessionProtocol = __esm({
|
|
|
103979
104241
|
stdin.setRawMode(true);
|
|
103980
104242
|
rawModeEnabled = true;
|
|
103981
104243
|
} catch {
|
|
103982
|
-
|
|
104244
|
+
logger3.warn("connect_stdin_rawmode_enable_failed");
|
|
103983
104245
|
}
|
|
103984
104246
|
}
|
|
103985
|
-
|
|
104247
|
+
logger3.info("connect_stdin_start", {
|
|
103986
104248
|
tty: options.tty,
|
|
103987
104249
|
stdinIsTty: stdin.isTTY,
|
|
103988
104250
|
rawModeEnabled
|
|
@@ -104005,10 +104267,10 @@ var init_sessionProtocol = __esm({
|
|
|
104005
104267
|
stdin.setRawMode(false);
|
|
104006
104268
|
rawModeRestored = true;
|
|
104007
104269
|
} catch {
|
|
104008
|
-
|
|
104270
|
+
logger3.warn("connect_stdin_rawmode_restore_failed");
|
|
104009
104271
|
}
|
|
104010
104272
|
}
|
|
104011
|
-
|
|
104273
|
+
logger3.info("connect_stdin_stop", {
|
|
104012
104274
|
tty: options.tty,
|
|
104013
104275
|
stdinIsTty: stdin.isTTY,
|
|
104014
104276
|
rawModeRestored
|
|
@@ -104059,7 +104321,7 @@ var init_sessionProtocol = __esm({
|
|
|
104059
104321
|
};
|
|
104060
104322
|
const onClose = (event) => {
|
|
104061
104323
|
closeCode = typeof event?.code === "number" ? event.code : closeCode;
|
|
104062
|
-
|
|
104324
|
+
logger3.info("connect_ws_close", {
|
|
104063
104325
|
opened,
|
|
104064
104326
|
closeCode,
|
|
104065
104327
|
exitCode
|
|
@@ -104127,7 +104389,7 @@ var init_sessionProtocol = __esm({
|
|
|
104127
104389
|
};
|
|
104128
104390
|
if (closeCode !== void 0) result.closeCode = closeCode;
|
|
104129
104391
|
if (errorMessage2) result.errorMessage = errorMessage2;
|
|
104130
|
-
|
|
104392
|
+
logger3.warn("connect_ws_error", {
|
|
104131
104393
|
opened,
|
|
104132
104394
|
closeCode,
|
|
104133
104395
|
errorMessage: errorMessage2
|
|
@@ -104141,7 +104403,7 @@ var init_sessionProtocol = __esm({
|
|
|
104141
104403
|
opened = true;
|
|
104142
104404
|
markAlive();
|
|
104143
104405
|
latency?.noteConnectOpen();
|
|
104144
|
-
|
|
104406
|
+
logger3.info("connect_ws_open", {
|
|
104145
104407
|
tty: options.tty,
|
|
104146
104408
|
stdin: options.stdin
|
|
104147
104409
|
});
|
|
@@ -108895,7 +109157,7 @@ var require_dist2 = __commonJS({
|
|
|
108895
109157
|
function randomID() {
|
|
108896
109158
|
return Math.random().toString(36).slice(2, 11);
|
|
108897
109159
|
}
|
|
108898
|
-
function
|
|
109160
|
+
function createClient2(clientOptions) {
|
|
108899
109161
|
let {
|
|
108900
109162
|
baseUrl = "",
|
|
108901
109163
|
Request: CustomRequest = globalThis.Request,
|
|
@@ -109187,7 +109449,7 @@ var require_dist2 = __commonJS({
|
|
|
109187
109449
|
return client;
|
|
109188
109450
|
}
|
|
109189
109451
|
function createPathBasedClient(clientOptions) {
|
|
109190
|
-
return wrapAsPathBasedClient(
|
|
109452
|
+
return wrapAsPathBasedClient(createClient2(clientOptions));
|
|
109191
109453
|
}
|
|
109192
109454
|
function serializePrimitiveParam(name, value, options) {
|
|
109193
109455
|
if (value === void 0 || value === null) {
|
|
@@ -109405,7 +109667,7 @@ var require_dist2 = __commonJS({
|
|
|
109405
109667
|
exports.createFinalURL = createFinalURL;
|
|
109406
109668
|
exports.createPathBasedClient = createPathBasedClient;
|
|
109407
109669
|
exports.createQuerySerializer = createQuerySerializer;
|
|
109408
|
-
exports.default =
|
|
109670
|
+
exports.default = createClient2;
|
|
109409
109671
|
exports.defaultBodySerializer = defaultBodySerializer;
|
|
109410
109672
|
exports.defaultPathSerializer = defaultPathSerializer;
|
|
109411
109673
|
exports.mergeHeaders = mergeHeaders;
|
|
@@ -117531,7 +117793,7 @@ var require_promise_client = __commonJS({
|
|
|
117531
117793
|
}
|
|
117532
117794
|
};
|
|
117533
117795
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
117534
|
-
exports.createClient =
|
|
117796
|
+
exports.createClient = createClient2;
|
|
117535
117797
|
exports.createUnaryFn = createUnaryFn;
|
|
117536
117798
|
exports.createServerStreamingFn = createServerStreamingFn;
|
|
117537
117799
|
exports.createClientStreamingFn = createClientStreamingFn;
|
|
@@ -117540,7 +117802,7 @@ var require_promise_client = __commonJS({
|
|
|
117540
117802
|
var connect_error_js_1 = require_connect_error();
|
|
117541
117803
|
var code_js_1 = require_code2();
|
|
117542
117804
|
var async_iterable_js_1 = require_async_iterable();
|
|
117543
|
-
function
|
|
117805
|
+
function createClient2(service, transport) {
|
|
117544
117806
|
return (0, any_client_js_1.makeAnyClient)(service, (method) => {
|
|
117545
117807
|
switch (method.methodKind) {
|
|
117546
117808
|
case "unary":
|
|
@@ -128664,14 +128926,14 @@ var require_dist3 = __commonJS({
|
|
|
128664
128926
|
function formatLog(log3) {
|
|
128665
128927
|
return JSON.parse(JSON.stringify(log3));
|
|
128666
128928
|
}
|
|
128667
|
-
function createRpcLogger(
|
|
128929
|
+
function createRpcLogger(logger13) {
|
|
128668
128930
|
function logEach(stream) {
|
|
128669
128931
|
return __asyncGenerator(this, null, function* () {
|
|
128670
128932
|
var _a32;
|
|
128671
128933
|
try {
|
|
128672
128934
|
for (var iter = __forAwait(stream), more, temp, error55; more = !(temp = yield new __await(iter.next())).done; more = false) {
|
|
128673
128935
|
const m = temp.value;
|
|
128674
|
-
(_a32 =
|
|
128936
|
+
(_a32 = logger13.debug) == null ? void 0 : _a32.call(logger13, "Response stream:", formatLog(m));
|
|
128675
128937
|
yield m;
|
|
128676
128938
|
}
|
|
128677
128939
|
} catch (temp2) {
|
|
@@ -128688,31 +128950,31 @@ var require_dist3 = __commonJS({
|
|
|
128688
128950
|
}
|
|
128689
128951
|
return (next) => async (req) => {
|
|
128690
128952
|
var _a32, _b3;
|
|
128691
|
-
(_a32 =
|
|
128953
|
+
(_a32 = logger13.info) == null ? void 0 : _a32.call(logger13, `Request: POST ${req.url}`);
|
|
128692
128954
|
const res = await next(req);
|
|
128693
128955
|
if (res.stream) {
|
|
128694
128956
|
return __spreadProps(__spreadValues({}, res), {
|
|
128695
128957
|
message: logEach(res.message)
|
|
128696
128958
|
});
|
|
128697
128959
|
} else {
|
|
128698
|
-
(_b3 =
|
|
128960
|
+
(_b3 = logger13.info) == null ? void 0 : _b3.call(logger13, "Response:", formatLog(res.message));
|
|
128699
128961
|
}
|
|
128700
128962
|
return res;
|
|
128701
128963
|
};
|
|
128702
128964
|
}
|
|
128703
|
-
function createApiLogger(
|
|
128965
|
+
function createApiLogger(logger13) {
|
|
128704
128966
|
return {
|
|
128705
128967
|
async onRequest({ request: request2 }) {
|
|
128706
128968
|
var _a32;
|
|
128707
|
-
(_a32 =
|
|
128969
|
+
(_a32 = logger13.info) == null ? void 0 : _a32.call(logger13, `Request ${request2.method} ${request2.url}`);
|
|
128708
128970
|
return request2;
|
|
128709
128971
|
},
|
|
128710
128972
|
async onResponse({ response }) {
|
|
128711
128973
|
var _a32, _b3;
|
|
128712
128974
|
if (response.status >= 400) {
|
|
128713
|
-
(_a32 =
|
|
128975
|
+
(_a32 = logger13.error) == null ? void 0 : _a32.call(logger13, "Response:", response.status, response.statusText);
|
|
128714
128976
|
} else {
|
|
128715
|
-
(_b3 =
|
|
128977
|
+
(_b3 = logger13.info) == null ? void 0 : _b3.call(logger13, "Response:", response.status, response.statusText);
|
|
128716
128978
|
}
|
|
128717
128979
|
return response;
|
|
128718
128980
|
}
|
|
@@ -134640,7 +134902,7 @@ var init_directDaemonTtyChannel = __esm({
|
|
|
134640
134902
|
|
|
134641
134903
|
// src/devbox/commands/provider/directDaemonRuntime.ts
|
|
134642
134904
|
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
134643
|
-
var DIRECT_DAEMON_CONTROL_WS_PATH, DIRECT_DAEMON_CONTROL_IDLE_MS, DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_PADDING_MS, DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_MIN_MS, DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_MAX_MS, DIRECT_DAEMON_CONTROL_CONNECT_ATTEMPT_TIMEOUT_MS, DIRECT_DAEMON_CONTROL_CONNECT_RETRY_INITIAL_DELAY_MS, DIRECT_DAEMON_CONTROL_CONNECT_RETRY_MAX_DELAY_MS, DIRECT_DAEMON_CONTROL_PING_INTERVAL_MS, DIRECT_DAEMON_CONTROL_PONG_GRACE_MS, DIRECT_DAEMON_REQUEST_TRANSPORT_RETRY_LIMIT, DIRECT_DAEMON_REQUEST_TIMEOUT_USER_MESSAGE,
|
|
134905
|
+
var SystemTrustWebSocket2, DIRECT_DAEMON_CONTROL_WS_PATH, DIRECT_DAEMON_CONTROL_IDLE_MS, DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_PADDING_MS, DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_MIN_MS, DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_MAX_MS, DIRECT_DAEMON_CONTROL_CONNECT_ATTEMPT_TIMEOUT_MS, DIRECT_DAEMON_CONTROL_CONNECT_RETRY_INITIAL_DELAY_MS, DIRECT_DAEMON_CONTROL_CONNECT_RETRY_MAX_DELAY_MS, DIRECT_DAEMON_CONTROL_PING_INTERVAL_MS, DIRECT_DAEMON_CONTROL_PONG_GRACE_MS, DIRECT_DAEMON_REQUEST_TRANSPORT_RETRY_LIMIT, DIRECT_DAEMON_REQUEST_TIMEOUT_USER_MESSAGE, logger7, CodexThreadArchiveCapabilityUnavailableError, DEFAULT_DIRECT_DAEMON_CONTROL_TIMING, directDaemonControlTimingOverrides, formatProviderLabel, resolveDirectDaemonRequestType, DIRECT_DAEMON_REPLAY_SAFE_REQUEST_TYPES, isDirectDaemonReplaySafeRequest, resolveDirectDaemonAudience, directDaemonGrantWsUrlResolverForTests, buildDirectDaemonWsUrl, buildDirectDaemonRequestContext, buildDirectDaemonControlErrorText, buildDirectDaemonWsLogFields, replaceRecoveredDirectDaemonGrantTarget, buildDirectDaemonRequestLogFields, buildDirectDaemonOperationLogFields, formatDirectDaemonWebSocketState, measureDirectDaemonRawMessageBytes, refDirectDaemonWebSocket, unrefDirectDaemonWebSocket, getDirectDaemonControlTiming, sleep4, resolveDirectDaemonConnectTimeoutMs, createDirectDaemonTransportError, isDirectDaemonTransportError, wrapDirectDaemonRequestError, validateDirectDaemonControlReadyMessage, assertDirectDaemonRequiredCapabilities, awaitWithAbortSignal, DirectDaemonControlSocket, directDaemonControlSockets, buildDirectDaemonControlSocketKey, resolveDirectDaemonControlSocket, closeAllDirectDaemonControlSockets, runDirectDaemonControlRequest, supportsDirectDaemonControlCapabilities, runDirectDaemonAgentExec, cancelDirectDaemonAgentExec, setDirectDaemonCodexThreadArchivedState, probeDirectDaemonCodexTui, openDirectDaemonCodexTuiChannel, probeDirectDaemonCodexNewThreadTui, openDirectDaemonCodexNewThreadTuiChannel, openDirectDaemonTtySession, preconnectDirectDaemonControlSocket, probeDirectDaemonControlSocketWithoutWake, openDirectDaemonClaudeTui, openDirectDaemonClaudeEmptyTui;
|
|
134644
134906
|
var init_directDaemonRuntime = __esm({
|
|
134645
134907
|
"src/devbox/commands/provider/directDaemonRuntime.ts"() {
|
|
134646
134908
|
"use strict";
|
|
@@ -134650,6 +134912,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
134650
134912
|
init_logger3();
|
|
134651
134913
|
init_daemonRuntimeShared();
|
|
134652
134914
|
init_directDaemonTtyChannel();
|
|
134915
|
+
SystemTrustWebSocket2 = withSystemTrustWebSocket(wrapper_default2);
|
|
134653
134916
|
DIRECT_DAEMON_CONTROL_WS_PATH = "/ws";
|
|
134654
134917
|
DIRECT_DAEMON_CONTROL_IDLE_MS = 15 * 60 * 1e3;
|
|
134655
134918
|
DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_PADDING_MS = 1e4;
|
|
@@ -134662,7 +134925,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
134662
134925
|
DIRECT_DAEMON_CONTROL_PONG_GRACE_MS = 45e3;
|
|
134663
134926
|
DIRECT_DAEMON_REQUEST_TRANSPORT_RETRY_LIMIT = 1;
|
|
134664
134927
|
DIRECT_DAEMON_REQUEST_TIMEOUT_USER_MESSAGE = "The machine did not respond in time. Resume setup to continue.";
|
|
134665
|
-
|
|
134928
|
+
logger7 = createLogger("direct_daemon_runtime");
|
|
134666
134929
|
CodexThreadArchiveCapabilityUnavailableError = class extends Error {
|
|
134667
134930
|
targetKind;
|
|
134668
134931
|
operation;
|
|
@@ -135040,7 +135303,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135040
135303
|
retryable: true,
|
|
135041
135304
|
message: `${formatProviderLabel(this.provider)} control websocket missed keepalive pong for ${String(pongGraceMs)}ms.`
|
|
135042
135305
|
});
|
|
135043
|
-
|
|
135306
|
+
logger7.warn(
|
|
135044
135307
|
"direct_daemon_control_keepalive_timeout",
|
|
135045
135308
|
this.buildLogFields({
|
|
135046
135309
|
elapsedSincePongMs,
|
|
@@ -135095,7 +135358,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135095
135358
|
const pendingEntries = [...this.pendingRequests.entries()];
|
|
135096
135359
|
this.pendingRequests.clear();
|
|
135097
135360
|
if (pendingEntries.length > 0) {
|
|
135098
|
-
|
|
135361
|
+
logger7.warn(
|
|
135099
135362
|
"direct_daemon_control_pending_requests_failed",
|
|
135100
135363
|
this.buildLogFields({
|
|
135101
135364
|
failedRequestCount: pendingEntries.length,
|
|
@@ -135163,7 +135426,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135163
135426
|
const pending = this.pendingRequests.get(responseRequestId);
|
|
135164
135427
|
if (!pending) {
|
|
135165
135428
|
if (this.ignoredResponseRequestIds.delete(responseRequestId)) {
|
|
135166
|
-
|
|
135429
|
+
logger7.debug(
|
|
135167
135430
|
"direct_daemon_control_response_ignored_after_abort",
|
|
135168
135431
|
this.buildLogFields({
|
|
135169
135432
|
requestId: responseRequestId,
|
|
@@ -135172,7 +135435,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135172
135435
|
);
|
|
135173
135436
|
return;
|
|
135174
135437
|
}
|
|
135175
|
-
|
|
135438
|
+
logger7.warn(
|
|
135176
135439
|
"direct_daemon_control_response_unmatched",
|
|
135177
135440
|
this.buildLogFields({
|
|
135178
135441
|
requestId: responseRequestId,
|
|
@@ -135190,7 +135453,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135190
135453
|
pending.abortSignal.removeEventListener("abort", pending.abortListener);
|
|
135191
135454
|
}
|
|
135192
135455
|
this.scheduleIdleClose();
|
|
135193
|
-
|
|
135456
|
+
logger7.debug(
|
|
135194
135457
|
"direct_daemon_control_response_received",
|
|
135195
135458
|
this.buildLogFields({
|
|
135196
135459
|
requestId: responseRequestId,
|
|
@@ -135340,7 +135603,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135340
135603
|
timing.connectAttemptTimeoutMs,
|
|
135341
135604
|
Math.max(1, remainingAttemptBudgetMs)
|
|
135342
135605
|
);
|
|
135343
|
-
|
|
135606
|
+
logger7.debug(
|
|
135344
135607
|
"direct_daemon_control_socket_connect_start",
|
|
135345
135608
|
this.buildLogFields({
|
|
135346
135609
|
...buildDirectDaemonWsLogFields(lastConnectInfo, this.intent),
|
|
@@ -135351,13 +135614,12 @@ var init_directDaemonRuntime = __esm({
|
|
|
135351
135614
|
...buildDirectDaemonRequestLogFields(args.requestPayload)
|
|
135352
135615
|
})
|
|
135353
135616
|
);
|
|
135354
|
-
|
|
135355
|
-
|
|
135356
|
-
traceStartupStage,
|
|
135357
|
-
attemptTimeoutMs
|
|
135617
|
+
const connectInfo = lastConnectInfo;
|
|
135618
|
+
await withSystemTrustRetry(
|
|
135619
|
+
() => this.connectOnce(connectInfo, traceStartupStage, attemptTimeoutMs)
|
|
135358
135620
|
);
|
|
135359
135621
|
if (this.reconnecting || attempt > 1) {
|
|
135360
|
-
|
|
135622
|
+
logger7.info(
|
|
135361
135623
|
"direct_daemon_control_socket_reconnected",
|
|
135362
135624
|
this.buildLogFields({
|
|
135363
135625
|
attempt,
|
|
@@ -135375,7 +135637,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135375
135637
|
if (lastConnectInfo && isDirectDaemonTransportError(failure) && failure.providerRecoveryReason && !providerRecoveryAttempted) {
|
|
135376
135638
|
providerRecoveryAttempted = true;
|
|
135377
135639
|
const recoveryRequestId = randomUUID10();
|
|
135378
|
-
|
|
135640
|
+
logger7.warn(
|
|
135379
135641
|
"direct_daemon_control_provider_recovery_start",
|
|
135380
135642
|
this.buildLogFields({
|
|
135381
135643
|
requestId: recoveryRequestId,
|
|
@@ -135397,7 +135659,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135397
135659
|
connectInfo: lastConnectInfo,
|
|
135398
135660
|
recoveredTarget
|
|
135399
135661
|
});
|
|
135400
|
-
|
|
135662
|
+
logger7.info(
|
|
135401
135663
|
"direct_daemon_control_provider_recovery_ready",
|
|
135402
135664
|
this.buildLogFields({
|
|
135403
135665
|
requestId: recoveryRequestId,
|
|
@@ -135410,7 +135672,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135410
135672
|
continue;
|
|
135411
135673
|
}
|
|
135412
135674
|
if (!isDirectDaemonTransportError(failure)) {
|
|
135413
|
-
|
|
135675
|
+
logger7.warn(
|
|
135414
135676
|
"direct_daemon_control_connect_info_failed",
|
|
135415
135677
|
this.buildLogFields({
|
|
135416
135678
|
attempt,
|
|
@@ -135435,7 +135697,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135435
135697
|
}
|
|
135436
135698
|
this.reconnecting = true;
|
|
135437
135699
|
const retryInMs = Math.min(delayMs, remainingMs);
|
|
135438
|
-
|
|
135700
|
+
logger7.warn(
|
|
135439
135701
|
"direct_daemon_control_socket_connect_retry",
|
|
135440
135702
|
this.buildLogFields({
|
|
135441
135703
|
attempt,
|
|
@@ -135473,10 +135735,15 @@ var init_directDaemonRuntime = __esm({
|
|
|
135473
135735
|
);
|
|
135474
135736
|
}
|
|
135475
135737
|
async connectOnce(connectInfo, traceStartupStage, attemptTimeoutMs) {
|
|
135738
|
+
if (this.disposed) {
|
|
135739
|
+
throw new Error(
|
|
135740
|
+
`${formatProviderLabel(this.provider)} control socket is closed.`
|
|
135741
|
+
);
|
|
135742
|
+
}
|
|
135476
135743
|
this.cleanupWebSocket();
|
|
135477
135744
|
await new Promise((resolve3, reject) => {
|
|
135478
135745
|
let settled = false;
|
|
135479
|
-
const ws = new
|
|
135746
|
+
const ws = new SystemTrustWebSocket2(
|
|
135480
135747
|
buildDirectDaemonWsUrl(connectInfo, this.intent)
|
|
135481
135748
|
);
|
|
135482
135749
|
traceStartupStage("websocket_created", { attemptTimeoutMs });
|
|
@@ -135533,7 +135800,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135533
135800
|
ws.on("open", () => {
|
|
135534
135801
|
clearOpeningTimer();
|
|
135535
135802
|
traceStartupStage("websocket_open");
|
|
135536
|
-
|
|
135803
|
+
logger7.debug(
|
|
135537
135804
|
"direct_daemon_control_socket_open",
|
|
135538
135805
|
this.buildLogFields(
|
|
135539
135806
|
buildDirectDaemonWsLogFields(connectInfo, this.intent)
|
|
@@ -135558,7 +135825,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135558
135825
|
ws.on("message", (raw) => {
|
|
135559
135826
|
const parsed = parseDaemonJsonRecord(raw);
|
|
135560
135827
|
if (!parsed) {
|
|
135561
|
-
|
|
135828
|
+
logger7.warn(
|
|
135562
135829
|
"direct_daemon_control_socket_message_parse_failed",
|
|
135563
135830
|
this.buildLogFields({
|
|
135564
135831
|
rawBytes: measureDirectDaemonRawMessageBytes(raw)
|
|
@@ -135636,7 +135903,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135636
135903
|
this.controlCapabilities = new Set(ready.capabilities);
|
|
135637
135904
|
this.lastPongAt = Date.now();
|
|
135638
135905
|
this.startKeepalive();
|
|
135639
|
-
|
|
135906
|
+
logger7.debug(
|
|
135640
135907
|
"direct_daemon_control_socket_ready",
|
|
135641
135908
|
this.buildLogFields(
|
|
135642
135909
|
buildDirectDaemonWsLogFields(connectInfo, this.intent)
|
|
@@ -135691,20 +135958,21 @@ var init_directDaemonRuntime = __esm({
|
|
|
135691
135958
|
this.lastPongAt = Date.now();
|
|
135692
135959
|
});
|
|
135693
135960
|
ws.on("error", (error55) => {
|
|
135694
|
-
|
|
135961
|
+
logger7.warn(
|
|
135695
135962
|
"direct_daemon_control_socket_error",
|
|
135696
135963
|
this.buildLogFields({
|
|
135697
135964
|
...buildDirectDaemonWsLogFields(connectInfo, this.intent),
|
|
135698
135965
|
error: error55.message
|
|
135699
135966
|
})
|
|
135700
135967
|
);
|
|
135968
|
+
const untrusted = isUntrustedCertificateError(error55);
|
|
135701
135969
|
const transportError = createDirectDaemonTransportError({
|
|
135702
135970
|
provider: this.provider,
|
|
135703
135971
|
alias: this.alias,
|
|
135704
135972
|
transportCode: "socket_error",
|
|
135705
|
-
retryable:
|
|
135973
|
+
retryable: !untrusted,
|
|
135706
135974
|
message: `${formatProviderLabel(this.provider)} control websocket error: ${error55.message}`,
|
|
135707
|
-
...grantStage === "awaiting_challenge" ? { providerRecoveryReason: "socket_unreachable" } : {},
|
|
135975
|
+
...grantStage === "awaiting_challenge" && !untrusted ? { providerRecoveryReason: "socket_unreachable" } : {},
|
|
135708
135976
|
cause: error55
|
|
135709
135977
|
});
|
|
135710
135978
|
if (!this.authenticated) {
|
|
@@ -135715,7 +135983,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135715
135983
|
});
|
|
135716
135984
|
ws.on("close", (code2, reason) => {
|
|
135717
135985
|
const reasonText = reason.toString("utf8");
|
|
135718
|
-
|
|
135986
|
+
logger7.warn(
|
|
135719
135987
|
"direct_daemon_control_socket_close",
|
|
135720
135988
|
this.buildLogFields({
|
|
135721
135989
|
...buildDirectDaemonWsLogFields(connectInfo, this.intent),
|
|
@@ -135789,7 +136057,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135789
136057
|
);
|
|
135790
136058
|
}
|
|
135791
136059
|
this.scheduleIdleClose();
|
|
135792
|
-
|
|
136060
|
+
logger7.warn(
|
|
135793
136061
|
"direct_daemon_control_request_timeout",
|
|
135794
136062
|
this.buildLogFields({
|
|
135795
136063
|
requestId: requestId2,
|
|
@@ -135854,7 +136122,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135854
136122
|
});
|
|
135855
136123
|
}
|
|
135856
136124
|
refDirectDaemonWebSocket(ws);
|
|
135857
|
-
|
|
136125
|
+
logger7.debug(
|
|
135858
136126
|
"direct_daemon_control_request_send",
|
|
135859
136127
|
this.buildLogFields({
|
|
135860
136128
|
requestId: requestId2,
|
|
@@ -135980,7 +136248,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135980
136248
|
}
|
|
135981
136249
|
this.disposed = true;
|
|
135982
136250
|
this.reconnecting = false;
|
|
135983
|
-
|
|
136251
|
+
logger7.debug("direct_daemon_control_socket_dispose", this.buildLogFields());
|
|
135984
136252
|
this.clearIdleTimer();
|
|
135985
136253
|
this.failPendingRequests(
|
|
135986
136254
|
new Error(
|
|
@@ -136066,7 +136334,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
136066
136334
|
try {
|
|
136067
136335
|
const response = await executeRequest(forceRefresh);
|
|
136068
136336
|
if (transportRetries > 0) {
|
|
136069
|
-
|
|
136337
|
+
logger7.info(
|
|
136070
136338
|
"direct_daemon_control_request_retry_recovered",
|
|
136071
136339
|
buildDirectDaemonOperationLogFields({
|
|
136072
136340
|
alias: args.alias,
|
|
@@ -136083,7 +136351,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
136083
136351
|
if (transportRetries < DIRECT_DAEMON_REQUEST_TRANSPORT_RETRY_LIMIT && isDirectDaemonReplaySafeRequest(args.requestPayload) && isDirectDaemonTransportError(error55) && error55.retryable) {
|
|
136084
136352
|
transportRetries += 1;
|
|
136085
136353
|
forceRefresh = true;
|
|
136086
|
-
|
|
136354
|
+
logger7.warn("direct_daemon_control_request_retry", {
|
|
136087
136355
|
...buildDirectDaemonOperationLogFields({
|
|
136088
136356
|
alias: args.alias,
|
|
136089
136357
|
provider: args.provider,
|
|
@@ -138605,7 +138873,7 @@ var init_connect2 = __esm({
|
|
|
138605
138873
|
try {
|
|
138606
138874
|
boxes = await listDevboxes();
|
|
138607
138875
|
} catch (error55) {
|
|
138608
|
-
|
|
138876
|
+
logger3.warn("registry_boxes_lookup_failed", { error: String(error55) });
|
|
138609
138877
|
}
|
|
138610
138878
|
}
|
|
138611
138879
|
if (!resolvedTarget && parsed.target && !parsedTarget.session) {
|
|
@@ -138699,7 +138967,7 @@ var init_connect2 = __esm({
|
|
|
138699
138967
|
latency?.setContext({ box: spriteAlias });
|
|
138700
138968
|
}
|
|
138701
138969
|
} catch (error55) {
|
|
138702
|
-
|
|
138970
|
+
logger3.warn("session_id_resolution_failed", { error: String(error55) });
|
|
138703
138971
|
}
|
|
138704
138972
|
}
|
|
138705
138973
|
stage("Syncing machine");
|
|
@@ -138739,7 +139007,7 @@ var init_connect2 = __esm({
|
|
|
138739
139007
|
return;
|
|
138740
139008
|
}
|
|
138741
139009
|
} catch (error55) {
|
|
138742
|
-
|
|
139010
|
+
logger3.warn("ports_snapshot_failed", { error: String(error55) });
|
|
138743
139011
|
}
|
|
138744
139012
|
}
|
|
138745
139013
|
if (pendingPortLogs.get(event.port) === token) {
|
|
@@ -138788,7 +139056,7 @@ var init_connect2 = __esm({
|
|
|
138788
139056
|
}
|
|
138789
139057
|
);
|
|
138790
139058
|
if (response.status !== 200) {
|
|
138791
|
-
|
|
139059
|
+
logger3.warn("connect_port_owner_release_failed", {
|
|
138792
139060
|
box: spriteAlias,
|
|
138793
139061
|
sessionId: connectOwnerSessionId,
|
|
138794
139062
|
status: response.status,
|
|
@@ -138796,7 +139064,7 @@ var init_connect2 = __esm({
|
|
|
138796
139064
|
});
|
|
138797
139065
|
}
|
|
138798
139066
|
} catch (error55) {
|
|
138799
|
-
|
|
139067
|
+
logger3.warn("connect_port_owner_release_failed", {
|
|
138800
139068
|
box: spriteAlias,
|
|
138801
139069
|
sessionId: connectOwnerSessionId,
|
|
138802
139070
|
error: String(error55)
|
|
@@ -138813,13 +139081,13 @@ var init_connect2 = __esm({
|
|
|
138813
139081
|
{ alias: spriteAlias }
|
|
138814
139082
|
);
|
|
138815
139083
|
if (response.status !== 200) {
|
|
138816
|
-
|
|
139084
|
+
logger3.warn("registry_usage_failed", {
|
|
138817
139085
|
status: response.status,
|
|
138818
139086
|
error: response.body?.error
|
|
138819
139087
|
});
|
|
138820
139088
|
}
|
|
138821
139089
|
} catch (error55) {
|
|
138822
|
-
|
|
139090
|
+
logger3.warn("registry_usage_failed", { error: String(error55) });
|
|
138823
139091
|
} finally {
|
|
138824
139092
|
traceEmbeddedStartup("registry_usage_finished");
|
|
138825
139093
|
}
|
|
@@ -138837,7 +139105,7 @@ var init_connect2 = __esm({
|
|
|
138837
139105
|
}
|
|
138838
139106
|
connectOwnerHeartbeatTimer = setInterval(() => {
|
|
138839
139107
|
void renewConnectPortOwner().catch((error55) => {
|
|
138840
|
-
|
|
139108
|
+
logger3.warn("connect_port_owner_heartbeat_failed", {
|
|
138841
139109
|
box: spriteAlias,
|
|
138842
139110
|
sessionId: connectOwnerSessionId,
|
|
138843
139111
|
error: String(error55)
|
|
@@ -138865,7 +139133,7 @@ var init_connect2 = __esm({
|
|
|
138865
139133
|
setupStatus = summary?.setupStatus ?? null;
|
|
138866
139134
|
}
|
|
138867
139135
|
} catch (error55) {
|
|
138868
|
-
|
|
139136
|
+
logger3.warn("registry_setup_status_failed", { error: String(error55) });
|
|
138869
139137
|
}
|
|
138870
139138
|
}
|
|
138871
139139
|
if (setupStatus && setupStatus !== "complete") {
|
|
@@ -138888,14 +139156,14 @@ var init_connect2 = __esm({
|
|
|
138888
139156
|
computeProvider
|
|
138889
139157
|
});
|
|
138890
139158
|
} catch (error55) {
|
|
138891
|
-
|
|
139159
|
+
logger3.warn("workdir_lookup_failed", {
|
|
138892
139160
|
box: spriteAlias,
|
|
138893
139161
|
error: String(error55)
|
|
138894
139162
|
});
|
|
138895
139163
|
}
|
|
138896
139164
|
connectShell = await resolveConnectShell(client, spriteAlias);
|
|
138897
139165
|
}
|
|
138898
|
-
const warnSessionMap = (event, fields) =>
|
|
139166
|
+
const warnSessionMap = (event, fields) => logger3.warn(event, fields);
|
|
138899
139167
|
const initialSessionState = await initializeSessionMapState({
|
|
138900
139168
|
client,
|
|
138901
139169
|
alias: spriteAlias,
|
|
@@ -139149,7 +139417,7 @@ ${message}\r
|
|
|
139149
139417
|
}
|
|
139150
139418
|
};
|
|
139151
139419
|
const onSigint = () => {
|
|
139152
|
-
|
|
139420
|
+
logger3.info("connect_sigint", {
|
|
139153
139421
|
connectPhase,
|
|
139154
139422
|
hasActiveSocket: Boolean(activeSocket),
|
|
139155
139423
|
localCancelRequested
|
|
@@ -139159,21 +139427,21 @@ ${message}\r
|
|
|
139159
139427
|
try {
|
|
139160
139428
|
activeSocket.terminate?.();
|
|
139161
139429
|
} catch {
|
|
139162
|
-
|
|
139430
|
+
logger3.warn("connect_sigint_terminate_failed", {
|
|
139163
139431
|
connectPhase
|
|
139164
139432
|
});
|
|
139165
139433
|
}
|
|
139166
139434
|
try {
|
|
139167
139435
|
activeSocket.close();
|
|
139168
139436
|
} catch {
|
|
139169
|
-
|
|
139437
|
+
logger3.warn("connect_sigint_close_failed", {
|
|
139170
139438
|
connectPhase
|
|
139171
139439
|
});
|
|
139172
139440
|
}
|
|
139173
139441
|
};
|
|
139174
139442
|
const setConnectPhase = (phase) => {
|
|
139175
139443
|
if (connectPhase !== phase) {
|
|
139176
|
-
|
|
139444
|
+
logger3.debug("connect_phase_change", {
|
|
139177
139445
|
from: connectPhase,
|
|
139178
139446
|
to: phase
|
|
139179
139447
|
});
|
|
@@ -139202,7 +139470,7 @@ ${message}\r
|
|
|
139202
139470
|
try {
|
|
139203
139471
|
await refreshSessionMapping();
|
|
139204
139472
|
} catch (error55) {
|
|
139205
|
-
|
|
139473
|
+
logger3.warn("session_refresh_failed", { error: String(error55) });
|
|
139206
139474
|
}
|
|
139207
139475
|
if (explicitName && sessionName && !sessionId && !confirmedCreateExplicit) {
|
|
139208
139476
|
pauseStatus();
|
|
@@ -139279,7 +139547,7 @@ ${message}\r
|
|
|
139279
139547
|
mappingWrite.then(() => {
|
|
139280
139548
|
reportSessionInfo(id2);
|
|
139281
139549
|
}).catch((error55) => {
|
|
139282
|
-
|
|
139550
|
+
logger3.warn("session_auto_rename_failed", {
|
|
139283
139551
|
error: String(error55)
|
|
139284
139552
|
});
|
|
139285
139553
|
reportSessionInfo(id2);
|
|
@@ -139331,7 +139599,7 @@ ${message}\r
|
|
|
139331
139599
|
try {
|
|
139332
139600
|
await mappingWrite;
|
|
139333
139601
|
} catch (error55) {
|
|
139334
|
-
|
|
139602
|
+
logger3.warn("session_write_failed", { error: String(error55) });
|
|
139335
139603
|
}
|
|
139336
139604
|
}
|
|
139337
139605
|
const streamOutcome = resolveConnectStreamOutcome({
|
|
@@ -139395,7 +139663,7 @@ ${message}\r
|
|
|
139395
139663
|
sessionId = void 0;
|
|
139396
139664
|
}
|
|
139397
139665
|
} catch (error55) {
|
|
139398
|
-
|
|
139666
|
+
logger3.warn("session_lookup_failed", { error: String(error55) });
|
|
139399
139667
|
}
|
|
139400
139668
|
}
|
|
139401
139669
|
}
|
|
@@ -139429,7 +139697,7 @@ ${message}\r
|
|
|
139429
139697
|
homeDir: homeDir2
|
|
139430
139698
|
});
|
|
139431
139699
|
} catch (error55) {
|
|
139432
|
-
|
|
139700
|
+
logger3.warn("completion_cache_update_failed", { error: String(error55) });
|
|
139433
139701
|
}
|
|
139434
139702
|
if (outcome === null) {
|
|
139435
139703
|
throw new Error("Connect ended without a terminal outcome.");
|
|
@@ -140136,7 +140404,7 @@ var init_cp = __esm({
|
|
|
140136
140404
|
computeProvider: target.computeProvider
|
|
140137
140405
|
})
|
|
140138
140406
|
});
|
|
140139
|
-
|
|
140407
|
+
logger3.info("cp_start", {
|
|
140140
140408
|
box: target.box,
|
|
140141
140409
|
provider: target.computeProvider,
|
|
140142
140410
|
kind: sourceStats.isDirectory() ? "directory" : "file",
|
|
@@ -140156,7 +140424,7 @@ var init_cp = __esm({
|
|
|
140156
140424
|
remotePath,
|
|
140157
140425
|
...onProgress ? { onProgress } : {}
|
|
140158
140426
|
});
|
|
140159
|
-
|
|
140427
|
+
logger3.info("cp_complete", {
|
|
140160
140428
|
box: target.box,
|
|
140161
140429
|
provider: target.computeProvider,
|
|
140162
140430
|
kind: sourceStats.isDirectory() ? "directory" : "file",
|
|
@@ -140217,7 +140485,7 @@ var init_cp = __esm({
|
|
|
140217
140485
|
})
|
|
140218
140486
|
});
|
|
140219
140487
|
} catch (error55) {
|
|
140220
|
-
|
|
140488
|
+
logger3.warn("cp_failed", {
|
|
140221
140489
|
box: providerTarget.alias,
|
|
140222
140490
|
provider: providerTarget.computeProvider,
|
|
140223
140491
|
sourcePath,
|
|
@@ -142521,7 +142789,7 @@ var init_cliAgentToolsContract = __esm({
|
|
|
142521
142789
|
});
|
|
142522
142790
|
|
|
142523
142791
|
// ../../../../shared/threadRuntime/cliAgentToolsProjection.ts
|
|
142524
|
-
var projectCliAgentToolsProjectV1, resolveCliAgentToolsThreadStatusV1, projectCliAgentToolsThreadContextV1;
|
|
142792
|
+
var projectCliAgentToolsProjectV1, resolveCliAgentToolsThreadStatusV1, pendingInputHoldsTurn, resolveThreadStatusWithPendingInput, projectCliAgentToolsThreadContextV1;
|
|
142525
142793
|
var init_cliAgentToolsProjection = __esm({
|
|
142526
142794
|
"../../../../shared/threadRuntime/cliAgentToolsProjection.ts"() {
|
|
142527
142795
|
"use strict";
|
|
@@ -142569,6 +142837,8 @@ var init_cliAgentToolsProjection = __esm({
|
|
|
142569
142837
|
}
|
|
142570
142838
|
return activeTurnId === null ? "idle" : "running";
|
|
142571
142839
|
};
|
|
142840
|
+
pendingInputHoldsTurn = (pendingInput, turnId) => pendingInput != null && pendingInput.kind !== "access_request" && turnId !== null && pendingInput.turnId === turnId;
|
|
142841
|
+
resolveThreadStatusWithPendingInput = (status, activeTurnId, pendingInput) => status === "running" && pendingInputHoldsTurn(pendingInput, activeTurnId) ? "needs_input" : status;
|
|
142572
142842
|
projectCliAgentToolsThreadContextV1 = (thread) => ({
|
|
142573
142843
|
clientThreadId: thread.clientThreadId,
|
|
142574
142844
|
agent: thread.backend,
|
|
@@ -142833,7 +143103,8 @@ var init_forkExecutionStatusTone = __esm({
|
|
|
142833
143103
|
sleeping: "idle",
|
|
142834
143104
|
waking: "warning",
|
|
142835
143105
|
upgrading: "warning",
|
|
142836
|
-
|
|
143106
|
+
// The box keeps working on its current version, so this is a warning.
|
|
143107
|
+
upgrade_failed: "warning",
|
|
142837
143108
|
not_responding: "warning"
|
|
142838
143109
|
};
|
|
142839
143110
|
hasFreshRunningObservation = ({
|
|
@@ -143430,7 +143701,7 @@ var init_onboxOtherDevboxDestructionAccess = __esm({
|
|
|
143430
143701
|
});
|
|
143431
143702
|
|
|
143432
143703
|
// ../../../../shared/onboxAgentPermissionRequestProtocol.ts
|
|
143433
|
-
var ONBOX_AGENT_PERMISSION_REQUEST_MAX_HTTP_BODY_BYTES, ONBOX_AGENT_PERMISSION_REQUEST_TTL_MS, ONBOX_AGENT_PERMISSIONS, ONBOX_AGENT_THREAD_GRANT_PERMISSIONS, ONBOX_AGENT_THREAD_GRANT_TTL_MS, isOnboxAgentThreadGrantPermission, isOnboxAgentPermission, REQUEST_ID_PATTERN, normalizeOnboxAgentPermissionRequestId;
|
|
143704
|
+
var ONBOX_AGENT_PERMISSION_REQUEST_MAX_HTTP_BODY_BYTES, ONBOX_AGENT_PERMISSION_REQUEST_TTL_MS, ONBOX_AGENT_PERMISSIONS, ONBOX_AGENT_THREAD_GRANT_PERMISSIONS, ONBOX_AGENT_EXACT_ACTION_PERMISSIONS, isOnboxAgentExactActionPermission, ONBOX_AGENT_EXACT_ACTION_APPLY_TTL_MS, ONBOX_AGENT_THREAD_GRANT_TTL_MS, isOnboxAgentThreadGrantPermission, isOnboxAgentPermission, REQUEST_ID_PATTERN, normalizeOnboxAgentPermissionRequestId;
|
|
143434
143705
|
var init_onboxAgentPermissionRequestProtocol = __esm({
|
|
143435
143706
|
"../../../../shared/onboxAgentPermissionRequestProtocol.ts"() {
|
|
143436
143707
|
"use strict";
|
|
@@ -143460,15 +143731,29 @@ var init_onboxAgentPermissionRequestProtocol = __esm({
|
|
|
143460
143731
|
"edit-project-settings",
|
|
143461
143732
|
"edit-team-template",
|
|
143462
143733
|
"edit-personal-environment",
|
|
143463
|
-
"edit-automations"
|
|
143734
|
+
"edit-automations",
|
|
143735
|
+
"edit-tailscale-integration",
|
|
143736
|
+
"edit-google-cloud-integration",
|
|
143737
|
+
"change-aws-profile",
|
|
143738
|
+
"enable-tailscale-integration"
|
|
143464
143739
|
];
|
|
143465
143740
|
ONBOX_AGENT_THREAD_GRANT_PERMISSIONS = [
|
|
143466
143741
|
"edit-template-box",
|
|
143467
143742
|
"edit-project-settings",
|
|
143468
143743
|
"edit-team-template",
|
|
143469
143744
|
"edit-personal-environment",
|
|
143470
|
-
"edit-automations"
|
|
143745
|
+
"edit-automations",
|
|
143746
|
+
"edit-tailscale-integration",
|
|
143747
|
+
"edit-google-cloud-integration"
|
|
143748
|
+
];
|
|
143749
|
+
ONBOX_AGENT_EXACT_ACTION_PERMISSIONS = [
|
|
143750
|
+
"change-aws-profile",
|
|
143751
|
+
"enable-tailscale-integration"
|
|
143471
143752
|
];
|
|
143753
|
+
isOnboxAgentExactActionPermission = (permission) => ONBOX_AGENT_EXACT_ACTION_PERMISSIONS.includes(
|
|
143754
|
+
permission
|
|
143755
|
+
);
|
|
143756
|
+
ONBOX_AGENT_EXACT_ACTION_APPLY_TTL_MS = 10 * 60 * 1e3;
|
|
143472
143757
|
ONBOX_AGENT_THREAD_GRANT_TTL_MS = 3 * 60 * 60 * 1e3;
|
|
143473
143758
|
isOnboxAgentThreadGrantPermission = (permission) => ONBOX_AGENT_THREAD_GRANT_PERMISSIONS.includes(
|
|
143474
143759
|
permission
|
|
@@ -143483,7 +143768,7 @@ var init_onboxAgentPermissionRequestProtocol = __esm({
|
|
|
143483
143768
|
});
|
|
143484
143769
|
|
|
143485
143770
|
// ../../../../shared/onboxAgentPermissionRequestPresentation.ts
|
|
143486
|
-
var permissionQuestions, threadGrantScope, buildOnboxAgentPermissionRequestPresentation;
|
|
143771
|
+
var permissionQuestions, threadGrantScope, describeAwsAccess, presentAction, buildOnboxAgentPermissionRequestPresentation;
|
|
143487
143772
|
var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
143488
143773
|
"../../../../shared/onboxAgentPermissionRequestPresentation.ts"() {
|
|
143489
143774
|
"use strict";
|
|
@@ -143512,7 +143797,11 @@ var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
|
143512
143797
|
"edit-project-settings": "Allow this thread to edit project settings?",
|
|
143513
143798
|
"edit-team-template": "Allow this thread to edit the Team Template?",
|
|
143514
143799
|
"edit-personal-environment": "Allow this thread to edit your environment variables?",
|
|
143515
|
-
"edit-automations": "Allow this thread to edit your automations?"
|
|
143800
|
+
"edit-automations": "Allow this thread to edit your automations?",
|
|
143801
|
+
"edit-tailscale-integration": "Allow this thread to change Tailscale auto-connect?",
|
|
143802
|
+
"edit-google-cloud-integration": "Allow this thread to choose the Google Cloud project?",
|
|
143803
|
+
"change-aws-profile": "Allow this thread to change an AWS profile?",
|
|
143804
|
+
"enable-tailscale-integration": "Allow this thread to enable Tailscale?"
|
|
143516
143805
|
};
|
|
143517
143806
|
threadGrantScope = (permission, teamTemplateName) => {
|
|
143518
143807
|
switch (permission) {
|
|
@@ -143522,18 +143811,79 @@ var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
|
143522
143811
|
return "For the next 3 hours, the agent in this thread will be able to change settings and your environment and member-file values in this project, plus your account's auto-wake preference. Agent permission defaults remain user-only.";
|
|
143523
143812
|
case "edit-personal-environment":
|
|
143524
143813
|
return "For the next 3 hours, the agent in this thread will be able to add, change, and remove your own environment variables in this project. Changes will reach all your devboxes in this project.";
|
|
143814
|
+
case "edit-tailscale-integration":
|
|
143815
|
+
return "For the next 3 hours, the agent in this thread will be able to choose whether new devboxes in this project connect to Tailscale automatically. Saved changes will stay in place after this permission expires.";
|
|
143816
|
+
case "edit-google-cloud-integration":
|
|
143817
|
+
return "For the next 3 hours, the agent in this thread will be able to choose the Google Cloud project this project uses by default and for quota. Your Google account's access won't change. Saved changes will stay in place after this permission expires.";
|
|
143525
143818
|
case "edit-automations":
|
|
143526
143819
|
return "For the next 3 hours, the agent in this thread will be able to create, change, pause, run, and delete your automations in this project. Each run will either start a new agent thread on a new devbox, without this conversation, or send the prompt to an existing thread, such as this one. Runs will use box-hours.";
|
|
143527
143820
|
case "edit-team-template":
|
|
143528
143821
|
return `For the next 3 hours, the agent in this thread will be able to edit ${teamTemplateName === null ? "your team's Team Template" : `the "${teamTemplateName}" Team Template`}, including its settings and environment variables, change settings in this project and your account's auto-wake preference, and save new versions for your team. Agent permission defaults remain user-only.`;
|
|
143529
143822
|
}
|
|
143530
143823
|
};
|
|
143824
|
+
describeAwsAccess = (choice) => `${choice.roleName} in ${choice.accountName} (${choice.accountId})`;
|
|
143825
|
+
presentAction = (action) => {
|
|
143826
|
+
const common = {
|
|
143827
|
+
automationsSectionSentence: null,
|
|
143828
|
+
agentReason: action.agentReason ? `The agent says: ${action.agentReason}` : null,
|
|
143829
|
+
declineLabel: "Deny",
|
|
143830
|
+
projectAllowLabel: "Always allow for project"
|
|
143831
|
+
};
|
|
143832
|
+
if (action.kind === "aws_profile") {
|
|
143833
|
+
const adding = action.current === null;
|
|
143834
|
+
return {
|
|
143835
|
+
...common,
|
|
143836
|
+
question: `${adding ? "Add" : "Change"} the ${action.profileName} AWS profile in ${action.projectAlias}?`,
|
|
143837
|
+
details: [
|
|
143838
|
+
{ label: "Project", value: action.projectAlias },
|
|
143839
|
+
{ label: "Profile", value: action.profileName },
|
|
143840
|
+
...action.current ? [
|
|
143841
|
+
{
|
|
143842
|
+
label: "Current access",
|
|
143843
|
+
value: describeAwsAccess(action.current)
|
|
143844
|
+
}
|
|
143845
|
+
] : [],
|
|
143846
|
+
{ label: "New access", value: describeAwsAccess(action) }
|
|
143847
|
+
],
|
|
143848
|
+
scope: "Programs and agents on this project's boxes will be able to use this role. The change will stay in place until someone changes this profile again.",
|
|
143849
|
+
allowLabel: adding ? "Add AWS profile" : "Change AWS profile"
|
|
143850
|
+
};
|
|
143851
|
+
}
|
|
143852
|
+
return {
|
|
143853
|
+
...common,
|
|
143854
|
+
question: `Enable Tailscale in ${action.projectAlias}?`,
|
|
143855
|
+
details: [
|
|
143856
|
+
{ label: "Project", value: action.projectAlias },
|
|
143857
|
+
{ label: "Tailnet", value: action.tailnetId },
|
|
143858
|
+
{ label: "Tag", value: action.tag },
|
|
143859
|
+
{
|
|
143860
|
+
label: "New devboxes",
|
|
143861
|
+
value: action.autoConnect.after ? "Will connect automatically" : "Won't connect automatically"
|
|
143862
|
+
}
|
|
143863
|
+
],
|
|
143864
|
+
scope: "Programs and agents on this project's boxes will be able to use the network access this tag has. Tailscale will stay on until someone turns it off for this project.",
|
|
143865
|
+
allowLabel: "Enable Tailscale"
|
|
143866
|
+
};
|
|
143867
|
+
};
|
|
143531
143868
|
buildOnboxAgentPermissionRequestPresentation = ({
|
|
143532
143869
|
permission,
|
|
143533
143870
|
sourceBoxKind,
|
|
143534
143871
|
projectScopeAvailable,
|
|
143535
|
-
teamTemplateName
|
|
143872
|
+
teamTemplateName,
|
|
143873
|
+
action
|
|
143536
143874
|
}) => {
|
|
143875
|
+
if (action) return presentAction(action);
|
|
143876
|
+
if (isOnboxAgentExactActionPermission(permission))
|
|
143877
|
+
return {
|
|
143878
|
+
question: permissionQuestions[permission],
|
|
143879
|
+
scope: "Update boxes.dev to see this change.",
|
|
143880
|
+
automationsSectionSentence: null,
|
|
143881
|
+
details: [],
|
|
143882
|
+
agentReason: null,
|
|
143883
|
+
allowLabel: "Allow",
|
|
143884
|
+
declineLabel: "Deny",
|
|
143885
|
+
projectAllowLabel: "Always allow for project"
|
|
143886
|
+
};
|
|
143537
143887
|
const box = sourceBoxKind === "template_box" ? "Template box" : "devbox";
|
|
143538
143888
|
const boxScope = permission === "message-agents" ? `Allow will let agents on this ${box} message your other agents in this project and receive their messages until you turn it off. A message will start an idle agent and wake its devbox if it's asleep.` : permission === "message-teammates-agents" ? `Allow will let agents on this ${box} message your teammates\u2019 agents until you turn it off. Your teammates\u2019 agents will also be able to message agents here once you allow their messages. An allowed message will start an idle agent and wake this ${box} if it's asleep.` : `Allow will enable this permission on this ${box} until you turn it off.`;
|
|
143539
143889
|
return {
|
|
@@ -143544,6 +143894,8 @@ var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
|
143544
143894
|
linkText: "automations",
|
|
143545
143895
|
after: " section."
|
|
143546
143896
|
} : null,
|
|
143897
|
+
details: [],
|
|
143898
|
+
agentReason: null,
|
|
143547
143899
|
allowLabel: isOnboxAgentThreadGrantPermission(permission) ? "Allow for 3 hours" : "Allow",
|
|
143548
143900
|
declineLabel: "Deny",
|
|
143549
143901
|
projectAllowLabel: "Always allow for project"
|
|
@@ -143813,7 +144165,7 @@ var init_commandContext = __esm({
|
|
|
143813
144165
|
projects.map((project) => project.projectAlias)
|
|
143814
144166
|
);
|
|
143815
144167
|
} catch (error55) {
|
|
143816
|
-
|
|
144168
|
+
logger3.warn("completion_cache_update_failed", {
|
|
143817
144169
|
error: String(error55)
|
|
143818
144170
|
});
|
|
143819
144171
|
}
|
|
@@ -144647,12 +144999,12 @@ var init_managedCodex = __esm({
|
|
|
144647
144999
|
versionsDir
|
|
144648
145000
|
});
|
|
144649
145001
|
if (removedVersions.length > 0) {
|
|
144650
|
-
|
|
145002
|
+
logger3.info("managed_codex_old_versions_removed", {
|
|
144651
145003
|
removedVersions
|
|
144652
145004
|
});
|
|
144653
145005
|
}
|
|
144654
145006
|
} catch (error55) {
|
|
144655
|
-
|
|
145007
|
+
logger3.warn("managed_codex_old_versions_remove_failed", {
|
|
144656
145008
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
144657
145009
|
});
|
|
144658
145010
|
}
|
|
@@ -165619,7 +165971,7 @@ var init_nativeAgentImageUpload = __esm({
|
|
|
165619
165971
|
gestureSignal: signal ?? null,
|
|
165620
165972
|
abortAttempt: (reason) => attemptController.abort(reason)
|
|
165621
165973
|
});
|
|
165622
|
-
|
|
165974
|
+
logger3.info("native_agent_image_upload_complete", {
|
|
165623
165975
|
alias,
|
|
165624
165976
|
attempt,
|
|
165625
165977
|
byteCount: metadata.reduce((sum, image2) => sum + image2.sizeBytes, 0),
|
|
@@ -165638,7 +165990,7 @@ var init_nativeAgentImageUpload = __esm({
|
|
|
165638
165990
|
});
|
|
165639
165991
|
}
|
|
165640
165992
|
if (attempt < ATTEMPT_LIMIT && isDirectDaemonTransportError(error55) && error55.transportCode !== "missing_capabilities" && error55.retryable) {
|
|
165641
|
-
|
|
165993
|
+
logger3.warn("native_agent_image_upload_recovery", {
|
|
165642
165994
|
alias,
|
|
165643
165995
|
attempt,
|
|
165644
165996
|
imageCount: images.length,
|
|
@@ -169443,7 +169795,7 @@ var init_agentDirectThread = __esm({
|
|
|
169443
169795
|
target
|
|
169444
169796
|
});
|
|
169445
169797
|
assertContractVersion(started, "Empty thread start");
|
|
169446
|
-
|
|
169798
|
+
logger3.info("direct_agent_thread_start_requested", {
|
|
169447
169799
|
backend,
|
|
169448
169800
|
primaryInstanceId: project.primaryInstanceId,
|
|
169449
169801
|
clientThreadId: String(started.clientThreadId),
|
|
@@ -169462,7 +169814,7 @@ var init_agentDirectThread = __esm({
|
|
|
169462
169814
|
clientThreadId: started.clientThreadId,
|
|
169463
169815
|
dependencies
|
|
169464
169816
|
});
|
|
169465
|
-
|
|
169817
|
+
logger3.info("direct_agent_renderer_open_requested", {
|
|
169466
169818
|
backend,
|
|
169467
169819
|
primaryInstanceId: project.primaryInstanceId,
|
|
169468
169820
|
clientThreadId: String(started.clientThreadId),
|
|
@@ -169476,7 +169828,7 @@ var init_agentDirectThread = __esm({
|
|
|
169476
169828
|
resolveConnectInfo: dependencies.resolveConnectInfo(getToken),
|
|
169477
169829
|
onStage: dependencies.report
|
|
169478
169830
|
});
|
|
169479
|
-
|
|
169831
|
+
logger3.info("direct_agent_renderer_closed", {
|
|
169480
169832
|
backend,
|
|
169481
169833
|
primaryInstanceId: project.primaryInstanceId,
|
|
169482
169834
|
clientThreadId: String(started.clientThreadId),
|
|
@@ -169727,14 +170079,14 @@ var init_threadViewed = __esm({
|
|
|
169727
170079
|
hasFocus: null
|
|
169728
170080
|
}
|
|
169729
170081
|
});
|
|
169730
|
-
|
|
170082
|
+
logger3.info("agent_view_thread_mark_viewed", {
|
|
169731
170083
|
clientThreadId,
|
|
169732
170084
|
status: "marked"
|
|
169733
170085
|
});
|
|
169734
170086
|
return { status: "marked" };
|
|
169735
170087
|
} catch (error55) {
|
|
169736
170088
|
const message = error55 instanceof Error ? error55.message : String(error55);
|
|
169737
|
-
|
|
170089
|
+
logger3.warn("agent_view_thread_mark_viewed", {
|
|
169738
170090
|
clientThreadId,
|
|
169739
170091
|
status: "failed",
|
|
169740
170092
|
reasonCode: "mutation_failed",
|
|
@@ -169903,7 +170255,7 @@ var init_agentDirectResume = __esm({
|
|
|
169903
170255
|
});
|
|
169904
170256
|
markViewedFailed = viewed.status === "failed";
|
|
169905
170257
|
};
|
|
169906
|
-
|
|
170258
|
+
logger3.info("direct_agent_resume_target_resolved", {
|
|
169907
170259
|
backend,
|
|
169908
170260
|
primaryInstanceId: project.primaryInstanceId,
|
|
169909
170261
|
executionInstanceId: resolvedThread.executionInstanceId,
|
|
@@ -220435,7 +220787,7 @@ var init_creationComposerController = __esm({
|
|
|
220435
220787
|
);
|
|
220436
220788
|
}
|
|
220437
220789
|
showCreationDefaultsPersistenceError(message, error55) {
|
|
220438
|
-
|
|
220790
|
+
logger3.warn("agent_view_creation_defaults_save_failed", {
|
|
220439
220791
|
projectAlias: this.project.projectAlias,
|
|
220440
220792
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
220441
220793
|
});
|
|
@@ -220541,7 +220893,7 @@ var init_creationComposerController = __esm({
|
|
|
220541
220893
|
}
|
|
220542
220894
|
}
|
|
220543
220895
|
});
|
|
220544
|
-
|
|
220896
|
+
logger3.warn("agent_view_creation_draft_text_sync_failed", {
|
|
220545
220897
|
clientThreadId: args.draftId,
|
|
220546
220898
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
220547
220899
|
});
|
|
@@ -220617,7 +220969,7 @@ var init_creationComposerController = __esm({
|
|
|
220617
220969
|
selectedActionStatusTone: "neutral"
|
|
220618
220970
|
});
|
|
220619
220971
|
this.creationReturnSelectionKey = null;
|
|
220620
|
-
|
|
220972
|
+
logger3.info("agent_view_creation_draft_kept", {
|
|
220621
220973
|
clientThreadId: composer.draftId
|
|
220622
220974
|
});
|
|
220623
220975
|
}
|
|
@@ -220775,7 +221127,7 @@ var init_creationComposerController = __esm({
|
|
|
220775
221127
|
}
|
|
220776
221128
|
});
|
|
220777
221129
|
} catch (error55) {
|
|
220778
|
-
|
|
221130
|
+
logger3.warn("agent_view_creation_draft_refresh_failed", {
|
|
220779
221131
|
clientThreadId: draftId,
|
|
220780
221132
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
220781
221133
|
});
|
|
@@ -220905,7 +221257,7 @@ var init_creationComposerController = __esm({
|
|
|
220905
221257
|
});
|
|
220906
221258
|
this.host.addPendingCreationSelection(draftId);
|
|
220907
221259
|
this.host.recompute();
|
|
220908
|
-
|
|
221260
|
+
logger3.info("agent_view_creation_draft_created", {
|
|
220909
221261
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
220910
221262
|
clientThreadId: draftId,
|
|
220911
221263
|
backend: created.draft.backend,
|
|
@@ -220916,7 +221268,7 @@ var init_creationComposerController = __esm({
|
|
|
220916
221268
|
selectedActionStatusMessage: "The thread composer could not open. Check the connection and try again.",
|
|
220917
221269
|
selectedActionStatusTone: "error"
|
|
220918
221270
|
});
|
|
220919
|
-
|
|
221271
|
+
logger3.warn("agent_view_creation_draft_failed", {
|
|
220920
221272
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
220921
221273
|
targetKind: kind,
|
|
220922
221274
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -220943,7 +221295,7 @@ var init_creationComposerController = __esm({
|
|
|
220943
221295
|
});
|
|
220944
221296
|
assertContractVersion3(result, "Editable draft");
|
|
220945
221297
|
if (result.status === "unavailable") {
|
|
220946
|
-
|
|
221298
|
+
logger3.info("agent_view_creation_draft_reopen_unavailable", {
|
|
220947
221299
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
220948
221300
|
clientThreadId,
|
|
220949
221301
|
reason: result.reason
|
|
@@ -221021,7 +221373,7 @@ var init_creationComposerController = __esm({
|
|
|
221021
221373
|
} : null
|
|
221022
221374
|
}
|
|
221023
221375
|
});
|
|
221024
|
-
|
|
221376
|
+
logger3.info("agent_view_creation_draft_reopened", {
|
|
221025
221377
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
221026
221378
|
clientThreadId,
|
|
221027
221379
|
backend,
|
|
@@ -221036,7 +221388,7 @@ var init_creationComposerController = __esm({
|
|
|
221036
221388
|
selectedActionStatusMessage: "The draft could not open. Check the connection and try again.",
|
|
221037
221389
|
selectedActionStatusTone: "error"
|
|
221038
221390
|
});
|
|
221039
|
-
|
|
221391
|
+
logger3.warn("agent_view_creation_draft_reopen_failed", {
|
|
221040
221392
|
clientThreadId,
|
|
221041
221393
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221042
221394
|
});
|
|
@@ -221210,7 +221562,7 @@ var init_creationComposerController = __esm({
|
|
|
221210
221562
|
}
|
|
221211
221563
|
});
|
|
221212
221564
|
}
|
|
221213
|
-
|
|
221565
|
+
logger3.warn("agent_view_creation_backend_update_failed", {
|
|
221214
221566
|
clientThreadId: composer.draftId,
|
|
221215
221567
|
backend,
|
|
221216
221568
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -221650,7 +222002,7 @@ var init_creationComposerController = __esm({
|
|
|
221650
222002
|
}
|
|
221651
222003
|
});
|
|
221652
222004
|
}
|
|
221653
|
-
|
|
222005
|
+
logger3.warn("agent_view_creation_draft_keep_failed", {
|
|
221654
222006
|
clientThreadId: composer.draftId,
|
|
221655
222007
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221656
222008
|
});
|
|
@@ -221709,7 +222061,7 @@ var init_creationComposerController = __esm({
|
|
|
221709
222061
|
selectedActionStatusTone: "neutral"
|
|
221710
222062
|
});
|
|
221711
222063
|
this.creationReturnSelectionKey = null;
|
|
221712
|
-
|
|
222064
|
+
logger3.info("agent_view_creation_draft_discarded", {
|
|
221713
222065
|
clientThreadId: composer.draftId,
|
|
221714
222066
|
removed: discarded.removed
|
|
221715
222067
|
});
|
|
@@ -221727,7 +222079,7 @@ var init_creationComposerController = __esm({
|
|
|
221727
222079
|
}
|
|
221728
222080
|
});
|
|
221729
222081
|
}
|
|
221730
|
-
|
|
222082
|
+
logger3.warn("agent_view_creation_draft_discard_failed", {
|
|
221731
222083
|
clientThreadId: composer.draftId,
|
|
221732
222084
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221733
222085
|
});
|
|
@@ -221772,7 +222124,7 @@ var init_creationComposerController = __esm({
|
|
|
221772
222124
|
}
|
|
221773
222125
|
});
|
|
221774
222126
|
}
|
|
221775
|
-
|
|
222127
|
+
logger3.warn("agent_view_creation_draft_exit_persist_failed", {
|
|
221776
222128
|
clientThreadId: composer.draftId,
|
|
221777
222129
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221778
222130
|
});
|
|
@@ -221865,7 +222217,7 @@ var init_creationComposerController = __esm({
|
|
|
221865
222217
|
});
|
|
221866
222218
|
this.creationReturnSelectionKey = null;
|
|
221867
222219
|
this.prewarmedCreationDraftIds.delete(composer.draftId);
|
|
221868
|
-
|
|
222220
|
+
logger3.info("agent_view_creation_submit_accepted", {
|
|
221869
222221
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
221870
222222
|
clientThreadId: composer.draftId,
|
|
221871
222223
|
attemptId,
|
|
@@ -221884,13 +222236,13 @@ var init_creationComposerController = __esm({
|
|
|
221884
222236
|
attemptId
|
|
221885
222237
|
}).then((result) => {
|
|
221886
222238
|
assertContractVersion3(result, "Thread start kickoff");
|
|
221887
|
-
|
|
222239
|
+
logger3.info("agent_view_creation_kickoff_completed", {
|
|
221888
222240
|
clientThreadId: composer.draftId,
|
|
221889
222241
|
attemptId,
|
|
221890
222242
|
skipped: result.skipped
|
|
221891
222243
|
});
|
|
221892
222244
|
}).catch((error55) => {
|
|
221893
|
-
|
|
222245
|
+
logger3.warn("agent_view_creation_kickoff_failed", {
|
|
221894
222246
|
clientThreadId: composer.draftId,
|
|
221895
222247
|
attemptId,
|
|
221896
222248
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -221941,7 +222293,7 @@ var init_creationComposerController = __esm({
|
|
|
221941
222293
|
recovered = true;
|
|
221942
222294
|
}
|
|
221943
222295
|
} catch (statusError) {
|
|
221944
|
-
|
|
222296
|
+
logger3.warn("agent_view_creation_submit_status_failed", {
|
|
221945
222297
|
clientThreadId: composer.draftId,
|
|
221946
222298
|
error: statusError instanceof Error ? statusError.message : String(statusError)
|
|
221947
222299
|
});
|
|
@@ -221959,7 +222311,7 @@ var init_creationComposerController = __esm({
|
|
|
221959
222311
|
}
|
|
221960
222312
|
});
|
|
221961
222313
|
}
|
|
221962
|
-
|
|
222314
|
+
logger3.warn("agent_view_creation_submit_failed", {
|
|
221963
222315
|
clientThreadId: composer.draftId,
|
|
221964
222316
|
backend: composer.backend,
|
|
221965
222317
|
model: composer.executionSelection.model,
|
|
@@ -221975,7 +222327,7 @@ var init_creationComposerController = __esm({
|
|
|
221975
222327
|
return;
|
|
221976
222328
|
}
|
|
221977
222329
|
this.prewarmedCreationDraftIds.add(clientThreadId);
|
|
221978
|
-
|
|
222330
|
+
logger3.info("agent_view_creation_prewarm_started", {
|
|
221979
222331
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
221980
222332
|
clientThreadId
|
|
221981
222333
|
});
|
|
@@ -221984,13 +222336,13 @@ var init_creationComposerController = __esm({
|
|
|
221984
222336
|
clientThreadId
|
|
221985
222337
|
}).then((result) => {
|
|
221986
222338
|
assertContractVersion3(result, "Thread draft prewarm");
|
|
221987
|
-
|
|
222339
|
+
logger3.info("agent_view_creation_prewarm_completed", {
|
|
221988
222340
|
clientThreadId,
|
|
221989
222341
|
status: result.status
|
|
221990
222342
|
});
|
|
221991
222343
|
}).catch((error55) => {
|
|
221992
222344
|
this.prewarmedCreationDraftIds.delete(clientThreadId);
|
|
221993
|
-
|
|
222345
|
+
logger3.warn("agent_view_creation_prewarm_failed", {
|
|
221994
222346
|
clientThreadId,
|
|
221995
222347
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221996
222348
|
});
|
|
@@ -223349,7 +223701,7 @@ var init_metadataActionController = __esm({
|
|
|
223349
223701
|
statusMessage: `${result.pinned ? "Pinned" : "Unpinned"} \u201C${target.currentTitle}\u201D.`,
|
|
223350
223702
|
statusTone: "neutral"
|
|
223351
223703
|
});
|
|
223352
|
-
|
|
223704
|
+
logger3.info("agent_view_thread_pin_completed", {
|
|
223353
223705
|
clientThreadId: target.clientThreadId,
|
|
223354
223706
|
pinned: result.pinned
|
|
223355
223707
|
});
|
|
@@ -223359,7 +223711,7 @@ var init_metadataActionController = __esm({
|
|
|
223359
223711
|
statusMessage: genericFailureCopy("pin"),
|
|
223360
223712
|
statusTone: "error"
|
|
223361
223713
|
});
|
|
223362
|
-
|
|
223714
|
+
logger3.warn("agent_view_thread_pin_failed", {
|
|
223363
223715
|
clientThreadId: target.clientThreadId,
|
|
223364
223716
|
expectedPinned: !target.isPinned,
|
|
223365
223717
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -223405,7 +223757,7 @@ var init_metadataActionController = __esm({
|
|
|
223405
223757
|
statusMessage: genericFailureCopy("rename"),
|
|
223406
223758
|
statusTone: "error"
|
|
223407
223759
|
});
|
|
223408
|
-
|
|
223760
|
+
logger3.warn("agent_view_thread_rename_open_failed", {
|
|
223409
223761
|
clientThreadId: target.clientThreadId,
|
|
223410
223762
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
223411
223763
|
});
|
|
@@ -223470,7 +223822,7 @@ var init_metadataActionController = __esm({
|
|
|
223470
223822
|
statusMessage: result2.devboxName === null ? "Using the first thread\u2019s title for this devbox." : `Renamed devbox to \u201C${result2.devboxName}\u201D.`,
|
|
223471
223823
|
statusTone: "neutral"
|
|
223472
223824
|
});
|
|
223473
|
-
|
|
223825
|
+
logger3.info("agent_view_devbox_rename_completed", {
|
|
223474
223826
|
placementId: subject.placementId,
|
|
223475
223827
|
cleared: result2.devboxName === null
|
|
223476
223828
|
});
|
|
@@ -223493,7 +223845,7 @@ var init_metadataActionController = __esm({
|
|
|
223493
223845
|
statusMessage: result.automaticTitle ? "Using the automatic title for this thread." : `Renamed thread to \u201C${result.title}\u201D.`,
|
|
223494
223846
|
statusTone: "neutral"
|
|
223495
223847
|
});
|
|
223496
|
-
|
|
223848
|
+
logger3.info("agent_view_thread_rename_completed", {
|
|
223497
223849
|
clientThreadId: modal.target.clientThreadId,
|
|
223498
223850
|
automaticTitle: result.automaticTitle
|
|
223499
223851
|
});
|
|
@@ -223510,7 +223862,7 @@ var init_metadataActionController = __esm({
|
|
|
223510
223862
|
),
|
|
223511
223863
|
statusTone: "error"
|
|
223512
223864
|
});
|
|
223513
|
-
|
|
223865
|
+
logger3.warn(
|
|
223514
223866
|
subject.kind === "devbox" ? "agent_view_devbox_rename_failed" : "agent_view_thread_rename_failed",
|
|
223515
223867
|
{
|
|
223516
223868
|
clientThreadId: modal.target.clientThreadId,
|
|
@@ -223641,7 +223993,7 @@ var init_metadataActionController = __esm({
|
|
|
223641
223993
|
statusMessage: coldRestoreDestination ? `Restored \u201C${target.currentTitle}\u201D to ${coldRestoreDestination === "new_devbox" ? "a new devbox" : "the Template box"}.` : `${result.archived ? "Archived" : "Unarchived"} \u201C${target.currentTitle}\u201D.`,
|
|
223642
223994
|
statusTone: "neutral"
|
|
223643
223995
|
});
|
|
223644
|
-
|
|
223996
|
+
logger3.info("agent_view_thread_archive_completed", {
|
|
223645
223997
|
clientThreadId: target.clientThreadId,
|
|
223646
223998
|
backend: target.backend,
|
|
223647
223999
|
archived: result.archived,
|
|
@@ -223656,7 +224008,7 @@ var init_metadataActionController = __esm({
|
|
|
223656
224008
|
statusMessage: capability ? `This ${targetLabel} needs a boxes.dev service update before Codex threads can be ${operation === "archive" ? "archived" : "unarchived"} here.` : genericFailureCopy(operation),
|
|
223657
224009
|
statusTone: "error"
|
|
223658
224010
|
});
|
|
223659
|
-
|
|
224011
|
+
logger3.warn("agent_view_thread_archive_failed", {
|
|
223660
224012
|
clientThreadId: target.clientThreadId,
|
|
223661
224013
|
backend: target.backend,
|
|
223662
224014
|
operation,
|
|
@@ -224580,7 +224932,7 @@ var init_controller = __esm({
|
|
|
224580
224932
|
};
|
|
224581
224933
|
this.syncTrackedCreationsSnapshot();
|
|
224582
224934
|
this.emit();
|
|
224583
|
-
|
|
224935
|
+
logger3.info("agent_view_creation_progress", {
|
|
224584
224936
|
clientThreadId: args.clientThreadId,
|
|
224585
224937
|
attemptId: args.attemptId,
|
|
224586
224938
|
state: status.state,
|
|
@@ -224597,7 +224949,7 @@ var init_controller = __esm({
|
|
|
224597
224949
|
},
|
|
224598
224950
|
(error55) => {
|
|
224599
224951
|
if (!this.stopped) {
|
|
224600
|
-
|
|
224952
|
+
logger3.warn("agent_view_creation_subscription_failed", {
|
|
224601
224953
|
clientThreadId: args.clientThreadId,
|
|
224602
224954
|
attemptId: args.attemptId,
|
|
224603
224955
|
error: error55.message
|
|
@@ -224611,7 +224963,7 @@ var init_controller = __esm({
|
|
|
224611
224963
|
creation.unsubscribe();
|
|
224612
224964
|
this.trackedCreations.delete(creation.clientThreadId);
|
|
224613
224965
|
this.syncTrackedCreationsSnapshot();
|
|
224614
|
-
|
|
224966
|
+
logger3.info("agent_view_creation_unsubscribed", {
|
|
224615
224967
|
clientThreadId: creation.clientThreadId,
|
|
224616
224968
|
attemptId: creation.attemptId,
|
|
224617
224969
|
state: creation.status?.state ?? null
|
|
@@ -224886,7 +225238,7 @@ var init_controller = __esm({
|
|
|
224886
225238
|
nextMessage = outcome.detail;
|
|
224887
225239
|
nextTone = "error";
|
|
224888
225240
|
}
|
|
224889
|
-
|
|
225241
|
+
logger3.info("agent_view_codex_empty_tui_completed", {
|
|
224890
225242
|
alias: resolved.target.alias,
|
|
224891
225243
|
clientThreadId: action.clientThreadId,
|
|
224892
225244
|
startupAttemptId: String(status.attemptId),
|
|
@@ -224895,7 +225247,7 @@ var init_controller = __esm({
|
|
|
224895
225247
|
} catch (error55) {
|
|
224896
225248
|
nextMessage = error55 instanceof Error ? error55.message : "Codex couldn't open in terminal.";
|
|
224897
225249
|
nextTone = "error";
|
|
224898
|
-
|
|
225250
|
+
logger3.warn("agent_view_codex_empty_tui_failed", {
|
|
224899
225251
|
clientThreadId: action.clientThreadId,
|
|
224900
225252
|
startupAttemptId: action.attemptId,
|
|
224901
225253
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -224982,7 +225334,7 @@ var init_controller = __esm({
|
|
|
224982
225334
|
} else {
|
|
224983
225335
|
this.syncTrackedCreationsSnapshot();
|
|
224984
225336
|
}
|
|
224985
|
-
|
|
225337
|
+
logger3.info("agent_view_creation_auto_open_replaced_by_manual_open", {
|
|
224986
225338
|
clientThreadId: creation.clientThreadId,
|
|
224987
225339
|
attemptId: creation.attemptId
|
|
224988
225340
|
});
|
|
@@ -225104,7 +225456,7 @@ var init_controller = __esm({
|
|
|
225104
225456
|
nextMessage = outcome.detail;
|
|
225105
225457
|
nextTone = "error";
|
|
225106
225458
|
}
|
|
225107
|
-
|
|
225459
|
+
logger3.info("agent_view_claude_empty_tui_completed", {
|
|
225108
225460
|
alias: resolved.target.alias,
|
|
225109
225461
|
clientThreadId: action.clientThreadId,
|
|
225110
225462
|
startupAttemptId: String(status.attemptId),
|
|
@@ -225122,7 +225474,7 @@ var init_controller = __esm({
|
|
|
225122
225474
|
nextMessage = error55 instanceof Error ? error55.message : "Claude couldn't open in terminal.";
|
|
225123
225475
|
nextTone = "error";
|
|
225124
225476
|
}
|
|
225125
|
-
|
|
225477
|
+
logger3.warn("agent_view_claude_empty_tui_failed", {
|
|
225126
225478
|
clientThreadId: action.clientThreadId,
|
|
225127
225479
|
startupAttemptId: action.attemptId,
|
|
225128
225480
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -225232,7 +225584,7 @@ var init_controller = __esm({
|
|
|
225232
225584
|
};
|
|
225233
225585
|
}
|
|
225234
225586
|
}
|
|
225235
|
-
|
|
225587
|
+
logger3.info("agent_view_claude_tui_completed", {
|
|
225236
225588
|
alias: resolved.target.alias,
|
|
225237
225589
|
clientThreadId: action.clientThreadId,
|
|
225238
225590
|
threadId: action.backendThreadId,
|
|
@@ -225254,7 +225606,7 @@ var init_controller = __esm({
|
|
|
225254
225606
|
nextMessage = "Claude couldn't open in terminal. Review the latest status and try again.";
|
|
225255
225607
|
nextTone = "error";
|
|
225256
225608
|
}
|
|
225257
|
-
|
|
225609
|
+
logger3.warn("agent_view_claude_tui_failed", {
|
|
225258
225610
|
clientThreadId: action.clientThreadId,
|
|
225259
225611
|
threadId: action.backendThreadId,
|
|
225260
225612
|
status: "error",
|
|
@@ -225304,7 +225656,7 @@ var init_controller = __esm({
|
|
|
225304
225656
|
throw new Error("Resolved machine target did not match the selection.");
|
|
225305
225657
|
}
|
|
225306
225658
|
const boxLabel2 = resolved.target.role === "primary" ? "Template box" : "devbox";
|
|
225307
|
-
|
|
225659
|
+
logger3.info("agent_view_native_target_resolved", {
|
|
225308
225660
|
alias: resolved.target.alias,
|
|
225309
225661
|
requestType: "codex_tui_open",
|
|
225310
225662
|
primaryInstanceId: resolved.target.primaryInstanceId,
|
|
@@ -225321,7 +225673,7 @@ var init_controller = __esm({
|
|
|
225321
225673
|
threadId: action.backendThreadId,
|
|
225322
225674
|
sessionPath: action.sessionPath,
|
|
225323
225675
|
onStage: (message) => {
|
|
225324
|
-
|
|
225676
|
+
logger3.info("agent_view_codex_renderer_stage", {
|
|
225325
225677
|
alias: resolved.target.alias,
|
|
225326
225678
|
clientThreadId: action.clientThreadId,
|
|
225327
225679
|
status: "pending",
|
|
@@ -225351,7 +225703,7 @@ var init_controller = __esm({
|
|
|
225351
225703
|
const formatted = formatCodexOutcome({ outcome, boxLabel: boxLabel2 });
|
|
225352
225704
|
nextMessage = markViewedFailed ? `${formatted.message} Its unread status could not be updated.` : formatted.message;
|
|
225353
225705
|
nextTone = formatted.tone;
|
|
225354
|
-
|
|
225706
|
+
logger3.info("agent_view_codex_renderer_completed", {
|
|
225355
225707
|
alias: resolved.target.alias,
|
|
225356
225708
|
clientThreadId: action.clientThreadId,
|
|
225357
225709
|
threadId: action.backendThreadId,
|
|
@@ -225373,7 +225725,7 @@ var init_controller = __esm({
|
|
|
225373
225725
|
nextMessage = "Codex couldn't open. Review the latest status and try again.";
|
|
225374
225726
|
nextTone = "error";
|
|
225375
225727
|
}
|
|
225376
|
-
|
|
225728
|
+
logger3.warn("agent_view_codex_renderer_failed", {
|
|
225377
225729
|
clientThreadId: action.clientThreadId,
|
|
225378
225730
|
threadId: action.backendThreadId,
|
|
225379
225731
|
status: "error",
|
|
@@ -225534,7 +225886,7 @@ var init_controller = __esm({
|
|
|
225534
225886
|
if (resolvedTarget.primaryInstanceId !== shell.primaryInstanceId || resolvedTarget.executionInstanceId !== shell.executionInstanceId || resolvedTarget.computeProvider !== "e2b") {
|
|
225535
225887
|
throw new Error("Resolved machine target did not match the selection.");
|
|
225536
225888
|
}
|
|
225537
|
-
|
|
225889
|
+
logger3.info("agent_view_shell_target_resolved", {
|
|
225538
225890
|
alias: resolvedTarget.alias,
|
|
225539
225891
|
requestType: "shell",
|
|
225540
225892
|
primaryInstanceId: resolvedTarget.primaryInstanceId,
|
|
@@ -225569,7 +225921,7 @@ var init_controller = __esm({
|
|
|
225569
225921
|
}
|
|
225570
225922
|
});
|
|
225571
225923
|
nextMessage = formatShellOutcome(outcome, shell.targetRole);
|
|
225572
|
-
|
|
225924
|
+
logger3.info("agent_view_shell_completed", {
|
|
225573
225925
|
alias: resolvedTarget.alias,
|
|
225574
225926
|
requestType: "shell",
|
|
225575
225927
|
status: outcome.kind
|
|
@@ -225664,7 +226016,7 @@ var init_controller = __esm({
|
|
|
225664
226016
|
if (this.pendingShellPreconnect === pending) {
|
|
225665
226017
|
this.pendingShellPreconnect = null;
|
|
225666
226018
|
}
|
|
225667
|
-
|
|
226019
|
+
logger3.debug("agent_view_shell_preconnect_failed", {
|
|
225668
226020
|
alias: resolvedTarget.alias,
|
|
225669
226021
|
executionInstanceId: resolvedTarget.executionInstanceId,
|
|
225670
226022
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -225683,14 +226035,14 @@ var init_controller = __esm({
|
|
|
225683
226035
|
}
|
|
225684
226036
|
this.shellPreconnect = { key, handle };
|
|
225685
226037
|
void handle.ready.catch((error55) => {
|
|
225686
|
-
|
|
226038
|
+
logger3.debug("agent_view_shell_preconnect_failed", {
|
|
225687
226039
|
alias: resolvedTarget.alias,
|
|
225688
226040
|
executionInstanceId: resolvedTarget.executionInstanceId,
|
|
225689
226041
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
225690
226042
|
});
|
|
225691
226043
|
});
|
|
225692
226044
|
} catch (error55) {
|
|
225693
|
-
|
|
226045
|
+
logger3.debug("agent_view_shell_preconnect_failed", {
|
|
225694
226046
|
alias: resolvedTarget.alias,
|
|
225695
226047
|
executionInstanceId: resolvedTarget.executionInstanceId,
|
|
225696
226048
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -230156,7 +230508,7 @@ var init_tmuxWorkspace = __esm({
|
|
|
230156
230508
|
"Agent workspace initial focus"
|
|
230157
230509
|
);
|
|
230158
230510
|
await applyAgentWorkspaceLayout({ config: config5, tmuxCommand, runner });
|
|
230159
|
-
|
|
230511
|
+
logger3.info("agent_view_workspace_started", {
|
|
230160
230512
|
workspaceSessionId: created.sessionId,
|
|
230161
230513
|
projectFingerprint: project.projectFingerprint,
|
|
230162
230514
|
tmuxVersion: `${String(version4.major)}.${String(version4.minor)}`,
|
|
@@ -230840,7 +231192,7 @@ var init_workspaceActionClient = __esm({
|
|
|
230840
231192
|
}
|
|
230841
231193
|
if (message.type === "result") {
|
|
230842
231194
|
await restoreSidebar().catch((error55) => {
|
|
230843
|
-
|
|
231195
|
+
logger3.warn("agent_view_workspace_restore_failed", {
|
|
230844
231196
|
workspaceSessionId: this.config.sessionId,
|
|
230845
231197
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
230846
231198
|
});
|
|
@@ -231396,7 +231748,7 @@ var init_runAgentView = __esm({
|
|
|
231396
231748
|
const resolveLocalService = createConnectLocalServiceResolver();
|
|
231397
231749
|
if (workspaceClient === null) {
|
|
231398
231750
|
void resolveLocalService().catch((error55) => {
|
|
231399
|
-
|
|
231751
|
+
logger3.debug("agent_view_local_service_prewarm_failed", {
|
|
231400
231752
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
231401
231753
|
});
|
|
231402
231754
|
});
|
|
@@ -231617,7 +231969,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231617
231969
|
createDetailRuntime = async () => {
|
|
231618
231970
|
const resolveLocalService = createConnectLocalServiceResolver();
|
|
231619
231971
|
void resolveLocalService().catch((error55) => {
|
|
231620
|
-
|
|
231972
|
+
logger3.debug("agent_view_local_service_prewarm_failed", {
|
|
231621
231973
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
231622
231974
|
});
|
|
231623
231975
|
});
|
|
@@ -231745,7 +232097,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231745
232097
|
return runtime;
|
|
231746
232098
|
});
|
|
231747
232099
|
void getRuntime().catch((error55) => {
|
|
231748
|
-
|
|
232100
|
+
logger3.debug("agent_view_workspace_detail_runtime_prewarm_failed", {
|
|
231749
232101
|
workspaceSessionId: resolvedConfig.sessionId,
|
|
231750
232102
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
231751
232103
|
});
|
|
@@ -231757,7 +232109,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231757
232109
|
const server = createServer3((socket) => {
|
|
231758
232110
|
socket.setEncoding("utf8");
|
|
231759
232111
|
socket.on("error", (error55) => {
|
|
231760
|
-
|
|
232112
|
+
logger3.warn("agent_view_workspace_detail_socket_error", {
|
|
231761
232113
|
workspaceSessionId: resolvedConfig.sessionId,
|
|
231762
232114
|
error: error55.message
|
|
231763
232115
|
});
|
|
@@ -231909,7 +232261,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231909
232261
|
});
|
|
231910
232262
|
await chmod2(resolvedConfig.actionSocketPath, 384);
|
|
231911
232263
|
renderPlaceholder();
|
|
231912
|
-
|
|
232264
|
+
logger3.info("agent_view_workspace_detail_ready", {
|
|
231913
232265
|
workspaceSessionId: resolvedConfig.sessionId,
|
|
231914
232266
|
status: "ready"
|
|
231915
232267
|
});
|
|
@@ -232046,6 +232398,7 @@ var init_threads = __esm({
|
|
|
232046
232398
|
includeProjectAnchor,
|
|
232047
232399
|
window: window2,
|
|
232048
232400
|
automationThreads,
|
|
232401
|
+
pendingInputs,
|
|
232049
232402
|
section,
|
|
232050
232403
|
includeArchived
|
|
232051
232404
|
}) => {
|
|
@@ -232090,12 +232443,26 @@ var init_threads = __esm({
|
|
|
232090
232443
|
) : []
|
|
232091
232444
|
];
|
|
232092
232445
|
const seen = /* @__PURE__ */ new Set();
|
|
232446
|
+
const pendingInputByThreadId = new Map(
|
|
232447
|
+
pendingInputs.map((entry) => [entry.clientThreadId, entry.pendingInput])
|
|
232448
|
+
);
|
|
232093
232449
|
return rows.filter((thread) => {
|
|
232094
232450
|
if (seen.has(thread.clientThreadId)) {
|
|
232095
232451
|
return false;
|
|
232096
232452
|
}
|
|
232097
232453
|
seen.add(thread.clientThreadId);
|
|
232098
232454
|
return true;
|
|
232455
|
+
}).map((thread) => {
|
|
232456
|
+
const pendingInput = pendingInputByThreadId.get(thread.clientThreadId) ?? null;
|
|
232457
|
+
return {
|
|
232458
|
+
...thread,
|
|
232459
|
+
status: resolveThreadStatusWithPendingInput(
|
|
232460
|
+
thread.status,
|
|
232461
|
+
thread.activeTurnId,
|
|
232462
|
+
pendingInput
|
|
232463
|
+
),
|
|
232464
|
+
pendingInput
|
|
232465
|
+
};
|
|
232099
232466
|
});
|
|
232100
232467
|
};
|
|
232101
232468
|
listCliAgentToolThreads = async ({
|
|
@@ -232124,6 +232491,7 @@ var init_threads = __esm({
|
|
|
232124
232491
|
includeProjectAnchor: project.kind !== "team_template_managed",
|
|
232125
232492
|
window: pageResult.page,
|
|
232126
232493
|
automationThreads: pageResult.automationThreads,
|
|
232494
|
+
pendingInputs: pageResult.pendingInputs ?? [],
|
|
232127
232495
|
section: decoded.bucket,
|
|
232128
232496
|
includeArchived
|
|
232129
232497
|
});
|
|
@@ -232160,6 +232528,7 @@ var init_threads = __esm({
|
|
|
232160
232528
|
includeProjectAnchor: project.kind !== "team_template_managed",
|
|
232161
232529
|
window: liveResult.window,
|
|
232162
232530
|
automationThreads: liveResult.automationThreads,
|
|
232531
|
+
pendingInputs: liveResult.pendingInputs ?? [],
|
|
232163
232532
|
section: "live",
|
|
232164
232533
|
includeArchived
|
|
232165
232534
|
});
|
|
@@ -232215,6 +232584,9 @@ var init_threads = __esm({
|
|
|
232215
232584
|
includeProjectAnchor: project.kind !== "team_template_managed",
|
|
232216
232585
|
window: window2,
|
|
232217
232586
|
automationThreads,
|
|
232587
|
+
pendingInputs: [liveResult, ...recentPages, ...archivedPages].flatMap(
|
|
232588
|
+
(result) => result.pendingInputs ?? []
|
|
232589
|
+
),
|
|
232218
232590
|
section: "all",
|
|
232219
232591
|
includeArchived
|
|
232220
232592
|
});
|
|
@@ -232335,6 +232707,60 @@ var init_resourceOutput = __esm({
|
|
|
232335
232707
|
}
|
|
232336
232708
|
});
|
|
232337
232709
|
|
|
232710
|
+
// src/devbox/commands/pendingInputText.ts
|
|
232711
|
+
var pendingInputLead, renderPendingInputLines, renderPendingInput;
|
|
232712
|
+
var init_pendingInputText = __esm({
|
|
232713
|
+
"src/devbox/commands/pendingInputText.ts"() {
|
|
232714
|
+
"use strict";
|
|
232715
|
+
pendingInputLead = (input) => {
|
|
232716
|
+
const owner = input.owner.name ?? "the thread's owner";
|
|
232717
|
+
switch (input.kind) {
|
|
232718
|
+
case "access_request":
|
|
232719
|
+
return `Waiting for ${owner} to answer: ${input.prompt}`;
|
|
232720
|
+
case "unknown":
|
|
232721
|
+
return `Waiting for ${owner} to respond.`;
|
|
232722
|
+
case "tool_permission":
|
|
232723
|
+
return `Waiting for ${owner} to allow or deny this request:`;
|
|
232724
|
+
case "question":
|
|
232725
|
+
return `Waiting for ${owner} to answer:`;
|
|
232726
|
+
}
|
|
232727
|
+
};
|
|
232728
|
+
renderPendingInputLines = (input) => {
|
|
232729
|
+
const lead = pendingInputLead(input);
|
|
232730
|
+
const first = input.kind === "access_request" ? void 0 : input.questions[0]?.question.replace(/\s+/g, " ").trim();
|
|
232731
|
+
const count = input.kind !== "access_request" && input.questionCount > 1 ? ` (1 of ${String(input.questionCount)} questions)` : "";
|
|
232732
|
+
const ending = input.truncated ? "\u2026" : "";
|
|
232733
|
+
return [
|
|
232734
|
+
` ${lead}${first ? ` ${first}${ending}${count}` : ""}`,
|
|
232735
|
+
...input.threadUrl === null ? [] : [` Thread: ${input.threadUrl}`]
|
|
232736
|
+
];
|
|
232737
|
+
};
|
|
232738
|
+
renderPendingInput = (input) => {
|
|
232739
|
+
const blocks = [
|
|
232740
|
+
input.kind === "unknown" ? `${pendingInputLead(input)} The details aren't available here.` : pendingInputLead(input)
|
|
232741
|
+
];
|
|
232742
|
+
if (input.kind !== "access_request") {
|
|
232743
|
+
for (const entry of input.questions) {
|
|
232744
|
+
const options = entry.options.map(
|
|
232745
|
+
(option) => `- ${option.label}${option.description ? `: ${option.description}` : ""}`
|
|
232746
|
+
);
|
|
232747
|
+
const prompt = entry.header ? `${entry.header}: ${entry.question}` : entry.question;
|
|
232748
|
+
blocks.push([prompt, ...options].join("\n"));
|
|
232749
|
+
}
|
|
232750
|
+
}
|
|
232751
|
+
if (input.truncated) {
|
|
232752
|
+
blocks.push(
|
|
232753
|
+
"Some of this text was shortened. Open the thread to read all of it."
|
|
232754
|
+
);
|
|
232755
|
+
}
|
|
232756
|
+
if (input.threadUrl !== null) {
|
|
232757
|
+
blocks.push(`Thread: ${input.threadUrl}`);
|
|
232758
|
+
}
|
|
232759
|
+
return blocks.join("\n\n");
|
|
232760
|
+
};
|
|
232761
|
+
}
|
|
232762
|
+
});
|
|
232763
|
+
|
|
232338
232764
|
// src/devbox/commands/resourceArgs.ts
|
|
232339
232765
|
var parseResourceListArgs;
|
|
232340
232766
|
var init_resourceArgs = __esm({
|
|
@@ -232437,13 +232863,15 @@ var init_threads2 = __esm({
|
|
|
232437
232863
|
"use strict";
|
|
232438
232864
|
init_threads();
|
|
232439
232865
|
init_queryRefs();
|
|
232866
|
+
init_pendingInputText();
|
|
232440
232867
|
init_resourceArgs();
|
|
232441
232868
|
init_resourceNextAction();
|
|
232442
232869
|
init_resourceOutput();
|
|
232443
232870
|
renderCliAgentToolThreads = (data) => data.threads.length === 0 ? `No agent threads found for ${data.project.name}.` : [
|
|
232444
|
-
...data.threads.
|
|
232445
|
-
|
|
232446
|
-
|
|
232871
|
+
...data.threads.flatMap((thread) => [
|
|
232872
|
+
`${thread.clientThreadId} ${thread.agent} ${thread.status} ${thread.title}`,
|
|
232873
|
+
...thread.pendingInput ? renderPendingInputLines(thread.pendingInput) : []
|
|
232874
|
+
]),
|
|
232447
232875
|
...data.pagination.nextCursor ? [
|
|
232448
232876
|
`More threads are available. Continue with --cursor ${data.pagination.nextCursor}`
|
|
232449
232877
|
] : []
|
|
@@ -234486,7 +234914,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234486
234914
|
const socketInfo = resolveSocketInfo();
|
|
234487
234915
|
const statusEnabled = process.stderr.isTTY && !parsed.json;
|
|
234488
234916
|
const status = createStatusLine({ enabled: statusEnabled });
|
|
234489
|
-
|
|
234917
|
+
logger3.info("ide_setup_start", {
|
|
234490
234918
|
box: parsed.box ?? null,
|
|
234491
234919
|
all: parsed.all
|
|
234492
234920
|
});
|
|
@@ -234565,7 +234993,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234565
234993
|
status.stage("Writing managed SSH config");
|
|
234566
234994
|
await writeManagedSshEntries(nextEntries.values(), sshOptions);
|
|
234567
234995
|
const ok = failures.length === 0;
|
|
234568
|
-
|
|
234996
|
+
logger3.info(ok ? "ide_setup_complete" : "ide_setup_failed", {
|
|
234569
234997
|
box: parsed.box ?? null,
|
|
234570
234998
|
all: parsed.all,
|
|
234571
234999
|
successes: successes.length,
|
|
@@ -234603,7 +235031,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234603
235031
|
runIdeDoctor = async (args) => {
|
|
234604
235032
|
const parsed = parseDoctorArgs(args);
|
|
234605
235033
|
const socketInfo = resolveSocketInfo();
|
|
234606
|
-
|
|
235034
|
+
logger3.info("ide_doctor_start", {
|
|
234607
235035
|
box: parsed.box ?? null,
|
|
234608
235036
|
all: parsed.all,
|
|
234609
235037
|
editor: parsed.editor
|
|
@@ -234951,7 +235379,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234951
235379
|
});
|
|
234952
235380
|
}
|
|
234953
235381
|
const ok = results.every((result) => !hasErrors(result.findings));
|
|
234954
|
-
|
|
235382
|
+
logger3.info("ide_doctor_complete", {
|
|
234955
235383
|
box: parsed.box ?? null,
|
|
234956
235384
|
all: parsed.all,
|
|
234957
235385
|
editor: parsed.editor,
|
|
@@ -235036,7 +235464,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
235036
235464
|
runIdeOpen = async (args) => {
|
|
235037
235465
|
const parsed = parseOpenArgs(args);
|
|
235038
235466
|
const socketInfo = resolveSocketInfo();
|
|
235039
|
-
|
|
235467
|
+
logger3.info("ide_open_start", {
|
|
235040
235468
|
box: parsed.box,
|
|
235041
235469
|
editor: parsed.editor
|
|
235042
235470
|
});
|
|
@@ -235089,7 +235517,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
235089
235517
|
ideHint: parsed.ide
|
|
235090
235518
|
});
|
|
235091
235519
|
}
|
|
235092
|
-
|
|
235520
|
+
logger3.info("ide_open_complete", {
|
|
235093
235521
|
box: resolvedTarget.alias,
|
|
235094
235522
|
editor: parsed.editor,
|
|
235095
235523
|
remotePath
|
|
@@ -235117,7 +235545,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
235117
235545
|
throw new Error(IDE_USAGE);
|
|
235118
235546
|
} catch (error55) {
|
|
235119
235547
|
const event = subcommand === "setup" ? "ide_setup_failed" : subcommand === "doctor" ? "ide_doctor_complete" : "ide_open_failed";
|
|
235120
|
-
|
|
235548
|
+
logger3.warn(event, {
|
|
235121
235549
|
subcommand,
|
|
235122
235550
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
235123
235551
|
});
|
|
@@ -251903,7 +252331,7 @@ var init_progressReport = __esm({
|
|
|
251903
252331
|
folder = process.cwd(),
|
|
251904
252332
|
report = reportAgentInitStep,
|
|
251905
252333
|
step,
|
|
251906
|
-
warn: warn3 = (event, fields) =>
|
|
252334
|
+
warn: warn3 = (event, fields) => logger3.warn(event, fields)
|
|
251907
252335
|
}) => {
|
|
251908
252336
|
try {
|
|
251909
252337
|
const project = await resolveAgentInitReportProject(folder);
|
|
@@ -251938,14 +252366,14 @@ var init_progressReport = __esm({
|
|
|
251938
252366
|
await openAgentInitSecretStore()
|
|
251939
252367
|
);
|
|
251940
252368
|
} catch (error55) {
|
|
251941
|
-
|
|
252369
|
+
logger3.debug("agent_init_activity_report_skipped", {
|
|
251942
252370
|
command,
|
|
251943
252371
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
251944
252372
|
});
|
|
251945
252373
|
return;
|
|
251946
252374
|
}
|
|
251947
252375
|
if (controlPlaneToken === null) {
|
|
251948
|
-
|
|
252376
|
+
logger3.debug("agent_init_activity_report_skipped", {
|
|
251949
252377
|
command,
|
|
251950
252378
|
error: "no_unexpired_token"
|
|
251951
252379
|
});
|
|
@@ -251955,7 +252383,7 @@ var init_progressReport = __esm({
|
|
|
251955
252383
|
controlPlaneToken,
|
|
251956
252384
|
folder,
|
|
251957
252385
|
step: { command, outcome: "ok", phase: null },
|
|
251958
|
-
warn: (event, fields) =>
|
|
252386
|
+
warn: (event, fields) => logger3.debug(event, fields)
|
|
251959
252387
|
});
|
|
251960
252388
|
};
|
|
251961
252389
|
}
|
|
@@ -252274,7 +252702,7 @@ var init_codexSignIn = __esm({
|
|
|
252274
252702
|
kind: "redirect",
|
|
252275
252703
|
location: error55 ? returnTo.failed : returnTo.connected
|
|
252276
252704
|
}),
|
|
252277
|
-
onEvent: (event) =>
|
|
252705
|
+
onEvent: (event) => logger3.info("ChatGPT browser sign-in", event),
|
|
252278
252706
|
saveCredential,
|
|
252279
252707
|
signal
|
|
252280
252708
|
});
|
|
@@ -252656,7 +253084,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252656
253084
|
timeoutMs = CLAUDE_SETUP_REQUEST_TIMEOUT_MS
|
|
252657
253085
|
}) => {
|
|
252658
253086
|
const requestId2 = randomUUID26();
|
|
252659
|
-
|
|
253087
|
+
logger3.info("claude_setup_oauth_request", {
|
|
252660
253088
|
requestId: requestId2,
|
|
252661
253089
|
method,
|
|
252662
253090
|
host: url3.host,
|
|
@@ -252670,7 +253098,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252670
253098
|
method,
|
|
252671
253099
|
headers: Object.fromEntries(headers)
|
|
252672
253100
|
};
|
|
252673
|
-
const
|
|
253101
|
+
const sendRequest = () => new Promise((resolve3, reject) => {
|
|
252674
253102
|
const request2 = transport.request(options, (incoming) => {
|
|
252675
253103
|
const chunks = [];
|
|
252676
253104
|
incoming.on("data", (chunk2) => {
|
|
@@ -252699,7 +253127,8 @@ var init_claudeSetupOauth = __esm({
|
|
|
252699
253127
|
}
|
|
252700
253128
|
request2.end();
|
|
252701
253129
|
});
|
|
252702
|
-
|
|
253130
|
+
const response = await withSystemTrustRetry(sendRequest);
|
|
253131
|
+
logger3.info("claude_setup_oauth_response", {
|
|
252703
253132
|
requestId: requestId2,
|
|
252704
253133
|
method,
|
|
252705
253134
|
host: url3.host,
|
|
@@ -252877,7 +253306,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252877
253306
|
startClaudeSetupCallbackServerFn = startClaudeSetupCallbackServer,
|
|
252878
253307
|
exchangeClaudeSetupOauthCodeFn = exchangeClaudeSetupOauthCode
|
|
252879
253308
|
}) => {
|
|
252880
|
-
|
|
253309
|
+
logger3.info("claude_setup_oauth_flow_start", {
|
|
252881
253310
|
authorizeOrigin: discovery.authorizeOrigin,
|
|
252882
253311
|
claudeCliVersion
|
|
252883
253312
|
});
|
|
@@ -252975,7 +253404,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252975
253404
|
showCopyableUrlFn = showCopyableUrl,
|
|
252976
253405
|
exchangeClaudeSetupOauthCodeFn = exchangeClaudeSetupOauthCode
|
|
252977
253406
|
}) => {
|
|
252978
|
-
|
|
253407
|
+
logger3.info("claude_setup_oauth_flow_start", {
|
|
252979
253408
|
authorizeOrigin: discovery.authorizeOrigin,
|
|
252980
253409
|
claudeCliVersion
|
|
252981
253410
|
});
|
|
@@ -269505,7 +269934,7 @@ var init_config2 = __esm({
|
|
|
269505
269934
|
|
|
269506
269935
|
// src/devbox/commands/init/remote.ts
|
|
269507
269936
|
import { randomUUID as randomUUID28 } from "node:crypto";
|
|
269508
|
-
var MANAGED_DAEMON_NODE_PATH, BOOTSTRAP_EXEC_TIMEOUT_MS, STAGE_SETUP_ARTIFACTS_TIMEOUT_MS, BOOTSTRAP_EXEC_HANDSHAKE_TIMEOUT_MS, BASIC_ALIASES_MARKER, LEGACY_BASH_TRAP, SAFE_BASH_TRAP, BASH_HISTORY_BLOCK, ZSH_HISTORY_BLOCK, HISTORY_BLOCK_PATTERN, BASH_HISTORY_LINE_PATTERN, ZSH_HISTORY_LINE_PATTERN,
|
|
269937
|
+
var MANAGED_DAEMON_NODE_PATH, BOOTSTRAP_EXEC_TIMEOUT_MS, STAGE_SETUP_ARTIFACTS_TIMEOUT_MS, BOOTSTRAP_EXEC_HANDSHAKE_TIMEOUT_MS, BASIC_ALIASES_MARKER, LEGACY_BASH_TRAP, SAFE_BASH_TRAP, BASH_HISTORY_BLOCK, ZSH_HISTORY_BLOCK, HISTORY_BLOCK_PATTERN, BASH_HISTORY_LINE_PATTERN, ZSH_HISTORY_LINE_PATTERN, logger9, truncateTail, shellQuote6, buildDaemonPaths, resolveRemoteHomeDir2, expandHome2, execWithLog, writeRemoteFile, readRemoteFile2, ensureTrailingNewline, upsertHistoryBlock, patchBashrcContent, patchZshrcContent, bootstrapDevbox, patchRemoteRcFile, patchBashrc, patchZshrc, ensureRemoteCodexConfig, stageRemoteSetupArtifacts, ensureSpriteDaemonService;
|
|
269509
269938
|
var init_remote = __esm({
|
|
269510
269939
|
"src/devbox/commands/init/remote.ts"() {
|
|
269511
269940
|
"use strict";
|
|
@@ -269538,7 +269967,7 @@ var init_remote = __esm({
|
|
|
269538
269967
|
HISTORY_BLOCK_PATTERN = /^# History search with up\/down arrows\n[\s\S]*?(?=\n# Basic aliases|(?![\s\S]))/m;
|
|
269539
269968
|
BASH_HISTORY_LINE_PATTERN = /^.*history-search-(?:backward|forward).*$\n?/gm;
|
|
269540
269969
|
ZSH_HISTORY_LINE_PATTERN = /^.*history-search-end.*$\n?|^.*history-beginning-search-backward-end.*$\n?|^.*history-beginning-search-forward-end.*$\n?/gm;
|
|
269541
|
-
|
|
269970
|
+
logger9 = createLogger("devbox-init");
|
|
269542
269971
|
truncateTail = (value, maxChars) => {
|
|
269543
269972
|
if (value.length <= maxChars) return value;
|
|
269544
269973
|
const omitted = value.length - maxChars;
|
|
@@ -269585,7 +270014,7 @@ var init_remote = __esm({
|
|
|
269585
270014
|
execWithLog = async (client, spriteAlias, script, stage, options) => {
|
|
269586
270015
|
const requestId2 = randomUUID28();
|
|
269587
270016
|
const startedAt2 = Date.now();
|
|
269588
|
-
|
|
270017
|
+
logger9.info("sprites_request", {
|
|
269589
270018
|
requestId: requestId2,
|
|
269590
270019
|
method: "exec",
|
|
269591
270020
|
path: "/exec",
|
|
@@ -269598,7 +270027,7 @@ var init_remote = __esm({
|
|
|
269598
270027
|
options
|
|
269599
270028
|
);
|
|
269600
270029
|
const durationMs = Date.now() - startedAt2;
|
|
269601
|
-
|
|
270030
|
+
logger9.info("sprites_response", {
|
|
269602
270031
|
requestId: requestId2,
|
|
269603
270032
|
method: "exec",
|
|
269604
270033
|
path: "/exec",
|
|
@@ -269618,7 +270047,7 @@ var init_remote = __esm({
|
|
|
269618
270047
|
};
|
|
269619
270048
|
writeRemoteFile = async (client, spriteAlias, path108, content, stage) => {
|
|
269620
270049
|
const requestId2 = randomUUID28();
|
|
269621
|
-
|
|
270050
|
+
logger9.info("sprites_request", {
|
|
269622
270051
|
requestId: requestId2,
|
|
269623
270052
|
method: "writeFile",
|
|
269624
270053
|
path: path108,
|
|
@@ -269627,7 +270056,7 @@ var init_remote = __esm({
|
|
|
269627
270056
|
});
|
|
269628
270057
|
const buffer = typeof content === "string" ? Buffer.from(content, "utf8") : content;
|
|
269629
270058
|
await client.writeFile(spriteAlias, path108, buffer);
|
|
269630
|
-
|
|
270059
|
+
logger9.info("sprites_response", {
|
|
269631
270060
|
requestId: requestId2,
|
|
269632
270061
|
method: "writeFile",
|
|
269633
270062
|
path: path108,
|
|
@@ -269638,7 +270067,7 @@ var init_remote = __esm({
|
|
|
269638
270067
|
};
|
|
269639
270068
|
readRemoteFile2 = async (client, spriteAlias, path108, stage) => {
|
|
269640
270069
|
const requestId2 = randomUUID28();
|
|
269641
|
-
|
|
270070
|
+
logger9.info("sprites_request", {
|
|
269642
270071
|
requestId: requestId2,
|
|
269643
270072
|
method: "readFile",
|
|
269644
270073
|
path: path108,
|
|
@@ -269647,7 +270076,7 @@ var init_remote = __esm({
|
|
|
269647
270076
|
});
|
|
269648
270077
|
try {
|
|
269649
270078
|
const bytes = await client.readFile(spriteAlias, { path: path108 });
|
|
269650
|
-
|
|
270079
|
+
logger9.info("sprites_response", {
|
|
269651
270080
|
requestId: requestId2,
|
|
269652
270081
|
method: "readFile",
|
|
269653
270082
|
path: path108,
|
|
@@ -269659,7 +270088,7 @@ var init_remote = __esm({
|
|
|
269659
270088
|
return Buffer.from(bytes).toString("utf8");
|
|
269660
270089
|
} catch (error55) {
|
|
269661
270090
|
const notFound = error55 instanceof RuntimeApiError && error55.status === 404;
|
|
269662
|
-
|
|
270091
|
+
logger9.info("sprites_response", {
|
|
269663
270092
|
requestId: requestId2,
|
|
269664
270093
|
method: "readFile",
|
|
269665
270094
|
path: path108,
|
|
@@ -269797,7 +270226,7 @@ ${canonicalBlock}
|
|
|
269797
270226
|
`${options.errorLabel}-read`
|
|
269798
270227
|
);
|
|
269799
270228
|
if (existing === null) {
|
|
269800
|
-
|
|
270229
|
+
logger9.warn("init_rc_patch_skipped_missing_file", {
|
|
269801
270230
|
box: spriteAlias,
|
|
269802
270231
|
path: options.path,
|
|
269803
270232
|
rcFile: options.errorLabel
|
|
@@ -269911,7 +270340,7 @@ ${canonicalBlock}
|
|
|
269911
270340
|
const stagedIndexPath = `${stagedExternalDir}/index.json`;
|
|
269912
270341
|
const stagedDatabaseDumpDir = `${workdir.replace(/\/$/, "")}/.devbox/database-dumps`;
|
|
269913
270342
|
const stagedDatabaseDumpIndexPath = `${stagedDatabaseDumpDir}/database-dumps.json`;
|
|
269914
|
-
|
|
270343
|
+
logger9.info("init_setup_artifacts_stage_start", {
|
|
269915
270344
|
box: spriteAlias,
|
|
269916
270345
|
workdir,
|
|
269917
270346
|
hasArtifactsBundle: Boolean(artifactsBundlePath),
|
|
@@ -270085,7 +270514,7 @@ ${canonicalBlock}
|
|
|
270085
270514
|
details ? `staging setup artifacts failed: ${details}` : `staging setup artifacts failed (exit ${result.exitCode})`
|
|
270086
270515
|
);
|
|
270087
270516
|
}
|
|
270088
|
-
|
|
270517
|
+
logger9.info("init_setup_artifacts_stage_complete", {
|
|
270089
270518
|
box: spriteAlias,
|
|
270090
270519
|
workdir,
|
|
270091
270520
|
stageMarkers: stageMarkers.length > 0 ? stageMarkers : void 0
|
|
@@ -274234,7 +274663,7 @@ var init_artifacts = __esm({
|
|
|
274234
274663
|
await appendImplicitRepoAgentArtifacts({ repoRoot, entries });
|
|
274235
274664
|
const filteredEntries = filterGitCheckoutEntries(entries);
|
|
274236
274665
|
if (filteredEntries.length === 0) {
|
|
274237
|
-
|
|
274666
|
+
logger3.info("init_setup_artifacts_packaging_skipped", {
|
|
274238
274667
|
operationId,
|
|
274239
274668
|
reason: "no_entries"
|
|
274240
274669
|
});
|
|
@@ -274258,7 +274687,7 @@ var init_artifacts = __esm({
|
|
|
274258
274687
|
(sum, item) => sum + item.sizeBytes,
|
|
274259
274688
|
0
|
|
274260
274689
|
);
|
|
274261
|
-
|
|
274690
|
+
logger3.info("init_setup_artifacts_packaging_start", {
|
|
274262
274691
|
operationId,
|
|
274263
274692
|
entryCount: filteredEntries.length,
|
|
274264
274693
|
excludedGitCheckoutCount: entries.length - filteredEntries.length,
|
|
@@ -274277,7 +274706,7 @@ var init_artifacts = __esm({
|
|
|
274277
274706
|
totalBytes,
|
|
274278
274707
|
detail: `${entry.name} (${index + 1}/${preparedEntries.length})`
|
|
274279
274708
|
});
|
|
274280
|
-
|
|
274709
|
+
logger3.info("init_setup_artifacts_copy_start", {
|
|
274281
274710
|
operationId,
|
|
274282
274711
|
artifactIndex: index + 1,
|
|
274283
274712
|
artifactCount: filteredEntries.length,
|
|
@@ -274293,7 +274722,7 @@ var init_artifacts = __esm({
|
|
|
274293
274722
|
totalBytes,
|
|
274294
274723
|
detail: `${entry.name} (${index + 1}/${preparedEntries.length})`
|
|
274295
274724
|
});
|
|
274296
|
-
|
|
274725
|
+
logger3.info("init_setup_artifacts_copy_complete", {
|
|
274297
274726
|
operationId,
|
|
274298
274727
|
artifactIndex: index + 1,
|
|
274299
274728
|
artifactCount: filteredEntries.length,
|
|
@@ -274325,7 +274754,7 @@ var init_artifacts = __esm({
|
|
|
274325
274754
|
totalBytes,
|
|
274326
274755
|
detail: "creating archive"
|
|
274327
274756
|
});
|
|
274328
|
-
|
|
274757
|
+
logger3.info("init_setup_artifacts_archive_start", {
|
|
274329
274758
|
operationId,
|
|
274330
274759
|
entryCount: filteredEntries.length
|
|
274331
274760
|
});
|
|
@@ -274347,13 +274776,13 @@ var init_artifacts = __esm({
|
|
|
274347
274776
|
await fs63.copyFile(bundlePath, finalBundle);
|
|
274348
274777
|
await fs63.copyFile(manifestPath, finalManifest);
|
|
274349
274778
|
const finalBundleStat = await fs63.stat(finalBundle);
|
|
274350
|
-
|
|
274779
|
+
logger3.info("init_setup_artifacts_archive_complete", {
|
|
274351
274780
|
operationId,
|
|
274352
274781
|
bundleBytes: finalBundleStat.size,
|
|
274353
274782
|
durationMs: Date.now() - archiveStartedAt
|
|
274354
274783
|
});
|
|
274355
274784
|
if (finalBundleStat.size <= SETUP_ARTIFACT_PART_SIZE_BYTES) {
|
|
274356
|
-
|
|
274785
|
+
logger3.info("init_setup_artifacts_packaging_complete", {
|
|
274357
274786
|
operationId,
|
|
274358
274787
|
entryCount: filteredEntries.length,
|
|
274359
274788
|
bundleBytes: finalBundleStat.size,
|
|
@@ -274376,7 +274805,7 @@ var init_artifacts = __esm({
|
|
|
274376
274805
|
totalBytes,
|
|
274377
274806
|
detail: "splitting large bundle"
|
|
274378
274807
|
});
|
|
274379
|
-
|
|
274808
|
+
logger3.info("init_setup_artifacts_split_start", {
|
|
274380
274809
|
operationId,
|
|
274381
274810
|
bundleBytes: finalBundleStat.size,
|
|
274382
274811
|
partSizeBytes: SETUP_ARTIFACT_PART_SIZE_BYTES
|
|
@@ -274421,14 +274850,14 @@ var init_artifacts = __esm({
|
|
|
274421
274850
|
JSON.stringify(descriptor, null, 2),
|
|
274422
274851
|
"utf8"
|
|
274423
274852
|
);
|
|
274424
|
-
|
|
274853
|
+
logger3.info("init_setup_artifacts_split_complete", {
|
|
274425
274854
|
operationId,
|
|
274426
274855
|
bundleBytes: finalBundleStat.size,
|
|
274427
274856
|
partSizeBytes: SETUP_ARTIFACT_PART_SIZE_BYTES,
|
|
274428
274857
|
splitPartCount: parts.length,
|
|
274429
274858
|
durationMs: Date.now() - splitStartedAt
|
|
274430
274859
|
});
|
|
274431
|
-
|
|
274860
|
+
logger3.info("init_setup_artifacts_packaging_complete", {
|
|
274432
274861
|
operationId,
|
|
274433
274862
|
entryCount: filteredEntries.length,
|
|
274434
274863
|
bundleBytes: finalBundleStat.size,
|
|
@@ -275533,7 +275962,7 @@ ${execResult.stderr}`;
|
|
|
275533
275962
|
return;
|
|
275534
275963
|
}
|
|
275535
275964
|
activeThreadId = threadId2;
|
|
275536
|
-
|
|
275965
|
+
logger3.info("init_remote_codex_managed_thread_persisted", {
|
|
275537
275966
|
box: spriteAlias,
|
|
275538
275967
|
workdir: expandedWorkdir,
|
|
275539
275968
|
threadId: threadId2,
|
|
@@ -276162,7 +276591,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276162
276591
|
}) => {
|
|
276163
276592
|
const uploadOperationId = randomUUID31();
|
|
276164
276593
|
const uploadStartedAt = Date.now();
|
|
276165
|
-
|
|
276594
|
+
logger3.info("init_setup_artifacts_upload_start", {
|
|
276166
276595
|
operationId: uploadOperationId,
|
|
276167
276596
|
box: spriteAlias,
|
|
276168
276597
|
hasArtifactsBundle: Boolean(
|
|
@@ -276241,7 +276670,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276241
276670
|
expectedBundleSha: descriptor.bundleSha256,
|
|
276242
276671
|
parts
|
|
276243
276672
|
};
|
|
276244
|
-
|
|
276673
|
+
logger3.info("init_setup_artifacts_split_upload_prepared", {
|
|
276245
276674
|
operationId: uploadOperationId,
|
|
276246
276675
|
box: spriteAlias,
|
|
276247
276676
|
splitPartCount: parts.length,
|
|
@@ -276334,7 +276763,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276334
276763
|
})
|
|
276335
276764
|
);
|
|
276336
276765
|
const totalBytes = plannedUploads.reduce((sum, item) => sum + item.size, 0);
|
|
276337
|
-
|
|
276766
|
+
logger3.info("init_setup_artifacts_upload_plan", {
|
|
276338
276767
|
operationId: uploadOperationId,
|
|
276339
276768
|
box: spriteAlias,
|
|
276340
276769
|
fileCount: plannedUploads.length,
|
|
@@ -276356,7 +276785,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276356
276785
|
const detail = `${upload.label} (${index + 1}/${plannedUploads.length})`;
|
|
276357
276786
|
const fileData = await fs64.readFile(upload.localPath);
|
|
276358
276787
|
const fileStartedAt = Date.now();
|
|
276359
|
-
|
|
276788
|
+
logger3.info("init_setup_artifacts_upload_file_start", {
|
|
276360
276789
|
operationId: uploadOperationId,
|
|
276361
276790
|
box: spriteAlias,
|
|
276362
276791
|
fileIndex: index + 1,
|
|
@@ -276377,7 +276806,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276377
276806
|
});
|
|
276378
276807
|
uploadedBytes += fileData.length;
|
|
276379
276808
|
updateProgress(fileData.length, detail);
|
|
276380
|
-
|
|
276809
|
+
logger3.info("init_setup_artifacts_upload_file_complete", {
|
|
276381
276810
|
operationId: uploadOperationId,
|
|
276382
276811
|
box: spriteAlias,
|
|
276383
276812
|
fileIndex: index + 1,
|
|
@@ -276391,7 +276820,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276391
276820
|
if (splitArtifacts && remoteArtifactsBundlePath) {
|
|
276392
276821
|
status.stage("Assembling artifacts on remote");
|
|
276393
276822
|
const assembleStartedAt = Date.now();
|
|
276394
|
-
|
|
276823
|
+
logger3.info("init_setup_artifacts_remote_assemble_start", {
|
|
276395
276824
|
operationId: uploadOperationId,
|
|
276396
276825
|
box: spriteAlias,
|
|
276397
276826
|
splitPartCount: splitArtifacts.parts.length,
|
|
@@ -276459,7 +276888,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276459
276888
|
assembleResult.stderr || assembleResult.stdout || "Failed to assemble split setup artifacts on remote"
|
|
276460
276889
|
);
|
|
276461
276890
|
}
|
|
276462
|
-
|
|
276891
|
+
logger3.info("init_setup_artifacts_remote_assemble_complete", {
|
|
276463
276892
|
operationId: uploadOperationId,
|
|
276464
276893
|
box: spriteAlias,
|
|
276465
276894
|
splitPartCount: splitArtifacts.parts.length,
|
|
@@ -276474,7 +276903,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276474
276903
|
totalBytes,
|
|
276475
276904
|
detail: "completed"
|
|
276476
276905
|
});
|
|
276477
|
-
|
|
276906
|
+
logger3.info("init_setup_artifacts_upload_complete", {
|
|
276478
276907
|
operationId: uploadOperationId,
|
|
276479
276908
|
box: spriteAlias,
|
|
276480
276909
|
fileCount: plannedUploads.length,
|
|
@@ -276512,7 +276941,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276512
276941
|
}) => {
|
|
276513
276942
|
const handoffAfterRemoteStart = emitCodexOutput === false && completionArtifactsGraceMs === 0;
|
|
276514
276943
|
const hasManagedDaemonControl = typeof client.runDaemonControlRequest === "function";
|
|
276515
|
-
|
|
276944
|
+
logger3.info("init_remote_codex_branch_selected", {
|
|
276516
276945
|
box: spriteAlias,
|
|
276517
276946
|
workdir: expandedWorkdir,
|
|
276518
276947
|
computeProvider,
|
|
@@ -276614,7 +277043,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276614
277043
|
execSessionId
|
|
276615
277044
|
})
|
|
276616
277045
|
).catch((error55) => {
|
|
276617
|
-
|
|
277046
|
+
logger3.warn("init_remote_codex_running_hook_failed", {
|
|
276618
277047
|
box: spriteAlias,
|
|
276619
277048
|
workdir: expandedWorkdir,
|
|
276620
277049
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -281163,14 +281592,14 @@ var init_provisionFlow = __esm({
|
|
|
281163
281592
|
import fs71 from "node:fs/promises";
|
|
281164
281593
|
import { randomUUID as randomUUID33 } from "node:crypto";
|
|
281165
281594
|
import { spawn as spawn23 } from "node:child_process";
|
|
281166
|
-
var
|
|
281595
|
+
var logger10, SSH_IDENTITY_FILE, stripGitSuffix2, normalizeGitRemoteHost, buildSshUrl, buildSettingsUrl, parseScpLike, parseGitRemote, execRemote, readRemoteOrigin, setRemoteOrigin, ensureSshKey, ensureSshConfig, verifySshAuth, runClipboardCommand2, copyToClipboard;
|
|
281167
281596
|
var init_ssh = __esm({
|
|
281168
281597
|
"src/devbox/commands/init/ssh.ts"() {
|
|
281169
281598
|
"use strict";
|
|
281170
281599
|
init_devboxCore();
|
|
281171
281600
|
init_browser();
|
|
281172
281601
|
init_remote();
|
|
281173
|
-
|
|
281602
|
+
logger10 = createLogger("devbox-init");
|
|
281174
281603
|
SSH_IDENTITY_FILE = "~/.ssh/devbox_ed25519";
|
|
281175
281604
|
stripGitSuffix2 = (value) => {
|
|
281176
281605
|
let trimmed = value.trim();
|
|
@@ -281259,7 +281688,7 @@ var init_ssh = __esm({
|
|
|
281259
281688
|
};
|
|
281260
281689
|
execRemote = async (client, spriteAlias, script, stage) => {
|
|
281261
281690
|
const requestId2 = randomUUID33();
|
|
281262
|
-
|
|
281691
|
+
logger10.info("sprites_request", {
|
|
281263
281692
|
requestId: requestId2,
|
|
281264
281693
|
method: "exec",
|
|
281265
281694
|
path: "/exec",
|
|
@@ -281267,7 +281696,7 @@ var init_ssh = __esm({
|
|
|
281267
281696
|
stage
|
|
281268
281697
|
});
|
|
281269
281698
|
const result = await client.exec(spriteAlias, ["/bin/bash", "-lc", script]);
|
|
281270
|
-
|
|
281699
|
+
logger10.info("sprites_response", {
|
|
281271
281700
|
requestId: requestId2,
|
|
281272
281701
|
method: "exec",
|
|
281273
281702
|
path: "/exec",
|
|
@@ -283687,7 +284116,7 @@ var init_setup = __esm({
|
|
|
283687
284116
|
url: url3,
|
|
283688
284117
|
destinationPath
|
|
283689
284118
|
}) => {
|
|
283690
|
-
const response = await
|
|
284119
|
+
const response = await fetchWithSystemTrust(url3);
|
|
283691
284120
|
if (!response.ok) {
|
|
283692
284121
|
throw new Error(`Download failed with HTTP ${response.status}.`);
|
|
283693
284122
|
}
|
|
@@ -283700,7 +284129,7 @@ var init_setup = __esm({
|
|
|
283700
284129
|
);
|
|
283701
284130
|
};
|
|
283702
284131
|
fetchDesktopDownloadManifest = async (manifestUrl) => {
|
|
283703
|
-
const response = await
|
|
284132
|
+
const response = await fetchWithSystemTrust(manifestUrl);
|
|
283704
284133
|
if (!response.ok) {
|
|
283705
284134
|
throw new Error(
|
|
283706
284135
|
`Desktop download manifest failed with HTTP ${response.status}.`
|
|
@@ -283861,7 +284290,7 @@ var init_setup = __esm({
|
|
|
283861
284290
|
spinner.start("Resolving latest Boxes.dev desktop app");
|
|
283862
284291
|
spinnerStarted = true;
|
|
283863
284292
|
const manifest = await fetchDesktopDownloadManifest(download.manifestUrl);
|
|
283864
|
-
|
|
284293
|
+
logger3.info("setup_desktop_install_start", {
|
|
283865
284294
|
downloadManifestUrl: download.manifestUrl,
|
|
283866
284295
|
url: manifest.url,
|
|
283867
284296
|
version: manifest.version,
|
|
@@ -283896,7 +284325,7 @@ var init_setup = __esm({
|
|
|
283896
284325
|
);
|
|
283897
284326
|
console.log(`Run it with: open "${DESKTOP_APP_TARGET_PATH}"`);
|
|
283898
284327
|
console.log("");
|
|
283899
|
-
|
|
284328
|
+
logger3.info("setup_desktop_install_complete", {
|
|
283900
284329
|
targetPath: DESKTOP_APP_TARGET_PATH
|
|
283901
284330
|
});
|
|
283902
284331
|
return {
|
|
@@ -283908,7 +284337,7 @@ var init_setup = __esm({
|
|
|
283908
284337
|
spinner.stop("Desktop install failed.");
|
|
283909
284338
|
}
|
|
283910
284339
|
const detail = error55 instanceof Error && error55.message.trim().length > 0 ? error55.message.trim() : String(error55);
|
|
283911
|
-
|
|
284340
|
+
logger3.warn("setup_desktop_install_failed", { error: detail });
|
|
283912
284341
|
console.error(
|
|
283913
284342
|
`Failed to install ${DESKTOP_APP_BUNDLE_NAME} automatically: ${detail}`
|
|
283914
284343
|
);
|
|
@@ -283921,7 +284350,7 @@ var init_setup = __esm({
|
|
|
283921
284350
|
} finally {
|
|
283922
284351
|
if (mounted && tempDir) {
|
|
283923
284352
|
await detachDmg(mountPath()).catch((error55) => {
|
|
283924
|
-
|
|
284353
|
+
logger3.warn("setup_desktop_install_detach_failed", {
|
|
283925
284354
|
mountPath: mountPath(),
|
|
283926
284355
|
error: String(error55)
|
|
283927
284356
|
});
|
|
@@ -283929,7 +284358,7 @@ var init_setup = __esm({
|
|
|
283929
284358
|
}
|
|
283930
284359
|
if (tempDir) {
|
|
283931
284360
|
await rm3(tempDir, { recursive: true, force: true }).catch((error55) => {
|
|
283932
|
-
|
|
284361
|
+
logger3.warn("setup_desktop_install_cleanup_failed", {
|
|
283933
284362
|
tempDir,
|
|
283934
284363
|
error: String(error55)
|
|
283935
284364
|
});
|
|
@@ -284164,7 +284593,7 @@ var init_setup = __esm({
|
|
|
284164
284593
|
const e2bCredentialStatus = await fetchResolvedE2bCredentials(controlPlaneToken);
|
|
284165
284594
|
e2bAuthMode = resolveE2bAuthMode(e2bCredentialStatus.source);
|
|
284166
284595
|
} catch (error55) {
|
|
284167
|
-
|
|
284596
|
+
logger3.warn("e2b_credential_status_failed", { error: String(error55) });
|
|
284168
284597
|
e2bAuthMode = "shared";
|
|
284169
284598
|
}
|
|
284170
284599
|
}
|
|
@@ -286561,7 +286990,7 @@ var init_gitSigningRemoteInstall = __esm({
|
|
|
286561
286990
|
spriteAlias,
|
|
286562
286991
|
script
|
|
286563
286992
|
}) => {
|
|
286564
|
-
|
|
286993
|
+
logger3.info("init_git_signing_remote_install_start", {
|
|
286565
286994
|
box: spriteAlias
|
|
286566
286995
|
});
|
|
286567
286996
|
const result = await client.exec(
|
|
@@ -286579,7 +287008,7 @@ var init_gitSigningRemoteInstall = __esm({
|
|
|
286579
287008
|
],
|
|
286580
287009
|
{ timeoutMs: GIT_SIGNING_REMOTE_INSTALL_TIMEOUT_MS }
|
|
286581
287010
|
);
|
|
286582
|
-
|
|
287011
|
+
logger3.info("init_git_signing_remote_install_complete", {
|
|
286583
287012
|
box: spriteAlias,
|
|
286584
287013
|
status: result.exitCode === 0 ? "ok" : "error",
|
|
286585
287014
|
exitCode: result.exitCode
|
|
@@ -287472,7 +287901,7 @@ var init_finalizeFlow = __esm({
|
|
|
287472
287901
|
status
|
|
287473
287902
|
}) => {
|
|
287474
287903
|
status.stage("Configuring git safe dir");
|
|
287475
|
-
|
|
287904
|
+
logger3.info("init_git_safe_directory_configure_start", {
|
|
287476
287905
|
box: spriteAlias,
|
|
287477
287906
|
workdir
|
|
287478
287907
|
});
|
|
@@ -287519,7 +287948,7 @@ var init_finalizeFlow = __esm({
|
|
|
287519
287948
|
details ? `Failed to configure git safe.directory: ${details.trim()}` : `Failed to configure git safe.directory (exit ${result.exitCode})`
|
|
287520
287949
|
);
|
|
287521
287950
|
}
|
|
287522
|
-
|
|
287951
|
+
logger3.info("init_git_safe_directory_configure_complete", {
|
|
287523
287952
|
box: spriteAlias,
|
|
287524
287953
|
workdir
|
|
287525
287954
|
});
|
|
@@ -287763,7 +288192,7 @@ var init_finalizeFlow = __esm({
|
|
|
287763
288192
|
}
|
|
287764
288193
|
});
|
|
287765
288194
|
} catch (error55) {
|
|
287766
|
-
|
|
288195
|
+
logger3.warn("init_remote_codex_thread_visibility_sync_failed", {
|
|
287767
288196
|
box: spriteAlias,
|
|
287768
288197
|
alias,
|
|
287769
288198
|
previousThreadId: normalizeStoredPath(previousResumeState?.threadId),
|
|
@@ -287781,7 +288210,7 @@ var init_finalizeFlow = __esm({
|
|
|
287781
288210
|
try {
|
|
287782
288211
|
return await upsertRemoteInitCodexThread(token, alias, threadId2);
|
|
287783
288212
|
} catch (error55) {
|
|
287784
|
-
|
|
288213
|
+
logger3.warn("init_remote_codex_desktop_thread_lookup_failed", {
|
|
287785
288214
|
box: spriteAlias,
|
|
287786
288215
|
alias,
|
|
287787
288216
|
threadId: threadId2,
|
|
@@ -287810,7 +288239,7 @@ var init_finalizeFlow = __esm({
|
|
|
287810
288239
|
codexSetupLastMessagePath: resumeState?.lastMessagePath ?? null,
|
|
287811
288240
|
codexSetupTodoPath: resumeState?.setupTodoPath ?? null
|
|
287812
288241
|
});
|
|
287813
|
-
|
|
288242
|
+
logger3.info("init_remote_codex_resume_state_persisted", {
|
|
287814
288243
|
box: spriteAlias,
|
|
287815
288244
|
alias,
|
|
287816
288245
|
threadId: resumeState?.threadId ?? null,
|
|
@@ -287839,7 +288268,7 @@ var init_finalizeFlow = __esm({
|
|
|
287839
288268
|
const resolvedThreadId = matchingSession?.sessionId?.trim() ?? "";
|
|
287840
288269
|
return resolvedThreadId.length > 0 ? resolvedThreadId : null;
|
|
287841
288270
|
} catch (error55) {
|
|
287842
|
-
|
|
288271
|
+
logger3.warn("init_remote_codex_thread_recovery_failed", {
|
|
287843
288272
|
box: spriteAlias,
|
|
287844
288273
|
alias,
|
|
287845
288274
|
execSessionId: normalizedExecSessionId,
|
|
@@ -288024,7 +288453,7 @@ var init_finalizeFlow = __esm({
|
|
|
288024
288453
|
ok(`Snapshot created: ${checkpoint.id}`);
|
|
288025
288454
|
}
|
|
288026
288455
|
} catch (error55) {
|
|
288027
|
-
|
|
288456
|
+
logger3.warn("init_checkpoint_create_failed", {
|
|
288028
288457
|
box: canonical,
|
|
288029
288458
|
fingerprint,
|
|
288030
288459
|
phase: "pre-codex-setup",
|
|
@@ -288076,7 +288505,7 @@ var init_finalizeFlow = __esm({
|
|
|
288076
288505
|
summary: setupCompletion.summary
|
|
288077
288506
|
});
|
|
288078
288507
|
}
|
|
288079
|
-
|
|
288508
|
+
logger3.info("init_codex_resume_detected_remote_completion", {
|
|
288080
288509
|
box: spriteAlias,
|
|
288081
288510
|
workdir: expandedWorkdir,
|
|
288082
288511
|
source: setupCompletion.source
|
|
@@ -288297,7 +288726,7 @@ var init_finalizeFlow = __esm({
|
|
|
288297
288726
|
ok(`Snapshot created: ${checkpoint.id}`);
|
|
288298
288727
|
}
|
|
288299
288728
|
} catch (error55) {
|
|
288300
|
-
|
|
288729
|
+
logger3.warn("init_checkpoint_create_failed", {
|
|
288301
288730
|
box: canonical,
|
|
288302
288731
|
fingerprint,
|
|
288303
288732
|
phase: "post-codex-setup",
|
|
@@ -288877,7 +289306,7 @@ var init_e2b = __esm({
|
|
|
288877
289306
|
enabled: progressEnabled,
|
|
288878
289307
|
title: "Destroying Template box (--force)",
|
|
288879
289308
|
fn: async ({ status }) => {
|
|
288880
|
-
|
|
289309
|
+
logger3.info("init_force_destroy_start", {
|
|
288881
289310
|
box: forceAlias,
|
|
288882
289311
|
provider: "e2b"
|
|
288883
289312
|
});
|
|
@@ -290171,7 +290600,7 @@ var init_claudeBootstrap = __esm({
|
|
|
290171
290600
|
remoteHome
|
|
290172
290601
|
}) => {
|
|
290173
290602
|
const paths = buildRemoteClaudePaths(remoteHome);
|
|
290174
|
-
|
|
290603
|
+
logger3.info("init_claude_bootstrap_start", {
|
|
290175
290604
|
box: spriteAlias,
|
|
290176
290605
|
workdir: remoteWorkdir,
|
|
290177
290606
|
remoteHome
|
|
@@ -290279,7 +290708,7 @@ var init_claudeBootstrap = __esm({
|
|
|
290279
290708
|
}
|
|
290280
290709
|
const status = remoteState.data === null ? "applied" : shouldWriteState || shouldWriteSettings || shouldWriteClaudeMd || shouldWritePluginsConfig || shouldSyncCommandsDir || shouldSyncSkillsDir || shouldSyncAgentsDir ? "updated_existing" : "skipped_existing";
|
|
290281
290710
|
if (status === "skipped_existing") {
|
|
290282
|
-
|
|
290711
|
+
logger3.info("init_claude_bootstrap_skipped_existing", {
|
|
290283
290712
|
box: spriteAlias,
|
|
290284
290713
|
workdir: remoteWorkdir,
|
|
290285
290714
|
path: remoteState.path
|
|
@@ -290305,7 +290734,7 @@ var init_claudeBootstrap = __esm({
|
|
|
290305
290734
|
...shouldWriteClaudeMd ? [paths.remoteClaudeMdPath] : []
|
|
290306
290735
|
]
|
|
290307
290736
|
});
|
|
290308
|
-
|
|
290737
|
+
logger3.info("init_claude_bootstrap_success", {
|
|
290309
290738
|
box: spriteAlias,
|
|
290310
290739
|
workdir: remoteWorkdir,
|
|
290311
290740
|
sourceStatePath: stateSource.path,
|
|
@@ -290564,7 +290993,7 @@ var init_codexBootstrap = __esm({
|
|
|
290564
290993
|
spriteAlias
|
|
290565
290994
|
}) => {
|
|
290566
290995
|
const paths = buildRemoteCodexPaths(remoteHome);
|
|
290567
|
-
|
|
290996
|
+
logger3.info("init_codex_bootstrap_start", {
|
|
290568
290997
|
box: spriteAlias,
|
|
290569
290998
|
remoteHome
|
|
290570
290999
|
});
|
|
@@ -290575,7 +291004,7 @@ var init_codexBootstrap = __esm({
|
|
|
290575
291004
|
const shouldWriteAgentsMd = Boolean(localAgentsMd);
|
|
290576
291005
|
const shouldSyncSkillsDir = Boolean(localSkillsDir);
|
|
290577
291006
|
if (!shouldImportConfig && !shouldWriteAgentsMd && !shouldSyncSkillsDir) {
|
|
290578
|
-
|
|
291007
|
+
logger3.info("init_codex_bootstrap_skipped_no_local_config", {
|
|
290579
291008
|
box: spriteAlias,
|
|
290580
291009
|
sourceConfigPath: configSource.path
|
|
290581
291010
|
});
|
|
@@ -290641,7 +291070,7 @@ var init_codexBootstrap = __esm({
|
|
|
290641
291070
|
touchedSkillsDir: shouldSyncSkillsDir
|
|
290642
291071
|
});
|
|
290643
291072
|
}
|
|
290644
|
-
|
|
291073
|
+
logger3.info("init_codex_bootstrap_success", {
|
|
290645
291074
|
box: spriteAlias,
|
|
290646
291075
|
importedMcpServerCount: Object.keys(configSource.data.mcpServers).length,
|
|
290647
291076
|
parseWarningCount: configSource.parseWarnings.length,
|
|
@@ -290807,7 +291236,7 @@ var init_agentsSection = __esm({
|
|
|
290807
291236
|
remoteHome
|
|
290808
291237
|
});
|
|
290809
291238
|
if (result.parseWarnings.length > 0) {
|
|
290810
|
-
|
|
291239
|
+
logger3.warn("init_claude_bootstrap_local_parse_warnings", {
|
|
290811
291240
|
box: spriteAlias,
|
|
290812
291241
|
warningCount: result.parseWarnings.length,
|
|
290813
291242
|
warnings: result.parseWarnings
|
|
@@ -290821,7 +291250,7 @@ var init_agentsSection = __esm({
|
|
|
290821
291250
|
status.stage("Claude: config bootstrapped");
|
|
290822
291251
|
}
|
|
290823
291252
|
} catch (error55) {
|
|
290824
|
-
|
|
291253
|
+
logger3.warn("init_claude_bootstrap_failed", {
|
|
290825
291254
|
box: spriteAlias,
|
|
290826
291255
|
workdir: expandedWorkdir,
|
|
290827
291256
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -290856,7 +291285,7 @@ var init_agentsSection = __esm({
|
|
|
290856
291285
|
spriteAlias
|
|
290857
291286
|
});
|
|
290858
291287
|
if (result.parseWarnings.length > 0) {
|
|
290859
|
-
|
|
291288
|
+
logger3.warn("init_codex_bootstrap_local_parse_warnings", {
|
|
290860
291289
|
box: spriteAlias,
|
|
290861
291290
|
warningCount: result.parseWarnings.length,
|
|
290862
291291
|
warnings: result.parseWarnings
|
|
@@ -290872,7 +291301,7 @@ var init_agentsSection = __esm({
|
|
|
290872
291301
|
status.stage("Codex: config bootstrapped");
|
|
290873
291302
|
}
|
|
290874
291303
|
} catch (error55) {
|
|
290875
|
-
|
|
291304
|
+
logger3.warn("init_codex_bootstrap_failed", {
|
|
290876
291305
|
box: spriteAlias,
|
|
290877
291306
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
290878
291307
|
});
|
|
@@ -291228,7 +291657,7 @@ var init_init = __esm({
|
|
|
291228
291657
|
throw error55;
|
|
291229
291658
|
}
|
|
291230
291659
|
status.stage(`${title} (retry ${retryIndex}/${maxRetries})`);
|
|
291231
|
-
|
|
291660
|
+
logger3.warn("init_step_retry", {
|
|
291232
291661
|
title,
|
|
291233
291662
|
retry: retryIndex,
|
|
291234
291663
|
retries: maxRetries,
|
|
@@ -291556,7 +291985,7 @@ var init_init = __esm({
|
|
|
291556
291985
|
updateInitState,
|
|
291557
291986
|
extractCheckpointId: extractInitCheckpointId,
|
|
291558
291987
|
onCheckpointIdMissing: ({ canonical: canonical2, phaseLabel }) => {
|
|
291559
|
-
|
|
291988
|
+
logger3.warn("init_checkpoint_id_missing", {
|
|
291560
291989
|
box: canonical2,
|
|
291561
291990
|
fingerprint,
|
|
291562
291991
|
phase: phaseLabel
|
|
@@ -291781,7 +292210,7 @@ var init_init = __esm({
|
|
|
291781
292210
|
status.stop();
|
|
291782
292211
|
},
|
|
291783
292212
|
onFetchStatusError: (error55) => {
|
|
291784
|
-
|
|
292213
|
+
logger3.warn("init_claude_token_status_failed", {
|
|
291785
292214
|
error: String(error55)
|
|
291786
292215
|
});
|
|
291787
292216
|
}
|
|
@@ -291822,7 +292251,7 @@ var init_init = __esm({
|
|
|
291822
292251
|
throw new Error("E2B init runtime is missing keepalive support.");
|
|
291823
292252
|
}
|
|
291824
292253
|
const result = await client.keepAlive(alias, { wakeIfPaused: true });
|
|
291825
|
-
|
|
292254
|
+
logger3.info("init_e2b_keepalive", {
|
|
291826
292255
|
box: canonical,
|
|
291827
292256
|
alias,
|
|
291828
292257
|
boundary,
|
|
@@ -291940,7 +292369,7 @@ var init_init = __esm({
|
|
|
291940
292369
|
}
|
|
291941
292370
|
});
|
|
291942
292371
|
} catch (error55) {
|
|
291943
|
-
|
|
292372
|
+
logger3.warn("devbox_bootstrap_failed", {
|
|
291944
292373
|
box: canonical,
|
|
291945
292374
|
error: String(error55)
|
|
291946
292375
|
});
|
|
@@ -291990,7 +292419,7 @@ var init_init = __esm({
|
|
|
291990
292419
|
});
|
|
291991
292420
|
await updateInitState({ steps: { daemonInstalled: true } });
|
|
291992
292421
|
} catch (error55) {
|
|
291993
|
-
|
|
292422
|
+
logger3.warn("sprite_daemon_install_failed", {
|
|
291994
292423
|
box: canonical,
|
|
291995
292424
|
error: String(error55)
|
|
291996
292425
|
});
|
|
@@ -292016,7 +292445,7 @@ var init_init = __esm({
|
|
|
292016
292445
|
});
|
|
292017
292446
|
await updateInitState({ steps: { daemonServiceEnsured: true } });
|
|
292018
292447
|
} catch (error55) {
|
|
292019
|
-
|
|
292448
|
+
logger3.warn("sprite_daemon_service_failed", {
|
|
292020
292449
|
box: canonical,
|
|
292021
292450
|
error: String(error55)
|
|
292022
292451
|
});
|
|
@@ -292074,7 +292503,7 @@ var init_init = __esm({
|
|
|
292074
292503
|
});
|
|
292075
292504
|
await updateInitState({ steps: { sshdConfigured: true } });
|
|
292076
292505
|
} catch (error55) {
|
|
292077
|
-
|
|
292506
|
+
logger3.warn("sshd_config_failed", {
|
|
292078
292507
|
box: canonical,
|
|
292079
292508
|
error: String(error55)
|
|
292080
292509
|
});
|
|
@@ -292101,7 +292530,7 @@ var init_init = __esm({
|
|
|
292101
292530
|
});
|
|
292102
292531
|
await updateInitState({ steps: { codexCliEnsured: true } });
|
|
292103
292532
|
} catch (error55) {
|
|
292104
|
-
|
|
292533
|
+
logger3.warn("codex_cli_ensure_failed", {
|
|
292105
292534
|
box: canonical,
|
|
292106
292535
|
fingerprint,
|
|
292107
292536
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -292204,7 +292633,7 @@ var init_init = __esm({
|
|
|
292204
292633
|
updateInitState
|
|
292205
292634
|
});
|
|
292206
292635
|
if (remoteWorkdirState === "missing") {
|
|
292207
|
-
|
|
292636
|
+
logger3.info("init_resume_remote_repo_missing", {
|
|
292208
292637
|
box: canonical,
|
|
292209
292638
|
workdir: expandedWorkdir
|
|
292210
292639
|
});
|
|
@@ -292523,7 +292952,7 @@ var init_list = __esm({
|
|
|
292523
292952
|
}
|
|
292524
292953
|
return states;
|
|
292525
292954
|
} catch (error55) {
|
|
292526
|
-
|
|
292955
|
+
logger3.warn("managed_lifecycle_status_lookup_failed", {
|
|
292527
292956
|
error: String(error55)
|
|
292528
292957
|
});
|
|
292529
292958
|
for (const box of managedBoxes) {
|
|
@@ -292569,7 +292998,7 @@ var init_list = __esm({
|
|
|
292569
292998
|
try {
|
|
292570
292999
|
await recordCompletionAliases(boxes);
|
|
292571
293000
|
} catch (error55) {
|
|
292572
|
-
|
|
293001
|
+
logger3.warn("completion_cache_update_failed", { error: String(error55) });
|
|
292573
293002
|
}
|
|
292574
293003
|
const managedStates = await managedStatesPromise;
|
|
292575
293004
|
const remoteStates = resolveRemoteStates(boxes, managedStates);
|
|
@@ -292700,7 +293129,7 @@ var init_logout = __esm({
|
|
|
292700
293129
|
try {
|
|
292701
293130
|
await signOutControlPlane(token);
|
|
292702
293131
|
} catch (error55) {
|
|
292703
|
-
|
|
293132
|
+
logger3.warn("control_plane_signout_failed", { error: String(error55) });
|
|
292704
293133
|
}
|
|
292705
293134
|
}
|
|
292706
293135
|
await store.clearControlPlaneSession();
|
|
@@ -292822,7 +293251,7 @@ var init_mount = __esm({
|
|
|
292822
293251
|
try {
|
|
292823
293252
|
providerLookupBoxes = await listDevboxes();
|
|
292824
293253
|
} catch (error55) {
|
|
292825
|
-
|
|
293254
|
+
logger3.warn("mount_provider_lookup_failed", {
|
|
292826
293255
|
box: spriteAlias,
|
|
292827
293256
|
error: String(error55)
|
|
292828
293257
|
});
|
|
@@ -292920,7 +293349,7 @@ var init_mount = __esm({
|
|
|
292920
293349
|
try {
|
|
292921
293350
|
await stopSshPort(socketInfo.socketPath, spriteAlias, sshPort);
|
|
292922
293351
|
} catch (stopError) {
|
|
292923
|
-
|
|
293352
|
+
logger3.warn("mount_forward_cleanup_failed", {
|
|
292924
293353
|
box: spriteAlias,
|
|
292925
293354
|
error: String(stopError)
|
|
292926
293355
|
});
|
|
@@ -294282,7 +294711,7 @@ var init_agentPermissions = __esm({
|
|
|
294282
294711
|
});
|
|
294283
294712
|
|
|
294284
294713
|
// src/devbox/commands/agentPermissionRequests.ts
|
|
294285
|
-
var listPending, respond, boxLabel, describeRequest, formatExpiry, renderPendingPermissionRequests, parseAnswerArgs, findPendingRequest, requireProjectScope, requireDecisionApplied, renderPermissionAnswer, runAnswer, runAgentPermissionRequestsWithDependencies, runAgentPermissionAllowWithDependencies, runAgentPermissionDenyWithDependencies, runAgentPermissionRequests, runAgentPermissionAllow, runAgentPermissionDeny;
|
|
294714
|
+
var listPending, respond, boxLabel, describeRequest, formatExpiry, renderPendingPermissionRequests, parseAnswerArgs, listPendingRequests, findPendingRequest, requireProjectScope, requireDecisionApplied, renderPermissionAnswer, runAnswer, runAgentPermissionRequestsWithDependencies, runAgentPermissionAllowWithDependencies, runAgentPermissionDenyWithDependencies, runAgentPermissionRequests, runAgentPermissionAllow, runAgentPermissionDeny;
|
|
294286
294715
|
var init_agentPermissionRequests = __esm({
|
|
294287
294716
|
"src/devbox/commands/agentPermissionRequests.ts"() {
|
|
294288
294717
|
"use strict";
|
|
@@ -294300,14 +294729,17 @@ var init_agentPermissionRequests = __esm({
|
|
|
294300
294729
|
if (!isOnboxAgentPermission(permission)) {
|
|
294301
294730
|
return {
|
|
294302
294731
|
question: `An agent is asking for the ${permission} permission.`,
|
|
294303
|
-
scope: "Run `dvb upgrade` to see what this permission will allow. You can still allow or deny it now."
|
|
294732
|
+
scope: "Run `dvb upgrade` to see what this permission will allow. You can still allow or deny it now.",
|
|
294733
|
+
details: [],
|
|
294734
|
+
agentReason: null
|
|
294304
294735
|
};
|
|
294305
294736
|
}
|
|
294306
294737
|
return buildOnboxAgentPermissionRequestPresentation({
|
|
294307
294738
|
permission,
|
|
294308
294739
|
sourceBoxKind: entry.sourceBoxKind,
|
|
294309
294740
|
projectScopeAvailable: entry.request.projectScopeAvailable,
|
|
294310
|
-
teamTemplateName: entry.request.teamTemplateName
|
|
294741
|
+
teamTemplateName: entry.request.teamTemplateName,
|
|
294742
|
+
action: entry.request.action ?? null
|
|
294311
294743
|
});
|
|
294312
294744
|
};
|
|
294313
294745
|
formatExpiry = (expiresAt, now) => {
|
|
@@ -294317,12 +294749,14 @@ var init_agentPermissionRequests = __esm({
|
|
|
294317
294749
|
renderPendingPermissionRequests = (entries, now) => {
|
|
294318
294750
|
if (entries.length === 0) return "No agents are waiting for permission.";
|
|
294319
294751
|
const blocks = entries.map((entry) => {
|
|
294320
|
-
const { question, scope } = describeRequest(entry);
|
|
294752
|
+
const { question, scope, details, agentReason } = describeRequest(entry);
|
|
294321
294753
|
const id2 = entry.request.requestId;
|
|
294322
294754
|
return [
|
|
294323
294755
|
question,
|
|
294324
294756
|
` From ${boxLabel(entry)}, thread "${entry.threadTitle}". ${formatExpiry(entry.request.expiresAt, now)}`,
|
|
294757
|
+
...details.map(({ label, value }) => ` ${label}: ${value}`),
|
|
294325
294758
|
` ${scope}`,
|
|
294759
|
+
...agentReason === null ? [] : [` ${agentReason}`],
|
|
294326
294760
|
` dvb permissions allow ${id2}${entry.request.projectScopeAvailable ? " [--project]" : ""}`,
|
|
294327
294761
|
` dvb permissions deny ${id2}`
|
|
294328
294762
|
].join("\n");
|
|
@@ -294365,8 +294799,9 @@ var init_agentPermissionRequests = __esm({
|
|
|
294365
294799
|
json: readBooleanFlag(flags, "json")
|
|
294366
294800
|
};
|
|
294367
294801
|
};
|
|
294802
|
+
listPendingRequests = async (client) => await client.query(listPending, { supportsIntegrationPermissions: true });
|
|
294368
294803
|
findPendingRequest = async (client, requestId2) => {
|
|
294369
|
-
const entries = await client
|
|
294804
|
+
const entries = await listPendingRequests(client);
|
|
294370
294805
|
const entry = entries.find(
|
|
294371
294806
|
(candidate) => candidate.request.requestId === requestId2
|
|
294372
294807
|
);
|
|
@@ -294403,6 +294838,9 @@ var init_agentPermissionRequests = __esm({
|
|
|
294403
294838
|
if (decision === "deny") {
|
|
294404
294839
|
return `Denied ${permission} for ${boxLabel(entry)}. Agent permissions didn't change.`;
|
|
294405
294840
|
}
|
|
294841
|
+
if (entry.request.action) {
|
|
294842
|
+
return `Allowed this change in thread "${entry.threadTitle}". The agent can now apply it.`;
|
|
294843
|
+
}
|
|
294406
294844
|
if (isOnboxAgentPermission(permission) && isOnboxAgentThreadGrantPermission(permission)) {
|
|
294407
294845
|
return `Allowed ${permission} for 3 hours in thread "${entry.threadTitle}".`;
|
|
294408
294846
|
}
|
|
@@ -294421,7 +294859,8 @@ var init_agentPermissionRequests = __esm({
|
|
|
294421
294859
|
clientThreadId: entry.clientThreadId,
|
|
294422
294860
|
requestId: entry.request.requestId,
|
|
294423
294861
|
decision,
|
|
294424
|
-
scope
|
|
294862
|
+
scope,
|
|
294863
|
+
supportsIntegrationPermissions: true
|
|
294425
294864
|
});
|
|
294426
294865
|
requireDecisionApplied(decision, response.status);
|
|
294427
294866
|
return { decision, scope, status: response.status, entry };
|
|
@@ -294444,7 +294883,7 @@ var init_agentPermissionRequests = __esm({
|
|
|
294444
294883
|
json: readBooleanFlag(flags, "json"),
|
|
294445
294884
|
dependencies,
|
|
294446
294885
|
load: async ({ client }) => ({
|
|
294447
|
-
requests: await client
|
|
294886
|
+
requests: await listPendingRequests(client)
|
|
294448
294887
|
}),
|
|
294449
294888
|
render: ({ requests }) => renderPendingPermissionRequests(requests, now())
|
|
294450
294889
|
});
|
|
@@ -297555,7 +297994,7 @@ var init_sentryTest = __esm({
|
|
|
297555
297994
|
// src/devbox/commands/sshProxy.ts
|
|
297556
297995
|
import { randomUUID as randomUUID39 } from "node:crypto";
|
|
297557
297996
|
import net5 from "node:net";
|
|
297558
|
-
var
|
|
297997
|
+
var logger12, SSH_PROXY_USAGE, parsePort2, parseSshProxyArgs, acquireSshForward, releaseSshForward, bridgeProxySocket, runSshProxy;
|
|
297559
297998
|
var init_sshProxy = __esm({
|
|
297560
297999
|
"src/devbox/commands/sshProxy.ts"() {
|
|
297561
298000
|
"use strict";
|
|
@@ -297563,7 +298002,7 @@ var init_sshProxy = __esm({
|
|
|
297563
298002
|
init_daemonClient();
|
|
297564
298003
|
init_args();
|
|
297565
298004
|
init_errors4();
|
|
297566
|
-
|
|
298005
|
+
logger12 = createLogger("devbox-ssh");
|
|
297567
298006
|
SSH_PROXY_USAGE = "Usage: dvb ssh proxy <box> [--port <port>]";
|
|
297568
298007
|
parsePort2 = (raw) => {
|
|
297569
298008
|
if (!raw) {
|
|
@@ -297689,7 +298128,7 @@ var init_sshProxy = __esm({
|
|
|
297689
298128
|
};
|
|
297690
298129
|
const handleConnect = () => {
|
|
297691
298130
|
connected = true;
|
|
297692
|
-
|
|
298131
|
+
logger12.info("ssh_proxy_transport_ready", {
|
|
297693
298132
|
box,
|
|
297694
298133
|
localPort
|
|
297695
298134
|
});
|
|
@@ -297746,7 +298185,7 @@ var init_sshProxy = __esm({
|
|
|
297746
298185
|
const { box, port } = parseSshProxyArgs(args);
|
|
297747
298186
|
const owner = `ssh-proxy:${randomUUID39()}`;
|
|
297748
298187
|
const socketInfo = resolveSocketInfo();
|
|
297749
|
-
|
|
298188
|
+
logger12.info("ssh_proxy_start", {
|
|
297750
298189
|
box,
|
|
297751
298190
|
owner,
|
|
297752
298191
|
path: "/ports/forward"
|
|
@@ -297762,14 +298201,14 @@ var init_sshProxy = __esm({
|
|
|
297762
298201
|
owner
|
|
297763
298202
|
});
|
|
297764
298203
|
await bridgeProxySocket({ box, localPort });
|
|
297765
|
-
|
|
298204
|
+
logger12.info("ssh_proxy_end", {
|
|
297766
298205
|
box,
|
|
297767
298206
|
owner,
|
|
297768
298207
|
localPort,
|
|
297769
298208
|
status: "ok"
|
|
297770
298209
|
});
|
|
297771
298210
|
} catch (error55) {
|
|
297772
|
-
|
|
298211
|
+
logger12.warn("ssh_proxy_transport_failed", {
|
|
297773
298212
|
box,
|
|
297774
298213
|
owner,
|
|
297775
298214
|
...typeof localPort === "number" ? { localPort } : {},
|
|
@@ -297785,7 +298224,7 @@ var init_sshProxy = __esm({
|
|
|
297785
298224
|
owner
|
|
297786
298225
|
});
|
|
297787
298226
|
} catch (error55) {
|
|
297788
|
-
|
|
298227
|
+
logger12.warn("ssh_proxy_release_failed", {
|
|
297789
298228
|
box,
|
|
297790
298229
|
owner,
|
|
297791
298230
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -298183,7 +298622,7 @@ var init_threadArchive2 = __esm({
|
|
|
298183
298622
|
archived,
|
|
298184
298623
|
requestId: requestId2
|
|
298185
298624
|
});
|
|
298186
|
-
|
|
298625
|
+
logger3.info("cli_thread_archive_completed", {
|
|
298187
298626
|
requestId: requestId2,
|
|
298188
298627
|
...result,
|
|
298189
298628
|
status: "ok"
|
|
@@ -299301,8 +299740,18 @@ var init_threadRead = __esm({
|
|
|
299301
299740
|
pageSize: turns,
|
|
299302
299741
|
...cursor === null ? {} : { cursor }
|
|
299303
299742
|
});
|
|
299743
|
+
const thread = projectCliAgentToolsThreadContextV1(threadContext.thread);
|
|
299744
|
+
const pendingInput = threadContext.pendingInput ?? null;
|
|
299304
299745
|
return {
|
|
299305
|
-
thread:
|
|
299746
|
+
thread: {
|
|
299747
|
+
...thread,
|
|
299748
|
+
status: resolveThreadStatusWithPendingInput(
|
|
299749
|
+
thread.status,
|
|
299750
|
+
thread.activeTurnId,
|
|
299751
|
+
pendingInput
|
|
299752
|
+
),
|
|
299753
|
+
pendingInput
|
|
299754
|
+
},
|
|
299306
299755
|
transcript: projectCliAgentThreadTranscript(peek)
|
|
299307
299756
|
};
|
|
299308
299757
|
} catch (error55) {
|
|
@@ -299403,6 +299852,7 @@ async function* streamCliAgentToolThreadEvents({
|
|
|
299403
299852
|
turnId: streamCursor.turnId,
|
|
299404
299853
|
requestId: requestId2,
|
|
299405
299854
|
baselineThread,
|
|
299855
|
+
baselinePendingInput: page.pendingInput ?? null,
|
|
299406
299856
|
baselineEventId: streamCursor.lastEventId,
|
|
299407
299857
|
timeoutMs: null,
|
|
299408
299858
|
signal
|
|
@@ -299455,7 +299905,7 @@ async function* streamCliAgentToolThreadEvents({
|
|
|
299455
299905
|
throw normalizeConvexResourceError(error55);
|
|
299456
299906
|
}
|
|
299457
299907
|
}
|
|
299458
|
-
var THREAD_EVENT_PAGE_SIZE, projectCliAgentToolsThreadFailureV1, encodeThreadEventCursor, decodeThreadEventCursor, loadThreadContext, loadThreadEventPage, threadStateSignature, waitForThreadObservation, threadEventWaitStatus, loadTerminalWaitResult, nonTerminalWaitResult, detachedThreadWaitStatus, waitForCliAgentToolThread, initialStreamCursor, buildCliAgentToolsThreadEventEnvelope;
|
|
299908
|
+
var THREAD_EVENT_PAGE_SIZE, projectCliAgentToolsThreadFailureV1, encodeThreadEventCursor, decodeThreadEventCursor, loadThreadContext, loadThreadEventPage, threadStateSignature, waitForThreadObservation, threadEventWaitStatus, loadTerminalWaitResult, loadInputWaitResult, nonTerminalWaitResult, detachedThreadWaitStatus, threadAwaitsInput, isTurnOutcomeEvent, waitForCliAgentToolThread, initialStreamCursor, buildCliAgentToolsThreadEventEnvelope;
|
|
299459
299909
|
var init_threadObservation = __esm({
|
|
299460
299910
|
"src/devbox/resourceApi/threadObservation.ts"() {
|
|
299461
299911
|
"use strict";
|
|
@@ -299580,13 +300030,14 @@ var init_threadObservation = __esm({
|
|
|
299580
300030
|
},
|
|
299581
300031
|
requestId: requestId2
|
|
299582
300032
|
});
|
|
299583
|
-
threadStateSignature = (thread) => [
|
|
300033
|
+
threadStateSignature = (thread, pendingInput) => [
|
|
299584
300034
|
thread.lifecycle,
|
|
299585
300035
|
thread.archived ? "archived" : "active",
|
|
299586
300036
|
thread.storageState,
|
|
299587
300037
|
thread.activeTurnId ?? "",
|
|
299588
300038
|
thread.activeTurnStatus ?? "",
|
|
299589
|
-
String(thread.updatedAt)
|
|
300039
|
+
String(thread.updatedAt),
|
|
300040
|
+
JSON.stringify(pendingInput)
|
|
299590
300041
|
].join(":");
|
|
299591
300042
|
waitForThreadObservation = async ({
|
|
299592
300043
|
context: context34,
|
|
@@ -299594,6 +300045,7 @@ var init_threadObservation = __esm({
|
|
|
299594
300045
|
turnId,
|
|
299595
300046
|
requestId: requestId2,
|
|
299596
300047
|
baselineThread,
|
|
300048
|
+
baselinePendingInput,
|
|
299597
300049
|
baselineEventId,
|
|
299598
300050
|
timeoutMs,
|
|
299599
300051
|
signal
|
|
@@ -299636,7 +300088,10 @@ var init_threadObservation = __esm({
|
|
|
299636
300088
|
const onAbort = () => finish({ kind: "canceled" });
|
|
299637
300089
|
timer = timeoutMs === null ? null : setTimeout(() => finish({ kind: "timeout" }), timeoutMs);
|
|
299638
300090
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
299639
|
-
const baselineSignature = threadStateSignature(
|
|
300091
|
+
const baselineSignature = threadStateSignature(
|
|
300092
|
+
baselineThread,
|
|
300093
|
+
baselinePendingInput
|
|
300094
|
+
);
|
|
299640
300095
|
unsubscribe4 = context34.client.onUpdate(
|
|
299641
300096
|
observeCliAgentToolThreadV1,
|
|
299642
300097
|
{
|
|
@@ -299646,7 +300101,10 @@ var init_threadObservation = __esm({
|
|
|
299646
300101
|
requestId: requestId2
|
|
299647
300102
|
},
|
|
299648
300103
|
(observation) => {
|
|
299649
|
-
if (observation.latestEvent?.eventId !== baselineEventId || threadStateSignature(
|
|
300104
|
+
if ((observation.latestEvent?.eventId ?? null) !== baselineEventId || threadStateSignature(
|
|
300105
|
+
observation.thread,
|
|
300106
|
+
observation.pendingInput ?? null
|
|
300107
|
+
) !== baselineSignature) {
|
|
299650
300108
|
finish({ kind: "observation", observation });
|
|
299651
300109
|
}
|
|
299652
300110
|
},
|
|
@@ -299697,6 +300155,31 @@ var init_threadObservation = __esm({
|
|
|
299697
300155
|
transcript: read2.transcript
|
|
299698
300156
|
};
|
|
299699
300157
|
};
|
|
300158
|
+
loadInputWaitResult = async ({
|
|
300159
|
+
context: context34,
|
|
300160
|
+
thread,
|
|
300161
|
+
turnId,
|
|
300162
|
+
occurredAt,
|
|
300163
|
+
pendingInput,
|
|
300164
|
+
requestId: requestId2
|
|
300165
|
+
}) => {
|
|
300166
|
+
const read2 = await readCliAgentToolThread({
|
|
300167
|
+
context: context34,
|
|
300168
|
+
clientThreadId: thread.clientThreadId,
|
|
300169
|
+
turns: 20,
|
|
300170
|
+
cursor: null,
|
|
300171
|
+
requestId: requestId2
|
|
300172
|
+
});
|
|
300173
|
+
return {
|
|
300174
|
+
executionInstanceId: thread.executionInstanceId,
|
|
300175
|
+
turnId,
|
|
300176
|
+
status: "needs_input",
|
|
300177
|
+
occurredAt,
|
|
300178
|
+
failure: null,
|
|
300179
|
+
transcript: read2.transcript,
|
|
300180
|
+
pendingInput
|
|
300181
|
+
};
|
|
300182
|
+
};
|
|
299700
300183
|
nonTerminalWaitResult = ({
|
|
299701
300184
|
thread,
|
|
299702
300185
|
turnId,
|
|
@@ -299727,6 +300210,15 @@ var init_threadObservation = __esm({
|
|
|
299727
300210
|
}
|
|
299728
300211
|
return null;
|
|
299729
300212
|
};
|
|
300213
|
+
threadAwaitsInput = ({
|
|
300214
|
+
thread,
|
|
300215
|
+
pendingInput,
|
|
300216
|
+
turnId
|
|
300217
|
+
}) => thread.activeTurnId === turnId && (thread.activeTurnStatus === "waiting_for_input" || pendingInputHoldsTurn(pendingInput, turnId));
|
|
300218
|
+
isTurnOutcomeEvent = (event) => {
|
|
300219
|
+
const status = threadEventWaitStatus(event);
|
|
300220
|
+
return status !== null && status !== "needs_input";
|
|
300221
|
+
};
|
|
299730
300222
|
waitForCliAgentToolThread = async ({
|
|
299731
300223
|
context: context34,
|
|
299732
300224
|
clientThreadId,
|
|
@@ -299760,7 +300252,17 @@ var init_threadObservation = __esm({
|
|
|
299760
300252
|
let cursor = null;
|
|
299761
300253
|
let baselineThread = threadContext.thread;
|
|
299762
300254
|
let latestEventId = null;
|
|
300255
|
+
let outcomeEvent = null;
|
|
300256
|
+
let inputEvent = null;
|
|
300257
|
+
let pendingInput = null;
|
|
299763
300258
|
while (true) {
|
|
300259
|
+
if (signal.aborted) {
|
|
300260
|
+
return nonTerminalWaitResult({
|
|
300261
|
+
thread: baselineThread,
|
|
300262
|
+
turnId: observedTurnId,
|
|
300263
|
+
status: "canceled"
|
|
300264
|
+
});
|
|
300265
|
+
}
|
|
299764
300266
|
const remainingMs = Math.max(0, deadline - Date.now());
|
|
299765
300267
|
if (remainingMs === 0) {
|
|
299766
300268
|
return nonTerminalWaitResult({
|
|
@@ -299779,17 +300281,14 @@ var init_threadObservation = __esm({
|
|
|
299779
300281
|
requestId: requestId2
|
|
299780
300282
|
});
|
|
299781
300283
|
baselineThread = page.thread;
|
|
300284
|
+
pendingInput = page.pendingInput ?? null;
|
|
299782
300285
|
latestEventId = page.events.at(-1)?.eventId ?? latestEventId;
|
|
299783
|
-
const
|
|
299784
|
-
(event
|
|
299785
|
-
|
|
299786
|
-
|
|
299787
|
-
|
|
299788
|
-
|
|
299789
|
-
thread: page.thread,
|
|
299790
|
-
event: terminalEvent,
|
|
299791
|
-
requestId: requestId2
|
|
299792
|
-
});
|
|
300286
|
+
for (const event of page.events) {
|
|
300287
|
+
if (event.kind === "needs_input") {
|
|
300288
|
+
inputEvent = event;
|
|
300289
|
+
} else if (isTurnOutcomeEvent(event)) {
|
|
300290
|
+
outcomeEvent = event;
|
|
300291
|
+
}
|
|
299793
300292
|
}
|
|
299794
300293
|
cursor = page.continueCursor;
|
|
299795
300294
|
if (!page.isDone) {
|
|
@@ -299797,6 +300296,14 @@ var init_threadObservation = __esm({
|
|
|
299797
300296
|
}
|
|
299798
300297
|
break;
|
|
299799
300298
|
}
|
|
300299
|
+
if (outcomeEvent !== null) {
|
|
300300
|
+
return await loadTerminalWaitResult({
|
|
300301
|
+
context: context34,
|
|
300302
|
+
thread: baselineThread,
|
|
300303
|
+
event: outcomeEvent,
|
|
300304
|
+
requestId: requestId2
|
|
300305
|
+
});
|
|
300306
|
+
}
|
|
299800
300307
|
while (true) {
|
|
299801
300308
|
const remainingMs = Math.max(0, deadline - Date.now());
|
|
299802
300309
|
if (remainingMs === 0) {
|
|
@@ -299817,12 +300324,27 @@ var init_threadObservation = __esm({
|
|
|
299817
300324
|
status: detached
|
|
299818
300325
|
});
|
|
299819
300326
|
}
|
|
300327
|
+
if (threadAwaitsInput({
|
|
300328
|
+
thread: baselineThread,
|
|
300329
|
+
pendingInput,
|
|
300330
|
+
turnId: observedTurnId
|
|
300331
|
+
})) {
|
|
300332
|
+
return await loadInputWaitResult({
|
|
300333
|
+
context: context34,
|
|
300334
|
+
thread: baselineThread,
|
|
300335
|
+
turnId: observedTurnId,
|
|
300336
|
+
occurredAt: inputEvent?.occurredAt ?? null,
|
|
300337
|
+
pendingInput,
|
|
300338
|
+
requestId: requestId2
|
|
300339
|
+
});
|
|
300340
|
+
}
|
|
299820
300341
|
const observed = await waitForThreadObservation({
|
|
299821
300342
|
context: context34,
|
|
299822
300343
|
clientThreadId,
|
|
299823
300344
|
turnId: observedTurnId,
|
|
299824
300345
|
requestId: requestId2,
|
|
299825
300346
|
baselineThread,
|
|
300347
|
+
baselinePendingInput: pendingInput,
|
|
299826
300348
|
baselineEventId: latestEventId,
|
|
299827
300349
|
timeoutMs: remainingMs,
|
|
299828
300350
|
signal
|
|
@@ -299835,9 +300357,10 @@ var init_threadObservation = __esm({
|
|
|
299835
300357
|
});
|
|
299836
300358
|
}
|
|
299837
300359
|
baselineThread = observed.observation.thread;
|
|
300360
|
+
pendingInput = observed.observation.pendingInput ?? null;
|
|
299838
300361
|
const event = observed.observation.latestEvent;
|
|
299839
300362
|
latestEventId = event?.eventId ?? latestEventId;
|
|
299840
|
-
if (event !== null &&
|
|
300363
|
+
if (event !== null && isTurnOutcomeEvent(event)) {
|
|
299841
300364
|
return await loadTerminalWaitResult({
|
|
299842
300365
|
context: context34,
|
|
299843
300366
|
thread: baselineThread,
|
|
@@ -299845,6 +300368,9 @@ var init_threadObservation = __esm({
|
|
|
299845
300368
|
requestId: requestId2
|
|
299846
300369
|
});
|
|
299847
300370
|
}
|
|
300371
|
+
if (event?.kind === "needs_input") {
|
|
300372
|
+
inputEvent = event;
|
|
300373
|
+
}
|
|
299848
300374
|
}
|
|
299849
300375
|
} catch (error55) {
|
|
299850
300376
|
throw normalizeConvexResourceError(error55);
|
|
@@ -299892,7 +300418,7 @@ var init_threadObservation = __esm({
|
|
|
299892
300418
|
});
|
|
299893
300419
|
|
|
299894
300420
|
// src/devbox/commands/threadObservation.ts
|
|
299895
|
-
var DEFAULT_THREAD_WAIT_TIMEOUT_MS, MAX_THREAD_WAIT_TIMEOUT_MS, createProcessObservationSignal, defaultThreadObservationCommandDependencies, invalidObservationArgs, parseObservationOptions, TEAM_THREAD_PUBLIC_ID_PATTERN, parseThreadReadLocator, parsePositiveInteger2, parseDurationMs2, parseThreadReadArgs, parseThreadWaitArgs, parseThreadEventsArgs, renderCliAgentToolThreadRead, renderCliAgentToolCanonicalThreadRead, renderCliAgentToolThreadWait, runThreadReadWithDependencies, runThreadWaitWithDependencies, runThreadEventsWithDependencies, runThreadRead, runThreadWait, runThreadEvents;
|
|
300421
|
+
var DEFAULT_THREAD_WAIT_TIMEOUT_MS, MAX_THREAD_WAIT_TIMEOUT_MS, createProcessObservationSignal, defaultThreadObservationCommandDependencies, invalidObservationArgs, parseObservationOptions, TEAM_THREAD_PUBLIC_ID_PATTERN, parseThreadReadLocator, parsePositiveInteger2, parseDurationMs2, parseThreadReadArgs, parseThreadWaitArgs, parseThreadEventsArgs, withPendingInput, renderCliAgentToolThreadRead, renderCliAgentToolCanonicalThreadRead, renderCliAgentToolThreadWait, runThreadReadWithDependencies, runThreadWaitWithDependencies, runThreadEventsWithDependencies, runThreadRead, runThreadWait, runThreadEvents;
|
|
299896
300422
|
var init_threadObservation2 = __esm({
|
|
299897
300423
|
"src/devbox/commands/threadObservation.ts"() {
|
|
299898
300424
|
"use strict";
|
|
@@ -299902,6 +300428,7 @@ var init_threadObservation2 = __esm({
|
|
|
299902
300428
|
init_results();
|
|
299903
300429
|
init_errors5();
|
|
299904
300430
|
init_siteUrl();
|
|
300431
|
+
init_pendingInputText();
|
|
299905
300432
|
init_resourceNextAction();
|
|
299906
300433
|
init_resourceOutput();
|
|
299907
300434
|
DEFAULT_THREAD_WAIT_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
@@ -300128,17 +300655,17 @@ var init_threadObservation2 = __esm({
|
|
|
300128
300655
|
fromStart
|
|
300129
300656
|
};
|
|
300130
300657
|
};
|
|
300658
|
+
withPendingInput = (input, text) => input ? `${renderPendingInput(input)}
|
|
300659
|
+
|
|
300660
|
+
${text}` : text;
|
|
300131
300661
|
renderCliAgentToolThreadRead = (data) => {
|
|
300132
300662
|
if ("locator" in data) {
|
|
300133
300663
|
return renderCliAgentToolCanonicalThreadRead(data);
|
|
300134
300664
|
}
|
|
300135
|
-
|
|
300136
|
-
|
|
300137
|
-
|
|
300138
|
-
|
|
300139
|
-
return "No projected conversation content is available yet.";
|
|
300140
|
-
}
|
|
300141
|
-
return data.transcript.messages.map((message) => `[${message.role}] ${message.text}`).join("\n\n");
|
|
300665
|
+
return withPendingInput(
|
|
300666
|
+
data.thread.pendingInput,
|
|
300667
|
+
data.transcript.status !== "ready" ? `Transcript unavailable: ${data.transcript.status}` : data.transcript.messages.length === 0 ? "No projected conversation content is available yet." : data.transcript.messages.map((message) => `[${message.role}] ${message.text}`).join("\n\n")
|
|
300668
|
+
);
|
|
300142
300669
|
};
|
|
300143
300670
|
renderCliAgentToolCanonicalThreadRead = (data) => {
|
|
300144
300671
|
if (data.access.mode === "metadata_only") {
|
|
@@ -300146,16 +300673,18 @@ var init_threadObservation2 = __esm({
|
|
|
300146
300673
|
return `Access required for \u201C${data.thread.title}\u201D${owner}.
|
|
300147
300674
|
${data.locator.url}`;
|
|
300148
300675
|
}
|
|
300149
|
-
|
|
300150
|
-
|
|
300151
|
-
|
|
300152
|
-
|
|
300153
|
-
return "No projected conversation content is available yet.";
|
|
300154
|
-
}
|
|
300155
|
-
return data.transcript.messages.map((message) => `[${message.role}] ${message.text}`).join("\n\n");
|
|
300676
|
+
return withPendingInput(
|
|
300677
|
+
data.pendingInput,
|
|
300678
|
+
!data.transcript || data.transcript.status !== "ready" ? `Transcript unavailable: ${data.transcript?.status ?? "unavailable"}` : data.transcript.messages.length === 0 ? "No projected conversation content is available yet." : data.transcript.messages.map((message) => `[${message.role}] ${message.text}`).join("\n\n")
|
|
300679
|
+
);
|
|
300156
300680
|
};
|
|
300157
300681
|
renderCliAgentToolThreadWait = (data) => {
|
|
300158
300682
|
const header = data.turnId === null ? `Thread is ${data.status}.` : `Turn ${data.turnId} is ${data.status}.`;
|
|
300683
|
+
if (data.pendingInput) {
|
|
300684
|
+
return `${header}
|
|
300685
|
+
|
|
300686
|
+
${renderPendingInput(data.pendingInput)}`;
|
|
300687
|
+
}
|
|
300159
300688
|
if (data.transcript?.status !== "ready" || data.transcript.messages.length === 0) {
|
|
300160
300689
|
return header;
|
|
300161
300690
|
}
|
|
@@ -300594,11 +301123,12 @@ import fsp from "node:fs/promises";
|
|
|
300594
301123
|
import path107 from "node:path";
|
|
300595
301124
|
|
|
300596
301125
|
// src/devbox/compromisedRoots.ts
|
|
301126
|
+
init_devboxCore();
|
|
300597
301127
|
init_colors();
|
|
300598
301128
|
import { X509Certificate } from "node:crypto";
|
|
300599
301129
|
import { existsSync as existsSync4 } from "node:fs";
|
|
300600
301130
|
import path19 from "node:path";
|
|
300601
|
-
import
|
|
301131
|
+
import tls3 from "node:tls";
|
|
300602
301132
|
var COMPROMISED_ROOT_SHA256_FINGERPRINTS = /* @__PURE__ */ new Set([
|
|
300603
301133
|
// emSign ECC Root CA - G3
|
|
300604
301134
|
"86:A1:EC:BA:08:9C:4A:8D:3B:BE:27:34:C6:12:BA:34:1D:81:3E:04:3C:F9:E8:A8:62:CD:5C:57:A3:6B:BE:6B",
|
|
@@ -300609,13 +301139,14 @@ var isCompromisedRoot = (pem) => COMPROMISED_ROOT_SHA256_FINGERPRINTS.has(
|
|
|
300609
301139
|
new X509Certificate(pem).fingerprint256
|
|
300610
301140
|
);
|
|
300611
301141
|
var distrustCompromisedRoots = () => {
|
|
300612
|
-
|
|
300613
|
-
|
|
301142
|
+
setSystemRootFilter((pem) => !isCompromisedRoot(pem));
|
|
301143
|
+
if (typeof tls3.setDefaultCACertificates !== "function") {
|
|
301144
|
+
return !tls3.rootCertificates.some(isCompromisedRoot);
|
|
300614
301145
|
}
|
|
300615
|
-
const current =
|
|
301146
|
+
const current = tls3.getCACertificates("default");
|
|
300616
301147
|
const kept = current.filter((pem) => !isCompromisedRoot(pem));
|
|
300617
301148
|
if (kept.length !== current.length) {
|
|
300618
|
-
|
|
301149
|
+
tls3.setDefaultCACertificates(kept);
|
|
300619
301150
|
}
|
|
300620
301151
|
return true;
|
|
300621
301152
|
};
|
|
@@ -300980,4 +301511,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
300980
301511
|
*)
|
|
300981
301512
|
*/
|
|
300982
301513
|
|
|
300983
|
-
//# debugId=
|
|
301514
|
+
//# debugId=a9a5ab0a-d34f-5b1c-afa5-ae1d2d484362
|