@tangle-network/sandbox 0.30.1 → 0.30.2-develop.20260820122029.869ebfa
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 +1 -0
- package/dist/abort-signal-si1WMfJb.js +31 -0
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +3 -3
- package/dist/agent-run-outcome-CM7xD7Mg.d.ts +27 -0
- package/dist/auth/index.d.ts +1 -1
- package/dist/browser-interactive-control-controller-B476gcui.d.ts +96 -0
- package/dist/browser-interactive-control-controller-wXQ7W5pT.js +276 -0
- package/dist/{client-Bg9vBEfL.js → client-BfnJ44gF.js} +29 -6
- package/dist/{client-DRV5bzRc.d.ts → client-Do_HS671.d.ts} +28 -3
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/core.d.ts +4 -4
- package/dist/core.js +2 -2
- package/dist/{index-ldDRk8Jh.d.ts → index-ebsVOlUc.d.ts} +2 -2
- package/dist/index.d.ts +11 -8
- package/dist/index.js +7 -6
- package/dist/interactive-control.d.ts +2 -0
- package/dist/interactive-control.js +2 -0
- package/dist/openai/index.d.ts +24 -2
- package/dist/openai/index.js +147 -67
- package/dist/{runtime-api-CK-4S7oA.js → runtime-api-B0tx7NJM.js} +389 -7
- package/dist/runtime.d.ts +4 -3
- package/dist/runtime.js +3 -2
- package/dist/{sandbox-4F9CNqdR.js → sandbox-AUHcCJe1.js} +1435 -784
- package/dist/{sandbox-B49ZGQv7.d.ts → sandbox-Cr-4qzaA.d.ts} +139 -194
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-CHpXtqlI.js → tangle-iDk_s8vt.js} +1 -1
- package/dist/terminal-stream-4KNJ6SmL.d.ts +256 -0
- package/dist/{types-Qn3x7R8O.d.ts → types-BwYLVqxX.d.ts} +24 -256
- package/package.json +9 -4
- /package/dist/{collaboration-COCXdRrk.js → collaboration-DQD9kCdN.js} +0 -0
- /package/dist/{errors-Bdy5jXzc.d.ts → errors-CQOvGddH.d.ts} +0 -0
- /package/dist/{index-DtRFVx5U.d.ts → index-Bq_z_u6A.d.ts} +0 -0
- /package/dist/{index-Cp1KYanB.d.ts → index-CMLW3u5K.d.ts} +0 -0
- /package/dist/{local-cli-auth-D4u7fsnH.js → local-cli-auth-CJmSpTjk.js} +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as TerminalStreamReconnectAuthority, c as MintScopedTokenOptions, l as ScopedToken, t as TerminalStream } from "./terminal-stream-4KNJ6SmL.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-B476gcui.js";
|
|
3
|
+
import { $i as WorkspaceOperationLookup, $r as SandboxTerminals, Ai as StartupDiagnostics, An as PromptInputPart, Bt as GitCommit, Ci as SnapshotDeleteAcknowledgement, Di as SnapshotOptions, E as CodeLanguage, Ei as SnapshotInfo, En as ProcessManager, Fi as TaskSessionCommitResult, Ft as ForkIdempotency, Gr as SandboxRuntimeCapabilities, H as DispatchPromptOptions, Ht as GitDiff, It as ForkLookupOptions, J as DriverInfo, Jn as Rollout, Jr as SandboxTerminalAttachOptions, K as DriveTurnOptions, Ki as TurnDriveResult, Kn as RestoreSnapshotOptions, Kr as SandboxRuntimeHealth, L as CreateSessionOptions, Li as TaskSessionInfo, Mn as PromptResult, Nn as ProvisionEvent, O as CommitTaskSessionOptions, Oi as SnapshotResult, Pi as TaskSessionChanges, Pn as ProvisionResult, Pt as ForkCounts, Qi as WaitForRolloutOptions, Qn as RolloutStartResult, R as CreateTaskSessionOptions, St as FileWriteResult, T as CodeExecutionResult, U as DispatchedSession, Ui as TeePublicKeyResponse, Ur as SandboxResourceUsage, Ut as GitStatus, Vi as TeeAttestationResponse, Vr as SandboxPortBinding, Wt as GpuLease, X as DurablePlan, Xn as RolloutOptions, Yt as GpuLeaseManager, Z as DurablePlanDecisionResult, Zi as WaitForOptions, _i as SessionInterruptOptions, ai as SearchMatch, an as IntelligenceReportWindow, bn as PreviewLinkManager, ct as ExecOptions, d as BackendConfig, di as SentSessionMessage, ea as WriteFileOptions, ei as SandboxTraceBundle, en as InstalledTool, gi as SessionInfo, gt as FileSystem, hi as SessionForkOptions, hn as NetworkManager, ir as SandboxConnection, jn as PromptOptions, k as CompletedTurnResult, kr as SandboxFleetTraceBundle, li as SendSessionMessageOptions, lt as ExecResult, na as WriteManyOptions, nn as IntelligenceReportBudget, nr as SSHCredentials, oi as SearchOptions, on as JsonValue, or as SandboxCreateReceipt, ot as EventStreamOptions, p as BackendManager, pi as SessionEventStreamOptions, qn as ResumeOptions, qr as SandboxStatus, ri as SandboxTraceOptions, rn as IntelligenceReportCompareTo, rt as EgressManager, sn as ListMessagesOptions, sr as SandboxDeleteAcknowledgement, ta as WriteManyFile, tn as IntelligenceReport, tr as SSHCommandDescriptor, ui as SendSessionMessageRequest, ur as SandboxEvent, vi as SessionListOptions, vn as PermissionsManager, w as CodeExecutionOptions, x as BranchOptions, xi as SessionResultOptions, yi as SessionMessage, zi as TeeAttestationOptions, zr as SandboxInfo, zt as GitBranch } from "./types-BwYLVqxX.js";
|
|
4
|
+
import { AgentInteractiveSessionControlClaim, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionControlClaimRequest, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentInteractiveSessionStopAcknowledgement, AgentInteractiveSessionStopCommand, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, InteractionAcknowledgement, InteractionData, InteractionRequest, InteractionResponseCommand, agentInteractiveSessionPromptRequestDigest } from "@tangle-network/agent-interface";
|
|
3
5
|
import { z } from "zod";
|
|
4
6
|
|
|
5
7
|
//#region src/mcp.d.ts
|
|
@@ -113,12 +115,9 @@ declare function buildControlPlaneMcpConfig(options: BuildControlPlaneMcpConfigO
|
|
|
113
115
|
config: SandboxMcpConfig;
|
|
114
116
|
};
|
|
115
117
|
//#endregion
|
|
116
|
-
//#region
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
binding_mismatch: "binding_mismatch";
|
|
120
|
-
}>;
|
|
121
|
-
declare const InteractionResolutionSchema: z.ZodObject<{
|
|
118
|
+
//#region ../../../packages/runtime-contracts/dist/interaction-response.d.ts
|
|
119
|
+
/** Canonical result returned after a response is recorded by Sidecar. */
|
|
120
|
+
declare const interactionResolutionAcknowledgementSchema: z.ZodObject<{
|
|
122
121
|
status: z.ZodEnum<{
|
|
123
122
|
accepted: "accepted";
|
|
124
123
|
already_resolved_same: "already_resolved_same";
|
|
@@ -132,6 +131,14 @@ declare const InteractionResolutionSchema: z.ZodObject<{
|
|
|
132
131
|
declined: "declined";
|
|
133
132
|
cancelled: "cancelled";
|
|
134
133
|
}>;
|
|
134
|
+
deliveryState: z.ZodEnum<{
|
|
135
|
+
pending: "pending";
|
|
136
|
+
delivering: "delivering";
|
|
137
|
+
delivered: "delivered";
|
|
138
|
+
delivery_failed: "delivery_failed";
|
|
139
|
+
backend_lost: "backend_lost";
|
|
140
|
+
effect_unknown: "effect_unknown";
|
|
141
|
+
}>;
|
|
135
142
|
delivered: z.ZodBoolean;
|
|
136
143
|
resolvedAt: z.ZodString;
|
|
137
144
|
binding: z.ZodOptional<z.ZodObject<{
|
|
@@ -144,7 +151,14 @@ declare const InteractionResolutionSchema: z.ZodObject<{
|
|
|
144
151
|
interactionId: z.ZodString;
|
|
145
152
|
}, z.core.$strict>>;
|
|
146
153
|
}, z.core.$strict>;
|
|
147
|
-
type
|
|
154
|
+
type InteractionResolutionAcknowledgement = z.infer<typeof interactionResolutionAcknowledgementSchema>;
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/interaction-response.d.ts
|
|
157
|
+
declare const REFUSED_INTERACTION_STATUS: z.ZodEnum<{
|
|
158
|
+
already_resolved_different: "already_resolved_different";
|
|
159
|
+
binding_mismatch: "binding_mismatch";
|
|
160
|
+
}>;
|
|
161
|
+
type SandboxInteractionResolution = InteractionResolutionAcknowledgement;
|
|
148
162
|
type SandboxInteractionConflict = {
|
|
149
163
|
status: z.infer<typeof REFUSED_INTERACTION_STATUS>;
|
|
150
164
|
message: string;
|
|
@@ -159,177 +173,121 @@ interface SandboxInteractionCommandResult {
|
|
|
159
173
|
serverResult?: SandboxInteractionResult;
|
|
160
174
|
}
|
|
161
175
|
//#endregion
|
|
162
|
-
//#region src/interactive.d.ts
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
176
|
+
//#region src/interactive-controller.d.ts
|
|
177
|
+
/** The request fields supplied by an attach caller before control is claimed. */
|
|
178
|
+
type InteractiveAttachRequest = Omit<InteractiveAttachOptions, "control">;
|
|
179
|
+
/** Transport used by the status → claim → WebSocket controller. */
|
|
180
|
+
interface InteractiveSessionControllerTransport extends InteractiveSessionControlTransport {
|
|
181
|
+
attach(sessionId: string, ref: AgentInteractiveSessionRef, request: InteractiveAttachOptions, options?: InteractiveRequestOptions, reconnectAuthority?: TerminalStreamReconnectAuthority): Promise<TerminalStream>;
|
|
168
182
|
}
|
|
169
|
-
interface
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/** Working directory; defaults to the sandbox workspace root. */
|
|
182
|
-
cwd?: string;
|
|
183
|
-
cols?: number;
|
|
184
|
-
rows?: number;
|
|
185
|
-
authFiles?: InteractiveAuthFile[];
|
|
186
|
-
/**
|
|
187
|
-
* Canonical agent profile (persona, skills, tool policy, MCP). When set, the
|
|
188
|
-
* sidecar materializes it into `cwd` before spawning the TUI, so the
|
|
189
|
-
* interactive session runs AS the configured agent rather than a bare harness.
|
|
190
|
-
* Omit to launch the harness's default TUI.
|
|
191
|
-
*/
|
|
192
|
-
profile?: AgentProfile;
|
|
193
|
-
/**
|
|
194
|
-
* Opening message the TUI submits on its own once ready (via the harness's
|
|
195
|
-
* prompt launch arg). Use this to start the agent working immediately instead
|
|
196
|
-
* of writing keystrokes after start — a TUI drops input sent before it is
|
|
197
|
-
* ready to read. Omit for a session that opens idle.
|
|
198
|
-
*/
|
|
199
|
-
initialPrompt?: string;
|
|
200
|
-
}
|
|
201
|
-
interface InteractiveSessionInfo {
|
|
202
|
-
sessionId: string;
|
|
203
|
-
harness: BackendType;
|
|
204
|
-
/** ISO timestamp of when the harness process was spawned. */
|
|
205
|
-
startedAt: string;
|
|
183
|
+
interface InteractiveSessionControllerOptions extends InteractiveSessionControlControllerOptions {}
|
|
184
|
+
/**
|
|
185
|
+
* Attach-capable controller for one exact interactive process.
|
|
186
|
+
*
|
|
187
|
+
* Control ownership lives in the dependency-light base controller. This layer
|
|
188
|
+
* adds only the terminal attach operation after that ownership is resolved.
|
|
189
|
+
*/
|
|
190
|
+
declare class InteractiveSessionController extends InteractiveSessionControlController {
|
|
191
|
+
private readonly attachTransport;
|
|
192
|
+
private attachInFlight?;
|
|
193
|
+
constructor(attachTransport: InteractiveSessionControllerTransport, options: InteractiveSessionControllerOptions);
|
|
194
|
+
attach(request: InteractiveAttachRequest, requestOptions?: InteractiveRequestOptions): Promise<TerminalStream>;
|
|
206
195
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
196
|
+
* Open a stream for a claim returned by this controller's `resolve()`.
|
|
197
|
+
* The controller releases that claim when the stream cannot be opened.
|
|
209
198
|
*/
|
|
210
|
-
|
|
199
|
+
attachWithIdentity(identity: InteractiveSessionIdentity, request: InteractiveAttachRequest, requestOptions?: InteractiveRequestOptions): Promise<TerminalStream>;
|
|
211
200
|
}
|
|
212
|
-
/**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
*/
|
|
218
|
-
|
|
201
|
+
/** Browser transport options for the attach-capable controller. */
|
|
202
|
+
interface BrowserInteractiveSessionControllerOptions extends InteractiveSessionControllerOptions, BrowserInteractiveSessionControlControllerOptions {
|
|
203
|
+
/** Mint a future session-runtime token for every browser terminal dial. */
|
|
204
|
+
terminalTokenProvider?: (signal?: AbortSignal) => Promise<ScopedToken>;
|
|
205
|
+
}
|
|
206
|
+
/** Concrete controller for browser deep links and terminal attachment. */
|
|
207
|
+
declare class BrowserInteractiveSessionController extends InteractiveSessionController {
|
|
208
|
+
constructor(options: BrowserInteractiveSessionControllerOptions);
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/interactive.d.ts
|
|
212
|
+
/** Exact start request sent to the Sandbox runtime. */
|
|
213
|
+
type InteractiveSessionStartOptions = AgentInteractiveSessionStart;
|
|
214
|
+
/** Exact identity of one admitted interactive process. */
|
|
215
|
+
type InteractiveSessionRef = AgentInteractiveSessionRef;
|
|
216
|
+
/** Incarnation identifier carried by an exact interactive reference. */
|
|
217
|
+
type InteractiveSessionIncarnationId = AgentInteractiveSessionRef["incarnationId"];
|
|
218
|
+
/** Write authority for one exact interactive process. */
|
|
219
|
+
type InteractiveSessionControlClaim = AgentInteractiveSessionControlClaim;
|
|
220
|
+
/** Published Interface prompt command. */
|
|
221
|
+
type InteractivePromptCommand = AgentInteractiveSessionPromptCommand;
|
|
222
|
+
/** Published Interface stop command. */
|
|
223
|
+
type InteractiveStopCommand = AgentInteractiveSessionStopCommand;
|
|
224
|
+
/** Published Interface control-claim request. */
|
|
225
|
+
type InteractiveControlClaimRequest = AgentInteractiveSessionControlClaimRequest;
|
|
226
|
+
interface InteractiveSessionInfo {
|
|
219
227
|
state: "running";
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
startedAt: string;
|
|
228
|
+
ref: AgentInteractiveSessionRef;
|
|
229
|
+
control: AgentInteractiveSessionControlClaim;
|
|
223
230
|
streamUrl: string;
|
|
224
|
-
}
|
|
231
|
+
}
|
|
232
|
+
interface InteractiveSessionExitInfo {
|
|
225
233
|
state: "exited";
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
startedAt: string;
|
|
234
|
+
ref: AgentInteractiveSessionRef;
|
|
235
|
+
control: AgentInteractiveSessionControlClaim;
|
|
229
236
|
endedAt: string;
|
|
230
237
|
exitCode?: number;
|
|
231
238
|
exitSignal?: string;
|
|
232
|
-
/**
|
|
233
|
-
* "exited" = the process ended on its own; "stopped" = explicit stop();
|
|
234
|
-
* "lost" = the session was interrupted by a sidecar restart mid-run (its
|
|
235
|
-
* PTY died with the process) and re-hydrated as a durable tombstone rather
|
|
236
|
-
* than reported as a 404/null. A "lost" session is a failed run.
|
|
237
|
-
*/
|
|
238
239
|
reason: "exited" | "stopped" | "lost";
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Stream callbacks, bound before the socket opens. Register `onData` here:
|
|
247
|
-
* the server replays the session's buffered screen immediately after the
|
|
248
|
-
* attach acknowledgement, so a handler added after `attach()` resolves
|
|
249
|
-
* would miss the replayed frames.
|
|
250
|
-
*/
|
|
251
|
-
handlers?: TerminalStreamHandlers;
|
|
240
|
+
}
|
|
241
|
+
type InteractiveSessionStartResult = InteractiveSessionInfo | InteractiveSessionExitInfo;
|
|
242
|
+
/** Identity required to reconstruct a handle after a process boundary. */
|
|
243
|
+
interface InteractiveSessionHandleOptions {
|
|
244
|
+
ref?: AgentInteractiveSessionRef;
|
|
245
|
+
control?: AgentInteractiveSessionControlClaim;
|
|
252
246
|
}
|
|
253
247
|
/** Decision passed to `respondToPermission`. */
|
|
254
248
|
interface RespondToPermissionOptions {
|
|
255
|
-
/** The human's decision for the awaiting permission interaction. */
|
|
256
249
|
response: "allow" | "deny";
|
|
257
250
|
signal?: AbortSignal;
|
|
258
251
|
}
|
|
259
252
|
/** Result of `interrupt`. */
|
|
260
253
|
interface InterruptResult {
|
|
261
|
-
/**
|
|
262
|
-
* True iff an execution was actively running and the abort signal reached
|
|
263
|
-
* it. `false` means there was nothing in flight to cancel — surfaced
|
|
264
|
-
* explicitly rather than as a silent success so callers can distinguish a
|
|
265
|
-
* real interruption from a no-op.
|
|
266
|
-
*/
|
|
267
254
|
cancelled: boolean;
|
|
268
255
|
}
|
|
269
|
-
/**
|
|
270
|
-
* Host hooks the SDK box implements to drive interactive sessions. Kept
|
|
271
|
-
* separate from the prompt/session-event host so the interactive surface is an
|
|
272
|
-
* explicit, independently-mockable contract.
|
|
273
|
-
*/
|
|
256
|
+
/** Host hooks implemented by the Sandbox client. */
|
|
274
257
|
interface InteractiveSessionHost {
|
|
275
|
-
_startInteractive(id: string, options:
|
|
276
|
-
_sendInteractivePrompt(id: string,
|
|
277
|
-
_stopInteractive(id: string): Promise<
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
*/
|
|
284
|
-
_interactiveStatus?(id: string): Promise<InteractiveSessionStatus | null>;
|
|
285
|
-
/**
|
|
286
|
-
* Optional for the same additive-change reason as `_interactiveStatus`. A
|
|
287
|
-
* host that omits it makes `InteractiveSessionHandle.attach()` reject with
|
|
288
|
-
* a clear "not supported" error.
|
|
289
|
-
*/
|
|
290
|
-
_attachInteractive?(id: string, options?: InteractiveAttachOptions): Promise<TerminalStream>;
|
|
258
|
+
_startInteractive(id: string, options: InteractiveSessionStartOptions, requestOptions?: InteractiveRequestOptions): Promise<InteractiveSessionStartResult>;
|
|
259
|
+
_sendInteractivePrompt(id: string, command: InteractivePromptCommand, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionPromptAcknowledgement>;
|
|
260
|
+
_stopInteractive(id: string, command: InteractiveStopCommand, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionStopAcknowledgement>;
|
|
261
|
+
_stopInteractiveLifecycle(id: string, ref: AgentInteractiveSessionRef, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionStopAcknowledgement>;
|
|
262
|
+
_claimInteractiveControl(id: string, request: InteractiveControlClaimRequest, options?: InteractiveControlClaimOptions): Promise<InteractiveControlClaimAcknowledgement>;
|
|
263
|
+
_releaseInteractiveControl(id: string, ref: AgentInteractiveSessionRef, control: AgentInteractiveSessionControlClaim, options?: InteractiveRequestOptions): Promise<void>;
|
|
264
|
+
_interactiveStatus(id: string, incarnationId: string, options?: InteractiveRequestOptions): Promise<InteractiveSessionStatus | null>;
|
|
265
|
+
_attachInteractive(id: string, ref: AgentInteractiveSessionRef, request: InteractiveAttachOptions, options?: InteractiveRequestOptions, reconnectAuthority?: TerminalStreamReconnectAuthority): Promise<TerminalStream>;
|
|
291
266
|
}
|
|
292
267
|
/**
|
|
293
|
-
* Handle for one
|
|
294
|
-
*
|
|
295
|
-
*
|
|
268
|
+
* Handle for one exact interactive harness session.
|
|
269
|
+
*
|
|
270
|
+
* `start()` binds the returned ref and control for prompt and stop commands.
|
|
271
|
+
* Attach always observes and claims a fresh control before opening its stream.
|
|
296
272
|
*/
|
|
297
273
|
declare class InteractiveSessionHandle {
|
|
298
274
|
private readonly host;
|
|
299
275
|
private readonly sessionId;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
* harness — never a fresh shell. The host mints a short-lived scoped
|
|
316
|
-
* terminal token and dials the session's `streamUrl` through the secured
|
|
317
|
-
* sidecar proxy; resolves once the server acknowledges the attach (the
|
|
318
|
-
* buffered screen then replays through `handlers.onData`).
|
|
319
|
-
*
|
|
320
|
-
* Throws when no interactive session is running for this id — attach after
|
|
321
|
-
* `start()`, or to a session another caller started.
|
|
322
|
-
*/
|
|
323
|
-
attach(options?: InteractiveAttachOptions): Promise<TerminalStream>;
|
|
324
|
-
/**
|
|
325
|
-
* Observe the session: running, exited (with its exit code), or `null`
|
|
326
|
-
* when the sidecar no longer knows the id. Poll this to detect completion —
|
|
327
|
-
* an interactive session has no structured result stream, so the exit
|
|
328
|
-
* tombstone is the completion signal.
|
|
329
|
-
*/
|
|
330
|
-
status(): Promise<InteractiveSessionStatus | null>;
|
|
331
|
-
/** Stop the interactive harness and reap its PTY. */
|
|
332
|
-
stop(): Promise<void>;
|
|
276
|
+
private ref?;
|
|
277
|
+
private control?;
|
|
278
|
+
private readonly attachHolderId;
|
|
279
|
+
private attachController?;
|
|
280
|
+
private attachInFlight?;
|
|
281
|
+
constructor(host: InteractiveSessionHost, sessionId: string, options?: InteractiveSessionHandleOptions);
|
|
282
|
+
start(options: InteractiveSessionStartOptions, requestOptions?: InteractiveRequestOptions): Promise<InteractiveSessionStartResult>;
|
|
283
|
+
private requireBinding;
|
|
284
|
+
private requireRef;
|
|
285
|
+
sendPrompt(command: InteractivePromptCommand, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionPromptAcknowledgement>;
|
|
286
|
+
attach(request?: InteractiveAttachRequest, options?: InteractiveRequestOptions): Promise<TerminalStream>;
|
|
287
|
+
status(options?: InteractiveRequestOptions): Promise<InteractiveSessionStatus | null>;
|
|
288
|
+
claimControl(request: InteractiveControlClaimRequest, options?: InteractiveControlClaimOptions): Promise<InteractiveControlClaimAcknowledgement>;
|
|
289
|
+
stop(command: InteractiveStopCommand, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionStopAcknowledgement>;
|
|
290
|
+
stopLifecycle(options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionStopAcknowledgement>;
|
|
333
291
|
}
|
|
334
292
|
//#endregion
|
|
335
293
|
//#region src/session.d.ts
|
|
@@ -447,7 +405,7 @@ declare class SandboxSession {
|
|
|
447
405
|
* from the headless `prompt()`/`events()` surface above. Lazy — does not hit
|
|
448
406
|
* the network until a handle method is called.
|
|
449
407
|
*/
|
|
450
|
-
interactive(): InteractiveSessionHandle;
|
|
408
|
+
interactive(options?: InteractiveSessionHandleOptions): InteractiveSessionHandle;
|
|
451
409
|
/**
|
|
452
410
|
* Resolve a pending permission interaction the agent raised mid-turn,
|
|
453
411
|
* forwarding `allow`/`deny` to the blocked agent through the unified
|
|
@@ -681,6 +639,10 @@ declare class SandboxInstance {
|
|
|
681
639
|
private readonly defaultRuntimeBackend?;
|
|
682
640
|
private readonly runtime;
|
|
683
641
|
private readonly workspaceImages;
|
|
642
|
+
private readonly interactiveOperations;
|
|
643
|
+
private readonly interactiveTerminalOperations;
|
|
644
|
+
/** @internal Test seam for terminal attach unit tests. */
|
|
645
|
+
private _terminalStreamConnect;
|
|
684
646
|
/**
|
|
685
647
|
* A profile the runtime has cached (create-time priming), letting turns
|
|
686
648
|
* send `backend.profileSha256` instead of re-shipping the profile's static
|
|
@@ -814,7 +776,7 @@ declare class SandboxInstance {
|
|
|
814
776
|
/**
|
|
815
777
|
* Refresh sandbox information from the server.
|
|
816
778
|
*/
|
|
817
|
-
refresh(): Promise<void>;
|
|
779
|
+
refresh(signal?: AbortSignal): Promise<void>;
|
|
818
780
|
private refreshInfo;
|
|
819
781
|
/**
|
|
820
782
|
* Fetch fresh TEE attestation evidence for this sandbox.
|
|
@@ -969,15 +931,13 @@ declare class SandboxInstance {
|
|
|
969
931
|
* Stream events from an agent prompt.
|
|
970
932
|
* Use this for real-time updates during agent execution.
|
|
971
933
|
*
|
|
972
|
-
* Guarantees
|
|
973
|
-
* ends with
|
|
974
|
-
* error
|
|
975
|
-
*
|
|
976
|
-
* never a thrown generator. Caller-initiated cancellation (aborting
|
|
977
|
-
* `options.signal`) ends the stream silently with no synthetic terminal.
|
|
934
|
+
* Guarantees terminal completion on every non-cancelled path. A clean run
|
|
935
|
+
* emits a `result` summary and ends with `done`. A failure is an in-band
|
|
936
|
+
* `error` followed by `done`, never a thrown generator. Caller cancellation
|
|
937
|
+
* ends the stream silently with no synthetic terminal.
|
|
978
938
|
*
|
|
979
939
|
* Automatically reconnects via the runtime event replay endpoint if the
|
|
980
|
-
* SSE stream drops before a terminal event (`
|
|
940
|
+
* SSE stream drops before a terminal event (`done` or `error`) is
|
|
981
941
|
* received. Reconnection is transparent — replayed events that were
|
|
982
942
|
* already yielded (based on event ID tracking) are deduplicated.
|
|
983
943
|
*/
|
|
@@ -1900,39 +1860,24 @@ declare class SandboxInstance {
|
|
|
1900
1860
|
private _executionEvents;
|
|
1901
1861
|
/** @internal — invoked by SandboxSession.result(). */
|
|
1902
1862
|
_sessionResult(id: string, options?: SessionResultOptions, knownSession?: SessionInfo): Promise<PromptResult>;
|
|
1903
|
-
/** @internal —
|
|
1904
|
-
_startInteractive(id: string, options:
|
|
1905
|
-
/** @internal —
|
|
1906
|
-
_sendInteractivePrompt(id: string,
|
|
1907
|
-
/** @internal —
|
|
1908
|
-
|
|
1909
|
-
/**
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
/**
|
|
1916
|
-
* Resolve a sandbox-relative terminal stream path against the browser-safe
|
|
1917
|
-
* sidecar proxy base returned by the scoped-token mint. Concatenation, not
|
|
1918
|
-
* URL resolution: the proxy base carries a path prefix
|
|
1919
|
-
* (`/v1/sidecar-proxy/{id}`) that `new URL(absolutePath, base)` would drop.
|
|
1920
|
-
*/
|
|
1921
|
-
private resolveTerminalStreamUrl;
|
|
1922
|
-
/** @internal — invoked by InteractiveSessionHandle.attach(). */
|
|
1923
|
-
_attachInteractive(id: string, options?: InteractiveAttachOptions): Promise<TerminalStream>;
|
|
1924
|
-
/**
|
|
1925
|
-
* Per-dial credential for a terminal attach. The first dial consumes the
|
|
1926
|
-
* token minted alongside the proxy URL (no second mint); every later dial
|
|
1927
|
-
* (a `reconnect()` after the socket dropped or the detach window) re-mints,
|
|
1928
|
-
* because scoped terminal tokens are clamped to a <= 15-minute TTL and the
|
|
1929
|
-
* original is likely dead by then.
|
|
1930
|
-
*/
|
|
1931
|
-
private terminalTokenProvider;
|
|
1932
|
-
/** @internal — invoked by `box.terminals.attach()`. */
|
|
1863
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1864
|
+
_startInteractive(id: string, options: InteractiveSessionStartOptions, requestOptions?: InteractiveRequestOptions): Promise<InteractiveSessionStartResult>;
|
|
1865
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1866
|
+
_sendInteractivePrompt(id: string, command: InteractivePromptCommand, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionPromptAcknowledgement>;
|
|
1867
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1868
|
+
_claimInteractiveControl(id: string, request: AgentInteractiveSessionControlClaimRequest, options?: InteractiveControlClaimOptions): Promise<AgentInteractiveSessionControlClaimAcknowledgement>;
|
|
1869
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1870
|
+
_releaseInteractiveControl(id: string, ref: AgentInteractiveSessionRef, control: AgentInteractiveSessionControlClaim, options?: InteractiveRequestOptions): Promise<void>;
|
|
1871
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1872
|
+
_interactiveStatus(id: string, incarnationId: string, options?: InteractiveRequestOptions): Promise<InteractiveSessionStatus | null>;
|
|
1873
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1874
|
+
_attachInteractive(id: string, ref: AgentInteractiveSessionRef, request: InteractiveAttachOptions, options?: InteractiveRequestOptions, reconnectAuthority?: TerminalStreamReconnectAuthority): Promise<TerminalStream>;
|
|
1875
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1933
1876
|
_attachTerminal(connectionId: string, options?: SandboxTerminalAttachOptions): Promise<TerminalStream>;
|
|
1934
|
-
/** @internal —
|
|
1935
|
-
_stopInteractive(id: string): Promise<
|
|
1877
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1878
|
+
_stopInteractive(id: string, command: InteractiveStopCommand, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionStopAcknowledgement>;
|
|
1879
|
+
/** @internal — delegated to the native interactive operations module. */
|
|
1880
|
+
_stopInteractiveLifecycle(id: string, ref: AgentInteractiveSessionRef, options?: InteractiveRequestOptions): Promise<AgentInteractiveSessionStopAcknowledgement>;
|
|
1936
1881
|
private interactionTransport;
|
|
1937
1882
|
/** @internal — invoked by SandboxSession.interactions(). */
|
|
1938
1883
|
_listInteractions(id: string, options?: {
|
|
@@ -1965,4 +1910,4 @@ declare class SandboxInstance {
|
|
|
1965
1910
|
}): Promise<DurablePlanDecisionResult>;
|
|
1966
1911
|
}
|
|
1967
1912
|
//#endregion
|
|
1968
|
-
export {
|
|
1913
|
+
export { RespondToPermissionOptions as A, SandboxInteractionResolution as B, InteractiveSessionIncarnationId as C, InteractiveSessionStartResult as D, InteractiveSessionStartOptions as E, InteractiveSessionController as F, SANDBOX_MCP_SERVER_NAME as G, BuildControlPlaneMcpConfigOptions as H, InteractiveSessionControllerOptions as I, SandboxMcpServerEntry as J, SandboxMcpConfig as K, InteractiveSessionControllerTransport as L, BrowserInteractiveSessionController as M, BrowserInteractiveSessionControllerOptions as N, InteractiveStopCommand as O, InteractiveAttachRequest as P, SandboxInteractionCommandResult as R, InteractiveSessionHost as S, InteractiveSessionRef as T, BuildSandboxMcpConfigOptions as U, SandboxInteractionResult as V, CONTROL_PLANE_MCP_SERVER_NAME as W, buildSandboxMcpConfig as X, buildControlPlaneMcpConfig as Y, InteractiveControlClaimRequest as _, WorkspaceImagePublishRequestOptions as a, InteractiveSessionHandle as b, TraceExportFormat as c, buildTraceExportPayload as d, exportTraceBundle as f, SandboxSession as g, SandboxTaskSession as h, WorkspaceImagePublishInput as i, agentInteractiveSessionPromptRequestDigest as j, InterruptResult as k, TraceExportResult as l, toOtelJson as m, HttpClient as n, WorkspaceImagePublishResult as o, otelTraceIdForTangleTrace as p, SandboxMcpEndpoint as q, SandboxInstance as r, WorkspaceImages as s, ForkAcknowledgement as t, TraceExportSink as u, InteractivePromptCommand as v, InteractiveSessionInfo as w, InteractiveSessionHandleOptions as x, InteractiveSessionControlClaim as y, SandboxInteractionConflict as z };
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-ebsVOlUc.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
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 TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-
|
|
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 TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-iDk_s8vt.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as parseErrorResponse } from "./errors-C6kn-3zt.js";
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-AUHcCJe1.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|