@constal/sdk 6.9.1 → 6.11.0

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.
@@ -203,12 +203,32 @@ interface ModelHistoryToolCall {
203
203
  name: string;
204
204
  args: unknown;
205
205
  }
206
+ /** Text a user or tool message carries among its parts. */
207
+ interface ModelTextPart {
208
+ type: "text";
209
+ text: string;
210
+ }
211
+ /**
212
+ * A stored file a user or tool message carries, by its ref: the history and the journal hold only this, and the model's
213
+ * connection sends the file's bytes, or the provider's id of them, when it sends the request.
214
+ */
215
+ interface ModelFilePart {
216
+ type: "file";
217
+ ref: Ref;
218
+ bytes: number;
219
+ mediaType: string;
220
+ name?: string;
221
+ /** The object the value came from, which remembers provider file ids. */
222
+ object?: string;
223
+ }
224
+ type ModelContentPart = ModelTextPart | ModelFilePart;
206
225
  /** One earlier message, oldest first. User and assistant text is as it always was; an assistant message may also carry the
207
- * Tool calls it made, and a tool message returns one call's result to the model. The tool messages right after an
208
- * assistant message answer each of its calls once, before any other message. */
226
+ * Tool calls it made, and a tool message returns one call's result to the model. A user or tool message may carry content
227
+ * parts instead of text: text and stored files, in order. The tool messages right after an assistant message answer each of
228
+ * its calls once, before any other message. */
209
229
  type ModelHistoryMessage = {
210
230
  role: "user";
211
- content: string;
231
+ content: string | ModelContentPart[];
212
232
  } | {
213
233
  role: "assistant";
214
234
  content: string;
@@ -216,7 +236,7 @@ type ModelHistoryMessage = {
216
236
  } | {
217
237
  role: "tool";
218
238
  toolCallId: string;
219
- content: string;
239
+ content: string | ModelContentPart[];
220
240
  isError?: boolean;
221
241
  };
222
242
  /** Opt-in prompt caching. With a hint, an Anthropic-protocol request marks cache breakpoints on its stable prefix (Tools and
@@ -238,6 +258,19 @@ declare function modelPrompt(args: ModelInvocationArgs): string;
238
258
  * assistant message), then each earlier exchange as its own message, then feedback about the previous attempt. Without
239
259
  * history this is the single prompt message it always was. */
240
260
  declare function modelMessages(args: ModelInvocationArgs): ModelHistoryMessage[];
261
+ /**
262
+ * How a model's connection sends one stored file of a request: its bytes inline, the provider's id of the file it already holds,
263
+ * or, when the file cannot be sent to this model, a text part with the reason, so the turn goes on and the model reads why.
264
+ */
265
+ type ResolvedModelFile = {
266
+ kind: "inline";
267
+ } | {
268
+ kind: "provider";
269
+ id: string;
270
+ } | {
271
+ kind: "refused";
272
+ reason: string;
273
+ };
241
274
  /** Choices an OpenAI-protocol request makes for the endpoint it is sent to. Without them the request is plain Chat
242
275
  * Completions, as every OpenAI-compatible endpoint takes it. */
243
276
  interface ModelProtocolRequestOptions {
@@ -247,7 +280,11 @@ interface ModelProtocolRequestOptions {
247
280
  /** Name an error Tool result `tool_error`, which the Constal Gateway sends to Anthropic as `is_error`. */
248
281
  toolErrorName?: boolean;
249
282
  }
250
- declare function modelProtocolRequest(protocol: ModelGatewayProtocol, model: string, maxOutputTokens: number | null, temperature: number | null, args: ModelInvocationArgs, options?: ModelProtocolRequestOptions): Record<string, unknown>;
283
+ /** How each stored file of a request is sent, by its ref (`modelFileParts`); every file part of the request needs one. */
284
+ interface ModelProtocolFiles {
285
+ files?: ReadonlyMap<string, ResolvedModelFile>;
286
+ }
287
+ declare function modelProtocolRequest(protocol: ModelGatewayProtocol, model: string, maxOutputTokens: number | null, temperature: number | null, args: ModelInvocationArgs, options?: ModelProtocolRequestOptions & ModelProtocolFiles): Record<string, unknown>;
251
288
  declare function modelProtocolResult(protocol: ModelGatewayProtocol, raw: unknown, provider: string, model: string): ModelInvocationResult;
252
289
 
253
290
  /**
@@ -1442,7 +1479,7 @@ interface PriceTableRef {
1442
1479
  version: string;
1443
1480
  hash: Hash;
1444
1481
  }
1445
- type SandboxNetworkMode = "block-all" | "cidr-allow" | "domain-allow" | "managed-http" | "unrestricted";
1482
+ type SandboxNetworkMode = "block-all" | "cidr-allow" | "domain-allow" | "unrestricted";
1446
1483
  type SandboxNetworkPolicy = {
1447
1484
  mode: "block-all";
1448
1485
  } | {
@@ -1451,15 +1488,6 @@ type SandboxNetworkPolicy = {
1451
1488
  } | {
1452
1489
  mode: "domain-allow";
1453
1490
  domains: string[];
1454
- } | {
1455
- mode: "managed-http";
1456
- transport: "bridge";
1457
- egress: CRN;
1458
- } | {
1459
- mode: "managed-http";
1460
- transport: "proxy";
1461
- egress: CRN;
1462
- domains: string[];
1463
1491
  } | {
1464
1492
  mode: "unrestricted";
1465
1493
  };
@@ -1715,18 +1743,14 @@ interface SandboxGovernanceControls {
1715
1743
  command_timeout_ms: number;
1716
1744
  cpu: number;
1717
1745
  disk_gib: number;
1718
- idle_stop_ms: number;
1719
- max_concurrent_commands: number;
1720
1746
  max_file_bytes: number;
1721
1747
  memory_gib: number;
1722
1748
  network_cidrs: string[];
1723
1749
  network_domains: string[];
1724
- network_egress: string | null;
1725
- network_mode: "block-all" | "cidr-allow" | "domain-allow" | "managed-http" | "unrestricted";
1726
- network_transport: "bridge" | "proxy" | null;
1750
+ network_mode: "block-all" | "cidr-allow" | "domain-allow" | "unrestricted";
1727
1751
  permitted_paths: string[];
1728
1752
  }
1729
- type SandboxGovernanceMeter = "commands" | "compute_ms" | "file_bytes" | "requests";
1753
+ type SandboxGovernanceMeter = "commands" | "requests";
1730
1754
 
1731
1755
  interface GovernanceContractRef {
1732
1756
  id: string;
@@ -1831,14 +1855,7 @@ type PolicyInvocationOrigin = {
1831
1855
  } | {
1832
1856
  kind: "channel";
1833
1857
  channel: CRN;
1834
- phase: "receive" | "respond" | "send" | "failed" | "authorize-subscription";
1835
- } | {
1836
- kind: "sandbox";
1837
- agent: CRN;
1838
- sandbox: {
1839
- crn: CRN;
1840
- hash: Hash;
1841
- };
1858
+ phase: "receive" | "respond" | "send" | "failed" | "authorize-subscription" | "presence" | "fetch";
1842
1859
  } | {
1843
1860
  kind: "system";
1844
1861
  };
@@ -1922,359 +1939,406 @@ interface AnalyticsClient {
1922
1939
  }
1923
1940
  declare function analyticsEvent<Dimension extends string, Metric extends string>(definition: AnalyticsEventDefinition<Dimension, Metric>): AnalyticsEventDefinition<Dimension, Metric>;
1924
1941
 
1925
- interface ContainerImageReference {
1926
- registry: string;
1927
- repository: string;
1928
- tag: string | null;
1929
- digest: string | null;
1930
- reference: string;
1942
+ interface SandboxResources {
1943
+ cpu: number;
1944
+ memoryGib: number;
1945
+ diskGib: number;
1931
1946
  }
1932
- /** Immutable OCI identity before any provider-specific preparation. */
1933
- interface ContainerImageSource {
1934
- reference: string;
1935
- digest: `sha256:${string}`;
1936
- mediaType: string;
1937
- bytes: number;
1938
- platform: {
1939
- os: string;
1940
- architecture: string;
1941
- variant?: string;
1947
+ /**
1948
+ * Sandbox sizes: provider-neutral allocations a pool names with `size` (vCPU, memory in GiB, disk in GB), on any provider.
1949
+ * A pool that names one states the same allocation as its `resources`, which is what its usage is metered and priced on;
1950
+ * the provider decides what it starts to provide it (its nearest shape at or above the size's allocation). Every size has
1951
+ * its own disk, so a report's disk axis alone tells which size it was measured on.
1952
+ */
1953
+ declare const SANDBOX_SIZES: {
1954
+ readonly xs: {
1955
+ readonly cpu: 0.0625;
1956
+ readonly memoryGib: 0.25;
1957
+ readonly diskGib: 2;
1942
1958
  };
1943
- }
1944
- /** Digest-pinned image selected for one Linux execution environment. Manifest
1945
- * metadata is resolved by the runtime pull and recorded in its receipt. */
1946
- interface ContainerImageSelection {
1947
- reference: string;
1948
- platform: {
1949
- os: string;
1950
- architecture: string;
1951
- variant?: string;
1959
+ readonly s: {
1960
+ readonly cpu: 0.25;
1961
+ readonly memoryGib: 1;
1962
+ readonly diskGib: 4;
1963
+ };
1964
+ readonly m: {
1965
+ readonly cpu: 0.5;
1966
+ readonly memoryGib: 4;
1967
+ readonly diskGib: 8;
1968
+ };
1969
+ readonly l: {
1970
+ readonly cpu: 1;
1971
+ readonly memoryGib: 6;
1972
+ readonly diskGib: 12;
1973
+ };
1974
+ readonly xl: {
1975
+ readonly cpu: 2;
1976
+ readonly memoryGib: 8;
1977
+ readonly diskGib: 16;
1952
1978
  };
1979
+ readonly "2xl": {
1980
+ readonly cpu: 4;
1981
+ readonly memoryGib: 12;
1982
+ readonly diskGib: 20;
1983
+ };
1984
+ };
1985
+ type SandboxSize = keyof typeof SANDBOX_SIZES;
1986
+
1987
+ /**
1988
+ * The sandbox door: Constal's one sandbox API (caas.sh docs/design/one-door-sandbox-api.md, sections 4 and 5). Sandboxes are
1989
+ * addressed by id in a namespace, under `/v1/namespaces/{namespace}/sandboxes`, and every caller uses these routes:
1990
+ *
1991
+ * - a tenant's API key, on the platform's public routes (caas.sh calls them over its CONSTAL_PLATFORM binding);
1992
+ * - an agent's Run, through its sandbox-pool Resource, which reaches the same routes at `https://platform.internal`
1993
+ * with the Run's own authority instead of a key.
1994
+ *
1995
+ * Each call is authorized where it arrives, inline: the key (or Run), the Policy scope of its operation (`scope` below) on
1996
+ * the pool it names, and the balance at create and start (`balance`). Nothing is pre-issued. The platform then calls the sandbox's coordinator, one per sandbox id
1997
+ * (packages/platform-protocol/src/sandbox-door-calls.ts), which answers when the provider answers.
1998
+ *
1999
+ * Nothing runs in a sandbox but the caller's image and the caller's commands. Exec, files, egress, ports and snapshots are
2000
+ * the provider's own APIs; what a provider lacks is `Unsupported` (naming the capability, SandboxCapabilities), never
2001
+ * emulated. Persistence and snapshots are the provider's own; Constal takes no snapshot or archive of its own.
2002
+ *
2003
+ * Every call names its pool: a create in its body, every other call in the `x-constal-sandbox-pool` header. It names a
2004
+ * sandbox-pool Resource of the caller's tenant in the route's namespace by its id, and any other by its CRN (a pool another
2005
+ * tenant offers, such as the platform's, or one of another namespace); sandboxDoorPoolName gives the name a sandbox keeps.
2006
+ * A sandbox of another pool is `NotFound`, as is one of another tenant or namespace.
2007
+ *
2008
+ * Every mutating call takes an `Idempotency-Key` (`key` below). The coordinator keeps each key it admitted, with the
2009
+ * identity of the request it named (its operation, path, query and body), for as long as it keeps the sandbox; a deleted
2010
+ * sandbox's tombstone keeps them too. The same key with the same request answers that call's effect as it stands now (a
2011
+ * create's replay answers 200 with the sandbox, not 201); the same key with another request is `Conflict` and changes
2012
+ * nothing. A create without an `id` gets `sandboxIdFromKey(namespace, key)`, so a retried create names the same sandbox.
2013
+ * An id names one sandbox for good: a create of an id that exists, or existed, under another key is `AlreadyExists`.
2014
+ *
2015
+ * Waits long-poll and answer as soon as the lifecycle settles, at most SANDBOX_DOOR_MAX_WAIT_MS: `?wait=<seconds>` on
2016
+ * create, start and stop, `?waitMs=<milliseconds>` on a get, an exec and an exec's read. Without one, or 0, a call answers
2017
+ * at once. A wait that ends unsettled answers the state then (create 201, start and stop 202, exec 202).
2018
+ */
2019
+ /** The longest wait a call takes, in milliseconds (the design's `?waitMs` bound, which caas.sh's own waits keep). */
2020
+ declare const SANDBOX_DOOR_MAX_WAIT_MS = 25000;
2021
+ /**
2022
+ * A sandbox's state: the provider's own (`starting`, `running`, `stopping`, `stopped`, and `failed` when the provider
2023
+ * reports the sandbox broken) and the two the platform owns: `deleted`, and `failed` for a create or start the coordinator
2024
+ * gave up on.
2025
+ */
2026
+ type SandboxState = "starting" | "running" | "stopping" | "stopped" | "failed" | "deleted";
2027
+ /**
2028
+ * A sandbox's egress, enforced by its provider's own network API: every destination, none, or only those listed. A
2029
+ * provider without one takes only `all` (SandboxCapabilities.egress).
2030
+ */
2031
+ type SandboxEgress = {
2032
+ mode: "all";
2033
+ } | {
2034
+ mode: "none";
2035
+ } | {
2036
+ mode: "allow";
2037
+ allow: SandboxEgressDestination[];
2038
+ };
2039
+ /**
2040
+ * One destination an `allow` egress admits: a host name, exact or `*.example.com` (the apex and every name under it), or
2041
+ * an IPv4 or IPv6 range in CIDR notation (one address is a /32 or /128), on the ports it names. Without `ports`: every port
2042
+ * the provider matches that kind of destination on (SandboxEgressCapabilities.domains.ports).
2043
+ */
2044
+ type SandboxEgressDestination = {
2045
+ domain: string;
2046
+ ports?: number[];
2047
+ } | {
2048
+ cidr: string;
2049
+ ports?: number[];
2050
+ };
2051
+ /** The paths a file operation reaches: any path, or only those under these absolute directories. */
2052
+ type SandboxFileScope = "any" | {
2053
+ under: string[];
2054
+ };
2055
+ /**
2056
+ * What the provider's exec API takes, each a field of SandboxExecRequest or a behavior of the door's exec: output while the
2057
+ * command runs (`streaming`), one-shot standard input (`stdin`), a pseudo-terminal (`pty`), a command that outlives the
2058
+ * request that started it and is read again or cancelled by its id (`detach`), per-command variables (`env`), a working
2059
+ * directory (`cwd`) and a time limit the provider enforces (`timeout`).
2060
+ */
2061
+ interface SandboxExecCapabilities {
2062
+ streaming: boolean;
2063
+ stdin: boolean;
2064
+ pty: boolean;
2065
+ detach: boolean;
2066
+ env: boolean;
2067
+ cwd: boolean;
2068
+ timeout: boolean;
2069
+ }
2070
+ /** The provider's file API, per operation: the paths it reaches, or null when it has no such operation. */
2071
+ interface SandboxFileCapabilities {
2072
+ read: SandboxFileScope | null;
2073
+ write: SandboxFileScope | null;
2074
+ delete: SandboxFileScope | null;
1953
2075
  }
1954
- interface ContainerRegistryResponse {
1955
- status: number;
1956
- headers: Record<string, string>;
1957
- body: Uint8Array;
2076
+ /**
2077
+ * The egress vocabulary the provider's network API enforces: its modes; domain destinations (whether `*.` names match, and
2078
+ * the only ports a domain is matched on, null when it is matched on the ports the destination names); CIDR destinations by
2079
+ * IP version; whether a destination may name ports; whether one policy may list domains and CIDRs together; and whether a
2080
+ * running sandbox's egress can be replaced (otherwise only at create, or on a stopped sandbox, taking effect at its start).
2081
+ */
2082
+ interface SandboxEgressCapabilities {
2083
+ modes: ("all" | "none" | "allow")[];
2084
+ domains: {
2085
+ wildcards: boolean;
2086
+ ports: number[] | null;
2087
+ } | null;
2088
+ cidrs: {
2089
+ ipv4: boolean;
2090
+ ipv6: boolean;
2091
+ } | null;
2092
+ ports: boolean;
2093
+ mixed: boolean;
2094
+ live: boolean;
1958
2095
  }
1959
- type ContainerRegistryRequest = (request: {
1960
- url: string;
1961
- method: "GET";
1962
- headers: Record<string, string>;
1963
- maximumBytes: number;
1964
- }) => Promise<ContainerRegistryResponse>;
1965
- /** Canonical Docker/OCI distribution reference. Tags remain mutable until the
1966
- * owning registry resolver pins them; digests are preserved exactly. */
1967
- declare function containerImageReference(value: string): ContainerImageReference;
1968
- declare function immutableContainerImageReference(value: string): ContainerImageReference & {
1969
- digest: `sha256:${string}`;
2096
+ /**
2097
+ * How a sandbox's ports are reached: at a URL the provider serves itself (GET …/ports/{port} answers it with the
2098
+ * authorization it needs; `maxPorts`: how many ports one sandbox can have reachable, null for any), or only from inside
2099
+ * Constal's sandbox service, through the door's forward route (`door`).
2100
+ */
2101
+ type SandboxPortCapabilities = {
2102
+ via: "provider";
2103
+ maxPorts: number | null;
2104
+ } | {
2105
+ via: "door";
1970
2106
  };
1971
- declare function containerImageSource(value: unknown): ContainerImageSource;
1972
- declare function containerImageSelection(value: unknown): ContainerImageSelection;
1973
- /** Resolve a mutable tag or multi-platform index exactly once to one immutable
1974
- * manifest. The caller owns registry authentication and transport Policy. */
1975
- declare function resolveContainerImageSource(reference: string, platform: ContainerImageSource["platform"], request: ContainerRegistryRequest, authorization?: string): Promise<ContainerImageSource>;
1976
-
1977
- /** Canonicalize one provider-neutral path and keep it inside the logical workspace. */
1978
- declare function normalizeSandboxWorkspacePath(path: string, cwd?: string): string;
2107
+ /** The provider's own snapshots: whether one keeps memory (a create from it resumes its processes), and what taking one does to the sandbox. */
2108
+ interface SandboxSnapshotCapabilities {
2109
+ memory: boolean;
2110
+ effect: "none" | "pause" | "stop";
2111
+ }
1979
2112
  /**
1980
- * A sandbox's https requests carry its owner's connections: the Credential of each enabled binding its customer owns (the
1981
- * tenant, for a tenant-level Run) in the Agent's namespace, at the destinations that Credential declares
1982
- * (CredentialDestination). Nothing here names them.
2113
+ * What survives the door's stop on this provider, which is the provider's own: memory, processes and disk (its stop is a
2114
+ * pause, and a start resumes them); the disk, all of it (`only` null) or only under `only`, without what it names in
2115
+ * `except`, which a start boots again; or nothing (its stop destroys the instance, and a start boots the image afresh).
1983
2116
  */
1984
- interface CreateSandboxOptions {
1985
- /** Restrict egress credentials to these owner connection keys. Omitted keeps the existing restriction; [] permits none. */
1986
- connectionKeys?: string[];
1987
- image?: SandboxImage;
1988
- resetImage?: boolean;
1989
- execution?: ContainerImageSelection;
1990
- /** Narrows the pool's network for this sandbox; `Sandbox.updateNetwork` replaces it later. */
1991
- network?: SandboxEgressPolicy;
1992
- /** Labels every egress event of this sandbox carries. */
1993
- labels?: SandboxLabels;
2117
+ type SandboxPersistence = {
2118
+ kind: "memory";
2119
+ } | {
2120
+ kind: "disk";
2121
+ only: string[] | null;
2122
+ except: string[];
2123
+ } | {
2124
+ kind: "none";
2125
+ };
2126
+ /**
2127
+ * How the secrets layer (connectors' Credentials, sign-ins and Logins, added by Constal's egress gateway) reaches a
2128
+ * sandbox's traffic, by the provider's own egress feature: its egress proxy (`proxy`), its forwarding of requests to a URL
2129
+ * (`forwarding`), its interception of them (`interception`), or headers it sets itself (`header-injection`). Nothing in the
2130
+ * sandbox carries it, and a feature that needs anything installed in the sandbox does not count. `none`: a sandbox on this
2131
+ * provider takes no `connectionKeys`.
2132
+ */
2133
+ type SandboxSecretsRoute = "proxy" | "forwarding" | "interception" | "header-injection" | "none";
2134
+ /**
2135
+ * What a provider's own API offers, as its adapter declares it: what a create takes besides its image and size (`create`),
2136
+ * exec, files, egress, ports and snapshots (null where the provider has none), what survives a stop (`persistence`),
2137
+ * whether the provider can also pause a sandbox with its memory (`pauseWithMemory`), and how secrets reach its traffic. A
2138
+ * request that needs what is absent is refused with `Unsupported` and `capability` naming the path, such as `exec.cwd`,
2139
+ * `egress.live`, `files.write` or `secrets`.
2140
+ */
2141
+ interface SandboxCapabilities {
2142
+ /** Whether a create takes the image's start command (`command`) and environment (`env`). */
2143
+ create: {
2144
+ command: boolean;
2145
+ env: boolean;
2146
+ };
2147
+ exec: SandboxExecCapabilities | null;
2148
+ files: SandboxFileCapabilities | null;
2149
+ egress: SandboxEgressCapabilities | null;
2150
+ ports: SandboxPortCapabilities | null;
2151
+ snapshots: SandboxSnapshotCapabilities | null;
2152
+ persistence: SandboxPersistence;
2153
+ pauseWithMemory: boolean;
2154
+ secrets: SandboxSecretsRoute;
2155
+ }
2156
+ /** POST /sandboxes. */
2157
+ interface SandboxCreateRequest {
2158
+ /** The sandbox's id (SANDBOX_DOOR_ID); omitted: sandboxIdFromKey(namespace, key). */
2159
+ id?: string;
1994
2160
  /**
1995
- * Whose sandbox this is. `session` (the default): the Session's own. `entry`: one sandbox for the Run's whole end-to-end
1996
- * run, shared by every Run it reaches, whatever its Agent or Session (InvokeOrigin `entry`): each such Run that calls
1997
- * createSandbox with `entry` works in it, its files kept from one Run to the next, and the Session's calls that name no
1998
- * sandbox (`workspace()`) go there until a createSandbox without it. No Session's end releases it: it is deleted 6 h
1999
- * after it was last used, and the next createSandbox makes a new one. Make it a Run's first call to the pool: a Run's fast
2000
- * calls keep the sandbox their grant found.
2161
+ * The sandbox-pool Resource it runs on (its provider, account, region, and default image and size): its id in the
2162
+ * namespace, or its CRN (SANDBOX_DOOR_POOL_HEADER).
2001
2163
  */
2002
- scope?: SandboxScope;
2164
+ pool: string;
2165
+ /** What the provider boots: an image reference it can boot, or a snapshot's `image`; omitted: the pool's. */
2166
+ image?: string;
2167
+ /** A SANDBOX_SIZES name or an allocation, which usage is priced on; the provider gives its nearest shape at or above it. Omitted: the pool's. */
2168
+ size?: SandboxSize | SandboxResources;
2169
+ /** The command the image starts with, in place of its own (`create.command`). */
2170
+ command?: string[];
2171
+ /** The sandbox's environment (`create.env`). */
2172
+ env?: Record<string, string>;
2173
+ /** Omitted: `{ mode: "all" }`. */
2174
+ network?: SandboxEgress;
2175
+ /** Kept by the coordinator and answered with the sandbox; given to the provider as its labels where it takes them. */
2176
+ labels?: SandboxLabels;
2177
+ /** The tenant's owner connections (binding keys) the secrets layer adds to the sandbox's requests; omitted or []: none. */
2178
+ connectionKeys?: string[];
2003
2179
  }
2004
- /** CreateSandboxOptions `scope`. */
2005
- type SandboxScope = "session" | "entry";
2006
- /**
2007
- * Optional immutable identity for a prepared image. Cache keys are supplied as
2008
- * full SHA-256 digests so a SandboxPool can safely scope and reuse an image
2009
- * without interpreting an Agent's environment manifest.
2010
- */
2011
- interface CreateSandboxImageOptions {
2012
- cacheKey?: string;
2180
+ /** PATCH /sandboxes/{id}: each field replaces its value whole. `network` on a running sandbox needs `egress.live`; `connectionKeys` apply at once. */
2181
+ interface SandboxUpdateRequest {
2182
+ network?: SandboxEgress;
2183
+ labels?: SandboxLabels;
2184
+ connectionKeys?: string[];
2013
2185
  }
2014
- interface SandboxExecInput {
2186
+ /** POST /sandboxes/{id}/exec: `cmd` and `args` are the argv; each other field needs its `exec` capability. */
2187
+ interface SandboxExecRequest {
2015
2188
  cmd: string;
2016
2189
  args?: string[];
2017
2190
  cwd?: string;
2018
2191
  env?: Record<string, string>;
2019
2192
  stdin?: string;
2020
2193
  timeoutMs?: number;
2021
- outputs?: string[];
2022
- /** Upload stdout and stderr to content-addressed storage even when
2023
- * `stdoutPreview` holds them completely. By default output stays on the
2024
- * sandbox disk and `stdoutRef`/`stderrRef` are null unless the preview was
2025
- * truncated or outputs were declared. */
2026
- retain?: boolean;
2027
- /** Keep stdin open for governed process I/O until EOF or process termination. */
2028
- interactive?: boolean;
2029
- /** Stable caller-owned name for one interactive process in this Run. */
2030
- processKey?: string;
2031
- credentials?: SandboxProcessCredentials;
2032
- }
2033
- interface SandboxProcessCredentials {
2034
- /** Variable receives the Credential value. */
2035
- env?: Record<string, ResourceCredentialBinding>;
2036
- /** Variable receives a memory-backed file path containing the value. */
2037
- files?: Record<string, ResourceCredentialBinding>;
2038
- }
2039
- declare const SANDBOX_PROCESS_IO_OPERATIONS: readonly ["process.status", "process.read", "process.write", "process.close"];
2040
- declare const SANDBOX_PROCESS_OPERATIONS: readonly ["process.resolve", "process.status", "process.read", "process.write", "process.close", "process.stop"];
2041
- type SandboxProcessIoOperation = typeof SANDBOX_PROCESS_IO_OPERATIONS[number];
2042
- type SandboxProcessOperation = typeof SANDBOX_PROCESS_OPERATIONS[number];
2043
- interface SandboxProcessReadInput {
2044
- stream: "stdout" | "stderr";
2045
- offset: number;
2046
- limit: number;
2047
- }
2048
- interface SandboxProcessReadResult {
2049
- /** Base64 bytes, which may split a UTF-8 character or application frame. */
2050
- data: string;
2051
- bytes: number;
2052
- offset: number;
2053
- returnedBytes: number;
2054
- nextOffset: number;
2055
- eof: boolean;
2056
2194
  }
2057
- interface SandboxProcessWriteResult {
2195
+ /** A sandbox as the door answers it. */
2196
+ interface SandboxView {
2058
2197
  id: string;
2059
- status: "acknowledged" | "uncertain";
2060
- bytes: number;
2061
- }
2062
- interface SandboxProcessStatus {
2063
- process: string;
2064
- status: string;
2065
- generation: number | null;
2198
+ namespace: string;
2199
+ pool: string;
2200
+ state: SandboxState;
2201
+ /**
2202
+ * Why it stopped, failed or was deleted, when that was said: its caller's stop, the tenant's balance running out, the
2203
+ * provider's own stop (its time limit), a create or start that failed. Null otherwise.
2204
+ */
2205
+ reason: string | null;
2206
+ image: string;
2207
+ /** The allocation its size states, which usage is priced on. */
2208
+ resources: SandboxResources;
2209
+ command: string[] | null;
2210
+ env: Record<string, string>;
2211
+ network: SandboxEgress;
2212
+ labels: SandboxLabels;
2213
+ connectionKeys: string[];
2214
+ /** Where it runs: the provider, its own id for the sandbox (null until it has one), the allocation it gave, and what it offers. */
2215
+ provider: {
2216
+ name: string;
2217
+ id: string | null;
2218
+ allocation: SandboxResources | null;
2219
+ capabilities: SandboxCapabilities;
2220
+ };
2221
+ createdAt: number;
2222
+ startedAt: number | null;
2223
+ stoppedAt: number | null;
2066
2224
  }
2067
- interface SandboxProcess {
2068
- readonly id: string;
2069
- readonly execution: InvocationHandle<SandboxCommandResult> | null;
2070
- status(opts?: InvokeOpts): InvocationHandle<SandboxProcessStatus>;
2071
- read(input: SandboxProcessReadInput, opts?: InvokeOpts): InvocationHandle<SandboxProcessReadResult>;
2072
- write(data: Uint8Array | string, opts?: InvokeOpts): InvocationHandle<SandboxProcessWriteResult>;
2073
- closeStdin(opts?: InvokeOpts): InvocationHandle<SandboxProcessWriteResult>;
2074
- stop(): Promise<void>;
2075
- }
2076
- /** Process facts, independent of whether the caller considers the exit code successful. */
2077
- interface SandboxCommandExecution {
2225
+ type SandboxExecutionState = "running" | "exited" | "timed-out" | "cancelled" | "failed";
2226
+ /**
2227
+ * One command and its result. `stdout` and `stderr` are whole, as the provider answered them (while it runs, what it has
2228
+ * answered so far); Constal cuts nothing, and a provider that keeps only part of a stream answers that part. `error`: why
2229
+ * it `failed` (the provider could not run it, or lost it).
2230
+ */
2231
+ interface SandboxExecution {
2232
+ id: string;
2233
+ state: SandboxExecutionState;
2078
2234
  exitCode: number | null;
2079
- /** The terminating signal, when reported by the runner. */
2080
2235
  signal: string | null;
2081
- /** A failure to execute the process, distinct from a process that exited nonzero. */
2082
- error: {
2083
- code: string;
2084
- message: string;
2085
- } | null;
2236
+ stdout: string;
2237
+ stderr: string;
2238
+ error: string | null;
2239
+ startedAt: number;
2240
+ endedAt: number | null;
2086
2241
  }
2087
- interface SandboxCommandCollectionError {
2242
+ /** A file a call wrote or deleted: its path, and its size when written. */
2243
+ interface SandboxFile {
2088
2244
  path: string;
2089
- code: string;
2090
- message: string;
2245
+ bytes: number | null;
2091
2246
  }
2092
- interface SandboxCommandResult {
2093
- commandId: string;
2094
- /** Execution-service summary, including nonzero exits and output collection failures. It is not application success. */
2095
- status: "completed" | "failed" | "timeout" | "cancelled" | "lease-lost";
2096
- /** Compatibility projection of execution.exitCode. */
2097
- exitCode: number | null;
2098
- /** Null when no process outcome was established; absent on older sandbox results. A resolved invocation may contain an execution error or a nonzero exit. */
2099
- execution?: SandboxCommandExecution | null;
2100
- /** Failures retaining streams or declared outputs, separate from process execution. Absent on older results. */
2101
- collectionErrors?: SandboxCommandCollectionError[];
2102
- /**
2103
- * The stream's output, or its start: up to 100 KiB per stream. On pool versions with the sandbox fast path, an exec it
2104
- * answers holds complete output up to 512 KiB for stdout and stderr together (`stdoutTruncated` false); a stream beyond
2105
- * that budget keeps a 100 KiB preview with `…Truncated` true, its size in `…Bytes` and its content in `…Ref`. Read
2106
- * `…Truncated` rather than assuming a preview size.
2107
- */
2108
- stdoutPreview: string;
2109
- /** As `stdoutPreview`, for stderr; it shares the same 512 KiB inline budget, after stdout. */
2110
- stderrPreview: string;
2111
- stdoutRef: Ref | null;
2112
- stderrRef: Ref | null;
2113
- /** Whether the stream holds more than its preview shows. Absent from results that predate it. */
2114
- stdoutTruncated?: boolean;
2115
- stderrTruncated?: boolean;
2116
- /** The stream's size in bytes; null when it was truncated and not retained. Absent from results that predate it. */
2117
- stdoutBytes?: number | null;
2118
- stderrBytes?: number | null;
2119
- outputs: {
2120
- path: string;
2121
- ref: Ref;
2122
- bytes: number;
2123
- }[];
2124
- sandbox: {
2125
- id: string;
2126
- generation: number;
2127
- fresh: boolean;
2128
- };
2129
- reason?: string;
2247
+ /** A snapshot the provider took: its id, the image a create boots it from, and whether it kept memory. */
2248
+ interface SandboxSnapshot {
2249
+ id: string;
2250
+ image: string;
2251
+ memory: boolean;
2252
+ createdAt: number;
2130
2253
  }
2131
- interface SandboxFileResult {
2254
+
2255
+ /**
2256
+ * A sandbox-pool Resource's operations: the sandbox door's (SANDBOX_DOOR_OPERATIONS in sandbox-door.ts), each one call to it
2257
+ * with the Run's own authority, named as the door names them. The door's port routes are not among them: an endpoint
2258
+ * answers the provider's own authorization, and a forward is the port's stream.
2259
+ */
2260
+ declare const SANDBOX_POOL_OPERATIONS: readonly ["create", "get", "start", "stop", "delete", "update", "exec", "execution", "cancel", "readFile", "writeFile", "deleteFile", "snapshot", "deleteSnapshot"];
2261
+ type SandboxPoolOperation = typeof SANDBOX_POOL_OPERATIONS[number];
2262
+ /** A create through a pool: the door's create request, whose pool is the pool's own Resource. */
2263
+ type SandboxPoolCreateRequest = Omit<SandboxCreateRequest, "pool">;
2264
+ /** A file readFile answered: its path, and its bytes, whole, stored by reference. */
2265
+ interface SandboxFileContent {
2132
2266
  path: string;
2133
2267
  ref: Ref;
2134
2268
  bytes: number;
2135
2269
  }
2136
- interface SandboxReadFileOptions {
2137
- offset?: number;
2138
- limit?: number;
2270
+ /** What writeFile writes: UTF-8 text, or a stored value's bytes. */
2271
+ type SandboxFileBody = string | {
2272
+ ref: Ref;
2273
+ };
2274
+ /** A wait a call long-polls with, in milliseconds: at most SANDBOX_DOOR_MAX_WAIT_MS; omitted or 0 answers at once. */
2275
+ interface SandboxWaitOptions {
2276
+ waitMs?: number;
2139
2277
  invoke?: InvokeOpts;
2140
2278
  }
2141
- interface SandboxReadFileResult {
2142
- path: string;
2143
- content: string;
2144
- contentHash: Ref;
2145
- bytes: number;
2146
- offset: number;
2147
- returnedBytes: number;
2148
- nextOffset: number | null;
2149
- }
2150
- interface SandboxWriteFileResult {
2151
- path: string;
2152
- contentHash: Ref;
2153
- bytes: number;
2154
- }
2155
- interface SandboxMutationResult {
2156
- ok: boolean;
2157
- }
2158
- /** Immutable image handle owned by exactly one SandboxPool Resource. */
2159
- interface SandboxImage {
2279
+ /** One sandbox of a pool, addressed by its id: each method is one door call. */
2280
+ interface Sandbox {
2160
2281
  readonly id: string;
2161
2282
  readonly pool: SandboxPool;
2162
- /** The cache key the image was created or resolved with; null when it has none, or when a handle from `SandboxPool.image` does not know it. */
2163
- readonly cacheKey: string | null;
2164
- delete(opts?: InvokeOpts): Promise<void>;
2165
- }
2166
- /** The authenticated Agent/Session workspace. Its physical sandbox is lazy. */
2167
- interface SandboxWorkspace {
2168
- readonly pool: SandboxPool;
2169
- readonly agent: CRN;
2170
- readonly session: string;
2283
+ get(options?: SandboxWaitOptions): Promise<SandboxView>;
2284
+ /** Answers once the start settles, or the sandbox as it is when the wait ends (`starting`). */
2285
+ start(opts?: InvokeOpts): Promise<SandboxView>;
2286
+ /** What survives a stop is the provider's own (SandboxCapabilities.persistence). */
2287
+ stop(opts?: InvokeOpts): Promise<SandboxView>;
2288
+ delete(opts?: InvokeOpts): Promise<SandboxView>;
2289
+ update(patch: SandboxUpdateRequest, opts?: InvokeOpts): Promise<SandboxView>;
2171
2290
  /**
2172
- * Run one command. `await workspace.exec(...)` (or `Promise.all` of execs) waits for the command inline and continues
2173
- * in the same pass; `start()` first, or racing it with a durable wait, spawn or approval, answers once it is admitted and
2174
- * delivers the result through the Handle. `opts.wait` (`"inline"` | `"async"`) overrides that choice and passes through
2175
- * unchanged; it never changes the Handle id or the operation's identity.
2291
+ * Run one command through the provider's exec API. `await sandbox.exec(...)` waits for it inline; `start()` first, or
2292
+ * racing it with a durable wait, answers once the door admitted it and delivers the result through the Handle.
2176
2293
  */
2177
- exec(input: SandboxExecInput, opts?: InvokeOpts): InvocationHandle<SandboxCommandResult>;
2178
- /** Admit ordinary exec without waiting for exit. Readiness is observable via I/O. */
2179
- openProcess(input: SandboxExecInput, opts?: InvokeOpts): Promise<SandboxProcess>;
2180
- /** Find an active process by key, or reattach by ID, including after exit. Both require this Run's ownership. */
2181
- resolveProcess(selector: string | {
2182
- id: string;
2183
- }, opts?: InvokeOpts): Promise<SandboxProcess | null>;
2184
- /** Synchronous: waits inline unless `options.invoke.wait` is `"async"`. `options.invoke` passes through to the invocation unchanged. */
2185
- readFile(path: string, options?: SandboxReadFileOptions): Promise<SandboxReadFileResult>;
2186
- /** Synchronous: waits inline unless `options.invoke.wait` is `"async"`. `options.invoke` passes through to the invocation unchanged. */
2187
- writeFile(path: string, content: string, options?: {
2188
- mode?: number;
2189
- invoke?: InvokeOpts;
2190
- }): Promise<SandboxWriteFileResult>;
2191
- getFile(path: string, opts?: InvokeOpts): InvocationHandle<SandboxFileResult>;
2192
- putFile(path: string, ref: Ref, options?: {
2193
- mode?: number;
2194
- invoke?: InvokeOpts;
2195
- }): InvocationHandle<SandboxMutationResult>;
2196
- deleteFile(path: string, opts?: InvokeOpts): InvocationHandle<SandboxMutationResult>;
2197
- }
2198
- /** A retained disk's identity and activation fence, separate from any portable checkpoint of its contents. */
2199
- interface SandboxWorkspaceReceipt {
2200
- storageId: string;
2201
- epoch: number;
2202
- coordinator: string;
2203
- /** Opaque provider identity; capabilities are expressed by retained and paths. */
2204
- provider: string;
2205
- paths: string[];
2206
- retained: boolean;
2207
- mutationEpoch: number;
2208
- }
2209
- interface SandboxWorkspacePreparation {
2210
- /** Reuse this key when retrying the same lifecycle action, even across Runs. */
2211
- key: string;
2212
- paths: string[];
2213
- expected?: SandboxWorkspaceReceipt;
2214
- }
2215
- interface SandboxWorkspaceInspection {
2216
- workspace: SandboxWorkspaceReceipt | null;
2217
- state: "active" | "stopping" | "checkpoint" | "stopped" | "missing" | "untracked";
2218
- /** Admitted work may still be writing; the mutation counter alone does not prove backup consistency. */
2219
- busy: boolean;
2220
- /** A lifecycle call whose answer is still uncertain, so an owning Run can join it after recovery. */
2221
- pending?: {
2222
- key: string;
2223
- operation: "resume" | "checkpoint" | "stop" | "discard";
2224
- };
2225
- }
2226
- /** Explicit physical handle used only for lifecycle/image selection controls. */
2227
- interface Sandbox extends SandboxWorkspace {
2228
- readonly id: string;
2229
- /** Replace this sandbox's narrowing of its pool's network, live; null removes it. */
2230
- updateNetwork(network: SandboxEgressPolicy | null, opts?: InvokeOpts): Promise<void>;
2231
- suspend(opts?: InvokeOpts): Promise<void>;
2232
- resume(opts?: InvokeOpts): Promise<void>;
2233
- delete(opts?: InvokeOpts): Promise<void>;
2234
- /** Materialize or resume a workspace, verifying expected storage before reusing it. Unsupported paths retain the archive fallback. */
2235
- prepareWorkspace(input: SandboxWorkspacePreparation, opts?: InvokeOpts): Promise<{
2236
- workspace: SandboxWorkspaceReceipt;
2237
- reused: boolean;
2238
- }>;
2239
- /** Fence admission, drain/cancel work, flush and stop a provider that retains these paths. */
2240
- stopWorkspace(input: {
2241
- key: string;
2242
- expected: SandboxWorkspaceReceipt;
2243
- discard?: boolean;
2244
- }, opts?: InvokeOpts): Promise<{
2245
- workspace: SandboxWorkspaceReceipt;
2246
- }>;
2247
- /** Revoke direct calls and drain work, allowing only the returned Run to export a checkpoint before stop/delete. */
2248
- quiesceWorkspace(input: {
2249
- key: string;
2250
- expected: SandboxWorkspaceReceipt;
2251
- }, opts?: InvokeOpts): Promise<{
2252
- workspace: SandboxWorkspaceReceipt;
2253
- run: string;
2254
- }>;
2255
- inspectWorkspace(input?: {
2256
- expected?: SandboxWorkspaceReceipt;
2257
- probe?: boolean;
2258
- }, opts?: InvokeOpts): Promise<SandboxWorkspaceInspection>;
2259
- /** Explicitly discard a retained workspace; the current activation receipt is required. */
2260
- deleteWorkspace(expected: SandboxWorkspaceReceipt, opts?: InvokeOpts): Promise<void>;
2261
- }
2262
- /** Provider-neutral factory and owner for images and logical sandboxes. */
2294
+ exec(request: SandboxExecRequest, opts?: InvokeOpts): InvocationHandle<SandboxExecution>;
2295
+ /** An execution by its id, such as one another caller started. */
2296
+ execution(id: string, options?: SandboxWaitOptions): Promise<SandboxExecution>;
2297
+ cancelExecution(id: string, opts?: InvokeOpts): Promise<SandboxExecution>;
2298
+ readFile(path: string, opts?: InvokeOpts): Promise<SandboxFileContent>;
2299
+ writeFile(path: string, body: SandboxFileBody, opts?: InvokeOpts): Promise<SandboxFile>;
2300
+ deleteFile(path: string, opts?: InvokeOpts): Promise<SandboxFile>;
2301
+ /** The provider's own snapshot; a later createSandbox names its `image`. */
2302
+ snapshot(opts?: InvokeOpts): Promise<SandboxSnapshot>;
2303
+ deleteSnapshot(id: string, opts?: InvokeOpts): Promise<SandboxSnapshot>;
2304
+ }
2305
+ /** A sandbox createSandbox made, or found again on a replay: its handle, and the sandbox as the door answered it. */
2306
+ interface CreatedSandbox {
2307
+ sandbox: Sandbox;
2308
+ view: SandboxView;
2309
+ }
2310
+ /** A provider-neutral pool of sandboxes, each addressed by id. */
2263
2311
  interface SandboxPool {
2264
2312
  readonly resource: CRN;
2265
- /** Use the current authenticated Agent/Session workspace without creating it explicitly. */
2266
- workspace(): SandboxWorkspace;
2267
- /** Capture an immutable image from a sandbox owned by this pool. */
2268
- createImage(sandbox: Sandbox, options?: CreateSandboxImageOptions, opts?: InvokeOpts): Promise<SandboxImage>;
2269
- /** Resolve an Agent-owned prepared image by its immutable environment digest. */
2270
- resolveImage(cacheKey: string, opts?: InvokeOpts): Promise<SandboxImage | null>;
2271
- /** Address a pool-owned image recorded earlier, e.g. in a Fact. No invocation. The handle does not know the image's
2272
- * cache key (`cacheKey` is null) and its delete() removes a setup-cache image too, so address only images the Agent recorded. */
2273
- image(id: string): SandboxImage;
2274
- /** Register a logical Agent/Session sandbox; provider compute is allocated by its first work operation. The pool refuses
2275
- * an `image` while the Session's sandbox is live: delete that sandbox first to recreate it from an image. */
2276
- createSandbox(agent: CRN, session: string, options?: CreateSandboxOptions, opts?: InvokeOpts): Promise<Sandbox>;
2313
+ /** Create a sandbox on the pool; without an `id`, the door names it from the invocation's idempotency key. */
2314
+ createSandbox(request?: SandboxPoolCreateRequest, opts?: InvokeOpts): Promise<CreatedSandbox>;
2315
+ /** Address a sandbox of the pool by its id, such as one the Session keeps. No invocation. */
2316
+ sandbox(id: string): Sandbox;
2277
2317
  }
2318
+ /** The code a sandbox operation fails with when its pool's provider cannot provide a sandbox now (see `sandboxProviderUnavailable`). */
2319
+ declare const SANDBOX_PROVIDER_UNAVAILABLE = "ProviderUnavailable";
2320
+ /**
2321
+ * Why a provider cannot provide a sandbox now: out of capacity, rate limiting the account, the account's quota spent, the
2322
+ * pool's region unavailable, or an outage (any other provider failure that persisted).
2323
+ */
2324
+ declare const SANDBOX_PROVIDER_FAILURE_CLASSES: readonly ["capacity", "rate_limited", "quota", "region", "outage"];
2325
+ type SandboxProviderFailureClass = typeof SANDBOX_PROVIDER_FAILURE_CLASSES[number];
2326
+ /**
2327
+ * A pool's provider could not provide a sandbox (the door's `ProviderUnavailable`). `retryAfterMs` is when the same provider
2328
+ * is worth asking again. A caller that routes between pools fails over on it.
2329
+ */
2330
+ interface SandboxProviderUnavailable {
2331
+ code: typeof SANDBOX_PROVIDER_UNAVAILABLE;
2332
+ reason: SandboxProviderFailureClass;
2333
+ retryAfterMs: number;
2334
+ message: string;
2335
+ }
2336
+ /**
2337
+ * ProviderUnavailable from whatever carries it, or null for any other failure: the door's refusal (`{ code, message, reason,
2338
+ * retryAfterMs }`), a failed Handle's error (`{ code, message, reason, retryAfterMs, cause }`), or the Error an invocation
2339
+ * rejects with, which keeps `code`, `retryAfterMs` and `cause` (`cause.code` is the reason) across every boundary.
2340
+ */
2341
+ declare function sandboxProviderUnavailable(value: unknown): SandboxProviderUnavailable | null;
2278
2342
 
2279
2343
  /**
2280
2344
  * Model evaluation: one shared state judged against a map of typed questions,
@@ -3283,7 +3347,7 @@ interface InvokeOpts {
3283
3347
  * called before it is awaited or it is raced with a durable wait, spawn, approval or any other Handle.
3284
3348
  *
3285
3349
  * A transport hint, not part of the operation: it never changes the operation hash, the Handle id, the journal or the
3286
- * result, and a platform without the sandbox fast path ignores it. Any other value is a TypeError.
3350
+ * result, and a platform that does not take it ignores it. Any other value is a TypeError.
3287
3351
  */
3288
3352
  wait?: "inline" | "async";
3289
3353
  }
@@ -3310,10 +3374,12 @@ interface BoundResourceCapabilities {
3310
3374
  hash: Hash;
3311
3375
  credentialSlots: string[];
3312
3376
  operations: BoundOperation[];
3377
+ /** `inputModalities`: what the model takes as input (`text`, `image`, `file`, …), when its Resource declares it. */
3313
3378
  model?: {
3314
3379
  id: string;
3315
3380
  contextTokens?: number;
3316
3381
  maxOutputTokens?: number;
3382
+ inputModalities?: string[];
3317
3383
  };
3318
3384
  }
3319
3385
  /** One evaluation of shared state against typed questions through a bound evaluation Model, or a Gateway plus explicit model identifier. */
@@ -3385,6 +3451,12 @@ interface Ctx {
3385
3451
  invokeAsync<T>(resource: CRN, op: string, args: unknown, opts?: InvokeOpts): InvocationHandle<T>;
3386
3452
  request(policy: PolicyCRN, grant: CapabilityGrant): Handle<CapabilityRef>;
3387
3453
  analytics: AnalyticsClient;
3454
+ /**
3455
+ * Declares what this Run's conversation shows once the Run ends: a state its Channel renders (Leonard's Slack Channel:
3456
+ * suspended, processing or active). The last declaration of the Run stands; with none, a Run admitted by an event that
3457
+ * showed working shows idle. "working" is the platform's own and cannot be declared.
3458
+ */
3459
+ presence(state: string): void;
3388
3460
  /** This step's journal at the Agent's current position. Undefined where the platform's runtime predates it. */
3389
3461
  readonly journal?: StepJournal;
3390
3462
  run: RunInfo;
@@ -3430,10 +3502,10 @@ declare function race<T>(handles: Handle<T>[], opts?: {
3430
3502
 
3431
3503
  /**
3432
3504
  * The find, read and run Tools over one bound skills Resource, named from its binding (`.` and `-` become `_`).
3433
- * find and read are the library's catalog operations; run copies the skill's folder into the sandbox workspace once per
3505
+ * find and read are the library's catalog operations; run copies the skill's folder into a sandbox of the bound pool once per
3434
3506
  * bundle and runs one command there.
3435
3507
  */
3436
- declare function skills(binding?: string, sandbox?: string): Record<string, Tool>;
3508
+ declare function skills(binding?: string, pool?: string): Record<string, Tool>;
3437
3509
 
3438
3510
  declare function validateTool(tool: Tool, path?: string): Tool;
3439
3511
  declare function validateView<V extends ViewDef<any, any>>(view: V, path?: string): V;
@@ -3512,6 +3584,31 @@ interface CanonicalEvent<T = unknown> {
3512
3584
  occurredAt: number;
3513
3585
  deliver?: DeliveryMode;
3514
3586
  }
3587
+ /** A file an event carries, as the source declared it. */
3588
+ interface ChannelObject {
3589
+ /** The source's own id of the file, unique within this Channel for its customer. */
3590
+ id: string;
3591
+ name?: string;
3592
+ mediaType?: string;
3593
+ /** Its size as the source declared it. */
3594
+ bytes?: number;
3595
+ /** What fetch() needs to reach it again (Slack: the download path). */
3596
+ metadata?: Record<string, string | number | boolean>;
3597
+ }
3598
+ /** A range of a file receive() declared, for fetch() to download with this Channel's own Resources. */
3599
+ interface ChannelFetchRequest {
3600
+ object: ChannelObject;
3601
+ range: {
3602
+ offset: number;
3603
+ length: number;
3604
+ };
3605
+ }
3606
+ /** `gone` says why the source no longer has the file. */
3607
+ type ChannelFetchResult = {
3608
+ fetched: true;
3609
+ } | {
3610
+ gone: string;
3611
+ };
3515
3612
  interface CanonicalEventDraft<T = unknown> {
3516
3613
  id: string;
3517
3614
  type: string;
@@ -3530,6 +3627,31 @@ interface CanonicalEventDraft<T = unknown> {
3530
3627
  replyTo?: string;
3531
3628
  metadata?: Record<string, string | number | boolean>;
3532
3629
  };
3630
+ /** The event's presence: `working` asks the Session to show working when it admits the event (never for a duplicate);
3631
+ * `metadata` reaches presence() for this event's destination. */
3632
+ presence?: {
3633
+ working?: true;
3634
+ metadata?: Record<string, string | number | boolean>;
3635
+ };
3636
+ /** Files the event carries that the platform stores when first read, or in the background from admission. */
3637
+ objects?: ChannelObject[];
3638
+ }
3639
+ /** What a destination shows, as presence() receives it. */
3640
+ interface ChannelPresence {
3641
+ destination: string;
3642
+ replyTo?: string;
3643
+ /** The reply address's metadata, as receive() pinned it. */
3644
+ replyMetadata?: Record<string, string | number | boolean>;
3645
+ /** "working", "idle", or the state a Run declared (ctx.presence). */
3646
+ state: string;
3647
+ /** The presence metadata of the event this destination's presence came from. */
3648
+ metadata: Record<string, string | number | boolean>;
3649
+ /** What this Channel's last presence() for this destination returned; null for the first. */
3650
+ previous: Record<string, string | number | boolean> | null;
3651
+ }
3652
+ /** What presence() returns; the next presence() for the destination receives its metadata as `previous`. */
3653
+ interface ChannelPresenceReceipt {
3654
+ metadata?: Record<string, string | number | boolean>;
3533
3655
  }
3534
3656
  interface IgnoredChannelEvent {
3535
3657
  ignored: true;
@@ -3620,6 +3742,10 @@ interface ChannelProtocol<Input = unknown, Output = unknown, Delivery = Output>
3620
3742
  failed?(failure: ChannelFailure, context: ChannelContext): Promise<void> | void;
3621
3743
  /** Prove external access before a subscriber's Channel, bindings, or routes are installed. */
3622
3744
  authorizeSubscription?(request: ChannelSubscriptionRequest, context: ChannelContext): Promise<boolean> | boolean;
3745
+ /** Shows a destination's presence. Called by the Session's outbox, in order, once per state change. */
3746
+ presence?(presence: ChannelPresence, context: ChannelContext): Promise<ChannelPresenceReceipt> | ChannelPresenceReceipt;
3747
+ /** Fetches a range of a file receive() declared, with this Channel's own Resources; `gone` says why the source no longer has it. */
3748
+ fetch?(request: ChannelFetchRequest, context: ChannelContext): Promise<ChannelFetchResult> | ChannelFetchResult;
3623
3749
  }
3624
3750
  interface Channel<Input = unknown, Output = unknown, Delivery = Output> {
3625
3751
  id: string;
@@ -5265,6 +5391,58 @@ declare function credentialProviderSetupMetadata(value: unknown, slots: string[]
5265
5391
  /** Defines and validates a Credential Provider package. */
5266
5392
  declare function credentialProvider<C>(definition: CredentialProviderDefinition<C>): CredentialProviderPackage<C>;
5267
5393
 
5394
+ interface ContainerImageReference {
5395
+ registry: string;
5396
+ repository: string;
5397
+ tag: string | null;
5398
+ digest: string | null;
5399
+ reference: string;
5400
+ }
5401
+ /** Immutable OCI identity before any provider-specific preparation. */
5402
+ interface ContainerImageSource {
5403
+ reference: string;
5404
+ digest: `sha256:${string}`;
5405
+ mediaType: string;
5406
+ bytes: number;
5407
+ platform: {
5408
+ os: string;
5409
+ architecture: string;
5410
+ variant?: string;
5411
+ };
5412
+ }
5413
+ /** Digest-pinned image selected for one Linux execution environment. Manifest
5414
+ * metadata is resolved by the runtime pull and recorded in its receipt. */
5415
+ interface ContainerImageSelection {
5416
+ reference: string;
5417
+ platform: {
5418
+ os: string;
5419
+ architecture: string;
5420
+ variant?: string;
5421
+ };
5422
+ }
5423
+ interface ContainerRegistryResponse {
5424
+ status: number;
5425
+ headers: Record<string, string>;
5426
+ body: Uint8Array;
5427
+ }
5428
+ type ContainerRegistryRequest = (request: {
5429
+ url: string;
5430
+ method: "GET";
5431
+ headers: Record<string, string>;
5432
+ maximumBytes: number;
5433
+ }) => Promise<ContainerRegistryResponse>;
5434
+ /** Canonical Docker/OCI distribution reference. Tags remain mutable until the
5435
+ * owning registry resolver pins them; digests are preserved exactly. */
5436
+ declare function containerImageReference(value: string): ContainerImageReference;
5437
+ declare function immutableContainerImageReference(value: string): ContainerImageReference & {
5438
+ digest: `sha256:${string}`;
5439
+ };
5440
+ declare function containerImageSource(value: unknown): ContainerImageSource;
5441
+ declare function containerImageSelection(value: unknown): ContainerImageSelection;
5442
+ /** Resolve a mutable tag or multi-platform index exactly once to one immutable
5443
+ * manifest. The caller owns registry authentication and transport Policy. */
5444
+ declare function resolveContainerImageSource(reference: string, platform: ContainerImageSource["platform"], request: ContainerRegistryRequest, authorization?: string): Promise<ContainerImageSource>;
5445
+
5268
5446
  declare const MCP_PROTOCOL_VERSION = "2025-06-18";
5269
5447
  interface McpClientState {
5270
5448
  protocolVersion: string;
@@ -5543,5 +5721,5 @@ declare function parseLedgerAddress(value: unknown): LedgerAddressParts | null;
5543
5721
  /** Formats ledger address parts; throws when a part breaks its id rule. */
5544
5722
  declare function formatLedgerAddress(parts: LedgerAddressParts): LedgerAddress;
5545
5723
 
5546
- export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CHAT_FORMAT_CAPABILITY, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DATA_SHARE_FEE_BPS, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GENERAL_QUALITY_JUDGE, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, NotAppendOnly, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_EGRESS_LIMITS, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TRAINING_RECIPE_DEFAULTS, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentLimit, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, all, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, chatFormat, chatFormatMetadata, chatFormatPin, chatParseInput, chatParsed, chatRenderInput, chatRenderRequest, chatRendering, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, dataShareEarningMicroUsd, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, formatLedgerAddress, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, judgeAgent, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeCredentialDestinations, normalizeModelGatewayConfig, normalizeSandboxConnectionKeys, normalizeSandboxEgressPolicy, normalizeSandboxLabels, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, runLabels, sandboxControls, sandboxEgressDecision, sandboxEgressHostMatches, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerDraftHash, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, shareContributionRequest, shareContributionReview, shareEvaluation, sharePrices, shareRequest, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingCorrection, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
5547
- export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentGovernanceMeter, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AgentUiDeclaration, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundOperation, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelContext, ChannelDeliveryError, ChannelDeliveryEvent, ChannelDeliveryOutcome, ChannelDeliveryReport, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, ChatFormatDefinition, ChatFormatMetadata, ChatFormatPin, ChatMessage, ChatParseRequest, ChatParsed, ChatRenderRequest, ChatRendering, ChatSpan, ChatTool, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, ChoiceAnswer, ChoiceQuestion, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ContainerImageReference, ContainerImageSelection, ContainerImageSource, ContainerRegistryRequest, ContainerRegistryResponse, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestination, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialPresentation, CredentialProviderCRN, CredentialProviderConfigEgressBinding, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DataSharingScope, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvalSuiteCase, EvalSuiteCasePage, EvalSuiteCaseScore, EvalSuiteCaseState, EvalSuiteScoreState, EvaluationAnswer, EvaluationAnswerFor, EvaluationAnswers, EvaluationEntry, EvaluationInvocationArgs, EvaluationInvocationResult, EvaluationProtocol, EvaluationQuestion, EvaluationQuestions, EvaluationRecord, EvaluationSpec, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryPage, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, JudgeRubric, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCacheHint, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, NoulAnswer, NoulQuestion, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunReport, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandCollectionError, SandboxCommandExecution, SandboxCommandResult, SandboxEgressPolicy, SandboxEgressRule, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxLabels, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, SandboxWorkspaceInspection, SandboxWorkspacePreparation, SandboxWorkspaceReceipt, SandboxWriteFileResult, Schedule, ScheduleCancellation, ScheduleDuration, ScheduleMissed, ScheduleOccurrence, ScheduleOccurrencePage, ScheduleOptions, SchedulePage, ScheduleState, ScheduleTarget, ScheduleTiming, ScheduleTrigger, ScheduleWhen, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreAnswer, ScoreQuestion, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerDraft, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, ShareHistory, SharePrice, ShareRequest, ShareReviewDecision, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, StepJournal, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingCorrection, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingPreparation, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingStep, TrainingUsageUnits, TurnDraft, TurnGate, TurnHistoryMessage, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
5724
+ export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CHAT_FORMAT_CAPABILITY, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DATA_SHARE_FEE_BPS, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GENERAL_QUALITY_JUDGE, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, NotAppendOnly, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_DOOR_MAX_WAIT_MS, SANDBOX_EGRESS_LIMITS, SANDBOX_POOL_OPERATIONS, SANDBOX_PROVIDER_FAILURE_CLASSES, SANDBOX_PROVIDER_UNAVAILABLE, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TRAINING_RECIPE_DEFAULTS, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentLimit, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, all, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, chatFormat, chatFormatMetadata, chatFormatPin, chatParseInput, chatParsed, chatRenderInput, chatRenderRequest, chatRendering, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, dataShareEarningMicroUsd, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, formatLedgerAddress, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, judgeAgent, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeCredentialDestinations, normalizeModelGatewayConfig, normalizeSandboxConnectionKeys, normalizeSandboxEgressPolicy, normalizeSandboxLabels, normalizeSandboxNetworkPolicy, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, runLabels, sandboxControls, sandboxEgressDecision, sandboxEgressHostMatches, sandboxLimit, sandboxProviderUnavailable, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerDraftHash, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, shareContributionRequest, shareContributionReview, shareEvaluation, sharePrices, shareRequest, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingCorrection, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
5725
+ export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentGovernanceMeter, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AgentUiDeclaration, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundOperation, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelContext, ChannelDeliveryError, ChannelDeliveryEvent, ChannelDeliveryOutcome, ChannelDeliveryReport, ChannelFailure, ChannelFetchRequest, ChannelFetchResult, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelObject, ChannelPresence, ChannelPresenceReceipt, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, ChatFormatDefinition, ChatFormatMetadata, ChatFormatPin, ChatMessage, ChatParseRequest, ChatParsed, ChatRenderRequest, ChatRendering, ChatSpan, ChatTool, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, ChoiceAnswer, ChoiceQuestion, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ContainerImageReference, ContainerImageSelection, ContainerImageSource, ContainerRegistryRequest, ContainerRegistryResponse, ControlEvent, Cost, CreatedSandbox, CredentialCRN, CredentialDestination, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialPresentation, CredentialProviderCRN, CredentialProviderConfigEgressBinding, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DataSharingScope, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvalSuiteCase, EvalSuiteCasePage, EvalSuiteCaseScore, EvalSuiteCaseState, EvalSuiteScoreState, EvaluationAnswer, EvaluationAnswerFor, EvaluationAnswers, EvaluationEntry, EvaluationInvocationArgs, EvaluationInvocationResult, EvaluationProtocol, EvaluationQuestion, EvaluationQuestions, EvaluationRecord, EvaluationSpec, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryPage, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, JudgeRubric, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCacheHint, ModelCompletion, ModelContentPart, ModelCredentialHeader, ModelFilePart, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, ModelTechnicalCapabilities, ModelTextPart, ModelTool, NormalizedModelGatewayConfig, NoulAnswer, NoulQuestion, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunReport, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCapabilities, SandboxCreateRequest, SandboxEgress, SandboxEgressCapabilities, SandboxEgressDestination, SandboxEgressPolicy, SandboxEgressRule, SandboxExecCapabilities, SandboxExecRequest, SandboxExecution, SandboxExecutionState, SandboxFile, SandboxFileBody, SandboxFileCapabilities, SandboxFileContent, SandboxFileScope, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxLabels, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPersistence, SandboxPool, SandboxPoolCreateRequest, SandboxPoolOperation, SandboxPortCapabilities, SandboxProviderFailureClass, SandboxProviderUnavailable, SandboxSecretsRoute, SandboxSnapshot, SandboxSnapshotCapabilities, SandboxState, SandboxUpdateRequest, SandboxView, SandboxWaitOptions, Schedule, ScheduleCancellation, ScheduleDuration, ScheduleMissed, ScheduleOccurrence, ScheduleOccurrencePage, ScheduleOptions, SchedulePage, ScheduleState, ScheduleTarget, ScheduleTiming, ScheduleTrigger, ScheduleWhen, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreAnswer, ScoreQuestion, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerDraft, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, ShareHistory, SharePrice, ShareRequest, ShareReviewDecision, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, StepJournal, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingCorrection, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingPreparation, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingStep, TrainingUsageUnits, TurnDraft, TurnGate, TurnHistoryMessage, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };