@tangle-network/sandbox 0.30.2-develop.20260820100122.dc85046 → 0.30.2-develop.20260820200640.75917

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.
Files changed (35) hide show
  1. package/README.md +1 -0
  2. package/dist/abort-signal-si1WMfJb.js +31 -0
  3. package/dist/agent/index.d.ts +3 -3
  4. package/dist/agent/index.js +3 -3
  5. package/dist/{agent-run-outcome-TwIC-Ccd.d.ts → agent-run-outcome-CM7xD7Mg.d.ts} +1 -1
  6. package/dist/auth/index.d.ts +1 -1
  7. package/dist/browser-interactive-control-controller-B476gcui.d.ts +96 -0
  8. package/dist/browser-interactive-control-controller-wXQ7W5pT.js +276 -0
  9. package/dist/{client-CCKEVUaD.js → client-BfnJ44gF.js} +19 -6
  10. package/dist/{client-1OK1sjCh.d.ts → client-Do_HS671.d.ts} +20 -3
  11. package/dist/collaboration/index.d.ts +1 -1
  12. package/dist/collaboration/index.js +1 -1
  13. package/dist/core.d.ts +4 -4
  14. package/dist/core.js +2 -2
  15. package/dist/{index-DAxioMfr.d.ts → index-ebsVOlUc.d.ts} +2 -2
  16. package/dist/index.d.ts +11 -9
  17. package/dist/index.js +7 -6
  18. package/dist/interactive-control.d.ts +2 -0
  19. package/dist/interactive-control.js +2 -0
  20. package/dist/{runtime-api-TVLbV10b.js → runtime-api-B0tx7NJM.js} +2 -6
  21. package/dist/runtime.d.ts +3 -3
  22. package/dist/runtime.js +2 -1
  23. package/dist/{sandbox-DM-VD8ja.js → sandbox-AUHcCJe1.js} +1418 -565
  24. package/dist/{sandbox-Caev7isY.d.ts → sandbox-Cr-4qzaA.d.ts} +134 -187
  25. package/dist/tangle/index.d.ts +1 -1
  26. package/dist/tangle/index.js +1 -1
  27. package/dist/{tangle-lzUyvhKp.js → tangle-iDk_s8vt.js} +1 -1
  28. package/dist/terminal-stream-4KNJ6SmL.d.ts +256 -0
  29. package/dist/{types-D_ykdqn6.d.ts → types-BwYLVqxX.d.ts} +14 -250
  30. package/package.json +9 -4
  31. /package/dist/{collaboration-COCXdRrk.js → collaboration-DQD9kCdN.js} +0 -0
  32. /package/dist/{errors-Bdy5jXzc.d.ts → errors-CQOvGddH.d.ts} +0 -0
  33. /package/dist/{index-DtRFVx5U.d.ts → index-Bq_z_u6A.d.ts} +0 -0
  34. /package/dist/{index-Cp1KYanB.d.ts → index-CMLW3u5K.d.ts} +0 -0
  35. /package/dist/{local-cli-auth-D4u7fsnH.js → local-cli-auth-CJmSpTjk.js} +0 -0
package/README.md CHANGED
@@ -23,6 +23,7 @@ export SANDBOX_BASE_URL=https://sandbox.tangle.tools
23
23
  | Full client, sandboxes, fleets, images, sessions, and trace utilities | `@tangle-network/sandbox` |
24
24
  | Edge-safe client without `viem` | `@tangle-network/sandbox/core` |
25
25
  | Browser or Worker access with a short-lived scoped token | `@tangle-network/sandbox/runtime` |
26
+ | Browser status, claim, and release control for an interactive session | `@tangle-network/sandbox/interactive-control` |
26
27
  | Direct Tangle chain operations | `@tangle-network/sandbox/tangle` |
27
28
  | Server-side token issuance and validation | `@tangle-network/sandbox/auth` |
28
29
  | Collaborative document clients and file bridging | `@tangle-network/sandbox/collaboration` |
@@ -0,0 +1,31 @@
1
+ //#region src/lib/abort-signal.ts
2
+ function combineAbortSignals(signals) {
3
+ return AbortSignal.any(signals);
4
+ }
5
+ function awaitWithAbort(work, signal) {
6
+ if (!signal) return work;
7
+ signal.throwIfAborted();
8
+ return new Promise((resolve, reject) => {
9
+ let settled = false;
10
+ const onAbort = () => {
11
+ if (settled) return;
12
+ settled = true;
13
+ signal.removeEventListener("abort", onAbort);
14
+ reject(signal.reason ?? new DOMException("The request was aborted", "AbortError"));
15
+ };
16
+ signal.addEventListener("abort", onAbort, { once: true });
17
+ work.then((value) => {
18
+ if (settled) return;
19
+ settled = true;
20
+ signal.removeEventListener("abort", onAbort);
21
+ resolve(value);
22
+ }, (cause) => {
23
+ if (settled) return;
24
+ settled = true;
25
+ signal.removeEventListener("abort", onAbort);
26
+ reject(cause);
27
+ });
28
+ });
29
+ }
30
+ //#endregion
31
+ export { combineAbortSignals as n, awaitWithAbort as t };
@@ -1,6 +1,6 @@
1
- import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-Caev7isY.js";
2
- import { D as CodeResultPart, E as CodeLanguage, T as CodeExecutionResult, d as BackendConfig, w as CodeExecutionOptions, xi as SessionListOptions, yi as SessionInfo } from "../types-D_ykdqn6.js";
3
- import { i as Sandbox } from "../client-1OK1sjCh.js";
1
+ import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-Cr-4qzaA.js";
2
+ import { D as CodeResultPart, E as CodeLanguage, T as CodeExecutionResult, d as BackendConfig, gi as SessionInfo, vi as SessionListOptions, w as CodeExecutionOptions } from "../types-BwYLVqxX.js";
3
+ import { i as Sandbox } from "../client-Do_HS671.js";
4
4
  import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
5
5
 
6
6
  //#region src/agent/instances.d.ts
@@ -1,7 +1,7 @@
1
- import { f as assertCurrentBackendType } from "../runtime-api-TVLbV10b.js";
1
+ import { d as assertCurrentBackendType } from "../runtime-api-B0tx7NJM.js";
2
2
  import { d as StateError, o as NotFoundError, p as ValidationError } from "../errors-C6kn-3zt.js";
3
- import { n as Sandbox } from "../client-CCKEVUaD.js";
4
- import { t as SandboxInstance } from "../sandbox-DM-VD8ja.js";
3
+ import { n as Sandbox } from "../client-BfnJ44gF.js";
4
+ import { t as SandboxInstance } from "../sandbox-AUHcCJe1.js";
5
5
  import { createRequire } from "node:module";
6
6
  //#region src/agent/instances.ts
7
7
  const managers = /* @__PURE__ */ new WeakMap();
@@ -1,4 +1,4 @@
1
- import { Q as DurablePlanSnapshot, a as AgentQuestionRequest, dr as SandboxEvent, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation } from "./types-D_ykdqn6.js";
1
+ import { Q as DurablePlanSnapshot, a as AgentQuestionRequest, i as AgentApprovalRequirement, o as AgentRunStatus, s as AgentToolInvocation, ur as SandboxEvent } from "./types-BwYLVqxX.js";
2
2
  import { InteractionRequest } from "@tangle-network/agent-interface";
3
3
 
4
4
  //#region src/agent-run-outcome.d.ts
@@ -1,2 +1,2 @@
1
- import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-DtRFVx5U.js";
1
+ import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-Bq_z_u6A.js";
2
2
  export { AnyTokenPayload, BatchScopedTokenPayload, CollaborationAccess, CollaborationTokenPayload, IssueCollaborationTokenOptions, ProductTokenIssuer, ProjectScopedTokenPayload, ReadTokenPayload, SessionScopedTokenPayload, TokenScope, getTokenTTL, isTokenExpiringSoon, issueBatchScopedToken, issueCollaborationToken, issueProjectScopedToken, issueReadToken, issueSessionScopedToken, unsafeDecodeToken, verifyToken };
@@ -0,0 +1,96 @@
1
+ import { r as TerminalStreamHandlers } from "./terminal-stream-4KNJ6SmL.js";
2
+ import { AgentInteractiveSessionAttach, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionStatus } from "@tangle-network/agent-interface";
3
+ import { AgentInteractiveSessionControlClaim as AgentInteractiveSessionControlClaim$1, AgentInteractiveSessionControlClaimRequest as AgentInteractiveSessionControlClaimRequest$1, AgentInteractiveSessionRef as AgentInteractiveSessionRef$1 } from "@tangle-network/agent-interface/environment-interactive-control";
4
+
5
+ //#region src/interactive-types.d.ts
6
+ /** Cancellation for an interactive SDK request. */
7
+ interface InteractiveRequestOptions {
8
+ signal?: AbortSignal;
9
+ }
10
+ /** Cancellation for a control-claim request. */
11
+ type InteractiveControlClaimOptions = InteractiveRequestOptions;
12
+ /** Exact attach command after the controller has claimed control. */
13
+ type InteractiveAttachOptions = AgentInteractiveSessionAttach & {
14
+ handlers?: TerminalStreamHandlers;
15
+ };
16
+ /** Published Interface control-claim acknowledgement. */
17
+ type InteractiveControlClaimAcknowledgement = AgentInteractiveSessionControlClaimAcknowledgement;
18
+ /** Provider-observed status without write authority. */
19
+ type InteractiveSessionStatus = AgentInteractiveSessionStatus;
20
+ //#endregion
21
+ //#region src/interactive-control-controller.d.ts
22
+ /** The exact identity needed to control one admitted interactive process. */
23
+ interface InteractiveSessionIdentity {
24
+ ref: AgentInteractiveSessionRef$1;
25
+ control: AgentInteractiveSessionControlClaim$1;
26
+ }
27
+ /** Transport for the status, claim, and release control operations. */
28
+ interface InteractiveSessionControlTransport {
29
+ status(sessionId: string, incarnationId: string, options?: InteractiveRequestOptions): Promise<InteractiveSessionStatus | null>;
30
+ claimControl(sessionId: string, request: AgentInteractiveSessionControlClaimRequest$1, options?: InteractiveRequestOptions): Promise<InteractiveControlClaimAcknowledgement>;
31
+ releaseControl(sessionId: string, ref: AgentInteractiveSessionRef$1, control: AgentInteractiveSessionControlClaim$1, options?: InteractiveRequestOptions): Promise<void>;
32
+ }
33
+ /** Maximum time spent on bounded claim recovery and release cleanup. */
34
+ declare const INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS = 5000;
35
+ interface InteractiveSessionControlControllerOptions {
36
+ sessionId: string;
37
+ incarnationId: string;
38
+ holderId: string;
39
+ /** Check that the provider identity belongs to the expected environment. */
40
+ environmentId?: string;
41
+ /** Injectable only for deterministic callers and tests. */
42
+ operationIdFactory?: () => string;
43
+ /** Bound cleanup requests when a transport ignores AbortSignal. */
44
+ cleanupTimeoutMs?: number;
45
+ }
46
+ /** Create a holder id for one in-memory interactive controller. */
47
+ declare function createInteractiveControlHolderId(prefix?: string): string;
48
+ /**
49
+ * Own the one status → claim → release sequence shared by browser and SDK callers.
50
+ *
51
+ * This module deliberately has no terminal or WebSocket dependency. Attach-capable
52
+ * callers extend it with the stream operation after a claim has been resolved.
53
+ */
54
+ declare class InteractiveSessionControlController {
55
+ protected readonly transport: InteractiveSessionControlTransport;
56
+ protected readonly options: InteractiveSessionControlControllerOptions;
57
+ private readonly operationIdFactory;
58
+ private readonly cleanupTimeoutMs;
59
+ private resolveInFlight?;
60
+ constructor(transport: InteractiveSessionControlTransport, options: InteractiveSessionControlControllerOptions);
61
+ protected safelyReleaseClaim(identity: InteractiveSessionIdentity): Promise<void>;
62
+ /**
63
+ * Recover a claim whose response or commit may have been lost or corrupted.
64
+ *
65
+ * The same operation id and digest make this replay idempotent. Recovery uses
66
+ * an independent bounded signal so caller abort cannot strand an invisible claim.
67
+ */
68
+ private recoverAmbiguousClaim;
69
+ /** Release one claim that this controller resolved. */
70
+ release(identity: InteractiveSessionIdentity, requestOptions?: InteractiveRequestOptions): Promise<void>;
71
+ /** Observe and claim the current exact process incarnation. */
72
+ resolve(requestOptions?: InteractiveRequestOptions): Promise<InteractiveSessionIdentity>;
73
+ private resolveInternal;
74
+ /** Expose the canonical ref digest used by persisted control identities. */
75
+ static identityDigest(identity: InteractiveSessionIdentity): string;
76
+ }
77
+ /** Expose the same digest used to bind persistence and control identities. */
78
+ declare function interactiveSessionIdentityDigest(identity: InteractiveSessionIdentity): string;
79
+ //#endregion
80
+ //#region src/browser-interactive-control-controller.d.ts
81
+ interface BrowserInteractiveSessionControlControllerOptions extends InteractiveSessionControlControllerOptions {
82
+ sessionApiUrl: string;
83
+ token: string;
84
+ fetchImpl?: typeof fetch;
85
+ }
86
+ /** Browser controller for status, claim, and release without terminal attach. */
87
+ declare class BrowserInteractiveSessionControlController extends InteractiveSessionControlController {
88
+ constructor(options: BrowserInteractiveSessionControlControllerOptions);
89
+ }
90
+ /**
91
+ * Return one stable browser holder per exact sandbox process incarnation.
92
+ * Storage failures produce a new holder and never reuse persisted authority.
93
+ */
94
+ declare function browserInteractiveControlHolderId(environmentId: string, sessionId: string, incarnationId: string): string;
95
+ //#endregion
96
+ export { InteractiveSessionControlController as a, InteractiveSessionIdentity as c, InteractiveAttachOptions as d, InteractiveControlClaimAcknowledgement as f, InteractiveSessionStatus as h, INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS as i, createInteractiveControlHolderId as l, InteractiveRequestOptions as m, BrowserInteractiveSessionControlControllerOptions as n, InteractiveSessionControlControllerOptions as o, InteractiveControlClaimOptions as p, browserInteractiveControlHolderId as r, InteractiveSessionControlTransport as s, BrowserInteractiveSessionControlController as t, interactiveSessionIdentityDigest as u };
@@ -0,0 +1,276 @@
1
+ import { t as awaitWithAbort } from "./abort-signal-si1WMfJb.js";
2
+ import { z } from "zod";
3
+ import { AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimRequestSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionControlClaimRequestDigest } from "@tangle-network/agent-interface/environment-interactive-control";
4
+ //#region ../../../packages/runtime-contracts/dist/interactive-session-control-http.js
5
+ const interactiveSessionStatusResponseSchema = z.object({
6
+ success: z.literal(true),
7
+ data: z.object({ status: AgentInteractiveSessionStatusSchema }).strict()
8
+ }).strict();
9
+ const interactiveSessionControlClaimResponseSchema = z.object({
10
+ success: z.literal(true),
11
+ data: AgentInteractiveSessionControlClaimAcknowledgementSchema
12
+ }).strict();
13
+ const interactiveSessionControlReleaseBodySchema = z.object({
14
+ ref: AgentInteractiveSessionRefSchema,
15
+ control: AgentInteractiveSessionControlClaimSchema
16
+ }).strict();
17
+ const interactiveSessionControlReleaseResponseSchema = z.object({
18
+ success: z.literal(true),
19
+ data: z.object({ status: z.enum([
20
+ "released",
21
+ "already-released",
22
+ "absent"
23
+ ]) }).strict()
24
+ }).strict();
25
+ //#endregion
26
+ //#region src/interactive-control-controller.ts
27
+ /** Maximum time spent on bounded claim recovery and release cleanup. */
28
+ const INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS = 5e3;
29
+ function randomId(prefix) {
30
+ const cryptoApi = globalThis.crypto;
31
+ if (cryptoApi && typeof cryptoApi.randomUUID === "function") return `${prefix}-${cryptoApi.randomUUID()}`;
32
+ return `${prefix}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
33
+ }
34
+ /** Create a holder id for one in-memory interactive controller. */
35
+ function createInteractiveControlHolderId(prefix = "interactive") {
36
+ return randomId(prefix);
37
+ }
38
+ function assertInteractiveSessionRef(ref, options) {
39
+ if (ref.run.sessionId !== options.sessionId || ref.incarnationId !== options.incarnationId || options.environmentId !== void 0 && ref.run.environmentId !== options.environmentId) throw new Error("Interactive session identity does not match this sandbox");
40
+ }
41
+ function assertActiveControlClaim(control) {
42
+ const expiresAt = Date.parse(control.expiresAt);
43
+ if (!Number.isFinite(expiresAt) || expiresAt <= Date.now()) throw new Error("Interactive control claim is stale");
44
+ }
45
+ function createCleanupScope(timeoutMs) {
46
+ const controller = new AbortController();
47
+ const timer = setTimeout(() => {
48
+ controller.abort(new DOMException(`Interactive control cleanup timed out after ${timeoutMs}ms`, "TimeoutError"));
49
+ }, timeoutMs);
50
+ return {
51
+ signal: controller.signal,
52
+ dispose: () => clearTimeout(timer)
53
+ };
54
+ }
55
+ function claimAcknowledgementMatchesRequest(ref, request, acknowledgement) {
56
+ if (!agentInteractiveSessionControlClaimAcknowledgementMatchesRequest(request, acknowledgement)) return false;
57
+ if (acknowledgement.status !== "accepted" && acknowledgement.status !== "replayed") return true;
58
+ return acknowledgement.control !== void 0 && agentInteractiveSessionControlClaimMatchesRef(ref, acknowledgement.control) && acknowledgement.control.holderId === request.holderId;
59
+ }
60
+ /**
61
+ * Own the one status → claim → release sequence shared by browser and SDK callers.
62
+ *
63
+ * This module deliberately has no terminal or WebSocket dependency. Attach-capable
64
+ * callers extend it with the stream operation after a claim has been resolved.
65
+ */
66
+ var InteractiveSessionControlController = class {
67
+ operationIdFactory;
68
+ cleanupTimeoutMs;
69
+ resolveInFlight;
70
+ constructor(transport, options) {
71
+ this.transport = transport;
72
+ this.options = options;
73
+ this.operationIdFactory = options.operationIdFactory ?? (() => randomId("interactive-claim"));
74
+ this.cleanupTimeoutMs = options.cleanupTimeoutMs ?? 5e3;
75
+ if (!Number.isFinite(this.cleanupTimeoutMs) || this.cleanupTimeoutMs <= 0) throw new RangeError("Interactive control cleanup timeout must be greater than zero");
76
+ }
77
+ async safelyReleaseClaim(identity) {
78
+ const cleanupScope = createCleanupScope(this.cleanupTimeoutMs);
79
+ try {
80
+ await awaitWithAbort(this.release(identity, { signal: cleanupScope.signal }), cleanupScope.signal);
81
+ } catch {} finally {
82
+ cleanupScope.dispose();
83
+ }
84
+ }
85
+ /**
86
+ * Recover a claim whose response or commit may have been lost or corrupted.
87
+ *
88
+ * The same operation id and digest make this replay idempotent. Recovery uses
89
+ * an independent bounded signal so caller abort cannot strand an invisible claim.
90
+ */
91
+ async recoverAmbiguousClaim(ref, request) {
92
+ const cleanupScope = createCleanupScope(this.cleanupTimeoutMs);
93
+ try {
94
+ const acknowledgement = AgentInteractiveSessionControlClaimAcknowledgementSchema.parse(await awaitWithAbort(this.transport.claimControl(this.options.sessionId, request, { signal: cleanupScope.signal }), cleanupScope.signal));
95
+ if ((acknowledgement.status === "accepted" || acknowledgement.status === "replayed") && acknowledgement.control !== void 0 && claimAcknowledgementMatchesRequest(ref, request, acknowledgement) && agentInteractiveSessionControlClaimMatchesRef(ref, acknowledgement.control)) await this.safelyReleaseClaim({
96
+ ref,
97
+ control: acknowledgement.control
98
+ });
99
+ } catch {} finally {
100
+ cleanupScope.dispose();
101
+ }
102
+ }
103
+ /** Release one claim that this controller resolved. */
104
+ async release(identity, requestOptions) {
105
+ requestOptions?.signal?.throwIfAborted();
106
+ const exactRef = AgentInteractiveSessionRefSchema.parse(identity.ref);
107
+ assertInteractiveSessionRef(exactRef, this.options);
108
+ if (!agentInteractiveSessionControlClaimMatchesRef(exactRef, identity.control)) throw new Error("Interactive control claim is not bound to the session");
109
+ await this.transport.releaseControl(this.options.sessionId, exactRef, identity.control, requestOptions);
110
+ }
111
+ /** Observe and claim the current exact process incarnation. */
112
+ async resolve(requestOptions) {
113
+ requestOptions?.signal?.throwIfAborted();
114
+ if (this.resolveInFlight !== void 0) return await awaitWithAbort(this.resolveInFlight, requestOptions?.signal);
115
+ const operation = this.resolveInternal(requestOptions);
116
+ let tracked;
117
+ tracked = operation.finally(() => {
118
+ if (this.resolveInFlight === tracked) this.resolveInFlight = void 0;
119
+ });
120
+ this.resolveInFlight = tracked;
121
+ return await tracked;
122
+ }
123
+ async resolveInternal(requestOptions) {
124
+ let claimedIdentity;
125
+ try {
126
+ requestOptions?.signal?.throwIfAborted();
127
+ const status = await this.transport.status(this.options.sessionId, this.options.incarnationId, requestOptions);
128
+ requestOptions?.signal?.throwIfAborted();
129
+ if (!status || status.state !== "running") throw new Error("Interactive session is not running or has stale identity");
130
+ const ref = AgentInteractiveSessionRefSchema.parse(status.ref);
131
+ assertInteractiveSessionRef(ref, this.options);
132
+ let expectedGeneration = 1;
133
+ for (let attempt = 0; attempt < 2; attempt += 1) {
134
+ requestOptions?.signal?.throwIfAborted();
135
+ const material = {
136
+ operationId: this.operationIdFactory(),
137
+ ref,
138
+ holderId: this.options.holderId,
139
+ expectedGeneration
140
+ };
141
+ const request = AgentInteractiveSessionControlClaimRequestSchema.parse({
142
+ ...material,
143
+ requestDigest: agentInteractiveSessionControlClaimRequestDigest(material)
144
+ });
145
+ let acknowledgement;
146
+ try {
147
+ acknowledgement = AgentInteractiveSessionControlClaimAcknowledgementSchema.parse(await this.transport.claimControl(this.options.sessionId, request, requestOptions));
148
+ } catch (error) {
149
+ await this.recoverAmbiguousClaim(ref, request);
150
+ throw error;
151
+ }
152
+ if (!claimAcknowledgementMatchesRequest(ref, request, acknowledgement)) {
153
+ await this.recoverAmbiguousClaim(ref, request);
154
+ throw new Error("Interactive control claim acknowledgement does not match the request");
155
+ }
156
+ if ((acknowledgement.status === "accepted" || acknowledgement.status === "replayed") && acknowledgement.control) {
157
+ if (!agentInteractiveSessionControlClaimMatchesRef(ref, acknowledgement.control)) throw new Error("Interactive control claim is not bound to the session");
158
+ claimedIdentity = {
159
+ ref,
160
+ control: acknowledgement.control
161
+ };
162
+ requestOptions?.signal?.throwIfAborted();
163
+ assertActiveControlClaim(acknowledgement.control);
164
+ return claimedIdentity;
165
+ }
166
+ requestOptions?.signal?.throwIfAborted();
167
+ if (acknowledgement.status === "conflict" && acknowledgement.conflictReason === "generation_mismatch" && acknowledgement.currentGeneration !== void 0 && acknowledgement.currentGeneration > expectedGeneration) {
168
+ expectedGeneration = acknowledgement.currentGeneration;
169
+ continue;
170
+ }
171
+ throw new Error(acknowledgement.message ?? "Interactive control is held by another client");
172
+ }
173
+ throw new Error("Interactive control claim became stale during attach");
174
+ } catch (error) {
175
+ if (claimedIdentity !== void 0) await this.safelyReleaseClaim(claimedIdentity);
176
+ throw error;
177
+ }
178
+ }
179
+ /** Expose the canonical ref digest used by persisted control identities. */
180
+ static identityDigest(identity) {
181
+ const ref = AgentInteractiveSessionRefSchema.parse(identity.ref);
182
+ const control = AgentInteractiveSessionControlClaimSchema.parse(identity.control);
183
+ if (!agentInteractiveSessionControlClaimMatchesRef(ref, control)) throw new Error("Interactive control claim is not bound to the session");
184
+ return control.refDigest;
185
+ }
186
+ };
187
+ /** Expose the same digest used to bind persistence and control identities. */
188
+ function interactiveSessionIdentityDigest(identity) {
189
+ return InteractiveSessionControlController.identityDigest(identity);
190
+ }
191
+ //#endregion
192
+ //#region src/browser-interactive-control-controller.ts
193
+ function browserInteractiveSessionEndpoint(baseUrl, sessionId, suffix = "") {
194
+ return `${baseUrl.replace(/\/+$/, "")}/agents/sessions/${encodeURIComponent(sessionId)}/interactive${suffix}`;
195
+ }
196
+ function browserInteractiveTerminalEndpoint(baseUrl, sessionId) {
197
+ return `${baseUrl.replace(/\/+$/, "")}/terminals/${encodeURIComponent(sessionId)}/ws`;
198
+ }
199
+ function authHeaders(token, includeContentType = false) {
200
+ return {
201
+ Authorization: `Bearer ${token}`,
202
+ ...includeContentType ? { "Content-Type": "application/json" } : {}
203
+ };
204
+ }
205
+ async function readError(response) {
206
+ if (response.status === 404) return /* @__PURE__ */ new Error("Interactive session identity is stale or no longer exists");
207
+ return /* @__PURE__ */ new Error(`Interactive session request failed (${response.status})`);
208
+ }
209
+ function createBrowserInteractiveSessionControlTransport(options) {
210
+ const fetchImpl = options.fetchImpl ?? globalThis.fetch;
211
+ if (typeof fetchImpl !== "function") throw new Error("Interactive browser controller requires fetch");
212
+ return {
213
+ async status(sessionId, incarnationId, requestOptions) {
214
+ const response = await fetchImpl(`${browserInteractiveSessionEndpoint(options.sessionApiUrl, sessionId)}?incarnationId=${encodeURIComponent(incarnationId)}`, {
215
+ headers: authHeaders(options.token),
216
+ ...requestOptions?.signal === void 0 ? {} : { signal: requestOptions.signal }
217
+ });
218
+ if (response.status === 404) return null;
219
+ if (!response.ok) throw await readError(response);
220
+ const parsed = interactiveSessionStatusResponseSchema.safeParse(await response.json());
221
+ if (!parsed.success) throw new Error("Interactive session is not running or has stale identity");
222
+ return parsed.data.data.status;
223
+ },
224
+ async claimControl(sessionId, request, requestOptions) {
225
+ const response = await fetchImpl(browserInteractiveSessionEndpoint(options.sessionApiUrl, sessionId, "/control"), {
226
+ method: "POST",
227
+ headers: authHeaders(options.token, true),
228
+ body: JSON.stringify(request),
229
+ ...requestOptions?.signal === void 0 ? {} : { signal: requestOptions.signal }
230
+ });
231
+ if (!response.ok) throw await readError(response);
232
+ const parsed = interactiveSessionControlClaimResponseSchema.safeParse(await response.json());
233
+ if (!parsed.success) throw new Error("Interactive control claim response is invalid");
234
+ return parsed.data.data;
235
+ },
236
+ async releaseControl(sessionId, ref, control, requestOptions) {
237
+ const body = interactiveSessionControlReleaseBodySchema.parse({
238
+ ref,
239
+ control
240
+ });
241
+ const response = await fetchImpl(browserInteractiveSessionEndpoint(options.sessionApiUrl, sessionId, "/control/release"), {
242
+ method: "POST",
243
+ headers: authHeaders(options.token, true),
244
+ body: JSON.stringify(body),
245
+ ...requestOptions?.signal === void 0 ? {} : { signal: requestOptions.signal }
246
+ });
247
+ if (!response.ok) throw await readError(response);
248
+ if (!interactiveSessionControlReleaseResponseSchema.safeParse(await response.json()).success) throw new Error("Interactive control release response is invalid");
249
+ }
250
+ };
251
+ }
252
+ /** Browser controller for status, claim, and release without terminal attach. */
253
+ var BrowserInteractiveSessionControlController = class extends InteractiveSessionControlController {
254
+ constructor(options) {
255
+ super(createBrowserInteractiveSessionControlTransport(options), options);
256
+ }
257
+ };
258
+ /**
259
+ * Return one stable browser holder per exact sandbox process incarnation.
260
+ * Storage failures produce a new holder and never reuse persisted authority.
261
+ */
262
+ function browserInteractiveControlHolderId(environmentId, sessionId, incarnationId) {
263
+ const key = `tangle.interactive.control-holder:${environmentId}:${sessionId}:${incarnationId}`;
264
+ try {
265
+ const storage = globalThis.sessionStorage;
266
+ const existing = storage.getItem(key);
267
+ if (existing) return existing;
268
+ const holderId = createInteractiveControlHolderId("browser");
269
+ storage.setItem(key, holderId);
270
+ return holderId;
271
+ } catch {
272
+ return createInteractiveControlHolderId("browser");
273
+ }
274
+ }
275
+ //#endregion
276
+ export { INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS as a, createInteractiveControlHolderId as c, interactiveSessionControlReleaseResponseSchema as d, interactiveSessionStatusResponseSchema as f, createBrowserInteractiveSessionControlTransport as i, interactiveSessionIdentityDigest as l, browserInteractiveControlHolderId as n, InteractiveSessionControlController as o, browserInteractiveTerminalEndpoint as r, assertInteractiveSessionRef as s, BrowserInteractiveSessionControlController as t, interactiveSessionControlClaimResponseSchema as u };
@@ -1,6 +1,7 @@
1
- import { _ as backendTypeSchema, c as combineAbortSignals, d as applyRequestedModel, f as assertCurrentBackendType, l as encodePromptForWire, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as normalizeRuntimeBackendConfig, u as encodeTextForWire } from "./runtime-api-TVLbV10b.js";
1
+ import { c as encodePromptForWire, d as assertCurrentBackendType, f as normalizeRuntimeBackendConfig, g as backendTypeSchema, l as encodeTextForWire, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, u as applyRequestedModel } from "./runtime-api-B0tx7NJM.js";
2
2
  import { a as NetworkError, f as TimeoutError, l as SandboxError, m as parseErrorResponse, o as NotFoundError, p as ValidationError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-C6kn-3zt.js";
3
- import { i as normalizeStartupDiagnostics, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt, w as parseSSEStream, x as exportTraceBundle, y as normalizeConnection } from "./sandbox-DM-VD8ja.js";
3
+ import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
4
+ import { C as normalizeConnection, O as parseSSEStream, T as exportTraceBundle, _ as requestInteractiveSessionToken, i as normalizeStartupDiagnostics, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt } from "./sandbox-AUHcCJe1.js";
4
5
  import { agentProfileSchema } from "@tangle-network/agent-interface";
5
6
  import { z } from "zod";
6
7
  //#region src/backend-registry.ts
@@ -2444,11 +2445,11 @@ function withRequestContextHeaders(response, path, method) {
2444
2445
  });
2445
2446
  }
2446
2447
  async function resolveLocalCliAuthFiles(backendType) {
2447
- const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-D4u7fsnH.js");
2448
+ const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-CJmSpTjk.js");
2448
2449
  return discoverLocalCliAuthFiles(backendType);
2449
2450
  }
2450
2451
  async function describeLocalCliAuthExpectation(backendType) {
2451
- const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-D4u7fsnH.js");
2452
+ const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-CJmSpTjk.js");
2452
2453
  return describe(backendType);
2453
2454
  }
2454
2455
  async function hydrateLocalCliBackendAuth(backend, baseUrl, trustLocalCliAuth) {
@@ -2890,6 +2891,16 @@ var Sandbox = class {
2890
2891
  return createSandboxInstanceFromResponse(this, this.parseInfo(data));
2891
2892
  }
2892
2893
  /**
2894
+ * Mint the terminal-capable token for one exact interactive session.
2895
+ *
2896
+ * This is a server-side operation. It validates the complete session
2897
+ * reference, derives the sandbox and runtime session IDs from that reference,
2898
+ * and makes one scoped-token request without loading the sandbox first.
2899
+ */
2900
+ async mintInteractiveSessionToken(ref, options = {}) {
2901
+ return requestInteractiveSessionToken(this, ref, options);
2902
+ }
2903
+ /**
2893
2904
  * Return the identity the public Sandbox API observed for this credential.
2894
2905
  *
2895
2906
  * This is useful for deployment checks that must confirm which account and
@@ -3126,6 +3137,7 @@ var Sandbox = class {
3126
3137
  const requestTimeoutMs = typeof fetchOptions?.timeoutMs === "number" && fetchOptions.timeoutMs > 0 ? fetchOptions.timeoutMs : this.timeoutMs;
3127
3138
  const controller = new AbortController();
3128
3139
  const timeoutId = setTimeout(() => controller.abort(), requestTimeoutMs);
3140
+ const requestSignal = options?.signal ? combineAbortSignals([options.signal, controller.signal]) : controller.signal;
3129
3141
  try {
3130
3142
  const headers = new Headers(options?.headers);
3131
3143
  headers.set("Authorization", `Bearer ${this.apiKey}`);
@@ -3134,10 +3146,11 @@ var Sandbox = class {
3134
3146
  return withRequestContextHeaders(await globalThis.fetch(url, {
3135
3147
  ...options,
3136
3148
  headers,
3137
- signal: options?.signal ?? controller.signal
3149
+ signal: requestSignal
3138
3150
  }), path, options?.method);
3139
3151
  } catch (err) {
3140
- if (err instanceof Error && err.name === "AbortError") throw new TimeoutError(requestTimeoutMs);
3152
+ if (controller.signal.aborted && requestSignal.reason === controller.signal.reason) throw new TimeoutError(requestTimeoutMs);
3153
+ if (options?.signal?.aborted) throw options.signal.reason ?? err;
3141
3154
  throw new NetworkError(`Failed to connect to Sandbox API: ${err instanceof Error ? err.message : String(err)}`, err instanceof Error ? err : void 0, {
3142
3155
  endpoint: path,
3143
3156
  origin: "sandbox-api"
@@ -1,5 +1,7 @@
1
- import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-Caev7isY.js";
2
- import { $i as UsageInfo, Ar as SandboxFleetTraceBundle, At as FleetExecDispatchResult, Bn as PublishPublicTemplateOptions, Br as SandboxInfo, Cr as SandboxFleetMachineRecord, Ct as FleetDispatchCancelResult, Dr as SandboxFleetOperationsSummary, Dt as FleetDriveTurnOutcome, Et as FleetDispatchStreamOptions, F as CreateSandboxFleetWithCoordinatorOptions, Gn as ReconcileSandboxFleetsResult, Hn as ReapExpiredSandboxFleetsOptions, I as CreateSandboxOptions, Ii as SubscriptionInfo, Ir as SandboxFleetWorkspaceReconcileResult, Lr as SandboxFleetWorkspaceRestoreResult, M as CreateRequestOptions, Mi as SshKeysManager, Mn as PromptOptions, Mt as FleetPromptDispatchOptions, N as CreateSandboxFleetOptions, Nn as PromptResult, Nr as SandboxFleetTraceOptions, Nt as FleetPromptDispatchResult, Ot as FleetDriveTurnRequest, P as CreateSandboxFleetTokenOptions, Pr as SandboxFleetUsage, Rn as PublicTemplateInfo, Rr as SandboxFleetWorkspaceSnapshotResult, Tr as SandboxFleetManifest, Tt as FleetDispatchResultBufferOptions, Un as ReapExpiredSandboxFleetsResult, Vn as PublishPublicTemplateVersionOptions, Wn as ReconcileSandboxFleetsOptions, _ as BatchRunOptions, _r as SandboxFleetDriverCapability, an as IntelligenceReportWindow, ct as ExecOptions, di as SecretsManager, fr as SandboxFleetArtifact, g as BatchResult, gr as SandboxFleetDispatchResponse, ir as SandboxConfig, j as CreateIntelligenceReportOptions, jn as PromptInputPart, jt as FleetMachineId, kr as SandboxFleetToken, kt as FleetExecDispatchOptions, l as AttachSandboxFleetMachineOptions, ln as ListSandboxFleetOptions, lt as ExecResult, mr as SandboxFleetCostEstimate, nn as IntelligenceReportBudget, pr as SandboxFleetArtifactSpec, qi as TokenRefreshHandler, rn as IntelligenceReportCompareTo, sa as BatchEvent, tn as IntelligenceReport, un as ListSandboxOptions, ur as SandboxEnvironment, v as BatchRunRequest, wt as FleetDispatchResultBuffer, yr as SandboxFleetInfo, zn as PublicTemplateVersionInfo, zr as SandboxIdentity } from "./types-D_ykdqn6.js";
1
+ import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-Cr-4qzaA.js";
2
+ import { l as ScopedToken, s as MintInteractiveSessionTokenOptions } from "./terminal-stream-4KNJ6SmL.js";
3
+ import { An as PromptInputPart, At as FleetExecDispatchResult, Bn as PublishPublicTemplateVersionOptions, Ct as FleetDispatchCancelResult, Dt as FleetDriveTurnOutcome, Er as SandboxFleetOperationsSummary, Et as FleetDispatchStreamOptions, F as CreateSandboxFleetWithCoordinatorOptions, Fr as SandboxFleetWorkspaceReconcileResult, Hn as ReapExpiredSandboxFleetsResult, I as CreateSandboxOptions, Ir as SandboxFleetWorkspaceRestoreResult, Ln as PublicTemplateInfo, Lr as SandboxFleetWorkspaceSnapshotResult, M as CreateRequestOptions, Mn as PromptResult, Mr as SandboxFleetTraceOptions, Mt as FleetPromptDispatchOptions, N as CreateSandboxFleetOptions, Ni as SubscriptionInfo, Nr as SandboxFleetUsage, Nt as FleetPromptDispatchResult, Or as SandboxFleetToken, Ot as FleetDriveTurnRequest, P as CreateSandboxFleetTokenOptions, Rn as PublicTemplateVersionInfo, Rr as SandboxIdentity, Sr as SandboxFleetMachineRecord, Tt as FleetDispatchResultBufferOptions, Un as ReconcileSandboxFleetsOptions, Vn as ReapExpiredSandboxFleetsOptions, Wi as TokenRefreshHandler, Wn as ReconcileSandboxFleetsResult, Xi as UsageInfo, _ as BatchRunOptions, an as IntelligenceReportWindow, ci as SecretsManager, ct as ExecOptions, dr as SandboxFleetArtifact, fr as SandboxFleetArtifactSpec, g as BatchResult, gr as SandboxFleetDriverCapability, hr as SandboxFleetDispatchResponse, ia as BatchEvent, j as CreateIntelligenceReportOptions, jn as PromptOptions, jt as FleetMachineId, ki as SshKeysManager, kr as SandboxFleetTraceBundle, kt as FleetExecDispatchOptions, l as AttachSandboxFleetMachineOptions, ln as ListSandboxFleetOptions, lr as SandboxEnvironment, lt as ExecResult, nn as IntelligenceReportBudget, pr as SandboxFleetCostEstimate, rn as IntelligenceReportCompareTo, rr as SandboxConfig, tn as IntelligenceReport, un as ListSandboxOptions, v as BatchRunRequest, vr as SandboxFleetInfo, wr as SandboxFleetManifest, wt as FleetDispatchResultBuffer, zn as PublishPublicTemplateOptions, zr as SandboxInfo } from "./types-BwYLVqxX.js";
4
+ import { AgentInteractiveSessionRef } from "@tangle-network/agent-interface";
3
5
  import { z } from "zod";
4
6
 
5
7
  //#region src/backend-registry.d.ts
@@ -280,6 +282,13 @@ declare class SandboxFleetClient {
280
282
  private listBySandboxMetadata;
281
283
  }
282
284
  //#endregion
285
+ //#region src/scoped-token.d.ts
286
+ interface ScopedTokenHttpClient {
287
+ fetch(path: string, options?: RequestInit, fetchOptions?: {
288
+ timeoutMs?: number;
289
+ }): Promise<Response>;
290
+ }
291
+ //#endregion
283
292
  //#region src/session-events.d.ts
284
293
  /** Event delivered to a product session through the Sandbox session gateway. */
285
294
  interface SessionBroadcastEvent {
@@ -324,7 +333,7 @@ interface SessionBroadcastResult {
324
333
  * await box.delete();
325
334
  * ```
326
335
  */
327
- declare class Sandbox implements HttpClient {
336
+ declare class Sandbox implements HttpClient, ScopedTokenHttpClient {
328
337
  private readonly baseUrl;
329
338
  private readonly apiKey;
330
339
  private readonly timeoutMs;
@@ -471,6 +480,14 @@ declare class Sandbox implements HttpClient {
471
480
  * ```
472
481
  */
473
482
  get(id: string): Promise<SandboxInstance | null>;
483
+ /**
484
+ * Mint the terminal-capable token for one exact interactive session.
485
+ *
486
+ * This is a server-side operation. It validates the complete session
487
+ * reference, derives the sandbox and runtime session IDs from that reference,
488
+ * and makes one scoped-token request without loading the sandbox first.
489
+ */
490
+ mintInteractiveSessionToken(ref: AgentInteractiveSessionRef, options?: MintInteractiveSessionTokenOptions): Promise<ScopedToken>;
474
491
  /**
475
492
  * Return the identity the public Sandbox API observed for this credential.
476
493
  *
@@ -1,2 +1,2 @@
1
- import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "../index-Cp1KYanB.js";
1
+ import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "../index-CMLW3u5K.js";
2
2
  export { CollaborationBootstrapRequest, CollaborationBootstrapResponse, CollaborationClient, CollaborationClientConfig, CollaborationDocumentAdapter, CollaborationDocumentChange, CollaborationDocumentRef, CollaborationFileBridge, CollaborationFileBridgeOptions, CollaborationFileEvent, CollaborationPermissions, CollaborationTokenRefreshRequest, CollaborationTokenRefreshResponse, CollaborationTransportConfig, SaveCollaborationSnapshotRequest, SaveCollaborationSnapshotResponse, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
@@ -1,2 +1,2 @@
1
- import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-COCXdRrk.js";
1
+ import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-DQD9kCdN.js";
2
2
  export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-Caev7isY.js";
2
- import { Br as SandboxInfo, I as CreateSandboxOptions, Jr as SandboxStatus, Sn as PreviewLinkWaitOptions, bn as PreviewLinkInfo, ct as ExecOptions, hn as NetworkConfig, ir as SandboxConfig, jn as PromptInputPart, lt as ExecResult, xn as PreviewLinkManager } from "./types-D_ykdqn6.js";
3
- import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-1OK1sjCh.js";
4
- import { a as NetworkError, c as QuotaError, d as SandboxFailureDetail, f as ServerError, h as ValidationError, i as FileWriteConflictError, l as SandboxError, m as TimeoutError, n as CapabilityError, o as NotFoundError, p as StateError, s as PartialFailureError, t as AuthError, u as SandboxErrorJson } from "./errors-Bdy5jXzc.js";
1
+ import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-Cr-4qzaA.js";
2
+ import { An as PromptInputPart, I as CreateSandboxOptions, bn as PreviewLinkManager, ct as ExecOptions, lt as ExecResult, mn as NetworkConfig, qr as SandboxStatus, rr as SandboxConfig, xn as PreviewLinkWaitOptions, yn as PreviewLinkInfo, zr as SandboxInfo } from "./types-BwYLVqxX.js";
3
+ import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-Do_HS671.js";
4
+ import { a as NetworkError, c as QuotaError, d as SandboxFailureDetail, f as ServerError, h as ValidationError, i as FileWriteConflictError, l as SandboxError, m as TimeoutError, n as CapabilityError, o as NotFoundError, p as StateError, s as PartialFailureError, t as AuthError, u as SandboxErrorJson } from "./errors-CQOvGddH.js";
5
5
  export { AuthError, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, FileWriteConflictError, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type PromptInputPart, QuotaError, Sandbox, type SandboxConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { a as NetworkError, c as QuotaError, d as StateError, f as TimeoutError, i as FileWriteConflictError, l as SandboxError, n as CapabilityError, o as NotFoundError, p as ValidationError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-C6kn-3zt.js";
2
- import { _ as parseBackendRegistryResponseBody, d as backendRegistryCapabilitiesSchema, f as backendRegistryEntrySchema, g as parseBackendRegistryResponse, h as isBackendRegistryInteractionKind, m as backendRegistryResponseSchema, n as Sandbox, p as backendRegistryInteractionKindSchema } from "./client-CCKEVUaD.js";
3
- import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox-DM-VD8ja.js";
2
+ import { _ as parseBackendRegistryResponseBody, d as backendRegistryCapabilitiesSchema, f as backendRegistryEntrySchema, g as parseBackendRegistryResponse, h as isBackendRegistryInteractionKind, m as backendRegistryResponseSchema, n as Sandbox, p as backendRegistryInteractionKindSchema } from "./client-BfnJ44gF.js";
3
+ import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox-AUHcCJe1.js";
4
4
  export { AuthError, CapabilityError, FileWriteConflictError, NetworkError, NotFoundError, PartialFailureError, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
@@ -1,5 +1,5 @@
1
- import { n as HttpClient, r as SandboxInstance } from "./sandbox-Caev7isY.js";
2
- import { I as CreateSandboxOptions } from "./types-D_ykdqn6.js";
1
+ import { n as HttpClient, r as SandboxInstance } from "./sandbox-Cr-4qzaA.js";
2
+ import { I as CreateSandboxOptions } from "./types-BwYLVqxX.js";
3
3
 
4
4
  //#region src/tangle/abi.d.ts
5
5
  /**