@boxes-dev/dvb-runtime 1.0.1127 → 1.0.1131
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 +336 -197
- package/dist/bin/dvbd.mjs +23 -12
- package/dist/postgres-tools/SHA256SUMS +39 -39
- package/dist/postgres-tools/darwin-universal/bin/pg_dump +0 -0
- package/dist/postgres-tools/darwin-universal/bin/pg_restore +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libcom_err.3.0.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libcrypto.3.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libgssapi_krb5.2.2.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libk5crypto.3.1.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libkrb5.3.3.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libkrb5support.1.1.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/liblz4.1.11.1.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libpq.5.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libssl.3.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/lib/{libz.1.3.2.dylib → libz.1.4.dylib} +0 -0
- package/dist/postgres-tools/darwin-universal/lib/libzstd.1.dylib +0 -0
- package/dist/postgres-tools/darwin-universal/notices/PostgreSQL.txt +1 -1
- package/dist/postgres-tools/darwin-universal/notices/THIRD_PARTY_NOTICES.txt +87 -1
- package/dist/postgres-tools/linux-arm64-el8/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-arm64-el8/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-arm64-el8/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/linux-arm64-el9/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-arm64-el9/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-arm64-el9/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/linux-arm64-ubuntu22.04/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-arm64-ubuntu22.04/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-arm64-ubuntu22.04/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/linux-arm64-ubuntu24.04/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-arm64-ubuntu24.04/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-arm64-ubuntu24.04/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/linux-x64-el8/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-x64-el8/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-x64-el8/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/linux-x64-el9/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-x64-el9/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-x64-el9/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/linux-x64-ubuntu22.04/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-x64-ubuntu22.04/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-x64-ubuntu22.04/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/linux-x64-ubuntu24.04/bin/pg_dump +0 -0
- package/dist/postgres-tools/linux-x64-ubuntu24.04/bin/pg_restore +0 -0
- package/dist/postgres-tools/linux-x64-ubuntu24.04/lib/libpq.so.5 +0 -0
- package/dist/postgres-tools/release.json +95 -95
- package/dist/product-docs/references/agent-tools.md +8 -2
- package/dist/product-docs/references/automations.md +37 -8
- package/dist/product-docs/references/aws.md +9 -6
- package/dist/product-docs/references/billing-and-limits.md +41 -23
- package/dist/product-docs/references/cli.md +18 -0
- package/dist/product-docs/references/desktop-workbench.md +42 -14
- package/dist/product-docs/references/files-git-and-review.md +31 -12
- package/dist/product-docs/references/managed-environment-files.md +24 -1
- package/dist/product-docs/references/mobile.md +22 -9
- package/dist/product-docs/references/onbox-agent-tools.md +77 -6
- package/dist/product-docs/references/security-and-data.md +12 -0
- package/dist/product-docs/references/slack.md +20 -8
- package/dist/product-docs/references/threads-and-agents.md +92 -45
- package/dist/product-docs/references/ui-references.md +5 -3
- package/package.json +2 -2
- package/dist/postgres-tools/darwin-universal/lib/liblz4.1.10.0.dylib +0 -0
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]="2c541fd7-9d30-5526-a597-0d4c51289327")}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";
|
|
@@ -4262,6 +4262,8 @@ var init_codexLocalRenderer = __esm({
|
|
|
4262
4262
|
resolveAccepted = resolve3;
|
|
4263
4263
|
rejectAccepted = reject;
|
|
4264
4264
|
});
|
|
4265
|
+
rendererAccepted.catch(() => {
|
|
4266
|
+
});
|
|
4265
4267
|
let resolveAttachmentFailure = () => {
|
|
4266
4268
|
};
|
|
4267
4269
|
const attachmentFailure = new Promise((resolve3) => {
|
|
@@ -70599,9 +70601,9 @@ var init_sentry = __esm({
|
|
|
70599
70601
|
uncaughtExceptionMonitorInstalled = false;
|
|
70600
70602
|
currentDevboxSentryUser = null;
|
|
70601
70603
|
readBuildMetadata = () => {
|
|
70602
|
-
const rawPackageVersion = "1.0.
|
|
70603
|
-
const rawGitSha = "
|
|
70604
|
-
const rawSentryRelease = "boxes-dev-dvb@1.0.
|
|
70604
|
+
const rawPackageVersion = "1.0.1131";
|
|
70605
|
+
const rawGitSha = "cf70007685f71e6ebbe48c2a12329c21c01fb86f";
|
|
70606
|
+
const rawSentryRelease = "boxes-dev-dvb@1.0.1131+cf70007685f71e6ebbe48c2a12329c21c01fb86f";
|
|
70605
70607
|
const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
|
|
70606
70608
|
const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
|
|
70607
70609
|
const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
|
|
@@ -76280,7 +76282,7 @@ var init_packageVersion = __esm({
|
|
|
76280
76282
|
return path18.join(process.cwd(), "dvb");
|
|
76281
76283
|
};
|
|
76282
76284
|
readEmbeddedPackageVersion = () => {
|
|
76283
|
-
const raw = "1.0.
|
|
76285
|
+
const raw = "1.0.1131";
|
|
76284
76286
|
return trimVersion(raw);
|
|
76285
76287
|
};
|
|
76286
76288
|
readNearestPackageMetadata = (basePath) => {
|
|
@@ -95676,7 +95678,7 @@ var init_help = __esm({
|
|
|
95676
95678
|
|
|
95677
95679
|
// ../daemon/src/spritesRegistry.ts
|
|
95678
95680
|
import { createHash as createHash6, randomUUID as randomUUID6 } from "node:crypto";
|
|
95679
|
-
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;
|
|
95681
|
+
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, ConvexRequestTimeoutError, 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;
|
|
95680
95682
|
var init_spritesRegistry = __esm({
|
|
95681
95683
|
"../daemon/src/spritesRegistry.ts"() {
|
|
95682
95684
|
"use strict";
|
|
@@ -95951,6 +95953,14 @@ var init_spritesRegistry = __esm({
|
|
|
95951
95953
|
this.name = "DaemonNotLoggedInError";
|
|
95952
95954
|
}
|
|
95953
95955
|
};
|
|
95956
|
+
ConvexRequestTimeoutError = class extends Error {
|
|
95957
|
+
constructor(functionName2, timeoutMs) {
|
|
95958
|
+
super(
|
|
95959
|
+
`Convex request timed out after ${timeoutMs}ms while calling ${functionName2}.`
|
|
95960
|
+
);
|
|
95961
|
+
this.name = "ConvexRequestTimeoutError";
|
|
95962
|
+
}
|
|
95963
|
+
};
|
|
95954
95964
|
requireControlPlaneToken = async () => {
|
|
95955
95965
|
const token = await loadControlPlaneToken();
|
|
95956
95966
|
if (!token) {
|
|
@@ -96019,11 +96029,7 @@ var init_spritesRegistry = __esm({
|
|
|
96019
96029
|
promise3,
|
|
96020
96030
|
new Promise((_2, reject) => {
|
|
96021
96031
|
timeout = setTimeout(() => {
|
|
96022
|
-
reject(
|
|
96023
|
-
new Error(
|
|
96024
|
-
`Convex request timed out after ${timeoutMs}ms while calling ${functionName2}.`
|
|
96025
|
-
)
|
|
96026
|
-
);
|
|
96032
|
+
reject(new ConvexRequestTimeoutError(functionName2, timeoutMs));
|
|
96027
96033
|
}, timeoutMs);
|
|
96028
96034
|
timeout.unref();
|
|
96029
96035
|
})
|
|
@@ -98698,6 +98704,13 @@ var init_src = __esm({
|
|
|
98698
98704
|
message: error55.message
|
|
98699
98705
|
};
|
|
98700
98706
|
}
|
|
98707
|
+
if (error55 instanceof ConvexRequestTimeoutError) {
|
|
98708
|
+
return {
|
|
98709
|
+
statusCode: 504,
|
|
98710
|
+
error: "control_plane_timeout",
|
|
98711
|
+
message: "The local boxes.dev service couldn't connect to boxes.dev. Run `dvb daemon restart`, then retry. If this keeps happening, check your internet connection."
|
|
98712
|
+
};
|
|
98713
|
+
}
|
|
98701
98714
|
const message = error55 instanceof Error ? error55.message.trim() : typeof error55 === "string" ? error55.trim() : String(error55);
|
|
98702
98715
|
if (errorType === "registry_error") {
|
|
98703
98716
|
const normalized = message.toLowerCase();
|
|
@@ -109500,17 +109513,16 @@ var init_commandProvider = __esm({
|
|
|
109500
109513
|
return canonical === normalizedTarget;
|
|
109501
109514
|
}) ?? null;
|
|
109502
109515
|
};
|
|
109503
|
-
buildMissingComputeProviderMessage = (box) => `
|
|
109516
|
+
buildMissingComputeProviderMessage = (box) => `Couldn't load the details for "${box}". Contact help@boxes.dev.`;
|
|
109504
109517
|
buildMissingDevboxMessage = (box) => `No machine named "${box}" found.`;
|
|
109505
109518
|
resolveCommandComputeProvider = async (options) => {
|
|
109506
|
-
const
|
|
109507
|
-
const matchedRegistryEntry = hasRegistrySnapshot ? resolveRegistryEntry(options.box, options.boxes ?? []) : null;
|
|
109519
|
+
const matchedRegistryEntry = resolveRegistryEntry(options.box, options.boxes);
|
|
109508
109520
|
const alias = normalizeBoxKey(matchedRegistryEntry?.alias) ?? normalizeBoxKey(options.box) ?? options.box;
|
|
109509
|
-
|
|
109510
|
-
if (hasRegistrySnapshot && !matchedRegistryEntry) {
|
|
109521
|
+
if (!matchedRegistryEntry) {
|
|
109511
109522
|
throw new Error(buildMissingDevboxMessage(alias));
|
|
109512
109523
|
}
|
|
109513
|
-
|
|
109524
|
+
const canonical = normalizeBoxKey(matchedRegistryEntry.canonical);
|
|
109525
|
+
if (matchedRegistryEntry.computeProvider) {
|
|
109514
109526
|
return {
|
|
109515
109527
|
alias,
|
|
109516
109528
|
canonical,
|
|
@@ -137097,7 +137109,8 @@ var init_directDaemonRuntime = __esm({
|
|
|
137097
137109
|
requestPayload: {
|
|
137098
137110
|
type: "codex_tui_probe",
|
|
137099
137111
|
threadId: args.threadId,
|
|
137100
|
-
sessionPath: args.sessionPath
|
|
137112
|
+
sessionPath: args.sessionPath,
|
|
137113
|
+
rendererCodexVersion: args.rendererCodexVersion
|
|
137101
137114
|
},
|
|
137102
137115
|
expectedType: "codex_tui_probe_result",
|
|
137103
137116
|
timeoutMs: args.timeoutMs,
|
|
@@ -137185,7 +137198,8 @@ var init_directDaemonRuntime = __esm({
|
|
|
137185
137198
|
provider: args.provider,
|
|
137186
137199
|
resolveConnectInfo: args.resolveConnectInfo,
|
|
137187
137200
|
requestPayload: {
|
|
137188
|
-
type: "codex_tui_new_thread_probe"
|
|
137201
|
+
type: "codex_tui_new_thread_probe",
|
|
137202
|
+
rendererCodexVersion: args.rendererCodexVersion
|
|
137189
137203
|
},
|
|
137190
137204
|
expectedType: "codex_tui_new_thread_probe_result",
|
|
137191
137205
|
timeoutMs: args.timeoutMs,
|
|
@@ -166880,6 +166894,7 @@ var init_codexRemoteRenderer = __esm({
|
|
|
166880
166894
|
resolveConnectInfo,
|
|
166881
166895
|
threadId: threadId2,
|
|
166882
166896
|
sessionPath,
|
|
166897
|
+
rendererCodexVersion: MANAGED_CODEX_VERSION,
|
|
166883
166898
|
timeoutMs
|
|
166884
166899
|
});
|
|
166885
166900
|
const probe = parseCodexTuiProbeResult(probeRaw);
|
|
@@ -167092,6 +167107,7 @@ var init_codexNewThreadRenderer = __esm({
|
|
|
167092
167107
|
alias,
|
|
167093
167108
|
provider: "e2b",
|
|
167094
167109
|
resolveConnectInfo,
|
|
167110
|
+
rendererCodexVersion: MANAGED_CODEX_VERSION,
|
|
167095
167111
|
timeoutMs
|
|
167096
167112
|
});
|
|
167097
167113
|
const probe = parseCodexTuiNewThreadProbeResult(probeRaw);
|
|
@@ -170216,7 +170232,9 @@ var init_agentDirectRenderers = __esm({
|
|
|
170216
170232
|
status,
|
|
170217
170233
|
project,
|
|
170218
170234
|
resolveConnectInfo,
|
|
170219
|
-
onStage
|
|
170235
|
+
onStage,
|
|
170236
|
+
onReady,
|
|
170237
|
+
suspendTerminal
|
|
170220
170238
|
}) => {
|
|
170221
170239
|
const target = requireRendererTarget(status);
|
|
170222
170240
|
const { terminal: terminal2, allowStartupTerminal } = resolveClaudeRendererLaunch(status);
|
|
@@ -170235,9 +170253,8 @@ var init_agentDirectRenderers = __esm({
|
|
|
170235
170253
|
allowStartupTerminal,
|
|
170236
170254
|
confirmation: null,
|
|
170237
170255
|
resolveConnectInfo,
|
|
170238
|
-
onReady
|
|
170239
|
-
|
|
170240
|
-
suspendTerminal: async (callback) => await callback()
|
|
170256
|
+
onReady,
|
|
170257
|
+
suspendTerminal: async (callback) => await suspendTerminal(callback)
|
|
170241
170258
|
})
|
|
170242
170259
|
);
|
|
170243
170260
|
};
|
|
@@ -170246,7 +170263,9 @@ var init_agentDirectRenderers = __esm({
|
|
|
170246
170263
|
project,
|
|
170247
170264
|
accountScope,
|
|
170248
170265
|
resolveConnectInfo,
|
|
170249
|
-
onStage
|
|
170266
|
+
onStage,
|
|
170267
|
+
onReady,
|
|
170268
|
+
suspendTerminal
|
|
170250
170269
|
}) => {
|
|
170251
170270
|
const target = requireRendererTarget(status);
|
|
170252
170271
|
if (!status.codexNativeTui) {
|
|
@@ -170263,9 +170282,8 @@ var init_agentDirectRenderers = __esm({
|
|
|
170263
170282
|
accountScope,
|
|
170264
170283
|
resolveConnectInfo,
|
|
170265
170284
|
onStage,
|
|
170266
|
-
onReady
|
|
170267
|
-
|
|
170268
|
-
suspendTerminal: async (callback) => await callback()
|
|
170285
|
+
onReady,
|
|
170286
|
+
suspendTerminal: async (callback) => await suspendTerminal(callback)
|
|
170269
170287
|
})
|
|
170270
170288
|
);
|
|
170271
170289
|
};
|
|
@@ -170277,7 +170295,7 @@ var init_agentDirectRenderers = __esm({
|
|
|
170277
170295
|
});
|
|
170278
170296
|
|
|
170279
170297
|
// src/devbox/commands/agentDirectThread.ts
|
|
170280
|
-
var assertContractVersion, promptForEmptyThreadCleanup, createDirectAgentResolveConnectInfo, defaultDependencies3, MATERIALIZATION_POLL_INTERVAL_MS, MATERIALIZATION_TIMEOUT_MS, waitForNativeInput, cleanupAfterCleanExit, runDirectAgentThreadWithDependencies, runDirectAgentThread;
|
|
170298
|
+
var assertContractVersion, promptForEmptyThreadCleanup, createDirectAgentResolveConnectInfo, defaultDependencies3, DirectAgentStartCanceledError, MATERIALIZATION_POLL_INTERVAL_MS, MATERIALIZATION_TIMEOUT_MS, waitForNativeInput, discardEmptyThread, cleanupAfterCleanExit, openStartedThread, runDirectAgentThreadWithDependencies, runDirectAgentThread;
|
|
170281
170299
|
var init_agentDirectThread = __esm({
|
|
170282
170300
|
"src/devbox/commands/agentDirectThread.ts"() {
|
|
170283
170301
|
"use strict";
|
|
@@ -170381,7 +170399,17 @@ var init_agentDirectThread = __esm({
|
|
|
170381
170399
|
setExitCode: (code2) => {
|
|
170382
170400
|
process.exitCode = code2;
|
|
170383
170401
|
},
|
|
170384
|
-
closeTransport: closeAllDirectDaemonControlSockets
|
|
170402
|
+
closeTransport: closeAllDirectDaemonControlSockets,
|
|
170403
|
+
onInterrupt: (listener) => {
|
|
170404
|
+
process.once("SIGINT", listener);
|
|
170405
|
+
return () => process.off("SIGINT", listener);
|
|
170406
|
+
}
|
|
170407
|
+
};
|
|
170408
|
+
DirectAgentStartCanceledError = class extends Error {
|
|
170409
|
+
constructor() {
|
|
170410
|
+
super("The thread start was canceled.");
|
|
170411
|
+
this.name = "DirectAgentStartCanceledError";
|
|
170412
|
+
}
|
|
170385
170413
|
};
|
|
170386
170414
|
MATERIALIZATION_POLL_INTERVAL_MS = 1e3;
|
|
170387
170415
|
MATERIALIZATION_TIMEOUT_MS = 20 * 60 * 1e3;
|
|
@@ -170389,10 +170417,12 @@ var init_agentDirectThread = __esm({
|
|
|
170389
170417
|
client,
|
|
170390
170418
|
project,
|
|
170391
170419
|
clientThreadId,
|
|
170392
|
-
dependencies
|
|
170420
|
+
dependencies,
|
|
170421
|
+
throwIfCanceled: throwIfCanceled2
|
|
170393
170422
|
}) => {
|
|
170394
170423
|
const deadline = dependencies.now() + MATERIALIZATION_TIMEOUT_MS;
|
|
170395
170424
|
for (; ; ) {
|
|
170425
|
+
throwIfCanceled2();
|
|
170396
170426
|
const status = await dependencies.loadStatus(client, {
|
|
170397
170427
|
primaryInstanceId: project.primaryInstanceId,
|
|
170398
170428
|
clientThreadId
|
|
@@ -170419,12 +170449,24 @@ var init_agentDirectThread = __esm({
|
|
|
170419
170449
|
await dependencies.sleep(MATERIALIZATION_POLL_INTERVAL_MS);
|
|
170420
170450
|
}
|
|
170421
170451
|
};
|
|
170422
|
-
|
|
170452
|
+
discardEmptyThread = async ({
|
|
170423
170453
|
client,
|
|
170424
170454
|
project,
|
|
170425
170455
|
clientThreadId,
|
|
170426
170456
|
dependencies
|
|
170427
170457
|
}) => {
|
|
170458
|
+
dependencies.report("Deleting empty thread\u2026");
|
|
170459
|
+
const result = await dependencies.discard(client, {
|
|
170460
|
+
primaryInstanceId: project.primaryInstanceId,
|
|
170461
|
+
clientThreadId
|
|
170462
|
+
});
|
|
170463
|
+
assertContractVersion(result, "Empty thread cleanup");
|
|
170464
|
+
dependencies.report(
|
|
170465
|
+
result.discarded ? "Empty thread deleted." : "The empty thread was already deleted."
|
|
170466
|
+
);
|
|
170467
|
+
};
|
|
170468
|
+
cleanupAfterCleanExit = async (input) => {
|
|
170469
|
+
const { client, project, clientThreadId, dependencies } = input;
|
|
170428
170470
|
const status = await dependencies.loadStatus(client, {
|
|
170429
170471
|
primaryInstanceId: project.primaryInstanceId,
|
|
170430
170472
|
clientThreadId
|
|
@@ -170442,15 +170484,50 @@ var init_agentDirectThread = __esm({
|
|
|
170442
170484
|
return;
|
|
170443
170485
|
}
|
|
170444
170486
|
}
|
|
170445
|
-
|
|
170446
|
-
|
|
170487
|
+
await discardEmptyThread(input);
|
|
170488
|
+
};
|
|
170489
|
+
openStartedThread = async ({
|
|
170490
|
+
backend,
|
|
170491
|
+
client,
|
|
170492
|
+
project,
|
|
170493
|
+
started,
|
|
170494
|
+
dependencies,
|
|
170495
|
+
rendererInput,
|
|
170496
|
+
throwIfCanceled: throwIfCanceled2
|
|
170497
|
+
}) => {
|
|
170498
|
+
throwIfCanceled2();
|
|
170499
|
+
const kickoff = await dependencies.kickoffThread(client, {
|
|
170447
170500
|
primaryInstanceId: project.primaryInstanceId,
|
|
170448
|
-
clientThreadId
|
|
170501
|
+
clientThreadId: started.clientThreadId,
|
|
170502
|
+
attemptId: started.attemptId
|
|
170449
170503
|
});
|
|
170450
|
-
assertContractVersion(
|
|
170451
|
-
|
|
170452
|
-
|
|
170453
|
-
|
|
170504
|
+
assertContractVersion(kickoff, "Thread start");
|
|
170505
|
+
const status = await waitForNativeInput({
|
|
170506
|
+
client,
|
|
170507
|
+
project,
|
|
170508
|
+
clientThreadId: started.clientThreadId,
|
|
170509
|
+
dependencies,
|
|
170510
|
+
throwIfCanceled: throwIfCanceled2
|
|
170511
|
+
});
|
|
170512
|
+
logger3.info("direct_agent_renderer_open_requested", {
|
|
170513
|
+
backend,
|
|
170514
|
+
primaryInstanceId: project.primaryInstanceId,
|
|
170515
|
+
clientThreadId: String(started.clientThreadId),
|
|
170516
|
+
targetExecutionInstanceId: status.executionInstanceId,
|
|
170517
|
+
readiness: status.backend === "claude" && status.claudeStartupTui !== null ? "startup_terminal" : "session_ready"
|
|
170518
|
+
});
|
|
170519
|
+
const outcome = await dependencies.openRenderer[backend]({
|
|
170520
|
+
...rendererInput,
|
|
170521
|
+
status,
|
|
170522
|
+
project
|
|
170523
|
+
});
|
|
170524
|
+
logger3.info("direct_agent_renderer_closed", {
|
|
170525
|
+
backend,
|
|
170526
|
+
primaryInstanceId: project.primaryInstanceId,
|
|
170527
|
+
clientThreadId: String(started.clientThreadId),
|
|
170528
|
+
outcome: outcome.kind
|
|
170529
|
+
});
|
|
170530
|
+
return outcome;
|
|
170454
170531
|
};
|
|
170455
170532
|
runDirectAgentThreadWithDependencies = async ({
|
|
170456
170533
|
backend,
|
|
@@ -170509,51 +170586,79 @@ var init_agentDirectThread = __esm({
|
|
|
170509
170586
|
dependencies.report(
|
|
170510
170587
|
target.kind === "new_devbox" ? `Starting ${backend === "codex" ? "Codex" : "Claude"} on a new devbox\u2026` : `Starting ${backend === "codex" ? "Codex" : "Claude"} on the selected devbox\u2026`
|
|
170511
170588
|
);
|
|
170512
|
-
|
|
170513
|
-
|
|
170514
|
-
|
|
170515
|
-
|
|
170516
|
-
});
|
|
170517
|
-
assertContractVersion(started, "Empty thread start");
|
|
170518
|
-
logger3.info("direct_agent_thread_start_requested", {
|
|
170519
|
-
backend,
|
|
170520
|
-
primaryInstanceId: project.primaryInstanceId,
|
|
170521
|
-
clientThreadId: String(started.clientThreadId),
|
|
170522
|
-
attemptId: String(started.attemptId),
|
|
170523
|
-
targetKind: target.kind
|
|
170524
|
-
});
|
|
170525
|
-
const kickoff = await dependencies.kickoffThread(client, {
|
|
170526
|
-
primaryInstanceId: project.primaryInstanceId,
|
|
170527
|
-
clientThreadId: started.clientThreadId,
|
|
170528
|
-
attemptId: started.attemptId
|
|
170529
|
-
});
|
|
170530
|
-
assertContractVersion(kickoff, "Thread start");
|
|
170531
|
-
const status = await waitForNativeInput({
|
|
170532
|
-
client,
|
|
170533
|
-
project,
|
|
170534
|
-
clientThreadId: started.clientThreadId,
|
|
170535
|
-
dependencies
|
|
170536
|
-
});
|
|
170537
|
-
logger3.info("direct_agent_renderer_open_requested", {
|
|
170538
|
-
backend,
|
|
170539
|
-
primaryInstanceId: project.primaryInstanceId,
|
|
170540
|
-
clientThreadId: String(started.clientThreadId),
|
|
170541
|
-
targetExecutionInstanceId: status.executionInstanceId,
|
|
170542
|
-
readiness: status.backend === "claude" && status.claudeStartupTui !== null ? "startup_terminal" : "session_ready"
|
|
170543
|
-
});
|
|
170544
|
-
const outcome = await dependencies.openRenderer[backend]({
|
|
170545
|
-
status,
|
|
170546
|
-
project,
|
|
170547
|
-
accountScope,
|
|
170548
|
-
resolveConnectInfo: dependencies.resolveConnectInfo(getToken),
|
|
170549
|
-
onStage: dependencies.report
|
|
170550
|
-
});
|
|
170551
|
-
logger3.info("direct_agent_renderer_closed", {
|
|
170552
|
-
backend,
|
|
170553
|
-
primaryInstanceId: project.primaryInstanceId,
|
|
170554
|
-
clientThreadId: String(started.clientThreadId),
|
|
170555
|
-
outcome: outcome.kind
|
|
170589
|
+
let cancelRequested = false;
|
|
170590
|
+
const stopListening = dependencies.onInterrupt(() => {
|
|
170591
|
+
cancelRequested = true;
|
|
170592
|
+
dependencies.report("Canceling\u2026 Press Ctrl-C again to quit immediately.");
|
|
170556
170593
|
});
|
|
170594
|
+
const throwIfCanceled2 = () => {
|
|
170595
|
+
if (cancelRequested) {
|
|
170596
|
+
throw new DirectAgentStartCanceledError();
|
|
170597
|
+
}
|
|
170598
|
+
};
|
|
170599
|
+
let started;
|
|
170600
|
+
let outcome;
|
|
170601
|
+
try {
|
|
170602
|
+
started = await dependencies.createThread(client, {
|
|
170603
|
+
primaryInstanceId: project.primaryInstanceId,
|
|
170604
|
+
backend,
|
|
170605
|
+
target
|
|
170606
|
+
});
|
|
170607
|
+
assertContractVersion(started, "Empty thread start");
|
|
170608
|
+
logger3.info("direct_agent_thread_start_requested", {
|
|
170609
|
+
backend,
|
|
170610
|
+
primaryInstanceId: project.primaryInstanceId,
|
|
170611
|
+
clientThreadId: String(started.clientThreadId),
|
|
170612
|
+
attemptId: String(started.attemptId),
|
|
170613
|
+
targetKind: target.kind
|
|
170614
|
+
});
|
|
170615
|
+
outcome = await openStartedThread({
|
|
170616
|
+
backend,
|
|
170617
|
+
client,
|
|
170618
|
+
project,
|
|
170619
|
+
started,
|
|
170620
|
+
dependencies,
|
|
170621
|
+
rendererInput: {
|
|
170622
|
+
accountScope,
|
|
170623
|
+
resolveConnectInfo: dependencies.resolveConnectInfo(getToken),
|
|
170624
|
+
onStage: dependencies.report,
|
|
170625
|
+
suspendTerminal: async (callback) => {
|
|
170626
|
+
throwIfCanceled2();
|
|
170627
|
+
return await callback();
|
|
170628
|
+
},
|
|
170629
|
+
onReady: async () => {
|
|
170630
|
+
if (cancelRequested) {
|
|
170631
|
+
dependencies.closeTransport();
|
|
170632
|
+
throw new DirectAgentStartCanceledError();
|
|
170633
|
+
}
|
|
170634
|
+
stopListening();
|
|
170635
|
+
}
|
|
170636
|
+
},
|
|
170637
|
+
throwIfCanceled: throwIfCanceled2
|
|
170638
|
+
}).catch((error55) => {
|
|
170639
|
+
if (!cancelRequested) {
|
|
170640
|
+
throw error55;
|
|
170641
|
+
}
|
|
170642
|
+
return { kind: "canceled" };
|
|
170643
|
+
});
|
|
170644
|
+
} finally {
|
|
170645
|
+
stopListening();
|
|
170646
|
+
}
|
|
170647
|
+
if (outcome.kind === "canceled" || cancelRequested) {
|
|
170648
|
+
logger3.info("direct_agent_thread_start_canceled", {
|
|
170649
|
+
backend,
|
|
170650
|
+
primaryInstanceId: project.primaryInstanceId,
|
|
170651
|
+
clientThreadId: String(started.clientThreadId)
|
|
170652
|
+
});
|
|
170653
|
+
await discardEmptyThread({
|
|
170654
|
+
client,
|
|
170655
|
+
project,
|
|
170656
|
+
clientThreadId: started.clientThreadId,
|
|
170657
|
+
dependencies
|
|
170658
|
+
});
|
|
170659
|
+
dependencies.setExitCode(130);
|
|
170660
|
+
return;
|
|
170661
|
+
}
|
|
170557
170662
|
if (outcome.kind === "preserve") {
|
|
170558
170663
|
dependencies.report(outcome.message);
|
|
170559
170664
|
if (outcome.exitCode !== null) {
|
|
@@ -232999,7 +233104,7 @@ var init_runAgentWorkspaceDetail = __esm({
|
|
|
232999
233104
|
});
|
|
233000
233105
|
|
|
233001
233106
|
// src/devbox/resourceApi/threads.ts
|
|
233002
|
-
var requireAgentViewContract, encodeThreadCursor, decodeThreadCursor, isBackendThreadCursor, requireThreadCursor, buildThreadCursor, loadAllCliAgentToolThreadPages, chunk, mapThread, projectThreadPage, listCliAgentToolThreads;
|
|
233107
|
+
var requireAgentViewContract, encodeThreadCursor, decodeThreadCursor, isBackendThreadCursor, requireThreadCursor, buildThreadCursor, loadAllCliAgentToolThreadPages, loadCompleteProjectWindow, listCliAgentToolProjectThreadEntries, chunk, mapThread, projectThreadPage, listCliAgentToolThreads;
|
|
233003
233108
|
var init_threads = __esm({
|
|
233004
233109
|
"src/devbox/resourceApi/threads.ts"() {
|
|
233005
233110
|
"use strict";
|
|
@@ -233084,6 +233189,49 @@ var init_threads = __esm({
|
|
|
233084
233189
|
}
|
|
233085
233190
|
return pages;
|
|
233086
233191
|
};
|
|
233192
|
+
loadCompleteProjectWindow = async ({
|
|
233193
|
+
client,
|
|
233194
|
+
primaryInstanceId,
|
|
233195
|
+
liveResult,
|
|
233196
|
+
includeArchived
|
|
233197
|
+
}) => {
|
|
233198
|
+
const recentPages = await loadAllCliAgentToolThreadPages({
|
|
233199
|
+
client,
|
|
233200
|
+
primaryInstanceId,
|
|
233201
|
+
bucket: "recent",
|
|
233202
|
+
hasMore: liveResult.window.recent.hasMore,
|
|
233203
|
+
cursor: liveResult.window.recent.nextCursor
|
|
233204
|
+
});
|
|
233205
|
+
const archivedPages = includeArchived ? await loadAllCliAgentToolThreadPages({
|
|
233206
|
+
client,
|
|
233207
|
+
primaryInstanceId,
|
|
233208
|
+
bucket: "archived",
|
|
233209
|
+
hasMore: liveResult.window.archived.hasAny,
|
|
233210
|
+
cursor: null
|
|
233211
|
+
}) : [];
|
|
233212
|
+
return {
|
|
233213
|
+
recentPages,
|
|
233214
|
+
archivedPages,
|
|
233215
|
+
window: mergeAgentViewWindow({ liveResult, recentPages, archivedPages })
|
|
233216
|
+
};
|
|
233217
|
+
};
|
|
233218
|
+
listCliAgentToolProjectThreadEntries = async ({
|
|
233219
|
+
client,
|
|
233220
|
+
projectSelector
|
|
233221
|
+
}) => {
|
|
233222
|
+
const project = await loadCliAgentToolProject(client, projectSelector);
|
|
233223
|
+
const liveResult = await client.query(getAgentViewProjectWindowV1, {
|
|
233224
|
+
primaryInstanceId: project.primaryInstanceId
|
|
233225
|
+
});
|
|
233226
|
+
requireAgentViewContract(liveResult.contractVersion);
|
|
233227
|
+
const { window: window2 } = await loadCompleteProjectWindow({
|
|
233228
|
+
client,
|
|
233229
|
+
primaryInstanceId: project.primaryInstanceId,
|
|
233230
|
+
liveResult,
|
|
233231
|
+
includeArchived: true
|
|
233232
|
+
});
|
|
233233
|
+
return window2.clientThreads;
|
|
233234
|
+
};
|
|
233087
233235
|
chunk = (values, size) => {
|
|
233088
233236
|
const chunks = [];
|
|
233089
233237
|
for (let index = 0; index < values.length; index += size) {
|
|
@@ -233274,24 +233422,11 @@ var init_threads = __esm({
|
|
|
233274
233422
|
}
|
|
233275
233423
|
};
|
|
233276
233424
|
}
|
|
233277
|
-
const recentPages = await
|
|
233278
|
-
client,
|
|
233279
|
-
primaryInstanceId: project.primaryInstanceId,
|
|
233280
|
-
bucket: "recent",
|
|
233281
|
-
hasMore: liveResult.window.recent.hasMore,
|
|
233282
|
-
cursor: liveResult.window.recent.nextCursor
|
|
233283
|
-
});
|
|
233284
|
-
const archivedPages = includeArchived ? await loadAllCliAgentToolThreadPages({
|
|
233425
|
+
const { recentPages, archivedPages, window: window2 } = await loadCompleteProjectWindow({
|
|
233285
233426
|
client,
|
|
233286
233427
|
primaryInstanceId: project.primaryInstanceId,
|
|
233287
|
-
bucket: "archived",
|
|
233288
|
-
hasMore: liveResult.window.archived.hasAny,
|
|
233289
|
-
cursor: null
|
|
233290
|
-
}) : [];
|
|
233291
|
-
const window2 = mergeAgentViewWindow({
|
|
233292
233428
|
liveResult,
|
|
233293
|
-
|
|
233294
|
-
archivedPages
|
|
233429
|
+
includeArchived
|
|
233295
233430
|
});
|
|
233296
233431
|
const automationThreads = mergeAgentViewAutomationThreads({
|
|
233297
233432
|
liveResult,
|
|
@@ -233890,7 +234025,7 @@ var init_devboxOperations = __esm({
|
|
|
233890
234025
|
const record3 = error55 !== null && typeof error55 === "object" ? error55 : null;
|
|
233891
234026
|
const data = record3?.data !== null && typeof record3?.data === "object" ? record3.data : null;
|
|
233892
234027
|
const code2 = typeof data?.code === "string" ? data.code : null;
|
|
233893
|
-
if (code2 === "idempotency_key_reused" || code2 === "project_not_found" || code2 === "thread_not_found" || code2 === "contract_version_unsupported" || code2 === "invalid_request") {
|
|
234028
|
+
if (code2 === "idempotency_key_reused" || code2 === "project_not_found" || code2 === "thread_not_found" || code2 === "contract_version_unsupported" || code2 === "invalid_request" || code2 === "devbox_has_threads") {
|
|
233894
234029
|
return new CliAgentToolError({
|
|
233895
234030
|
code: code2,
|
|
233896
234031
|
message: typeof data?.message === "string" ? data.message : error55 instanceof Error ? error55.message : String(error55),
|
|
@@ -234066,22 +234201,14 @@ var init_devboxOperations = __esm({
|
|
|
234066
234201
|
context: context34,
|
|
234067
234202
|
projectFingerprint,
|
|
234068
234203
|
instanceId,
|
|
234069
|
-
|
|
234070
|
-
}) => {
|
|
234071
|
-
|
|
234072
|
-
|
|
234073
|
-
|
|
234074
|
-
includeArchived: true,
|
|
234075
|
-
all: true,
|
|
234076
|
-
cursor: null
|
|
234077
|
-
});
|
|
234078
|
-
return threadInventory.threads.filter(
|
|
234079
|
-
(thread) => thread.executionInstanceId === instanceId
|
|
234080
|
-
);
|
|
234081
|
-
};
|
|
234204
|
+
listThreadEntries
|
|
234205
|
+
}) => (await listThreadEntries({
|
|
234206
|
+
client: context34.client,
|
|
234207
|
+
projectSelector: projectFingerprint
|
|
234208
|
+
})).filter((thread) => thread.executionInstanceId === instanceId);
|
|
234082
234209
|
defaultLifecycleDependencies = {
|
|
234083
234210
|
listDevboxes: listCliAgentToolDevboxes,
|
|
234084
|
-
|
|
234211
|
+
listThreadEntries: listCliAgentToolProjectThreadEntries,
|
|
234085
234212
|
sleep: sleepManagedDevbox,
|
|
234086
234213
|
wake: wakeManagedDevbox,
|
|
234087
234214
|
destroy: destroyManagedDevbox,
|
|
@@ -234105,7 +234232,7 @@ var init_devboxOperations = __esm({
|
|
|
234105
234232
|
context: context34,
|
|
234106
234233
|
projectFingerprint: inventory.project.fingerprint,
|
|
234107
234234
|
instanceId: target.instanceId,
|
|
234108
|
-
|
|
234235
|
+
listThreadEntries: dependencies.listThreadEntries
|
|
234109
234236
|
});
|
|
234110
234237
|
if (attachedThreads.length > 0) {
|
|
234111
234238
|
const single = attachedThreads.length === 1;
|
|
@@ -234179,7 +234306,7 @@ var init_devboxArchiveDestroy = __esm({
|
|
|
234179
234306
|
buildDevboxOperationStatusCommand = (operationId) => `dvb devboxes status --operation ${shellQuote(operationId)} --json`;
|
|
234180
234307
|
defaultDependencies8 = {
|
|
234181
234308
|
listDevboxes: listCliAgentToolDevboxes,
|
|
234182
|
-
|
|
234309
|
+
listThreadEntries: listCliAgentToolProjectThreadEntries,
|
|
234183
234310
|
loadProject: loadCliAgentToolProject
|
|
234184
234311
|
};
|
|
234185
234312
|
destroyAndArchiveCliAgentToolDevbox = async ({
|
|
@@ -234198,7 +234325,7 @@ var init_devboxArchiveDestroy = __esm({
|
|
|
234198
234325
|
context: context34,
|
|
234199
234326
|
projectFingerprint: inventory.project.fingerprint,
|
|
234200
234327
|
instanceId: target.instanceId,
|
|
234201
|
-
|
|
234328
|
+
listThreadEntries: dependencies.listThreadEntries
|
|
234202
234329
|
});
|
|
234203
234330
|
const anchorThread = attachedThreads[0];
|
|
234204
234331
|
if (!anchorThread) {
|
|
@@ -252637,8 +252764,9 @@ var init_projectSelection2 = __esm({
|
|
|
252637
252764
|
} = {}) => {
|
|
252638
252765
|
let baseRepo = null;
|
|
252639
252766
|
try {
|
|
252640
|
-
const
|
|
252641
|
-
await ensureDirectory(
|
|
252767
|
+
const requestedPath = normalizeProjectDirectoryPath(selectedPath);
|
|
252768
|
+
await ensureDirectory(requestedPath);
|
|
252769
|
+
const normalizedSelectedPath = await fs49.realpath(requestedPath);
|
|
252642
252770
|
const reusableContext = reuse?.context?.normalizedSelectedPath === normalizedSelectedPath ? reuse.context : null;
|
|
252643
252771
|
const availableDiscovery = reusableContext?.availableDiscovery ?? await discoverProjectRepos(normalizedSelectedPath);
|
|
252644
252772
|
const existingInventory = reusableContext ? reusableContext.existingInventory : availableDiscovery.projectRootIsGitRepo ? null : await readProjectRepoInventory(availableDiscovery.projectRoot);
|
|
@@ -294323,19 +294451,10 @@ var init_mount = __esm({
|
|
|
294323
294451
|
};
|
|
294324
294452
|
resolveMountProviderTarget = async (socketPath, targetBox, accountScope, homeDir2) => {
|
|
294325
294453
|
const spriteAlias = await resolveSpriteAlias(socketPath, targetBox);
|
|
294326
|
-
let providerLookupBoxes = null;
|
|
294327
|
-
try {
|
|
294328
|
-
providerLookupBoxes = await listDevboxes();
|
|
294329
|
-
} catch (error55) {
|
|
294330
|
-
logger3.warn("mount_provider_lookup_failed", {
|
|
294331
|
-
box: spriteAlias,
|
|
294332
|
-
error: String(error55)
|
|
294333
|
-
});
|
|
294334
|
-
}
|
|
294335
294454
|
return await resolveCommandComputeProvider({
|
|
294336
294455
|
accountScope,
|
|
294337
294456
|
box: spriteAlias,
|
|
294338
|
-
boxes:
|
|
294457
|
+
boxes: await listDevboxes(),
|
|
294339
294458
|
homeDir: homeDir2
|
|
294340
294459
|
});
|
|
294341
294460
|
};
|
|
@@ -295877,7 +295996,8 @@ var init_agentPermissionRequests = __esm({
|
|
|
295877
295996
|
};
|
|
295878
295997
|
listPendingRequests = async (client) => await client.query(listPending, {
|
|
295879
295998
|
supportsIntegrationPermissions: true,
|
|
295880
|
-
supportsTeamMembershipActions: true
|
|
295999
|
+
supportsTeamMembershipActions: true,
|
|
296000
|
+
supportsTeamSettingsGrant: true
|
|
295881
296001
|
});
|
|
295882
296002
|
findPendingRequest = async (client, requestId2) => {
|
|
295883
296003
|
const entries = await listPendingRequests(client);
|
|
@@ -295940,7 +296060,8 @@ var init_agentPermissionRequests = __esm({
|
|
|
295940
296060
|
decision,
|
|
295941
296061
|
scope,
|
|
295942
296062
|
supportsIntegrationPermissions: true,
|
|
295943
|
-
supportsTeamMembershipActions: true
|
|
296063
|
+
supportsTeamMembershipActions: true,
|
|
296064
|
+
supportsTeamSettingsGrant: true
|
|
295944
296065
|
});
|
|
295945
296066
|
requireDecisionApplied(decision, response.status);
|
|
295946
296067
|
return { decision, scope, status: response.status, entry };
|
|
@@ -296161,7 +296282,7 @@ var init_power = __esm({
|
|
|
296161
296282
|
|
|
296162
296283
|
// src/devbox/commands/ports.ts
|
|
296163
296284
|
import os40 from "node:os";
|
|
296164
|
-
var MANUAL_PORT_FORWARD_OWNER, parsePortsArgs,
|
|
296285
|
+
var MANUAL_PORT_FORWARD_OWNER, parsePortsArgs, resolvePortsProviderTarget, expandPortSpecToNumbers, runPolicyUpdate, runManualForwardOwnerUpdate, runPorts;
|
|
296165
296286
|
var init_ports3 = __esm({
|
|
296166
296287
|
"src/devbox/commands/ports.ts"() {
|
|
296167
296288
|
"use strict";
|
|
@@ -296231,24 +296352,8 @@ var init_ports3 = __esm({
|
|
|
296231
296352
|
...box ? { box } : {}
|
|
296232
296353
|
};
|
|
296233
296354
|
};
|
|
296234
|
-
|
|
296235
|
-
|
|
296236
|
-
const response = await requestJson2(
|
|
296237
|
-
socketPath,
|
|
296238
|
-
"GET",
|
|
296239
|
-
"/boxes",
|
|
296240
|
-
DAEMON_TIMEOUT_MS.registry
|
|
296241
|
-
);
|
|
296242
|
-
if (response.status !== 200) {
|
|
296243
|
-
return null;
|
|
296244
|
-
}
|
|
296245
|
-
return response.body.boxes;
|
|
296246
|
-
} catch {
|
|
296247
|
-
return null;
|
|
296248
|
-
}
|
|
296249
|
-
};
|
|
296250
|
-
resolvePortsProviderTarget = async (socketPath, targetBox) => {
|
|
296251
|
-
const boxes = await loadBoxesSnapshot(socketPath);
|
|
296355
|
+
resolvePortsProviderTarget = async (targetBox) => {
|
|
296356
|
+
const boxes = await listDevboxes();
|
|
296252
296357
|
const homeDir2 = process.env.HOME ?? os40.homedir();
|
|
296253
296358
|
const { accountScope } = await resolveCliAccountScopeFromLocalAuth({
|
|
296254
296359
|
cwd: process.cwd(),
|
|
@@ -296257,7 +296362,7 @@ var init_ports3 = __esm({
|
|
|
296257
296362
|
return await resolveCommandComputeProvider({
|
|
296258
296363
|
accountScope,
|
|
296259
296364
|
box: targetBox,
|
|
296260
|
-
|
|
296365
|
+
boxes,
|
|
296261
296366
|
homeDir: homeDir2
|
|
296262
296367
|
});
|
|
296263
296368
|
};
|
|
@@ -296334,10 +296439,7 @@ var init_ports3 = __esm({
|
|
|
296334
296439
|
if (!selected) return;
|
|
296335
296440
|
targetBox = selected.box;
|
|
296336
296441
|
}
|
|
296337
|
-
const providerTarget = await resolvePortsProviderTarget(
|
|
296338
|
-
socketInfo.socketPath,
|
|
296339
|
-
targetBox
|
|
296340
|
-
);
|
|
296442
|
+
const providerTarget = await resolvePortsProviderTarget(targetBox);
|
|
296341
296443
|
const policy = parsed.subcommand === "stop" ? "disabled" : "auto";
|
|
296342
296444
|
await runPolicyUpdate(socketInfo.socketPath, ports, {
|
|
296343
296445
|
box: providerTarget.alias,
|
|
@@ -296360,7 +296462,7 @@ var init_ports3 = __esm({
|
|
|
296360
296462
|
return;
|
|
296361
296463
|
}
|
|
296362
296464
|
await requireDaemonFeatures(socketInfo.socketPath, ["ports"]);
|
|
296363
|
-
const boxFilter = parsed.box ? (await resolvePortsProviderTarget(
|
|
296465
|
+
const boxFilter = parsed.box ? (await resolvePortsProviderTarget(parsed.box)).alias : void 0;
|
|
296364
296466
|
const response = await requestJson2(
|
|
296365
296467
|
socketInfo.socketPath,
|
|
296366
296468
|
"GET",
|
|
@@ -298122,7 +298224,7 @@ var init_providerClient = __esm({
|
|
|
298122
298224
|
|
|
298123
298225
|
// src/devbox/commands/sessions.ts
|
|
298124
298226
|
import os42 from "node:os";
|
|
298125
|
-
var renameUsage, killUsage, listUsage, parseSessionsArgs, parseSessionTarget, parseKillTarget, EXPORT_PREFIX_PATTERN, normalizeWrappedShellCommand, formatSessionCommandForDisplay,
|
|
298227
|
+
var renameUsage, killUsage, listUsage, parseSessionsArgs, parseSessionTarget, parseKillTarget, EXPORT_PREFIX_PATTERN, normalizeWrappedShellCommand, formatSessionCommandForDisplay, resolveSessionsClient, runRename, runKill, runSessions;
|
|
298126
298228
|
var init_sessions2 = __esm({
|
|
298127
298229
|
"src/devbox/commands/sessions.ts"() {
|
|
298128
298230
|
"use strict";
|
|
@@ -298257,28 +298359,12 @@ var init_sessions2 = __esm({
|
|
|
298257
298359
|
}
|
|
298258
298360
|
return command.join(" ");
|
|
298259
298361
|
};
|
|
298260
|
-
loadBoxesSnapshot2 = async (socketPath) => {
|
|
298261
|
-
try {
|
|
298262
|
-
const response = await requestJson2(
|
|
298263
|
-
socketPath,
|
|
298264
|
-
"GET",
|
|
298265
|
-
"/boxes",
|
|
298266
|
-
DAEMON_TIMEOUT_MS.registry
|
|
298267
|
-
);
|
|
298268
|
-
if (response.status !== 200) {
|
|
298269
|
-
return null;
|
|
298270
|
-
}
|
|
298271
|
-
return response.body.boxes;
|
|
298272
|
-
} catch {
|
|
298273
|
-
return null;
|
|
298274
|
-
}
|
|
298275
|
-
};
|
|
298276
298362
|
resolveSessionsClient = async (targetBox) => {
|
|
298277
298363
|
const socketInfo = resolveSocketInfo();
|
|
298278
298364
|
const socketPath = socketInfo.socketPath;
|
|
298279
298365
|
await ensureDaemonRunning(socketPath);
|
|
298280
298366
|
await requireDaemonFeatures(socketPath, ["registry"]);
|
|
298281
|
-
const boxes = await
|
|
298367
|
+
const boxes = await listDevboxes();
|
|
298282
298368
|
const homeDir2 = process.env.HOME ?? os42.homedir();
|
|
298283
298369
|
const { accountScope } = await resolveCliAccountScopeFromLocalAuth({
|
|
298284
298370
|
cwd: process.cwd(),
|
|
@@ -298287,7 +298373,7 @@ var init_sessions2 = __esm({
|
|
|
298287
298373
|
const providerTarget = await resolveCommandComputeProvider({
|
|
298288
298374
|
accountScope,
|
|
298289
298375
|
box: targetBox,
|
|
298290
|
-
|
|
298376
|
+
boxes,
|
|
298291
298377
|
homeDir: homeDir2
|
|
298292
298378
|
});
|
|
298293
298379
|
const spriteAlias = providerTarget.alias;
|
|
@@ -300931,9 +301017,11 @@ async function* streamCliAgentToolThreadEvents({
|
|
|
300931
301017
|
clientThreadId,
|
|
300932
301018
|
turnId: streamCursor.turnId,
|
|
300933
301019
|
requestId: requestId2,
|
|
300934
|
-
|
|
300935
|
-
|
|
300936
|
-
|
|
301020
|
+
settles: observationChanged({
|
|
301021
|
+
baselineThread,
|
|
301022
|
+
baselinePendingInput: page.pendingInput ?? null,
|
|
301023
|
+
baselineEventId: streamCursor.lastEventId
|
|
301024
|
+
}),
|
|
300937
301025
|
timeoutMs: null,
|
|
300938
301026
|
signal
|
|
300939
301027
|
});
|
|
@@ -300985,7 +301073,7 @@ async function* streamCliAgentToolThreadEvents({
|
|
|
300985
301073
|
throw normalizeConvexResourceError(error55);
|
|
300986
301074
|
}
|
|
300987
301075
|
}
|
|
300988
|
-
var THREAD_EVENT_PAGE_SIZE, projectCliAgentToolsThreadFailureV1, encodeThreadEventCursor, decodeThreadEventCursor, loadThreadContext, loadThreadEventPage, threadStateSignature, waitForThreadObservation, threadEventWaitStatus, loadTerminalWaitResult, loadInputWaitResult, nonTerminalWaitResult, detachedThreadWaitStatus, threadAwaitsInput, isTurnOutcomeEvent, waitForCliAgentToolThread, initialStreamCursor, buildCliAgentToolsThreadEventEnvelope;
|
|
301076
|
+
var THREAD_EVENT_PAGE_SIZE, projectCliAgentToolsThreadFailureV1, encodeThreadEventCursor, decodeThreadEventCursor, loadThreadContext, loadThreadEventPage, threadStateSignature, observationChanged, waitForThreadObservation, threadEventWaitStatus, loadTerminalWaitResult, loadInputWaitResult, nonTerminalWaitResult, detachedThreadWaitStatus, threadAwaitsInput, isTurnOutcomeEvent, waitForThreadOutcome, waitForCliAgentToolThread, initialStreamCursor, buildCliAgentToolsThreadEventEnvelope;
|
|
300989
301077
|
var init_threadObservation = __esm({
|
|
300990
301078
|
"src/devbox/resourceApi/threadObservation.ts"() {
|
|
300991
301079
|
"use strict";
|
|
@@ -301119,14 +301207,26 @@ var init_threadObservation = __esm({
|
|
|
301119
301207
|
String(thread.updatedAt),
|
|
301120
301208
|
JSON.stringify(pendingInput)
|
|
301121
301209
|
].join(":");
|
|
301210
|
+
observationChanged = ({
|
|
301211
|
+
baselineThread,
|
|
301212
|
+
baselinePendingInput,
|
|
301213
|
+
baselineEventId
|
|
301214
|
+
}) => {
|
|
301215
|
+
const baselineSignature = threadStateSignature(
|
|
301216
|
+
baselineThread,
|
|
301217
|
+
baselinePendingInput
|
|
301218
|
+
);
|
|
301219
|
+
return (observation) => (observation.latestEvent?.eventId ?? null) !== baselineEventId || threadStateSignature(
|
|
301220
|
+
observation.thread,
|
|
301221
|
+
observation.pendingInput ?? null
|
|
301222
|
+
) !== baselineSignature;
|
|
301223
|
+
};
|
|
301122
301224
|
waitForThreadObservation = async ({
|
|
301123
301225
|
context: context34,
|
|
301124
301226
|
clientThreadId,
|
|
301125
301227
|
turnId,
|
|
301126
301228
|
requestId: requestId2,
|
|
301127
|
-
|
|
301128
|
-
baselinePendingInput,
|
|
301129
|
-
baselineEventId,
|
|
301229
|
+
settles,
|
|
301130
301230
|
timeoutMs,
|
|
301131
301231
|
signal
|
|
301132
301232
|
}) => await new Promise((resolve3, reject) => {
|
|
@@ -301168,10 +301268,6 @@ var init_threadObservation = __esm({
|
|
|
301168
301268
|
const onAbort = () => finish({ kind: "canceled" });
|
|
301169
301269
|
timer = timeoutMs === null ? null : setTimeout(() => finish({ kind: "timeout" }), timeoutMs);
|
|
301170
301270
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
301171
|
-
const baselineSignature = threadStateSignature(
|
|
301172
|
-
baselineThread,
|
|
301173
|
-
baselinePendingInput
|
|
301174
|
-
);
|
|
301175
301271
|
unsubscribe4 = context34.client.onUpdate(
|
|
301176
301272
|
observeCliAgentToolThreadV1,
|
|
301177
301273
|
{
|
|
@@ -301181,10 +301277,7 @@ var init_threadObservation = __esm({
|
|
|
301181
301277
|
requestId: requestId2
|
|
301182
301278
|
},
|
|
301183
301279
|
(observation) => {
|
|
301184
|
-
if ((observation
|
|
301185
|
-
observation.thread,
|
|
301186
|
-
observation.pendingInput ?? null
|
|
301187
|
-
) !== baselineSignature) {
|
|
301280
|
+
if (settles(observation)) {
|
|
301188
301281
|
finish({ kind: "observation", observation });
|
|
301189
301282
|
}
|
|
301190
301283
|
},
|
|
@@ -301212,13 +301305,27 @@ var init_threadObservation = __esm({
|
|
|
301212
301305
|
loadTerminalWaitResult = async ({
|
|
301213
301306
|
context: context34,
|
|
301214
301307
|
thread,
|
|
301308
|
+
observedTurnId,
|
|
301215
301309
|
event,
|
|
301216
|
-
requestId: requestId2
|
|
301310
|
+
requestId: requestId2,
|
|
301311
|
+
deadline,
|
|
301312
|
+
signal
|
|
301217
301313
|
}) => {
|
|
301218
301314
|
const status = threadEventWaitStatus(event);
|
|
301219
301315
|
if (status === null) {
|
|
301220
301316
|
throw new Error("A non-terminal event cannot complete a thread wait.");
|
|
301221
301317
|
}
|
|
301318
|
+
if (event.transcriptUploaded === false) {
|
|
301319
|
+
await waitForThreadObservation({
|
|
301320
|
+
context: context34,
|
|
301321
|
+
clientThreadId: thread.clientThreadId,
|
|
301322
|
+
turnId: observedTurnId,
|
|
301323
|
+
requestId: requestId2,
|
|
301324
|
+
settles: (observation) => observation.latestEvent?.eventId !== event.eventId || observation.latestEvent.transcriptUploaded !== false,
|
|
301325
|
+
timeoutMs: Math.max(0, deadline - Date.now()),
|
|
301326
|
+
signal
|
|
301327
|
+
});
|
|
301328
|
+
}
|
|
301222
301329
|
const read2 = await readCliAgentToolThread({
|
|
301223
301330
|
context: context34,
|
|
301224
301331
|
clientThreadId: thread.clientThreadId,
|
|
@@ -301299,7 +301406,7 @@ var init_threadObservation = __esm({
|
|
|
301299
301406
|
const status = threadEventWaitStatus(event);
|
|
301300
301407
|
return status !== null && status !== "needs_input";
|
|
301301
301408
|
};
|
|
301302
|
-
|
|
301409
|
+
waitForThreadOutcome = async ({
|
|
301303
301410
|
context: context34,
|
|
301304
301411
|
clientThreadId,
|
|
301305
301412
|
turnId,
|
|
@@ -301380,8 +301487,11 @@ var init_threadObservation = __esm({
|
|
|
301380
301487
|
return await loadTerminalWaitResult({
|
|
301381
301488
|
context: context34,
|
|
301382
301489
|
thread: baselineThread,
|
|
301490
|
+
observedTurnId,
|
|
301383
301491
|
event: outcomeEvent,
|
|
301384
|
-
requestId: requestId2
|
|
301492
|
+
requestId: requestId2,
|
|
301493
|
+
deadline,
|
|
301494
|
+
signal
|
|
301385
301495
|
});
|
|
301386
301496
|
}
|
|
301387
301497
|
while (true) {
|
|
@@ -301423,9 +301533,11 @@ var init_threadObservation = __esm({
|
|
|
301423
301533
|
clientThreadId,
|
|
301424
301534
|
turnId: observedTurnId,
|
|
301425
301535
|
requestId: requestId2,
|
|
301426
|
-
|
|
301427
|
-
|
|
301428
|
-
|
|
301536
|
+
settles: observationChanged({
|
|
301537
|
+
baselineThread,
|
|
301538
|
+
baselinePendingInput: pendingInput,
|
|
301539
|
+
baselineEventId: latestEventId
|
|
301540
|
+
}),
|
|
301429
301541
|
timeoutMs: remainingMs,
|
|
301430
301542
|
signal
|
|
301431
301543
|
});
|
|
@@ -301444,8 +301556,11 @@ var init_threadObservation = __esm({
|
|
|
301444
301556
|
return await loadTerminalWaitResult({
|
|
301445
301557
|
context: context34,
|
|
301446
301558
|
thread: baselineThread,
|
|
301559
|
+
observedTurnId,
|
|
301447
301560
|
event,
|
|
301448
|
-
requestId: requestId2
|
|
301561
|
+
requestId: requestId2,
|
|
301562
|
+
deadline,
|
|
301563
|
+
signal
|
|
301449
301564
|
});
|
|
301450
301565
|
}
|
|
301451
301566
|
if (event?.kind === "needs_input") {
|
|
@@ -301456,6 +301571,24 @@ var init_threadObservation = __esm({
|
|
|
301456
301571
|
throw normalizeConvexResourceError(error55);
|
|
301457
301572
|
}
|
|
301458
301573
|
};
|
|
301574
|
+
waitForCliAgentToolThread = async (args) => {
|
|
301575
|
+
const result = await waitForThreadOutcome(args);
|
|
301576
|
+
if (result.status !== "timeout") {
|
|
301577
|
+
return result;
|
|
301578
|
+
}
|
|
301579
|
+
try {
|
|
301580
|
+
const read2 = await readCliAgentToolThread({
|
|
301581
|
+
context: args.context,
|
|
301582
|
+
clientThreadId: args.clientThreadId,
|
|
301583
|
+
turns: 20,
|
|
301584
|
+
cursor: null,
|
|
301585
|
+
requestId: args.requestId
|
|
301586
|
+
});
|
|
301587
|
+
return { ...result, transcript: read2.transcript };
|
|
301588
|
+
} catch (error55) {
|
|
301589
|
+
throw normalizeConvexResourceError(error55);
|
|
301590
|
+
}
|
|
301591
|
+
};
|
|
301459
301592
|
initialStreamCursor = async ({
|
|
301460
301593
|
context: context34,
|
|
301461
301594
|
clientThreadId,
|
|
@@ -301768,6 +301901,12 @@ ${renderPendingInput(data.pendingInput)}`;
|
|
|
301768
301901
|
if (data.transcript?.status !== "ready" || data.transcript.messages.length === 0) {
|
|
301769
301902
|
return header;
|
|
301770
301903
|
}
|
|
301904
|
+
if (data.status === "timeout") {
|
|
301905
|
+
const notices = data.transcript.messages.filter(
|
|
301906
|
+
(message) => message.role === "notice" && message.turnId === data.turnId
|
|
301907
|
+
).map((message) => message.text);
|
|
301908
|
+
return [header, ...notices].join("\n\n");
|
|
301909
|
+
}
|
|
301771
301910
|
const finalAssistant = [...data.transcript.messages].reverse().find((message) => message.role === "assistant");
|
|
301772
301911
|
return finalAssistant === void 0 ? header : `${header}
|
|
301773
301912
|
|
|
@@ -302591,4 +302730,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
302591
302730
|
*)
|
|
302592
302731
|
*/
|
|
302593
302732
|
|
|
302594
|
-
//# debugId=
|
|
302733
|
+
//# debugId=2c541fd7-9d30-5526-a597-0d4c51289327
|