@tangle-network/sandbox 0.9.4-develop.20260710200846.ca3d375 → 0.9.4-develop.20260711011249.9d3b3b3

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.
@@ -794,6 +794,110 @@ interface SandboxInfo {
794
794
  /** Source of the egress policy */
795
795
  egressPolicySource?: "sandbox" | "team" | "platform";
796
796
  }
797
+ /** Basic health reported by the runtime inside a sandbox. */
798
+ interface SandboxRuntimeHealth {
799
+ status: string;
800
+ docker: {
801
+ enabled: boolean;
802
+ status: string;
803
+ dockerHost?: string;
804
+ error?: string;
805
+ };
806
+ backends: {
807
+ total: number;
808
+ byType: Record<string, number>;
809
+ pending: number;
810
+ };
811
+ timestamp: string;
812
+ }
813
+ /** Public preview link associated with a listening runtime port. */
814
+ interface SandboxPortPreviewLink {
815
+ previewId: string;
816
+ url: string;
817
+ status: string;
818
+ }
819
+ /** One process listening on a port inside a sandbox. */
820
+ interface SandboxPortBinding {
821
+ pid: number;
822
+ processName: string;
823
+ commandPath: string;
824
+ port: number;
825
+ protocol: "tcp" | "udp";
826
+ localAddress: string;
827
+ family: "tcp4" | "tcp6" | "udp4" | "udp6";
828
+ allowlisted: boolean;
829
+ firstSeenAt: string;
830
+ lastSeenAt: string;
831
+ previewLink?: SandboxPortPreviewLink;
832
+ }
833
+ /** Options for creating an interactive terminal. */
834
+ interface SandboxTerminalCreateOptions {
835
+ name?: string;
836
+ description?: string;
837
+ shell?: string;
838
+ cwd?: string;
839
+ cols?: number;
840
+ rows?: number;
841
+ }
842
+ /** Runtime request context used to attribute terminal events to an agent session. */
843
+ interface SandboxTerminalRequestOptions {
844
+ sessionId?: string;
845
+ }
846
+ /** Interactive terminal metadata returned by the runtime. */
847
+ interface SandboxTerminalInfo {
848
+ sessionId: string;
849
+ connectionId?: string;
850
+ name?: string;
851
+ description?: string;
852
+ shell?: string;
853
+ command?: string;
854
+ cwd?: string;
855
+ cols?: number;
856
+ rows?: number;
857
+ createdAt?: string;
858
+ lastActivityAt?: string;
859
+ isRunning?: boolean;
860
+ exitCode?: number;
861
+ exitSignal?: string;
862
+ /** WebSocket path for terminal input/output. */
863
+ streamUrl?: string;
864
+ history?: unknown[];
865
+ }
866
+ /** Interactive terminal operations. Input/output flows over `streamUrl`. */
867
+ interface SandboxTerminalManager {
868
+ create(options?: SandboxTerminalCreateOptions, request?: SandboxTerminalRequestOptions): Promise<SandboxTerminalInfo>;
869
+ /** Send input through the runtime's HTTP fallback for an existing terminal. */
870
+ input(terminalId: string, data: string, request?: SandboxTerminalRequestOptions): Promise<void>;
871
+ list(): Promise<SandboxTerminalInfo[]>;
872
+ get(sessionId: string): Promise<SandboxTerminalInfo | null>;
873
+ }
874
+ /** Runtime-local agent profile. */
875
+ interface SandboxRuntimeProfile {
876
+ name: string;
877
+ description?: string;
878
+ systemPrompt?: string;
879
+ tools?: string[];
880
+ mcpServers?: string[];
881
+ env?: Record<string, string>;
882
+ model?: {
883
+ provider?: string;
884
+ model?: string;
885
+ };
886
+ }
887
+ /** Runtime-local profile listing and selected default. */
888
+ interface SandboxRuntimeProfileList {
889
+ profiles: SandboxRuntimeProfile[];
890
+ defaultProfile?: string;
891
+ }
892
+ /** Profile summary returned before a sandbox runtime exists. */
893
+ interface SandboxProfileSummary {
894
+ id: string;
895
+ name: string;
896
+ description?: string;
897
+ model?: string;
898
+ tags?: string[];
899
+ extends?: string;
900
+ }
797
901
  /**
798
902
  * Raw TEE attestation evidence returned by the sandbox runtime.
799
903
  *
@@ -1618,6 +1722,136 @@ interface SessionListOptions {
1618
1722
  /** Filter by backend identifier. */
1619
1723
  backend?: string;
1620
1724
  }
1725
+ /** Options for creating a runtime agent session. */
1726
+ interface CreateSessionOptions {
1727
+ title?: string;
1728
+ parentId?: string;
1729
+ backend: BackendConfig;
1730
+ }
1731
+ /** Backend credentials forwarded to the platform if a sandbox must restart. */
1732
+ interface SessionBackendCredentials {
1733
+ apiKey: string;
1734
+ baseUrl?: string;
1735
+ }
1736
+ /** One content part accepted by the runtime session message endpoint. */
1737
+ type SessionMessageInputPart = PromptInputPart | {
1738
+ type: "reasoning";
1739
+ text: string;
1740
+ } | {
1741
+ type: "tool";
1742
+ tool: string;
1743
+ state: {
1744
+ status: "pending" | "running" | "completed" | "failed";
1745
+ input?: unknown;
1746
+ output?: unknown;
1747
+ };
1748
+ } | {
1749
+ type: "step-start";
1750
+ } | {
1751
+ type: "step-finish";
1752
+ reason?: string;
1753
+ tokens?: {
1754
+ total?: number;
1755
+ input?: number;
1756
+ output?: number;
1757
+ reasoning?: number;
1758
+ cache?: {
1759
+ write?: number;
1760
+ read?: number;
1761
+ };
1762
+ };
1763
+ cost?: number;
1764
+ };
1765
+ /** Message body accepted by `SandboxSession.sendMessage`. */
1766
+ interface SendSessionMessageRequest {
1767
+ messageId?: string;
1768
+ parts: SessionMessageInputPart[];
1769
+ system?: string;
1770
+ agent?: string;
1771
+ model?: {
1772
+ providerId: string;
1773
+ modelId: string;
1774
+ };
1775
+ reasoningEffort?: "low" | "medium" | "high";
1776
+ turnId?: string;
1777
+ interactions?: BackendConfig["interactions"];
1778
+ }
1779
+ /** Per-call controls for `SandboxSession.sendMessage`. */
1780
+ interface SendSessionMessageOptions {
1781
+ credentials?: SessionBackendCredentials;
1782
+ timeoutMs?: number;
1783
+ signal?: AbortSignal;
1784
+ }
1785
+ /** Response returned after a session message finishes processing. */
1786
+ interface SentSessionMessage {
1787
+ info: {
1788
+ id: string;
1789
+ role: "user" | "assistant" | "system";
1790
+ timestamp?: string;
1791
+ };
1792
+ parts: unknown[];
1793
+ }
1794
+ /** Canonical portable profile attached to a task session. */
1795
+ type TaskSessionProfile = AgentProfile & {
1796
+ name: string;
1797
+ };
1798
+ /** Options for creating an isolated background task session. */
1799
+ interface CreateTaskSessionOptions {
1800
+ sessionId: string;
1801
+ backend: BackendConfig;
1802
+ title: string;
1803
+ profile?: TaskSessionProfile;
1804
+ parentSessionId?: string;
1805
+ isolateFileWrites?: boolean;
1806
+ }
1807
+ /** Task-session metadata returned at creation time. */
1808
+ interface TaskSessionInfo {
1809
+ id: string;
1810
+ title?: string;
1811
+ parentSessionId?: string;
1812
+ worktreeInfo?: {
1813
+ worktreePath: string;
1814
+ branchName: string;
1815
+ baseCommitSha: string;
1816
+ };
1817
+ profile?: TaskSessionProfile;
1818
+ }
1819
+ /** One changed file in an isolated task session. */
1820
+ interface TaskSessionFileChange {
1821
+ file: string;
1822
+ operation: "added" | "modified" | "deleted";
1823
+ additions: number;
1824
+ deletions: number;
1825
+ }
1826
+ /** Current diff and commit history for an isolated task session. */
1827
+ interface TaskSessionChanges {
1828
+ sessionId: string;
1829
+ files: TaskSessionFileChange[];
1830
+ diff: string;
1831
+ commits: Array<{
1832
+ sha: string;
1833
+ message: string;
1834
+ date: string;
1835
+ }>;
1836
+ worktreeInfo: {
1837
+ worktreePath: string;
1838
+ branchName: string;
1839
+ baseCommitSha: string;
1840
+ headCommitSha?: string;
1841
+ };
1842
+ }
1843
+ /** Options for merging task-session changes into the main workspace. */
1844
+ interface CommitTaskSessionOptions {
1845
+ message?: string;
1846
+ files?: string[];
1847
+ }
1848
+ /** Result of merging task-session changes into the main workspace. */
1849
+ interface TaskSessionCommitResult {
1850
+ success: true;
1851
+ commitSha?: string;
1852
+ conflicts?: string[];
1853
+ appliedFiles: number;
1854
+ }
1621
1855
  /**
1622
1856
  * Options for `SandboxSession.events()` streaming.
1623
1857
  */
@@ -1887,6 +2121,10 @@ interface BatchTask {
1887
2121
  /** Per-task timeout in milliseconds */
1888
2122
  timeoutMs?: number;
1889
2123
  }
2124
+ /** Backend configuration accepted by batch execution, including named profiles. */
2125
+ type BatchBackend = Omit<Partial<BackendConfig>, "type"> & {
2126
+ type?: BackendType | `${BackendType}:${string}`;
2127
+ };
1890
2128
  /**
1891
2129
  * Options for batch execution.
1892
2130
  */
@@ -1901,11 +2139,38 @@ interface BatchOptions {
1901
2139
  * Use `backend.profile` with a string for a named profile or a provider-neutral
1902
2140
  * `AgentProfile` object for inline profile configuration.
1903
2141
  */
1904
- backend?: Partial<BackendConfig>;
2142
+ backend?: BatchBackend;
2143
+ /** Run every task against each backend for comparison. */
2144
+ backends?: BatchBackend[];
2145
+ /** User identifier attached to the batch for platform attribution. */
2146
+ userId?: string;
2147
+ /** Partner identifier attached to the batch for credit attribution. */
2148
+ partnerId?: string;
2149
+ /** Request identifier used in events and metrics. */
2150
+ identifier?: string;
2151
+ /** Workload class used by capacity and lifecycle policy. */
2152
+ executionClass?: "project" | "simulation" | "background";
2153
+ /** Capacity to provision before execution starts. */
2154
+ desiredCapacity?: number;
2155
+ /** Maximum time to wait for requested capacity. */
2156
+ provisionTimeoutMs?: number;
1905
2157
  /** Keep sandboxes alive after completion (default: false) */
1906
2158
  persistent?: boolean;
2159
+ /** Lifecycle policy for persistent batch sandboxes. */
2160
+ lifecycle?: {
2161
+ idleTimeoutMs?: number;
2162
+ coldTimeoutMs?: number;
2163
+ };
2164
+ /** Use deterministic mock model responses. Intended for tests. */
2165
+ mock?: boolean;
1907
2166
  /** Milliseconds to keep non-persistent batch sandboxes alive after completion. */
1908
2167
  graceMs?: number;
2168
+ /** Repository cloned into persistent batch workspaces. */
2169
+ git?: GitConfig;
2170
+ /** Full replacement for the default agent system prompt. */
2171
+ systemPrompt?: string;
2172
+ /** Instructions appended to the default agent system prompt. */
2173
+ instructions?: string;
1909
2174
  /**
1910
2175
  * AbortSignal to cancel the batch mid-stream. When aborted, the HTTP
1911
2176
  * request to `/batch/run` is torn down; the SSE generator stops
@@ -1917,6 +2182,14 @@ interface BatchOptions {
1917
2182
  */
1918
2183
  signal?: AbortSignal;
1919
2184
  }
2185
+ /** Complete request accepted by `runBatch` and `streamBatch`. */
2186
+ interface BatchRunRequest extends Omit<BatchOptions, "signal"> {
2187
+ tasks: BatchTask[];
2188
+ }
2189
+ /** Per-call controls that are not serialized into a batch request. */
2190
+ interface BatchRunOptions {
2191
+ signal?: AbortSignal;
2192
+ }
1920
2193
  /**
1921
2194
  * Result of a single task in a batch.
1922
2195
  */
@@ -1935,6 +2208,16 @@ interface BatchTaskResult {
1935
2208
  retries: number;
1936
2209
  /** Token usage if available */
1937
2210
  tokensUsed?: number;
2211
+ /** Backend identifier for multi-backend batches. */
2212
+ backend?: string;
2213
+ /** Human-readable backend label emitted by the server. */
2214
+ backendLabel?: string;
2215
+ /** Model identifier emitted by the server. */
2216
+ backendModel?: string;
2217
+ /** Runtime session created for this task execution. */
2218
+ sessionId?: string;
2219
+ /** Sandbox used for this task execution. */
2220
+ sandboxId?: string;
1938
2221
  }
1939
2222
  /**
1940
2223
  * Summary of batch execution.
@@ -1953,23 +2236,145 @@ interface BatchResult {
1953
2236
  /** Individual task results */
1954
2237
  results: BatchTaskResult[];
1955
2238
  }
1956
- /**
1957
- * SSE event from batch streaming.
1958
- */
1959
- interface BatchEvent {
1960
- /** Event type (batch.started, task.completed, etc.) */
1961
- type: string;
1962
- /** Event data */
1963
- data: Record<string, unknown>;
1964
- /**
1965
- * Optional `id:` from the SSE frame. Present at runtime whenever
1966
- * the server emits an `id:` line (used by EventSource-style
1967
- * reconnection). Declared optional because the batch protocol
1968
- * doesn't currently emit it — downstream consumers that want to
1969
- * implement resume should feature-detect.
1970
- */
1971
- id?: string;
2239
+ /** Token and tool usage emitted when one batch task completes. */
2240
+ interface BatchTaskUsage {
2241
+ inputTokens: number;
2242
+ outputTokens: number;
2243
+ cacheReadTokens?: number;
2244
+ cacheWriteTokens?: number;
2245
+ toolCallCount?: number;
2246
+ }
2247
+ /** Per-backend aggregate emitted by `batch.completed`. */
2248
+ interface BatchBackendStats {
2249
+ backend: string;
2250
+ backendLabel?: string;
2251
+ backendModel?: string;
2252
+ success: number;
2253
+ failure: number;
2254
+ retries: number;
2255
+ successRate: number;
2256
+ }
2257
+ /** Sidecars allocated to one backend configuration. */
2258
+ interface BatchSidecarGroup {
2259
+ backend: string;
2260
+ sidecarIds: string[];
2261
+ }
2262
+ interface BatchTaskEventIdentity {
2263
+ taskId: string;
2264
+ backend: string;
2265
+ backendLabel?: string;
2266
+ backendModel?: string;
2267
+ }
2268
+ /** Data payloads keyed by the SSE event name emitted by `/batch/run`. */
2269
+ interface BatchEventDataMap {
2270
+ "batch.provisioning": {
2271
+ desiredCapacity: number;
2272
+ currentCapacity: number;
2273
+ provisionTimeoutMs: number;
2274
+ };
2275
+ "batch.provisioned": {
2276
+ capacity: number;
2277
+ };
2278
+ "batch.started": {
2279
+ taskCount: number;
2280
+ backendCount: number;
2281
+ totalExecutions: number;
2282
+ maxConcurrent: number;
2283
+ scalingMode: string;
2284
+ backends: string[];
2285
+ };
2286
+ "sidecars.allocated": {
2287
+ count: number;
2288
+ groups: BatchSidecarGroup[];
2289
+ };
2290
+ "batch.completed": {
2291
+ taskCount: number;
2292
+ backendCount: number;
2293
+ totalExecutions: number;
2294
+ totalSuccess: number;
2295
+ totalFailure: number;
2296
+ totalRetries: number;
2297
+ successRate: number;
2298
+ byBackend: BatchBackendStats[];
2299
+ };
2300
+ "batch.failed": {
2301
+ error: string;
2302
+ backends?: string[];
2303
+ };
2304
+ "batch.persistent": {
2305
+ message: string;
2306
+ sidecarCount: number;
2307
+ };
2308
+ "batch.grace_period": {
2309
+ message: string;
2310
+ sidecarCount: number;
2311
+ graceMs: number;
2312
+ sidecarIds: string[];
2313
+ };
2314
+ "task.started": BatchTaskEventIdentity & {
2315
+ sidecarId: string;
2316
+ projectRef?: string;
2317
+ attempt: number;
2318
+ };
2319
+ "task.message.delta": BatchTaskEventIdentity & {
2320
+ sidecarId: string;
2321
+ projectRef?: string;
2322
+ value: string;
2323
+ part: Record<string, unknown>;
2324
+ };
2325
+ "task.reasoning": BatchTaskEventIdentity & {
2326
+ sidecarId: string;
2327
+ projectRef?: string;
2328
+ value: string;
2329
+ part: Record<string, unknown>;
2330
+ };
2331
+ "task.tool.updated": BatchTaskEventIdentity & {
2332
+ sidecarId: string;
2333
+ projectRef?: string;
2334
+ part: Record<string, unknown>;
2335
+ };
2336
+ "task.completed": BatchTaskEventIdentity & {
2337
+ durationMs: number;
2338
+ attempt: number;
2339
+ retries: number;
2340
+ sidecarId: string;
2341
+ projectRef?: string;
2342
+ resultSummary?: string;
2343
+ sessionId?: string;
2344
+ usage: BatchTaskUsage;
2345
+ };
2346
+ "task.failed": BatchTaskEventIdentity & {
2347
+ durationMs: number;
2348
+ attempt: number;
2349
+ retries: number;
2350
+ error: string;
2351
+ sidecarId?: string;
2352
+ };
2353
+ "task.retry": BatchTaskEventIdentity & {
2354
+ attempt: number;
2355
+ maxRetries: number;
2356
+ error: string;
2357
+ delayMs: number;
2358
+ };
2359
+ "backend.completed": {
2360
+ backend: string;
2361
+ backendLabel?: string;
2362
+ backendModel?: string;
2363
+ success: number;
2364
+ failure: number;
2365
+ retries: number;
2366
+ successRate: number;
2367
+ };
2368
+ "sidecar.releasing": {
2369
+ sidecarId: string;
2370
+ };
1972
2371
  }
2372
+ /** Discriminated SSE event from a batch execution. */
2373
+ type BatchEvent = { [K in keyof BatchEventDataMap]: {
2374
+ type: K;
2375
+ data: BatchEventDataMap[K]; /** Optional SSE id used by reconnecting consumers. */
2376
+ id?: string;
2377
+ } }[keyof BatchEventDataMap];
1973
2378
  /**
1974
2379
  * Stable worker identifier inside a sandbox fleet.
1975
2380
  *
@@ -2869,6 +3274,18 @@ interface BackendConfig {
2869
3274
  question?: boolean;
2870
3275
  plan?: boolean;
2871
3276
  };
3277
+ /** Runtime session metadata used for attribution and workspace selection. */
3278
+ metadata?: {
3279
+ containerType?: string;
3280
+ telemetry?: {
3281
+ otlp: {
3282
+ endpoint: string;
3283
+ headers: string;
3284
+ };
3285
+ resourceAttributes: Record<string, string>;
3286
+ };
3287
+ [key: string]: unknown;
3288
+ };
2872
3289
  }
2873
3290
  /**
2874
3291
  * Backend capabilities.
@@ -3842,6 +4259,71 @@ interface FileInfo {
3842
4259
  /** Last access time */
3843
4260
  accessTime: Date;
3844
4261
  }
4262
+ /** File metadata returned by the recursive workspace tree endpoint. */
4263
+ interface FileTreeFile {
4264
+ path: string;
4265
+ size: number;
4266
+ /** File modification time as Unix milliseconds. */
4267
+ mtime: number;
4268
+ }
4269
+ /** Options for recursively scanning a workspace tree. */
4270
+ interface FileTreeOptions {
4271
+ sessionId?: string;
4272
+ maxDepth?: number;
4273
+ }
4274
+ /** Recursive workspace tree with scan statistics. */
4275
+ interface FileTreeResult {
4276
+ root: string;
4277
+ directories: string[];
4278
+ files: FileTreeFile[];
4279
+ stats: {
4280
+ totalDirectories: number;
4281
+ totalFiles: number;
4282
+ scanDurationMs: number;
4283
+ truncated: boolean;
4284
+ };
4285
+ }
4286
+ /** File content and metadata returned by a batch read. */
4287
+ interface FileReadResult {
4288
+ path: string;
4289
+ content: string;
4290
+ encoding: "utf8" | "base64";
4291
+ hash: string;
4292
+ size: number;
4293
+ /** File modification time as Unix milliseconds. */
4294
+ mtime: number;
4295
+ }
4296
+ /** One file that could not be read during a partial-success batch. */
4297
+ interface FileReadError {
4298
+ path: string;
4299
+ error: string;
4300
+ code?: string;
4301
+ }
4302
+ /** Options for reading files in a batch. */
4303
+ interface FileReadBatchOptions {
4304
+ encoding?: "utf8" | "base64";
4305
+ sessionId?: string;
4306
+ }
4307
+ /** Partial-success result from a batch file read. */
4308
+ interface FileReadBatchResult {
4309
+ files: FileReadResult[];
4310
+ errors: FileReadError[];
4311
+ stats: {
4312
+ requested: number;
4313
+ succeeded: number;
4314
+ failed: number;
4315
+ };
4316
+ }
4317
+ /** Metadata returned after a successful file write. */
4318
+ interface FileWriteResult {
4319
+ path: string;
4320
+ hash: string;
4321
+ size: number;
4322
+ /** File modification time as Unix milliseconds. */
4323
+ mtime: number;
4324
+ /** Encoding echoed by runtimes that include it in write responses. */
4325
+ encoding?: "utf8" | "base64";
4326
+ }
3845
4327
  /**
3846
4328
  * Options for uploading files.
3847
4329
  */
@@ -3910,6 +4392,8 @@ interface MkdirOptions {
3910
4392
  interface DeleteOptions {
3911
4393
  /** Recursively delete directories (like rm -rf) */
3912
4394
  recursive?: boolean;
4395
+ /** Agent session whose workspace and change history receive the deletion. */
4396
+ sessionId?: string;
3913
4397
  }
3914
4398
  /**
3915
4399
  * File system operations for sandboxes. Access via `sandbox.fs`.
@@ -3974,6 +4458,10 @@ interface WriteManyFile {
3974
4458
  interface WriteFileOptions {
3975
4459
  /** Unix mode bits applied after write, e.g. 0o755. */
3976
4460
  mode?: number;
4461
+ /** Encoding of `content` on the wire. */
4462
+ encoding?: "utf8" | "base64";
4463
+ /** Agent session whose workspace and change history receive the write. */
4464
+ sessionId?: string;
3977
4465
  }
3978
4466
  /** Options for {@link FileSystem.writeMany}. */
3979
4467
  interface WriteManyOptions {
@@ -3995,6 +4483,10 @@ interface FileSystem {
3995
4483
  * @throws NotFoundError if file doesn't exist
3996
4484
  */
3997
4485
  read(path: string): Promise<string>;
4486
+ /** Read up to any number of files with content metadata and per-file errors. */
4487
+ readBatch(paths: string[], options?: FileReadBatchOptions): Promise<FileReadBatchResult>;
4488
+ /** Recursively scan the workspace and return file metadata. */
4489
+ tree(path: string, options?: FileTreeOptions): Promise<FileTreeResult>;
3998
4490
  /**
3999
4491
  * Write string content to a file.
4000
4492
  * For binary files, use upload() instead.
@@ -4003,7 +4495,7 @@ interface FileSystem {
4003
4495
  * @param path - Path to file (relative to workspace)
4004
4496
  * @param content - Content to write
4005
4497
  */
4006
- write(path: string, content: string, options?: WriteFileOptions): Promise<void>;
4498
+ write(path: string, content: string, options?: WriteFileOptions): Promise<FileWriteResult>;
4007
4499
  /**
4008
4500
  * Write many files in one paced, retry-aware batch.
4009
4501
  *
@@ -4470,6 +4962,8 @@ interface SandboxSessionHost extends InteractiveSessionHost {
4470
4962
  _sessionEvents(id: string, opts?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
4471
4963
  _sessionResult(id: string): Promise<PromptResult>;
4472
4964
  _sessionCancel(id: string): Promise<void>;
4965
+ _sessionDelete(id: string): Promise<void>;
4966
+ _sessionSendMessage(id: string, request: SendSessionMessageRequest, options?: SendSessionMessageOptions): Promise<SentSessionMessage>;
4473
4967
  messages(opts: ListMessagesOptions): Promise<SessionMessage[]>;
4474
4968
  _sessionFork(id: string, opts?: SessionForkOptions): Promise<SessionInfo>;
4475
4969
  _respondToPermission(id: string, permissionID: string, options: RespondToPermissionOptions): Promise<void>;
@@ -4529,6 +5023,11 @@ declare class SandboxSession {
4529
5023
  * naturally on a Session reference.
4530
5024
  */
4531
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>;
4532
5031
  /**
4533
5032
  * Abort the session's in-flight execution; the session and its messages
4534
5033
  * are preserved (this does not delete the session). Void-returning alias
@@ -4538,6 +5037,8 @@ declare class SandboxSession {
4538
5037
  * aborting a session with nothing in flight is a no-op.
4539
5038
  */
4540
5039
  cancel(): Promise<void>;
5040
+ /** Delete this session and its persisted runtime state. */
5041
+ delete(): Promise<void>;
4541
5042
  /**
4542
5043
  * Fork this session into a new queued session. The fork shares the
4543
5044
  * parent workspace and copies conversation history up to `messageId`
@@ -4576,6 +5077,23 @@ declare class SandboxSession {
4576
5077
  answer(answers: Record<string, string[]>): Promise<void>;
4577
5078
  }
4578
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
4579
5097
  //#region src/trace-exporter.d.ts
4580
5098
  type JsonObject = {
4581
5099
  [key: string]: JsonValue;
@@ -4673,6 +5191,7 @@ declare class SandboxInstance {
4673
5191
  private readonly client;
4674
5192
  private info;
4675
5193
  private readonly defaultRuntimeBackend?;
5194
+ private readonly runtime;
4676
5195
  constructor(client: HttpClient, info: SandboxInfo, defaultRuntimeBackend?: BackendConfig);
4677
5196
  /** Unique sandbox identifier */
4678
5197
  get id(): string;
@@ -4891,7 +5410,7 @@ declare class SandboxInstance {
4891
5410
  * await box.write("/tmp/config.json", JSON.stringify(config));
4892
5411
  * ```
4893
5412
  */
4894
- write(path: string, content: string, options?: WriteFileOptions): Promise<void>;
5413
+ write(path: string, content: string, options?: WriteFileOptions): Promise<FileWriteResult>;
4895
5414
  /**
4896
5415
  * Write many files in one paced, retry-aware batch — see
4897
5416
  * {@link FileSystem.writeMany}. Each file goes through {@link write}; a small
@@ -5029,6 +5548,14 @@ declare class SandboxInstance {
5029
5548
  * ```
5030
5549
  */
5031
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>;
5032
5559
  /**
5033
5560
  * Live whole-sandbox resource usage (memory + CPU) from the container cgroup.
5034
5561
  *
@@ -5112,6 +5639,8 @@ declare class SandboxInstance {
5112
5639
  * ```
5113
5640
  */
5114
5641
  get fs(): FileSystem;
5642
+ private fsReadBatch;
5643
+ private fsTree;
5115
5644
  private fsUpload;
5116
5645
  private fsDownload;
5117
5646
  private fsUploadDir;
@@ -5562,6 +6091,20 @@ declare class SandboxInstance {
5562
6091
  * Use {@link sessions} to discover existing session ids.
5563
6092
  */
5564
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
+ }>;
5565
6108
  /**
5566
6109
  * List sessions on this sandbox, optionally filtering by status. Returns
5567
6110
  * `SandboxSession` instances paired with their last-known
@@ -5597,6 +6140,14 @@ declare class SandboxInstance {
5597
6140
  * abort stamps `interrupted: true` explicitly.
5598
6141
  */
5599
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>;
5600
6151
  _sessionFork(id: string, opts?: SessionForkOptions): Promise<SessionInfo>;
5601
6152
  /**
5602
6153
  * Look up a cached turn result by idempotency key. Returns the cached
@@ -5683,4 +6234,4 @@ declare class SandboxInstance {
5683
6234
  _answerQuestion(id: string, answers: Record<string, string[]>): Promise<void>;
5684
6235
  }
5685
6236
  //#endregion
5686
- export { CreateSandboxFleetOptions as $, SandboxFleetMachineRecord as $n, ToolsConfig as $r, ListMessagesOptions as $t, AttachGpuLeaseOptions as A, PublishPublicTemplateVersionOptions as An, SecretInfo as Ar, GitAuth as At, BatchResult as B, SandboxEnvironment as Bn, SshKeysManager as Br, GpuLeaseExecResult as Bt, SandboxMcpEndpoint as C, defineAgentProfile as Ci, ProvisionEvent as Cn, SandboxTraceExport as Cr, FleetDispatchStreamOptions as Ct, AcceleratorKind as D, PublicTemplateInfo as Dn, ScopedTokenScope as Dr, FleetPromptDispatchOptions as Dt, buildSandboxMcpConfig as E, mergeAgentProfiles as Ei, ProvisionStep as En, ScopedToken as Er, FleetMachineId as Et, BackendManager as F, RunCodeOptions as Fn, SessionMessage as Fr, GitStatus as Ft, CodeExecutionResult as G, SandboxFleetDispatchFailureClass as Gn, TaskOptions as Gr, HostAgentDriverConfig as Gt, BatchTaskResult as H, SandboxFleetArtifact as Hn, StartupOperation as Hr, GpuLeaseProviderName as Ht, BackendStatus as I, SSHCommandDescriptor as In, SessionStatus as Ir, GpuLease as It, CodeResultPart as J, SandboxFleetDriverTimings as Jn, TeeAttestationReport as Jr, IntelligenceReport as Jt, CodeLanguage as K, SandboxFleetDispatchResponse as Kn, TaskResult as Kr, HostAgentRuntimeBackend as Kt, BackendType as L, SSHCredentials as Ln, SnapshotInfo as Lr, GpuLeaseBilling as Lt, BackendCapabilities as M, ReapExpiredSandboxFleetsResult as Mn, SessionEventStreamOptions as Mr, GitCommit as Mt, BackendConfig as N, ReconcileSandboxFleetsOptions as Nn, SessionInfo as Nr, GitConfig as Nt, AccessPolicyRule as O, PublicTemplateVersionInfo as On, SearchMatch as Or, FleetPromptDispatchResult as Ot, BackendInfo as P, ReconcileSandboxFleetsResult as Pn, SessionListOptions as Pr, GitDiff as Pt, CreateRequestOptions as Q, SandboxFleetMachineMeteredUsage as Qn, TokenRefreshHandler as Qr, IntelligenceReportWindow as Qt, BatchEvent as R, SandboxClientConfig as Rn, SnapshotOptions as Rr, GpuLeaseCommandResult as Rt, SandboxMcpConfig as S, AgentSubagentProfile as Si, PromptResult as Sn, SandboxTraceEvent as Sr, FleetDispatchResultBufferOptions as St, buildControlPlaneMcpConfig as T, defineInlineResource as Ti, ProvisionStatus as Tn, SandboxUser as Tr, FleetExecDispatchResult as Tt, BranchOptions as U, SandboxFleetArtifactSpec as Un, StorageConfig as Ur, GpuLeaseStatus as Ut, BatchTask as V, SandboxEvent as Vn, StartupDiagnostics as Vr, GpuLeaseManager as Vt, CodeExecutionOptions as W, SandboxFleetCostEstimate as Wn, SubscriptionInfo as Wr, GpuType as Wt, CreateGpuLeaseOptions as X, SandboxFleetIntelligenceEnvelope as Xn, TeePublicKey as Xr, IntelligenceReportCompareTo as Xt, CompletedTurnResult as Y, SandboxFleetInfo as Yn, TeeAttestationResponse as Yr, IntelligenceReportBudget as Yt, CreateIntelligenceReportOptions as Z, SandboxFleetMachine as Zn, TeePublicKeyResponse as Zr, IntelligenceReportSubjectType as Zt, StartInteractiveOptions as _, AgentProfilePrompt as _i, ProcessSignal as _n, SandboxPermissionsConfig as _r, ExecResult as _t, TraceExportSink as a, WaitForOptions as ai, MkdirOptions as an, SandboxFleetToken as ar, DispatchPromptOptions as at, CONTROL_PLANE_MCP_SERVER_NAME as b, AgentProfileValidationIssue as bi, PromptInputPart as bn, SandboxStatus as br, FleetDispatchCancelResult as bt, otelTraceIdForTangleTrace as c, WriteManyOptions as ci, NonHostAgentDriverConfig as cn, SandboxFleetTraceExport as cr, DownloadProgress as ct, InteractiveAuthFile as d, AgentProfileConfidential as di, PreviewLinkInfo as dn, SandboxFleetWorkspace as dr, DriverInfo as dt, TurnDriveResult as ei, ListOptions as en, SandboxFleetMachineSpec as er, CreateSandboxFleetTokenOptions as et, InteractiveSessionHandle as f, AgentProfileConnection as fi, PreviewLinkManager as fn, SandboxFleetWorkspaceReconcileResult as fr, DriverType as ft, RespondToPermissionOptions as g, AgentProfilePermissionValue as gi, ProcessManager as gn, SandboxIntelligenceEnvelope as gr, ExecOptions as gt, InterruptResult as h, AgentProfileModelHints as hi, ProcessLogEntry as hn, SandboxInfo as hr, EventStreamOptions as ht, TraceExportResult as i, UsageInfo as ii, MintScopedTokenOptions as in, SandboxFleetPolicy as ir, DirectoryPermission as it, AttachSandboxFleetMachineOptions as j, ReapExpiredSandboxFleetsOptions as jn, SecretsManager as jr, GitBranch as jt, AddUserOptions as k, PublishPublicTemplateOptions as kn, SearchOptions as kr, GPU_LEASE_PROVIDER_NAMES as kt, toOtelJson as l, AgentProfile as li, PermissionLevel as ln, SandboxFleetTraceOptions as lr, DriveTurnOptions as lt, InteractiveSessionInfo as m, AgentProfileMcpServer as mi, ProcessInfo as mn, SandboxFleetWorkspaceSnapshotResult as mr, EgressPolicy as mt, SandboxInstance as n, UploadOptions as ni, ListSandboxOptions as nn, SandboxFleetManifestMachine as nr, CreateSandboxOptions as nt, buildTraceExportPayload as o, WriteFileOptions as oi, NetworkConfig as on, SandboxFleetTraceBundle as or, DispatchedSession as ot, InteractiveSessionHost as p, AgentProfileFileMount as pi, Process as pn, SandboxFleetWorkspaceRestoreResult as pr, EgressManager as pt, CodeResult as q, SandboxFleetDriverCapability as qn, TeeAttestationOptions as qr, InstalledTool as qt, TraceExportFormat as r, UploadProgress as ri, McpServerConfig as rn, SandboxFleetOperationsSummary as rr, DeleteOptions as rt, exportTraceBundle as s, WriteManyFile as si, NetworkManager as sn, SandboxFleetTraceEvent as sr, DownloadOptions as st, HttpClient as t, UpdateUserOptions as ti, ListSandboxFleetOptions as tn, SandboxFleetManifest as tr, CreateSandboxFleetWithCoordinatorOptions as tt, SandboxSession as u, AgentProfileCapabilities as ui, PermissionsManager as un, SandboxFleetUsage as ur, DriverConfig as ut, BuildControlPlaneMcpConfigOptions as v, AgentProfileResourceRef as vi, ProcessSpawnOptions as vn, SandboxResourceUsage as vr, FileInfo as vt, SandboxMcpServerEntry as w, defineGitHubResource as wi, ProvisionResult as wn, SandboxTraceOptions as wr, FleetExecDispatchOptions as wt, SANDBOX_MCP_SERVER_NAME as x, AgentProfileValidationResult as xi, PromptOptions as xn, SandboxTraceBundle as xr, FleetDispatchResultBuffer as xt, BuildSandboxMcpConfigOptions as y, AgentProfileResources as yi, ProcessStatus as yn, SandboxResources as yr, FileSystem as yt, BatchOptions as z, SandboxConnection as zn, SnapshotResult as zr, GpuLeaseExecOptions as zt };
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 };