@boxes-dev/dvb-runtime 1.0.1109 → 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 +1148 -583
- package/dist/bin/dvbd.mjs +4541 -609
- 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 +24 -2
- package/dist/product-docs/references/fork-workflows.md +17 -0
- package/dist/product-docs/references/google-cloud.md +8 -0
- package/dist/product-docs/references/mobile.md +17 -7
- package/dist/product-docs/references/onbox-agent-tools.md +145 -4
- package/dist/product-docs/references/ports-terminal-and-runtime.md +32 -0
- 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 +35 -17
- package/dist/product-docs/references/troubleshooting.md +43 -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
|
}
|
|
@@ -95092,42 +95326,65 @@ var init_spritesRegistry = __esm({
|
|
|
95092
95326
|
syncDevboxSentryUserFromControlPlaneToken(token);
|
|
95093
95327
|
return token ?? null;
|
|
95094
95328
|
};
|
|
95329
|
+
DaemonNotLoggedInError = class extends Error {
|
|
95330
|
+
constructor() {
|
|
95331
|
+
super("Not logged in. Run `dvb setup` to log in to boxes.dev.");
|
|
95332
|
+
this.name = "DaemonNotLoggedInError";
|
|
95333
|
+
}
|
|
95334
|
+
};
|
|
95095
95335
|
requireControlPlaneToken = async () => {
|
|
95096
95336
|
const token = await loadControlPlaneToken();
|
|
95097
95337
|
if (!token) {
|
|
95098
|
-
throw new
|
|
95338
|
+
throw new DaemonNotLoggedInError();
|
|
95099
95339
|
}
|
|
95100
95340
|
return token;
|
|
95101
95341
|
};
|
|
95102
|
-
|
|
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 () => {
|
|
95103
95360
|
const controlPlaneToken = await requireControlPlaneToken();
|
|
95104
95361
|
const convexUrl = requireConvexConfig();
|
|
95105
95362
|
const authFingerprint = fingerprintToken(controlPlaneToken);
|
|
95106
95363
|
if (clientCache && clientCache.url === convexUrl && clientCacheAuthFingerprint === authFingerprint) {
|
|
95107
95364
|
if (clientCacheViewerAuthFingerprint !== authFingerprint) {
|
|
95108
|
-
await ensureViewerIdentity(clientCache
|
|
95365
|
+
await ensureViewerIdentity(clientCache, authFingerprint);
|
|
95109
95366
|
}
|
|
95110
95367
|
return clientCache.client;
|
|
95111
95368
|
}
|
|
95112
95369
|
if (clientCache) {
|
|
95113
95370
|
await clientCache.client.close();
|
|
95114
95371
|
}
|
|
95115
|
-
const
|
|
95116
|
-
|
|
95117
|
-
clientCache = { url: convexUrl, client };
|
|
95372
|
+
const created = createClient(convexUrl);
|
|
95373
|
+
clientCache = created;
|
|
95118
95374
|
clientCacheAuthFingerprint = authFingerprint;
|
|
95119
95375
|
clientCacheViewerAuthFingerprint = null;
|
|
95120
|
-
await ensureViewerIdentity(
|
|
95121
|
-
return client;
|
|
95376
|
+
await ensureViewerIdentity(created, authFingerprint);
|
|
95377
|
+
return created.client;
|
|
95122
95378
|
};
|
|
95379
|
+
getClient2 = async () => await withSystemTrustRetry(connectClient);
|
|
95123
95380
|
boxPortsList = makeFunctionReference("spriteDaemonPorts:listForInstance");
|
|
95124
95381
|
logRequest = (method, fn) => {
|
|
95125
95382
|
const requestId2 = randomUUID6();
|
|
95126
|
-
|
|
95383
|
+
logger4.info("convex_request", { requestId: requestId2, method, path: fn });
|
|
95127
95384
|
return requestId2;
|
|
95128
95385
|
};
|
|
95129
95386
|
logResponse = (requestId2, method, fn, status, error55) => {
|
|
95130
|
-
|
|
95387
|
+
logger4.info("convex_response", {
|
|
95131
95388
|
requestId: requestId2,
|
|
95132
95389
|
method,
|
|
95133
95390
|
path: fn,
|
|
@@ -95179,13 +95436,19 @@ var init_spritesRegistry = __esm({
|
|
|
95179
95436
|
}
|
|
95180
95437
|
return instanceId;
|
|
95181
95438
|
};
|
|
95182
|
-
loadViewerIdentity = async (
|
|
95439
|
+
loadViewerIdentity = async ({
|
|
95440
|
+
client,
|
|
95441
|
+
certificateFailure
|
|
95442
|
+
}) => {
|
|
95183
95443
|
const requestId2 = logRequest("query", "hello:getViewer");
|
|
95184
95444
|
try {
|
|
95185
|
-
const viewer = await
|
|
95186
|
-
|
|
95187
|
-
|
|
95188
|
-
|
|
95445
|
+
const viewer = await Promise.race([
|
|
95446
|
+
withConvexRequestTimeout(
|
|
95447
|
+
"hello:getViewer",
|
|
95448
|
+
client.query(helloViewerGet2, {})
|
|
95449
|
+
),
|
|
95450
|
+
certificateFailure
|
|
95451
|
+
]);
|
|
95189
95452
|
if (!viewer) {
|
|
95190
95453
|
logResponse(requestId2, "query", "hello:getViewer", "error", "no_viewer");
|
|
95191
95454
|
return null;
|
|
@@ -95197,22 +95460,25 @@ var init_spritesRegistry = __esm({
|
|
|
95197
95460
|
throw error55;
|
|
95198
95461
|
}
|
|
95199
95462
|
};
|
|
95200
|
-
ensureViewerIdentity = async (
|
|
95463
|
+
ensureViewerIdentity = async (cached3, authFingerprint) => {
|
|
95201
95464
|
if (clientCacheViewerAuthFingerprint === authFingerprint) {
|
|
95202
95465
|
return;
|
|
95203
95466
|
}
|
|
95204
95467
|
let viewer;
|
|
95205
95468
|
try {
|
|
95206
|
-
viewer = await loadViewerIdentity(
|
|
95469
|
+
viewer = await loadViewerIdentity(cached3);
|
|
95207
95470
|
} catch (error55) {
|
|
95471
|
+
if (findCertificateFailure(error55) && clientCache === cached3) {
|
|
95472
|
+
await resetClientCache();
|
|
95473
|
+
}
|
|
95208
95474
|
await handleUnauthorized(error55);
|
|
95209
95475
|
throw error55;
|
|
95210
95476
|
}
|
|
95211
95477
|
if (!viewer) {
|
|
95212
95478
|
await clearControlPlaneAccessToken();
|
|
95213
95479
|
await resetClientCache();
|
|
95214
|
-
|
|
95215
|
-
throw new
|
|
95480
|
+
logger4.warn("control_plane_session_cleared", { error: "no_viewer" });
|
|
95481
|
+
throw new DaemonNotLoggedInError();
|
|
95216
95482
|
}
|
|
95217
95483
|
syncDevboxSentryUserFromViewerIdentity(viewer);
|
|
95218
95484
|
clientCacheViewerAuthFingerprint = authFingerprint;
|
|
@@ -95756,13 +96022,13 @@ var init_spritesRegistry = __esm({
|
|
|
95756
96022
|
|
|
95757
96023
|
// ../daemon/src/ports.ts
|
|
95758
96024
|
import { createHash as createHash7, randomUUID as randomUUID7 } from "node:crypto";
|
|
95759
|
-
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;
|
|
95760
96026
|
var init_ports2 = __esm({
|
|
95761
96027
|
"../daemon/src/ports.ts"() {
|
|
95762
96028
|
"use strict";
|
|
95763
96029
|
init_devboxCore();
|
|
95764
96030
|
init_spritesRegistry();
|
|
95765
|
-
|
|
96031
|
+
logger5 = createLogger("ports");
|
|
95766
96032
|
MAX_PORT3 = 65535;
|
|
95767
96033
|
MAX_PORT_SHIFT = 50;
|
|
95768
96034
|
MIN_UNPRIVILEGED_PORT = 1024;
|
|
@@ -96214,7 +96480,7 @@ var init_ports2 = __esm({
|
|
|
96214
96480
|
await this.handleControlPlaneConnectionStateChange(current);
|
|
96215
96481
|
}
|
|
96216
96482
|
} catch (error55) {
|
|
96217
|
-
|
|
96483
|
+
logger5.warn("ports_control_plane_state_subscription_failed", {
|
|
96218
96484
|
error: String(error55)
|
|
96219
96485
|
});
|
|
96220
96486
|
this.scheduleControlPlaneStateSubscriptionRetry();
|
|
@@ -96353,7 +96619,7 @@ var init_ports2 = __esm({
|
|
|
96353
96619
|
if (!this.started) {
|
|
96354
96620
|
return;
|
|
96355
96621
|
}
|
|
96356
|
-
|
|
96622
|
+
logger5.warn("ports_control_plane_reconnect", {
|
|
96357
96623
|
connected: state.isWebSocketConnected,
|
|
96358
96624
|
hasEverConnected: state.hasEverConnected,
|
|
96359
96625
|
connectionCount: state.connectionCount,
|
|
@@ -96381,7 +96647,7 @@ var init_ports2 = __esm({
|
|
|
96381
96647
|
await this.reconcileAllTracking();
|
|
96382
96648
|
this.disconnectedControlPlaneSince = null;
|
|
96383
96649
|
} catch (error55) {
|
|
96384
|
-
|
|
96650
|
+
logger5.warn("ports_control_plane_reconnect_failed", {
|
|
96385
96651
|
error: String(error55)
|
|
96386
96652
|
});
|
|
96387
96653
|
}
|
|
@@ -96390,7 +96656,7 @@ var init_ports2 = __esm({
|
|
|
96390
96656
|
if (!this.started) {
|
|
96391
96657
|
return;
|
|
96392
96658
|
}
|
|
96393
|
-
|
|
96659
|
+
logger5.warn("ports_control_plane_resubscribe_after_reconnect", {
|
|
96394
96660
|
connected: state.isWebSocketConnected,
|
|
96395
96661
|
hasEverConnected: state.hasEverConnected,
|
|
96396
96662
|
connectionCount: state.connectionCount,
|
|
@@ -96407,7 +96673,7 @@ var init_ports2 = __esm({
|
|
|
96407
96673
|
}
|
|
96408
96674
|
await this.reconcileAllTracking();
|
|
96409
96675
|
} catch (error55) {
|
|
96410
|
-
|
|
96676
|
+
logger5.warn("ports_control_plane_resubscribe_after_reconnect_failed", {
|
|
96411
96677
|
error: String(error55)
|
|
96412
96678
|
});
|
|
96413
96679
|
}
|
|
@@ -96498,7 +96764,7 @@ var init_ports2 = __esm({
|
|
|
96498
96764
|
}
|
|
96499
96765
|
if (!entry.forward) {
|
|
96500
96766
|
void this.ensureForward(entry).catch((error55) => {
|
|
96501
|
-
|
|
96767
|
+
logger5.warn("port_forward_failed", {
|
|
96502
96768
|
box: entry.box,
|
|
96503
96769
|
remotePort: entry.port,
|
|
96504
96770
|
error: String(error55)
|
|
@@ -96539,6 +96805,7 @@ var init_ports2 = __esm({
|
|
|
96539
96805
|
throw new Error("Port forward owner is required.");
|
|
96540
96806
|
}
|
|
96541
96807
|
this.noteBox(box);
|
|
96808
|
+
await this.resolveComputeProviderForBox(box);
|
|
96542
96809
|
const map3 = this.getPortMap(box);
|
|
96543
96810
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
96544
96811
|
let record3 = map3.get(port);
|
|
@@ -96745,7 +97012,7 @@ var init_ports2 = __esm({
|
|
|
96745
97012
|
}
|
|
96746
97013
|
owners.delete(ownerKey);
|
|
96747
97014
|
boxesToReconcile.add(box);
|
|
96748
|
-
|
|
97015
|
+
logger5.info("connect_port_owner_expired", {
|
|
96749
97016
|
box,
|
|
96750
97017
|
ownerKey,
|
|
96751
97018
|
staleAfterMs: this.connectOwnerStaleAfterMs
|
|
@@ -96780,7 +97047,7 @@ var init_ports2 = __esm({
|
|
|
96780
97047
|
this.syncKnownBoxes(entries);
|
|
96781
97048
|
},
|
|
96782
97049
|
onError: (error55) => {
|
|
96783
|
-
|
|
97050
|
+
logger5.warn("ports_known_boxes_subscription_error", {
|
|
96784
97051
|
error: String(error55)
|
|
96785
97052
|
});
|
|
96786
97053
|
if (subscription) {
|
|
@@ -96803,7 +97070,7 @@ var init_ports2 = __esm({
|
|
|
96803
97070
|
this.syncKnownBoxes(current);
|
|
96804
97071
|
}
|
|
96805
97072
|
} catch (error55) {
|
|
96806
|
-
|
|
97073
|
+
logger5.warn("ports_known_boxes_subscription_failed", {
|
|
96807
97074
|
error: String(error55)
|
|
96808
97075
|
});
|
|
96809
97076
|
this.scheduleKnownBoxSubscriptionRetry();
|
|
@@ -96847,7 +97114,7 @@ var init_ports2 = __esm({
|
|
|
96847
97114
|
});
|
|
96848
97115
|
this.syncFromSnapshot(box, entries);
|
|
96849
97116
|
} catch (error55) {
|
|
96850
|
-
|
|
97117
|
+
logger5.warn("ports_snapshot_refresh_failed", {
|
|
96851
97118
|
box,
|
|
96852
97119
|
error: String(error55)
|
|
96853
97120
|
});
|
|
@@ -96941,7 +97208,7 @@ var init_ports2 = __esm({
|
|
|
96941
97208
|
this.buildLeaseRecord(entry, forward.localPort)
|
|
96942
97209
|
);
|
|
96943
97210
|
} catch (error55) {
|
|
96944
|
-
|
|
97211
|
+
logger5.warn("port_forward_lease_refresh_failed", {
|
|
96945
97212
|
box: entry.box,
|
|
96946
97213
|
remotePort: entry.port,
|
|
96947
97214
|
localPort: forward.localPort,
|
|
@@ -96970,7 +97237,7 @@ var init_ports2 = __esm({
|
|
|
96970
97237
|
staleAfterMs: this.portLeaseStaleAfterMs
|
|
96971
97238
|
});
|
|
96972
97239
|
if (leaseResult.kind === "occupied") {
|
|
96973
|
-
|
|
97240
|
+
logger5.info("port_forward_lease_conflict", {
|
|
96974
97241
|
box: entry.box,
|
|
96975
97242
|
remotePort: entry.port,
|
|
96976
97243
|
desiredLocalPort: targetPort,
|
|
@@ -97015,7 +97282,7 @@ var init_ports2 = __esm({
|
|
|
97015
97282
|
} catch (error55) {
|
|
97016
97283
|
await leaseResult.handle.release();
|
|
97017
97284
|
const listenError = error55;
|
|
97018
|
-
|
|
97285
|
+
logger5.info("port_forward_bind_conflict", {
|
|
97019
97286
|
box: entry.box,
|
|
97020
97287
|
remotePort: entry.port,
|
|
97021
97288
|
desiredLocalPort: targetPort,
|
|
@@ -97086,7 +97353,7 @@ var init_ports2 = __esm({
|
|
|
97086
97353
|
this.syncFromSnapshot(box, entries);
|
|
97087
97354
|
},
|
|
97088
97355
|
onError: (error55) => {
|
|
97089
|
-
|
|
97356
|
+
logger5.warn("ports_subscription_error", {
|
|
97090
97357
|
box,
|
|
97091
97358
|
error: String(error55)
|
|
97092
97359
|
});
|
|
@@ -97117,7 +97384,7 @@ var init_ports2 = __esm({
|
|
|
97117
97384
|
this.syncFromSnapshot(box, current);
|
|
97118
97385
|
}
|
|
97119
97386
|
} catch (error55) {
|
|
97120
|
-
|
|
97387
|
+
logger5.warn("ports_subscription_failed", { box, error: String(error55) });
|
|
97121
97388
|
this.scheduleSubscriptionRetry(box);
|
|
97122
97389
|
} finally {
|
|
97123
97390
|
if (promise3 !== null && this.subscriptionPromises.get(box) === promise3) {
|
|
@@ -97297,7 +97564,7 @@ var init_ports2 = __esm({
|
|
|
97297
97564
|
}
|
|
97298
97565
|
if (!record3.forward) {
|
|
97299
97566
|
void this.ensureForward(record3).catch((error55) => {
|
|
97300
|
-
|
|
97567
|
+
logger5.warn("port_forward_failed", {
|
|
97301
97568
|
box: record3.box,
|
|
97302
97569
|
remotePort: record3.port,
|
|
97303
97570
|
error: String(error55)
|
|
@@ -97361,7 +97628,7 @@ var init_ports2 = __esm({
|
|
|
97361
97628
|
entry.forward = forward;
|
|
97362
97629
|
this.startLeaseHeartbeat(entry, forward);
|
|
97363
97630
|
if (heldElsewhereSameTarget) {
|
|
97364
|
-
|
|
97631
|
+
logger5.info("port_forward_same_target_deduped", {
|
|
97365
97632
|
box: entry.box,
|
|
97366
97633
|
remotePort: entry.port,
|
|
97367
97634
|
localPort,
|
|
@@ -97370,7 +97637,7 @@ var init_ports2 = __esm({
|
|
|
97370
97637
|
});
|
|
97371
97638
|
return forward;
|
|
97372
97639
|
}
|
|
97373
|
-
|
|
97640
|
+
logger5.info("port_forward_start", {
|
|
97374
97641
|
box: entry.box,
|
|
97375
97642
|
remotePort: entry.port,
|
|
97376
97643
|
localPort,
|
|
@@ -97391,7 +97658,7 @@ var init_ports2 = __esm({
|
|
|
97391
97658
|
});
|
|
97392
97659
|
});
|
|
97393
97660
|
server?.on("error", (error55) => {
|
|
97394
|
-
|
|
97661
|
+
logger5.error("port_forward_error", {
|
|
97395
97662
|
box: entry.box,
|
|
97396
97663
|
remotePort: entry.port,
|
|
97397
97664
|
localPort,
|
|
@@ -97412,7 +97679,7 @@ var init_ports2 = __esm({
|
|
|
97412
97679
|
try {
|
|
97413
97680
|
proxy = await this.openProxySocketForBox(box);
|
|
97414
97681
|
} catch (error55) {
|
|
97415
|
-
|
|
97682
|
+
logger5.warn("proxy_socket_open_failed", {
|
|
97416
97683
|
connectionId,
|
|
97417
97684
|
box,
|
|
97418
97685
|
remotePort,
|
|
@@ -97434,7 +97701,7 @@ var init_ports2 = __esm({
|
|
|
97434
97701
|
localSocket: socket,
|
|
97435
97702
|
remotePort,
|
|
97436
97703
|
onConnected: () => {
|
|
97437
|
-
|
|
97704
|
+
logger5.info("proxy_connected", {
|
|
97438
97705
|
connectionId,
|
|
97439
97706
|
box,
|
|
97440
97707
|
remotePort,
|
|
@@ -97443,7 +97710,7 @@ var init_ports2 = __esm({
|
|
|
97443
97710
|
});
|
|
97444
97711
|
},
|
|
97445
97712
|
onDisconnected: () => {
|
|
97446
|
-
|
|
97713
|
+
logger5.info("proxy_disconnected", {
|
|
97447
97714
|
connectionId,
|
|
97448
97715
|
box,
|
|
97449
97716
|
remotePort,
|
|
@@ -97509,7 +97776,7 @@ var init_ports2 = __esm({
|
|
|
97509
97776
|
forward.leaseRefreshTimer = null;
|
|
97510
97777
|
}
|
|
97511
97778
|
if (forward.heldElsewhereSameTarget) {
|
|
97512
|
-
|
|
97779
|
+
logger5.info("port_forward_same_target_reference_released", {
|
|
97513
97780
|
box: entry.box,
|
|
97514
97781
|
remotePort: entry.port,
|
|
97515
97782
|
localPort: forward.localPort,
|
|
@@ -97528,14 +97795,14 @@ var init_ports2 = __esm({
|
|
|
97528
97795
|
}
|
|
97529
97796
|
});
|
|
97530
97797
|
await forward.leaseHandle?.release().catch((error55) => {
|
|
97531
|
-
|
|
97798
|
+
logger5.warn("port_forward_lease_release_failed", {
|
|
97532
97799
|
box: entry.box,
|
|
97533
97800
|
remotePort: entry.port,
|
|
97534
97801
|
localPort: forward.localPort,
|
|
97535
97802
|
error: String(error55)
|
|
97536
97803
|
});
|
|
97537
97804
|
});
|
|
97538
|
-
|
|
97805
|
+
logger5.info("port_forward_stop", {
|
|
97539
97806
|
box: entry.box,
|
|
97540
97807
|
remotePort: entry.port,
|
|
97541
97808
|
localPort: forward.localPort,
|
|
@@ -97569,7 +97836,7 @@ import { existsSync as existsSync5 } from "node:fs";
|
|
|
97569
97836
|
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
97570
97837
|
import net4 from "node:net";
|
|
97571
97838
|
import path21 from "node:path";
|
|
97572
|
-
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;
|
|
97573
97840
|
var init_src = __esm({
|
|
97574
97841
|
"../daemon/src/index.ts"() {
|
|
97575
97842
|
init_devboxCore();
|
|
@@ -97578,7 +97845,7 @@ var init_src = __esm({
|
|
|
97578
97845
|
readPackageVersion = () => {
|
|
97579
97846
|
return readCurrentPackageVersion() ?? "unknown";
|
|
97580
97847
|
};
|
|
97581
|
-
|
|
97848
|
+
logger6 = createLogger("devboxd");
|
|
97582
97849
|
startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
97583
97850
|
daemonVersion = readPackageVersion();
|
|
97584
97851
|
DAEMON_API_VERSION = 4;
|
|
@@ -97805,6 +98072,13 @@ var init_src = __esm({
|
|
|
97805
98072
|
...upgradeRequired.minVersion ? { minVersion: upgradeRequired.minVersion } : {}
|
|
97806
98073
|
};
|
|
97807
98074
|
}
|
|
98075
|
+
if (error55 instanceof DaemonNotLoggedInError) {
|
|
98076
|
+
return {
|
|
98077
|
+
statusCode: 401,
|
|
98078
|
+
error: "control_plane_auth_invalid",
|
|
98079
|
+
message: error55.message
|
|
98080
|
+
};
|
|
98081
|
+
}
|
|
97808
98082
|
const message = error55 instanceof Error ? error55.message.trim() : typeof error55 === "string" ? error55.trim() : String(error55);
|
|
97809
98083
|
if (errorType === "registry_error") {
|
|
97810
98084
|
const normalized = message.toLowerCase();
|
|
@@ -97829,7 +98103,7 @@ var init_src = __esm({
|
|
|
97829
98103
|
}
|
|
97830
98104
|
const classified = classifyRequestError(errorType, error55);
|
|
97831
98105
|
if (classified.error === "client_upgrade_required") {
|
|
97832
|
-
|
|
98106
|
+
logger6.warn(errorType, {
|
|
97833
98107
|
error: String(error55),
|
|
97834
98108
|
statusCode: classified.statusCode
|
|
97835
98109
|
});
|
|
@@ -97840,7 +98114,18 @@ var init_src = __esm({
|
|
|
97840
98114
|
});
|
|
97841
98115
|
return;
|
|
97842
98116
|
}
|
|
97843
|
-
|
|
98117
|
+
if (classified.error === "control_plane_auth_invalid") {
|
|
98118
|
+
logger6.warn(errorType, {
|
|
98119
|
+
error: String(error55),
|
|
98120
|
+
statusCode: classified.statusCode
|
|
98121
|
+
});
|
|
98122
|
+
writeJson(res, classified.statusCode, {
|
|
98123
|
+
error: classified.error,
|
|
98124
|
+
message: classified.message
|
|
98125
|
+
});
|
|
98126
|
+
return;
|
|
98127
|
+
}
|
|
98128
|
+
logger6.error(errorType, { error: String(error55) });
|
|
97844
98129
|
captureDevboxException(error55, {
|
|
97845
98130
|
tags: {
|
|
97846
98131
|
handled: "true",
|
|
@@ -97857,19 +98142,21 @@ var init_src = __esm({
|
|
|
97857
98142
|
fetchLatestPackageVersion = async () => {
|
|
97858
98143
|
const requestId2 = randomUUID8();
|
|
97859
98144
|
const url3 = new URL(PACKAGE_UPDATE_URL);
|
|
97860
|
-
|
|
98145
|
+
logger6.info("npm_package_version_request", {
|
|
97861
98146
|
requestId: requestId2,
|
|
97862
98147
|
requestUrl: PACKAGE_UPDATE_URL,
|
|
97863
98148
|
requestPath: url3.pathname,
|
|
97864
98149
|
packageName: PACKAGE_UPDATE_NAME
|
|
97865
98150
|
});
|
|
97866
|
-
const response = await
|
|
97867
|
-
|
|
97868
|
-
|
|
97869
|
-
|
|
97870
|
-
|
|
97871
|
-
|
|
97872
|
-
|
|
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", {
|
|
97873
98160
|
requestId: requestId2,
|
|
97874
98161
|
requestUrl: PACKAGE_UPDATE_URL,
|
|
97875
98162
|
requestPath: url3.pathname,
|
|
@@ -97895,7 +98182,7 @@ var init_src = __esm({
|
|
|
97895
98182
|
await writeCachedPackageVersion(PACKAGE_UPDATE_NAME, latestVersion, {
|
|
97896
98183
|
...homeDir2 ? { homeDir: homeDir2 } : {}
|
|
97897
98184
|
});
|
|
97898
|
-
|
|
98185
|
+
logger6.info("npm_package_version_updated", {
|
|
97899
98186
|
packageName: PACKAGE_UPDATE_NAME,
|
|
97900
98187
|
latestVersion
|
|
97901
98188
|
});
|
|
@@ -97909,7 +98196,7 @@ var init_src = __esm({
|
|
|
97909
98196
|
try {
|
|
97910
98197
|
await refreshPackageVersionCache();
|
|
97911
98198
|
} catch (error55) {
|
|
97912
|
-
|
|
98199
|
+
logger6.warn("npm_package_version_check_failed", {
|
|
97913
98200
|
packageName: PACKAGE_UPDATE_NAME,
|
|
97914
98201
|
error: String(error55)
|
|
97915
98202
|
});
|
|
@@ -97996,7 +98283,7 @@ var init_src = __esm({
|
|
|
97996
98283
|
const portManager = new PortManager({ runtimeDir });
|
|
97997
98284
|
portManager.start();
|
|
97998
98285
|
const portManagerReady = buildBoxSummaries().then((boxes) => primePortManagerFromBoxes(portManager, boxes)).catch((error55) => {
|
|
97999
|
-
|
|
98286
|
+
logger6.warn("ports_registry_seed_failed", {
|
|
98000
98287
|
error: String(error55)
|
|
98001
98288
|
});
|
|
98002
98289
|
});
|
|
@@ -98004,7 +98291,7 @@ var init_src = __esm({
|
|
|
98004
98291
|
const requestId2 = req.headers["x-request-id"] ?? randomUUID8();
|
|
98005
98292
|
const path108 = readRequestPath(req);
|
|
98006
98293
|
res.on("finish", () => {
|
|
98007
|
-
|
|
98294
|
+
logger6.info("daemon_request", {
|
|
98008
98295
|
requestId: requestId2,
|
|
98009
98296
|
method: req.method,
|
|
98010
98297
|
path: path108,
|
|
@@ -98286,7 +98573,7 @@ var init_src = __esm({
|
|
|
98286
98573
|
writeJson(res, 404, { error: "not_found" });
|
|
98287
98574
|
});
|
|
98288
98575
|
server.on("error", (error55) => {
|
|
98289
|
-
|
|
98576
|
+
logger6.error("daemon_error", { error: String(error55) });
|
|
98290
98577
|
captureDevboxException(error55, {
|
|
98291
98578
|
tags: {
|
|
98292
98579
|
handled: "false",
|
|
@@ -98298,7 +98585,7 @@ var init_src = __esm({
|
|
|
98298
98585
|
});
|
|
98299
98586
|
await new Promise((resolve3, reject) => {
|
|
98300
98587
|
server.once("listening", () => {
|
|
98301
|
-
|
|
98588
|
+
logger6.info("daemon_listening", { socketPath });
|
|
98302
98589
|
resolve3();
|
|
98303
98590
|
});
|
|
98304
98591
|
server.once("error", reject);
|
|
@@ -98331,7 +98618,7 @@ var init_src = __esm({
|
|
|
98331
98618
|
stopInstallOwnerMonitor = startInstallOwnerMonitor(
|
|
98332
98619
|
ownerPaths,
|
|
98333
98620
|
(missingOwners) => {
|
|
98334
|
-
|
|
98621
|
+
logger6.warn("daemon_owner_paths_missing", {
|
|
98335
98622
|
socketPath,
|
|
98336
98623
|
ownerPaths,
|
|
98337
98624
|
missingOwners
|
|
@@ -98359,7 +98646,7 @@ var init_src = __esm({
|
|
|
98359
98646
|
};
|
|
98360
98647
|
const handleSignal = () => {
|
|
98361
98648
|
const forceExitTimer = setTimeout(() => {
|
|
98362
|
-
|
|
98649
|
+
logger6.warn("daemon_shutdown_force_exit", {
|
|
98363
98650
|
timeoutMs: DAEMON_SIGNAL_SHUTDOWN_TIMEOUT_MS
|
|
98364
98651
|
});
|
|
98365
98652
|
process.exit(0);
|
|
@@ -98430,7 +98717,7 @@ var init_auth = __esm({
|
|
|
98430
98717
|
try {
|
|
98431
98718
|
const token = await refreshToken();
|
|
98432
98719
|
if (retryCount > 0) {
|
|
98433
|
-
|
|
98720
|
+
logger3.info("control_plane_auth_refresh_recovered", {
|
|
98434
98721
|
retryCount
|
|
98435
98722
|
});
|
|
98436
98723
|
}
|
|
@@ -98441,7 +98728,7 @@ var init_auth = __esm({
|
|
|
98441
98728
|
}
|
|
98442
98729
|
const retryDelayMs = retryDelaysMs[Math.min(retryCount, retryDelaysMs.length - 1)];
|
|
98443
98730
|
retryCount += 1;
|
|
98444
|
-
|
|
98731
|
+
logger3.warn("control_plane_auth_refresh_unavailable_retrying", {
|
|
98445
98732
|
requestId: error55.requestId,
|
|
98446
98733
|
method: error55.method,
|
|
98447
98734
|
path: error55.path,
|
|
@@ -98565,7 +98852,7 @@ var init_auth = __esm({
|
|
|
98565
98852
|
stage?.("Checking boxes.dev login");
|
|
98566
98853
|
const viewer = await authApi.fetchViewerIdentity(token);
|
|
98567
98854
|
if (!viewer) {
|
|
98568
|
-
|
|
98855
|
+
logger3.warn("control_plane_viewer_missing");
|
|
98569
98856
|
return null;
|
|
98570
98857
|
}
|
|
98571
98858
|
syncDevboxSentryUserFromViewerIdentity(viewer);
|
|
@@ -98576,14 +98863,14 @@ var init_auth = __esm({
|
|
|
98576
98863
|
return await refreshControlPlaneToken(store, authApi, stage);
|
|
98577
98864
|
} catch (error55) {
|
|
98578
98865
|
if (isControlPlaneSessionRefreshRejectionError(error55)) {
|
|
98579
|
-
|
|
98866
|
+
logger3.warn("control_plane_refresh_rejected", { error: String(error55) });
|
|
98580
98867
|
await clearControlPlaneSession(store);
|
|
98581
98868
|
throw new ControlPlaneLoginRequiredError("session_invalid", {
|
|
98582
98869
|
cause: error55
|
|
98583
98870
|
});
|
|
98584
98871
|
}
|
|
98585
98872
|
if (isControlPlaneRequestUnavailableError(error55) || error55 instanceof ControlPlaneRequestError && (error55.statusCode === 429 || error55.statusCode >= 500)) {
|
|
98586
|
-
|
|
98873
|
+
logger3.warn("control_plane_refresh_unavailable", {
|
|
98587
98874
|
error: String(error55)
|
|
98588
98875
|
});
|
|
98589
98876
|
throw new ControlPlaneAuthUnavailableError({ cause: error55 });
|
|
@@ -98665,7 +98952,7 @@ var init_auth = __esm({
|
|
|
98665
98952
|
stage?.(CONTROL_PLANE_INTERACTIVE_SIGNIN_STAGE);
|
|
98666
98953
|
const tokens = await authApi.signInWithBrowser();
|
|
98667
98954
|
await updateControlPlaneSession(store, tokens.token, tokens.refreshToken);
|
|
98668
|
-
|
|
98955
|
+
logger3.info("control_plane_signed_in");
|
|
98669
98956
|
return await resolveStoredControlPlaneSession(store, stage, authApi);
|
|
98670
98957
|
};
|
|
98671
98958
|
ensureControlPlaneToken = async (store, stage, authApi = defaultControlPlaneAuthApi) => {
|
|
@@ -98709,7 +98996,7 @@ var init_auth = __esm({
|
|
|
98709
98996
|
throw new ControlPlaneAuthRefreshError({ cause: error55 });
|
|
98710
98997
|
}
|
|
98711
98998
|
if (existing && !isTokenExpired(existing)) {
|
|
98712
|
-
|
|
98999
|
+
logger3.warn("control_plane_refresh_unavailable_using_existing_token", {
|
|
98713
99000
|
error: String(error55)
|
|
98714
99001
|
});
|
|
98715
99002
|
return existing;
|
|
@@ -98959,6 +99246,7 @@ var init_daemonClient = __esm({
|
|
|
98959
99246
|
"src/devbox/daemonClient.ts"() {
|
|
98960
99247
|
"use strict";
|
|
98961
99248
|
init_devboxCore();
|
|
99249
|
+
init_authErrors();
|
|
98962
99250
|
init_controlPlane();
|
|
98963
99251
|
init_daemonWorkingDirectory();
|
|
98964
99252
|
init_logger3();
|
|
@@ -99015,6 +99303,14 @@ var init_daemonClient = __esm({
|
|
|
99015
99303
|
if (upgradeRequired) {
|
|
99016
99304
|
throw upgradeRequired;
|
|
99017
99305
|
}
|
|
99306
|
+
const errorCode = readNonEmptyString6(
|
|
99307
|
+
extractDaemonErrorPayload(response.body).error
|
|
99308
|
+
);
|
|
99309
|
+
if (errorCode === "control_plane_auth_invalid" || errorCode === "control_plane_auth_missing") {
|
|
99310
|
+
throw new ControlPlaneLoginRequiredError("signed_out", {
|
|
99311
|
+
message: formatDaemonResponseError(response)
|
|
99312
|
+
});
|
|
99313
|
+
}
|
|
99018
99314
|
throw new Error(formatDaemonResponseError(response));
|
|
99019
99315
|
};
|
|
99020
99316
|
DaemonConnectionError = class extends Error {
|
|
@@ -99126,7 +99422,7 @@ var init_daemonClient = __esm({
|
|
|
99126
99422
|
if (exitedGracefully) {
|
|
99127
99423
|
return;
|
|
99128
99424
|
}
|
|
99129
|
-
|
|
99425
|
+
logger3.warn("daemon_force_kill", {
|
|
99130
99426
|
socketPath,
|
|
99131
99427
|
pid,
|
|
99132
99428
|
reason
|
|
@@ -99153,7 +99449,7 @@ var init_daemonClient = __esm({
|
|
|
99153
99449
|
};
|
|
99154
99450
|
requestJson2 = async (socketPath, method, requestPath, timeoutMs, body) => {
|
|
99155
99451
|
const requestId2 = randomUUID9();
|
|
99156
|
-
|
|
99452
|
+
logger3.info("daemon_request", {
|
|
99157
99453
|
requestId: requestId2,
|
|
99158
99454
|
method,
|
|
99159
99455
|
path: requestPath
|
|
@@ -99188,7 +99484,7 @@ var init_daemonClient = __esm({
|
|
|
99188
99484
|
parsedBody = JSON.parse(payload2);
|
|
99189
99485
|
} catch (error55) {
|
|
99190
99486
|
parseError = error55 instanceof Error ? error55.message : "invalid_json";
|
|
99191
|
-
|
|
99487
|
+
logger3.warn("daemon_response_invalid_json", {
|
|
99192
99488
|
requestId: requestId2,
|
|
99193
99489
|
method,
|
|
99194
99490
|
path: requestPath,
|
|
@@ -99197,7 +99493,7 @@ var init_daemonClient = __esm({
|
|
|
99197
99493
|
});
|
|
99198
99494
|
}
|
|
99199
99495
|
}
|
|
99200
|
-
|
|
99496
|
+
logger3.info("daemon_response", {
|
|
99201
99497
|
requestId: requestId2,
|
|
99202
99498
|
method,
|
|
99203
99499
|
path: requestPath,
|
|
@@ -99308,7 +99604,7 @@ var init_daemonClient = __esm({
|
|
|
99308
99604
|
} catch {
|
|
99309
99605
|
logFd = null;
|
|
99310
99606
|
}
|
|
99311
|
-
|
|
99607
|
+
logger3.info("daemon_spawn", {
|
|
99312
99608
|
socketPath,
|
|
99313
99609
|
command: command.command,
|
|
99314
99610
|
args: command.args,
|
|
@@ -99364,7 +99660,7 @@ var init_daemonClient = __esm({
|
|
|
99364
99660
|
candidates.delete(primary);
|
|
99365
99661
|
return [...candidates].filter((socketPath) => {
|
|
99366
99662
|
if (!isSocketPathTooLong(socketPath)) return true;
|
|
99367
|
-
|
|
99663
|
+
logger3.warn("daemon_duplicate_check_skipped", {
|
|
99368
99664
|
socketPath,
|
|
99369
99665
|
reason: "socket_path_too_long"
|
|
99370
99666
|
});
|
|
@@ -99382,7 +99678,7 @@ var init_daemonClient = __esm({
|
|
|
99382
99678
|
DAEMON_TIMEOUT_MS.health
|
|
99383
99679
|
);
|
|
99384
99680
|
if (health.status === 200 && health.body.ok) {
|
|
99385
|
-
|
|
99681
|
+
logger3.warn("daemon_duplicate_detected", {
|
|
99386
99682
|
socketPath,
|
|
99387
99683
|
pid: health.body.pid
|
|
99388
99684
|
});
|
|
@@ -99390,7 +99686,7 @@ var init_daemonClient = __esm({
|
|
|
99390
99686
|
}
|
|
99391
99687
|
} catch (error55) {
|
|
99392
99688
|
if (!isConnectionError(error55)) {
|
|
99393
|
-
|
|
99689
|
+
logger3.warn("daemon_duplicate_check_failed", {
|
|
99394
99690
|
socketPath,
|
|
99395
99691
|
error: String(error55)
|
|
99396
99692
|
});
|
|
@@ -99425,7 +99721,7 @@ var init_daemonClient = __esm({
|
|
|
99425
99721
|
const pids = listDaemonPidsForSocket(socketPath);
|
|
99426
99722
|
for (const pid of pids) {
|
|
99427
99723
|
if (pid === keepPid) continue;
|
|
99428
|
-
|
|
99724
|
+
logger3.warn("daemon_duplicate_same_socket_detected", {
|
|
99429
99725
|
socketPath,
|
|
99430
99726
|
keepPid,
|
|
99431
99727
|
duplicatePid: pid
|
|
@@ -99435,7 +99731,7 @@ var init_daemonClient = __esm({
|
|
|
99435
99731
|
} catch (error55) {
|
|
99436
99732
|
const code2 = error55?.code;
|
|
99437
99733
|
if (code2 !== "ESRCH") {
|
|
99438
|
-
|
|
99734
|
+
logger3.warn("daemon_duplicate_same_socket_stop_failed", {
|
|
99439
99735
|
socketPath,
|
|
99440
99736
|
duplicatePid: pid,
|
|
99441
99737
|
error: String(error55)
|
|
@@ -99464,7 +99760,7 @@ var init_daemonClient = __esm({
|
|
|
99464
99760
|
startedAtMs
|
|
99465
99761
|
});
|
|
99466
99762
|
if (!mismatch.shouldRestart) return health;
|
|
99467
|
-
|
|
99763
|
+
logger3.warn(
|
|
99468
99764
|
mismatch.versionMismatch ? "daemon_version_mismatch" : "daemon_script_stale",
|
|
99469
99765
|
{
|
|
99470
99766
|
socketPath,
|
|
@@ -99478,7 +99774,7 @@ var init_daemonClient = __esm({
|
|
|
99478
99774
|
try {
|
|
99479
99775
|
await stopDaemon(socketPath);
|
|
99480
99776
|
} catch (error55) {
|
|
99481
|
-
|
|
99777
|
+
logger3.warn("daemon_restart_failed", {
|
|
99482
99778
|
socketPath,
|
|
99483
99779
|
pid: health.pid,
|
|
99484
99780
|
error: String(error55)
|
|
@@ -99528,7 +99824,7 @@ var init_daemonClient = __esm({
|
|
|
99528
99824
|
const existingDaemonPids = listDaemonPidsForSocket(socketPath);
|
|
99529
99825
|
const socketExists = await hasSocketPath(socketPath);
|
|
99530
99826
|
if (existingDaemonPids.length > 0 && !socketExists) {
|
|
99531
|
-
|
|
99827
|
+
logger3.warn("daemon_orphan_detected", {
|
|
99532
99828
|
socketPath,
|
|
99533
99829
|
pids: existingDaemonPids
|
|
99534
99830
|
});
|
|
@@ -99554,7 +99850,7 @@ var init_daemonClient = __esm({
|
|
|
99554
99850
|
} catch {
|
|
99555
99851
|
}
|
|
99556
99852
|
if (existingDaemonPids.length > 0) {
|
|
99557
|
-
|
|
99853
|
+
logger3.warn("daemon_unhealthy_reaping_before_restart", {
|
|
99558
99854
|
socketPath,
|
|
99559
99855
|
pids: existingDaemonPids
|
|
99560
99856
|
});
|
|
@@ -99612,7 +99908,7 @@ var init_daemonClient = __esm({
|
|
|
99612
99908
|
if (existingDaemonPids.length === 0) {
|
|
99613
99909
|
return false;
|
|
99614
99910
|
}
|
|
99615
|
-
|
|
99911
|
+
logger3.warn("daemon_orphan_detected", {
|
|
99616
99912
|
socketPath,
|
|
99617
99913
|
pids: existingDaemonPids
|
|
99618
99914
|
});
|
|
@@ -99622,7 +99918,7 @@ var init_daemonClient = __esm({
|
|
|
99622
99918
|
"stop_daemon_orphan"
|
|
99623
99919
|
);
|
|
99624
99920
|
if (await hasSocketPath(socketPath)) {
|
|
99625
|
-
|
|
99921
|
+
logger3.warn("daemon_socket_still_present_after_stop", {
|
|
99626
99922
|
socketPath
|
|
99627
99923
|
});
|
|
99628
99924
|
}
|
|
@@ -103777,7 +104073,7 @@ var init_sessionProtocol = __esm({
|
|
|
103777
104073
|
}
|
|
103778
104074
|
if (!opened) {
|
|
103779
104075
|
pendingInput.push(nextChunk);
|
|
103780
|
-
|
|
104076
|
+
logger3.debug("connect_stdin_buffered_preopen", {
|
|
103781
104077
|
...summarizeInputChunk(nextChunk),
|
|
103782
104078
|
pendingInputCount: pendingInput.length
|
|
103783
104079
|
});
|
|
@@ -103785,7 +104081,7 @@ var init_sessionProtocol = __esm({
|
|
|
103785
104081
|
}
|
|
103786
104082
|
if (options.tty && nextChunk.length === 1 && nextChunk[0] === detachControl.byte) {
|
|
103787
104083
|
stderr.write("\r\nDetached.\r\n");
|
|
103788
|
-
|
|
104084
|
+
logger3.info("connect_stdin_detach_key", {
|
|
103789
104085
|
opened,
|
|
103790
104086
|
readyState: ws.readyState,
|
|
103791
104087
|
key: detachControl.label
|
|
@@ -103794,7 +104090,7 @@ var init_sessionProtocol = __esm({
|
|
|
103794
104090
|
return;
|
|
103795
104091
|
}
|
|
103796
104092
|
if (typeof ws.readyState === "number" && ws.readyState !== WS_OPEN_STATE) {
|
|
103797
|
-
|
|
104093
|
+
logger3.warn("connect_stdin_socket_not_open", {
|
|
103798
104094
|
readyState: ws.readyState,
|
|
103799
104095
|
opened,
|
|
103800
104096
|
...summarizeInputChunk(nextChunk)
|
|
@@ -103813,7 +104109,7 @@ var init_sessionProtocol = __esm({
|
|
|
103813
104109
|
startInputProbe();
|
|
103814
104110
|
}
|
|
103815
104111
|
if (hasRecoveryKey) {
|
|
103816
|
-
|
|
104112
|
+
logger3.info("connect_stdin_recovery_key", {
|
|
103817
104113
|
...summarizeInputChunk(nextChunk),
|
|
103818
104114
|
ageMs,
|
|
103819
104115
|
streamProbeMisses,
|
|
@@ -103833,7 +104129,7 @@ var init_sessionProtocol = __esm({
|
|
|
103833
104129
|
try {
|
|
103834
104130
|
sendInput(nextChunk);
|
|
103835
104131
|
} catch {
|
|
103836
|
-
|
|
104132
|
+
logger3.warn("connect_stdin_send_failed", {
|
|
103837
104133
|
...summarizeInputChunk(nextChunk),
|
|
103838
104134
|
ageMs,
|
|
103839
104135
|
readyState: ws.readyState
|
|
@@ -103945,10 +104241,10 @@ var init_sessionProtocol = __esm({
|
|
|
103945
104241
|
stdin.setRawMode(true);
|
|
103946
104242
|
rawModeEnabled = true;
|
|
103947
104243
|
} catch {
|
|
103948
|
-
|
|
104244
|
+
logger3.warn("connect_stdin_rawmode_enable_failed");
|
|
103949
104245
|
}
|
|
103950
104246
|
}
|
|
103951
|
-
|
|
104247
|
+
logger3.info("connect_stdin_start", {
|
|
103952
104248
|
tty: options.tty,
|
|
103953
104249
|
stdinIsTty: stdin.isTTY,
|
|
103954
104250
|
rawModeEnabled
|
|
@@ -103971,10 +104267,10 @@ var init_sessionProtocol = __esm({
|
|
|
103971
104267
|
stdin.setRawMode(false);
|
|
103972
104268
|
rawModeRestored = true;
|
|
103973
104269
|
} catch {
|
|
103974
|
-
|
|
104270
|
+
logger3.warn("connect_stdin_rawmode_restore_failed");
|
|
103975
104271
|
}
|
|
103976
104272
|
}
|
|
103977
|
-
|
|
104273
|
+
logger3.info("connect_stdin_stop", {
|
|
103978
104274
|
tty: options.tty,
|
|
103979
104275
|
stdinIsTty: stdin.isTTY,
|
|
103980
104276
|
rawModeRestored
|
|
@@ -104025,7 +104321,7 @@ var init_sessionProtocol = __esm({
|
|
|
104025
104321
|
};
|
|
104026
104322
|
const onClose = (event) => {
|
|
104027
104323
|
closeCode = typeof event?.code === "number" ? event.code : closeCode;
|
|
104028
|
-
|
|
104324
|
+
logger3.info("connect_ws_close", {
|
|
104029
104325
|
opened,
|
|
104030
104326
|
closeCode,
|
|
104031
104327
|
exitCode
|
|
@@ -104093,7 +104389,7 @@ var init_sessionProtocol = __esm({
|
|
|
104093
104389
|
};
|
|
104094
104390
|
if (closeCode !== void 0) result.closeCode = closeCode;
|
|
104095
104391
|
if (errorMessage2) result.errorMessage = errorMessage2;
|
|
104096
|
-
|
|
104392
|
+
logger3.warn("connect_ws_error", {
|
|
104097
104393
|
opened,
|
|
104098
104394
|
closeCode,
|
|
104099
104395
|
errorMessage: errorMessage2
|
|
@@ -104107,7 +104403,7 @@ var init_sessionProtocol = __esm({
|
|
|
104107
104403
|
opened = true;
|
|
104108
104404
|
markAlive();
|
|
104109
104405
|
latency?.noteConnectOpen();
|
|
104110
|
-
|
|
104406
|
+
logger3.info("connect_ws_open", {
|
|
104111
104407
|
tty: options.tty,
|
|
104112
104408
|
stdin: options.stdin
|
|
104113
104409
|
});
|
|
@@ -108861,7 +109157,7 @@ var require_dist2 = __commonJS({
|
|
|
108861
109157
|
function randomID() {
|
|
108862
109158
|
return Math.random().toString(36).slice(2, 11);
|
|
108863
109159
|
}
|
|
108864
|
-
function
|
|
109160
|
+
function createClient2(clientOptions) {
|
|
108865
109161
|
let {
|
|
108866
109162
|
baseUrl = "",
|
|
108867
109163
|
Request: CustomRequest = globalThis.Request,
|
|
@@ -109153,7 +109449,7 @@ var require_dist2 = __commonJS({
|
|
|
109153
109449
|
return client;
|
|
109154
109450
|
}
|
|
109155
109451
|
function createPathBasedClient(clientOptions) {
|
|
109156
|
-
return wrapAsPathBasedClient(
|
|
109452
|
+
return wrapAsPathBasedClient(createClient2(clientOptions));
|
|
109157
109453
|
}
|
|
109158
109454
|
function serializePrimitiveParam(name, value, options) {
|
|
109159
109455
|
if (value === void 0 || value === null) {
|
|
@@ -109371,7 +109667,7 @@ var require_dist2 = __commonJS({
|
|
|
109371
109667
|
exports.createFinalURL = createFinalURL;
|
|
109372
109668
|
exports.createPathBasedClient = createPathBasedClient;
|
|
109373
109669
|
exports.createQuerySerializer = createQuerySerializer;
|
|
109374
|
-
exports.default =
|
|
109670
|
+
exports.default = createClient2;
|
|
109375
109671
|
exports.defaultBodySerializer = defaultBodySerializer;
|
|
109376
109672
|
exports.defaultPathSerializer = defaultPathSerializer;
|
|
109377
109673
|
exports.mergeHeaders = mergeHeaders;
|
|
@@ -117497,7 +117793,7 @@ var require_promise_client = __commonJS({
|
|
|
117497
117793
|
}
|
|
117498
117794
|
};
|
|
117499
117795
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
117500
|
-
exports.createClient =
|
|
117796
|
+
exports.createClient = createClient2;
|
|
117501
117797
|
exports.createUnaryFn = createUnaryFn;
|
|
117502
117798
|
exports.createServerStreamingFn = createServerStreamingFn;
|
|
117503
117799
|
exports.createClientStreamingFn = createClientStreamingFn;
|
|
@@ -117506,7 +117802,7 @@ var require_promise_client = __commonJS({
|
|
|
117506
117802
|
var connect_error_js_1 = require_connect_error();
|
|
117507
117803
|
var code_js_1 = require_code2();
|
|
117508
117804
|
var async_iterable_js_1 = require_async_iterable();
|
|
117509
|
-
function
|
|
117805
|
+
function createClient2(service, transport) {
|
|
117510
117806
|
return (0, any_client_js_1.makeAnyClient)(service, (method) => {
|
|
117511
117807
|
switch (method.methodKind) {
|
|
117512
117808
|
case "unary":
|
|
@@ -128630,14 +128926,14 @@ var require_dist3 = __commonJS({
|
|
|
128630
128926
|
function formatLog(log3) {
|
|
128631
128927
|
return JSON.parse(JSON.stringify(log3));
|
|
128632
128928
|
}
|
|
128633
|
-
function createRpcLogger(
|
|
128929
|
+
function createRpcLogger(logger13) {
|
|
128634
128930
|
function logEach(stream) {
|
|
128635
128931
|
return __asyncGenerator(this, null, function* () {
|
|
128636
128932
|
var _a32;
|
|
128637
128933
|
try {
|
|
128638
128934
|
for (var iter = __forAwait(stream), more, temp, error55; more = !(temp = yield new __await(iter.next())).done; more = false) {
|
|
128639
128935
|
const m = temp.value;
|
|
128640
|
-
(_a32 =
|
|
128936
|
+
(_a32 = logger13.debug) == null ? void 0 : _a32.call(logger13, "Response stream:", formatLog(m));
|
|
128641
128937
|
yield m;
|
|
128642
128938
|
}
|
|
128643
128939
|
} catch (temp2) {
|
|
@@ -128654,31 +128950,31 @@ var require_dist3 = __commonJS({
|
|
|
128654
128950
|
}
|
|
128655
128951
|
return (next) => async (req) => {
|
|
128656
128952
|
var _a32, _b3;
|
|
128657
|
-
(_a32 =
|
|
128953
|
+
(_a32 = logger13.info) == null ? void 0 : _a32.call(logger13, `Request: POST ${req.url}`);
|
|
128658
128954
|
const res = await next(req);
|
|
128659
128955
|
if (res.stream) {
|
|
128660
128956
|
return __spreadProps(__spreadValues({}, res), {
|
|
128661
128957
|
message: logEach(res.message)
|
|
128662
128958
|
});
|
|
128663
128959
|
} else {
|
|
128664
|
-
(_b3 =
|
|
128960
|
+
(_b3 = logger13.info) == null ? void 0 : _b3.call(logger13, "Response:", formatLog(res.message));
|
|
128665
128961
|
}
|
|
128666
128962
|
return res;
|
|
128667
128963
|
};
|
|
128668
128964
|
}
|
|
128669
|
-
function createApiLogger(
|
|
128965
|
+
function createApiLogger(logger13) {
|
|
128670
128966
|
return {
|
|
128671
128967
|
async onRequest({ request: request2 }) {
|
|
128672
128968
|
var _a32;
|
|
128673
|
-
(_a32 =
|
|
128969
|
+
(_a32 = logger13.info) == null ? void 0 : _a32.call(logger13, `Request ${request2.method} ${request2.url}`);
|
|
128674
128970
|
return request2;
|
|
128675
128971
|
},
|
|
128676
128972
|
async onResponse({ response }) {
|
|
128677
128973
|
var _a32, _b3;
|
|
128678
128974
|
if (response.status >= 400) {
|
|
128679
|
-
(_a32 =
|
|
128975
|
+
(_a32 = logger13.error) == null ? void 0 : _a32.call(logger13, "Response:", response.status, response.statusText);
|
|
128680
128976
|
} else {
|
|
128681
|
-
(_b3 =
|
|
128977
|
+
(_b3 = logger13.info) == null ? void 0 : _b3.call(logger13, "Response:", response.status, response.statusText);
|
|
128682
128978
|
}
|
|
128683
128979
|
return response;
|
|
128684
128980
|
}
|
|
@@ -134606,7 +134902,7 @@ var init_directDaemonTtyChannel = __esm({
|
|
|
134606
134902
|
|
|
134607
134903
|
// src/devbox/commands/provider/directDaemonRuntime.ts
|
|
134608
134904
|
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
134609
|
-
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;
|
|
134610
134906
|
var init_directDaemonRuntime = __esm({
|
|
134611
134907
|
"src/devbox/commands/provider/directDaemonRuntime.ts"() {
|
|
134612
134908
|
"use strict";
|
|
@@ -134616,6 +134912,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
134616
134912
|
init_logger3();
|
|
134617
134913
|
init_daemonRuntimeShared();
|
|
134618
134914
|
init_directDaemonTtyChannel();
|
|
134915
|
+
SystemTrustWebSocket2 = withSystemTrustWebSocket(wrapper_default2);
|
|
134619
134916
|
DIRECT_DAEMON_CONTROL_WS_PATH = "/ws";
|
|
134620
134917
|
DIRECT_DAEMON_CONTROL_IDLE_MS = 15 * 60 * 1e3;
|
|
134621
134918
|
DIRECT_DAEMON_CONTROL_CONNECT_TIMEOUT_PADDING_MS = 1e4;
|
|
@@ -134628,7 +134925,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
134628
134925
|
DIRECT_DAEMON_CONTROL_PONG_GRACE_MS = 45e3;
|
|
134629
134926
|
DIRECT_DAEMON_REQUEST_TRANSPORT_RETRY_LIMIT = 1;
|
|
134630
134927
|
DIRECT_DAEMON_REQUEST_TIMEOUT_USER_MESSAGE = "The machine did not respond in time. Resume setup to continue.";
|
|
134631
|
-
|
|
134928
|
+
logger7 = createLogger("direct_daemon_runtime");
|
|
134632
134929
|
CodexThreadArchiveCapabilityUnavailableError = class extends Error {
|
|
134633
134930
|
targetKind;
|
|
134634
134931
|
operation;
|
|
@@ -135006,7 +135303,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135006
135303
|
retryable: true,
|
|
135007
135304
|
message: `${formatProviderLabel(this.provider)} control websocket missed keepalive pong for ${String(pongGraceMs)}ms.`
|
|
135008
135305
|
});
|
|
135009
|
-
|
|
135306
|
+
logger7.warn(
|
|
135010
135307
|
"direct_daemon_control_keepalive_timeout",
|
|
135011
135308
|
this.buildLogFields({
|
|
135012
135309
|
elapsedSincePongMs,
|
|
@@ -135061,7 +135358,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135061
135358
|
const pendingEntries = [...this.pendingRequests.entries()];
|
|
135062
135359
|
this.pendingRequests.clear();
|
|
135063
135360
|
if (pendingEntries.length > 0) {
|
|
135064
|
-
|
|
135361
|
+
logger7.warn(
|
|
135065
135362
|
"direct_daemon_control_pending_requests_failed",
|
|
135066
135363
|
this.buildLogFields({
|
|
135067
135364
|
failedRequestCount: pendingEntries.length,
|
|
@@ -135129,7 +135426,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135129
135426
|
const pending = this.pendingRequests.get(responseRequestId);
|
|
135130
135427
|
if (!pending) {
|
|
135131
135428
|
if (this.ignoredResponseRequestIds.delete(responseRequestId)) {
|
|
135132
|
-
|
|
135429
|
+
logger7.debug(
|
|
135133
135430
|
"direct_daemon_control_response_ignored_after_abort",
|
|
135134
135431
|
this.buildLogFields({
|
|
135135
135432
|
requestId: responseRequestId,
|
|
@@ -135138,7 +135435,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135138
135435
|
);
|
|
135139
135436
|
return;
|
|
135140
135437
|
}
|
|
135141
|
-
|
|
135438
|
+
logger7.warn(
|
|
135142
135439
|
"direct_daemon_control_response_unmatched",
|
|
135143
135440
|
this.buildLogFields({
|
|
135144
135441
|
requestId: responseRequestId,
|
|
@@ -135156,7 +135453,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135156
135453
|
pending.abortSignal.removeEventListener("abort", pending.abortListener);
|
|
135157
135454
|
}
|
|
135158
135455
|
this.scheduleIdleClose();
|
|
135159
|
-
|
|
135456
|
+
logger7.debug(
|
|
135160
135457
|
"direct_daemon_control_response_received",
|
|
135161
135458
|
this.buildLogFields({
|
|
135162
135459
|
requestId: responseRequestId,
|
|
@@ -135306,7 +135603,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135306
135603
|
timing.connectAttemptTimeoutMs,
|
|
135307
135604
|
Math.max(1, remainingAttemptBudgetMs)
|
|
135308
135605
|
);
|
|
135309
|
-
|
|
135606
|
+
logger7.debug(
|
|
135310
135607
|
"direct_daemon_control_socket_connect_start",
|
|
135311
135608
|
this.buildLogFields({
|
|
135312
135609
|
...buildDirectDaemonWsLogFields(lastConnectInfo, this.intent),
|
|
@@ -135317,13 +135614,12 @@ var init_directDaemonRuntime = __esm({
|
|
|
135317
135614
|
...buildDirectDaemonRequestLogFields(args.requestPayload)
|
|
135318
135615
|
})
|
|
135319
135616
|
);
|
|
135320
|
-
|
|
135321
|
-
|
|
135322
|
-
traceStartupStage,
|
|
135323
|
-
attemptTimeoutMs
|
|
135617
|
+
const connectInfo = lastConnectInfo;
|
|
135618
|
+
await withSystemTrustRetry(
|
|
135619
|
+
() => this.connectOnce(connectInfo, traceStartupStage, attemptTimeoutMs)
|
|
135324
135620
|
);
|
|
135325
135621
|
if (this.reconnecting || attempt > 1) {
|
|
135326
|
-
|
|
135622
|
+
logger7.info(
|
|
135327
135623
|
"direct_daemon_control_socket_reconnected",
|
|
135328
135624
|
this.buildLogFields({
|
|
135329
135625
|
attempt,
|
|
@@ -135341,7 +135637,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135341
135637
|
if (lastConnectInfo && isDirectDaemonTransportError(failure) && failure.providerRecoveryReason && !providerRecoveryAttempted) {
|
|
135342
135638
|
providerRecoveryAttempted = true;
|
|
135343
135639
|
const recoveryRequestId = randomUUID10();
|
|
135344
|
-
|
|
135640
|
+
logger7.warn(
|
|
135345
135641
|
"direct_daemon_control_provider_recovery_start",
|
|
135346
135642
|
this.buildLogFields({
|
|
135347
135643
|
requestId: recoveryRequestId,
|
|
@@ -135363,7 +135659,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135363
135659
|
connectInfo: lastConnectInfo,
|
|
135364
135660
|
recoveredTarget
|
|
135365
135661
|
});
|
|
135366
|
-
|
|
135662
|
+
logger7.info(
|
|
135367
135663
|
"direct_daemon_control_provider_recovery_ready",
|
|
135368
135664
|
this.buildLogFields({
|
|
135369
135665
|
requestId: recoveryRequestId,
|
|
@@ -135376,7 +135672,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135376
135672
|
continue;
|
|
135377
135673
|
}
|
|
135378
135674
|
if (!isDirectDaemonTransportError(failure)) {
|
|
135379
|
-
|
|
135675
|
+
logger7.warn(
|
|
135380
135676
|
"direct_daemon_control_connect_info_failed",
|
|
135381
135677
|
this.buildLogFields({
|
|
135382
135678
|
attempt,
|
|
@@ -135401,7 +135697,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135401
135697
|
}
|
|
135402
135698
|
this.reconnecting = true;
|
|
135403
135699
|
const retryInMs = Math.min(delayMs, remainingMs);
|
|
135404
|
-
|
|
135700
|
+
logger7.warn(
|
|
135405
135701
|
"direct_daemon_control_socket_connect_retry",
|
|
135406
135702
|
this.buildLogFields({
|
|
135407
135703
|
attempt,
|
|
@@ -135439,10 +135735,15 @@ var init_directDaemonRuntime = __esm({
|
|
|
135439
135735
|
);
|
|
135440
135736
|
}
|
|
135441
135737
|
async connectOnce(connectInfo, traceStartupStage, attemptTimeoutMs) {
|
|
135738
|
+
if (this.disposed) {
|
|
135739
|
+
throw new Error(
|
|
135740
|
+
`${formatProviderLabel(this.provider)} control socket is closed.`
|
|
135741
|
+
);
|
|
135742
|
+
}
|
|
135442
135743
|
this.cleanupWebSocket();
|
|
135443
135744
|
await new Promise((resolve3, reject) => {
|
|
135444
135745
|
let settled = false;
|
|
135445
|
-
const ws = new
|
|
135746
|
+
const ws = new SystemTrustWebSocket2(
|
|
135446
135747
|
buildDirectDaemonWsUrl(connectInfo, this.intent)
|
|
135447
135748
|
);
|
|
135448
135749
|
traceStartupStage("websocket_created", { attemptTimeoutMs });
|
|
@@ -135499,7 +135800,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135499
135800
|
ws.on("open", () => {
|
|
135500
135801
|
clearOpeningTimer();
|
|
135501
135802
|
traceStartupStage("websocket_open");
|
|
135502
|
-
|
|
135803
|
+
logger7.debug(
|
|
135503
135804
|
"direct_daemon_control_socket_open",
|
|
135504
135805
|
this.buildLogFields(
|
|
135505
135806
|
buildDirectDaemonWsLogFields(connectInfo, this.intent)
|
|
@@ -135524,7 +135825,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135524
135825
|
ws.on("message", (raw) => {
|
|
135525
135826
|
const parsed = parseDaemonJsonRecord(raw);
|
|
135526
135827
|
if (!parsed) {
|
|
135527
|
-
|
|
135828
|
+
logger7.warn(
|
|
135528
135829
|
"direct_daemon_control_socket_message_parse_failed",
|
|
135529
135830
|
this.buildLogFields({
|
|
135530
135831
|
rawBytes: measureDirectDaemonRawMessageBytes(raw)
|
|
@@ -135602,7 +135903,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135602
135903
|
this.controlCapabilities = new Set(ready.capabilities);
|
|
135603
135904
|
this.lastPongAt = Date.now();
|
|
135604
135905
|
this.startKeepalive();
|
|
135605
|
-
|
|
135906
|
+
logger7.debug(
|
|
135606
135907
|
"direct_daemon_control_socket_ready",
|
|
135607
135908
|
this.buildLogFields(
|
|
135608
135909
|
buildDirectDaemonWsLogFields(connectInfo, this.intent)
|
|
@@ -135657,20 +135958,21 @@ var init_directDaemonRuntime = __esm({
|
|
|
135657
135958
|
this.lastPongAt = Date.now();
|
|
135658
135959
|
});
|
|
135659
135960
|
ws.on("error", (error55) => {
|
|
135660
|
-
|
|
135961
|
+
logger7.warn(
|
|
135661
135962
|
"direct_daemon_control_socket_error",
|
|
135662
135963
|
this.buildLogFields({
|
|
135663
135964
|
...buildDirectDaemonWsLogFields(connectInfo, this.intent),
|
|
135664
135965
|
error: error55.message
|
|
135665
135966
|
})
|
|
135666
135967
|
);
|
|
135968
|
+
const untrusted = isUntrustedCertificateError(error55);
|
|
135667
135969
|
const transportError = createDirectDaemonTransportError({
|
|
135668
135970
|
provider: this.provider,
|
|
135669
135971
|
alias: this.alias,
|
|
135670
135972
|
transportCode: "socket_error",
|
|
135671
|
-
retryable:
|
|
135973
|
+
retryable: !untrusted,
|
|
135672
135974
|
message: `${formatProviderLabel(this.provider)} control websocket error: ${error55.message}`,
|
|
135673
|
-
...grantStage === "awaiting_challenge" ? { providerRecoveryReason: "socket_unreachable" } : {},
|
|
135975
|
+
...grantStage === "awaiting_challenge" && !untrusted ? { providerRecoveryReason: "socket_unreachable" } : {},
|
|
135674
135976
|
cause: error55
|
|
135675
135977
|
});
|
|
135676
135978
|
if (!this.authenticated) {
|
|
@@ -135681,7 +135983,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135681
135983
|
});
|
|
135682
135984
|
ws.on("close", (code2, reason) => {
|
|
135683
135985
|
const reasonText = reason.toString("utf8");
|
|
135684
|
-
|
|
135986
|
+
logger7.warn(
|
|
135685
135987
|
"direct_daemon_control_socket_close",
|
|
135686
135988
|
this.buildLogFields({
|
|
135687
135989
|
...buildDirectDaemonWsLogFields(connectInfo, this.intent),
|
|
@@ -135755,7 +136057,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135755
136057
|
);
|
|
135756
136058
|
}
|
|
135757
136059
|
this.scheduleIdleClose();
|
|
135758
|
-
|
|
136060
|
+
logger7.warn(
|
|
135759
136061
|
"direct_daemon_control_request_timeout",
|
|
135760
136062
|
this.buildLogFields({
|
|
135761
136063
|
requestId: requestId2,
|
|
@@ -135820,7 +136122,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135820
136122
|
});
|
|
135821
136123
|
}
|
|
135822
136124
|
refDirectDaemonWebSocket(ws);
|
|
135823
|
-
|
|
136125
|
+
logger7.debug(
|
|
135824
136126
|
"direct_daemon_control_request_send",
|
|
135825
136127
|
this.buildLogFields({
|
|
135826
136128
|
requestId: requestId2,
|
|
@@ -135946,7 +136248,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
135946
136248
|
}
|
|
135947
136249
|
this.disposed = true;
|
|
135948
136250
|
this.reconnecting = false;
|
|
135949
|
-
|
|
136251
|
+
logger7.debug("direct_daemon_control_socket_dispose", this.buildLogFields());
|
|
135950
136252
|
this.clearIdleTimer();
|
|
135951
136253
|
this.failPendingRequests(
|
|
135952
136254
|
new Error(
|
|
@@ -136032,7 +136334,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
136032
136334
|
try {
|
|
136033
136335
|
const response = await executeRequest(forceRefresh);
|
|
136034
136336
|
if (transportRetries > 0) {
|
|
136035
|
-
|
|
136337
|
+
logger7.info(
|
|
136036
136338
|
"direct_daemon_control_request_retry_recovered",
|
|
136037
136339
|
buildDirectDaemonOperationLogFields({
|
|
136038
136340
|
alias: args.alias,
|
|
@@ -136049,7 +136351,7 @@ var init_directDaemonRuntime = __esm({
|
|
|
136049
136351
|
if (transportRetries < DIRECT_DAEMON_REQUEST_TRANSPORT_RETRY_LIMIT && isDirectDaemonReplaySafeRequest(args.requestPayload) && isDirectDaemonTransportError(error55) && error55.retryable) {
|
|
136050
136352
|
transportRetries += 1;
|
|
136051
136353
|
forceRefresh = true;
|
|
136052
|
-
|
|
136354
|
+
logger7.warn("direct_daemon_control_request_retry", {
|
|
136053
136355
|
...buildDirectDaemonOperationLogFields({
|
|
136054
136356
|
alias: args.alias,
|
|
136055
136357
|
provider: args.provider,
|
|
@@ -138571,7 +138873,7 @@ var init_connect2 = __esm({
|
|
|
138571
138873
|
try {
|
|
138572
138874
|
boxes = await listDevboxes();
|
|
138573
138875
|
} catch (error55) {
|
|
138574
|
-
|
|
138876
|
+
logger3.warn("registry_boxes_lookup_failed", { error: String(error55) });
|
|
138575
138877
|
}
|
|
138576
138878
|
}
|
|
138577
138879
|
if (!resolvedTarget && parsed.target && !parsedTarget.session) {
|
|
@@ -138665,7 +138967,7 @@ var init_connect2 = __esm({
|
|
|
138665
138967
|
latency?.setContext({ box: spriteAlias });
|
|
138666
138968
|
}
|
|
138667
138969
|
} catch (error55) {
|
|
138668
|
-
|
|
138970
|
+
logger3.warn("session_id_resolution_failed", { error: String(error55) });
|
|
138669
138971
|
}
|
|
138670
138972
|
}
|
|
138671
138973
|
stage("Syncing machine");
|
|
@@ -138705,7 +139007,7 @@ var init_connect2 = __esm({
|
|
|
138705
139007
|
return;
|
|
138706
139008
|
}
|
|
138707
139009
|
} catch (error55) {
|
|
138708
|
-
|
|
139010
|
+
logger3.warn("ports_snapshot_failed", { error: String(error55) });
|
|
138709
139011
|
}
|
|
138710
139012
|
}
|
|
138711
139013
|
if (pendingPortLogs.get(event.port) === token) {
|
|
@@ -138754,7 +139056,7 @@ var init_connect2 = __esm({
|
|
|
138754
139056
|
}
|
|
138755
139057
|
);
|
|
138756
139058
|
if (response.status !== 200) {
|
|
138757
|
-
|
|
139059
|
+
logger3.warn("connect_port_owner_release_failed", {
|
|
138758
139060
|
box: spriteAlias,
|
|
138759
139061
|
sessionId: connectOwnerSessionId,
|
|
138760
139062
|
status: response.status,
|
|
@@ -138762,7 +139064,7 @@ var init_connect2 = __esm({
|
|
|
138762
139064
|
});
|
|
138763
139065
|
}
|
|
138764
139066
|
} catch (error55) {
|
|
138765
|
-
|
|
139067
|
+
logger3.warn("connect_port_owner_release_failed", {
|
|
138766
139068
|
box: spriteAlias,
|
|
138767
139069
|
sessionId: connectOwnerSessionId,
|
|
138768
139070
|
error: String(error55)
|
|
@@ -138779,13 +139081,13 @@ var init_connect2 = __esm({
|
|
|
138779
139081
|
{ alias: spriteAlias }
|
|
138780
139082
|
);
|
|
138781
139083
|
if (response.status !== 200) {
|
|
138782
|
-
|
|
139084
|
+
logger3.warn("registry_usage_failed", {
|
|
138783
139085
|
status: response.status,
|
|
138784
139086
|
error: response.body?.error
|
|
138785
139087
|
});
|
|
138786
139088
|
}
|
|
138787
139089
|
} catch (error55) {
|
|
138788
|
-
|
|
139090
|
+
logger3.warn("registry_usage_failed", { error: String(error55) });
|
|
138789
139091
|
} finally {
|
|
138790
139092
|
traceEmbeddedStartup("registry_usage_finished");
|
|
138791
139093
|
}
|
|
@@ -138803,7 +139105,7 @@ var init_connect2 = __esm({
|
|
|
138803
139105
|
}
|
|
138804
139106
|
connectOwnerHeartbeatTimer = setInterval(() => {
|
|
138805
139107
|
void renewConnectPortOwner().catch((error55) => {
|
|
138806
|
-
|
|
139108
|
+
logger3.warn("connect_port_owner_heartbeat_failed", {
|
|
138807
139109
|
box: spriteAlias,
|
|
138808
139110
|
sessionId: connectOwnerSessionId,
|
|
138809
139111
|
error: String(error55)
|
|
@@ -138831,7 +139133,7 @@ var init_connect2 = __esm({
|
|
|
138831
139133
|
setupStatus = summary?.setupStatus ?? null;
|
|
138832
139134
|
}
|
|
138833
139135
|
} catch (error55) {
|
|
138834
|
-
|
|
139136
|
+
logger3.warn("registry_setup_status_failed", { error: String(error55) });
|
|
138835
139137
|
}
|
|
138836
139138
|
}
|
|
138837
139139
|
if (setupStatus && setupStatus !== "complete") {
|
|
@@ -138854,14 +139156,14 @@ var init_connect2 = __esm({
|
|
|
138854
139156
|
computeProvider
|
|
138855
139157
|
});
|
|
138856
139158
|
} catch (error55) {
|
|
138857
|
-
|
|
139159
|
+
logger3.warn("workdir_lookup_failed", {
|
|
138858
139160
|
box: spriteAlias,
|
|
138859
139161
|
error: String(error55)
|
|
138860
139162
|
});
|
|
138861
139163
|
}
|
|
138862
139164
|
connectShell = await resolveConnectShell(client, spriteAlias);
|
|
138863
139165
|
}
|
|
138864
|
-
const warnSessionMap = (event, fields) =>
|
|
139166
|
+
const warnSessionMap = (event, fields) => logger3.warn(event, fields);
|
|
138865
139167
|
const initialSessionState = await initializeSessionMapState({
|
|
138866
139168
|
client,
|
|
138867
139169
|
alias: spriteAlias,
|
|
@@ -139115,7 +139417,7 @@ ${message}\r
|
|
|
139115
139417
|
}
|
|
139116
139418
|
};
|
|
139117
139419
|
const onSigint = () => {
|
|
139118
|
-
|
|
139420
|
+
logger3.info("connect_sigint", {
|
|
139119
139421
|
connectPhase,
|
|
139120
139422
|
hasActiveSocket: Boolean(activeSocket),
|
|
139121
139423
|
localCancelRequested
|
|
@@ -139125,21 +139427,21 @@ ${message}\r
|
|
|
139125
139427
|
try {
|
|
139126
139428
|
activeSocket.terminate?.();
|
|
139127
139429
|
} catch {
|
|
139128
|
-
|
|
139430
|
+
logger3.warn("connect_sigint_terminate_failed", {
|
|
139129
139431
|
connectPhase
|
|
139130
139432
|
});
|
|
139131
139433
|
}
|
|
139132
139434
|
try {
|
|
139133
139435
|
activeSocket.close();
|
|
139134
139436
|
} catch {
|
|
139135
|
-
|
|
139437
|
+
logger3.warn("connect_sigint_close_failed", {
|
|
139136
139438
|
connectPhase
|
|
139137
139439
|
});
|
|
139138
139440
|
}
|
|
139139
139441
|
};
|
|
139140
139442
|
const setConnectPhase = (phase) => {
|
|
139141
139443
|
if (connectPhase !== phase) {
|
|
139142
|
-
|
|
139444
|
+
logger3.debug("connect_phase_change", {
|
|
139143
139445
|
from: connectPhase,
|
|
139144
139446
|
to: phase
|
|
139145
139447
|
});
|
|
@@ -139168,7 +139470,7 @@ ${message}\r
|
|
|
139168
139470
|
try {
|
|
139169
139471
|
await refreshSessionMapping();
|
|
139170
139472
|
} catch (error55) {
|
|
139171
|
-
|
|
139473
|
+
logger3.warn("session_refresh_failed", { error: String(error55) });
|
|
139172
139474
|
}
|
|
139173
139475
|
if (explicitName && sessionName && !sessionId && !confirmedCreateExplicit) {
|
|
139174
139476
|
pauseStatus();
|
|
@@ -139245,7 +139547,7 @@ ${message}\r
|
|
|
139245
139547
|
mappingWrite.then(() => {
|
|
139246
139548
|
reportSessionInfo(id2);
|
|
139247
139549
|
}).catch((error55) => {
|
|
139248
|
-
|
|
139550
|
+
logger3.warn("session_auto_rename_failed", {
|
|
139249
139551
|
error: String(error55)
|
|
139250
139552
|
});
|
|
139251
139553
|
reportSessionInfo(id2);
|
|
@@ -139297,7 +139599,7 @@ ${message}\r
|
|
|
139297
139599
|
try {
|
|
139298
139600
|
await mappingWrite;
|
|
139299
139601
|
} catch (error55) {
|
|
139300
|
-
|
|
139602
|
+
logger3.warn("session_write_failed", { error: String(error55) });
|
|
139301
139603
|
}
|
|
139302
139604
|
}
|
|
139303
139605
|
const streamOutcome = resolveConnectStreamOutcome({
|
|
@@ -139361,7 +139663,7 @@ ${message}\r
|
|
|
139361
139663
|
sessionId = void 0;
|
|
139362
139664
|
}
|
|
139363
139665
|
} catch (error55) {
|
|
139364
|
-
|
|
139666
|
+
logger3.warn("session_lookup_failed", { error: String(error55) });
|
|
139365
139667
|
}
|
|
139366
139668
|
}
|
|
139367
139669
|
}
|
|
@@ -139395,7 +139697,7 @@ ${message}\r
|
|
|
139395
139697
|
homeDir: homeDir2
|
|
139396
139698
|
});
|
|
139397
139699
|
} catch (error55) {
|
|
139398
|
-
|
|
139700
|
+
logger3.warn("completion_cache_update_failed", { error: String(error55) });
|
|
139399
139701
|
}
|
|
139400
139702
|
if (outcome === null) {
|
|
139401
139703
|
throw new Error("Connect ended without a terminal outcome.");
|
|
@@ -140102,7 +140404,7 @@ var init_cp = __esm({
|
|
|
140102
140404
|
computeProvider: target.computeProvider
|
|
140103
140405
|
})
|
|
140104
140406
|
});
|
|
140105
|
-
|
|
140407
|
+
logger3.info("cp_start", {
|
|
140106
140408
|
box: target.box,
|
|
140107
140409
|
provider: target.computeProvider,
|
|
140108
140410
|
kind: sourceStats.isDirectory() ? "directory" : "file",
|
|
@@ -140122,7 +140424,7 @@ var init_cp = __esm({
|
|
|
140122
140424
|
remotePath,
|
|
140123
140425
|
...onProgress ? { onProgress } : {}
|
|
140124
140426
|
});
|
|
140125
|
-
|
|
140427
|
+
logger3.info("cp_complete", {
|
|
140126
140428
|
box: target.box,
|
|
140127
140429
|
provider: target.computeProvider,
|
|
140128
140430
|
kind: sourceStats.isDirectory() ? "directory" : "file",
|
|
@@ -140183,7 +140485,7 @@ var init_cp = __esm({
|
|
|
140183
140485
|
})
|
|
140184
140486
|
});
|
|
140185
140487
|
} catch (error55) {
|
|
140186
|
-
|
|
140488
|
+
logger3.warn("cp_failed", {
|
|
140187
140489
|
box: providerTarget.alias,
|
|
140188
140490
|
provider: providerTarget.computeProvider,
|
|
140189
140491
|
sourcePath,
|
|
@@ -142487,7 +142789,7 @@ var init_cliAgentToolsContract = __esm({
|
|
|
142487
142789
|
});
|
|
142488
142790
|
|
|
142489
142791
|
// ../../../../shared/threadRuntime/cliAgentToolsProjection.ts
|
|
142490
|
-
var projectCliAgentToolsProjectV1, resolveCliAgentToolsThreadStatusV1, projectCliAgentToolsThreadContextV1;
|
|
142792
|
+
var projectCliAgentToolsProjectV1, resolveCliAgentToolsThreadStatusV1, pendingInputHoldsTurn, resolveThreadStatusWithPendingInput, projectCliAgentToolsThreadContextV1;
|
|
142491
142793
|
var init_cliAgentToolsProjection = __esm({
|
|
142492
142794
|
"../../../../shared/threadRuntime/cliAgentToolsProjection.ts"() {
|
|
142493
142795
|
"use strict";
|
|
@@ -142535,6 +142837,8 @@ var init_cliAgentToolsProjection = __esm({
|
|
|
142535
142837
|
}
|
|
142536
142838
|
return activeTurnId === null ? "idle" : "running";
|
|
142537
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;
|
|
142538
142842
|
projectCliAgentToolsThreadContextV1 = (thread) => ({
|
|
142539
142843
|
clientThreadId: thread.clientThreadId,
|
|
142540
142844
|
agent: thread.backend,
|
|
@@ -142799,7 +143103,8 @@ var init_forkExecutionStatusTone = __esm({
|
|
|
142799
143103
|
sleeping: "idle",
|
|
142800
143104
|
waking: "warning",
|
|
142801
143105
|
upgrading: "warning",
|
|
142802
|
-
|
|
143106
|
+
// The box keeps working on its current version, so this is a warning.
|
|
143107
|
+
upgrade_failed: "warning",
|
|
142803
143108
|
not_responding: "warning"
|
|
142804
143109
|
};
|
|
142805
143110
|
hasFreshRunningObservation = ({
|
|
@@ -143396,7 +143701,7 @@ var init_onboxOtherDevboxDestructionAccess = __esm({
|
|
|
143396
143701
|
});
|
|
143397
143702
|
|
|
143398
143703
|
// ../../../../shared/onboxAgentPermissionRequestProtocol.ts
|
|
143399
|
-
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;
|
|
143400
143705
|
var init_onboxAgentPermissionRequestProtocol = __esm({
|
|
143401
143706
|
"../../../../shared/onboxAgentPermissionRequestProtocol.ts"() {
|
|
143402
143707
|
"use strict";
|
|
@@ -143426,15 +143731,29 @@ var init_onboxAgentPermissionRequestProtocol = __esm({
|
|
|
143426
143731
|
"edit-project-settings",
|
|
143427
143732
|
"edit-team-template",
|
|
143428
143733
|
"edit-personal-environment",
|
|
143429
|
-
"edit-automations"
|
|
143734
|
+
"edit-automations",
|
|
143735
|
+
"edit-tailscale-integration",
|
|
143736
|
+
"edit-google-cloud-integration",
|
|
143737
|
+
"change-aws-profile",
|
|
143738
|
+
"enable-tailscale-integration"
|
|
143430
143739
|
];
|
|
143431
143740
|
ONBOX_AGENT_THREAD_GRANT_PERMISSIONS = [
|
|
143432
143741
|
"edit-template-box",
|
|
143433
143742
|
"edit-project-settings",
|
|
143434
143743
|
"edit-team-template",
|
|
143435
143744
|
"edit-personal-environment",
|
|
143436
|
-
"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"
|
|
143437
143752
|
];
|
|
143753
|
+
isOnboxAgentExactActionPermission = (permission) => ONBOX_AGENT_EXACT_ACTION_PERMISSIONS.includes(
|
|
143754
|
+
permission
|
|
143755
|
+
);
|
|
143756
|
+
ONBOX_AGENT_EXACT_ACTION_APPLY_TTL_MS = 10 * 60 * 1e3;
|
|
143438
143757
|
ONBOX_AGENT_THREAD_GRANT_TTL_MS = 3 * 60 * 60 * 1e3;
|
|
143439
143758
|
isOnboxAgentThreadGrantPermission = (permission) => ONBOX_AGENT_THREAD_GRANT_PERMISSIONS.includes(
|
|
143440
143759
|
permission
|
|
@@ -143449,7 +143768,7 @@ var init_onboxAgentPermissionRequestProtocol = __esm({
|
|
|
143449
143768
|
});
|
|
143450
143769
|
|
|
143451
143770
|
// ../../../../shared/onboxAgentPermissionRequestPresentation.ts
|
|
143452
|
-
var permissionQuestions, threadGrantScope, buildOnboxAgentPermissionRequestPresentation;
|
|
143771
|
+
var permissionQuestions, threadGrantScope, describeAwsAccess, presentAction, buildOnboxAgentPermissionRequestPresentation;
|
|
143453
143772
|
var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
143454
143773
|
"../../../../shared/onboxAgentPermissionRequestPresentation.ts"() {
|
|
143455
143774
|
"use strict";
|
|
@@ -143478,7 +143797,11 @@ var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
|
143478
143797
|
"edit-project-settings": "Allow this thread to edit project settings?",
|
|
143479
143798
|
"edit-team-template": "Allow this thread to edit the Team Template?",
|
|
143480
143799
|
"edit-personal-environment": "Allow this thread to edit your environment variables?",
|
|
143481
|
-
"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?"
|
|
143482
143805
|
};
|
|
143483
143806
|
threadGrantScope = (permission, teamTemplateName) => {
|
|
143484
143807
|
switch (permission) {
|
|
@@ -143488,18 +143811,79 @@ var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
|
143488
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.";
|
|
143489
143812
|
case "edit-personal-environment":
|
|
143490
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.";
|
|
143491
143818
|
case "edit-automations":
|
|
143492
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.";
|
|
143493
143820
|
case "edit-team-template":
|
|
143494
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.`;
|
|
143495
143822
|
}
|
|
143496
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
|
+
};
|
|
143497
143868
|
buildOnboxAgentPermissionRequestPresentation = ({
|
|
143498
143869
|
permission,
|
|
143499
143870
|
sourceBoxKind,
|
|
143500
143871
|
projectScopeAvailable,
|
|
143501
|
-
teamTemplateName
|
|
143872
|
+
teamTemplateName,
|
|
143873
|
+
action
|
|
143502
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
|
+
};
|
|
143503
143887
|
const box = sourceBoxKind === "template_box" ? "Template box" : "devbox";
|
|
143504
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.`;
|
|
143505
143889
|
return {
|
|
@@ -143510,6 +143894,8 @@ var init_onboxAgentPermissionRequestPresentation = __esm({
|
|
|
143510
143894
|
linkText: "automations",
|
|
143511
143895
|
after: " section."
|
|
143512
143896
|
} : null,
|
|
143897
|
+
details: [],
|
|
143898
|
+
agentReason: null,
|
|
143513
143899
|
allowLabel: isOnboxAgentThreadGrantPermission(permission) ? "Allow for 3 hours" : "Allow",
|
|
143514
143900
|
declineLabel: "Deny",
|
|
143515
143901
|
projectAllowLabel: "Always allow for project"
|
|
@@ -143779,7 +144165,7 @@ var init_commandContext = __esm({
|
|
|
143779
144165
|
projects.map((project) => project.projectAlias)
|
|
143780
144166
|
);
|
|
143781
144167
|
} catch (error55) {
|
|
143782
|
-
|
|
144168
|
+
logger3.warn("completion_cache_update_failed", {
|
|
143783
144169
|
error: String(error55)
|
|
143784
144170
|
});
|
|
143785
144171
|
}
|
|
@@ -144613,12 +144999,12 @@ var init_managedCodex = __esm({
|
|
|
144613
144999
|
versionsDir
|
|
144614
145000
|
});
|
|
144615
145001
|
if (removedVersions.length > 0) {
|
|
144616
|
-
|
|
145002
|
+
logger3.info("managed_codex_old_versions_removed", {
|
|
144617
145003
|
removedVersions
|
|
144618
145004
|
});
|
|
144619
145005
|
}
|
|
144620
145006
|
} catch (error55) {
|
|
144621
|
-
|
|
145007
|
+
logger3.warn("managed_codex_old_versions_remove_failed", {
|
|
144622
145008
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
144623
145009
|
});
|
|
144624
145010
|
}
|
|
@@ -165585,7 +165971,7 @@ var init_nativeAgentImageUpload = __esm({
|
|
|
165585
165971
|
gestureSignal: signal ?? null,
|
|
165586
165972
|
abortAttempt: (reason) => attemptController.abort(reason)
|
|
165587
165973
|
});
|
|
165588
|
-
|
|
165974
|
+
logger3.info("native_agent_image_upload_complete", {
|
|
165589
165975
|
alias,
|
|
165590
165976
|
attempt,
|
|
165591
165977
|
byteCount: metadata.reduce((sum, image2) => sum + image2.sizeBytes, 0),
|
|
@@ -165604,7 +165990,7 @@ var init_nativeAgentImageUpload = __esm({
|
|
|
165604
165990
|
});
|
|
165605
165991
|
}
|
|
165606
165992
|
if (attempt < ATTEMPT_LIMIT && isDirectDaemonTransportError(error55) && error55.transportCode !== "missing_capabilities" && error55.retryable) {
|
|
165607
|
-
|
|
165993
|
+
logger3.warn("native_agent_image_upload_recovery", {
|
|
165608
165994
|
alias,
|
|
165609
165995
|
attempt,
|
|
165610
165996
|
imageCount: images.length,
|
|
@@ -169409,7 +169795,7 @@ var init_agentDirectThread = __esm({
|
|
|
169409
169795
|
target
|
|
169410
169796
|
});
|
|
169411
169797
|
assertContractVersion(started, "Empty thread start");
|
|
169412
|
-
|
|
169798
|
+
logger3.info("direct_agent_thread_start_requested", {
|
|
169413
169799
|
backend,
|
|
169414
169800
|
primaryInstanceId: project.primaryInstanceId,
|
|
169415
169801
|
clientThreadId: String(started.clientThreadId),
|
|
@@ -169428,7 +169814,7 @@ var init_agentDirectThread = __esm({
|
|
|
169428
169814
|
clientThreadId: started.clientThreadId,
|
|
169429
169815
|
dependencies
|
|
169430
169816
|
});
|
|
169431
|
-
|
|
169817
|
+
logger3.info("direct_agent_renderer_open_requested", {
|
|
169432
169818
|
backend,
|
|
169433
169819
|
primaryInstanceId: project.primaryInstanceId,
|
|
169434
169820
|
clientThreadId: String(started.clientThreadId),
|
|
@@ -169442,7 +169828,7 @@ var init_agentDirectThread = __esm({
|
|
|
169442
169828
|
resolveConnectInfo: dependencies.resolveConnectInfo(getToken),
|
|
169443
169829
|
onStage: dependencies.report
|
|
169444
169830
|
});
|
|
169445
|
-
|
|
169831
|
+
logger3.info("direct_agent_renderer_closed", {
|
|
169446
169832
|
backend,
|
|
169447
169833
|
primaryInstanceId: project.primaryInstanceId,
|
|
169448
169834
|
clientThreadId: String(started.clientThreadId),
|
|
@@ -169693,14 +170079,14 @@ var init_threadViewed = __esm({
|
|
|
169693
170079
|
hasFocus: null
|
|
169694
170080
|
}
|
|
169695
170081
|
});
|
|
169696
|
-
|
|
170082
|
+
logger3.info("agent_view_thread_mark_viewed", {
|
|
169697
170083
|
clientThreadId,
|
|
169698
170084
|
status: "marked"
|
|
169699
170085
|
});
|
|
169700
170086
|
return { status: "marked" };
|
|
169701
170087
|
} catch (error55) {
|
|
169702
170088
|
const message = error55 instanceof Error ? error55.message : String(error55);
|
|
169703
|
-
|
|
170089
|
+
logger3.warn("agent_view_thread_mark_viewed", {
|
|
169704
170090
|
clientThreadId,
|
|
169705
170091
|
status: "failed",
|
|
169706
170092
|
reasonCode: "mutation_failed",
|
|
@@ -169869,7 +170255,7 @@ var init_agentDirectResume = __esm({
|
|
|
169869
170255
|
});
|
|
169870
170256
|
markViewedFailed = viewed.status === "failed";
|
|
169871
170257
|
};
|
|
169872
|
-
|
|
170258
|
+
logger3.info("direct_agent_resume_target_resolved", {
|
|
169873
170259
|
backend,
|
|
169874
170260
|
primaryInstanceId: project.primaryInstanceId,
|
|
169875
170261
|
executionInstanceId: resolvedThread.executionInstanceId,
|
|
@@ -220401,7 +220787,7 @@ var init_creationComposerController = __esm({
|
|
|
220401
220787
|
);
|
|
220402
220788
|
}
|
|
220403
220789
|
showCreationDefaultsPersistenceError(message, error55) {
|
|
220404
|
-
|
|
220790
|
+
logger3.warn("agent_view_creation_defaults_save_failed", {
|
|
220405
220791
|
projectAlias: this.project.projectAlias,
|
|
220406
220792
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
220407
220793
|
});
|
|
@@ -220507,7 +220893,7 @@ var init_creationComposerController = __esm({
|
|
|
220507
220893
|
}
|
|
220508
220894
|
}
|
|
220509
220895
|
});
|
|
220510
|
-
|
|
220896
|
+
logger3.warn("agent_view_creation_draft_text_sync_failed", {
|
|
220511
220897
|
clientThreadId: args.draftId,
|
|
220512
220898
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
220513
220899
|
});
|
|
@@ -220583,7 +220969,7 @@ var init_creationComposerController = __esm({
|
|
|
220583
220969
|
selectedActionStatusTone: "neutral"
|
|
220584
220970
|
});
|
|
220585
220971
|
this.creationReturnSelectionKey = null;
|
|
220586
|
-
|
|
220972
|
+
logger3.info("agent_view_creation_draft_kept", {
|
|
220587
220973
|
clientThreadId: composer.draftId
|
|
220588
220974
|
});
|
|
220589
220975
|
}
|
|
@@ -220741,7 +221127,7 @@ var init_creationComposerController = __esm({
|
|
|
220741
221127
|
}
|
|
220742
221128
|
});
|
|
220743
221129
|
} catch (error55) {
|
|
220744
|
-
|
|
221130
|
+
logger3.warn("agent_view_creation_draft_refresh_failed", {
|
|
220745
221131
|
clientThreadId: draftId,
|
|
220746
221132
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
220747
221133
|
});
|
|
@@ -220871,7 +221257,7 @@ var init_creationComposerController = __esm({
|
|
|
220871
221257
|
});
|
|
220872
221258
|
this.host.addPendingCreationSelection(draftId);
|
|
220873
221259
|
this.host.recompute();
|
|
220874
|
-
|
|
221260
|
+
logger3.info("agent_view_creation_draft_created", {
|
|
220875
221261
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
220876
221262
|
clientThreadId: draftId,
|
|
220877
221263
|
backend: created.draft.backend,
|
|
@@ -220882,7 +221268,7 @@ var init_creationComposerController = __esm({
|
|
|
220882
221268
|
selectedActionStatusMessage: "The thread composer could not open. Check the connection and try again.",
|
|
220883
221269
|
selectedActionStatusTone: "error"
|
|
220884
221270
|
});
|
|
220885
|
-
|
|
221271
|
+
logger3.warn("agent_view_creation_draft_failed", {
|
|
220886
221272
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
220887
221273
|
targetKind: kind,
|
|
220888
221274
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -220909,7 +221295,7 @@ var init_creationComposerController = __esm({
|
|
|
220909
221295
|
});
|
|
220910
221296
|
assertContractVersion3(result, "Editable draft");
|
|
220911
221297
|
if (result.status === "unavailable") {
|
|
220912
|
-
|
|
221298
|
+
logger3.info("agent_view_creation_draft_reopen_unavailable", {
|
|
220913
221299
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
220914
221300
|
clientThreadId,
|
|
220915
221301
|
reason: result.reason
|
|
@@ -220987,7 +221373,7 @@ var init_creationComposerController = __esm({
|
|
|
220987
221373
|
} : null
|
|
220988
221374
|
}
|
|
220989
221375
|
});
|
|
220990
|
-
|
|
221376
|
+
logger3.info("agent_view_creation_draft_reopened", {
|
|
220991
221377
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
220992
221378
|
clientThreadId,
|
|
220993
221379
|
backend,
|
|
@@ -221002,7 +221388,7 @@ var init_creationComposerController = __esm({
|
|
|
221002
221388
|
selectedActionStatusMessage: "The draft could not open. Check the connection and try again.",
|
|
221003
221389
|
selectedActionStatusTone: "error"
|
|
221004
221390
|
});
|
|
221005
|
-
|
|
221391
|
+
logger3.warn("agent_view_creation_draft_reopen_failed", {
|
|
221006
221392
|
clientThreadId,
|
|
221007
221393
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221008
221394
|
});
|
|
@@ -221176,7 +221562,7 @@ var init_creationComposerController = __esm({
|
|
|
221176
221562
|
}
|
|
221177
221563
|
});
|
|
221178
221564
|
}
|
|
221179
|
-
|
|
221565
|
+
logger3.warn("agent_view_creation_backend_update_failed", {
|
|
221180
221566
|
clientThreadId: composer.draftId,
|
|
221181
221567
|
backend,
|
|
221182
221568
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -221616,7 +222002,7 @@ var init_creationComposerController = __esm({
|
|
|
221616
222002
|
}
|
|
221617
222003
|
});
|
|
221618
222004
|
}
|
|
221619
|
-
|
|
222005
|
+
logger3.warn("agent_view_creation_draft_keep_failed", {
|
|
221620
222006
|
clientThreadId: composer.draftId,
|
|
221621
222007
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221622
222008
|
});
|
|
@@ -221675,7 +222061,7 @@ var init_creationComposerController = __esm({
|
|
|
221675
222061
|
selectedActionStatusTone: "neutral"
|
|
221676
222062
|
});
|
|
221677
222063
|
this.creationReturnSelectionKey = null;
|
|
221678
|
-
|
|
222064
|
+
logger3.info("agent_view_creation_draft_discarded", {
|
|
221679
222065
|
clientThreadId: composer.draftId,
|
|
221680
222066
|
removed: discarded.removed
|
|
221681
222067
|
});
|
|
@@ -221693,7 +222079,7 @@ var init_creationComposerController = __esm({
|
|
|
221693
222079
|
}
|
|
221694
222080
|
});
|
|
221695
222081
|
}
|
|
221696
|
-
|
|
222082
|
+
logger3.warn("agent_view_creation_draft_discard_failed", {
|
|
221697
222083
|
clientThreadId: composer.draftId,
|
|
221698
222084
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221699
222085
|
});
|
|
@@ -221738,7 +222124,7 @@ var init_creationComposerController = __esm({
|
|
|
221738
222124
|
}
|
|
221739
222125
|
});
|
|
221740
222126
|
}
|
|
221741
|
-
|
|
222127
|
+
logger3.warn("agent_view_creation_draft_exit_persist_failed", {
|
|
221742
222128
|
clientThreadId: composer.draftId,
|
|
221743
222129
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221744
222130
|
});
|
|
@@ -221831,7 +222217,7 @@ var init_creationComposerController = __esm({
|
|
|
221831
222217
|
});
|
|
221832
222218
|
this.creationReturnSelectionKey = null;
|
|
221833
222219
|
this.prewarmedCreationDraftIds.delete(composer.draftId);
|
|
221834
|
-
|
|
222220
|
+
logger3.info("agent_view_creation_submit_accepted", {
|
|
221835
222221
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
221836
222222
|
clientThreadId: composer.draftId,
|
|
221837
222223
|
attemptId,
|
|
@@ -221850,13 +222236,13 @@ var init_creationComposerController = __esm({
|
|
|
221850
222236
|
attemptId
|
|
221851
222237
|
}).then((result) => {
|
|
221852
222238
|
assertContractVersion3(result, "Thread start kickoff");
|
|
221853
|
-
|
|
222239
|
+
logger3.info("agent_view_creation_kickoff_completed", {
|
|
221854
222240
|
clientThreadId: composer.draftId,
|
|
221855
222241
|
attemptId,
|
|
221856
222242
|
skipped: result.skipped
|
|
221857
222243
|
});
|
|
221858
222244
|
}).catch((error55) => {
|
|
221859
|
-
|
|
222245
|
+
logger3.warn("agent_view_creation_kickoff_failed", {
|
|
221860
222246
|
clientThreadId: composer.draftId,
|
|
221861
222247
|
attemptId,
|
|
221862
222248
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -221907,7 +222293,7 @@ var init_creationComposerController = __esm({
|
|
|
221907
222293
|
recovered = true;
|
|
221908
222294
|
}
|
|
221909
222295
|
} catch (statusError) {
|
|
221910
|
-
|
|
222296
|
+
logger3.warn("agent_view_creation_submit_status_failed", {
|
|
221911
222297
|
clientThreadId: composer.draftId,
|
|
221912
222298
|
error: statusError instanceof Error ? statusError.message : String(statusError)
|
|
221913
222299
|
});
|
|
@@ -221925,7 +222311,7 @@ var init_creationComposerController = __esm({
|
|
|
221925
222311
|
}
|
|
221926
222312
|
});
|
|
221927
222313
|
}
|
|
221928
|
-
|
|
222314
|
+
logger3.warn("agent_view_creation_submit_failed", {
|
|
221929
222315
|
clientThreadId: composer.draftId,
|
|
221930
222316
|
backend: composer.backend,
|
|
221931
222317
|
model: composer.executionSelection.model,
|
|
@@ -221941,7 +222327,7 @@ var init_creationComposerController = __esm({
|
|
|
221941
222327
|
return;
|
|
221942
222328
|
}
|
|
221943
222329
|
this.prewarmedCreationDraftIds.add(clientThreadId);
|
|
221944
|
-
|
|
222330
|
+
logger3.info("agent_view_creation_prewarm_started", {
|
|
221945
222331
|
primaryInstanceId: this.project.primaryInstanceId,
|
|
221946
222332
|
clientThreadId
|
|
221947
222333
|
});
|
|
@@ -221950,13 +222336,13 @@ var init_creationComposerController = __esm({
|
|
|
221950
222336
|
clientThreadId
|
|
221951
222337
|
}).then((result) => {
|
|
221952
222338
|
assertContractVersion3(result, "Thread draft prewarm");
|
|
221953
|
-
|
|
222339
|
+
logger3.info("agent_view_creation_prewarm_completed", {
|
|
221954
222340
|
clientThreadId,
|
|
221955
222341
|
status: result.status
|
|
221956
222342
|
});
|
|
221957
222343
|
}).catch((error55) => {
|
|
221958
222344
|
this.prewarmedCreationDraftIds.delete(clientThreadId);
|
|
221959
|
-
|
|
222345
|
+
logger3.warn("agent_view_creation_prewarm_failed", {
|
|
221960
222346
|
clientThreadId,
|
|
221961
222347
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
221962
222348
|
});
|
|
@@ -223315,7 +223701,7 @@ var init_metadataActionController = __esm({
|
|
|
223315
223701
|
statusMessage: `${result.pinned ? "Pinned" : "Unpinned"} \u201C${target.currentTitle}\u201D.`,
|
|
223316
223702
|
statusTone: "neutral"
|
|
223317
223703
|
});
|
|
223318
|
-
|
|
223704
|
+
logger3.info("agent_view_thread_pin_completed", {
|
|
223319
223705
|
clientThreadId: target.clientThreadId,
|
|
223320
223706
|
pinned: result.pinned
|
|
223321
223707
|
});
|
|
@@ -223325,7 +223711,7 @@ var init_metadataActionController = __esm({
|
|
|
223325
223711
|
statusMessage: genericFailureCopy("pin"),
|
|
223326
223712
|
statusTone: "error"
|
|
223327
223713
|
});
|
|
223328
|
-
|
|
223714
|
+
logger3.warn("agent_view_thread_pin_failed", {
|
|
223329
223715
|
clientThreadId: target.clientThreadId,
|
|
223330
223716
|
expectedPinned: !target.isPinned,
|
|
223331
223717
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -223371,7 +223757,7 @@ var init_metadataActionController = __esm({
|
|
|
223371
223757
|
statusMessage: genericFailureCopy("rename"),
|
|
223372
223758
|
statusTone: "error"
|
|
223373
223759
|
});
|
|
223374
|
-
|
|
223760
|
+
logger3.warn("agent_view_thread_rename_open_failed", {
|
|
223375
223761
|
clientThreadId: target.clientThreadId,
|
|
223376
223762
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
223377
223763
|
});
|
|
@@ -223436,7 +223822,7 @@ var init_metadataActionController = __esm({
|
|
|
223436
223822
|
statusMessage: result2.devboxName === null ? "Using the first thread\u2019s title for this devbox." : `Renamed devbox to \u201C${result2.devboxName}\u201D.`,
|
|
223437
223823
|
statusTone: "neutral"
|
|
223438
223824
|
});
|
|
223439
|
-
|
|
223825
|
+
logger3.info("agent_view_devbox_rename_completed", {
|
|
223440
223826
|
placementId: subject.placementId,
|
|
223441
223827
|
cleared: result2.devboxName === null
|
|
223442
223828
|
});
|
|
@@ -223459,7 +223845,7 @@ var init_metadataActionController = __esm({
|
|
|
223459
223845
|
statusMessage: result.automaticTitle ? "Using the automatic title for this thread." : `Renamed thread to \u201C${result.title}\u201D.`,
|
|
223460
223846
|
statusTone: "neutral"
|
|
223461
223847
|
});
|
|
223462
|
-
|
|
223848
|
+
logger3.info("agent_view_thread_rename_completed", {
|
|
223463
223849
|
clientThreadId: modal.target.clientThreadId,
|
|
223464
223850
|
automaticTitle: result.automaticTitle
|
|
223465
223851
|
});
|
|
@@ -223476,7 +223862,7 @@ var init_metadataActionController = __esm({
|
|
|
223476
223862
|
),
|
|
223477
223863
|
statusTone: "error"
|
|
223478
223864
|
});
|
|
223479
|
-
|
|
223865
|
+
logger3.warn(
|
|
223480
223866
|
subject.kind === "devbox" ? "agent_view_devbox_rename_failed" : "agent_view_thread_rename_failed",
|
|
223481
223867
|
{
|
|
223482
223868
|
clientThreadId: modal.target.clientThreadId,
|
|
@@ -223607,7 +223993,7 @@ var init_metadataActionController = __esm({
|
|
|
223607
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.`,
|
|
223608
223994
|
statusTone: "neutral"
|
|
223609
223995
|
});
|
|
223610
|
-
|
|
223996
|
+
logger3.info("agent_view_thread_archive_completed", {
|
|
223611
223997
|
clientThreadId: target.clientThreadId,
|
|
223612
223998
|
backend: target.backend,
|
|
223613
223999
|
archived: result.archived,
|
|
@@ -223622,7 +224008,7 @@ var init_metadataActionController = __esm({
|
|
|
223622
224008
|
statusMessage: capability ? `This ${targetLabel} needs a boxes.dev service update before Codex threads can be ${operation === "archive" ? "archived" : "unarchived"} here.` : genericFailureCopy(operation),
|
|
223623
224009
|
statusTone: "error"
|
|
223624
224010
|
});
|
|
223625
|
-
|
|
224011
|
+
logger3.warn("agent_view_thread_archive_failed", {
|
|
223626
224012
|
clientThreadId: target.clientThreadId,
|
|
223627
224013
|
backend: target.backend,
|
|
223628
224014
|
operation,
|
|
@@ -224546,7 +224932,7 @@ var init_controller = __esm({
|
|
|
224546
224932
|
};
|
|
224547
224933
|
this.syncTrackedCreationsSnapshot();
|
|
224548
224934
|
this.emit();
|
|
224549
|
-
|
|
224935
|
+
logger3.info("agent_view_creation_progress", {
|
|
224550
224936
|
clientThreadId: args.clientThreadId,
|
|
224551
224937
|
attemptId: args.attemptId,
|
|
224552
224938
|
state: status.state,
|
|
@@ -224563,7 +224949,7 @@ var init_controller = __esm({
|
|
|
224563
224949
|
},
|
|
224564
224950
|
(error55) => {
|
|
224565
224951
|
if (!this.stopped) {
|
|
224566
|
-
|
|
224952
|
+
logger3.warn("agent_view_creation_subscription_failed", {
|
|
224567
224953
|
clientThreadId: args.clientThreadId,
|
|
224568
224954
|
attemptId: args.attemptId,
|
|
224569
224955
|
error: error55.message
|
|
@@ -224577,7 +224963,7 @@ var init_controller = __esm({
|
|
|
224577
224963
|
creation.unsubscribe();
|
|
224578
224964
|
this.trackedCreations.delete(creation.clientThreadId);
|
|
224579
224965
|
this.syncTrackedCreationsSnapshot();
|
|
224580
|
-
|
|
224966
|
+
logger3.info("agent_view_creation_unsubscribed", {
|
|
224581
224967
|
clientThreadId: creation.clientThreadId,
|
|
224582
224968
|
attemptId: creation.attemptId,
|
|
224583
224969
|
state: creation.status?.state ?? null
|
|
@@ -224852,7 +225238,7 @@ var init_controller = __esm({
|
|
|
224852
225238
|
nextMessage = outcome.detail;
|
|
224853
225239
|
nextTone = "error";
|
|
224854
225240
|
}
|
|
224855
|
-
|
|
225241
|
+
logger3.info("agent_view_codex_empty_tui_completed", {
|
|
224856
225242
|
alias: resolved.target.alias,
|
|
224857
225243
|
clientThreadId: action.clientThreadId,
|
|
224858
225244
|
startupAttemptId: String(status.attemptId),
|
|
@@ -224861,7 +225247,7 @@ var init_controller = __esm({
|
|
|
224861
225247
|
} catch (error55) {
|
|
224862
225248
|
nextMessage = error55 instanceof Error ? error55.message : "Codex couldn't open in terminal.";
|
|
224863
225249
|
nextTone = "error";
|
|
224864
|
-
|
|
225250
|
+
logger3.warn("agent_view_codex_empty_tui_failed", {
|
|
224865
225251
|
clientThreadId: action.clientThreadId,
|
|
224866
225252
|
startupAttemptId: action.attemptId,
|
|
224867
225253
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -224948,7 +225334,7 @@ var init_controller = __esm({
|
|
|
224948
225334
|
} else {
|
|
224949
225335
|
this.syncTrackedCreationsSnapshot();
|
|
224950
225336
|
}
|
|
224951
|
-
|
|
225337
|
+
logger3.info("agent_view_creation_auto_open_replaced_by_manual_open", {
|
|
224952
225338
|
clientThreadId: creation.clientThreadId,
|
|
224953
225339
|
attemptId: creation.attemptId
|
|
224954
225340
|
});
|
|
@@ -225070,7 +225456,7 @@ var init_controller = __esm({
|
|
|
225070
225456
|
nextMessage = outcome.detail;
|
|
225071
225457
|
nextTone = "error";
|
|
225072
225458
|
}
|
|
225073
|
-
|
|
225459
|
+
logger3.info("agent_view_claude_empty_tui_completed", {
|
|
225074
225460
|
alias: resolved.target.alias,
|
|
225075
225461
|
clientThreadId: action.clientThreadId,
|
|
225076
225462
|
startupAttemptId: String(status.attemptId),
|
|
@@ -225088,7 +225474,7 @@ var init_controller = __esm({
|
|
|
225088
225474
|
nextMessage = error55 instanceof Error ? error55.message : "Claude couldn't open in terminal.";
|
|
225089
225475
|
nextTone = "error";
|
|
225090
225476
|
}
|
|
225091
|
-
|
|
225477
|
+
logger3.warn("agent_view_claude_empty_tui_failed", {
|
|
225092
225478
|
clientThreadId: action.clientThreadId,
|
|
225093
225479
|
startupAttemptId: action.attemptId,
|
|
225094
225480
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -225198,7 +225584,7 @@ var init_controller = __esm({
|
|
|
225198
225584
|
};
|
|
225199
225585
|
}
|
|
225200
225586
|
}
|
|
225201
|
-
|
|
225587
|
+
logger3.info("agent_view_claude_tui_completed", {
|
|
225202
225588
|
alias: resolved.target.alias,
|
|
225203
225589
|
clientThreadId: action.clientThreadId,
|
|
225204
225590
|
threadId: action.backendThreadId,
|
|
@@ -225220,7 +225606,7 @@ var init_controller = __esm({
|
|
|
225220
225606
|
nextMessage = "Claude couldn't open in terminal. Review the latest status and try again.";
|
|
225221
225607
|
nextTone = "error";
|
|
225222
225608
|
}
|
|
225223
|
-
|
|
225609
|
+
logger3.warn("agent_view_claude_tui_failed", {
|
|
225224
225610
|
clientThreadId: action.clientThreadId,
|
|
225225
225611
|
threadId: action.backendThreadId,
|
|
225226
225612
|
status: "error",
|
|
@@ -225270,7 +225656,7 @@ var init_controller = __esm({
|
|
|
225270
225656
|
throw new Error("Resolved machine target did not match the selection.");
|
|
225271
225657
|
}
|
|
225272
225658
|
const boxLabel2 = resolved.target.role === "primary" ? "Template box" : "devbox";
|
|
225273
|
-
|
|
225659
|
+
logger3.info("agent_view_native_target_resolved", {
|
|
225274
225660
|
alias: resolved.target.alias,
|
|
225275
225661
|
requestType: "codex_tui_open",
|
|
225276
225662
|
primaryInstanceId: resolved.target.primaryInstanceId,
|
|
@@ -225287,7 +225673,7 @@ var init_controller = __esm({
|
|
|
225287
225673
|
threadId: action.backendThreadId,
|
|
225288
225674
|
sessionPath: action.sessionPath,
|
|
225289
225675
|
onStage: (message) => {
|
|
225290
|
-
|
|
225676
|
+
logger3.info("agent_view_codex_renderer_stage", {
|
|
225291
225677
|
alias: resolved.target.alias,
|
|
225292
225678
|
clientThreadId: action.clientThreadId,
|
|
225293
225679
|
status: "pending",
|
|
@@ -225317,7 +225703,7 @@ var init_controller = __esm({
|
|
|
225317
225703
|
const formatted = formatCodexOutcome({ outcome, boxLabel: boxLabel2 });
|
|
225318
225704
|
nextMessage = markViewedFailed ? `${formatted.message} Its unread status could not be updated.` : formatted.message;
|
|
225319
225705
|
nextTone = formatted.tone;
|
|
225320
|
-
|
|
225706
|
+
logger3.info("agent_view_codex_renderer_completed", {
|
|
225321
225707
|
alias: resolved.target.alias,
|
|
225322
225708
|
clientThreadId: action.clientThreadId,
|
|
225323
225709
|
threadId: action.backendThreadId,
|
|
@@ -225339,7 +225725,7 @@ var init_controller = __esm({
|
|
|
225339
225725
|
nextMessage = "Codex couldn't open. Review the latest status and try again.";
|
|
225340
225726
|
nextTone = "error";
|
|
225341
225727
|
}
|
|
225342
|
-
|
|
225728
|
+
logger3.warn("agent_view_codex_renderer_failed", {
|
|
225343
225729
|
clientThreadId: action.clientThreadId,
|
|
225344
225730
|
threadId: action.backendThreadId,
|
|
225345
225731
|
status: "error",
|
|
@@ -225500,7 +225886,7 @@ var init_controller = __esm({
|
|
|
225500
225886
|
if (resolvedTarget.primaryInstanceId !== shell.primaryInstanceId || resolvedTarget.executionInstanceId !== shell.executionInstanceId || resolvedTarget.computeProvider !== "e2b") {
|
|
225501
225887
|
throw new Error("Resolved machine target did not match the selection.");
|
|
225502
225888
|
}
|
|
225503
|
-
|
|
225889
|
+
logger3.info("agent_view_shell_target_resolved", {
|
|
225504
225890
|
alias: resolvedTarget.alias,
|
|
225505
225891
|
requestType: "shell",
|
|
225506
225892
|
primaryInstanceId: resolvedTarget.primaryInstanceId,
|
|
@@ -225535,7 +225921,7 @@ var init_controller = __esm({
|
|
|
225535
225921
|
}
|
|
225536
225922
|
});
|
|
225537
225923
|
nextMessage = formatShellOutcome(outcome, shell.targetRole);
|
|
225538
|
-
|
|
225924
|
+
logger3.info("agent_view_shell_completed", {
|
|
225539
225925
|
alias: resolvedTarget.alias,
|
|
225540
225926
|
requestType: "shell",
|
|
225541
225927
|
status: outcome.kind
|
|
@@ -225630,7 +226016,7 @@ var init_controller = __esm({
|
|
|
225630
226016
|
if (this.pendingShellPreconnect === pending) {
|
|
225631
226017
|
this.pendingShellPreconnect = null;
|
|
225632
226018
|
}
|
|
225633
|
-
|
|
226019
|
+
logger3.debug("agent_view_shell_preconnect_failed", {
|
|
225634
226020
|
alias: resolvedTarget.alias,
|
|
225635
226021
|
executionInstanceId: resolvedTarget.executionInstanceId,
|
|
225636
226022
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -225649,14 +226035,14 @@ var init_controller = __esm({
|
|
|
225649
226035
|
}
|
|
225650
226036
|
this.shellPreconnect = { key, handle };
|
|
225651
226037
|
void handle.ready.catch((error55) => {
|
|
225652
|
-
|
|
226038
|
+
logger3.debug("agent_view_shell_preconnect_failed", {
|
|
225653
226039
|
alias: resolvedTarget.alias,
|
|
225654
226040
|
executionInstanceId: resolvedTarget.executionInstanceId,
|
|
225655
226041
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
225656
226042
|
});
|
|
225657
226043
|
});
|
|
225658
226044
|
} catch (error55) {
|
|
225659
|
-
|
|
226045
|
+
logger3.debug("agent_view_shell_preconnect_failed", {
|
|
225660
226046
|
alias: resolvedTarget.alias,
|
|
225661
226047
|
executionInstanceId: resolvedTarget.executionInstanceId,
|
|
225662
226048
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -230122,7 +230508,7 @@ var init_tmuxWorkspace = __esm({
|
|
|
230122
230508
|
"Agent workspace initial focus"
|
|
230123
230509
|
);
|
|
230124
230510
|
await applyAgentWorkspaceLayout({ config: config5, tmuxCommand, runner });
|
|
230125
|
-
|
|
230511
|
+
logger3.info("agent_view_workspace_started", {
|
|
230126
230512
|
workspaceSessionId: created.sessionId,
|
|
230127
230513
|
projectFingerprint: project.projectFingerprint,
|
|
230128
230514
|
tmuxVersion: `${String(version4.major)}.${String(version4.minor)}`,
|
|
@@ -230806,7 +231192,7 @@ var init_workspaceActionClient = __esm({
|
|
|
230806
231192
|
}
|
|
230807
231193
|
if (message.type === "result") {
|
|
230808
231194
|
await restoreSidebar().catch((error55) => {
|
|
230809
|
-
|
|
231195
|
+
logger3.warn("agent_view_workspace_restore_failed", {
|
|
230810
231196
|
workspaceSessionId: this.config.sessionId,
|
|
230811
231197
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
230812
231198
|
});
|
|
@@ -231362,7 +231748,7 @@ var init_runAgentView = __esm({
|
|
|
231362
231748
|
const resolveLocalService = createConnectLocalServiceResolver();
|
|
231363
231749
|
if (workspaceClient === null) {
|
|
231364
231750
|
void resolveLocalService().catch((error55) => {
|
|
231365
|
-
|
|
231751
|
+
logger3.debug("agent_view_local_service_prewarm_failed", {
|
|
231366
231752
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
231367
231753
|
});
|
|
231368
231754
|
});
|
|
@@ -231583,7 +231969,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231583
231969
|
createDetailRuntime = async () => {
|
|
231584
231970
|
const resolveLocalService = createConnectLocalServiceResolver();
|
|
231585
231971
|
void resolveLocalService().catch((error55) => {
|
|
231586
|
-
|
|
231972
|
+
logger3.debug("agent_view_local_service_prewarm_failed", {
|
|
231587
231973
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
231588
231974
|
});
|
|
231589
231975
|
});
|
|
@@ -231711,7 +232097,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231711
232097
|
return runtime;
|
|
231712
232098
|
});
|
|
231713
232099
|
void getRuntime().catch((error55) => {
|
|
231714
|
-
|
|
232100
|
+
logger3.debug("agent_view_workspace_detail_runtime_prewarm_failed", {
|
|
231715
232101
|
workspaceSessionId: resolvedConfig.sessionId,
|
|
231716
232102
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
231717
232103
|
});
|
|
@@ -231723,7 +232109,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231723
232109
|
const server = createServer3((socket) => {
|
|
231724
232110
|
socket.setEncoding("utf8");
|
|
231725
232111
|
socket.on("error", (error55) => {
|
|
231726
|
-
|
|
232112
|
+
logger3.warn("agent_view_workspace_detail_socket_error", {
|
|
231727
232113
|
workspaceSessionId: resolvedConfig.sessionId,
|
|
231728
232114
|
error: error55.message
|
|
231729
232115
|
});
|
|
@@ -231875,7 +232261,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
231875
232261
|
});
|
|
231876
232262
|
await chmod2(resolvedConfig.actionSocketPath, 384);
|
|
231877
232263
|
renderPlaceholder();
|
|
231878
|
-
|
|
232264
|
+
logger3.info("agent_view_workspace_detail_ready", {
|
|
231879
232265
|
workspaceSessionId: resolvedConfig.sessionId,
|
|
231880
232266
|
status: "ready"
|
|
231881
232267
|
});
|
|
@@ -232012,6 +232398,7 @@ var init_threads = __esm({
|
|
|
232012
232398
|
includeProjectAnchor,
|
|
232013
232399
|
window: window2,
|
|
232014
232400
|
automationThreads,
|
|
232401
|
+
pendingInputs,
|
|
232015
232402
|
section,
|
|
232016
232403
|
includeArchived
|
|
232017
232404
|
}) => {
|
|
@@ -232056,12 +232443,26 @@ var init_threads = __esm({
|
|
|
232056
232443
|
) : []
|
|
232057
232444
|
];
|
|
232058
232445
|
const seen = /* @__PURE__ */ new Set();
|
|
232446
|
+
const pendingInputByThreadId = new Map(
|
|
232447
|
+
pendingInputs.map((entry) => [entry.clientThreadId, entry.pendingInput])
|
|
232448
|
+
);
|
|
232059
232449
|
return rows.filter((thread) => {
|
|
232060
232450
|
if (seen.has(thread.clientThreadId)) {
|
|
232061
232451
|
return false;
|
|
232062
232452
|
}
|
|
232063
232453
|
seen.add(thread.clientThreadId);
|
|
232064
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
|
+
};
|
|
232065
232466
|
});
|
|
232066
232467
|
};
|
|
232067
232468
|
listCliAgentToolThreads = async ({
|
|
@@ -232090,6 +232491,7 @@ var init_threads = __esm({
|
|
|
232090
232491
|
includeProjectAnchor: project.kind !== "team_template_managed",
|
|
232091
232492
|
window: pageResult.page,
|
|
232092
232493
|
automationThreads: pageResult.automationThreads,
|
|
232494
|
+
pendingInputs: pageResult.pendingInputs ?? [],
|
|
232093
232495
|
section: decoded.bucket,
|
|
232094
232496
|
includeArchived
|
|
232095
232497
|
});
|
|
@@ -232126,6 +232528,7 @@ var init_threads = __esm({
|
|
|
232126
232528
|
includeProjectAnchor: project.kind !== "team_template_managed",
|
|
232127
232529
|
window: liveResult.window,
|
|
232128
232530
|
automationThreads: liveResult.automationThreads,
|
|
232531
|
+
pendingInputs: liveResult.pendingInputs ?? [],
|
|
232129
232532
|
section: "live",
|
|
232130
232533
|
includeArchived
|
|
232131
232534
|
});
|
|
@@ -232181,6 +232584,9 @@ var init_threads = __esm({
|
|
|
232181
232584
|
includeProjectAnchor: project.kind !== "team_template_managed",
|
|
232182
232585
|
window: window2,
|
|
232183
232586
|
automationThreads,
|
|
232587
|
+
pendingInputs: [liveResult, ...recentPages, ...archivedPages].flatMap(
|
|
232588
|
+
(result) => result.pendingInputs ?? []
|
|
232589
|
+
),
|
|
232184
232590
|
section: "all",
|
|
232185
232591
|
includeArchived
|
|
232186
232592
|
});
|
|
@@ -232301,6 +232707,60 @@ var init_resourceOutput = __esm({
|
|
|
232301
232707
|
}
|
|
232302
232708
|
});
|
|
232303
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
|
+
|
|
232304
232764
|
// src/devbox/commands/resourceArgs.ts
|
|
232305
232765
|
var parseResourceListArgs;
|
|
232306
232766
|
var init_resourceArgs = __esm({
|
|
@@ -232403,13 +232863,15 @@ var init_threads2 = __esm({
|
|
|
232403
232863
|
"use strict";
|
|
232404
232864
|
init_threads();
|
|
232405
232865
|
init_queryRefs();
|
|
232866
|
+
init_pendingInputText();
|
|
232406
232867
|
init_resourceArgs();
|
|
232407
232868
|
init_resourceNextAction();
|
|
232408
232869
|
init_resourceOutput();
|
|
232409
232870
|
renderCliAgentToolThreads = (data) => data.threads.length === 0 ? `No agent threads found for ${data.project.name}.` : [
|
|
232410
|
-
...data.threads.
|
|
232411
|
-
|
|
232412
|
-
|
|
232871
|
+
...data.threads.flatMap((thread) => [
|
|
232872
|
+
`${thread.clientThreadId} ${thread.agent} ${thread.status} ${thread.title}`,
|
|
232873
|
+
...thread.pendingInput ? renderPendingInputLines(thread.pendingInput) : []
|
|
232874
|
+
]),
|
|
232413
232875
|
...data.pagination.nextCursor ? [
|
|
232414
232876
|
`More threads are available. Continue with --cursor ${data.pagination.nextCursor}`
|
|
232415
232877
|
] : []
|
|
@@ -234452,7 +234914,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234452
234914
|
const socketInfo = resolveSocketInfo();
|
|
234453
234915
|
const statusEnabled = process.stderr.isTTY && !parsed.json;
|
|
234454
234916
|
const status = createStatusLine({ enabled: statusEnabled });
|
|
234455
|
-
|
|
234917
|
+
logger3.info("ide_setup_start", {
|
|
234456
234918
|
box: parsed.box ?? null,
|
|
234457
234919
|
all: parsed.all
|
|
234458
234920
|
});
|
|
@@ -234531,7 +234993,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234531
234993
|
status.stage("Writing managed SSH config");
|
|
234532
234994
|
await writeManagedSshEntries(nextEntries.values(), sshOptions);
|
|
234533
234995
|
const ok = failures.length === 0;
|
|
234534
|
-
|
|
234996
|
+
logger3.info(ok ? "ide_setup_complete" : "ide_setup_failed", {
|
|
234535
234997
|
box: parsed.box ?? null,
|
|
234536
234998
|
all: parsed.all,
|
|
234537
234999
|
successes: successes.length,
|
|
@@ -234569,7 +235031,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234569
235031
|
runIdeDoctor = async (args) => {
|
|
234570
235032
|
const parsed = parseDoctorArgs(args);
|
|
234571
235033
|
const socketInfo = resolveSocketInfo();
|
|
234572
|
-
|
|
235034
|
+
logger3.info("ide_doctor_start", {
|
|
234573
235035
|
box: parsed.box ?? null,
|
|
234574
235036
|
all: parsed.all,
|
|
234575
235037
|
editor: parsed.editor
|
|
@@ -234917,7 +235379,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
234917
235379
|
});
|
|
234918
235380
|
}
|
|
234919
235381
|
const ok = results.every((result) => !hasErrors(result.findings));
|
|
234920
|
-
|
|
235382
|
+
logger3.info("ide_doctor_complete", {
|
|
234921
235383
|
box: parsed.box ?? null,
|
|
234922
235384
|
all: parsed.all,
|
|
234923
235385
|
editor: parsed.editor,
|
|
@@ -235002,7 +235464,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
235002
235464
|
runIdeOpen = async (args) => {
|
|
235003
235465
|
const parsed = parseOpenArgs(args);
|
|
235004
235466
|
const socketInfo = resolveSocketInfo();
|
|
235005
|
-
|
|
235467
|
+
logger3.info("ide_open_start", {
|
|
235006
235468
|
box: parsed.box,
|
|
235007
235469
|
editor: parsed.editor
|
|
235008
235470
|
});
|
|
@@ -235055,7 +235517,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
235055
235517
|
ideHint: parsed.ide
|
|
235056
235518
|
});
|
|
235057
235519
|
}
|
|
235058
|
-
|
|
235520
|
+
logger3.info("ide_open_complete", {
|
|
235059
235521
|
box: resolvedTarget.alias,
|
|
235060
235522
|
editor: parsed.editor,
|
|
235061
235523
|
remotePath
|
|
@@ -235083,7 +235545,7 @@ cat ${shellEscape3(filePath)}`
|
|
|
235083
235545
|
throw new Error(IDE_USAGE);
|
|
235084
235546
|
} catch (error55) {
|
|
235085
235547
|
const event = subcommand === "setup" ? "ide_setup_failed" : subcommand === "doctor" ? "ide_doctor_complete" : "ide_open_failed";
|
|
235086
|
-
|
|
235548
|
+
logger3.warn(event, {
|
|
235087
235549
|
subcommand,
|
|
235088
235550
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
235089
235551
|
});
|
|
@@ -251869,7 +252331,7 @@ var init_progressReport = __esm({
|
|
|
251869
252331
|
folder = process.cwd(),
|
|
251870
252332
|
report = reportAgentInitStep,
|
|
251871
252333
|
step,
|
|
251872
|
-
warn: warn3 = (event, fields) =>
|
|
252334
|
+
warn: warn3 = (event, fields) => logger3.warn(event, fields)
|
|
251873
252335
|
}) => {
|
|
251874
252336
|
try {
|
|
251875
252337
|
const project = await resolveAgentInitReportProject(folder);
|
|
@@ -251904,14 +252366,14 @@ var init_progressReport = __esm({
|
|
|
251904
252366
|
await openAgentInitSecretStore()
|
|
251905
252367
|
);
|
|
251906
252368
|
} catch (error55) {
|
|
251907
|
-
|
|
252369
|
+
logger3.debug("agent_init_activity_report_skipped", {
|
|
251908
252370
|
command,
|
|
251909
252371
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
251910
252372
|
});
|
|
251911
252373
|
return;
|
|
251912
252374
|
}
|
|
251913
252375
|
if (controlPlaneToken === null) {
|
|
251914
|
-
|
|
252376
|
+
logger3.debug("agent_init_activity_report_skipped", {
|
|
251915
252377
|
command,
|
|
251916
252378
|
error: "no_unexpired_token"
|
|
251917
252379
|
});
|
|
@@ -251921,7 +252383,7 @@ var init_progressReport = __esm({
|
|
|
251921
252383
|
controlPlaneToken,
|
|
251922
252384
|
folder,
|
|
251923
252385
|
step: { command, outcome: "ok", phase: null },
|
|
251924
|
-
warn: (event, fields) =>
|
|
252386
|
+
warn: (event, fields) => logger3.debug(event, fields)
|
|
251925
252387
|
});
|
|
251926
252388
|
};
|
|
251927
252389
|
}
|
|
@@ -252240,7 +252702,7 @@ var init_codexSignIn = __esm({
|
|
|
252240
252702
|
kind: "redirect",
|
|
252241
252703
|
location: error55 ? returnTo.failed : returnTo.connected
|
|
252242
252704
|
}),
|
|
252243
|
-
onEvent: (event) =>
|
|
252705
|
+
onEvent: (event) => logger3.info("ChatGPT browser sign-in", event),
|
|
252244
252706
|
saveCredential,
|
|
252245
252707
|
signal
|
|
252246
252708
|
});
|
|
@@ -252622,7 +253084,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252622
253084
|
timeoutMs = CLAUDE_SETUP_REQUEST_TIMEOUT_MS
|
|
252623
253085
|
}) => {
|
|
252624
253086
|
const requestId2 = randomUUID26();
|
|
252625
|
-
|
|
253087
|
+
logger3.info("claude_setup_oauth_request", {
|
|
252626
253088
|
requestId: requestId2,
|
|
252627
253089
|
method,
|
|
252628
253090
|
host: url3.host,
|
|
@@ -252636,7 +253098,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252636
253098
|
method,
|
|
252637
253099
|
headers: Object.fromEntries(headers)
|
|
252638
253100
|
};
|
|
252639
|
-
const
|
|
253101
|
+
const sendRequest = () => new Promise((resolve3, reject) => {
|
|
252640
253102
|
const request2 = transport.request(options, (incoming) => {
|
|
252641
253103
|
const chunks = [];
|
|
252642
253104
|
incoming.on("data", (chunk2) => {
|
|
@@ -252665,7 +253127,8 @@ var init_claudeSetupOauth = __esm({
|
|
|
252665
253127
|
}
|
|
252666
253128
|
request2.end();
|
|
252667
253129
|
});
|
|
252668
|
-
|
|
253130
|
+
const response = await withSystemTrustRetry(sendRequest);
|
|
253131
|
+
logger3.info("claude_setup_oauth_response", {
|
|
252669
253132
|
requestId: requestId2,
|
|
252670
253133
|
method,
|
|
252671
253134
|
host: url3.host,
|
|
@@ -252843,7 +253306,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252843
253306
|
startClaudeSetupCallbackServerFn = startClaudeSetupCallbackServer,
|
|
252844
253307
|
exchangeClaudeSetupOauthCodeFn = exchangeClaudeSetupOauthCode
|
|
252845
253308
|
}) => {
|
|
252846
|
-
|
|
253309
|
+
logger3.info("claude_setup_oauth_flow_start", {
|
|
252847
253310
|
authorizeOrigin: discovery.authorizeOrigin,
|
|
252848
253311
|
claudeCliVersion
|
|
252849
253312
|
});
|
|
@@ -252941,7 +253404,7 @@ var init_claudeSetupOauth = __esm({
|
|
|
252941
253404
|
showCopyableUrlFn = showCopyableUrl,
|
|
252942
253405
|
exchangeClaudeSetupOauthCodeFn = exchangeClaudeSetupOauthCode
|
|
252943
253406
|
}) => {
|
|
252944
|
-
|
|
253407
|
+
logger3.info("claude_setup_oauth_flow_start", {
|
|
252945
253408
|
authorizeOrigin: discovery.authorizeOrigin,
|
|
252946
253409
|
claudeCliVersion
|
|
252947
253410
|
});
|
|
@@ -269471,7 +269934,7 @@ var init_config2 = __esm({
|
|
|
269471
269934
|
|
|
269472
269935
|
// src/devbox/commands/init/remote.ts
|
|
269473
269936
|
import { randomUUID as randomUUID28 } from "node:crypto";
|
|
269474
|
-
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;
|
|
269475
269938
|
var init_remote = __esm({
|
|
269476
269939
|
"src/devbox/commands/init/remote.ts"() {
|
|
269477
269940
|
"use strict";
|
|
@@ -269504,7 +269967,7 @@ var init_remote = __esm({
|
|
|
269504
269967
|
HISTORY_BLOCK_PATTERN = /^# History search with up\/down arrows\n[\s\S]*?(?=\n# Basic aliases|(?![\s\S]))/m;
|
|
269505
269968
|
BASH_HISTORY_LINE_PATTERN = /^.*history-search-(?:backward|forward).*$\n?/gm;
|
|
269506
269969
|
ZSH_HISTORY_LINE_PATTERN = /^.*history-search-end.*$\n?|^.*history-beginning-search-backward-end.*$\n?|^.*history-beginning-search-forward-end.*$\n?/gm;
|
|
269507
|
-
|
|
269970
|
+
logger9 = createLogger("devbox-init");
|
|
269508
269971
|
truncateTail = (value, maxChars) => {
|
|
269509
269972
|
if (value.length <= maxChars) return value;
|
|
269510
269973
|
const omitted = value.length - maxChars;
|
|
@@ -269551,7 +270014,7 @@ var init_remote = __esm({
|
|
|
269551
270014
|
execWithLog = async (client, spriteAlias, script, stage, options) => {
|
|
269552
270015
|
const requestId2 = randomUUID28();
|
|
269553
270016
|
const startedAt2 = Date.now();
|
|
269554
|
-
|
|
270017
|
+
logger9.info("sprites_request", {
|
|
269555
270018
|
requestId: requestId2,
|
|
269556
270019
|
method: "exec",
|
|
269557
270020
|
path: "/exec",
|
|
@@ -269564,7 +270027,7 @@ var init_remote = __esm({
|
|
|
269564
270027
|
options
|
|
269565
270028
|
);
|
|
269566
270029
|
const durationMs = Date.now() - startedAt2;
|
|
269567
|
-
|
|
270030
|
+
logger9.info("sprites_response", {
|
|
269568
270031
|
requestId: requestId2,
|
|
269569
270032
|
method: "exec",
|
|
269570
270033
|
path: "/exec",
|
|
@@ -269584,7 +270047,7 @@ var init_remote = __esm({
|
|
|
269584
270047
|
};
|
|
269585
270048
|
writeRemoteFile = async (client, spriteAlias, path108, content, stage) => {
|
|
269586
270049
|
const requestId2 = randomUUID28();
|
|
269587
|
-
|
|
270050
|
+
logger9.info("sprites_request", {
|
|
269588
270051
|
requestId: requestId2,
|
|
269589
270052
|
method: "writeFile",
|
|
269590
270053
|
path: path108,
|
|
@@ -269593,7 +270056,7 @@ var init_remote = __esm({
|
|
|
269593
270056
|
});
|
|
269594
270057
|
const buffer = typeof content === "string" ? Buffer.from(content, "utf8") : content;
|
|
269595
270058
|
await client.writeFile(spriteAlias, path108, buffer);
|
|
269596
|
-
|
|
270059
|
+
logger9.info("sprites_response", {
|
|
269597
270060
|
requestId: requestId2,
|
|
269598
270061
|
method: "writeFile",
|
|
269599
270062
|
path: path108,
|
|
@@ -269604,7 +270067,7 @@ var init_remote = __esm({
|
|
|
269604
270067
|
};
|
|
269605
270068
|
readRemoteFile2 = async (client, spriteAlias, path108, stage) => {
|
|
269606
270069
|
const requestId2 = randomUUID28();
|
|
269607
|
-
|
|
270070
|
+
logger9.info("sprites_request", {
|
|
269608
270071
|
requestId: requestId2,
|
|
269609
270072
|
method: "readFile",
|
|
269610
270073
|
path: path108,
|
|
@@ -269613,7 +270076,7 @@ var init_remote = __esm({
|
|
|
269613
270076
|
});
|
|
269614
270077
|
try {
|
|
269615
270078
|
const bytes = await client.readFile(spriteAlias, { path: path108 });
|
|
269616
|
-
|
|
270079
|
+
logger9.info("sprites_response", {
|
|
269617
270080
|
requestId: requestId2,
|
|
269618
270081
|
method: "readFile",
|
|
269619
270082
|
path: path108,
|
|
@@ -269625,7 +270088,7 @@ var init_remote = __esm({
|
|
|
269625
270088
|
return Buffer.from(bytes).toString("utf8");
|
|
269626
270089
|
} catch (error55) {
|
|
269627
270090
|
const notFound = error55 instanceof RuntimeApiError && error55.status === 404;
|
|
269628
|
-
|
|
270091
|
+
logger9.info("sprites_response", {
|
|
269629
270092
|
requestId: requestId2,
|
|
269630
270093
|
method: "readFile",
|
|
269631
270094
|
path: path108,
|
|
@@ -269763,7 +270226,7 @@ ${canonicalBlock}
|
|
|
269763
270226
|
`${options.errorLabel}-read`
|
|
269764
270227
|
);
|
|
269765
270228
|
if (existing === null) {
|
|
269766
|
-
|
|
270229
|
+
logger9.warn("init_rc_patch_skipped_missing_file", {
|
|
269767
270230
|
box: spriteAlias,
|
|
269768
270231
|
path: options.path,
|
|
269769
270232
|
rcFile: options.errorLabel
|
|
@@ -269877,7 +270340,7 @@ ${canonicalBlock}
|
|
|
269877
270340
|
const stagedIndexPath = `${stagedExternalDir}/index.json`;
|
|
269878
270341
|
const stagedDatabaseDumpDir = `${workdir.replace(/\/$/, "")}/.devbox/database-dumps`;
|
|
269879
270342
|
const stagedDatabaseDumpIndexPath = `${stagedDatabaseDumpDir}/database-dumps.json`;
|
|
269880
|
-
|
|
270343
|
+
logger9.info("init_setup_artifacts_stage_start", {
|
|
269881
270344
|
box: spriteAlias,
|
|
269882
270345
|
workdir,
|
|
269883
270346
|
hasArtifactsBundle: Boolean(artifactsBundlePath),
|
|
@@ -270051,7 +270514,7 @@ ${canonicalBlock}
|
|
|
270051
270514
|
details ? `staging setup artifacts failed: ${details}` : `staging setup artifacts failed (exit ${result.exitCode})`
|
|
270052
270515
|
);
|
|
270053
270516
|
}
|
|
270054
|
-
|
|
270517
|
+
logger9.info("init_setup_artifacts_stage_complete", {
|
|
270055
270518
|
box: spriteAlias,
|
|
270056
270519
|
workdir,
|
|
270057
270520
|
stageMarkers: stageMarkers.length > 0 ? stageMarkers : void 0
|
|
@@ -274200,7 +274663,7 @@ var init_artifacts = __esm({
|
|
|
274200
274663
|
await appendImplicitRepoAgentArtifacts({ repoRoot, entries });
|
|
274201
274664
|
const filteredEntries = filterGitCheckoutEntries(entries);
|
|
274202
274665
|
if (filteredEntries.length === 0) {
|
|
274203
|
-
|
|
274666
|
+
logger3.info("init_setup_artifacts_packaging_skipped", {
|
|
274204
274667
|
operationId,
|
|
274205
274668
|
reason: "no_entries"
|
|
274206
274669
|
});
|
|
@@ -274224,7 +274687,7 @@ var init_artifacts = __esm({
|
|
|
274224
274687
|
(sum, item) => sum + item.sizeBytes,
|
|
274225
274688
|
0
|
|
274226
274689
|
);
|
|
274227
|
-
|
|
274690
|
+
logger3.info("init_setup_artifacts_packaging_start", {
|
|
274228
274691
|
operationId,
|
|
274229
274692
|
entryCount: filteredEntries.length,
|
|
274230
274693
|
excludedGitCheckoutCount: entries.length - filteredEntries.length,
|
|
@@ -274243,7 +274706,7 @@ var init_artifacts = __esm({
|
|
|
274243
274706
|
totalBytes,
|
|
274244
274707
|
detail: `${entry.name} (${index + 1}/${preparedEntries.length})`
|
|
274245
274708
|
});
|
|
274246
|
-
|
|
274709
|
+
logger3.info("init_setup_artifacts_copy_start", {
|
|
274247
274710
|
operationId,
|
|
274248
274711
|
artifactIndex: index + 1,
|
|
274249
274712
|
artifactCount: filteredEntries.length,
|
|
@@ -274259,7 +274722,7 @@ var init_artifacts = __esm({
|
|
|
274259
274722
|
totalBytes,
|
|
274260
274723
|
detail: `${entry.name} (${index + 1}/${preparedEntries.length})`
|
|
274261
274724
|
});
|
|
274262
|
-
|
|
274725
|
+
logger3.info("init_setup_artifacts_copy_complete", {
|
|
274263
274726
|
operationId,
|
|
274264
274727
|
artifactIndex: index + 1,
|
|
274265
274728
|
artifactCount: filteredEntries.length,
|
|
@@ -274291,7 +274754,7 @@ var init_artifacts = __esm({
|
|
|
274291
274754
|
totalBytes,
|
|
274292
274755
|
detail: "creating archive"
|
|
274293
274756
|
});
|
|
274294
|
-
|
|
274757
|
+
logger3.info("init_setup_artifacts_archive_start", {
|
|
274295
274758
|
operationId,
|
|
274296
274759
|
entryCount: filteredEntries.length
|
|
274297
274760
|
});
|
|
@@ -274313,13 +274776,13 @@ var init_artifacts = __esm({
|
|
|
274313
274776
|
await fs63.copyFile(bundlePath, finalBundle);
|
|
274314
274777
|
await fs63.copyFile(manifestPath, finalManifest);
|
|
274315
274778
|
const finalBundleStat = await fs63.stat(finalBundle);
|
|
274316
|
-
|
|
274779
|
+
logger3.info("init_setup_artifacts_archive_complete", {
|
|
274317
274780
|
operationId,
|
|
274318
274781
|
bundleBytes: finalBundleStat.size,
|
|
274319
274782
|
durationMs: Date.now() - archiveStartedAt
|
|
274320
274783
|
});
|
|
274321
274784
|
if (finalBundleStat.size <= SETUP_ARTIFACT_PART_SIZE_BYTES) {
|
|
274322
|
-
|
|
274785
|
+
logger3.info("init_setup_artifacts_packaging_complete", {
|
|
274323
274786
|
operationId,
|
|
274324
274787
|
entryCount: filteredEntries.length,
|
|
274325
274788
|
bundleBytes: finalBundleStat.size,
|
|
@@ -274342,7 +274805,7 @@ var init_artifacts = __esm({
|
|
|
274342
274805
|
totalBytes,
|
|
274343
274806
|
detail: "splitting large bundle"
|
|
274344
274807
|
});
|
|
274345
|
-
|
|
274808
|
+
logger3.info("init_setup_artifacts_split_start", {
|
|
274346
274809
|
operationId,
|
|
274347
274810
|
bundleBytes: finalBundleStat.size,
|
|
274348
274811
|
partSizeBytes: SETUP_ARTIFACT_PART_SIZE_BYTES
|
|
@@ -274387,14 +274850,14 @@ var init_artifacts = __esm({
|
|
|
274387
274850
|
JSON.stringify(descriptor, null, 2),
|
|
274388
274851
|
"utf8"
|
|
274389
274852
|
);
|
|
274390
|
-
|
|
274853
|
+
logger3.info("init_setup_artifacts_split_complete", {
|
|
274391
274854
|
operationId,
|
|
274392
274855
|
bundleBytes: finalBundleStat.size,
|
|
274393
274856
|
partSizeBytes: SETUP_ARTIFACT_PART_SIZE_BYTES,
|
|
274394
274857
|
splitPartCount: parts.length,
|
|
274395
274858
|
durationMs: Date.now() - splitStartedAt
|
|
274396
274859
|
});
|
|
274397
|
-
|
|
274860
|
+
logger3.info("init_setup_artifacts_packaging_complete", {
|
|
274398
274861
|
operationId,
|
|
274399
274862
|
entryCount: filteredEntries.length,
|
|
274400
274863
|
bundleBytes: finalBundleStat.size,
|
|
@@ -275499,7 +275962,7 @@ ${execResult.stderr}`;
|
|
|
275499
275962
|
return;
|
|
275500
275963
|
}
|
|
275501
275964
|
activeThreadId = threadId2;
|
|
275502
|
-
|
|
275965
|
+
logger3.info("init_remote_codex_managed_thread_persisted", {
|
|
275503
275966
|
box: spriteAlias,
|
|
275504
275967
|
workdir: expandedWorkdir,
|
|
275505
275968
|
threadId: threadId2,
|
|
@@ -276128,7 +276591,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276128
276591
|
}) => {
|
|
276129
276592
|
const uploadOperationId = randomUUID31();
|
|
276130
276593
|
const uploadStartedAt = Date.now();
|
|
276131
|
-
|
|
276594
|
+
logger3.info("init_setup_artifacts_upload_start", {
|
|
276132
276595
|
operationId: uploadOperationId,
|
|
276133
276596
|
box: spriteAlias,
|
|
276134
276597
|
hasArtifactsBundle: Boolean(
|
|
@@ -276207,7 +276670,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276207
276670
|
expectedBundleSha: descriptor.bundleSha256,
|
|
276208
276671
|
parts
|
|
276209
276672
|
};
|
|
276210
|
-
|
|
276673
|
+
logger3.info("init_setup_artifacts_split_upload_prepared", {
|
|
276211
276674
|
operationId: uploadOperationId,
|
|
276212
276675
|
box: spriteAlias,
|
|
276213
276676
|
splitPartCount: parts.length,
|
|
@@ -276300,7 +276763,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276300
276763
|
})
|
|
276301
276764
|
);
|
|
276302
276765
|
const totalBytes = plannedUploads.reduce((sum, item) => sum + item.size, 0);
|
|
276303
|
-
|
|
276766
|
+
logger3.info("init_setup_artifacts_upload_plan", {
|
|
276304
276767
|
operationId: uploadOperationId,
|
|
276305
276768
|
box: spriteAlias,
|
|
276306
276769
|
fileCount: plannedUploads.length,
|
|
@@ -276322,7 +276785,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276322
276785
|
const detail = `${upload.label} (${index + 1}/${plannedUploads.length})`;
|
|
276323
276786
|
const fileData = await fs64.readFile(upload.localPath);
|
|
276324
276787
|
const fileStartedAt = Date.now();
|
|
276325
|
-
|
|
276788
|
+
logger3.info("init_setup_artifacts_upload_file_start", {
|
|
276326
276789
|
operationId: uploadOperationId,
|
|
276327
276790
|
box: spriteAlias,
|
|
276328
276791
|
fileIndex: index + 1,
|
|
@@ -276343,7 +276806,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276343
276806
|
});
|
|
276344
276807
|
uploadedBytes += fileData.length;
|
|
276345
276808
|
updateProgress(fileData.length, detail);
|
|
276346
|
-
|
|
276809
|
+
logger3.info("init_setup_artifacts_upload_file_complete", {
|
|
276347
276810
|
operationId: uploadOperationId,
|
|
276348
276811
|
box: spriteAlias,
|
|
276349
276812
|
fileIndex: index + 1,
|
|
@@ -276357,7 +276820,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276357
276820
|
if (splitArtifacts && remoteArtifactsBundlePath) {
|
|
276358
276821
|
status.stage("Assembling artifacts on remote");
|
|
276359
276822
|
const assembleStartedAt = Date.now();
|
|
276360
|
-
|
|
276823
|
+
logger3.info("init_setup_artifacts_remote_assemble_start", {
|
|
276361
276824
|
operationId: uploadOperationId,
|
|
276362
276825
|
box: spriteAlias,
|
|
276363
276826
|
splitPartCount: splitArtifacts.parts.length,
|
|
@@ -276425,7 +276888,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276425
276888
|
assembleResult.stderr || assembleResult.stdout || "Failed to assemble split setup artifacts on remote"
|
|
276426
276889
|
);
|
|
276427
276890
|
}
|
|
276428
|
-
|
|
276891
|
+
logger3.info("init_setup_artifacts_remote_assemble_complete", {
|
|
276429
276892
|
operationId: uploadOperationId,
|
|
276430
276893
|
box: spriteAlias,
|
|
276431
276894
|
splitPartCount: splitArtifacts.parts.length,
|
|
@@ -276440,7 +276903,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276440
276903
|
totalBytes,
|
|
276441
276904
|
detail: "completed"
|
|
276442
276905
|
});
|
|
276443
|
-
|
|
276906
|
+
logger3.info("init_setup_artifacts_upload_complete", {
|
|
276444
276907
|
operationId: uploadOperationId,
|
|
276445
276908
|
box: spriteAlias,
|
|
276446
276909
|
fileCount: plannedUploads.length,
|
|
@@ -276478,7 +276941,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276478
276941
|
}) => {
|
|
276479
276942
|
const handoffAfterRemoteStart = emitCodexOutput === false && completionArtifactsGraceMs === 0;
|
|
276480
276943
|
const hasManagedDaemonControl = typeof client.runDaemonControlRequest === "function";
|
|
276481
|
-
|
|
276944
|
+
logger3.info("init_remote_codex_branch_selected", {
|
|
276482
276945
|
box: spriteAlias,
|
|
276483
276946
|
workdir: expandedWorkdir,
|
|
276484
276947
|
computeProvider,
|
|
@@ -276580,7 +277043,7 @@ codex login --boxes-dev-managed-auth-override`
|
|
|
276580
277043
|
execSessionId
|
|
276581
277044
|
})
|
|
276582
277045
|
).catch((error55) => {
|
|
276583
|
-
|
|
277046
|
+
logger3.warn("init_remote_codex_running_hook_failed", {
|
|
276584
277047
|
box: spriteAlias,
|
|
276585
277048
|
workdir: expandedWorkdir,
|
|
276586
277049
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -281129,14 +281592,14 @@ var init_provisionFlow = __esm({
|
|
|
281129
281592
|
import fs71 from "node:fs/promises";
|
|
281130
281593
|
import { randomUUID as randomUUID33 } from "node:crypto";
|
|
281131
281594
|
import { spawn as spawn23 } from "node:child_process";
|
|
281132
|
-
var
|
|
281595
|
+
var logger10, SSH_IDENTITY_FILE, stripGitSuffix2, normalizeGitRemoteHost, buildSshUrl, buildSettingsUrl, parseScpLike, parseGitRemote, execRemote, readRemoteOrigin, setRemoteOrigin, ensureSshKey, ensureSshConfig, verifySshAuth, runClipboardCommand2, copyToClipboard;
|
|
281133
281596
|
var init_ssh = __esm({
|
|
281134
281597
|
"src/devbox/commands/init/ssh.ts"() {
|
|
281135
281598
|
"use strict";
|
|
281136
281599
|
init_devboxCore();
|
|
281137
281600
|
init_browser();
|
|
281138
281601
|
init_remote();
|
|
281139
|
-
|
|
281602
|
+
logger10 = createLogger("devbox-init");
|
|
281140
281603
|
SSH_IDENTITY_FILE = "~/.ssh/devbox_ed25519";
|
|
281141
281604
|
stripGitSuffix2 = (value) => {
|
|
281142
281605
|
let trimmed = value.trim();
|
|
@@ -281225,7 +281688,7 @@ var init_ssh = __esm({
|
|
|
281225
281688
|
};
|
|
281226
281689
|
execRemote = async (client, spriteAlias, script, stage) => {
|
|
281227
281690
|
const requestId2 = randomUUID33();
|
|
281228
|
-
|
|
281691
|
+
logger10.info("sprites_request", {
|
|
281229
281692
|
requestId: requestId2,
|
|
281230
281693
|
method: "exec",
|
|
281231
281694
|
path: "/exec",
|
|
@@ -281233,7 +281696,7 @@ var init_ssh = __esm({
|
|
|
281233
281696
|
stage
|
|
281234
281697
|
});
|
|
281235
281698
|
const result = await client.exec(spriteAlias, ["/bin/bash", "-lc", script]);
|
|
281236
|
-
|
|
281699
|
+
logger10.info("sprites_response", {
|
|
281237
281700
|
requestId: requestId2,
|
|
281238
281701
|
method: "exec",
|
|
281239
281702
|
path: "/exec",
|
|
@@ -283653,7 +284116,7 @@ var init_setup = __esm({
|
|
|
283653
284116
|
url: url3,
|
|
283654
284117
|
destinationPath
|
|
283655
284118
|
}) => {
|
|
283656
|
-
const response = await
|
|
284119
|
+
const response = await fetchWithSystemTrust(url3);
|
|
283657
284120
|
if (!response.ok) {
|
|
283658
284121
|
throw new Error(`Download failed with HTTP ${response.status}.`);
|
|
283659
284122
|
}
|
|
@@ -283666,7 +284129,7 @@ var init_setup = __esm({
|
|
|
283666
284129
|
);
|
|
283667
284130
|
};
|
|
283668
284131
|
fetchDesktopDownloadManifest = async (manifestUrl) => {
|
|
283669
|
-
const response = await
|
|
284132
|
+
const response = await fetchWithSystemTrust(manifestUrl);
|
|
283670
284133
|
if (!response.ok) {
|
|
283671
284134
|
throw new Error(
|
|
283672
284135
|
`Desktop download manifest failed with HTTP ${response.status}.`
|
|
@@ -283827,7 +284290,7 @@ var init_setup = __esm({
|
|
|
283827
284290
|
spinner.start("Resolving latest Boxes.dev desktop app");
|
|
283828
284291
|
spinnerStarted = true;
|
|
283829
284292
|
const manifest = await fetchDesktopDownloadManifest(download.manifestUrl);
|
|
283830
|
-
|
|
284293
|
+
logger3.info("setup_desktop_install_start", {
|
|
283831
284294
|
downloadManifestUrl: download.manifestUrl,
|
|
283832
284295
|
url: manifest.url,
|
|
283833
284296
|
version: manifest.version,
|
|
@@ -283862,7 +284325,7 @@ var init_setup = __esm({
|
|
|
283862
284325
|
);
|
|
283863
284326
|
console.log(`Run it with: open "${DESKTOP_APP_TARGET_PATH}"`);
|
|
283864
284327
|
console.log("");
|
|
283865
|
-
|
|
284328
|
+
logger3.info("setup_desktop_install_complete", {
|
|
283866
284329
|
targetPath: DESKTOP_APP_TARGET_PATH
|
|
283867
284330
|
});
|
|
283868
284331
|
return {
|
|
@@ -283874,7 +284337,7 @@ var init_setup = __esm({
|
|
|
283874
284337
|
spinner.stop("Desktop install failed.");
|
|
283875
284338
|
}
|
|
283876
284339
|
const detail = error55 instanceof Error && error55.message.trim().length > 0 ? error55.message.trim() : String(error55);
|
|
283877
|
-
|
|
284340
|
+
logger3.warn("setup_desktop_install_failed", { error: detail });
|
|
283878
284341
|
console.error(
|
|
283879
284342
|
`Failed to install ${DESKTOP_APP_BUNDLE_NAME} automatically: ${detail}`
|
|
283880
284343
|
);
|
|
@@ -283887,7 +284350,7 @@ var init_setup = __esm({
|
|
|
283887
284350
|
} finally {
|
|
283888
284351
|
if (mounted && tempDir) {
|
|
283889
284352
|
await detachDmg(mountPath()).catch((error55) => {
|
|
283890
|
-
|
|
284353
|
+
logger3.warn("setup_desktop_install_detach_failed", {
|
|
283891
284354
|
mountPath: mountPath(),
|
|
283892
284355
|
error: String(error55)
|
|
283893
284356
|
});
|
|
@@ -283895,7 +284358,7 @@ var init_setup = __esm({
|
|
|
283895
284358
|
}
|
|
283896
284359
|
if (tempDir) {
|
|
283897
284360
|
await rm3(tempDir, { recursive: true, force: true }).catch((error55) => {
|
|
283898
|
-
|
|
284361
|
+
logger3.warn("setup_desktop_install_cleanup_failed", {
|
|
283899
284362
|
tempDir,
|
|
283900
284363
|
error: String(error55)
|
|
283901
284364
|
});
|
|
@@ -284130,7 +284593,7 @@ var init_setup = __esm({
|
|
|
284130
284593
|
const e2bCredentialStatus = await fetchResolvedE2bCredentials(controlPlaneToken);
|
|
284131
284594
|
e2bAuthMode = resolveE2bAuthMode(e2bCredentialStatus.source);
|
|
284132
284595
|
} catch (error55) {
|
|
284133
|
-
|
|
284596
|
+
logger3.warn("e2b_credential_status_failed", { error: String(error55) });
|
|
284134
284597
|
e2bAuthMode = "shared";
|
|
284135
284598
|
}
|
|
284136
284599
|
}
|
|
@@ -286527,7 +286990,7 @@ var init_gitSigningRemoteInstall = __esm({
|
|
|
286527
286990
|
spriteAlias,
|
|
286528
286991
|
script
|
|
286529
286992
|
}) => {
|
|
286530
|
-
|
|
286993
|
+
logger3.info("init_git_signing_remote_install_start", {
|
|
286531
286994
|
box: spriteAlias
|
|
286532
286995
|
});
|
|
286533
286996
|
const result = await client.exec(
|
|
@@ -286545,7 +287008,7 @@ var init_gitSigningRemoteInstall = __esm({
|
|
|
286545
287008
|
],
|
|
286546
287009
|
{ timeoutMs: GIT_SIGNING_REMOTE_INSTALL_TIMEOUT_MS }
|
|
286547
287010
|
);
|
|
286548
|
-
|
|
287011
|
+
logger3.info("init_git_signing_remote_install_complete", {
|
|
286549
287012
|
box: spriteAlias,
|
|
286550
287013
|
status: result.exitCode === 0 ? "ok" : "error",
|
|
286551
287014
|
exitCode: result.exitCode
|
|
@@ -287438,7 +287901,7 @@ var init_finalizeFlow = __esm({
|
|
|
287438
287901
|
status
|
|
287439
287902
|
}) => {
|
|
287440
287903
|
status.stage("Configuring git safe dir");
|
|
287441
|
-
|
|
287904
|
+
logger3.info("init_git_safe_directory_configure_start", {
|
|
287442
287905
|
box: spriteAlias,
|
|
287443
287906
|
workdir
|
|
287444
287907
|
});
|
|
@@ -287485,7 +287948,7 @@ var init_finalizeFlow = __esm({
|
|
|
287485
287948
|
details ? `Failed to configure git safe.directory: ${details.trim()}` : `Failed to configure git safe.directory (exit ${result.exitCode})`
|
|
287486
287949
|
);
|
|
287487
287950
|
}
|
|
287488
|
-
|
|
287951
|
+
logger3.info("init_git_safe_directory_configure_complete", {
|
|
287489
287952
|
box: spriteAlias,
|
|
287490
287953
|
workdir
|
|
287491
287954
|
});
|
|
@@ -287729,7 +288192,7 @@ var init_finalizeFlow = __esm({
|
|
|
287729
288192
|
}
|
|
287730
288193
|
});
|
|
287731
288194
|
} catch (error55) {
|
|
287732
|
-
|
|
288195
|
+
logger3.warn("init_remote_codex_thread_visibility_sync_failed", {
|
|
287733
288196
|
box: spriteAlias,
|
|
287734
288197
|
alias,
|
|
287735
288198
|
previousThreadId: normalizeStoredPath(previousResumeState?.threadId),
|
|
@@ -287747,7 +288210,7 @@ var init_finalizeFlow = __esm({
|
|
|
287747
288210
|
try {
|
|
287748
288211
|
return await upsertRemoteInitCodexThread(token, alias, threadId2);
|
|
287749
288212
|
} catch (error55) {
|
|
287750
|
-
|
|
288213
|
+
logger3.warn("init_remote_codex_desktop_thread_lookup_failed", {
|
|
287751
288214
|
box: spriteAlias,
|
|
287752
288215
|
alias,
|
|
287753
288216
|
threadId: threadId2,
|
|
@@ -287776,7 +288239,7 @@ var init_finalizeFlow = __esm({
|
|
|
287776
288239
|
codexSetupLastMessagePath: resumeState?.lastMessagePath ?? null,
|
|
287777
288240
|
codexSetupTodoPath: resumeState?.setupTodoPath ?? null
|
|
287778
288241
|
});
|
|
287779
|
-
|
|
288242
|
+
logger3.info("init_remote_codex_resume_state_persisted", {
|
|
287780
288243
|
box: spriteAlias,
|
|
287781
288244
|
alias,
|
|
287782
288245
|
threadId: resumeState?.threadId ?? null,
|
|
@@ -287805,7 +288268,7 @@ var init_finalizeFlow = __esm({
|
|
|
287805
288268
|
const resolvedThreadId = matchingSession?.sessionId?.trim() ?? "";
|
|
287806
288269
|
return resolvedThreadId.length > 0 ? resolvedThreadId : null;
|
|
287807
288270
|
} catch (error55) {
|
|
287808
|
-
|
|
288271
|
+
logger3.warn("init_remote_codex_thread_recovery_failed", {
|
|
287809
288272
|
box: spriteAlias,
|
|
287810
288273
|
alias,
|
|
287811
288274
|
execSessionId: normalizedExecSessionId,
|
|
@@ -287990,7 +288453,7 @@ var init_finalizeFlow = __esm({
|
|
|
287990
288453
|
ok(`Snapshot created: ${checkpoint.id}`);
|
|
287991
288454
|
}
|
|
287992
288455
|
} catch (error55) {
|
|
287993
|
-
|
|
288456
|
+
logger3.warn("init_checkpoint_create_failed", {
|
|
287994
288457
|
box: canonical,
|
|
287995
288458
|
fingerprint,
|
|
287996
288459
|
phase: "pre-codex-setup",
|
|
@@ -288042,7 +288505,7 @@ var init_finalizeFlow = __esm({
|
|
|
288042
288505
|
summary: setupCompletion.summary
|
|
288043
288506
|
});
|
|
288044
288507
|
}
|
|
288045
|
-
|
|
288508
|
+
logger3.info("init_codex_resume_detected_remote_completion", {
|
|
288046
288509
|
box: spriteAlias,
|
|
288047
288510
|
workdir: expandedWorkdir,
|
|
288048
288511
|
source: setupCompletion.source
|
|
@@ -288263,7 +288726,7 @@ var init_finalizeFlow = __esm({
|
|
|
288263
288726
|
ok(`Snapshot created: ${checkpoint.id}`);
|
|
288264
288727
|
}
|
|
288265
288728
|
} catch (error55) {
|
|
288266
|
-
|
|
288729
|
+
logger3.warn("init_checkpoint_create_failed", {
|
|
288267
288730
|
box: canonical,
|
|
288268
288731
|
fingerprint,
|
|
288269
288732
|
phase: "post-codex-setup",
|
|
@@ -288843,7 +289306,7 @@ var init_e2b = __esm({
|
|
|
288843
289306
|
enabled: progressEnabled,
|
|
288844
289307
|
title: "Destroying Template box (--force)",
|
|
288845
289308
|
fn: async ({ status }) => {
|
|
288846
|
-
|
|
289309
|
+
logger3.info("init_force_destroy_start", {
|
|
288847
289310
|
box: forceAlias,
|
|
288848
289311
|
provider: "e2b"
|
|
288849
289312
|
});
|
|
@@ -290137,7 +290600,7 @@ var init_claudeBootstrap = __esm({
|
|
|
290137
290600
|
remoteHome
|
|
290138
290601
|
}) => {
|
|
290139
290602
|
const paths = buildRemoteClaudePaths(remoteHome);
|
|
290140
|
-
|
|
290603
|
+
logger3.info("init_claude_bootstrap_start", {
|
|
290141
290604
|
box: spriteAlias,
|
|
290142
290605
|
workdir: remoteWorkdir,
|
|
290143
290606
|
remoteHome
|
|
@@ -290245,7 +290708,7 @@ var init_claudeBootstrap = __esm({
|
|
|
290245
290708
|
}
|
|
290246
290709
|
const status = remoteState.data === null ? "applied" : shouldWriteState || shouldWriteSettings || shouldWriteClaudeMd || shouldWritePluginsConfig || shouldSyncCommandsDir || shouldSyncSkillsDir || shouldSyncAgentsDir ? "updated_existing" : "skipped_existing";
|
|
290247
290710
|
if (status === "skipped_existing") {
|
|
290248
|
-
|
|
290711
|
+
logger3.info("init_claude_bootstrap_skipped_existing", {
|
|
290249
290712
|
box: spriteAlias,
|
|
290250
290713
|
workdir: remoteWorkdir,
|
|
290251
290714
|
path: remoteState.path
|
|
@@ -290271,7 +290734,7 @@ var init_claudeBootstrap = __esm({
|
|
|
290271
290734
|
...shouldWriteClaudeMd ? [paths.remoteClaudeMdPath] : []
|
|
290272
290735
|
]
|
|
290273
290736
|
});
|
|
290274
|
-
|
|
290737
|
+
logger3.info("init_claude_bootstrap_success", {
|
|
290275
290738
|
box: spriteAlias,
|
|
290276
290739
|
workdir: remoteWorkdir,
|
|
290277
290740
|
sourceStatePath: stateSource.path,
|
|
@@ -290530,7 +290993,7 @@ var init_codexBootstrap = __esm({
|
|
|
290530
290993
|
spriteAlias
|
|
290531
290994
|
}) => {
|
|
290532
290995
|
const paths = buildRemoteCodexPaths(remoteHome);
|
|
290533
|
-
|
|
290996
|
+
logger3.info("init_codex_bootstrap_start", {
|
|
290534
290997
|
box: spriteAlias,
|
|
290535
290998
|
remoteHome
|
|
290536
290999
|
});
|
|
@@ -290541,7 +291004,7 @@ var init_codexBootstrap = __esm({
|
|
|
290541
291004
|
const shouldWriteAgentsMd = Boolean(localAgentsMd);
|
|
290542
291005
|
const shouldSyncSkillsDir = Boolean(localSkillsDir);
|
|
290543
291006
|
if (!shouldImportConfig && !shouldWriteAgentsMd && !shouldSyncSkillsDir) {
|
|
290544
|
-
|
|
291007
|
+
logger3.info("init_codex_bootstrap_skipped_no_local_config", {
|
|
290545
291008
|
box: spriteAlias,
|
|
290546
291009
|
sourceConfigPath: configSource.path
|
|
290547
291010
|
});
|
|
@@ -290607,7 +291070,7 @@ var init_codexBootstrap = __esm({
|
|
|
290607
291070
|
touchedSkillsDir: shouldSyncSkillsDir
|
|
290608
291071
|
});
|
|
290609
291072
|
}
|
|
290610
|
-
|
|
291073
|
+
logger3.info("init_codex_bootstrap_success", {
|
|
290611
291074
|
box: spriteAlias,
|
|
290612
291075
|
importedMcpServerCount: Object.keys(configSource.data.mcpServers).length,
|
|
290613
291076
|
parseWarningCount: configSource.parseWarnings.length,
|
|
@@ -290773,7 +291236,7 @@ var init_agentsSection = __esm({
|
|
|
290773
291236
|
remoteHome
|
|
290774
291237
|
});
|
|
290775
291238
|
if (result.parseWarnings.length > 0) {
|
|
290776
|
-
|
|
291239
|
+
logger3.warn("init_claude_bootstrap_local_parse_warnings", {
|
|
290777
291240
|
box: spriteAlias,
|
|
290778
291241
|
warningCount: result.parseWarnings.length,
|
|
290779
291242
|
warnings: result.parseWarnings
|
|
@@ -290787,7 +291250,7 @@ var init_agentsSection = __esm({
|
|
|
290787
291250
|
status.stage("Claude: config bootstrapped");
|
|
290788
291251
|
}
|
|
290789
291252
|
} catch (error55) {
|
|
290790
|
-
|
|
291253
|
+
logger3.warn("init_claude_bootstrap_failed", {
|
|
290791
291254
|
box: spriteAlias,
|
|
290792
291255
|
workdir: expandedWorkdir,
|
|
290793
291256
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -290822,7 +291285,7 @@ var init_agentsSection = __esm({
|
|
|
290822
291285
|
spriteAlias
|
|
290823
291286
|
});
|
|
290824
291287
|
if (result.parseWarnings.length > 0) {
|
|
290825
|
-
|
|
291288
|
+
logger3.warn("init_codex_bootstrap_local_parse_warnings", {
|
|
290826
291289
|
box: spriteAlias,
|
|
290827
291290
|
warningCount: result.parseWarnings.length,
|
|
290828
291291
|
warnings: result.parseWarnings
|
|
@@ -290838,7 +291301,7 @@ var init_agentsSection = __esm({
|
|
|
290838
291301
|
status.stage("Codex: config bootstrapped");
|
|
290839
291302
|
}
|
|
290840
291303
|
} catch (error55) {
|
|
290841
|
-
|
|
291304
|
+
logger3.warn("init_codex_bootstrap_failed", {
|
|
290842
291305
|
box: spriteAlias,
|
|
290843
291306
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
290844
291307
|
});
|
|
@@ -291194,7 +291657,7 @@ var init_init = __esm({
|
|
|
291194
291657
|
throw error55;
|
|
291195
291658
|
}
|
|
291196
291659
|
status.stage(`${title} (retry ${retryIndex}/${maxRetries})`);
|
|
291197
|
-
|
|
291660
|
+
logger3.warn("init_step_retry", {
|
|
291198
291661
|
title,
|
|
291199
291662
|
retry: retryIndex,
|
|
291200
291663
|
retries: maxRetries,
|
|
@@ -291522,7 +291985,7 @@ var init_init = __esm({
|
|
|
291522
291985
|
updateInitState,
|
|
291523
291986
|
extractCheckpointId: extractInitCheckpointId,
|
|
291524
291987
|
onCheckpointIdMissing: ({ canonical: canonical2, phaseLabel }) => {
|
|
291525
|
-
|
|
291988
|
+
logger3.warn("init_checkpoint_id_missing", {
|
|
291526
291989
|
box: canonical2,
|
|
291527
291990
|
fingerprint,
|
|
291528
291991
|
phase: phaseLabel
|
|
@@ -291747,7 +292210,7 @@ var init_init = __esm({
|
|
|
291747
292210
|
status.stop();
|
|
291748
292211
|
},
|
|
291749
292212
|
onFetchStatusError: (error55) => {
|
|
291750
|
-
|
|
292213
|
+
logger3.warn("init_claude_token_status_failed", {
|
|
291751
292214
|
error: String(error55)
|
|
291752
292215
|
});
|
|
291753
292216
|
}
|
|
@@ -291788,7 +292251,7 @@ var init_init = __esm({
|
|
|
291788
292251
|
throw new Error("E2B init runtime is missing keepalive support.");
|
|
291789
292252
|
}
|
|
291790
292253
|
const result = await client.keepAlive(alias, { wakeIfPaused: true });
|
|
291791
|
-
|
|
292254
|
+
logger3.info("init_e2b_keepalive", {
|
|
291792
292255
|
box: canonical,
|
|
291793
292256
|
alias,
|
|
291794
292257
|
boundary,
|
|
@@ -291906,7 +292369,7 @@ var init_init = __esm({
|
|
|
291906
292369
|
}
|
|
291907
292370
|
});
|
|
291908
292371
|
} catch (error55) {
|
|
291909
|
-
|
|
292372
|
+
logger3.warn("devbox_bootstrap_failed", {
|
|
291910
292373
|
box: canonical,
|
|
291911
292374
|
error: String(error55)
|
|
291912
292375
|
});
|
|
@@ -291956,7 +292419,7 @@ var init_init = __esm({
|
|
|
291956
292419
|
});
|
|
291957
292420
|
await updateInitState({ steps: { daemonInstalled: true } });
|
|
291958
292421
|
} catch (error55) {
|
|
291959
|
-
|
|
292422
|
+
logger3.warn("sprite_daemon_install_failed", {
|
|
291960
292423
|
box: canonical,
|
|
291961
292424
|
error: String(error55)
|
|
291962
292425
|
});
|
|
@@ -291982,7 +292445,7 @@ var init_init = __esm({
|
|
|
291982
292445
|
});
|
|
291983
292446
|
await updateInitState({ steps: { daemonServiceEnsured: true } });
|
|
291984
292447
|
} catch (error55) {
|
|
291985
|
-
|
|
292448
|
+
logger3.warn("sprite_daemon_service_failed", {
|
|
291986
292449
|
box: canonical,
|
|
291987
292450
|
error: String(error55)
|
|
291988
292451
|
});
|
|
@@ -292040,7 +292503,7 @@ var init_init = __esm({
|
|
|
292040
292503
|
});
|
|
292041
292504
|
await updateInitState({ steps: { sshdConfigured: true } });
|
|
292042
292505
|
} catch (error55) {
|
|
292043
|
-
|
|
292506
|
+
logger3.warn("sshd_config_failed", {
|
|
292044
292507
|
box: canonical,
|
|
292045
292508
|
error: String(error55)
|
|
292046
292509
|
});
|
|
@@ -292067,7 +292530,7 @@ var init_init = __esm({
|
|
|
292067
292530
|
});
|
|
292068
292531
|
await updateInitState({ steps: { codexCliEnsured: true } });
|
|
292069
292532
|
} catch (error55) {
|
|
292070
|
-
|
|
292533
|
+
logger3.warn("codex_cli_ensure_failed", {
|
|
292071
292534
|
box: canonical,
|
|
292072
292535
|
fingerprint,
|
|
292073
292536
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -292170,7 +292633,7 @@ var init_init = __esm({
|
|
|
292170
292633
|
updateInitState
|
|
292171
292634
|
});
|
|
292172
292635
|
if (remoteWorkdirState === "missing") {
|
|
292173
|
-
|
|
292636
|
+
logger3.info("init_resume_remote_repo_missing", {
|
|
292174
292637
|
box: canonical,
|
|
292175
292638
|
workdir: expandedWorkdir
|
|
292176
292639
|
});
|
|
@@ -292489,7 +292952,7 @@ var init_list = __esm({
|
|
|
292489
292952
|
}
|
|
292490
292953
|
return states;
|
|
292491
292954
|
} catch (error55) {
|
|
292492
|
-
|
|
292955
|
+
logger3.warn("managed_lifecycle_status_lookup_failed", {
|
|
292493
292956
|
error: String(error55)
|
|
292494
292957
|
});
|
|
292495
292958
|
for (const box of managedBoxes) {
|
|
@@ -292535,7 +292998,7 @@ var init_list = __esm({
|
|
|
292535
292998
|
try {
|
|
292536
292999
|
await recordCompletionAliases(boxes);
|
|
292537
293000
|
} catch (error55) {
|
|
292538
|
-
|
|
293001
|
+
logger3.warn("completion_cache_update_failed", { error: String(error55) });
|
|
292539
293002
|
}
|
|
292540
293003
|
const managedStates = await managedStatesPromise;
|
|
292541
293004
|
const remoteStates = resolveRemoteStates(boxes, managedStates);
|
|
@@ -292666,7 +293129,7 @@ var init_logout = __esm({
|
|
|
292666
293129
|
try {
|
|
292667
293130
|
await signOutControlPlane(token);
|
|
292668
293131
|
} catch (error55) {
|
|
292669
|
-
|
|
293132
|
+
logger3.warn("control_plane_signout_failed", { error: String(error55) });
|
|
292670
293133
|
}
|
|
292671
293134
|
}
|
|
292672
293135
|
await store.clearControlPlaneSession();
|
|
@@ -292788,7 +293251,7 @@ var init_mount = __esm({
|
|
|
292788
293251
|
try {
|
|
292789
293252
|
providerLookupBoxes = await listDevboxes();
|
|
292790
293253
|
} catch (error55) {
|
|
292791
|
-
|
|
293254
|
+
logger3.warn("mount_provider_lookup_failed", {
|
|
292792
293255
|
box: spriteAlias,
|
|
292793
293256
|
error: String(error55)
|
|
292794
293257
|
});
|
|
@@ -292886,7 +293349,7 @@ var init_mount = __esm({
|
|
|
292886
293349
|
try {
|
|
292887
293350
|
await stopSshPort(socketInfo.socketPath, spriteAlias, sshPort);
|
|
292888
293351
|
} catch (stopError) {
|
|
292889
|
-
|
|
293352
|
+
logger3.warn("mount_forward_cleanup_failed", {
|
|
292890
293353
|
box: spriteAlias,
|
|
292891
293354
|
error: String(stopError)
|
|
292892
293355
|
});
|
|
@@ -294248,7 +294711,7 @@ var init_agentPermissions = __esm({
|
|
|
294248
294711
|
});
|
|
294249
294712
|
|
|
294250
294713
|
// src/devbox/commands/agentPermissionRequests.ts
|
|
294251
|
-
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;
|
|
294252
294715
|
var init_agentPermissionRequests = __esm({
|
|
294253
294716
|
"src/devbox/commands/agentPermissionRequests.ts"() {
|
|
294254
294717
|
"use strict";
|
|
@@ -294266,14 +294729,17 @@ var init_agentPermissionRequests = __esm({
|
|
|
294266
294729
|
if (!isOnboxAgentPermission(permission)) {
|
|
294267
294730
|
return {
|
|
294268
294731
|
question: `An agent is asking for the ${permission} permission.`,
|
|
294269
|
-
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
|
|
294270
294735
|
};
|
|
294271
294736
|
}
|
|
294272
294737
|
return buildOnboxAgentPermissionRequestPresentation({
|
|
294273
294738
|
permission,
|
|
294274
294739
|
sourceBoxKind: entry.sourceBoxKind,
|
|
294275
294740
|
projectScopeAvailable: entry.request.projectScopeAvailable,
|
|
294276
|
-
teamTemplateName: entry.request.teamTemplateName
|
|
294741
|
+
teamTemplateName: entry.request.teamTemplateName,
|
|
294742
|
+
action: entry.request.action ?? null
|
|
294277
294743
|
});
|
|
294278
294744
|
};
|
|
294279
294745
|
formatExpiry = (expiresAt, now) => {
|
|
@@ -294283,12 +294749,14 @@ var init_agentPermissionRequests = __esm({
|
|
|
294283
294749
|
renderPendingPermissionRequests = (entries, now) => {
|
|
294284
294750
|
if (entries.length === 0) return "No agents are waiting for permission.";
|
|
294285
294751
|
const blocks = entries.map((entry) => {
|
|
294286
|
-
const { question, scope } = describeRequest(entry);
|
|
294752
|
+
const { question, scope, details, agentReason } = describeRequest(entry);
|
|
294287
294753
|
const id2 = entry.request.requestId;
|
|
294288
294754
|
return [
|
|
294289
294755
|
question,
|
|
294290
294756
|
` From ${boxLabel(entry)}, thread "${entry.threadTitle}". ${formatExpiry(entry.request.expiresAt, now)}`,
|
|
294757
|
+
...details.map(({ label, value }) => ` ${label}: ${value}`),
|
|
294291
294758
|
` ${scope}`,
|
|
294759
|
+
...agentReason === null ? [] : [` ${agentReason}`],
|
|
294292
294760
|
` dvb permissions allow ${id2}${entry.request.projectScopeAvailable ? " [--project]" : ""}`,
|
|
294293
294761
|
` dvb permissions deny ${id2}`
|
|
294294
294762
|
].join("\n");
|
|
@@ -294331,8 +294799,9 @@ var init_agentPermissionRequests = __esm({
|
|
|
294331
294799
|
json: readBooleanFlag(flags, "json")
|
|
294332
294800
|
};
|
|
294333
294801
|
};
|
|
294802
|
+
listPendingRequests = async (client) => await client.query(listPending, { supportsIntegrationPermissions: true });
|
|
294334
294803
|
findPendingRequest = async (client, requestId2) => {
|
|
294335
|
-
const entries = await client
|
|
294804
|
+
const entries = await listPendingRequests(client);
|
|
294336
294805
|
const entry = entries.find(
|
|
294337
294806
|
(candidate) => candidate.request.requestId === requestId2
|
|
294338
294807
|
);
|
|
@@ -294369,6 +294838,9 @@ var init_agentPermissionRequests = __esm({
|
|
|
294369
294838
|
if (decision === "deny") {
|
|
294370
294839
|
return `Denied ${permission} for ${boxLabel(entry)}. Agent permissions didn't change.`;
|
|
294371
294840
|
}
|
|
294841
|
+
if (entry.request.action) {
|
|
294842
|
+
return `Allowed this change in thread "${entry.threadTitle}". The agent can now apply it.`;
|
|
294843
|
+
}
|
|
294372
294844
|
if (isOnboxAgentPermission(permission) && isOnboxAgentThreadGrantPermission(permission)) {
|
|
294373
294845
|
return `Allowed ${permission} for 3 hours in thread "${entry.threadTitle}".`;
|
|
294374
294846
|
}
|
|
@@ -294387,7 +294859,8 @@ var init_agentPermissionRequests = __esm({
|
|
|
294387
294859
|
clientThreadId: entry.clientThreadId,
|
|
294388
294860
|
requestId: entry.request.requestId,
|
|
294389
294861
|
decision,
|
|
294390
|
-
scope
|
|
294862
|
+
scope,
|
|
294863
|
+
supportsIntegrationPermissions: true
|
|
294391
294864
|
});
|
|
294392
294865
|
requireDecisionApplied(decision, response.status);
|
|
294393
294866
|
return { decision, scope, status: response.status, entry };
|
|
@@ -294410,7 +294883,7 @@ var init_agentPermissionRequests = __esm({
|
|
|
294410
294883
|
json: readBooleanFlag(flags, "json"),
|
|
294411
294884
|
dependencies,
|
|
294412
294885
|
load: async ({ client }) => ({
|
|
294413
|
-
requests: await client
|
|
294886
|
+
requests: await listPendingRequests(client)
|
|
294414
294887
|
}),
|
|
294415
294888
|
render: ({ requests }) => renderPendingPermissionRequests(requests, now())
|
|
294416
294889
|
});
|
|
@@ -297521,7 +297994,7 @@ var init_sentryTest = __esm({
|
|
|
297521
297994
|
// src/devbox/commands/sshProxy.ts
|
|
297522
297995
|
import { randomUUID as randomUUID39 } from "node:crypto";
|
|
297523
297996
|
import net5 from "node:net";
|
|
297524
|
-
var
|
|
297997
|
+
var logger12, SSH_PROXY_USAGE, parsePort2, parseSshProxyArgs, acquireSshForward, releaseSshForward, bridgeProxySocket, runSshProxy;
|
|
297525
297998
|
var init_sshProxy = __esm({
|
|
297526
297999
|
"src/devbox/commands/sshProxy.ts"() {
|
|
297527
298000
|
"use strict";
|
|
@@ -297529,7 +298002,7 @@ var init_sshProxy = __esm({
|
|
|
297529
298002
|
init_daemonClient();
|
|
297530
298003
|
init_args();
|
|
297531
298004
|
init_errors4();
|
|
297532
|
-
|
|
298005
|
+
logger12 = createLogger("devbox-ssh");
|
|
297533
298006
|
SSH_PROXY_USAGE = "Usage: dvb ssh proxy <box> [--port <port>]";
|
|
297534
298007
|
parsePort2 = (raw) => {
|
|
297535
298008
|
if (!raw) {
|
|
@@ -297655,7 +298128,7 @@ var init_sshProxy = __esm({
|
|
|
297655
298128
|
};
|
|
297656
298129
|
const handleConnect = () => {
|
|
297657
298130
|
connected = true;
|
|
297658
|
-
|
|
298131
|
+
logger12.info("ssh_proxy_transport_ready", {
|
|
297659
298132
|
box,
|
|
297660
298133
|
localPort
|
|
297661
298134
|
});
|
|
@@ -297712,7 +298185,7 @@ var init_sshProxy = __esm({
|
|
|
297712
298185
|
const { box, port } = parseSshProxyArgs(args);
|
|
297713
298186
|
const owner = `ssh-proxy:${randomUUID39()}`;
|
|
297714
298187
|
const socketInfo = resolveSocketInfo();
|
|
297715
|
-
|
|
298188
|
+
logger12.info("ssh_proxy_start", {
|
|
297716
298189
|
box,
|
|
297717
298190
|
owner,
|
|
297718
298191
|
path: "/ports/forward"
|
|
@@ -297728,14 +298201,14 @@ var init_sshProxy = __esm({
|
|
|
297728
298201
|
owner
|
|
297729
298202
|
});
|
|
297730
298203
|
await bridgeProxySocket({ box, localPort });
|
|
297731
|
-
|
|
298204
|
+
logger12.info("ssh_proxy_end", {
|
|
297732
298205
|
box,
|
|
297733
298206
|
owner,
|
|
297734
298207
|
localPort,
|
|
297735
298208
|
status: "ok"
|
|
297736
298209
|
});
|
|
297737
298210
|
} catch (error55) {
|
|
297738
|
-
|
|
298211
|
+
logger12.warn("ssh_proxy_transport_failed", {
|
|
297739
298212
|
box,
|
|
297740
298213
|
owner,
|
|
297741
298214
|
...typeof localPort === "number" ? { localPort } : {},
|
|
@@ -297751,7 +298224,7 @@ var init_sshProxy = __esm({
|
|
|
297751
298224
|
owner
|
|
297752
298225
|
});
|
|
297753
298226
|
} catch (error55) {
|
|
297754
|
-
|
|
298227
|
+
logger12.warn("ssh_proxy_release_failed", {
|
|
297755
298228
|
box,
|
|
297756
298229
|
owner,
|
|
297757
298230
|
error: error55 instanceof Error ? error55.message : String(error55)
|
|
@@ -298149,7 +298622,7 @@ var init_threadArchive2 = __esm({
|
|
|
298149
298622
|
archived,
|
|
298150
298623
|
requestId: requestId2
|
|
298151
298624
|
});
|
|
298152
|
-
|
|
298625
|
+
logger3.info("cli_thread_archive_completed", {
|
|
298153
298626
|
requestId: requestId2,
|
|
298154
298627
|
...result,
|
|
298155
298628
|
status: "ok"
|
|
@@ -299267,8 +299740,18 @@ var init_threadRead = __esm({
|
|
|
299267
299740
|
pageSize: turns,
|
|
299268
299741
|
...cursor === null ? {} : { cursor }
|
|
299269
299742
|
});
|
|
299743
|
+
const thread = projectCliAgentToolsThreadContextV1(threadContext.thread);
|
|
299744
|
+
const pendingInput = threadContext.pendingInput ?? null;
|
|
299270
299745
|
return {
|
|
299271
|
-
thread:
|
|
299746
|
+
thread: {
|
|
299747
|
+
...thread,
|
|
299748
|
+
status: resolveThreadStatusWithPendingInput(
|
|
299749
|
+
thread.status,
|
|
299750
|
+
thread.activeTurnId,
|
|
299751
|
+
pendingInput
|
|
299752
|
+
),
|
|
299753
|
+
pendingInput
|
|
299754
|
+
},
|
|
299272
299755
|
transcript: projectCliAgentThreadTranscript(peek)
|
|
299273
299756
|
};
|
|
299274
299757
|
} catch (error55) {
|
|
@@ -299369,6 +299852,7 @@ async function* streamCliAgentToolThreadEvents({
|
|
|
299369
299852
|
turnId: streamCursor.turnId,
|
|
299370
299853
|
requestId: requestId2,
|
|
299371
299854
|
baselineThread,
|
|
299855
|
+
baselinePendingInput: page.pendingInput ?? null,
|
|
299372
299856
|
baselineEventId: streamCursor.lastEventId,
|
|
299373
299857
|
timeoutMs: null,
|
|
299374
299858
|
signal
|
|
@@ -299421,7 +299905,7 @@ async function* streamCliAgentToolThreadEvents({
|
|
|
299421
299905
|
throw normalizeConvexResourceError(error55);
|
|
299422
299906
|
}
|
|
299423
299907
|
}
|
|
299424
|
-
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;
|
|
299425
299909
|
var init_threadObservation = __esm({
|
|
299426
299910
|
"src/devbox/resourceApi/threadObservation.ts"() {
|
|
299427
299911
|
"use strict";
|
|
@@ -299546,13 +300030,14 @@ var init_threadObservation = __esm({
|
|
|
299546
300030
|
},
|
|
299547
300031
|
requestId: requestId2
|
|
299548
300032
|
});
|
|
299549
|
-
threadStateSignature = (thread) => [
|
|
300033
|
+
threadStateSignature = (thread, pendingInput) => [
|
|
299550
300034
|
thread.lifecycle,
|
|
299551
300035
|
thread.archived ? "archived" : "active",
|
|
299552
300036
|
thread.storageState,
|
|
299553
300037
|
thread.activeTurnId ?? "",
|
|
299554
300038
|
thread.activeTurnStatus ?? "",
|
|
299555
|
-
String(thread.updatedAt)
|
|
300039
|
+
String(thread.updatedAt),
|
|
300040
|
+
JSON.stringify(pendingInput)
|
|
299556
300041
|
].join(":");
|
|
299557
300042
|
waitForThreadObservation = async ({
|
|
299558
300043
|
context: context34,
|
|
@@ -299560,6 +300045,7 @@ var init_threadObservation = __esm({
|
|
|
299560
300045
|
turnId,
|
|
299561
300046
|
requestId: requestId2,
|
|
299562
300047
|
baselineThread,
|
|
300048
|
+
baselinePendingInput,
|
|
299563
300049
|
baselineEventId,
|
|
299564
300050
|
timeoutMs,
|
|
299565
300051
|
signal
|
|
@@ -299602,7 +300088,10 @@ var init_threadObservation = __esm({
|
|
|
299602
300088
|
const onAbort = () => finish({ kind: "canceled" });
|
|
299603
300089
|
timer = timeoutMs === null ? null : setTimeout(() => finish({ kind: "timeout" }), timeoutMs);
|
|
299604
300090
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
299605
|
-
const baselineSignature = threadStateSignature(
|
|
300091
|
+
const baselineSignature = threadStateSignature(
|
|
300092
|
+
baselineThread,
|
|
300093
|
+
baselinePendingInput
|
|
300094
|
+
);
|
|
299606
300095
|
unsubscribe4 = context34.client.onUpdate(
|
|
299607
300096
|
observeCliAgentToolThreadV1,
|
|
299608
300097
|
{
|
|
@@ -299612,7 +300101,10 @@ var init_threadObservation = __esm({
|
|
|
299612
300101
|
requestId: requestId2
|
|
299613
300102
|
},
|
|
299614
300103
|
(observation) => {
|
|
299615
|
-
if (observation.latestEvent?.eventId !== baselineEventId || threadStateSignature(
|
|
300104
|
+
if ((observation.latestEvent?.eventId ?? null) !== baselineEventId || threadStateSignature(
|
|
300105
|
+
observation.thread,
|
|
300106
|
+
observation.pendingInput ?? null
|
|
300107
|
+
) !== baselineSignature) {
|
|
299616
300108
|
finish({ kind: "observation", observation });
|
|
299617
300109
|
}
|
|
299618
300110
|
},
|
|
@@ -299663,6 +300155,31 @@ var init_threadObservation = __esm({
|
|
|
299663
300155
|
transcript: read2.transcript
|
|
299664
300156
|
};
|
|
299665
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
|
+
};
|
|
299666
300183
|
nonTerminalWaitResult = ({
|
|
299667
300184
|
thread,
|
|
299668
300185
|
turnId,
|
|
@@ -299693,6 +300210,15 @@ var init_threadObservation = __esm({
|
|
|
299693
300210
|
}
|
|
299694
300211
|
return null;
|
|
299695
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
|
+
};
|
|
299696
300222
|
waitForCliAgentToolThread = async ({
|
|
299697
300223
|
context: context34,
|
|
299698
300224
|
clientThreadId,
|
|
@@ -299726,7 +300252,17 @@ var init_threadObservation = __esm({
|
|
|
299726
300252
|
let cursor = null;
|
|
299727
300253
|
let baselineThread = threadContext.thread;
|
|
299728
300254
|
let latestEventId = null;
|
|
300255
|
+
let outcomeEvent = null;
|
|
300256
|
+
let inputEvent = null;
|
|
300257
|
+
let pendingInput = null;
|
|
299729
300258
|
while (true) {
|
|
300259
|
+
if (signal.aborted) {
|
|
300260
|
+
return nonTerminalWaitResult({
|
|
300261
|
+
thread: baselineThread,
|
|
300262
|
+
turnId: observedTurnId,
|
|
300263
|
+
status: "canceled"
|
|
300264
|
+
});
|
|
300265
|
+
}
|
|
299730
300266
|
const remainingMs = Math.max(0, deadline - Date.now());
|
|
299731
300267
|
if (remainingMs === 0) {
|
|
299732
300268
|
return nonTerminalWaitResult({
|
|
@@ -299745,17 +300281,14 @@ var init_threadObservation = __esm({
|
|
|
299745
300281
|
requestId: requestId2
|
|
299746
300282
|
});
|
|
299747
300283
|
baselineThread = page.thread;
|
|
300284
|
+
pendingInput = page.pendingInput ?? null;
|
|
299748
300285
|
latestEventId = page.events.at(-1)?.eventId ?? latestEventId;
|
|
299749
|
-
const
|
|
299750
|
-
(event
|
|
299751
|
-
|
|
299752
|
-
|
|
299753
|
-
|
|
299754
|
-
|
|
299755
|
-
thread: page.thread,
|
|
299756
|
-
event: terminalEvent,
|
|
299757
|
-
requestId: requestId2
|
|
299758
|
-
});
|
|
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
|
+
}
|
|
299759
300292
|
}
|
|
299760
300293
|
cursor = page.continueCursor;
|
|
299761
300294
|
if (!page.isDone) {
|
|
@@ -299763,6 +300296,14 @@ var init_threadObservation = __esm({
|
|
|
299763
300296
|
}
|
|
299764
300297
|
break;
|
|
299765
300298
|
}
|
|
300299
|
+
if (outcomeEvent !== null) {
|
|
300300
|
+
return await loadTerminalWaitResult({
|
|
300301
|
+
context: context34,
|
|
300302
|
+
thread: baselineThread,
|
|
300303
|
+
event: outcomeEvent,
|
|
300304
|
+
requestId: requestId2
|
|
300305
|
+
});
|
|
300306
|
+
}
|
|
299766
300307
|
while (true) {
|
|
299767
300308
|
const remainingMs = Math.max(0, deadline - Date.now());
|
|
299768
300309
|
if (remainingMs === 0) {
|
|
@@ -299783,12 +300324,27 @@ var init_threadObservation = __esm({
|
|
|
299783
300324
|
status: detached
|
|
299784
300325
|
});
|
|
299785
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
|
+
}
|
|
299786
300341
|
const observed = await waitForThreadObservation({
|
|
299787
300342
|
context: context34,
|
|
299788
300343
|
clientThreadId,
|
|
299789
300344
|
turnId: observedTurnId,
|
|
299790
300345
|
requestId: requestId2,
|
|
299791
300346
|
baselineThread,
|
|
300347
|
+
baselinePendingInput: pendingInput,
|
|
299792
300348
|
baselineEventId: latestEventId,
|
|
299793
300349
|
timeoutMs: remainingMs,
|
|
299794
300350
|
signal
|
|
@@ -299801,9 +300357,10 @@ var init_threadObservation = __esm({
|
|
|
299801
300357
|
});
|
|
299802
300358
|
}
|
|
299803
300359
|
baselineThread = observed.observation.thread;
|
|
300360
|
+
pendingInput = observed.observation.pendingInput ?? null;
|
|
299804
300361
|
const event = observed.observation.latestEvent;
|
|
299805
300362
|
latestEventId = event?.eventId ?? latestEventId;
|
|
299806
|
-
if (event !== null &&
|
|
300363
|
+
if (event !== null && isTurnOutcomeEvent(event)) {
|
|
299807
300364
|
return await loadTerminalWaitResult({
|
|
299808
300365
|
context: context34,
|
|
299809
300366
|
thread: baselineThread,
|
|
@@ -299811,6 +300368,9 @@ var init_threadObservation = __esm({
|
|
|
299811
300368
|
requestId: requestId2
|
|
299812
300369
|
});
|
|
299813
300370
|
}
|
|
300371
|
+
if (event?.kind === "needs_input") {
|
|
300372
|
+
inputEvent = event;
|
|
300373
|
+
}
|
|
299814
300374
|
}
|
|
299815
300375
|
} catch (error55) {
|
|
299816
300376
|
throw normalizeConvexResourceError(error55);
|
|
@@ -299858,7 +300418,7 @@ var init_threadObservation = __esm({
|
|
|
299858
300418
|
});
|
|
299859
300419
|
|
|
299860
300420
|
// src/devbox/commands/threadObservation.ts
|
|
299861
|
-
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;
|
|
299862
300422
|
var init_threadObservation2 = __esm({
|
|
299863
300423
|
"src/devbox/commands/threadObservation.ts"() {
|
|
299864
300424
|
"use strict";
|
|
@@ -299868,6 +300428,7 @@ var init_threadObservation2 = __esm({
|
|
|
299868
300428
|
init_results();
|
|
299869
300429
|
init_errors5();
|
|
299870
300430
|
init_siteUrl();
|
|
300431
|
+
init_pendingInputText();
|
|
299871
300432
|
init_resourceNextAction();
|
|
299872
300433
|
init_resourceOutput();
|
|
299873
300434
|
DEFAULT_THREAD_WAIT_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
@@ -300094,17 +300655,17 @@ var init_threadObservation2 = __esm({
|
|
|
300094
300655
|
fromStart
|
|
300095
300656
|
};
|
|
300096
300657
|
};
|
|
300658
|
+
withPendingInput = (input, text) => input ? `${renderPendingInput(input)}
|
|
300659
|
+
|
|
300660
|
+
${text}` : text;
|
|
300097
300661
|
renderCliAgentToolThreadRead = (data) => {
|
|
300098
300662
|
if ("locator" in data) {
|
|
300099
300663
|
return renderCliAgentToolCanonicalThreadRead(data);
|
|
300100
300664
|
}
|
|
300101
|
-
|
|
300102
|
-
|
|
300103
|
-
|
|
300104
|
-
|
|
300105
|
-
return "No projected conversation content is available yet.";
|
|
300106
|
-
}
|
|
300107
|
-
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
|
+
);
|
|
300108
300669
|
};
|
|
300109
300670
|
renderCliAgentToolCanonicalThreadRead = (data) => {
|
|
300110
300671
|
if (data.access.mode === "metadata_only") {
|
|
@@ -300112,16 +300673,18 @@ var init_threadObservation2 = __esm({
|
|
|
300112
300673
|
return `Access required for \u201C${data.thread.title}\u201D${owner}.
|
|
300113
300674
|
${data.locator.url}`;
|
|
300114
300675
|
}
|
|
300115
|
-
|
|
300116
|
-
|
|
300117
|
-
|
|
300118
|
-
|
|
300119
|
-
return "No projected conversation content is available yet.";
|
|
300120
|
-
}
|
|
300121
|
-
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
|
+
);
|
|
300122
300680
|
};
|
|
300123
300681
|
renderCliAgentToolThreadWait = (data) => {
|
|
300124
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
|
+
}
|
|
300125
300688
|
if (data.transcript?.status !== "ready" || data.transcript.messages.length === 0) {
|
|
300126
300689
|
return header;
|
|
300127
300690
|
}
|
|
@@ -300560,11 +301123,12 @@ import fsp from "node:fs/promises";
|
|
|
300560
301123
|
import path107 from "node:path";
|
|
300561
301124
|
|
|
300562
301125
|
// src/devbox/compromisedRoots.ts
|
|
301126
|
+
init_devboxCore();
|
|
300563
301127
|
init_colors();
|
|
300564
301128
|
import { X509Certificate } from "node:crypto";
|
|
300565
301129
|
import { existsSync as existsSync4 } from "node:fs";
|
|
300566
301130
|
import path19 from "node:path";
|
|
300567
|
-
import
|
|
301131
|
+
import tls3 from "node:tls";
|
|
300568
301132
|
var COMPROMISED_ROOT_SHA256_FINGERPRINTS = /* @__PURE__ */ new Set([
|
|
300569
301133
|
// emSign ECC Root CA - G3
|
|
300570
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",
|
|
@@ -300575,13 +301139,14 @@ var isCompromisedRoot = (pem) => COMPROMISED_ROOT_SHA256_FINGERPRINTS.has(
|
|
|
300575
301139
|
new X509Certificate(pem).fingerprint256
|
|
300576
301140
|
);
|
|
300577
301141
|
var distrustCompromisedRoots = () => {
|
|
300578
|
-
|
|
300579
|
-
|
|
301142
|
+
setSystemRootFilter((pem) => !isCompromisedRoot(pem));
|
|
301143
|
+
if (typeof tls3.setDefaultCACertificates !== "function") {
|
|
301144
|
+
return !tls3.rootCertificates.some(isCompromisedRoot);
|
|
300580
301145
|
}
|
|
300581
|
-
const current =
|
|
301146
|
+
const current = tls3.getCACertificates("default");
|
|
300582
301147
|
const kept = current.filter((pem) => !isCompromisedRoot(pem));
|
|
300583
301148
|
if (kept.length !== current.length) {
|
|
300584
|
-
|
|
301149
|
+
tls3.setDefaultCACertificates(kept);
|
|
300585
301150
|
}
|
|
300586
301151
|
return true;
|
|
300587
301152
|
};
|
|
@@ -300946,4 +301511,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
300946
301511
|
*)
|
|
300947
301512
|
*/
|
|
300948
301513
|
|
|
300949
|
-
//# debugId=
|
|
301514
|
+
//# debugId=a9a5ab0a-d34f-5b1c-afa5-ae1d2d484362
|