@tangle-network/sandbox 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +3 -2
- package/dist/auth/index.d.ts +1 -1
- package/dist/{client-BgKAw8YA.d.ts → client-Cr39zlgv.d.ts} +4 -1
- package/dist/{client-DeHvk634.js → client-Df1K1d_Q.js} +19 -1
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/core.d.ts +4 -3
- package/dist/core.js +2 -2
- package/dist/{index-DS4SOkKG.d.ts → index-DzEUjav-.d.ts} +2 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +5 -4
- package/dist/runtime-api-CYA2DUQw.js +434 -0
- package/dist/runtime.d.ts +62 -0
- package/dist/runtime.js +81 -0
- package/dist/sandbox-BhYmj7L3.d.ts +1489 -0
- package/dist/{sandbox-CeimsfC8.js → sandbox-CxBHIBV1.js} +3 -393
- package/dist/session-gateway/index.js +16 -10
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-DayyZe-i.js → tangle-BdRRHMpX.js} +1 -1
- package/dist/{sandbox-Bm2C9Phd.d.ts → types-Cmpv-ox_.d.ts} +6 -1491
- package/package.json +6 -1
- /package/dist/{collaboration-D17lnOJX.js → collaboration-QZXrXdIb.js} +0 -0
- /package/dist/{errors-H9268M_g.d.ts → errors--P_nbLzM.d.ts} +0 -0
- /package/dist/{index-D-2pH_70.d.ts → index-CyHojkuA.d.ts} +0 -0
- /package/dist/{index-D7bwmNs8.d.ts → index-DKzapw-9.d.ts} +0 -0
|
@@ -2018,10 +2018,11 @@ type TurnDriveResult = {
|
|
|
2018
2018
|
error: string;
|
|
2019
2019
|
};
|
|
2020
2020
|
/**
|
|
2021
|
-
* Scope of a `box.mintScopedToken()` request. Each value narrows the
|
|
2022
|
-
*
|
|
2021
|
+
* Scope of a `box.mintScopedToken()` request. Each value narrows the token's
|
|
2022
|
+
* authority compared to the full sandbox bearer. `session-runtime` permits
|
|
2023
|
+
* only typed message, workspace-file, and terminal operations for one session.
|
|
2023
2024
|
*/
|
|
2024
|
-
type ScopedTokenScope = "session" | "project" | "read-only";
|
|
2025
|
+
type ScopedTokenScope = "session" | "session-runtime" | "project" | "read-only";
|
|
2025
2026
|
/**
|
|
2026
2027
|
* Options for `box.mintScopedToken()`.
|
|
2027
2028
|
*/
|
|
@@ -2030,7 +2031,7 @@ interface MintScopedTokenOptions {
|
|
|
2030
2031
|
* grants read access to the whole sandbox; `read-only` is a project
|
|
2031
2032
|
* scope without prompt-dispatch capabilities. */
|
|
2032
2033
|
scope: ScopedTokenScope;
|
|
2033
|
-
/** Required when `scope
|
|
2034
|
+
/** Required when `scope` is `session` or `session-runtime`. */
|
|
2034
2035
|
sessionId?: string;
|
|
2035
2036
|
/** TTL in minutes. Default 5; clamped to [1, 15]. Browser-side
|
|
2036
2037
|
* bearers must be short-lived; pair with `client.onTokenRefresh()`
|
|
@@ -4748,1490 +4749,4 @@ interface CodeExecutionOptions {
|
|
|
4748
4749
|
idempotencyKey?: string;
|
|
4749
4750
|
}
|
|
4750
4751
|
//#endregion
|
|
4751
|
-
|
|
4752
|
-
/**
|
|
4753
|
-
* MCP (Model Context Protocol) helpers for sandbox capabilities.
|
|
4754
|
-
*
|
|
4755
|
-
* The sandbox exposes capabilities (currently `computer_use`, more
|
|
4756
|
-
* later) as MCP tools over Streamable HTTP. Any MCP-capable client —
|
|
4757
|
-
* Claude Desktop, Cursor, claude-code, codex, opencode, raw
|
|
4758
|
-
* `@modelcontextprotocol/sdk` apps — can consume this surface by
|
|
4759
|
-
* pasting the JSON returned from `Sandbox#getMcpEndpoint()` (or
|
|
4760
|
-
* `buildSandboxMcpConfig` if you already have the URL + token) into
|
|
4761
|
-
* the client's MCP config.
|
|
4762
|
-
*
|
|
4763
|
-
* Security model:
|
|
4764
|
-
* - Tokens are capability-scoped JWTs (claim `cap: ["computer_use"]`).
|
|
4765
|
-
* - Full sandbox runtime tokens are rejected on `/mcp`; only
|
|
4766
|
-
* capability-scoped tokens work there.
|
|
4767
|
-
* - A scoped token cannot pivot to admin endpoints (`/exec`, `/files`,
|
|
4768
|
-
* etc.) — those routes reject scoped tokens.
|
|
4769
|
-
* - Tokens are short-lived. Rotate via `Sandbox#getMcpEndpoint()`,
|
|
4770
|
-
* which mints a fresh token each call.
|
|
4771
|
-
*/
|
|
4772
|
-
/** Default name of the MCP server entry — surfaces in the host UI. */
|
|
4773
|
-
declare const SANDBOX_MCP_SERVER_NAME = "tangle-sandbox";
|
|
4774
|
-
/**
|
|
4775
|
-
* MCP HTTP server entry — matches the Anthropic MCP HTTP transport
|
|
4776
|
-
* schema (`type: "http"`, `url`, optional `headers`). Compatible with
|
|
4777
|
-
* every MCP host that implements the spec.
|
|
4778
|
-
*/
|
|
4779
|
-
interface SandboxMcpServerEntry {
|
|
4780
|
-
type: "http";
|
|
4781
|
-
url: string;
|
|
4782
|
-
headers: Record<string, string>;
|
|
4783
|
-
}
|
|
4784
|
-
/**
|
|
4785
|
-
* `.mcp.json`-shaped config any MCP host accepts. Drop the contents of
|
|
4786
|
-
* `mcpServers` into your host's `mcpServers` block (Claude Desktop,
|
|
4787
|
-
* Cursor, claude-code's `--mcp-config`, etc.) — no host-specific
|
|
4788
|
-
* fields, no provider lock-in.
|
|
4789
|
-
*/
|
|
4790
|
-
interface SandboxMcpConfig {
|
|
4791
|
-
mcpServers: Record<string, SandboxMcpServerEntry>;
|
|
4792
|
-
}
|
|
4793
|
-
/**
|
|
4794
|
-
* Endpoint payload returned by `GET /v1/sandboxes/:id/mcp`. Includes
|
|
4795
|
-
* the canonical config plus token expiry so callers can plan
|
|
4796
|
-
* refreshes.
|
|
4797
|
-
*/
|
|
4798
|
-
interface SandboxMcpEndpoint {
|
|
4799
|
-
/** MCP host config — paste this into Cursor/Claude Desktop/etc. */
|
|
4800
|
-
config: SandboxMcpConfig;
|
|
4801
|
-
/** Server entry name used inside `config.mcpServers`. */
|
|
4802
|
-
serverName: string;
|
|
4803
|
-
/** Reachable URL for the MCP HTTP transport. */
|
|
4804
|
-
url: string;
|
|
4805
|
-
/** Bearer token sent by the MCP host on every request. */
|
|
4806
|
-
authToken: string;
|
|
4807
|
-
/** ISO-8601 expiry — the host should refresh before this. */
|
|
4808
|
-
expiresAt: string;
|
|
4809
|
-
/** Capabilities the token is scoped to. */
|
|
4810
|
-
capabilities: ReadonlyArray<"computer_use">;
|
|
4811
|
-
}
|
|
4812
|
-
interface BuildSandboxMcpConfigOptions {
|
|
4813
|
-
/** Public sandbox URL where `/mcp` is reachable. No trailing slash. */
|
|
4814
|
-
sandboxUrl: string;
|
|
4815
|
-
/** Capability-scoped JWT minted by the Sandbox API. */
|
|
4816
|
-
authToken: string;
|
|
4817
|
-
/** Override the entry name. Defaults to SANDBOX_MCP_SERVER_NAME. */
|
|
4818
|
-
serverName?: string;
|
|
4819
|
-
}
|
|
4820
|
-
/**
|
|
4821
|
-
* Build the canonical `mcpServers` config for a sandbox MCP endpoint.
|
|
4822
|
-
* Pure function — no I/O, no crypto. Use this when you already have a
|
|
4823
|
-
* `{ url, authToken }` pair from the API and just want the JSON shape
|
|
4824
|
-
* to paste into a host. Most callers should use
|
|
4825
|
-
* `Sandbox#getMcpEndpoint()` instead, which fetches a freshly-minted
|
|
4826
|
-
* token from the API.
|
|
4827
|
-
*/
|
|
4828
|
-
declare function buildSandboxMcpConfig(options: BuildSandboxMcpConfigOptions): {
|
|
4829
|
-
serverName: string;
|
|
4830
|
-
config: SandboxMcpConfig;
|
|
4831
|
-
};
|
|
4832
|
-
/**
|
|
4833
|
-
* Default name of the control-plane MCP server entry. Distinct from the per-
|
|
4834
|
-
* sandbox runtime server (`SANDBOX_MCP_SERVER_NAME`): the sandbox surface
|
|
4835
|
-
* operates INSIDE one sandbox (`run_code`/`exec`/`read`/`write`), while this one
|
|
4836
|
-
* operates ACROSS the account (sandboxes, workflows, integrations, usage).
|
|
4837
|
-
*/
|
|
4838
|
-
declare const CONTROL_PLANE_MCP_SERVER_NAME = "tangle-control-plane";
|
|
4839
|
-
interface BuildControlPlaneMcpConfigOptions {
|
|
4840
|
-
/** Public platform URL where `/mcp` is reachable. No trailing slash. */
|
|
4841
|
-
platformUrl: string;
|
|
4842
|
-
/**
|
|
4843
|
-
* A Tangle account API key scoped to the control-plane operations you need
|
|
4844
|
-
* (e.g. `read`, `workflows:write`). Sent on every request as a Bearer token.
|
|
4845
|
-
*/
|
|
4846
|
-
apiKey: string;
|
|
4847
|
-
/** Override the entry name. Defaults to CONTROL_PLANE_MCP_SERVER_NAME. */
|
|
4848
|
-
serverName?: string;
|
|
4849
|
-
}
|
|
4850
|
-
/**
|
|
4851
|
-
* Build the canonical `mcpServers` config for the public control-plane MCP
|
|
4852
|
-
* endpoint — the JSON a user pastes into Claude Desktop / Cursor / claude-code
|
|
4853
|
-
* to drive their Tangle account from their own agent. Pure function; mirrors
|
|
4854
|
-
* `buildSandboxMcpConfig` but carries an account API key instead of a per-
|
|
4855
|
-
* sandbox capability token.
|
|
4856
|
-
*/
|
|
4857
|
-
declare function buildControlPlaneMcpConfig(options: BuildControlPlaneMcpConfigOptions): {
|
|
4858
|
-
serverName: string;
|
|
4859
|
-
config: SandboxMcpConfig;
|
|
4860
|
-
};
|
|
4861
|
-
//#endregion
|
|
4862
|
-
//#region src/interactive.d.ts
|
|
4863
|
-
/**
|
|
4864
|
-
* Interactive harness sessions on the public SDK.
|
|
4865
|
-
*
|
|
4866
|
-
* `box.session(id).interactive()` returns a handle that spawns a coding
|
|
4867
|
-
* harness's native interactive TUI in the sandbox (start), drives it with
|
|
4868
|
-
* prompts (sendPrompt), and tears it down (stop). The live framebuffer is
|
|
4869
|
-
* streamed over the WebSocket at the returned `streamUrl` (the secured
|
|
4870
|
-
* `/terminals/:id/ws` pixel lane) — open it with your terminal/xterm client.
|
|
4871
|
-
*
|
|
4872
|
-
* This is the public SDK surface of the Session Protocol Gateway; it rides the
|
|
4873
|
-
* same secured runtime routes as the rest of the SDK.
|
|
4874
|
-
*/
|
|
4875
|
-
/** CLI auth file materialized into the harness's auth home before launch. */
|
|
4876
|
-
interface InteractiveAuthFile {
|
|
4877
|
-
path: string;
|
|
4878
|
-
content: string;
|
|
4879
|
-
mode?: number;
|
|
4880
|
-
}
|
|
4881
|
-
interface StartInteractiveOptions {
|
|
4882
|
-
/** Harness with a native interactive TUI: "claude-code" | "codex" | "kimi-code". */
|
|
4883
|
-
harness: string;
|
|
4884
|
-
model?: string;
|
|
4885
|
-
apiKey?: string;
|
|
4886
|
-
authMode?: string;
|
|
4887
|
-
baseUrl?: string;
|
|
4888
|
-
/** Working directory; defaults to the sandbox workspace root. */
|
|
4889
|
-
cwd?: string;
|
|
4890
|
-
cols?: number;
|
|
4891
|
-
rows?: number;
|
|
4892
|
-
authFiles?: InteractiveAuthFile[];
|
|
4893
|
-
}
|
|
4894
|
-
interface InteractiveSessionInfo {
|
|
4895
|
-
sessionId: string;
|
|
4896
|
-
harness: string;
|
|
4897
|
-
/** ISO timestamp of when the harness process was spawned. */
|
|
4898
|
-
startedAt: string;
|
|
4899
|
-
/**
|
|
4900
|
-
* Sandbox-relative WebSocket path that streams the live framebuffer and
|
|
4901
|
-
* accepts keystrokes (the mTLS- + capability-gated terminal socket).
|
|
4902
|
-
*/
|
|
4903
|
-
streamUrl: string;
|
|
4904
|
-
}
|
|
4905
|
-
/** Decision passed to `respondToPermission`. */
|
|
4906
|
-
interface RespondToPermissionOptions {
|
|
4907
|
-
/** The human's decision for the awaiting permission interaction. */
|
|
4908
|
-
response: "allow" | "deny";
|
|
4909
|
-
}
|
|
4910
|
-
/** Result of `interrupt`. */
|
|
4911
|
-
interface InterruptResult {
|
|
4912
|
-
/**
|
|
4913
|
-
* True iff an execution was actively running and the abort signal reached
|
|
4914
|
-
* it. `false` means there was nothing in flight to cancel — surfaced
|
|
4915
|
-
* explicitly rather than as a silent success so callers can distinguish a
|
|
4916
|
-
* real interruption from a no-op.
|
|
4917
|
-
*/
|
|
4918
|
-
cancelled: boolean;
|
|
4919
|
-
}
|
|
4920
|
-
/**
|
|
4921
|
-
* Host hooks the SDK box implements to drive interactive sessions. Kept
|
|
4922
|
-
* separate from the prompt/session-event host so the interactive surface is an
|
|
4923
|
-
* explicit, independently-mockable contract.
|
|
4924
|
-
*/
|
|
4925
|
-
interface InteractiveSessionHost {
|
|
4926
|
-
_startInteractive(id: string, options: StartInteractiveOptions): Promise<InteractiveSessionInfo>;
|
|
4927
|
-
_sendInteractivePrompt(id: string, prompt: string): Promise<void>;
|
|
4928
|
-
_stopInteractive(id: string): Promise<void>;
|
|
4929
|
-
}
|
|
4930
|
-
/**
|
|
4931
|
-
* Handle for one session's interactive harness. Obtained via
|
|
4932
|
-
* `box.session(id).interactive()`; does not hit the network until a method is
|
|
4933
|
-
* called.
|
|
4934
|
-
*/
|
|
4935
|
-
declare class InteractiveSessionHandle {
|
|
4936
|
-
private readonly host;
|
|
4937
|
-
private readonly sessionId;
|
|
4938
|
-
constructor(host: InteractiveSessionHost, sessionId: string);
|
|
4939
|
-
/**
|
|
4940
|
-
* Spawn the harness's interactive TUI for this session. Returns the
|
|
4941
|
-
* `streamUrl` to attach a terminal client to. Throws if the harness has no
|
|
4942
|
-
* interactive entrypoint (e.g. opencode), the binary is not installed, or a
|
|
4943
|
-
* session is already running for this id.
|
|
4944
|
-
*/
|
|
4945
|
-
start(options: StartInteractiveOptions): Promise<InteractiveSessionInfo>;
|
|
4946
|
-
/** Inject a prompt as keystrokes into the live harness (submitted on send). */
|
|
4947
|
-
sendPrompt(prompt: string): Promise<void>;
|
|
4948
|
-
/** Stop the interactive harness and reap its PTY. */
|
|
4949
|
-
stop(): Promise<void>;
|
|
4950
|
-
}
|
|
4951
|
-
//#endregion
|
|
4952
|
-
//#region src/session.d.ts
|
|
4953
|
-
/**
|
|
4954
|
-
* The subset of `SandboxInstance` a `SandboxSession` drives. Declared here
|
|
4955
|
-
* (rather than importing the concrete class) so `session.ts` stays a leaf
|
|
4956
|
-
* of `sandbox.ts` — `sandbox.ts` constructs `SandboxSession`, so the reverse
|
|
4957
|
-
* import would form a cycle. `SandboxInstance` satisfies this structurally.
|
|
4958
|
-
*/
|
|
4959
|
-
interface SandboxSessionHost extends InteractiveSessionHost {
|
|
4960
|
-
prompt(message: string | PromptInputPart[], options?: PromptOptions): Promise<PromptResult>;
|
|
4961
|
-
_sessionStatus(id: string): Promise<SessionInfo | null>;
|
|
4962
|
-
_sessionEvents(id: string, opts?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
|
|
4963
|
-
_sessionResult(id: string): Promise<PromptResult>;
|
|
4964
|
-
_sessionCancel(id: string): Promise<void>;
|
|
4965
|
-
_sessionDelete(id: string): Promise<void>;
|
|
4966
|
-
_sessionSendMessage(id: string, request: SendSessionMessageRequest, options?: SendSessionMessageOptions): Promise<SentSessionMessage>;
|
|
4967
|
-
messages(opts: ListMessagesOptions): Promise<SessionMessage[]>;
|
|
4968
|
-
_sessionFork(id: string, opts?: SessionForkOptions): Promise<SessionInfo>;
|
|
4969
|
-
_respondToPermission(id: string, permissionID: string, options: RespondToPermissionOptions): Promise<void>;
|
|
4970
|
-
_interrupt(id: string): Promise<InterruptResult>;
|
|
4971
|
-
_answerQuestion(id: string, answers: Record<string, string[]>): Promise<void>;
|
|
4972
|
-
}
|
|
4973
|
-
/**
|
|
4974
|
-
* A single agent session inside a sandbox. Created via
|
|
4975
|
-
* `box.session(id)` — does not hit the network until a method is called.
|
|
4976
|
-
*/
|
|
4977
|
-
declare class SandboxSession {
|
|
4978
|
-
private readonly box;
|
|
4979
|
-
/** Stable session id assigned by the sandbox runtime. */
|
|
4980
|
-
readonly id: string;
|
|
4981
|
-
/**
|
|
4982
|
-
* @internal SDK-internal constructor — apps should call `box.session(id)`.
|
|
4983
|
-
*/
|
|
4984
|
-
constructor(box: SandboxSessionHost, /** Stable session id assigned by the sandbox runtime. */
|
|
4985
|
-
|
|
4986
|
-
id: string);
|
|
4987
|
-
/**
|
|
4988
|
-
* Fetch the current session state from the sandbox. Includes status,
|
|
4989
|
-
* model, prompt count, token usage if known, and timing metadata.
|
|
4990
|
-
*
|
|
4991
|
-
* Throws on transport error; returns `null` if the session id is not
|
|
4992
|
-
* known to the sandbox (e.g. it ended and was reaped, or the id is
|
|
4993
|
-
* invalid).
|
|
4994
|
-
*/
|
|
4995
|
-
status(): Promise<SessionInfo | null>;
|
|
4996
|
-
/**
|
|
4997
|
-
* Stream events from this session as they arrive. With no `since`,
|
|
4998
|
-
* starts at the live tail; with `since`, replays from that event id
|
|
4999
|
-
* forward — useful for reconnect-after-disconnect flows.
|
|
5000
|
-
*
|
|
5001
|
-
* The async iterator terminates when the session reaches a terminal
|
|
5002
|
-
* state (`completed`, `failed`, `cancelled`) and the corresponding
|
|
5003
|
-
* terminal event has been yielded, OR when the caller's signal aborts.
|
|
5004
|
-
*/
|
|
5005
|
-
events(opts?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
|
|
5006
|
-
/**
|
|
5007
|
-
* Await the session's terminal result. Polls status + drains events
|
|
5008
|
-
* until the session reaches a terminal state, then returns the
|
|
5009
|
-
* aggregated `PromptResult`.
|
|
5010
|
-
*
|
|
5011
|
-
* Use this to wait for a session that was started by another caller
|
|
5012
|
-
* (e.g. `dispatchPrompt`).
|
|
5013
|
-
*/
|
|
5014
|
-
result(): Promise<PromptResult>;
|
|
5015
|
-
/**
|
|
5016
|
-
* List persisted messages for this session, including in-flight assistant
|
|
5017
|
-
* content when the runtime has flushed partial output.
|
|
5018
|
-
*/
|
|
5019
|
-
messages(opts?: Omit<ListMessagesOptions, "sessionId">): Promise<SessionMessage[]>;
|
|
5020
|
-
/**
|
|
5021
|
-
* Continue this session with an additional prompt. Equivalent to
|
|
5022
|
-
* `box.prompt(message, { ...opts, sessionId: this.id })` but reads
|
|
5023
|
-
* naturally on a Session reference.
|
|
5024
|
-
*/
|
|
5025
|
-
prompt(message: string | PromptInputPart[], opts?: PromptOptions): Promise<PromptResult>;
|
|
5026
|
-
/**
|
|
5027
|
-
* Send a structured message through the session message endpoint. Model and
|
|
5028
|
-
* message identifiers are translated to the runtime's wire names by the SDK.
|
|
5029
|
-
*/
|
|
5030
|
-
sendMessage(request: SendSessionMessageRequest, options?: SendSessionMessageOptions): Promise<SentSessionMessage>;
|
|
5031
|
-
/**
|
|
5032
|
-
* Abort the session's in-flight execution; the session and its messages
|
|
5033
|
-
* are preserved (this does not delete the session). Void-returning alias
|
|
5034
|
-
* of `interrupt()` — use `interrupt()` when you need to know whether an
|
|
5035
|
-
* execution was actually running. Best-effort: an in-flight LLM call may
|
|
5036
|
-
* still complete one more token before the abort takes effect. Idempotent —
|
|
5037
|
-
* aborting a session with nothing in flight is a no-op.
|
|
5038
|
-
*/
|
|
5039
|
-
cancel(): Promise<void>;
|
|
5040
|
-
/** Delete this session and its persisted runtime state. */
|
|
5041
|
-
delete(): Promise<void>;
|
|
5042
|
-
/**
|
|
5043
|
-
* Fork this session into a new queued session. The fork shares the
|
|
5044
|
-
* parent workspace and copies conversation history up to `messageId`
|
|
5045
|
-
* when supplied.
|
|
5046
|
-
*/
|
|
5047
|
-
fork(opts?: SessionForkOptions): Promise<{
|
|
5048
|
-
session: SandboxSession;
|
|
5049
|
-
info: SessionInfo;
|
|
5050
|
-
}>;
|
|
5051
|
-
/**
|
|
5052
|
-
* Drive this session's harness in INTERACTIVE mode: spawn its native TUI,
|
|
5053
|
-
* stream the live framebuffer, and inject prompts as keystrokes. Distinct
|
|
5054
|
-
* from the headless `prompt()`/`events()` surface above. Lazy — does not hit
|
|
5055
|
-
* the network until a handle method is called.
|
|
5056
|
-
*/
|
|
5057
|
-
interactive(): InteractiveSessionHandle;
|
|
5058
|
-
/**
|
|
5059
|
-
* Resolve a pending permission interaction the agent raised mid-turn,
|
|
5060
|
-
* forwarding `allow`/`deny` to the blocked agent through the unified
|
|
5061
|
-
* interaction channel. Throws if no matching permission is outstanding.
|
|
5062
|
-
*/
|
|
5063
|
-
respondToPermission(permissionID: string, options: RespondToPermissionOptions): Promise<void>;
|
|
5064
|
-
/**
|
|
5065
|
-
* Interrupt the session's current execution without deleting it. Returns
|
|
5066
|
-
* `{ cancelled: false }` when nothing was running — the no-op is reported
|
|
5067
|
-
* explicitly rather than masked as success.
|
|
5068
|
-
*/
|
|
5069
|
-
interrupt(): Promise<InterruptResult>;
|
|
5070
|
-
/**
|
|
5071
|
-
* Answer a question the agent asked via a question tool invocation. `answers`
|
|
5072
|
-
* maps each question id to the selected option(s). Backend-agnostic: works
|
|
5073
|
-
* with any backend that raises kind:"question" interactions — OpenCode
|
|
5074
|
-
* natively, or CLI backends with `BackendConfig.interactions.question`
|
|
5075
|
-
* enabled. Backends with no question support reject loudly.
|
|
5076
|
-
*/
|
|
5077
|
-
answer(answers: Record<string, string[]>): Promise<void>;
|
|
5078
|
-
}
|
|
5079
|
-
//#endregion
|
|
5080
|
-
//#region src/task-session.d.ts
|
|
5081
|
-
/** @internal Operations implemented by `SandboxInstance`. */
|
|
5082
|
-
interface SandboxTaskSessionHost extends SandboxSessionHost {
|
|
5083
|
-
_taskSessionChanges(id: string): Promise<TaskSessionChanges>;
|
|
5084
|
-
_taskSessionCommit(id: string, options?: CommitTaskSessionOptions): Promise<TaskSessionCommitResult>;
|
|
5085
|
-
}
|
|
5086
|
-
/** A background task session with isolated changeset operations. */
|
|
5087
|
-
declare class SandboxTaskSession extends SandboxSession {
|
|
5088
|
-
private readonly taskBox;
|
|
5089
|
-
/** @internal Apps should call `box.taskSession(id)`. */
|
|
5090
|
-
constructor(taskBox: SandboxTaskSessionHost, id: string);
|
|
5091
|
-
/** Read the task's isolated file changes. */
|
|
5092
|
-
changes(): Promise<TaskSessionChanges>;
|
|
5093
|
-
/** Apply all or a selected subset of the task's isolated file changes. */
|
|
5094
|
-
commit(options?: CommitTaskSessionOptions): Promise<TaskSessionCommitResult>;
|
|
5095
|
-
}
|
|
5096
|
-
//#endregion
|
|
5097
|
-
//#region src/trace-exporter.d.ts
|
|
5098
|
-
type JsonObject = {
|
|
5099
|
-
[key: string]: JsonValue;
|
|
5100
|
-
};
|
|
5101
|
-
type TraceExportFormat = "tangle" | "otel-json";
|
|
5102
|
-
type TraceExportBundle = SandboxTraceBundle | SandboxFleetTraceBundle;
|
|
5103
|
-
interface TraceExportSink {
|
|
5104
|
-
url: string;
|
|
5105
|
-
headers?: Record<string, string>;
|
|
5106
|
-
format?: TraceExportFormat;
|
|
5107
|
-
serviceName?: string;
|
|
5108
|
-
timeoutMs?: number;
|
|
5109
|
-
fetch?: typeof fetch;
|
|
5110
|
-
}
|
|
5111
|
-
interface TraceExportResult {
|
|
5112
|
-
status: number;
|
|
5113
|
-
ok: boolean;
|
|
5114
|
-
body: string;
|
|
5115
|
-
}
|
|
5116
|
-
declare function buildTraceExportPayload(bundle: TraceExportBundle, format?: TraceExportFormat, serviceName?: string): TraceExportBundle | JsonObject;
|
|
5117
|
-
declare function exportTraceBundle(bundle: TraceExportBundle, sink: TraceExportSink): Promise<TraceExportResult>;
|
|
5118
|
-
declare function toOtelJson(bundle: TraceExportBundle, serviceName?: string): JsonObject;
|
|
5119
|
-
declare function otelTraceIdForTangleTrace(traceId: string): string;
|
|
5120
|
-
//#endregion
|
|
5121
|
-
//#region src/sandbox.d.ts
|
|
5122
|
-
/**
|
|
5123
|
-
* Result of registering a sidecar session mapping. `reprovisionRequired` is
|
|
5124
|
-
* true when the server reports the mapped sidecar is stale (HTTP 410) and the
|
|
5125
|
-
* caller must reprovision the sandbox before retrying.
|
|
5126
|
-
*/
|
|
5127
|
-
interface SessionMappingResult {
|
|
5128
|
-
success: boolean;
|
|
5129
|
-
sessionId: string;
|
|
5130
|
-
sidecarSessionId?: string;
|
|
5131
|
-
reprovisionRequired: boolean;
|
|
5132
|
-
code?: string;
|
|
5133
|
-
}
|
|
5134
|
-
/**
|
|
5135
|
-
* HTTP client interface for making requests.
|
|
5136
|
-
*/
|
|
5137
|
-
interface HttpClient {
|
|
5138
|
-
fetch(path: string, options?: RequestInit, fetchOptions?: {
|
|
5139
|
-
timeoutMs?: number;
|
|
5140
|
-
}): Promise<Response>;
|
|
5141
|
-
getApiKey?(): string | undefined;
|
|
5142
|
-
}
|
|
5143
|
-
/**
|
|
5144
|
-
* Git capability for repository operations.
|
|
5145
|
-
*/
|
|
5146
|
-
interface GitCapability {
|
|
5147
|
-
/** Get repository status */
|
|
5148
|
-
status(): Promise<GitStatus>;
|
|
5149
|
-
/** Get commit log */
|
|
5150
|
-
log(limit?: number): Promise<GitCommit[]>;
|
|
5151
|
-
/** Get diff (optionally against a ref) */
|
|
5152
|
-
diff(ref?: string): Promise<GitDiff>;
|
|
5153
|
-
/** Stage files */
|
|
5154
|
-
add(paths: string[]): Promise<void>;
|
|
5155
|
-
/** Create a commit */
|
|
5156
|
-
commit(message: string, options?: {
|
|
5157
|
-
amend?: boolean;
|
|
5158
|
-
}): Promise<GitCommit>;
|
|
5159
|
-
/** Push to remote */
|
|
5160
|
-
push(options?: {
|
|
5161
|
-
force?: boolean;
|
|
5162
|
-
}): Promise<void>;
|
|
5163
|
-
/** Pull from remote */
|
|
5164
|
-
pull(options?: {
|
|
5165
|
-
rebase?: boolean;
|
|
5166
|
-
}): Promise<void>;
|
|
5167
|
-
/** List branches */
|
|
5168
|
-
branches(): Promise<GitBranch[]>;
|
|
5169
|
-
/** Checkout a branch or ref */
|
|
5170
|
-
checkout(ref: string, options?: {
|
|
5171
|
-
create?: boolean;
|
|
5172
|
-
}): Promise<void>;
|
|
5173
|
-
}
|
|
5174
|
-
/**
|
|
5175
|
-
* Tools capability for managing language runtimes via mise.
|
|
5176
|
-
*/
|
|
5177
|
-
interface ToolsCapability {
|
|
5178
|
-
/** Install a tool version */
|
|
5179
|
-
install(tool: string, version: string): Promise<void>;
|
|
5180
|
-
/** Activate a tool version for the session */
|
|
5181
|
-
use(tool: string, version: string): Promise<void>;
|
|
5182
|
-
/** List installed tools */
|
|
5183
|
-
list(): Promise<InstalledTool[]>;
|
|
5184
|
-
/** Run a command with a specific tool */
|
|
5185
|
-
run(tool: string, args: string[]): Promise<ExecResult>;
|
|
5186
|
-
}
|
|
5187
|
-
/**
|
|
5188
|
-
* A sandbox instance with methods for interaction.
|
|
5189
|
-
*/
|
|
5190
|
-
declare class SandboxInstance {
|
|
5191
|
-
private readonly client;
|
|
5192
|
-
private info;
|
|
5193
|
-
private readonly defaultRuntimeBackend?;
|
|
5194
|
-
private readonly runtime;
|
|
5195
|
-
constructor(client: HttpClient, info: SandboxInfo, defaultRuntimeBackend?: BackendConfig);
|
|
5196
|
-
/** Unique sandbox identifier */
|
|
5197
|
-
get id(): string;
|
|
5198
|
-
/** Human-readable name */
|
|
5199
|
-
get name(): string | undefined;
|
|
5200
|
-
/** Current status */
|
|
5201
|
-
get status(): SandboxStatus;
|
|
5202
|
-
/** Connection information */
|
|
5203
|
-
get connection(): SandboxConnection | undefined;
|
|
5204
|
-
/** Custom metadata */
|
|
5205
|
-
get metadata(): Record<string, unknown> | undefined;
|
|
5206
|
-
/** When the sandbox was created */
|
|
5207
|
-
get createdAt(): Date;
|
|
5208
|
-
/** When the sandbox started running */
|
|
5209
|
-
get startedAt(): Date | undefined;
|
|
5210
|
-
/** Last activity timestamp */
|
|
5211
|
-
get lastActivityAt(): Date | undefined;
|
|
5212
|
-
/** When the sandbox will expire */
|
|
5213
|
-
get expiresAt(): Date | undefined;
|
|
5214
|
-
/** Error message if status is 'failed' */
|
|
5215
|
-
get error(): string | undefined;
|
|
5216
|
-
/** GPU lease attached during sandbox creation, when requested. */
|
|
5217
|
-
get gpuLease(): GpuLease | undefined;
|
|
5218
|
-
/** Web terminal URL for browser-based access */
|
|
5219
|
-
get url(): string | undefined;
|
|
5220
|
-
/**
|
|
5221
|
-
* The 12-phase startup breakdown (storage_provision, host_select, edge_bind,
|
|
5222
|
-
* edge_ready, egress_proxy, docker_pull/create/start, sidecar_boot,
|
|
5223
|
-
* health_check, …) the platform emitted when this sandbox was provisioned.
|
|
5224
|
-
*
|
|
5225
|
-
* Present only on a freshly-created box; `null` for a box resolved by id or
|
|
5226
|
-
* when the runtime did not report diagnostics. Use `.phases` for the
|
|
5227
|
-
* operation-name → durationMs map.
|
|
5228
|
-
*
|
|
5229
|
-
* @example
|
|
5230
|
-
* ```typescript
|
|
5231
|
-
* const d = box.startupDiagnostics();
|
|
5232
|
-
* if (d) console.log(`provision phases: ${JSON.stringify(d.phases)}`);
|
|
5233
|
-
* ```
|
|
5234
|
-
*/
|
|
5235
|
-
startupDiagnostics(): StartupDiagnostics | null;
|
|
5236
|
-
/**
|
|
5237
|
-
* Serialize to the public sandbox shape for logs and structured
|
|
5238
|
-
* output. Secrets in `connection` (currently `authToken`) are
|
|
5239
|
-
* redacted so that `JSON.stringify(box)` is safe to ship to log
|
|
5240
|
-
* sinks. Use {@link toDebugJSON} when the bearer is required (e.g.
|
|
5241
|
-
* one-off CLI commands that print credentials to the user).
|
|
5242
|
-
*/
|
|
5243
|
-
toJSON(): SandboxInfo;
|
|
5244
|
-
/**
|
|
5245
|
-
* Serialize the sandbox **including secrets** when `includeSecrets`
|
|
5246
|
-
* is true. The default behavior matches {@link toJSON} and redacts
|
|
5247
|
-
* `connection.authToken`.
|
|
5248
|
-
*
|
|
5249
|
-
* Use only when the caller has an explicit need for the bearer
|
|
5250
|
-
* (e.g. presenting it once to the human operator). Never wire the
|
|
5251
|
-
* result of `toDebugJSON({ includeSecrets: true })` into a structured
|
|
5252
|
-
* logger — the bearer will land in any log sink consuming that output.
|
|
5253
|
-
*/
|
|
5254
|
-
toDebugJSON(options?: {
|
|
5255
|
-
includeSecrets?: boolean;
|
|
5256
|
-
}): SandboxInfo;
|
|
5257
|
-
/**
|
|
5258
|
-
* Create an advanced direct-runtime view of this sandbox.
|
|
5259
|
-
*
|
|
5260
|
-
* Runtime methods on the returned instance talk to the sandbox runtime
|
|
5261
|
-
* directly using `connection.runtimeUrl` and `connection.authToken`.
|
|
5262
|
-
* Lifecycle methods still go through the parent SDK client.
|
|
5263
|
-
*/
|
|
5264
|
-
direct(): SandboxInstance;
|
|
5265
|
-
/**
|
|
5266
|
-
* Get an MCP endpoint for this sandbox. Returns a paste-able config
|
|
5267
|
-
* for any MCP-capable host (Claude Desktop, Cursor, claude-code,
|
|
5268
|
-
* codex, opencode, …) plus a freshly-minted, capability-scoped JWT.
|
|
5269
|
-
*
|
|
5270
|
-
* The token is short-lived and limited to the requested capabilities
|
|
5271
|
-
* — it cannot be used against admin endpoints (`/exec`, `/files`,
|
|
5272
|
-
* etc.) on the sandbox. Call `getMcpEndpoint()` again to rotate.
|
|
5273
|
-
*
|
|
5274
|
-
* Requires the sandbox to have been created with `capabilities`
|
|
5275
|
-
* including the requested capability (default: `computer_use`).
|
|
5276
|
-
*
|
|
5277
|
-
* @example
|
|
5278
|
-
* ```typescript
|
|
5279
|
-
* const ep = await box.getMcpEndpoint();
|
|
5280
|
-
* // Save ep.config to your IDE's mcp.json — that's it.
|
|
5281
|
-
* fs.writeFileSync("mcp.json", JSON.stringify(ep.config, null, 2));
|
|
5282
|
-
* ```
|
|
5283
|
-
*/
|
|
5284
|
-
getMcpEndpoint(options?: {
|
|
5285
|
-
capabilities?: ReadonlyArray<"computer_use">; /** Override server entry name (default: "tangle-sandbox"). */
|
|
5286
|
-
serverName?: string; /** Token TTL in minutes (server clamps to its policy). */
|
|
5287
|
-
ttlMinutes?: number;
|
|
5288
|
-
}): Promise<SandboxMcpEndpoint>;
|
|
5289
|
-
/**
|
|
5290
|
-
* Refresh sandbox information from the server.
|
|
5291
|
-
*/
|
|
5292
|
-
refresh(): Promise<void>;
|
|
5293
|
-
/**
|
|
5294
|
-
* Fetch fresh TEE attestation evidence for this sandbox.
|
|
5295
|
-
*
|
|
5296
|
-
* When `attestationNonce` is supplied, the runtime must return evidence bound
|
|
5297
|
-
* to that challenge or fail closed if the selected TEE backend cannot support
|
|
5298
|
-
* nonce-bound report data.
|
|
5299
|
-
*/
|
|
5300
|
-
getTeeAttestation(options?: TeeAttestationOptions): Promise<TeeAttestationResponse>;
|
|
5301
|
-
/**
|
|
5302
|
-
* Fetch the TEE-bound public key used for sealed-secret encryption.
|
|
5303
|
-
*
|
|
5304
|
-
* The returned key includes an attestation report. Verify that report before
|
|
5305
|
-
* encrypting secrets to the key.
|
|
5306
|
-
*/
|
|
5307
|
-
getTeePublicKey(): Promise<TeePublicKeyResponse>;
|
|
5308
|
-
/**
|
|
5309
|
-
* Bootstrap a real-time collaboration session for a file.
|
|
5310
|
-
* Returns the WebSocket URL and auth token needed to connect a
|
|
5311
|
-
* Hocuspocus/Yjs provider for live multi-user editing.
|
|
5312
|
-
*
|
|
5313
|
-
* @example
|
|
5314
|
-
* ```typescript
|
|
5315
|
-
* const collab = await box.collaborate("src/index.ts")
|
|
5316
|
-
* // Use collab.transport.websocketUrl + collab.transport.token
|
|
5317
|
-
* // with @hocuspocus/provider to connect
|
|
5318
|
-
* ```
|
|
5319
|
-
*/
|
|
5320
|
-
collaborate(path: string, options?: {
|
|
5321
|
-
access?: "read" | "write";
|
|
5322
|
-
}): Promise<{
|
|
5323
|
-
documentId: string;
|
|
5324
|
-
transport: {
|
|
5325
|
-
websocketUrl: string;
|
|
5326
|
-
token: string;
|
|
5327
|
-
expiresAt: number;
|
|
5328
|
-
};
|
|
5329
|
-
permissions: {
|
|
5330
|
-
access: "read" | "write";
|
|
5331
|
-
canSnapshot: boolean;
|
|
5332
|
-
};
|
|
5333
|
-
}>;
|
|
5334
|
-
/**
|
|
5335
|
-
* Refresh a collaboration token for an existing document session.
|
|
5336
|
-
*/
|
|
5337
|
-
/**
|
|
5338
|
-
* Refresh a collaboration token. Access level is preserved from the original
|
|
5339
|
-
* token — cannot be escalated (read stays read, write stays write).
|
|
5340
|
-
*/
|
|
5341
|
-
refreshCollaborationToken(documentId: string, currentToken: string): Promise<{
|
|
5342
|
-
token: string;
|
|
5343
|
-
expiresAt: number;
|
|
5344
|
-
access: "read" | "write";
|
|
5345
|
-
}>;
|
|
5346
|
-
/**
|
|
5347
|
-
* Get SSH credentials for connecting to the sandbox.
|
|
5348
|
-
* Throws if SSH is not enabled or sandbox is not running.
|
|
5349
|
-
*/
|
|
5350
|
-
ssh(): Promise<SSHCredentials>;
|
|
5351
|
-
sshCommand(): Promise<SSHCommandDescriptor>;
|
|
5352
|
-
/**
|
|
5353
|
-
* Execute a command in the sandbox.
|
|
5354
|
-
*/
|
|
5355
|
-
exec(command: string, options?: ExecOptions): Promise<ExecResult>;
|
|
5356
|
-
/**
|
|
5357
|
-
* Run code in a persistent language kernel.
|
|
5358
|
-
*
|
|
5359
|
-
* Each `(sessionId, language)` pair gets its own long-lived kernel that
|
|
5360
|
-
* keeps variable state across calls — like Jupyter cells. Without a
|
|
5361
|
-
* `sessionId`, calls share a process-wide kernel per language.
|
|
5362
|
-
*
|
|
5363
|
-
* Returns typed results: stdout/stderr text plus a `results` array of
|
|
5364
|
-
* structured outputs (matplotlib images as base64 PNG, pandas DataFrames,
|
|
5365
|
-
* explicit `display(value)` calls as JSON/HTML, errors with traceback).
|
|
5366
|
-
*
|
|
5367
|
-
* @example Persistent Python session
|
|
5368
|
-
* ```ts
|
|
5369
|
-
* await box.runCode("python", "import pandas as pd; df = pd.DataFrame({'x': range(5)})", { sessionId: "s1" });
|
|
5370
|
-
* const r = await box.runCode("python", "df.describe()", { sessionId: "s1" });
|
|
5371
|
-
* // r.results[0] is a `dataframe` part with columns + rows from the describe()
|
|
5372
|
-
* ```
|
|
5373
|
-
*
|
|
5374
|
-
* @example Matplotlib chart
|
|
5375
|
-
* ```ts
|
|
5376
|
-
* const r = await box.runCode("python",
|
|
5377
|
-
* "import matplotlib.pyplot as plt; plt.plot([1,2,3,4]); plt.show()",
|
|
5378
|
-
* { sessionId: "s1" });
|
|
5379
|
-
* const png = r.results.find(p => p.type === "image");
|
|
5380
|
-
* // png.data is a base64 PNG ready to render or hand back to an LLM
|
|
5381
|
-
* ```
|
|
5382
|
-
*/
|
|
5383
|
-
runCode(language: CodeLanguage, source: string, options?: CodeExecutionOptions): Promise<CodeExecutionResult>;
|
|
5384
|
-
/**
|
|
5385
|
-
* Read a file from the sandbox.
|
|
5386
|
-
*
|
|
5387
|
-
* @param path - Path to the file. Relative paths resolve from the workspace root.
|
|
5388
|
-
* Absolute paths (e.g., `/tmp/output.json`) access the container filesystem directly.
|
|
5389
|
-
* @returns File content as string
|
|
5390
|
-
*
|
|
5391
|
-
* @example
|
|
5392
|
-
* ```typescript
|
|
5393
|
-
* const content = await box.read("src/index.ts");
|
|
5394
|
-
* const report = await box.read("/output/report.json");
|
|
5395
|
-
* ```
|
|
5396
|
-
*/
|
|
5397
|
-
read(path: string, options?: {
|
|
5398
|
-
sessionId?: string;
|
|
5399
|
-
}): Promise<string>;
|
|
5400
|
-
/**
|
|
5401
|
-
* Write content to a file in the sandbox.
|
|
5402
|
-
*
|
|
5403
|
-
* @param path - Path to the file. Relative paths resolve from the workspace root.
|
|
5404
|
-
* Absolute paths (e.g., `/tmp/cases.json`) write to the container filesystem directly.
|
|
5405
|
-
* @param content - Content to write
|
|
5406
|
-
*
|
|
5407
|
-
* @example
|
|
5408
|
-
* ```typescript
|
|
5409
|
-
* await box.write("src/fix.ts", "export const fix = () => {}");
|
|
5410
|
-
* await box.write("/tmp/config.json", JSON.stringify(config));
|
|
5411
|
-
* ```
|
|
5412
|
-
*/
|
|
5413
|
-
write(path: string, content: string, options?: WriteFileOptions): Promise<FileWriteResult>;
|
|
5414
|
-
/**
|
|
5415
|
-
* Write many files in one paced, retry-aware batch — see
|
|
5416
|
-
* {@link FileSystem.writeMany}. Each file goes through {@link write}; a small
|
|
5417
|
-
* pace between writes keeps a large corpus under the file-write rate limit,
|
|
5418
|
-
* and transient failures (quota / server / network / timeout) retry with
|
|
5419
|
-
* exponential backoff (honoring a server `retryAfterMs`). Fail-loud on the
|
|
5420
|
-
* first file that cannot be written after its retries.
|
|
5421
|
-
*/
|
|
5422
|
-
writeMany(files: WriteManyFile[], options?: WriteManyOptions): Promise<void>;
|
|
5423
|
-
/**
|
|
5424
|
-
* Send a prompt to the agent running in the sandbox.
|
|
5425
|
-
* Returns the complete response after the agent finishes.
|
|
5426
|
-
*/
|
|
5427
|
-
prompt(message: string | PromptInputPart[], options?: PromptOptions): Promise<PromptResult>;
|
|
5428
|
-
private logStreamCheckpoint;
|
|
5429
|
-
/**
|
|
5430
|
-
* Stream events from an agent prompt.
|
|
5431
|
-
* Use this for real-time updates during agent execution.
|
|
5432
|
-
*
|
|
5433
|
-
* Guarantees a terminal event on every non-cancelled path: a clean run
|
|
5434
|
-
* ends with the runtime's `result`/`done`; a failure (pre-stream HTTP
|
|
5435
|
-
* error, mid-stream network drop, timeout, or reconnect exhaustion) is
|
|
5436
|
-
* surfaced as an in-band `error` event followed by a synthetic `done`,
|
|
5437
|
-
* never a thrown generator. Caller-initiated cancellation (aborting
|
|
5438
|
-
* `options.signal`) ends the stream silently with no synthetic terminal.
|
|
5439
|
-
*
|
|
5440
|
-
* Automatically reconnects via the runtime event replay endpoint if the
|
|
5441
|
-
* SSE stream drops before a terminal event (`result` or `done`) is
|
|
5442
|
-
* received. Reconnection is transparent — replayed events that were
|
|
5443
|
-
* already yielded (based on event ID tracking) are deduplicated.
|
|
5444
|
-
*/
|
|
5445
|
-
streamPrompt(message: string | PromptInputPart[], options?: PromptOptions): AsyncGenerator<SandboxEvent>;
|
|
5446
|
-
/**
|
|
5447
|
-
* Inner prompt stream: opens the SSE connection and reconnects on silent
|
|
5448
|
-
* drops. May throw (pre-stream HTTP error, timeout, reconnect exhausted);
|
|
5449
|
-
* the public `streamPrompt` wrapper converts those throws into a terminal
|
|
5450
|
-
* `error` + `done` so callers never see a thrown generator.
|
|
5451
|
-
*/
|
|
5452
|
-
private streamPromptInner;
|
|
5453
|
-
/**
|
|
5454
|
-
* Stream sandbox lifecycle and activity events.
|
|
5455
|
-
*/
|
|
5456
|
-
events(options?: EventStreamOptions): AsyncGenerator<SandboxEvent>;
|
|
5457
|
-
trace(options?: SandboxTraceOptions): Promise<SandboxTraceBundle>;
|
|
5458
|
-
intelligence(): Promise<NonNullable<SandboxTraceBundle["intelligence"]>>;
|
|
5459
|
-
createIntelligenceReport(options?: {
|
|
5460
|
-
mode?: "deterministic" | "agentic";
|
|
5461
|
-
acknowledgeCost?: boolean;
|
|
5462
|
-
budget?: IntelligenceReportBudget;
|
|
5463
|
-
metadata?: Record<string, unknown>; /** Bound the analysis to a time window. */
|
|
5464
|
-
window?: IntelligenceReportWindow; /** Compare this sandbox against a same-type baseline sandbox. */
|
|
5465
|
-
compareTo?: IntelligenceReportCompareTo;
|
|
5466
|
-
}): Promise<IntelligenceReport>;
|
|
5467
|
-
createAgenticIntelligenceReport(options: {
|
|
5468
|
-
maxUsd: number;
|
|
5469
|
-
metadata?: Record<string, unknown>;
|
|
5470
|
-
}): Promise<IntelligenceReport>;
|
|
5471
|
-
exportTrace(sink: TraceExportSink): Promise<TraceExportResult>;
|
|
5472
|
-
/**
|
|
5473
|
-
* Stream real-time provisioning progress events.
|
|
5474
|
-
*
|
|
5475
|
-
* Connects to the SSE events stream and yields typed `ProvisionEvent` objects
|
|
5476
|
-
* for each provisioning step. The generator completes when provisioning
|
|
5477
|
-
* finishes (success or failure) and returns the terminal result.
|
|
5478
|
-
*
|
|
5479
|
-
* @returns AsyncGenerator of ProvisionEvent, with a ProvisionResult return value
|
|
5480
|
-
*
|
|
5481
|
-
* @example
|
|
5482
|
-
* ```typescript
|
|
5483
|
-
* const box = await client.create({ image: "ethereum" });
|
|
5484
|
-
*
|
|
5485
|
-
* const stream = box.watchProvisioning();
|
|
5486
|
-
* for await (const event of stream) {
|
|
5487
|
-
* console.log(`[${event.step}] ${event.status} — ${event.message}`);
|
|
5488
|
-
* }
|
|
5489
|
-
* // stream.return value contains the terminal result
|
|
5490
|
-
* ```
|
|
5491
|
-
*/
|
|
5492
|
-
watchProvisioning(options?: {
|
|
5493
|
-
signal?: AbortSignal;
|
|
5494
|
-
}): AsyncGenerator<ProvisionEvent, ProvisionResult | undefined>;
|
|
5495
|
-
/**
|
|
5496
|
-
* Run an agentic task until completion.
|
|
5497
|
-
*
|
|
5498
|
-
* Unlike prompt(), task() is designed for autonomous agent work:
|
|
5499
|
-
* - The agent works until it completes the task or hits an error
|
|
5500
|
-
* - Session state is maintained for context continuity
|
|
5501
|
-
* - Token usage is aggregated across the execution
|
|
5502
|
-
*
|
|
5503
|
-
* Note: The agent (OpenCode/Claude) handles multi-turn execution internally.
|
|
5504
|
-
* Most tasks complete in a single call. The maxTurns option is for edge cases
|
|
5505
|
-
* where the agent explicitly signals it needs additional input.
|
|
5506
|
-
*
|
|
5507
|
-
* @param prompt - Task description for the agent
|
|
5508
|
-
* @param options - Task options
|
|
5509
|
-
* @returns Task result with response and execution metadata
|
|
5510
|
-
*/
|
|
5511
|
-
task(prompt: string, options?: TaskOptions): Promise<TaskResult>;
|
|
5512
|
-
/**
|
|
5513
|
-
* Stream events from a task execution.
|
|
5514
|
-
*
|
|
5515
|
-
* Use this for real-time updates as the agent works:
|
|
5516
|
-
* - Tool calls and results
|
|
5517
|
-
* - Thinking/reasoning steps
|
|
5518
|
-
* - File operations
|
|
5519
|
-
* - Final response
|
|
5520
|
-
*
|
|
5521
|
-
* @param prompt - Task description for the agent
|
|
5522
|
-
* @param options - Task options
|
|
5523
|
-
*/
|
|
5524
|
-
streamTask(prompt: string, options?: TaskOptions): AsyncGenerator<SandboxEvent>;
|
|
5525
|
-
/**
|
|
5526
|
-
* Search for text patterns in files using ripgrep.
|
|
5527
|
-
*
|
|
5528
|
-
* This is a first-class code search capability, not a shell wrapper.
|
|
5529
|
-
* Ripgrep is pre-installed in all managed sandboxes.
|
|
5530
|
-
*
|
|
5531
|
-
* @param pattern - Regular expression pattern to search for
|
|
5532
|
-
* @param options - Search options
|
|
5533
|
-
* @returns Async iterator of search matches
|
|
5534
|
-
*
|
|
5535
|
-
* @example Search for task-marker comments
|
|
5536
|
-
* ```typescript
|
|
5537
|
-
* for await (const match of box.search("TASK:", { glob: "**\/*.ts" })) {
|
|
5538
|
-
* console.log(`${match.path}:${match.line}: ${match.text}`);
|
|
5539
|
-
* }
|
|
5540
|
-
* ```
|
|
5541
|
-
*
|
|
5542
|
-
* @example Collect all matches
|
|
5543
|
-
* ```typescript
|
|
5544
|
-
* const matches = [];
|
|
5545
|
-
* for await (const match of box.search("function.*async")) {
|
|
5546
|
-
* matches.push(match);
|
|
5547
|
-
* }
|
|
5548
|
-
* ```
|
|
5549
|
-
*/
|
|
5550
|
-
search(pattern: string, options?: SearchOptions): AsyncGenerator<SearchMatch>;
|
|
5551
|
-
/** Basic health reported by the runtime inside this sandbox. */
|
|
5552
|
-
runtimeHealth(): Promise<SandboxRuntimeHealth>;
|
|
5553
|
-
/** Return the runtime's current listening-port snapshot. */
|
|
5554
|
-
ports(): Promise<SandboxPortBinding[]>;
|
|
5555
|
-
/** Interactive terminal operations for this runtime. */
|
|
5556
|
-
get terminals(): SandboxTerminalManager;
|
|
5557
|
-
/** List profiles installed in this sandbox runtime. */
|
|
5558
|
-
listProfiles(): Promise<SandboxRuntimeProfileList>;
|
|
5559
|
-
/**
|
|
5560
|
-
* Live whole-sandbox resource usage (memory + CPU) from the container cgroup.
|
|
5561
|
-
*
|
|
5562
|
-
* Returns `null` when cgroup stats are unavailable (non-Linux host). Memory is
|
|
5563
|
-
* in MB; `memoryPeakMb` is the high-water mark since the sandbox started. CPU
|
|
5564
|
-
* is a cumulative microsecond counter — sample twice and compute
|
|
5565
|
-
* `cpu% = ΔcpuUsageUsec / (ΔsampledAtMs * 10)` for utilization.
|
|
5566
|
-
*
|
|
5567
|
-
* @example
|
|
5568
|
-
* ```typescript
|
|
5569
|
-
* const r = await box.resourceUsage();
|
|
5570
|
-
* if (r) console.log(`peak ${r.memoryPeakMb} MB`);
|
|
5571
|
-
* ```
|
|
5572
|
-
*/
|
|
5573
|
-
resourceUsage(): Promise<SandboxResourceUsage | null>;
|
|
5574
|
-
/**
|
|
5575
|
-
* Git capability object for repository operations.
|
|
5576
|
-
*
|
|
5577
|
-
* All git operations are executed in the sandbox workspace.
|
|
5578
|
-
*
|
|
5579
|
-
* @example Check status and commit
|
|
5580
|
-
* ```typescript
|
|
5581
|
-
* const status = await box.git.status();
|
|
5582
|
-
* if (status.isDirty) {
|
|
5583
|
-
* await box.git.add(["."]);
|
|
5584
|
-
* await box.git.commit("Update files");
|
|
5585
|
-
* await box.git.push();
|
|
5586
|
-
* }
|
|
5587
|
-
* ```
|
|
5588
|
-
*/
|
|
5589
|
-
get git(): GitCapability;
|
|
5590
|
-
private gitStatus;
|
|
5591
|
-
private gitLog;
|
|
5592
|
-
private gitDiff;
|
|
5593
|
-
private gitAdd;
|
|
5594
|
-
private gitCommit;
|
|
5595
|
-
private gitPush;
|
|
5596
|
-
private gitPull;
|
|
5597
|
-
private gitBranches;
|
|
5598
|
-
private gitCheckout;
|
|
5599
|
-
/**
|
|
5600
|
-
* Tools capability object for managing language runtimes.
|
|
5601
|
-
*
|
|
5602
|
-
* Uses mise (polyglot version manager) to install and manage tools.
|
|
5603
|
-
*
|
|
5604
|
-
* @example Install and use Node.js
|
|
5605
|
-
* ```typescript
|
|
5606
|
-
* await box.tools.install("node", "22");
|
|
5607
|
-
* await box.tools.use("node", "22");
|
|
5608
|
-
* const list = await box.tools.list();
|
|
5609
|
-
* ```
|
|
5610
|
-
*/
|
|
5611
|
-
get tools(): ToolsCapability;
|
|
5612
|
-
/**
|
|
5613
|
-
* File system operations beyond basic read/write:
|
|
5614
|
-
* - Binary upload/download
|
|
5615
|
-
* - Directory ops (uploadDir, downloadDir, list, mkdir)
|
|
5616
|
-
* - Metadata (stat, exists)
|
|
5617
|
-
* - Progress reporting for large files
|
|
5618
|
-
*
|
|
5619
|
-
* @example Upload and download
|
|
5620
|
-
* ```typescript
|
|
5621
|
-
* await box.fs.upload("./model.bin", "/workspace/models/model.bin");
|
|
5622
|
-
* await box.fs.download("/workspace/results.zip", "./results.zip");
|
|
5623
|
-
* ```
|
|
5624
|
-
*
|
|
5625
|
-
* @example Directory operations
|
|
5626
|
-
* ```typescript
|
|
5627
|
-
* await box.fs.uploadDir("./project", "/workspace/project");
|
|
5628
|
-
* const files = await box.fs.list("/workspace");
|
|
5629
|
-
* ```
|
|
5630
|
-
*
|
|
5631
|
-
* @example File management
|
|
5632
|
-
* ```typescript
|
|
5633
|
-
* if (await box.fs.exists("/workspace/config.json")) {
|
|
5634
|
-
* const info = await box.fs.stat("/workspace/config.json");
|
|
5635
|
-
* console.log(`Size: ${info.size}`);
|
|
5636
|
-
* }
|
|
5637
|
-
* await box.fs.mkdir("/workspace/output", { recursive: true });
|
|
5638
|
-
* await box.fs.delete("/workspace/temp", { recursive: true });
|
|
5639
|
-
* ```
|
|
5640
|
-
*/
|
|
5641
|
-
get fs(): FileSystem;
|
|
5642
|
-
private fsReadBatch;
|
|
5643
|
-
private fsTree;
|
|
5644
|
-
private fsUpload;
|
|
5645
|
-
private fsDownload;
|
|
5646
|
-
private fsUploadDir;
|
|
5647
|
-
private fsDownloadDir;
|
|
5648
|
-
private fsList;
|
|
5649
|
-
private fsStat;
|
|
5650
|
-
private fsDelete;
|
|
5651
|
-
private fsMkdir;
|
|
5652
|
-
private fsExists;
|
|
5653
|
-
/**
|
|
5654
|
-
* Permissions manager for multi-user access control.
|
|
5655
|
-
*
|
|
5656
|
-
* @example List users
|
|
5657
|
-
* ```typescript
|
|
5658
|
-
* const users = await box.permissions.list();
|
|
5659
|
-
* for (const user of users) {
|
|
5660
|
-
* console.log(`${user.username}: ${user.role}`);
|
|
5661
|
-
* }
|
|
5662
|
-
* ```
|
|
5663
|
-
*
|
|
5664
|
-
* @example Add a developer
|
|
5665
|
-
* ```typescript
|
|
5666
|
-
* await box.permissions.add({
|
|
5667
|
-
* userId: "user_abc",
|
|
5668
|
-
* role: "developer",
|
|
5669
|
-
* sshKeys: ["ssh-ed25519 AAAA..."],
|
|
5670
|
-
* });
|
|
5671
|
-
* ```
|
|
5672
|
-
*/
|
|
5673
|
-
get permissions(): PermissionsManager;
|
|
5674
|
-
private permissionsList;
|
|
5675
|
-
private permissionsGet;
|
|
5676
|
-
private permissionsAdd;
|
|
5677
|
-
private permissionsUpdate;
|
|
5678
|
-
private permissionsRemove;
|
|
5679
|
-
private permissionsSetAccessPolicies;
|
|
5680
|
-
private permissionsGetAccessPolicies;
|
|
5681
|
-
private permissionsCheckAccess;
|
|
5682
|
-
/**
|
|
5683
|
-
* Backend manager for runtime agent configuration.
|
|
5684
|
-
*
|
|
5685
|
-
* @example Check backend status
|
|
5686
|
-
* ```typescript
|
|
5687
|
-
* const status = await box.backend.status();
|
|
5688
|
-
* console.log(`Backend: ${status.type}, Status: ${status.status}`);
|
|
5689
|
-
* ```
|
|
5690
|
-
*
|
|
5691
|
-
* @example Add MCP server at runtime
|
|
5692
|
-
* ```typescript
|
|
5693
|
-
* await box.backend.addMcp("web-search", {
|
|
5694
|
-
* command: "npx",
|
|
5695
|
-
* args: ["-y", "@anthropic/web-search"],
|
|
5696
|
-
* });
|
|
5697
|
-
* ```
|
|
5698
|
-
*
|
|
5699
|
-
* @example Read provider-native Cursor metadata
|
|
5700
|
-
* ```typescript
|
|
5701
|
-
* const models = await box.backend.models();
|
|
5702
|
-
* const agents = await box.backend.agents({ limit: 20 });
|
|
5703
|
-
* const runs = await box.backend.runs(agents.items[0].agentId);
|
|
5704
|
-
* ```
|
|
5705
|
-
*/
|
|
5706
|
-
get backend(): BackendManager;
|
|
5707
|
-
private backendStatus;
|
|
5708
|
-
private backendCapabilities;
|
|
5709
|
-
private backendAddMcp;
|
|
5710
|
-
private backendGetMcpStatus;
|
|
5711
|
-
private backendUpdateConfig;
|
|
5712
|
-
private backendControlData;
|
|
5713
|
-
private backendControlAction;
|
|
5714
|
-
private backendListSearch;
|
|
5715
|
-
private backendAccount;
|
|
5716
|
-
private backendModels;
|
|
5717
|
-
private backendRepositories;
|
|
5718
|
-
private backendAgents;
|
|
5719
|
-
private backendAgent;
|
|
5720
|
-
private backendArchiveAgent;
|
|
5721
|
-
private backendUnarchiveAgent;
|
|
5722
|
-
private backendDeleteAgent;
|
|
5723
|
-
private backendRuns;
|
|
5724
|
-
private backendRun;
|
|
5725
|
-
private backendAgentMessages;
|
|
5726
|
-
private backendArtifacts;
|
|
5727
|
-
private backendDownloadArtifact;
|
|
5728
|
-
private backendRestart;
|
|
5729
|
-
/**
|
|
5730
|
-
* Process manager for spawning and controlling processes.
|
|
5731
|
-
*
|
|
5732
|
-
* Provides non-blocking process execution with real-time log streaming,
|
|
5733
|
-
* ideal for long-running tasks like ML training or dev servers.
|
|
5734
|
-
*
|
|
5735
|
-
* @example Non-blocking process
|
|
5736
|
-
* ```typescript
|
|
5737
|
-
* const proc = await box.process.spawn("python train.py", {
|
|
5738
|
-
* cwd: "/workspace",
|
|
5739
|
-
* env: { "CUDA_VISIBLE_DEVICES": "0" }
|
|
5740
|
-
* });
|
|
5741
|
-
*
|
|
5742
|
-
* // Stream logs
|
|
5743
|
-
* for await (const entry of proc.logs()) {
|
|
5744
|
-
* console.log(`[${entry.type}] ${entry.data}`);
|
|
5745
|
-
* }
|
|
5746
|
-
*
|
|
5747
|
-
* // Check status
|
|
5748
|
-
* const status = await proc.status();
|
|
5749
|
-
* console.log(`Running: ${status.running}`);
|
|
5750
|
-
*
|
|
5751
|
-
* // Kill if needed
|
|
5752
|
-
* await proc.kill();
|
|
5753
|
-
* ```
|
|
5754
|
-
*
|
|
5755
|
-
* @example Run Python code directly
|
|
5756
|
-
* ```typescript
|
|
5757
|
-
* const result = await box.process.runCode(`
|
|
5758
|
-
* import numpy as np
|
|
5759
|
-
* print(np.random.rand(10).mean())
|
|
5760
|
-
* `);
|
|
5761
|
-
* console.log(result.stdout);
|
|
5762
|
-
* ```
|
|
5763
|
-
*/
|
|
5764
|
-
get process(): ProcessManager;
|
|
5765
|
-
private processSpawn;
|
|
5766
|
-
private processRunCode;
|
|
5767
|
-
private processList;
|
|
5768
|
-
private processGet;
|
|
5769
|
-
private createProcessHandle;
|
|
5770
|
-
private parseProcessLogStream;
|
|
5771
|
-
/**
|
|
5772
|
-
* Network manager for runtime network configuration.
|
|
5773
|
-
*
|
|
5774
|
-
* @example Update network restrictions
|
|
5775
|
-
* ```typescript
|
|
5776
|
-
* // Block all outbound traffic
|
|
5777
|
-
* await box.network.update({ blockOutbound: true });
|
|
5778
|
-
*
|
|
5779
|
-
* // Or switch to allowlist mode
|
|
5780
|
-
* await box.network.update({
|
|
5781
|
-
* allowList: ["192.168.1.0/24", "8.8.8.8/32"]
|
|
5782
|
-
* });
|
|
5783
|
-
* ```
|
|
5784
|
-
*
|
|
5785
|
-
* @example Expose ports dynamically
|
|
5786
|
-
* ```typescript
|
|
5787
|
-
* const url = await box.network.exposePort(8000);
|
|
5788
|
-
* console.log(`Service available at: ${url}`);
|
|
5789
|
-
* ```
|
|
5790
|
-
*/
|
|
5791
|
-
get network(): NetworkManager;
|
|
5792
|
-
/**
|
|
5793
|
-
* Egress policy manager for controlling outbound internet access.
|
|
5794
|
-
*
|
|
5795
|
-
* @example Read current egress policy
|
|
5796
|
-
* ```typescript
|
|
5797
|
-
* const { policy, source } = await box.egress.get();
|
|
5798
|
-
* console.log(policy.mode, source);
|
|
5799
|
-
* ```
|
|
5800
|
-
*
|
|
5801
|
-
* @example Update egress policy at runtime
|
|
5802
|
-
* ```typescript
|
|
5803
|
-
* await box.egress.update({ mode: "strict", allowDomains: ["api.github.com"] });
|
|
5804
|
-
* ```
|
|
5805
|
-
*/
|
|
5806
|
-
get egress(): EgressManager;
|
|
5807
|
-
/**
|
|
5808
|
-
* On-demand GPU leases attached to this sandbox.
|
|
5809
|
-
*
|
|
5810
|
-
* The base sandbox stays cheap; `attach` starts a temporary external GPU
|
|
5811
|
-
* worker with an explicit spend cap, and `detach` destroys it.
|
|
5812
|
-
*/
|
|
5813
|
-
get gpu(): GpuLeaseManager;
|
|
5814
|
-
private networkUpdate;
|
|
5815
|
-
private networkExposePort;
|
|
5816
|
-
private networkListUrls;
|
|
5817
|
-
private networkGetConfig;
|
|
5818
|
-
private egressGet;
|
|
5819
|
-
private egressUpdate;
|
|
5820
|
-
private gpuAttach;
|
|
5821
|
-
private gpuList;
|
|
5822
|
-
private gpuExec;
|
|
5823
|
-
private gpuDetach;
|
|
5824
|
-
/**
|
|
5825
|
-
* Validate CIDR notation (IPv4 and IPv6)
|
|
5826
|
-
*/
|
|
5827
|
-
private isValidCidr;
|
|
5828
|
-
/**
|
|
5829
|
-
* Preview link management.
|
|
5830
|
-
*
|
|
5831
|
-
* Create publicly accessible HTTPS URLs for TCP ports inside the sandbox.
|
|
5832
|
-
*
|
|
5833
|
-
* @example
|
|
5834
|
-
* ```typescript
|
|
5835
|
-
* const link = await box.previewLinks.create(3000);
|
|
5836
|
-
* console.log(link.url);
|
|
5837
|
-
*
|
|
5838
|
-
* const links = await box.previewLinks.list();
|
|
5839
|
-
* await box.previewLinks.remove(link.previewId);
|
|
5840
|
-
* ```
|
|
5841
|
-
*/
|
|
5842
|
-
get previewLinks(): PreviewLinkManager;
|
|
5843
|
-
private previewLinkCreate;
|
|
5844
|
-
private previewLinkList;
|
|
5845
|
-
private previewLinkRemove;
|
|
5846
|
-
/**
|
|
5847
|
-
* Get information about the infrastructure driver for this sandbox.
|
|
5848
|
-
*
|
|
5849
|
-
* @example
|
|
5850
|
-
* ```typescript
|
|
5851
|
-
* const info = await box.getDriverInfo();
|
|
5852
|
-
* console.log(`Driver: ${info.type}, CRIU: ${info.capabilities.criu}`);
|
|
5853
|
-
* ```
|
|
5854
|
-
*/
|
|
5855
|
-
getDriverInfo(): Promise<DriverInfo>;
|
|
5856
|
-
private toolsInstall;
|
|
5857
|
-
private toolsUse;
|
|
5858
|
-
private toolsList;
|
|
5859
|
-
private toolsRun;
|
|
5860
|
-
/**
|
|
5861
|
-
* Create a snapshot of the sandbox state.
|
|
5862
|
-
* Snapshots can be used to save workspace state for later restoration.
|
|
5863
|
-
*
|
|
5864
|
-
* If `storage` is provided (BYOS3), the snapshot is created directly
|
|
5865
|
-
* directly on the sandbox and uploaded to customer-provided S3 storage.
|
|
5866
|
-
*
|
|
5867
|
-
* @param options - Snapshot options (tags, paths, storage)
|
|
5868
|
-
* @returns Snapshot result with ID and metadata
|
|
5869
|
-
*
|
|
5870
|
-
* @example Standard snapshot (our storage)
|
|
5871
|
-
* ```typescript
|
|
5872
|
-
* const snap = await box.snapshot({
|
|
5873
|
-
* tags: ["v1.0", "stable"],
|
|
5874
|
-
* });
|
|
5875
|
-
* console.log(`Snapshot: ${snap.snapshotId}`);
|
|
5876
|
-
* ```
|
|
5877
|
-
*
|
|
5878
|
-
* @example BYOS3 snapshot (customer storage)
|
|
5879
|
-
* ```typescript
|
|
5880
|
-
* const snap = await box.snapshot({
|
|
5881
|
-
* tags: ["production"],
|
|
5882
|
-
* storage: {
|
|
5883
|
-
* type: "s3",
|
|
5884
|
-
* bucket: "my-snapshots",
|
|
5885
|
-
* credentials: { accessKeyId: "...", secretAccessKey: "..." },
|
|
5886
|
-
* },
|
|
5887
|
-
* });
|
|
5888
|
-
* ```
|
|
5889
|
-
*/
|
|
5890
|
-
snapshot(options?: SnapshotOptions): Promise<SnapshotResult>;
|
|
5891
|
-
/**
|
|
5892
|
-
* List all snapshots for this sandbox.
|
|
5893
|
-
*
|
|
5894
|
-
* If `storage` is provided (BYOS3), lists snapshots from customer-provided
|
|
5895
|
-
* S3 storage.
|
|
5896
|
-
*
|
|
5897
|
-
* @param storage - Optional customer storage config for BYOS3
|
|
5898
|
-
* @returns Array of snapshot metadata
|
|
5899
|
-
*
|
|
5900
|
-
* @example List from our storage
|
|
5901
|
-
* ```typescript
|
|
5902
|
-
* const snapshots = await box.listSnapshots();
|
|
5903
|
-
* for (const snap of snapshots) {
|
|
5904
|
-
* console.log(`${snap.snapshotId}: ${snap.createdAt}`);
|
|
5905
|
-
* }
|
|
5906
|
-
* ```
|
|
5907
|
-
*
|
|
5908
|
-
* @example List from customer S3 (BYOS3)
|
|
5909
|
-
* ```typescript
|
|
5910
|
-
* const snapshots = await box.listSnapshots({
|
|
5911
|
-
* type: "s3",
|
|
5912
|
-
* bucket: "my-snapshots",
|
|
5913
|
-
* credentials: { accessKeyId: "...", secretAccessKey: "..." },
|
|
5914
|
-
* });
|
|
5915
|
-
* ```
|
|
5916
|
-
*/
|
|
5917
|
-
listSnapshots(storage?: SnapshotOptions["storage"]): Promise<SnapshotInfo[]>;
|
|
5918
|
-
revertToSnapshot(snapshotId: string): Promise<SnapshotResult>;
|
|
5919
|
-
private waitForSnapshotRestore;
|
|
5920
|
-
private waitForSnapshotVisible;
|
|
5921
|
-
deleteSnapshot(snapshotId: string): Promise<void>;
|
|
5922
|
-
/**
|
|
5923
|
-
* Restore from the latest snapshot in customer-provided storage.
|
|
5924
|
-
* Only available when using BYOS3 (calls the runtime directly).
|
|
5925
|
-
*
|
|
5926
|
-
* @param storage - Customer storage config (required)
|
|
5927
|
-
* @param destinationPath - Optional path to restore to
|
|
5928
|
-
* @returns Snapshot info if restored, null if no snapshot found
|
|
5929
|
-
*
|
|
5930
|
-
* @example Restore from customer S3
|
|
5931
|
-
* ```typescript
|
|
5932
|
-
* const result = await box.restoreFromStorage({
|
|
5933
|
-
* type: "s3",
|
|
5934
|
-
* bucket: "my-snapshots",
|
|
5935
|
-
* credentials: { accessKeyId: "...", secretAccessKey: "..." },
|
|
5936
|
-
* });
|
|
5937
|
-
*
|
|
5938
|
-
* if (result) {
|
|
5939
|
-
* console.log(`Restored from ${result.snapshotId}`);
|
|
5940
|
-
* } else {
|
|
5941
|
-
* console.log("No snapshot found");
|
|
5942
|
-
* }
|
|
5943
|
-
* ```
|
|
5944
|
-
*/
|
|
5945
|
-
restoreFromStorage(storage: SnapshotOptions["storage"], options?: RestoreSnapshotOptions): Promise<SnapshotResult | null>;
|
|
5946
|
-
/**
|
|
5947
|
-
* @deprecated CRIU checkpoints were removed. To branch live memory into
|
|
5948
|
-
* copy-on-write children of a running sandbox use {@link branch}; for durable
|
|
5949
|
-
* filesystem state use {@link snapshot}. This method now throws.
|
|
5950
|
-
*/
|
|
5951
|
-
checkpoint(): never;
|
|
5952
|
-
/**
|
|
5953
|
-
* @deprecated CRIU checkpoints were removed. List durable filesystem state
|
|
5954
|
-
* with {@link listSnapshots}. This method now throws.
|
|
5955
|
-
*/
|
|
5956
|
-
listCheckpoints(): never;
|
|
5957
|
-
/**
|
|
5958
|
-
* @deprecated CRIU checkpoints were removed. This method now throws.
|
|
5959
|
-
*/
|
|
5960
|
-
deleteCheckpoint(): never;
|
|
5961
|
-
/**
|
|
5962
|
-
* @deprecated Forking from a CRIU checkpoint was removed. Use {@link branch}
|
|
5963
|
-
* to fork a running sandbox's live memory into copy-on-write children, or
|
|
5964
|
-
* `client.create({ fromSnapshot })` to provision from durable disk state.
|
|
5965
|
-
* This method now throws.
|
|
5966
|
-
*/
|
|
5967
|
-
fork(): never;
|
|
5968
|
-
/**
|
|
5969
|
-
* Branch this RUNNING sandbox into `count` copy-on-write children
|
|
5970
|
-
* (Morph Infinibranch parity). Unlike {@link fork} — which rehydrates one
|
|
5971
|
-
* sandbox from a CRIU checkpoint — branch forks the live VM's memory into
|
|
5972
|
-
* many children at once via Firecracker UFFD copy-on-write: the children
|
|
5973
|
-
* share the parent's clean pages instead of each copying full guest
|
|
5974
|
-
* memory. The parent stays running.
|
|
5975
|
-
*
|
|
5976
|
-
* @param count - Number of children to create (must be >= 1).
|
|
5977
|
-
* @param options - Per-child overrides.
|
|
5978
|
-
* @returns Exactly `count` new sandbox instances.
|
|
5979
|
-
*
|
|
5980
|
-
* @example
|
|
5981
|
-
* ```typescript
|
|
5982
|
-
* const [a, b, c] = await box.branch(3);
|
|
5983
|
-
* // a, b, c each share box's memory state at branch time
|
|
5984
|
-
* ```
|
|
5985
|
-
*/
|
|
5986
|
-
branch(count: number, options?: BranchOptions): Promise<SandboxInstance[]>;
|
|
5987
|
-
/**
|
|
5988
|
-
* Stop the sandbox (keeps state for resume).
|
|
5989
|
-
*/
|
|
5990
|
-
stop(): Promise<void>;
|
|
5991
|
-
/**
|
|
5992
|
-
* Resume a stopped sandbox.
|
|
5993
|
-
*/
|
|
5994
|
-
resume(options?: ResumeOptions): Promise<void>;
|
|
5995
|
-
/**
|
|
5996
|
-
* Delete the sandbox permanently.
|
|
5997
|
-
*/
|
|
5998
|
-
delete(): Promise<void>;
|
|
5999
|
-
/**
|
|
6000
|
-
* keepAlive is intentionally unavailable until the API exposes timeout updates.
|
|
6001
|
-
* @param seconds - Reserved for future support
|
|
6002
|
-
*/
|
|
6003
|
-
keepAlive(_seconds?: number): Promise<void>;
|
|
6004
|
-
/**
|
|
6005
|
-
* Upload a local directory to the sandbox via tar.
|
|
6006
|
-
* @param localPath - Local directory path to upload
|
|
6007
|
-
* @param remotePath - Destination path in the sandbox (default: /home/user)
|
|
6008
|
-
*/
|
|
6009
|
-
uploadDirectory(localPath: string, remotePath?: string): Promise<void>;
|
|
6010
|
-
/**
|
|
6011
|
-
* Wait for the sandbox to reach a specific status.
|
|
6012
|
-
*
|
|
6013
|
-
* When `onProgress` is provided and the sandbox is still provisioning,
|
|
6014
|
-
* uses SSE events for real-time progress instead of polling. Falls back
|
|
6015
|
-
* to polling if the SSE connection fails or is unavailable.
|
|
6016
|
-
*
|
|
6017
|
-
* @example Basic wait
|
|
6018
|
-
* ```typescript
|
|
6019
|
-
* await box.waitFor("running");
|
|
6020
|
-
* ```
|
|
6021
|
-
*
|
|
6022
|
-
* @example Wait with progress tracking
|
|
6023
|
-
* ```typescript
|
|
6024
|
-
* await box.waitFor("running", {
|
|
6025
|
-
* onProgress: (event) => {
|
|
6026
|
-
* console.log(`[${event.step}] ${event.status} — ${event.message}`);
|
|
6027
|
-
* if (event.percent !== undefined) {
|
|
6028
|
-
* updateProgressBar(event.percent);
|
|
6029
|
-
* }
|
|
6030
|
-
* },
|
|
6031
|
-
* });
|
|
6032
|
-
* ```
|
|
6033
|
-
*/
|
|
6034
|
-
waitFor(status: SandboxStatus | SandboxStatus[], options?: WaitForOptions): Promise<void>;
|
|
6035
|
-
/**
|
|
6036
|
-
* SSE-based wait implementation. Subscribes to provisioning events and
|
|
6037
|
-
* delivers progress callbacks while waiting for a target status.
|
|
6038
|
-
*/
|
|
6039
|
-
private waitForWithSSE;
|
|
6040
|
-
private ensureRunning;
|
|
6041
|
-
private runtimeFetch;
|
|
6042
|
-
/**
|
|
6043
|
-
* Delegates to the shared `parseSSEStream` in `lib/sse-parser.ts`
|
|
6044
|
-
* — one canonical SSE implementation for the whole SDK. The
|
|
6045
|
-
* shared parser throws `AbortError` on cancellation (so consumers
|
|
6046
|
-
* can distinguish cancel from clean EOF), but agent/task streaming
|
|
6047
|
-
* callers of this method historically relied on a silent-return
|
|
6048
|
-
* abort: they check `options?.signal?.aborted` AFTER the loop and
|
|
6049
|
-
* decide whether to reconnect. The try/catch below preserves that
|
|
6050
|
-
* legacy contract by swallowing AbortError at the delegate layer.
|
|
6051
|
-
*/
|
|
6052
|
-
private parseSSEStream;
|
|
6053
|
-
/**
|
|
6054
|
-
* Associate a session ID with a user ID so the Sandbox API can route
|
|
6055
|
-
* subsequent WebSocket connections to this sandbox.
|
|
6056
|
-
*
|
|
6057
|
-
* @param opts - Session and user identifiers
|
|
6058
|
-
*
|
|
6059
|
-
* @example
|
|
6060
|
-
* ```typescript
|
|
6061
|
-
* await box.registerSessionMapping({
|
|
6062
|
-
* sessionId: "sess_abc",
|
|
6063
|
-
* userId: "user_123",
|
|
6064
|
-
* });
|
|
6065
|
-
* ```
|
|
6066
|
-
*/
|
|
6067
|
-
registerSessionMapping(opts: {
|
|
6068
|
-
sessionId: string;
|
|
6069
|
-
userId: string; /** The runtime (sidecar) session id this agent session routes to. */
|
|
6070
|
-
runtimeSessionId: string; /** Optional container id for direct routing. */
|
|
6071
|
-
sidecarId?: string; /** Optional projectRef so the server can detect a stale sidecar. */
|
|
6072
|
-
projectRef?: string;
|
|
6073
|
-
}): Promise<SessionMappingResult>;
|
|
6074
|
-
/**
|
|
6075
|
-
* Remove the sidecar session mapping for an agent session. Sandbox deletion
|
|
6076
|
-
* also cleans mappings, so this is only needed to release a mapping while the
|
|
6077
|
-
* sandbox stays alive.
|
|
6078
|
-
*/
|
|
6079
|
-
unregisterSessionMapping(opts: {
|
|
6080
|
-
sessionId: string;
|
|
6081
|
-
userId: string;
|
|
6082
|
-
}): Promise<{
|
|
6083
|
-
success: boolean;
|
|
6084
|
-
sessionId: string;
|
|
6085
|
-
}>;
|
|
6086
|
-
private parseInfo;
|
|
6087
|
-
private sleep;
|
|
6088
|
-
/**
|
|
6089
|
-
* Get a session reference bound to this sandbox. Lazy: does not hit the
|
|
6090
|
-
* network until you call a method on the returned `SandboxSession`.
|
|
6091
|
-
* Use {@link sessions} to discover existing session ids.
|
|
6092
|
-
*/
|
|
6093
|
-
session(id: string): SandboxSession;
|
|
6094
|
-
/** Create an agent session and return both its handle and initial metadata. */
|
|
6095
|
-
createSession(options: CreateSessionOptions): Promise<{
|
|
6096
|
-
session: SandboxSession;
|
|
6097
|
-
info: SessionInfo;
|
|
6098
|
-
}>;
|
|
6099
|
-
/** Delete an agent session by id. */
|
|
6100
|
-
deleteSession(id: string): Promise<void>;
|
|
6101
|
-
/** Get a lazy background-task session reference. */
|
|
6102
|
-
taskSession(id: string): SandboxTaskSession;
|
|
6103
|
-
/** Create a background task session. Dispatch work with `session.sendMessage()`. */
|
|
6104
|
-
createTaskSession(options: CreateTaskSessionOptions): Promise<{
|
|
6105
|
-
session: SandboxTaskSession;
|
|
6106
|
-
info: TaskSessionInfo;
|
|
6107
|
-
}>;
|
|
6108
|
-
/**
|
|
6109
|
-
* List sessions on this sandbox, optionally filtering by status. Returns
|
|
6110
|
-
* `SandboxSession` instances paired with their last-known
|
|
6111
|
-
* {@link SessionInfo} so callers can avoid an extra round-trip per
|
|
6112
|
-
* session for status.
|
|
6113
|
-
*/
|
|
6114
|
-
sessions(opts?: SessionListOptions): Promise<Array<{
|
|
6115
|
-
session: SandboxSession;
|
|
6116
|
-
info: SessionInfo;
|
|
6117
|
-
}>>;
|
|
6118
|
-
/**
|
|
6119
|
-
* Dispatch a prompt and return immediately with the session id (Issue
|
|
6120
|
-
* #913 Gap 2). The sandbox keeps running the prompt after this call
|
|
6121
|
-
* returns; reconnect via `box.session(id).events()` or wait for
|
|
6122
|
-
* completion with `box.session(id).result()`.
|
|
6123
|
-
*
|
|
6124
|
-
* Idempotent on `opts.sessionId`: re-dispatching with the same id when
|
|
6125
|
-
* the session is already running is a lookup, not a re-create. This
|
|
6126
|
-
* lets queue retries and reconnect-after-Worker-restart be safe by
|
|
6127
|
-
* construction.
|
|
6128
|
-
*/
|
|
6129
|
-
dispatchPrompt(message: string | PromptInputPart[], opts?: DispatchPromptOptions): Promise<DispatchedSession>;
|
|
6130
|
-
/**
|
|
6131
|
-
* List messages for a session, including in-flight assistant content
|
|
6132
|
-
* the agent is still streaming. Each entry's `metadata` carries the
|
|
6133
|
-
* durability marker — `status: "streaming" | "completed" | "interrupted"`,
|
|
6134
|
-
* `completed/interrupted` booleans, and the caller-supplied `turnId`
|
|
6135
|
-
* when one was set. See `SessionMessage` for the full contract.
|
|
6136
|
-
*
|
|
6137
|
-
* Polling this is the right way to detect "did the sidecar die mid-
|
|
6138
|
-
* turn?" — a SIGKILL leaves the assistant message with `status:
|
|
6139
|
-
* "streaming"` and no `completed`/`interrupted` marker; a graceful
|
|
6140
|
-
* abort stamps `interrupted: true` explicitly.
|
|
6141
|
-
*/
|
|
6142
|
-
messages(opts: ListMessagesOptions): Promise<SessionMessage[]>;
|
|
6143
|
-
/** @internal — invoked by SandboxSession.sendMessage(). */
|
|
6144
|
-
_sessionSendMessage(id: string, request: SendSessionMessageRequest, options?: SendSessionMessageOptions): Promise<SentSessionMessage>;
|
|
6145
|
-
/** @internal — invoked by SandboxSession.delete(). */
|
|
6146
|
-
_sessionDelete(id: string): Promise<void>;
|
|
6147
|
-
/** @internal — invoked by SandboxTaskSession.changes(). */
|
|
6148
|
-
_taskSessionChanges(id: string): Promise<TaskSessionChanges>;
|
|
6149
|
-
/** @internal — invoked by SandboxTaskSession.commit(). */
|
|
6150
|
-
_taskSessionCommit(id: string, options?: CommitTaskSessionOptions): Promise<TaskSessionCommitResult>;
|
|
6151
|
-
_sessionFork(id: string, opts?: SessionForkOptions): Promise<SessionInfo>;
|
|
6152
|
-
/**
|
|
6153
|
-
* Look up a cached turn result by idempotency key. Returns the cached
|
|
6154
|
-
* payload if a turn with this `turnId` previously completed on the
|
|
6155
|
-
* given session; returns `null` if no such turn has finished yet
|
|
6156
|
-
* (either it never started, or it interrupted before completion).
|
|
6157
|
-
*
|
|
6158
|
-
* Call this before re-issuing a `streamPrompt` / `prompt` / `task`
|
|
6159
|
-
* that you might be retrying — a non-null result means the original
|
|
6160
|
-
* attempt finished and you can return that to your caller instead of
|
|
6161
|
-
* running the agent a second time. Only turns that reach the
|
|
6162
|
-
* `completed` terminal state are cached; interrupted turns are not.
|
|
6163
|
-
*/
|
|
6164
|
-
findCompletedTurn(turnId: string, opts: {
|
|
6165
|
-
sessionId: string;
|
|
6166
|
-
}): Promise<CompletedTurnResult | null>;
|
|
6167
|
-
/**
|
|
6168
|
-
* Drive a detached turn forward by exactly one settle → poll → dispatch
|
|
6169
|
-
* pass and report where it stands. Built for tick-based callers —
|
|
6170
|
-
* Cloudflare Workflows steps, queue consumers, crons — that re-invoke
|
|
6171
|
-
* on their own schedule instead of holding a stream open. One
|
|
6172
|
-
* invocation never loops, never sleeps, and never keeps a connection
|
|
6173
|
-
* alive past the pass.
|
|
6174
|
-
*
|
|
6175
|
-
* The pass resolves to the first of:
|
|
6176
|
-
* 1. The completed-turn cache has `turnId` → `completed`, or `failed`
|
|
6177
|
-
* when the cached payload carries no text — that result is final,
|
|
6178
|
-
* so a retry cannot improve it.
|
|
6179
|
-
* 2. The session is queued/running → `running`, after enforcing
|
|
6180
|
-
* `wallCapMs`: a session past the cap is cancelled and reported
|
|
6181
|
-
* `failed`.
|
|
6182
|
-
* 3. The session is terminal without a cached turn → settle from the
|
|
6183
|
-
* session result; an unsuccessful result is `failed`.
|
|
6184
|
-
* 4. No session exists → dispatch fire-and-detach (idempotent on
|
|
6185
|
-
* `sessionId`, exactly like `dispatchPrompt`) → `running`.
|
|
6186
|
-
*
|
|
6187
|
-
* `failed` is always deterministic: re-invoking with the same ids
|
|
6188
|
-
* returns the same outcome rather than starting a second agent run, so
|
|
6189
|
-
* callers can treat it as terminal without their own retry bookkeeping.
|
|
6190
|
-
*/
|
|
6191
|
-
driveTurn(message: string | PromptInputPart[], opts: DriveTurnOptions): Promise<TurnDriveResult>;
|
|
6192
|
-
/**
|
|
6193
|
-
* Mint a scoped, time-bounded JWT for direct browser access to this
|
|
6194
|
-
* sandbox (Issue #913 Gap 1). Authority is the caller's
|
|
6195
|
-
* `TANGLE_API_KEY` (sk-tan-*) — the Sandbox API mints the token;
|
|
6196
|
-
* signing secrets stay server-side.
|
|
6197
|
-
*
|
|
6198
|
-
* Use this to give a browser direct read access to the sandbox without
|
|
6199
|
-
* leaking the full bearer (`box.connection.authToken`). The returned
|
|
6200
|
-
* token verifies against the same sidecar middleware that already
|
|
6201
|
-
* gates ProductTokenIssuer-issued JWTs — no new sidecar surface.
|
|
6202
|
-
*/
|
|
6203
|
-
mintScopedToken(opts: MintScopedTokenOptions): Promise<ScopedToken>;
|
|
6204
|
-
/** @internal — invoked by SandboxSession.status(). */
|
|
6205
|
-
_sessionStatus(id: string): Promise<SessionInfo | null>;
|
|
6206
|
-
/** @internal — invoked by SandboxSession.events(). */
|
|
6207
|
-
_sessionEvents(id: string, opts?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
|
|
6208
|
-
/** @internal — invoked by SandboxSession.result(). */
|
|
6209
|
-
_sessionResult(id: string): Promise<PromptResult>;
|
|
6210
|
-
/**
|
|
6211
|
-
* @internal — invoked by SandboxSession.cancel(). Void-returning alias of
|
|
6212
|
-
* `_interrupt`: both abort the in-flight execution via `POST /{id}/abort`
|
|
6213
|
-
* (the session and its messages are preserved). `cancel()` discards the
|
|
6214
|
-
* `cancelled` flag; callers that need to distinguish a real interruption
|
|
6215
|
-
* from a no-op should use `interrupt()`.
|
|
6216
|
-
*/
|
|
6217
|
-
_sessionCancel(id: string): Promise<void>;
|
|
6218
|
-
/** @internal — invoked by InteractiveSessionHandle.start(). */
|
|
6219
|
-
_startInteractive(id: string, options: StartInteractiveOptions): Promise<InteractiveSessionInfo>;
|
|
6220
|
-
/** @internal — invoked by InteractiveSessionHandle.sendPrompt(). */
|
|
6221
|
-
_sendInteractivePrompt(id: string, prompt: string): Promise<void>;
|
|
6222
|
-
/** @internal — invoked by InteractiveSessionHandle.stop(). */
|
|
6223
|
-
_stopInteractive(id: string): Promise<void>;
|
|
6224
|
-
/** @internal — invoked by SandboxSession.respondToPermission(). */
|
|
6225
|
-
_respondToPermission(id: string, permissionID: string, options: RespondToPermissionOptions): Promise<void>;
|
|
6226
|
-
/** @internal — invoked by SandboxSession.interrupt(). */
|
|
6227
|
-
_interrupt(id: string): Promise<InterruptResult>;
|
|
6228
|
-
/**
|
|
6229
|
-
* @internal — invoked by SandboxSession.answer(). Resolves the session's
|
|
6230
|
-
* outstanding question interaction and posts the answer through the
|
|
6231
|
-
* interaction response route. The positional answer arrays map onto the
|
|
6232
|
-
* question's `answerSpec` fields in order.
|
|
6233
|
-
*/
|
|
6234
|
-
_answerQuestion(id: string, answers: Record<string, string[]>): Promise<void>;
|
|
6235
|
-
}
|
|
6236
|
-
//#endregion
|
|
6237
|
-
export { CodeExecutionResult as $, AgentProfileFileMount as $i, ReconcileSandboxFleetsResult as $n, SandboxTraceOptions as $r, GitDiff as $t, AddUserOptions as A, TaskSessionFileChange as Ai, PreviewLinkInfo as An, SandboxFleetWorkspace as Ar, FileReadBatchOptions as At, BatchBackendStats as B, TurnDriveResult as Bi, PromptOptions as Bn, SandboxResourceUsage as Br, FleetDispatchResultBuffer as Bt, SandboxMcpConfig as C, StartupOperation as Ci, MintScopedTokenOptions as Cn, SandboxFleetPolicy as Cr, DriverType as Ct, buildSandboxMcpConfig as D, TaskResult as Di, NonHostAgentDriverConfig as Dn, SandboxFleetTraceExport as Dr, ExecOptions as Dt, buildControlPlaneMcpConfig as E, TaskOptions as Ei, NetworkManager as En, SandboxFleetTraceEvent as Er, EventStreamOptions as Et, BackendInfo as F, TeeAttestationResponse as Fi, ProcessManager as Fn, SandboxIntelligenceEnvelope as Fr, FileTreeFile as Ft, BatchRunOptions as G, WaitForOptions as Gi, ProvisionStep as Gn, SandboxStatus as Gr, FleetMachineId as Gt, BatchEventDataMap as H, UploadOptions as Hi, ProvisionEvent as Hn, SandboxRuntimeHealth as Hr, FleetDispatchStreamOptions as Ht, BackendManager as I, TeePublicKey as Ii, ProcessSignal as In, SandboxPermissionsConfig as Ir, FileTreeOptions as It, BatchTask as J, WriteManyOptions as Ji, PublishPublicTemplateOptions as Jn, SandboxTerminalManager as Jr, GPU_LEASE_PROVIDER_NAMES as Jt, BatchRunRequest as K, WriteFileOptions as Ki, PublicTemplateInfo as Kn, SandboxTerminalCreateOptions as Kr, FleetPromptDispatchOptions as Kt, BackendStatus as L, TeePublicKeyResponse as Li, ProcessSpawnOptions as Ln, SandboxPortBinding as Lr, FileTreeResult as Lt, AttachSandboxFleetMachineOptions as M, TaskSessionProfile as Mi, Process as Mn, SandboxFleetWorkspaceRestoreResult as Mr, FileReadError as Mt, BackendCapabilities as N, TeeAttestationOptions as Ni, ProcessInfo as Nn, SandboxFleetWorkspaceSnapshotResult as Nr, FileReadResult as Nt, AcceleratorKind as O, TaskSessionChanges as Oi, PermissionLevel as On, SandboxFleetTraceOptions as Or, ExecResult as Ot, BackendConfig as P, TeeAttestationReport as Pi, ProcessLogEntry as Pn, SandboxInfo as Pr, FileSystem as Pt, CodeExecutionOptions as Q, AgentProfileConnection as Qi, ReconcileSandboxFleetsOptions as Qn, SandboxTraceExport as Qr, GitConfig as Qt, BackendType as R, TokenRefreshHandler as Ri, ProcessStatus as Rn, SandboxPortPreviewLink as Rr, FileWriteResult as Rt, SANDBOX_MCP_SERVER_NAME as S, StartupDiagnostics as Si, McpServerConfig as Sn, SandboxFleetOperationsSummary as Sr, DriverInfo as St, SandboxMcpServerEntry as T, SubscriptionInfo as Ti, NetworkConfig as Tn, SandboxFleetTraceBundle as Tr, EgressPolicy as Tt, BatchOptions as U, UploadProgress as Ui, ProvisionResult as Un, SandboxRuntimeProfile as Ur, FleetExecDispatchOptions as Ut, BatchEvent as V, UpdateUserOptions as Vi, PromptResult as Vn, SandboxResources as Vr, FleetDispatchResultBufferOptions as Vt, BatchResult as W, UsageInfo as Wi, ProvisionStatus as Wn, SandboxRuntimeProfileList as Wr, FleetExecDispatchResult as Wt, BatchTaskUsage as X, AgentProfileCapabilities as Xi, ReapExpiredSandboxFleetsOptions as Xn, SandboxTraceBundle as Xr, GitBranch as Xt, BatchTaskResult as Y, AgentProfile as Yi, PublishPublicTemplateVersionOptions as Yn, SandboxTerminalRequestOptions as Yr, GitAuth as Yt, BranchOptions as Z, AgentProfileConfidential as Zi, ReapExpiredSandboxFleetsResult as Zn, SandboxTraceEvent as Zr, GitCommit as Zt, RespondToPermissionOptions as _, SessionStatus as _i, IntelligenceReportWindow as _n, SandboxFleetMachineMeteredUsage as _r, DispatchedSession as _t, TraceExportSink as a, AgentProfileResources as aa, SecretInfo as ai, GpuLeaseExecResult as an, SandboxEnvironment as ar, CreateGpuLeaseOptions as at, BuildSandboxMcpConfigOptions as b, SnapshotResult as bi, ListSandboxFleetOptions as bn, SandboxFleetManifest as br, DriveTurnOptions as bt, otelTraceIdForTangleTrace as c, AgentSubagentProfile as ca, SendSessionMessageRequest as ci, GpuLeaseStatus as cn, SandboxFleetArtifactSpec as cr, CreateSandboxFleetOptions as ct, SandboxSession as d, defineInlineResource as da, SessionEventStreamOptions as di, HostAgentRuntimeBackend as dn, SandboxFleetDispatchResponse as dr, CreateSandboxOptions as dt, AgentProfileMcpServer as ea, SandboxUser as ei, GitStatus as en, RunCodeOptions as er, CodeLanguage as et, InteractiveAuthFile as f, mergeAgentProfiles as fa, SessionForkOptions as fi, InstalledTool as fn, SandboxFleetDriverCapability as fr, CreateSessionOptions as ft, InterruptResult as g, SessionMessageInputPart as gi, IntelligenceReportSubjectType as gn, SandboxFleetMachine as gr, DispatchPromptOptions as gt, InteractiveSessionInfo as h, SessionMessage as hi, IntelligenceReportCompareTo as hn, SandboxFleetIntelligenceEnvelope as hr, DirectoryPermission as ht, TraceExportResult as i, AgentProfileResourceRef as ia, SearchOptions as ii, GpuLeaseExecOptions as in, SandboxConnection as ir, CompletedTurnResult as it, AttachGpuLeaseOptions as j, TaskSessionInfo as ji, PreviewLinkManager as jn, SandboxFleetWorkspaceReconcileResult as jr, FileReadBatchResult as jt, AccessPolicyRule as k, TaskSessionCommitResult as ki, PermissionsManager as kn, SandboxFleetUsage as kr, FileInfo as kt, toOtelJson as l, defineAgentProfile as la, SentSessionMessage as li, GpuType as ln, SandboxFleetCostEstimate as lr, CreateSandboxFleetTokenOptions as lt, InteractiveSessionHost as m, SessionListOptions as mi, IntelligenceReportBudget as mn, SandboxFleetInfo as mr, DeleteOptions as mt, SandboxInstance as n, AgentProfilePermissionValue as na, ScopedTokenScope as ni, GpuLeaseBilling as nn, SSHCredentials as nr, CodeResultPart as nt, buildTraceExportPayload as o, AgentProfileValidationIssue as oa, SecretsManager as oi, GpuLeaseManager as on, SandboxEvent as or, CreateIntelligenceReportOptions as ot, InteractiveSessionHandle as p, SessionInfo as pi, IntelligenceReport as pn, SandboxFleetDriverTimings as pr, CreateTaskSessionOptions as pt, BatchSidecarGroup as q, WriteManyFile as qi, PublicTemplateVersionInfo as qn, SandboxTerminalInfo as qr, FleetPromptDispatchResult as qt, TraceExportFormat as r, AgentProfilePrompt as ra, SearchMatch as ri, GpuLeaseCommandResult as rn, SandboxClientConfig as rr, CommitTaskSessionOptions as rt, exportTraceBundle as s, AgentProfileValidationResult as sa, SendSessionMessageOptions as si, GpuLeaseProviderName as sn, SandboxFleetArtifact as sr, CreateRequestOptions as st, HttpClient as t, AgentProfileModelHints as ta, ScopedToken as ti, GpuLease as tn, SSHCommandDescriptor as tr, CodeResult as tt, SandboxTaskSession as u, defineGitHubResource as ua, SessionBackendCredentials as ui, HostAgentDriverConfig as un, SandboxFleetDispatchFailureClass as ur, CreateSandboxFleetWithCoordinatorOptions as ut, StartInteractiveOptions as v, SnapshotInfo as vi, ListMessagesOptions as vn, SandboxFleetMachineRecord as vr, DownloadOptions as vt, SandboxMcpEndpoint as w, StorageConfig as wi, MkdirOptions as wn, SandboxFleetToken as wr, EgressManager as wt, CONTROL_PLANE_MCP_SERVER_NAME as x, SshKeysManager as xi, ListSandboxOptions as xn, SandboxFleetManifestMachine as xr, DriverConfig as xt, BuildControlPlaneMcpConfigOptions as y, SnapshotOptions as yi, ListOptions as yn, SandboxFleetMachineSpec as yr, DownloadProgress as yt, BatchBackend as z, ToolsConfig as zi, PromptInputPart as zn, SandboxProfileSummary as zr, FleetDispatchCancelResult as zt };
|
|
4752
|
+
export { EventStreamOptions as $, SandboxFleetPolicy as $n, StartupOperation as $r, NetworkConfig as $t, CommitTaskSessionOptions as A, AgentProfileMcpServer as Ai, RunCodeOptions as An, SandboxUser as Ar, GpuLeaseCommandResult as At, CreateTaskSessionOptions as B, defineGitHubResource as Bi, SandboxFleetDispatchFailureClass as Bn, SessionBackendCredentials as Br, IntelligenceReport as Bt, BatchTaskUsage as C, WriteManyFile as Ci, PublishPublicTemplateVersionOptions as Cn, SandboxTerminalInfo as Cr, GitBranch as Ct, CodeLanguage as D, AgentProfileConfidential as Di, ReconcileSandboxFleetsResult as Dn, SandboxTraceEvent as Dr, GitStatus as Dt, CodeExecutionResult as E, AgentProfileCapabilities as Ei, ReconcileSandboxFleetsOptions as En, SandboxTraceBundle as Er, GitDiff as Et, CreateSandboxFleetOptions as F, AgentProfileResources as Fi, SandboxEnvironment as Fn, SecretInfo as Fr, GpuLeaseStatus as Ft, DownloadOptions as G, SandboxFleetIntelligenceEnvelope as Gn, SessionMessage as Gr, JsonValue as Gt, DirectoryPermission as H, mergeAgentProfiles as Hi, SandboxFleetDriverCapability as Hn, SessionForkOptions as Hr, IntelligenceReportCompareTo as Ht, CreateSandboxFleetTokenOptions as I, AgentProfileValidationIssue as Ii, SandboxEvent as In, SecretsManager as Ir, GpuType as It, DriverConfig as J, SandboxFleetMachineRecord as Jn, SnapshotInfo as Jr, ListSandboxFleetOptions as Jt, DownloadProgress as K, SandboxFleetMachine as Kn, SessionMessageInputPart as Kr, ListMessagesOptions as Kt, CreateSandboxFleetWithCoordinatorOptions as L, AgentProfileValidationResult as Li, SandboxFleetArtifact as Ln, SendSessionMessageOptions as Lr, HostAgentDriverConfig as Lt, CreateGpuLeaseOptions as M, AgentProfilePermissionValue as Mi, SSHCredentials as Mn, ScopedTokenScope as Mr, GpuLeaseExecResult as Mt, CreateIntelligenceReportOptions as N, AgentProfilePrompt as Ni, SandboxClientConfig as Nn, SearchMatch as Nr, GpuLeaseManager as Nt, CodeResult as O, AgentProfileConnection as Oi, RestoreSnapshotOptions as On, SandboxTraceExport as Or, GpuLease as Ot, CreateRequestOptions as P, AgentProfileResourceRef as Pi, SandboxConnection as Pn, SearchOptions as Pr, GpuLeaseProviderName as Pt, EgressPolicy as Q, SandboxFleetOperationsSummary as Qn, StartupDiagnostics as Qr, MkdirOptions as Qt, CreateSandboxOptions as R, AgentSubagentProfile as Ri, SandboxFleetArtifactSpec as Rn, SendSessionMessageRequest as Rr, HostAgentRuntimeBackend as Rt, BatchTaskResult as S, WriteFileOptions as Si, PublishPublicTemplateOptions as Sn, SandboxTerminalCreateOptions as Sr, GitAuth as St, CodeExecutionOptions as T, AgentProfile as Ti, ReapExpiredSandboxFleetsResult as Tn, SandboxTerminalRequestOptions as Tr, GitConfig as Tt, DispatchPromptOptions as U, SandboxFleetDriverTimings as Un, SessionInfo as Ur, IntelligenceReportSubjectType as Ut, DeleteOptions as V, defineInlineResource as Vi, SandboxFleetDispatchResponse as Vn, SessionEventStreamOptions as Vr, IntelligenceReportBudget as Vt, DispatchedSession as W, SandboxFleetInfo as Wn, SessionListOptions as Wr, IntelligenceReportWindow as Wt, DriverType as X, SandboxFleetManifest as Xn, SnapshotResult as Xr, McpServerConfig as Xt, DriverInfo as Y, SandboxFleetMachineSpec as Yn, SnapshotOptions as Yr, ListSandboxOptions as Yt, EgressManager as Z, SandboxFleetManifestMachine as Zn, SshKeysManager as Zr, MintScopedTokenOptions as Zt, BatchResult as _, UpdateUserOptions as _i, ProvisionResult as _n, SandboxResources as _r, FleetExecDispatchResult as _t, AttachSandboxFleetMachineOptions as a, TaskSessionCommitResult as ai, PreviewLinkManager as an, SandboxFleetUsage as ar, FileReadError as at, BatchSidecarGroup as b, UsageInfo as bi, PublicTemplateInfo as bn, SandboxRuntimeProfileList as br, FleetPromptDispatchResult as bt, BackendInfo as c, TaskSessionProfile as ci, ProcessLogEntry as cn, SandboxFleetWorkspaceRestoreResult as cr, FileTreeFile as ct, BackendType as d, TeeAttestationResponse as di, ProcessSpawnOptions as dn, SandboxIntelligenceEnvelope as dr, FileWriteResult as dt, StorageConfig as ei, NetworkManager as en, SandboxFleetToken as er, ExecOptions as et, BatchBackend as f, TeePublicKey as fi, ProcessStatus as fn, SandboxPermissionsConfig as fr, FleetDispatchCancelResult as ft, BatchOptions as g, TurnDriveResult as gi, ProvisionEvent as gn, SandboxResourceUsage as gr, FleetExecDispatchOptions as gt, BatchEventDataMap as h, ToolsConfig as hi, PromptResult as hn, SandboxProfileSummary as hr, FleetDispatchStreamOptions as ht, AttachGpuLeaseOptions as i, TaskSessionChanges as ii, PreviewLinkInfo as in, SandboxFleetTraceOptions as ir, FileReadBatchResult as it, CompletedTurnResult as j, AgentProfileModelHints as ji, SSHCommandDescriptor as jn, ScopedToken as jr, GpuLeaseExecOptions as jt, CodeResultPart as k, AgentProfileFileMount as ki, ResumeOptions as kn, SandboxTraceOptions as kr, GpuLeaseBilling as kt, BackendManager as l, TeeAttestationOptions as li, ProcessManager as ln, SandboxFleetWorkspaceSnapshotResult as lr, FileTreeOptions as lt, BatchEvent as m, TokenRefreshHandler as mi, PromptOptions as mn, SandboxPortPreviewLink as mr, FleetDispatchResultBufferOptions as mt, AccessPolicyRule as n, TaskOptions as ni, PermissionLevel as nn, SandboxFleetTraceEvent as nr, FileInfo as nt, BackendCapabilities as o, TaskSessionFileChange as oi, Process as on, SandboxFleetWorkspace as or, FileReadResult as ot, BatchBackendStats as p, TeePublicKeyResponse as pi, PromptInputPart as pn, SandboxPortBinding as pr, FleetDispatchResultBuffer as pt, DriveTurnOptions as q, SandboxFleetMachineMeteredUsage as qn, SessionStatus as qr, ListOptions as qt, AddUserOptions as r, TaskResult as ri, PermissionsManager as rn, SandboxFleetTraceExport as rr, FileReadBatchOptions as rt, BackendConfig as s, TaskSessionInfo as si, ProcessInfo as sn, SandboxFleetWorkspaceReconcileResult as sr, FileSystem as st, AcceleratorKind as t, SubscriptionInfo as ti, NonHostAgentDriverConfig as tn, SandboxFleetTraceBundle as tr, ExecResult as tt, BackendStatus as u, TeeAttestationReport as ui, ProcessSignal as un, SandboxInfo as ur, FileTreeResult as ut, BatchRunOptions as v, UploadOptions as vi, ProvisionStatus as vn, SandboxRuntimeHealth as vr, FleetMachineId as vt, BranchOptions as w, WriteManyOptions as wi, ReapExpiredSandboxFleetsOptions as wn, SandboxTerminalManager as wr, GitCommit as wt, BatchTask as x, WaitForOptions as xi, PublicTemplateVersionInfo as xn, SandboxStatus as xr, GPU_LEASE_PROVIDER_NAMES as xt, BatchRunRequest as y, UploadProgress as yi, ProvisionStep as yn, SandboxRuntimeProfile as yr, FleetPromptDispatchOptions as yt, CreateSessionOptions as z, defineAgentProfile as zi, SandboxFleetCostEstimate as zn, SentSessionMessage as zr, InstalledTool as zt };
|