@tangle-network/sandbox 0.38.2 → 0.39.1-develop.20260912191433.b31d83f
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/README.md +11 -3
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +4 -4
- package/dist/{agent-run-outcome-Bq1aHHPy.d.ts → agent-run-outcome-BSysiQWr.d.ts} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -1
- package/dist/{browser-interactive-control-controller-lRfzpg9t.d.ts → browser-interactive-control-controller-BELrFH4f.d.ts} +1 -1
- package/dist/cli-auth-bundle-DUsK57rK.js +25 -0
- package/dist/{client-XqUR9qgS.d.ts → client-fy_RYdGN.d.ts} +13 -4
- package/dist/{client-DRumogtw.js → client-j6FmPkNB.js} +102 -14
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-DoSvMDEu.js → collaboration-CDvc5Hxk.js} +1 -1
- package/dist/core.d.ts +4 -4
- package/dist/core.js +3 -3
- package/dist/{errors-BMinPhXs.d.ts → errors-Cv3Td7LB.d.ts} +21 -1
- package/dist/{errors-MMMPY4T6.js → errors-V6uPkjfJ.js} +25 -3
- package/dist/{index-Bq_z_u6A.d.ts → index-CS-t6tPU.d.ts} +11 -1
- package/dist/{index-D3h0zRzl.d.ts → index-hYNUMvGr.d.ts} +2 -2
- package/dist/index.d.ts +30 -31
- package/dist/index.js +6 -14
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.d.ts +1 -1
- package/dist/{local-cli-auth-CJmSpTjk.js → local-cli-auth-BAJuMBZU.js} +7 -5
- package/dist/{runtime-api-CrjcDtUw.js → runtime-api-DokfzHVX.js} +31 -6
- package/dist/runtime.d.ts +3 -3
- package/dist/runtime.js +2 -2
- package/dist/{sandbox-CzBWptVE.js → sandbox-BFZa_Gx-.js} +39 -35
- package/dist/{sandbox-DQmu7a6M.d.ts → sandbox-C8xeDrlS.d.ts} +8 -8
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-B0p39vvV.js → tangle-Dn2pS3TZ.js} +2 -2
- package/dist/{types-DTDI3kek.d.ts → types-BZuZPQ0N.d.ts} +14 -5
- package/package.json +6 -5
- /package/dist/{index-CMLW3u5K.d.ts → index-BzAxTiqF.d.ts} +0 -0
- /package/dist/{terminal-stream-5GNLCsms.d.ts → terminal-stream-CcaBTVg3.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as uploadChunked, c as encodePromptForWire, d as applyRequestedModel, f as assertCurrentBackendType,
|
|
2
|
-
import { d as ServerError, f as StateError, h as parseErrorResponse, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-
|
|
1
|
+
import { a as uploadChunked, c as encodePromptForWire, d as applyRequestedModel, f as assertCurrentBackendType, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, i as sessionHeaders, m as normalizeRuntimeBackendConfig, n as normalizeSessionInfo, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as mergeRuntimeBackendConfig, r as appendSessionIdQuery, t as SandboxRuntimeApi, u as parseSSEStream } from "./runtime-api-DokfzHVX.js";
|
|
2
|
+
import { d as ServerError, f as StateError, h as parseErrorResponse, l as QuotaError, m as ValidationError, n as CapabilityError, o as NetworkError, p as TimeoutError, r as EdgeNotReadyError, s as NotFoundError, t as AuthError, u as SandboxError } from "./errors-V6uPkjfJ.js";
|
|
3
3
|
import { c as createInteractiveControlHolderId, d as interactiveSessionControlReleaseResponseSchema, f as interactiveSessionControlValidationResponseSchema, i as createBrowserInteractiveSessionControlTransport, o as InteractiveSessionControlController, p as interactiveSessionStatusResponseSchema, r as browserInteractiveTerminalEndpoint, s as assertInteractiveSessionRef, u as interactiveSessionControlClaimResponseSchema } from "./browser-interactive-control-controller-Dv0gbFMu.js";
|
|
4
4
|
import { n as combineAbortSignals, t as awaitWithAbort } from "./abort-signal-si1WMfJb.js";
|
|
5
5
|
import { AgentExactRunControlRefSchema, AgentInteractiveSessionAttachSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimRequestSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionPromptCommandSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStartSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentInteractiveSessionStopCommandSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, InteractionAcknowledgementSchema, InteractionBindingSchema, InteractionRequestSchema, InteractionResponseCommandSchema, InteractionResponseSchema, TerminalInputSchema, TerminalOutputEventSchema, TerminalReplayWindowSchema, TerminalResizeSchema, TerminalSessionRefSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimIsNewer, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionPromptRequestDigest, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentRunCancellationAcknowledgementMatchesRequest, canonicalCandidateDigest, exactAgentInteractiveSessionStart, sha256DigestSchema, terminalSessionUsable } from "@tangle-network/agent-interface";
|
|
@@ -4001,12 +4001,13 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4001
4001
|
*/
|
|
4002
4002
|
async exec(command, options) {
|
|
4003
4003
|
const headers = sessionHeaders(options?.sessionId);
|
|
4004
|
-
await this.ensureRunning();
|
|
4004
|
+
await this.ensureRunning(options?.signal);
|
|
4005
4005
|
const timeoutMs = options?.timeoutMs ?? EXEC_DEFAULT_TIMEOUT_MS;
|
|
4006
4006
|
if (!Number.isInteger(timeoutMs) || timeoutMs < EXEC_MIN_TIMEOUT_MS || timeoutMs > EXEC_MAX_TIMEOUT_MS) throw new ValidationError(`exec timeoutMs must be an integer between ${EXEC_MIN_TIMEOUT_MS} and ${EXEC_MAX_TIMEOUT_MS}`);
|
|
4007
4007
|
const response = await this.runtimeFetch("/process/spawn", {
|
|
4008
4008
|
method: "POST",
|
|
4009
4009
|
headers,
|
|
4010
|
+
...options?.signal ? { signal: options.signal } : {},
|
|
4010
4011
|
body: JSON.stringify({
|
|
4011
4012
|
executable: SANDBOX_COMMAND_SHELL,
|
|
4012
4013
|
args: sandboxShellCommandArgs(command),
|
|
@@ -4379,7 +4380,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4379
4380
|
* content references by hash, changed content sends inline.
|
|
4380
4381
|
*/
|
|
4381
4382
|
buildRunBackendBody(overrideBackend, forceFullProfile, requestedModel) {
|
|
4382
|
-
const normalized = normalizeRuntimeBackendConfig(applyRequestedModel(
|
|
4383
|
+
const normalized = normalizeRuntimeBackendConfig(applyRequestedModel(mergeRuntimeBackendConfig(this.defaultRuntimeBackend, overrideBackend), requestedModel));
|
|
4383
4384
|
if (!normalized) return normalized;
|
|
4384
4385
|
const deferred = this.deferredProfileReference;
|
|
4385
4386
|
if (!forceFullProfile && deferred !== void 0 && normalized.profile !== void 0 && serializeProfileSnapshot(normalized.profile) === deferred.snapshot) {
|
|
@@ -5213,28 +5214,18 @@ var SandboxInstance = class SandboxInstance {
|
|
|
5213
5214
|
}
|
|
5214
5215
|
async fsUpload(localPath, remotePath, options) {
|
|
5215
5216
|
await this.ensureRunning();
|
|
5216
|
-
const
|
|
5217
|
-
const path = await import("node:path");
|
|
5218
|
-
const fileBuffer = await fs.readFile(localPath);
|
|
5219
|
-
const fileName = path.basename(localPath);
|
|
5217
|
+
const fileBuffer = await (await import("node:fs/promises")).readFile(localPath);
|
|
5220
5218
|
if (options?.onProgress) options.onProgress({
|
|
5221
5219
|
bytesUploaded: 0,
|
|
5222
5220
|
totalBytes: fileBuffer.length,
|
|
5223
5221
|
percentage: 0
|
|
5224
5222
|
});
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
method: "POST",
|
|
5231
|
-
body: formData,
|
|
5232
|
-
headers: {}
|
|
5223
|
+
await this.fsUploadData(remotePath, fileBuffer, {
|
|
5224
|
+
mode: options?.permissions,
|
|
5225
|
+
onProgress: options?.onProgress ? (progress) => {
|
|
5226
|
+
if (progress.percentage < 100) options.onProgress?.(progress);
|
|
5227
|
+
} : void 0
|
|
5233
5228
|
});
|
|
5234
|
-
if (!response.ok) {
|
|
5235
|
-
const body = await response.text();
|
|
5236
|
-
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
5237
|
-
}
|
|
5238
5229
|
if (options?.onProgress) options.onProgress({
|
|
5239
5230
|
bytesUploaded: fileBuffer.length,
|
|
5240
5231
|
totalBytes: fileBuffer.length,
|
|
@@ -6933,7 +6924,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6933
6924
|
return attempt;
|
|
6934
6925
|
}, signal ? { signal } : {});
|
|
6935
6926
|
const data = await this.readLifecycleResponse(response);
|
|
6936
|
-
if (!this.applyLifecycleResponse(data)) await this.refresh();
|
|
6927
|
+
if (!this.applyLifecycleResponse(data)) await this.refresh(signal);
|
|
6937
6928
|
const diagnostics = data ? normalizeStartupDiagnostics(data.startupDiagnostics) : null;
|
|
6938
6929
|
if (diagnostics) this.info.startupDiagnostics = diagnostics;
|
|
6939
6930
|
}
|
|
@@ -6949,12 +6940,16 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6949
6940
|
* {@link startupDiagnostics} returns it for post-mortem reads on the
|
|
6950
6941
|
* now-gone sandbox.
|
|
6951
6942
|
*/
|
|
6952
|
-
async delete() {
|
|
6943
|
+
async delete(options) {
|
|
6944
|
+
options?.signal?.throwIfAborted();
|
|
6953
6945
|
let sawLifecycleConflict = false;
|
|
6954
6946
|
let response;
|
|
6955
6947
|
try {
|
|
6956
6948
|
response = await withLifecycleConflictRetry(async () => {
|
|
6957
|
-
const attempt = await this.client.fetch(`/v1/sandboxes/${this.id}`, {
|
|
6949
|
+
const attempt = await this.client.fetch(`/v1/sandboxes/${this.id}`, {
|
|
6950
|
+
method: "DELETE",
|
|
6951
|
+
...options?.signal ? { signal: options.signal } : {}
|
|
6952
|
+
});
|
|
6958
6953
|
if (!attempt.ok) {
|
|
6959
6954
|
const body = await attempt.text();
|
|
6960
6955
|
const refusal = parseErrorResponse(attempt.status, body, void 0, attempt.headers);
|
|
@@ -6962,7 +6957,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6962
6957
|
throw refusal;
|
|
6963
6958
|
}
|
|
6964
6959
|
return attempt;
|
|
6965
|
-
});
|
|
6960
|
+
}, options);
|
|
6966
6961
|
} catch (caught) {
|
|
6967
6962
|
if (!sawLifecycleConflict || !(caught instanceof NotFoundError)) throw caught;
|
|
6968
6963
|
sandboxStatusObservedAt.delete(this);
|
|
@@ -6972,6 +6967,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6972
6967
|
};
|
|
6973
6968
|
}
|
|
6974
6969
|
const data = await response.json().catch(() => null);
|
|
6970
|
+
options?.signal?.throwIfAborted();
|
|
6975
6971
|
const diagnostics = data ? normalizeStartupDiagnostics(data.startupDiagnostics) : null;
|
|
6976
6972
|
if (diagnostics) this.info.startupDiagnostics = diagnostics;
|
|
6977
6973
|
sandboxStatusObservedAt.delete(this);
|
|
@@ -7124,19 +7120,27 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7124
7120
|
const timeoutMs = options?.timeoutMs ?? 12e4;
|
|
7125
7121
|
const pollIntervalMs = options?.pollIntervalMs ?? 2e3;
|
|
7126
7122
|
const startTime = Date.now();
|
|
7123
|
+
const timeoutSignal = AbortSignal.timeout(timeoutMs);
|
|
7124
|
+
const signal = options?.signal ? combineAbortSignals([options.signal, timeoutSignal]) : timeoutSignal;
|
|
7125
|
+
const rethrowWaitError = (error) => {
|
|
7126
|
+
if (timeoutSignal.aborted) throw new TimeoutError(timeoutMs, `Timed out waiting for sandbox to reach ${statuses.join(" or ")}`);
|
|
7127
|
+
if (options?.signal?.aborted) throw new TimeoutError(0, "Aborted");
|
|
7128
|
+
throw error;
|
|
7129
|
+
};
|
|
7127
7130
|
if (options?.onProgress && (this.status === "provisioning" || this.status === "pending")) try {
|
|
7128
|
-
if (await this.waitForWithSSE(statuses, timeoutMs, options.onProgress,
|
|
7131
|
+
if (await this.waitForWithSSE(statuses, timeoutMs, options.onProgress, signal)) return;
|
|
7129
7132
|
} catch (err) {
|
|
7133
|
+
if (signal.aborted) rethrowWaitError(err);
|
|
7130
7134
|
if (err instanceof StateError || err instanceof TimeoutError) throw err;
|
|
7131
7135
|
}
|
|
7132
7136
|
if (this.hasFreshStatus() && this.hasReachedWaitTarget(statuses)) return;
|
|
7133
7137
|
while (true) {
|
|
7134
|
-
if (
|
|
7135
|
-
await this.refresh();
|
|
7138
|
+
if (signal.aborted) rethrowWaitError(signal.reason);
|
|
7139
|
+
await this.refresh(signal).catch(rethrowWaitError);
|
|
7136
7140
|
if (this.hasReachedWaitTarget(statuses)) return;
|
|
7137
7141
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
7138
7142
|
if (Date.now() - startTime > timeoutMs) throw new TimeoutError(timeoutMs, `Timed out waiting for sandbox to reach ${statuses.join(" or ")}`);
|
|
7139
|
-
await
|
|
7143
|
+
await delayUntilAborted(pollIntervalMs, signal).catch(rethrowWaitError);
|
|
7140
7144
|
}
|
|
7141
7145
|
}
|
|
7142
7146
|
/**
|
|
@@ -7173,14 +7177,14 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7173
7177
|
timestamp: d.timestamp ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
7174
7178
|
});
|
|
7175
7179
|
} else if (event.type === "provision_failed") {
|
|
7176
|
-
await this.refresh();
|
|
7180
|
+
await this.refresh(abortController.signal);
|
|
7177
7181
|
throw new StateError(event.data.error ?? "Provisioning failed", this.status);
|
|
7178
7182
|
} else if (event.type === "provision_complete" || event.type === "status_change") {
|
|
7179
|
-
await this.refresh();
|
|
7183
|
+
await this.refresh(abortController.signal);
|
|
7180
7184
|
if (this.hasReachedWaitTarget(statuses)) return true;
|
|
7181
7185
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
7182
7186
|
}
|
|
7183
|
-
await this.refresh();
|
|
7187
|
+
await this.refresh(abortController.signal);
|
|
7184
7188
|
if (this.hasReachedWaitTarget(statuses)) return true;
|
|
7185
7189
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
7186
7190
|
if (statuses.includes("running") && this.status === "running") return false;
|
|
@@ -7632,9 +7636,9 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7632
7636
|
* Drive a detached turn forward by exactly one settle → poll → dispatch
|
|
7633
7637
|
* pass and report where it stands. Built for tick-based callers —
|
|
7634
7638
|
* Cloudflare Workflows steps, queue consumers, crons — that re-invoke
|
|
7635
|
-
* on their own schedule instead of holding a stream open.
|
|
7636
|
-
*
|
|
7637
|
-
*
|
|
7639
|
+
* on their own schedule instead of holding a stream open.
|
|
7640
|
+
* The pass does not poll repeatedly or keep a connection alive.
|
|
7641
|
+
* Session admission may retry one classified pre-dispatch credential refusal.
|
|
7638
7642
|
*
|
|
7639
7643
|
* The pass resolves to the first of:
|
|
7640
7644
|
* 1. The completed-turn cache has `turnId` → `completed`, or `failed`
|
|
@@ -7659,7 +7663,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7659
7663
|
if (turn) return settleTurnDrive(turn.result);
|
|
7660
7664
|
const info = await this._sessionStatus(opts.sessionId);
|
|
7661
7665
|
const hasExplicitBackend = opts.backend !== void 0 || opts.model !== void 0;
|
|
7662
|
-
const backend = applyRequestedModel(
|
|
7666
|
+
const backend = applyRequestedModel(mergeRuntimeBackendConfig(this.defaultRuntimeBackend, opts.backend), opts.model);
|
|
7663
7667
|
if (info?.status === "queued" && hasExplicitBackend) await this.createSession({
|
|
7664
7668
|
sessionId: opts.sessionId,
|
|
7665
7669
|
...backend !== void 0 ? { backend } : {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as TerminalStreamReconnectAuthority, c as MintScopedTokenOptions, h as TerminalReadyInfo, l as ScopedToken, r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-
|
|
2
|
-
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-
|
|
3
|
-
import { $ as DurablePlanDecisionResult, A as CommitTaskSessionOptions, Ai as SnapshotInfo, B as CreateTaskSessionOptions, C as BranchOptions, Ci as SessionMessage, D as CodeExecutionResult, Di as SnapshotDeleteAcknowledgement, E as CodeExecutionOptions, Fn as ProvisionEvent, G as DispatchedSession, Gi as TeeAttestationResponse, Gr as SandboxResourceUsage, Gt as GitStatus, Ht as GitCommit, In as ProvisionResult, It as ForkCounts, J as DriveTurnOptions, Jn as RestoreSnapshotOptions, Jr as SandboxRuntimeHealth, Kt as GpuLease, Lt as ForkIdempotency, Mi as SnapshotResult, Mn as PromptInputPart, Nn as PromptOptions, O as CodeLanguage, On as ProcessManager, Pi as StartupDiagnostics, Pn as PromptResult, Q as DurablePlan, Qn as RolloutOptions, Ri as TaskSessionChanges, Rt as ForkLookupOptions, Si as SessionListOptions, Sn as PreviewLinkManager, Ti as SessionResultOptions, Ui as TeeAttestationOptions, Ur as SandboxPortBinding, Vi as TaskSessionInfo, Vr as SandboxInfo, Vt as GitBranch, W as DispatchPromptOptions, Wt as GitDiff, X as DriverInfo, Xi as TurnDriveResult, Xn as Rollout, Xr as SandboxTerminalAttachOptions, Yn as ResumeOptions, Yr as SandboxStatus, Zt as GpuLeaseManager, _n as NetworkManager, aa as WriteManyFile, ai as SandboxTraceOptions, an as IntelligenceReportCompareTo, at as EgressManager, bi as SessionInfo, bn as PermissionsManager, ci as SearchOptions, cn as JsonValue, cr as SandboxCreateReceipt, ct as EventStreamOptions, d as BackendConfig, di as SendSessionMessageOptions, dt as ExecResult, er as RolloutStartResult, fi as SendSessionMessageRequest, fr as SandboxEvent, gi as SessionExecutionInfo, hi as SessionEventStreamOptions, ia as WriteFileOptions, in as IntelligenceReportBudget, ir as SSHCredentials, j as CompletedTurnResult, ji as SnapshotOptions, jr as SandboxFleetTraceBundle, ln as ListMessagesOptions, lr as SandboxDeleteAcknowledgement, na as WaitForRolloutOptions, ni as SandboxTraceBundle, nn as InstalledTool, oa as WriteManyOptions, or as SandboxConnection, p as BackendManager, pi as SentSessionMessage, qi as TeePublicKeyResponse, qr as SandboxRuntimeCapabilities, ra as WorkspaceOperationLookup, rn as IntelligenceReport, rr as SSHCommandDescriptor, si as SearchMatch, sn as IntelligenceReportWindow, ta as WaitForOptions, ti as SandboxTerminals, ut as ExecOptions, vt as FileSystem, wt as FileWriteResult, xi as SessionInterruptOptions, yi as SessionForkOptions, z as CreateSessionOptions, zi as TaskSessionCommitResult } from "./types-
|
|
1
|
+
import { a as TerminalStreamReconnectAuthority, c as MintScopedTokenOptions, h as TerminalReadyInfo, l as ScopedToken, r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-CcaBTVg3.js";
|
|
2
|
+
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-BELrFH4f.js";
|
|
3
|
+
import { $ as DurablePlanDecisionResult, A as CommitTaskSessionOptions, Ai as SnapshotInfo, B as CreateTaskSessionOptions, C as BranchOptions, Ci as SessionMessage, D as CodeExecutionResult, Di as SnapshotDeleteAcknowledgement, E as CodeExecutionOptions, Fn as ProvisionEvent, G as DispatchedSession, Gi as TeeAttestationResponse, Gr as SandboxResourceUsage, Gt as GitStatus, Ht as GitCommit, In as ProvisionResult, It as ForkCounts, J as DriveTurnOptions, Jn as RestoreSnapshotOptions, Jr as SandboxRuntimeHealth, Kt as GpuLease, Lt as ForkIdempotency, Mi as SnapshotResult, Mn as PromptInputPart, Nn as PromptOptions, O as CodeLanguage, On as ProcessManager, Pi as StartupDiagnostics, Pn as PromptResult, Q as DurablePlan, Qn as RolloutOptions, Ri as TaskSessionChanges, Rt as ForkLookupOptions, Si as SessionListOptions, Sn as PreviewLinkManager, Ti as SessionResultOptions, Ui as TeeAttestationOptions, Ur as SandboxPortBinding, Vi as TaskSessionInfo, Vr as SandboxInfo, Vt as GitBranch, W as DispatchPromptOptions, Wt as GitDiff, X as DriverInfo, Xi as TurnDriveResult, Xn as Rollout, Xr as SandboxTerminalAttachOptions, Yn as ResumeOptions, Yr as SandboxStatus, Zt as GpuLeaseManager, _n as NetworkManager, aa as WriteManyFile, ai as SandboxTraceOptions, an as IntelligenceReportCompareTo, at as EgressManager, bi as SessionInfo, bn as PermissionsManager, ci as SearchOptions, cn as JsonValue, cr as SandboxCreateReceipt, ct as EventStreamOptions, d as BackendConfig, di as SendSessionMessageOptions, dt as ExecResult, er as RolloutStartResult, fi as SendSessionMessageRequest, fr as SandboxEvent, gi as SessionExecutionInfo, hi as SessionEventStreamOptions, ia as WriteFileOptions, in as IntelligenceReportBudget, ir as SSHCredentials, j as CompletedTurnResult, ji as SnapshotOptions, jr as SandboxFleetTraceBundle, ln as ListMessagesOptions, lr as SandboxDeleteAcknowledgement, na as WaitForRolloutOptions, ni as SandboxTraceBundle, nn as InstalledTool, oa as WriteManyOptions, or as SandboxConnection, p as BackendManager, pi as SentSessionMessage, qi as TeePublicKeyResponse, qr as SandboxRuntimeCapabilities, ra as WorkspaceOperationLookup, rn as IntelligenceReport, rr as SSHCommandDescriptor, si as SearchMatch, sn as IntelligenceReportWindow, ta as WaitForOptions, ti as SandboxTerminals, ut as ExecOptions, vt as FileSystem, wt as FileWriteResult, xi as SessionInterruptOptions, yi as SessionForkOptions, z as CreateSessionOptions, zi as TaskSessionCommitResult } from "./types-BZuZPQ0N.js";
|
|
4
4
|
import { AgentInteractiveSessionAttach, AgentInteractiveSessionControlClaim, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionControlClaimRequest, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentInteractiveSessionStopAcknowledgement, AgentInteractiveSessionStopCommand, AgentInteractiveTerminalSession, AgentInteractiveTerminalSession as AgentInteractiveTerminalSession$1, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, InteractionAcknowledgement, InteractionData, InteractionRequest, InteractionResponseCommand, TerminalOutputEvent, TerminalReplayWindow, agentInteractiveSessionPromptRequestDigest } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -142,13 +142,13 @@ declare const interactionResolutionAcknowledgementSchema: z.ZodObject<{
|
|
|
142
142
|
delivered: z.ZodBoolean;
|
|
143
143
|
resolvedAt: z.ZodString;
|
|
144
144
|
binding: z.ZodOptional<z.ZodObject<{
|
|
145
|
-
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
146
145
|
runId: z.ZodString;
|
|
147
146
|
provider: z.ZodString;
|
|
148
147
|
environmentId: z.ZodString;
|
|
149
148
|
sessionId: z.ZodString;
|
|
150
149
|
executionId: z.ZodString;
|
|
151
150
|
interactionId: z.ZodString;
|
|
151
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
152
152
|
}, z.core.$strict>>;
|
|
153
153
|
}, z.core.$strict>;
|
|
154
154
|
type InteractionResolutionAcknowledgement = z.infer<typeof interactionResolutionAcknowledgementSchema>;
|
|
@@ -1721,7 +1721,7 @@ declare class SandboxInstance {
|
|
|
1721
1721
|
* {@link startupDiagnostics} returns it for post-mortem reads on the
|
|
1722
1722
|
* now-gone sandbox.
|
|
1723
1723
|
*/
|
|
1724
|
-
delete(): Promise<SandboxDeleteAcknowledgement>;
|
|
1724
|
+
delete(options?: Pick<ResumeOptions, "signal">): Promise<SandboxDeleteAcknowledgement>;
|
|
1725
1725
|
/**
|
|
1726
1726
|
* Read a lifecycle response body once.
|
|
1727
1727
|
*
|
|
@@ -1942,9 +1942,9 @@ declare class SandboxInstance {
|
|
|
1942
1942
|
* Drive a detached turn forward by exactly one settle → poll → dispatch
|
|
1943
1943
|
* pass and report where it stands. Built for tick-based callers —
|
|
1944
1944
|
* Cloudflare Workflows steps, queue consumers, crons — that re-invoke
|
|
1945
|
-
* on their own schedule instead of holding a stream open.
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1945
|
+
* on their own schedule instead of holding a stream open.
|
|
1946
|
+
* The pass does not poll repeatedly or keep a connection alive.
|
|
1947
|
+
* Session admission may retry one classified pre-dispatch credential refusal.
|
|
1948
1948
|
*
|
|
1949
1949
|
* The pass resolves to the first of:
|
|
1950
1950
|
* 1. The completed-turn cache has `turnId` → `completed`, or `failed`
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TangleSandboxClientConfig, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../index-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TangleSandboxClientConfig, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../index-hYNUMvGr.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as JsonResponseParamTypes, d as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as SandboxCreateParamTypes, n as JOB_SANDBOX_CREATE, o as AgentSandboxBlueprintAbi, r as JOB_SANDBOX_DELETE, s as ITangleJobsAbi, t as TangleSandboxClient, u as SandboxCreateResponseParamTypes } from "../tangle-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as JsonResponseParamTypes, d as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as SandboxCreateParamTypes, n as JOB_SANDBOX_CREATE, o as AgentSandboxBlueprintAbi, r as JOB_SANDBOX_DELETE, s as ITangleJobsAbi, t as TangleSandboxClient, u as SandboxCreateResponseParamTypes } from "../tangle-Dn2pS3TZ.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as parseErrorResponse } from "./errors-
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
1
|
+
import { h as parseErrorResponse } from "./errors-V6uPkjfJ.js";
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-BFZa_Gx-.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-
|
|
1
|
+
import { r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-CcaBTVg3.js";
|
|
2
2
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
3
|
-
import { AgentExactRunControlRef, AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileValidationResult, HarnessType, ReasoningEffort } from "@tangle-network/agent-interface";
|
|
3
|
+
import { AgentExactRunControlRef, AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileValidationResult, AgentRuntimeAttachments, HarnessType, ReasoningEffort } from "@tangle-network/agent-interface";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region ../../../packages/runtime-contracts/dist/backend-types.d.ts
|
|
@@ -1515,12 +1515,14 @@ interface CreateSandboxOptions {
|
|
|
1515
1515
|
/** Environment variables injected into the sandbox */
|
|
1516
1516
|
env?: Record<string, string>;
|
|
1517
1517
|
/**
|
|
1518
|
-
* Maximum
|
|
1518
|
+
* Maximum continuous runtime in seconds for each create or resume interval.
|
|
1519
1519
|
*
|
|
1520
1520
|
* On expiry the sandbox is SUSPENDED, not deleted: the container stops and
|
|
1521
1521
|
* the workspace is preserved, with a best-effort pre-suspend snapshot when
|
|
1522
1522
|
* the platform has snapshots enabled. It can be resumed for as long as it
|
|
1523
|
-
* stays suspended
|
|
1523
|
+
* stays suspended. Resume starts a new runtime interval with the same limit;
|
|
1524
|
+
* reads, connections, and activity do not extend that interval.
|
|
1525
|
+
* Once the cold window also elapses (6 hours by default)
|
|
1524
1526
|
* the container is reclaimed, and bringing the preserved workspace back is
|
|
1525
1527
|
* a re-provision against the same ref rather than a resume. Drivers with a
|
|
1526
1528
|
* create/delete-only lifecycle (`driver: "tangle"`) skip the suspend
|
|
@@ -2192,6 +2194,8 @@ interface ExecResult {
|
|
|
2192
2194
|
* The command inherits the sandbox runtime environment.
|
|
2193
2195
|
*/
|
|
2194
2196
|
interface ExecOptions {
|
|
2197
|
+
/** Cancel readiness checks and the command request; the server timeout still bounds the process. */
|
|
2198
|
+
signal?: AbortSignal;
|
|
2195
2199
|
/** Working directory for the command. It must resolve within the active
|
|
2196
2200
|
* workspace; paths outside that boundary are rejected. When `sessionId`
|
|
2197
2201
|
* is set, the runtime resolves the path against that task's isolated
|
|
@@ -2537,6 +2541,8 @@ interface PromptOptions {
|
|
|
2537
2541
|
*
|
|
2538
2542
|
* Set `backend.model` for a model override and `backend.profile` for an
|
|
2539
2543
|
* inline provider-neutral `AgentProfile`.
|
|
2544
|
+
* Same-runtime overrides retain unspecified defaults. Changing the harness,
|
|
2545
|
+
* provider, or base URL replaces the default backend configuration.
|
|
2540
2546
|
*/
|
|
2541
2547
|
backend?: Partial<BackendConfig>;
|
|
2542
2548
|
/** Timeout in milliseconds */
|
|
@@ -4600,6 +4606,8 @@ interface McpServerConfig {
|
|
|
4600
4606
|
* ```
|
|
4601
4607
|
*/
|
|
4602
4608
|
interface BackendConfig {
|
|
4609
|
+
/** Runtime MCP bindings, separate from the authored profile. Headers may use secret references. */
|
|
4610
|
+
runtimeAttachments?: AgentRuntimeAttachments;
|
|
4603
4611
|
/** Backend type identifier. Defaults to the platform's configured backend. */
|
|
4604
4612
|
type?: BackendType;
|
|
4605
4613
|
/**
|
|
@@ -6045,8 +6053,9 @@ interface FileSystem {
|
|
|
6045
6053
|
search(query: string, options?: SearchOptions): AsyncIterable<SearchMatch>;
|
|
6046
6054
|
/**
|
|
6047
6055
|
* Upload a local file to the sandbox.
|
|
6048
|
-
*
|
|
6056
|
+
* Uses checksum-verified chunked upload through gateway or direct connections.
|
|
6049
6057
|
* Creates parent directories as needed.
|
|
6058
|
+
* The upload session limit also applies to local files.
|
|
6050
6059
|
*
|
|
6051
6060
|
* @param localPath - Path to local file
|
|
6052
6061
|
* @param remotePath - Destination path in sandbox
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.1-develop.20260912191433.b31d83f",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"@tangle-network/agent-core": "^0.9.6",
|
|
99
|
-
"@tangle-network/agent-interface": "^2.
|
|
99
|
+
"@tangle-network/agent-interface": "^2.6.1",
|
|
100
100
|
"zod": "4.5.4"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
@@ -135,10 +135,11 @@
|
|
|
135
135
|
"vitest": "^4.1.5",
|
|
136
136
|
"ws": "^8.20.0",
|
|
137
137
|
"yjs": "13.6.30",
|
|
138
|
-
"@tangle-network/
|
|
138
|
+
"@tangle-network/agent-profile-materialize": "0.20.0",
|
|
139
139
|
"@repo/shared": "0.0.0",
|
|
140
|
-
"@tangle-network/
|
|
141
|
-
"@tangle-network/
|
|
140
|
+
"@tangle-network/sse-core": "0.0.0",
|
|
141
|
+
"@tangle-network/runtime-contracts": "0.6.6",
|
|
142
|
+
"@tangle-network/cli-agent-registry": "0.4.0"
|
|
142
143
|
},
|
|
143
144
|
"scripts": {
|
|
144
145
|
"build": "node scripts/build-dist.mjs",
|
|
File without changes
|
|
File without changes
|