@miosa/sdk 3.2.4 → 3.3.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.
- package/README.md +121 -0
- package/dist/index.d.ts +872 -13
- package/dist/index.js +1325 -50
- package/dist/index.js.map +1 -1
- package/native/h3-runner/index.d.ts +61 -0
- package/native/h3-runner/index.js +60 -0
- package/native/h3-runner/npm/darwin-arm64/h3-runner-native.darwin-arm64.node +0 -0
- package/native/h3-runner/npm/darwin-x64/h3-runner-native.darwin-x64.node +0 -0
- package/native/h3-runner/npm/linux-arm64-gnu/h3-runner-native.linux-arm64-gnu.node +0 -0
- package/native/h3-runner/npm/linux-x64-gnu/h3-runner-native.linux-x64-gnu.node +0 -0
- package/native/h3-runner/package.json +9 -0
- package/package.json +17 -14
package/dist/index.d.ts
CHANGED
|
@@ -2230,6 +2230,20 @@ interface MiosaClientConfig {
|
|
|
2230
2230
|
baseUrl?: string;
|
|
2231
2231
|
timeout?: number;
|
|
2232
2232
|
maxRetries?: number;
|
|
2233
|
+
/**
|
|
2234
|
+
* Opt-in SOMA one-hop runner path (ONE-HOP-RUNNER-DESIGN-2026-10-02.md).
|
|
2235
|
+
* When enabled, `Miosa.runner` talks straight to `run-<region>.miosa.ai`
|
|
2236
|
+
* for sandbox create/exec/destroy, bypassing the control-plane hop.
|
|
2237
|
+
* Also enabled by the `MIOSA_RUNNER_MODE=1` environment variable.
|
|
2238
|
+
* Every other client path (`miosa.sandboxes`, etc.) is unaffected either way.
|
|
2239
|
+
*/
|
|
2240
|
+
runner?: {
|
|
2241
|
+
enabled?: boolean;
|
|
2242
|
+
/** Defaults to `us` (C5: not carried in the key this release); also settable via `MIOSA_RUNNER_REGION`. */
|
|
2243
|
+
region?: string;
|
|
2244
|
+
/** Overrides `miosa.ai` - for self-hosted / test deployments. */
|
|
2245
|
+
baseDomain?: string;
|
|
2246
|
+
};
|
|
2233
2247
|
}
|
|
2234
2248
|
|
|
2235
2249
|
type SnapshotStatus = "creating" | "uploading" | "ready" | "restoring" | "failed" | "deleted";
|
|
@@ -5219,6 +5233,8 @@ interface MiosaErrorBody {
|
|
|
5219
5233
|
message?: string;
|
|
5220
5234
|
details?: unknown;
|
|
5221
5235
|
retryable?: boolean;
|
|
5236
|
+
request_id?: string;
|
|
5237
|
+
retry_after_ms?: number;
|
|
5222
5238
|
};
|
|
5223
5239
|
message?: string;
|
|
5224
5240
|
code?: string;
|
|
@@ -5227,6 +5243,7 @@ interface MiosaErrorBody {
|
|
|
5227
5243
|
reason?: string;
|
|
5228
5244
|
request_id?: string;
|
|
5229
5245
|
retryable?: boolean;
|
|
5246
|
+
retry_after_ms?: number;
|
|
5230
5247
|
}
|
|
5231
5248
|
declare class MiosaError extends Error {
|
|
5232
5249
|
readonly status: number;
|
|
@@ -5234,8 +5251,21 @@ declare class MiosaError extends Error {
|
|
|
5234
5251
|
readonly details: unknown;
|
|
5235
5252
|
readonly requestId: string | undefined;
|
|
5236
5253
|
readonly retryable: boolean;
|
|
5237
|
-
|
|
5238
|
-
|
|
5254
|
+
/**
|
|
5255
|
+
* Server-supplied retry hint in milliseconds, taken from the canonical
|
|
5256
|
+
* error shape's `retry_after_ms` (nested under `error` or top-level) or,
|
|
5257
|
+
* failing that, the HTTP `Retry-After` header. `undefined` when the
|
|
5258
|
+
* response carried neither, in which case a caller should fall back to
|
|
5259
|
+
* its own backoff policy.
|
|
5260
|
+
*/
|
|
5261
|
+
retryAfterMs: number | undefined;
|
|
5262
|
+
constructor(message: string, status: number, code: string, details?: unknown, requestId?: string, retryable?: boolean, retryAfterMs?: number);
|
|
5263
|
+
/**
|
|
5264
|
+
* @param retryAfterHeaderMs The `Retry-After` header value, already
|
|
5265
|
+
* converted to milliseconds by the caller. Used only when the body does
|
|
5266
|
+
* not carry the more precise `retry_after_ms`.
|
|
5267
|
+
*/
|
|
5268
|
+
static fromResponse(status: number, body: MiosaErrorBody, requestId?: string, retryAfterHeaderMs?: number): MiosaError;
|
|
5239
5269
|
}
|
|
5240
5270
|
declare class AuthError extends MiosaError {
|
|
5241
5271
|
constructor(message: string, status?: number, code?: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
@@ -6732,7 +6762,7 @@ type SandboxSize = "xs" | "small" | "medium" | "large" | "xl";
|
|
|
6732
6762
|
type SandboxId = string & {
|
|
6733
6763
|
readonly __brand: "SandboxId";
|
|
6734
6764
|
};
|
|
6735
|
-
type SandboxState = "provisioning" | "running" | "paused" | "destroying" | "destroyed" | "error";
|
|
6765
|
+
type SandboxState = "provisioning" | "running" | "pausing" | "paused" | "resuming" | "stopped" | "destroying" | "destroyed" | "error";
|
|
6736
6766
|
interface SandboxCreateParams {
|
|
6737
6767
|
templateId?: string;
|
|
6738
6768
|
template_id?: string;
|
|
@@ -6827,8 +6857,18 @@ interface SandboxCreateParams {
|
|
|
6827
6857
|
}
|
|
6828
6858
|
interface SandboxGetOrCreateParams extends SandboxCreateParams {
|
|
6829
6859
|
name: string;
|
|
6830
|
-
/**
|
|
6860
|
+
/**
|
|
6861
|
+
* Resume an existing sandbox before returning it, when it is `paused`,
|
|
6862
|
+
* `stopped` (persistent sandboxes only), or - after a bounded wait - lands
|
|
6863
|
+
* in one of those states from `pausing`. Defaults to true.
|
|
6864
|
+
*/
|
|
6831
6865
|
resume?: boolean;
|
|
6866
|
+
/**
|
|
6867
|
+
* Bound on how long to wait out an in-progress `pausing` transition before
|
|
6868
|
+
* attempting resume, in seconds. The server's own pause work is typically
|
|
6869
|
+
* well under this. Defaults to 30.
|
|
6870
|
+
*/
|
|
6871
|
+
pausingWaitTimeoutSec?: number;
|
|
6832
6872
|
/**
|
|
6833
6873
|
* Wait for readiness before returning a created/resumed sandbox. Defaults to false.
|
|
6834
6874
|
*
|
|
@@ -6861,6 +6901,18 @@ interface SandboxExecOptions {
|
|
|
6861
6901
|
timeout?: number;
|
|
6862
6902
|
timeoutSec?: number;
|
|
6863
6903
|
timeout_sec?: number;
|
|
6904
|
+
/**
|
|
6905
|
+
* `exec.stream` only. Budget (seconds) reserved for the sandbox to wake
|
|
6906
|
+
* and resume before the command's own `timeoutSec` starts counting down,
|
|
6907
|
+
* separate from it. The server opens the SSE response, runs
|
|
6908
|
+
* `ensure_running` (which resumes a paused sandbox), and only then starts
|
|
6909
|
+
* the command's own timeout - so without a separate budget a slow resume
|
|
6910
|
+
* could abort a command client-side while it is still within its own
|
|
6911
|
+
* server-side deadline. Defaults to {@link DEFAULT_EXEC_WAKE_BUDGET_SEC}.
|
|
6912
|
+
* Has no effect when `timeoutSec` is omitted (the stream is unbounded).
|
|
6913
|
+
*/
|
|
6914
|
+
wakeTimeoutSec?: number;
|
|
6915
|
+
wake_timeout_sec?: number;
|
|
6864
6916
|
}
|
|
6865
6917
|
interface SandboxExecResult {
|
|
6866
6918
|
stdout: string;
|
|
@@ -6869,6 +6921,14 @@ interface SandboxExecResult {
|
|
|
6869
6921
|
exit_code: number;
|
|
6870
6922
|
durationMs?: number;
|
|
6871
6923
|
duration_ms?: number;
|
|
6924
|
+
/**
|
|
6925
|
+
* True when the server killed the command for exceeding its timeout.
|
|
6926
|
+
* Without this, a timeout was indistinguishable from the infra error
|
|
6927
|
+
* frame, which also reports `exitCode: -1`. Absent when the server did
|
|
6928
|
+
* not report it (older servers, or a non-timeout exit).
|
|
6929
|
+
*/
|
|
6930
|
+
timedOut?: boolean;
|
|
6931
|
+
timed_out?: boolean;
|
|
6872
6932
|
}
|
|
6873
6933
|
interface SandboxExportFile {
|
|
6874
6934
|
path: string;
|
|
@@ -6902,7 +6962,10 @@ interface SandboxExportParams {
|
|
|
6902
6962
|
* The server tags each SSE frame with an `event:` name (`stdout` / `stderr` /
|
|
6903
6963
|
* `exit`); the SDK maps that name onto `type`. For output frames `data` (and
|
|
6904
6964
|
* its legacy alias `line`) carry the text chunk. The exit frame carries the
|
|
6905
|
-
* process exit code as both `exit_code` and its camelCase alias `exitCode
|
|
6965
|
+
* process exit code as both `exit_code` and its camelCase alias `exitCode`,
|
|
6966
|
+
* plus `timed_out`/`timedOut` when the server reports it (see B1-9: without
|
|
6967
|
+
* this a timeout was indistinguishable from the infra error frame, which
|
|
6968
|
+
* also reports `exit_code: -1`).
|
|
6906
6969
|
*/
|
|
6907
6970
|
type SandboxExecEvent = {
|
|
6908
6971
|
type: "stdout";
|
|
@@ -6916,6 +6979,8 @@ type SandboxExecEvent = {
|
|
|
6916
6979
|
type: "exit";
|
|
6917
6980
|
exit_code: number;
|
|
6918
6981
|
exitCode: number;
|
|
6982
|
+
timed_out?: boolean;
|
|
6983
|
+
timedOut?: boolean;
|
|
6919
6984
|
};
|
|
6920
6985
|
interface SandboxExecRunner {
|
|
6921
6986
|
(command: string, options?: SandboxExecOptions): Promise<SandboxExecResult>;
|
|
@@ -7117,6 +7182,21 @@ interface SandboxWriteManyEntry {
|
|
|
7117
7182
|
content: string | Uint8Array;
|
|
7118
7183
|
}
|
|
7119
7184
|
interface SandboxWriteManyResult {
|
|
7185
|
+
/**
|
|
7186
|
+
* The guest's advertised batch transaction contract, forwarded verbatim.
|
|
7187
|
+
* Only the exact value `"failure_atomic"` promises that a failed batch left
|
|
7188
|
+
* no destination changed. Any other string, and an absent field on an older
|
|
7189
|
+
* guest, is not that guarantee, so compare the literal instead of testing
|
|
7190
|
+
* the field for presence.
|
|
7191
|
+
*/
|
|
7192
|
+
atomicity?: "failure_atomic" | (string & {});
|
|
7193
|
+
/**
|
|
7194
|
+
* The guest's advertised read-isolation scope, forwarded verbatim.
|
|
7195
|
+
* Only the exact value `"file_api_operations"` promises that file API reads
|
|
7196
|
+
* serialize against batch publication, and even then separate shell/Docker
|
|
7197
|
+
* readers, open descriptors and watchers are not transaction-isolated.
|
|
7198
|
+
*/
|
|
7199
|
+
read_isolation?: "file_api_operations" | (string & {});
|
|
7120
7200
|
written: Array<{
|
|
7121
7201
|
path: string;
|
|
7122
7202
|
size_bytes: number;
|
|
@@ -7212,7 +7292,16 @@ declare class SandboxFiles {
|
|
|
7212
7292
|
download(path: string): Promise<Uint8Array>;
|
|
7213
7293
|
/** GET /api/v1/sandboxes/{id}/files/tree — recursive directory tree. */
|
|
7214
7294
|
tree(path?: string, depth?: number): Promise<SandboxFileTreeNode>;
|
|
7215
|
-
/**
|
|
7295
|
+
/**
|
|
7296
|
+
* Write a failure-atomic batch on a batch-capable guest.
|
|
7297
|
+
* The guest's guarantee is whatever the response advertises: rely on it only
|
|
7298
|
+
* after `atomicity === "failure_atomic"` and `read_isolation ===
|
|
7299
|
+
* "file_api_operations"` compare equal, because the fields are forwarded
|
|
7300
|
+
* verbatim and an older guest omits them. Never treat an unknown value or a
|
|
7301
|
+
* missing field as the guarantee, and never substitute sequential writes.
|
|
7302
|
+
* Shell/Docker readers may see intermediate publication; coordinate them
|
|
7303
|
+
* with the write if a consistent multi-file view is required.
|
|
7304
|
+
*/
|
|
7216
7305
|
writeMany(files: SandboxWriteManyEntry[]): Promise<SandboxWriteManyResult>;
|
|
7217
7306
|
/** GET /api/v1/sandboxes/{id}/files/watch (SSE) — live file change events. */
|
|
7218
7307
|
watch(): AsyncIterableIterator<SandboxFileChange>;
|
|
@@ -7242,11 +7331,25 @@ declare class SandboxSnapshots {
|
|
|
7242
7331
|
restore(snapshotId: string): Promise<Sandbox>;
|
|
7243
7332
|
delete(snapshotId: string): Promise<void>;
|
|
7244
7333
|
}
|
|
7245
|
-
/**
|
|
7334
|
+
/**
|
|
7335
|
+
* Options for a `miosa-terminal-v1` PTY session.
|
|
7336
|
+
*
|
|
7337
|
+
* The server validates every option and answers `400 INVALID_TERMINAL_OPTIONS`
|
|
7338
|
+
* before host dispatch; the client-side checks in `terminal.create()` only
|
|
7339
|
+
* fail the locally decidable cases earlier. Direct command launch requires a
|
|
7340
|
+
* compatible platform and guest. Older control planes may ignore these fields
|
|
7341
|
+
* and return a default-shell ticket; verify platform support and the actual
|
|
7342
|
+
* process or container context instead of treating a ticket as execution proof.
|
|
7343
|
+
*/
|
|
7246
7344
|
interface SandboxTerminalCreateParams {
|
|
7247
7345
|
cols?: number;
|
|
7248
7346
|
rows?: number;
|
|
7347
|
+
/** A single shell executable. Mutually exclusive with command. */
|
|
7249
7348
|
shell?: string;
|
|
7349
|
+
/** An executable to start directly, without an implicit outer shell. */
|
|
7350
|
+
command?: string;
|
|
7351
|
+
/** Literal executable arguments. Requires command; at most 256 entries. */
|
|
7352
|
+
args?: string[];
|
|
7250
7353
|
cwd?: string;
|
|
7251
7354
|
env?: Record<string, string>;
|
|
7252
7355
|
}
|
|
@@ -7254,8 +7357,14 @@ interface SandboxTerminalCreateParams {
|
|
|
7254
7357
|
* A short-lived ticket for a `miosa-terminal-v1` WebSocket session.
|
|
7255
7358
|
*
|
|
7256
7359
|
* Connect to `wsUrl` with the `miosa-terminal-v1` subprotocol and provide
|
|
7257
|
-
* `streamAuth` as the Bearer credential.
|
|
7258
|
-
*
|
|
7360
|
+
* `streamAuth` as the Bearer credential. The frame, exit, close-code and
|
|
7361
|
+
* reconnect contract is documented under "Interactive sandbox terminals" in
|
|
7362
|
+
* this package's README.
|
|
7363
|
+
*
|
|
7364
|
+
* `streamAuthExpiresAt` and `expiresAt` are Unix epoch seconds, one hour after
|
|
7365
|
+
* creation. `streamAuth` authorizes connections only until then; an account
|
|
7366
|
+
* API key is accepted as the same Bearer credential and does not expire with
|
|
7367
|
+
* the ticket.
|
|
7259
7368
|
*
|
|
7260
7369
|
* Every field is carried both as its wire (snake_case) key and its camelCase
|
|
7261
7370
|
* alias, so callers that consumed the raw record keep working.
|
|
@@ -7457,6 +7566,17 @@ declare class Sandbox {
|
|
|
7457
7566
|
[key: string]: unknown;
|
|
7458
7567
|
}>;
|
|
7459
7568
|
pause(): Promise<Sandbox>;
|
|
7569
|
+
/**
|
|
7570
|
+
* Resume a paused (or persistent-stopped) sandbox.
|
|
7571
|
+
*
|
|
7572
|
+
* Always sends an `Idempotency-Key`, generating a fresh one when the
|
|
7573
|
+
* caller doesn't supply one - same rationale as {@link generateIdempotencyKey}
|
|
7574
|
+
* for create(): the key is built once here and threaded through a single
|
|
7575
|
+
* `HttpClient.request` call, whose headers are fixed before its retry loop
|
|
7576
|
+
* runs, so every retry of *this* resume replays the same key. Without this,
|
|
7577
|
+
* a client-side retry of a slow resume could dispatch a second full resume
|
|
7578
|
+
* execution (re-running host reservation) instead of deduping server-side.
|
|
7579
|
+
*/
|
|
7460
7580
|
resume(idempotencyKey?: string): Promise<Sandbox>;
|
|
7461
7581
|
deploy(params?: SandboxDeployParams): Promise<Record<string, unknown>>;
|
|
7462
7582
|
deployDocker(params?: SandboxDeployParams): Promise<Record<string, unknown>>;
|
|
@@ -7575,9 +7695,14 @@ declare class Sandboxes {
|
|
|
7575
7695
|
/**
|
|
7576
7696
|
* Idempotently obtain a persistent sandbox by stable name.
|
|
7577
7697
|
*
|
|
7578
|
-
* If the sandbox exists, it is returned.
|
|
7579
|
-
*
|
|
7580
|
-
*
|
|
7698
|
+
* If the sandbox exists, it is returned. Unless `resume === false`: a
|
|
7699
|
+
* `paused` or persistent `stopped` sandbox is resumed; a `pausing`
|
|
7700
|
+
* sandbox is waited out (bounded by `pausingWaitTimeoutSec`) and then
|
|
7701
|
+
* resumed if it landed on `paused`/`stopped`; a resume answered with a
|
|
7702
|
+
* 409 the server marks `retryable: true` (e.g. a concurrent pause still
|
|
7703
|
+
* finishing) is retried using the server's `retry_after_ms` hint. If the
|
|
7704
|
+
* sandbox does not exist, it is created with the supplied params.
|
|
7705
|
+
* Destroyed sandboxes are permanent and are not resumed by this helper.
|
|
7581
7706
|
*/
|
|
7582
7707
|
getOrCreate(params: SandboxGetOrCreateParams): Promise<Sandbox>;
|
|
7583
7708
|
delete(id: SandboxId | string): Promise<void>;
|
|
@@ -8545,6 +8670,459 @@ declare class WorkspaceInvites {
|
|
|
8545
8670
|
accept(token: string): Promise<AcceptWorkspaceInviteResponse>;
|
|
8546
8671
|
}
|
|
8547
8672
|
|
|
8673
|
+
/**
|
|
8674
|
+
* Transport-level contract shared by the HTTP/2 and HTTP/3 runner
|
|
8675
|
+
* transports (RUNNER-CONTRACTS-2026-10-02.md, C1/C6).
|
|
8676
|
+
*
|
|
8677
|
+
* A transport owns ONE pinned session pool per *region* hostname
|
|
8678
|
+
* (`run-<region>.miosa.ai`): `sessionsPerAddress` sessions per resolved
|
|
8679
|
+
* address (session `i` of that address's group), opened as soon as
|
|
8680
|
+
* `prewarm` or `request` first names the region - never deferred further.
|
|
8681
|
+
* A request waits only for the one session it lands on, never for a
|
|
8682
|
+
* sibling's.
|
|
8683
|
+
*
|
|
8684
|
+
* That one pool serves both call shapes, varying only the HTTP/2
|
|
8685
|
+
* `:authority` per request (connection coalescing: the cert covers both
|
|
8686
|
+
* `run-<region>.miosa.ai` and `*.run-<region>.miosa.ai`, and a per-host
|
|
8687
|
+
* name's one A record is the same IP already in the region pool, so no
|
|
8688
|
+
* second TLS handshake is needed):
|
|
8689
|
+
*
|
|
8690
|
+
* - create: `:authority` is the region hostname itself; RunnerClient
|
|
8691
|
+
* tries address index 0..n-1 in turn on retry (503 / connect failure).
|
|
8692
|
+
* - exec/destroy/etc: `:authority` is `<tag>.run-<region>.miosa.ai`;
|
|
8693
|
+
* RunnerClient has learned which address index that tag lives at
|
|
8694
|
+
* (from each address's own `/healthz`), so index is whichever one.
|
|
8695
|
+
*/
|
|
8696
|
+
interface RunnerRequestInit {
|
|
8697
|
+
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
8698
|
+
headers?: Record<string, string>;
|
|
8699
|
+
body?: string;
|
|
8700
|
+
/** Hard per-request deadline. Does not retry - that is the caller's job. */
|
|
8701
|
+
timeoutMs?: number;
|
|
8702
|
+
signal?: AbortSignal;
|
|
8703
|
+
}
|
|
8704
|
+
interface RunnerResponse {
|
|
8705
|
+
status: number;
|
|
8706
|
+
headers: Record<string, string>;
|
|
8707
|
+
body: string;
|
|
8708
|
+
}
|
|
8709
|
+
interface RunnerStreamResponse {
|
|
8710
|
+
status: number;
|
|
8711
|
+
headers: Record<string, string>;
|
|
8712
|
+
/** Raw body text chunks as they arrive - SSE line/JSON parsing is the caller's job. */
|
|
8713
|
+
chunks: AsyncIterableIterator<string>;
|
|
8714
|
+
}
|
|
8715
|
+
type RunnerProtocol = "h2" | "h3";
|
|
8716
|
+
interface RunnerTransport {
|
|
8717
|
+
readonly protocol: RunnerProtocol;
|
|
8718
|
+
/**
|
|
8719
|
+
* Starts resolving `regionHostname` and connecting every address's
|
|
8720
|
+
* session group now, without waiting for a request to need one (C6:
|
|
8721
|
+
* "opened at client construction ... never lazily on first use").
|
|
8722
|
+
* Fire-and-forget: a hostname that fails to resolve or connect here
|
|
8723
|
+
* simply pays that cost again, synchronously, on its first real
|
|
8724
|
+
* `request`/`addressCount` call. Idempotent - prewarming an
|
|
8725
|
+
* already-warming-or-warm hostname is a no-op.
|
|
8726
|
+
*/
|
|
8727
|
+
prewarm(regionHostname: string, sessionsPerAddress?: number): void;
|
|
8728
|
+
/** The number of distinct runner hosts behind `regionHostname`. */
|
|
8729
|
+
addressCount(regionHostname: string): Promise<number>;
|
|
8730
|
+
/**
|
|
8731
|
+
* Resolves once the session serving `addressIndex` is connected (or
|
|
8732
|
+
* rejects if it fails to), without sending a request. Used by the
|
|
8733
|
+
* HTTP/3-vs-HTTP/2 race in transport-factory.ts to pick a winner
|
|
8734
|
+
* without firing the same request down both protocols.
|
|
8735
|
+
*/
|
|
8736
|
+
ready(regionHostname: string, addressIndex: number): Promise<void>;
|
|
8737
|
+
/**
|
|
8738
|
+
* Sends a request through the session pinned to
|
|
8739
|
+
* `regionHostname`'s address `addressIndex % n`, with the HTTP/2
|
|
8740
|
+
* `:authority` set to `authority` (which may be `regionHostname`
|
|
8741
|
+
* itself, for a create, or that address's own per-host name, for a
|
|
8742
|
+
* per-sandbox call - see the module doc comment on connection
|
|
8743
|
+
* coalescing). Waits only for that one session; never races or waits
|
|
8744
|
+
* on a sibling's.
|
|
8745
|
+
*/
|
|
8746
|
+
request(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerResponse>;
|
|
8747
|
+
/**
|
|
8748
|
+
* Same routing as `request`, but for a server-sent-events response
|
|
8749
|
+
* (exec/stream, C2): resolves once headers arrive, with `chunks` as the
|
|
8750
|
+
* body streams in. HTTP/3 (today, no native streaming support in the
|
|
8751
|
+
* addon) buffers the whole response first and yields it as one chunk -
|
|
8752
|
+
* correct, just not incrementally streamed; HTTP/2 streams for real.
|
|
8753
|
+
*/
|
|
8754
|
+
streamRequest(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerStreamResponse>;
|
|
8755
|
+
/** Releases every open session/connection. Safe to call more than once. */
|
|
8756
|
+
close(): Promise<void>;
|
|
8757
|
+
}
|
|
8758
|
+
declare class RunnerTimeoutError extends Error {
|
|
8759
|
+
constructor(hostname: string, path: string, timeoutMs: number);
|
|
8760
|
+
}
|
|
8761
|
+
declare class RunnerConnectError extends Error {
|
|
8762
|
+
constructor(hostname: string, address: string, cause: unknown);
|
|
8763
|
+
}
|
|
8764
|
+
/**
|
|
8765
|
+
* True for errors that mean "this address/session is unusable" rather than
|
|
8766
|
+
* "the request itself failed" - the signal RunnerClient uses to retry a
|
|
8767
|
+
* `create` on the next IP (C6).
|
|
8768
|
+
*/
|
|
8769
|
+
declare function isConnectFailure(error: unknown): boolean;
|
|
8770
|
+
|
|
8771
|
+
/**
|
|
8772
|
+
* soma.api.v1 envelope (RUNNER-CONTRACTS-2026-10-02.md, C2b).
|
|
8773
|
+
*
|
|
8774
|
+
* The per-sandbox routes (list, get, stop, filesystem, terminal) answer
|
|
8775
|
+
* in soma-api's own envelope - distinct from the flatter fast-lane shapes
|
|
8776
|
+
* C2 uses for create/exec/destroy/healthz. Every response, success or
|
|
8777
|
+
* failure, is this one shape; `unwrapSomaEnvelope` returns `result` on
|
|
8778
|
+
* success and throws a `RunnerError` (reusing its nested-error parsing,
|
|
8779
|
+
* since the envelope's `error` field is that same `{code,message,
|
|
8780
|
+
* retryable}` sub-shape) on failure.
|
|
8781
|
+
*/
|
|
8782
|
+
interface SomaEnvelope<T> {
|
|
8783
|
+
schema: string;
|
|
8784
|
+
operation: string;
|
|
8785
|
+
status: "ok" | "error";
|
|
8786
|
+
result: T | null;
|
|
8787
|
+
error: {
|
|
8788
|
+
code: string;
|
|
8789
|
+
message: string;
|
|
8790
|
+
retryable: boolean;
|
|
8791
|
+
} | null;
|
|
8792
|
+
receipt: Record<string, unknown> | null;
|
|
8793
|
+
}
|
|
8794
|
+
/** Bytes are never raw strings on these routes (C2b) - always this wrapper. */
|
|
8795
|
+
interface SomaBytes {
|
|
8796
|
+
encoding: "base64";
|
|
8797
|
+
byte_length: number;
|
|
8798
|
+
data: string;
|
|
8799
|
+
}
|
|
8800
|
+
declare function encodeSomaBytes(content: string | Uint8Array): string;
|
|
8801
|
+
declare function decodeSomaBytes(bytes: SomaBytes): Uint8Array;
|
|
8802
|
+
/**
|
|
8803
|
+
* `instance_id` inside the envelope is the sandbox's public id with every
|
|
8804
|
+
* hyphen stripped (C2b). Normalizes back to the hyphenated UUID form used
|
|
8805
|
+
* everywhere else in this SDK; passes through anything that isn't exactly
|
|
8806
|
+
* 32 bare hex digits unchanged (already hyphenated, or not a UUID at all).
|
|
8807
|
+
*/
|
|
8808
|
+
declare function hyphenateInstanceId(instanceId: string): string;
|
|
8809
|
+
/**
|
|
8810
|
+
* Parses the envelope and returns `result` on `status: "ok"`. Throws a
|
|
8811
|
+
* `RunnerError` on `status: "error"` - `status` here is the envelope's
|
|
8812
|
+
* own field, independent of the HTTP status (C2b: envelope failures ride
|
|
8813
|
+
* on whatever HTTP status matches the facade outcome, not always 200).
|
|
8814
|
+
*/
|
|
8815
|
+
declare function unwrapSomaEnvelope<T>(httpStatus: number, body: string): T;
|
|
8816
|
+
|
|
8817
|
+
/**
|
|
8818
|
+
* RunnerClient - the SOMA one-hop runner path (ONE-HOP-RUNNER-DESIGN-2026-10-02.md
|
|
8819
|
+
* section 6, RUNNER-CONTRACTS-2026-10-02.md C1/C2/C2b/C5/C6).
|
|
8820
|
+
*
|
|
8821
|
+
* Opt-in and additive: this talks directly to `run-<region>.miosa.ai` and
|
|
8822
|
+
* its per-host names instead of `api.miosa.ai`, bypassing the
|
|
8823
|
+
* control-plane hop entirely. It does not replace or alter
|
|
8824
|
+
* `Sandboxes`/`Sandbox` - those keep using the existing HttpClient path
|
|
8825
|
+
* unchanged. Construct a RunnerClient explicitly (or via `Miosa.runner`,
|
|
8826
|
+
* gated by config/env - see ../client.ts) to use it.
|
|
8827
|
+
*
|
|
8828
|
+
* One pool, two `:authority` values (C1/C6): the region hostname's one
|
|
8829
|
+
* session pool, resolved and opened at construction, serves both creates
|
|
8830
|
+
* (`:authority` = the region hostname) and every per-sandbox call
|
|
8831
|
+
* (`:authority` = that sandbox's `<tag>.run-<region>.miosa.ai`) via HTTP/2
|
|
8832
|
+
* connection coalescing - see transport.ts's doc comment for why that's
|
|
8833
|
+
* valid. `addressIndexByTag` is this client's only extra bookkeeping: which
|
|
8834
|
+
* of the region's resolved addresses answers for which tag, learned from
|
|
8835
|
+
* each address's own unauthenticated `/healthz` in the background.
|
|
8836
|
+
*
|
|
8837
|
+
* Two response shapes (C2 vs C2b): create/exec/destroy/healthz answer
|
|
8838
|
+
* flat; get/stop/list/filesystem/terminal answer wrapped in soma-api's
|
|
8839
|
+
* own envelope (envelope.ts). `sendToSandbox` is the one routing
|
|
8840
|
+
* primitive (tag resolution, 421-follow, auth) both response parsers sit
|
|
8841
|
+
* on top of.
|
|
8842
|
+
*/
|
|
8843
|
+
|
|
8844
|
+
interface RunnerClientOptions {
|
|
8845
|
+
apiKey: string;
|
|
8846
|
+
/** Defaults to `us` (C5: not carried in the key this release). */
|
|
8847
|
+
region?: string;
|
|
8848
|
+
/** Overrides `miosa.ai` - for self-hosted / test deployments. */
|
|
8849
|
+
baseDomain?: string;
|
|
8850
|
+
/**
|
|
8851
|
+
* Accepted for shape-parity with the rest of the SDK's resources. Not
|
|
8852
|
+
* sent as a request header: C2 says the tenant comes only from the key
|
|
8853
|
+
* record, and the runner strips any client-supplied tenant header.
|
|
8854
|
+
*/
|
|
8855
|
+
tenant?: string;
|
|
8856
|
+
/** Sessions opened per resolved region address. C6 default: 8. */
|
|
8857
|
+
sessionsPerAddress?: number;
|
|
8858
|
+
/** Injectable for tests; defaults to the best available transport. */
|
|
8859
|
+
transport?: RunnerTransport;
|
|
8860
|
+
/**
|
|
8861
|
+
* Called for a create the runner doesn't serve (C2: template, image,
|
|
8862
|
+
* snapshot, cwd, persistent, non-xs shapes) - wired by `Miosa` to
|
|
8863
|
+
* `sandboxes.create()`. Without it, `createSandbox` throws rather than
|
|
8864
|
+
* silently going nowhere for those shapes.
|
|
8865
|
+
*/
|
|
8866
|
+
fallbackCreate?: (params: Record<string, unknown>, opts: {
|
|
8867
|
+
idempotencyKey?: string;
|
|
8868
|
+
}) => Promise<RunnerSandboxCreateResult>;
|
|
8869
|
+
}
|
|
8870
|
+
interface RunnerExecOptions {
|
|
8871
|
+
cwd?: string;
|
|
8872
|
+
env?: Record<string, string>;
|
|
8873
|
+
/** Seconds. Defaults to 30 on the runner if omitted (C2). */
|
|
8874
|
+
timeout?: number;
|
|
8875
|
+
}
|
|
8876
|
+
/** DELETE /api/v1/sandboxes/{id} - the sandbox's final usage (C2). */
|
|
8877
|
+
interface RunnerDestroyResult {
|
|
8878
|
+
cpu_ms?: number;
|
|
8879
|
+
lifetime_ms?: number;
|
|
8880
|
+
[key: string]: unknown;
|
|
8881
|
+
}
|
|
8882
|
+
/** POST /api/v1/sandboxes/{id}/exec/stream events (C2) - same shape as the control plane's existing exec stream. */
|
|
8883
|
+
type RunnerExecStreamEvent = {
|
|
8884
|
+
type: "stdout";
|
|
8885
|
+
line: string;
|
|
8886
|
+
} | {
|
|
8887
|
+
type: "stderr";
|
|
8888
|
+
line: string;
|
|
8889
|
+
} | {
|
|
8890
|
+
type: "exit";
|
|
8891
|
+
exit_code: number;
|
|
8892
|
+
};
|
|
8893
|
+
interface RunnerSandboxCreateResult {
|
|
8894
|
+
/** Empty string if the response body carried no `id` field. */
|
|
8895
|
+
id: string;
|
|
8896
|
+
/** The per-host URL this sandbox lives on. Empty when created via fallbackCreate (not runner-managed). */
|
|
8897
|
+
runnerUrl: string;
|
|
8898
|
+
data: Record<string, unknown>;
|
|
8899
|
+
}
|
|
8900
|
+
interface RunnerHealth {
|
|
8901
|
+
ok: boolean;
|
|
8902
|
+
/** The host tag this runner answers for, e.g. `"3"` (C2). */
|
|
8903
|
+
tag?: string;
|
|
8904
|
+
feed_age_ms?: number;
|
|
8905
|
+
pool_ready?: number;
|
|
8906
|
+
}
|
|
8907
|
+
interface SomaSandboxGetResult {
|
|
8908
|
+
instance_id: string;
|
|
8909
|
+
state: "ready" | "stopping";
|
|
8910
|
+
backend: "linux_kvm" | "macos_virtualization" | "docker_container" | "remote" | (string & {});
|
|
8911
|
+
}
|
|
8912
|
+
interface SomaSandboxStopResult {
|
|
8913
|
+
instance_id: string;
|
|
8914
|
+
state: "stopped";
|
|
8915
|
+
}
|
|
8916
|
+
/**
|
|
8917
|
+
* PATCH /api/v1/sandboxes/{id} {"timeout":N} - C2's flat shape (C2b line
|
|
8918
|
+
* 84), not the soma.api.v1 envelope every other per-sandbox route here
|
|
8919
|
+
* uses. `id` is the normal hyphenated sandbox id, same as create's.
|
|
8920
|
+
*/
|
|
8921
|
+
interface RunnerSetTimeoutResult {
|
|
8922
|
+
id: string;
|
|
8923
|
+
timeout_sec: number;
|
|
8924
|
+
expires_at: string | null;
|
|
8925
|
+
}
|
|
8926
|
+
interface SomaSandboxListEntry {
|
|
8927
|
+
instance_id: string;
|
|
8928
|
+
state: "launching" | "active" | "executing" | "terminating" | (string & {});
|
|
8929
|
+
host: "live" | "absent" | "unknown";
|
|
8930
|
+
backend: string;
|
|
8931
|
+
name?: string;
|
|
8932
|
+
}
|
|
8933
|
+
interface SomaSandboxListResult {
|
|
8934
|
+
sandboxes: SomaSandboxListEntry[];
|
|
8935
|
+
count: number;
|
|
8936
|
+
}
|
|
8937
|
+
type SomaFilesystemRefusal = "not_found" | "denied" | "wrong_kind" | "already_exists" | "not_empty" | "too_large" | "failed";
|
|
8938
|
+
type SomaTerminalRefusal = "no_session" | "already_open" | "denied" | "failed";
|
|
8939
|
+
interface SomaOperationResult {
|
|
8940
|
+
instance_id: string;
|
|
8941
|
+
operation: string;
|
|
8942
|
+
}
|
|
8943
|
+
interface SomaFilesystemReadResult extends SomaOperationResult {
|
|
8944
|
+
content?: SomaBytes;
|
|
8945
|
+
refusal?: SomaFilesystemRefusal;
|
|
8946
|
+
}
|
|
8947
|
+
interface SomaFilesystemWriteResult extends SomaOperationResult {
|
|
8948
|
+
byte_length?: number;
|
|
8949
|
+
refusal?: SomaFilesystemRefusal;
|
|
8950
|
+
}
|
|
8951
|
+
interface SomaFilesystemListEntry {
|
|
8952
|
+
name: SomaBytes;
|
|
8953
|
+
kind: "file" | "directory" | "other";
|
|
8954
|
+
}
|
|
8955
|
+
interface SomaFilesystemListResult extends SomaOperationResult {
|
|
8956
|
+
entries?: SomaFilesystemListEntry[];
|
|
8957
|
+
more_entries?: boolean;
|
|
8958
|
+
refusal?: SomaFilesystemRefusal;
|
|
8959
|
+
}
|
|
8960
|
+
interface SomaFilesystemExistsResult extends SomaOperationResult {
|
|
8961
|
+
exists?: boolean;
|
|
8962
|
+
kind?: "file" | "directory" | "other";
|
|
8963
|
+
refusal?: SomaFilesystemRefusal;
|
|
8964
|
+
}
|
|
8965
|
+
interface SomaFilesystemRemoveResult extends SomaOperationResult {
|
|
8966
|
+
refusal?: SomaFilesystemRefusal;
|
|
8967
|
+
}
|
|
8968
|
+
interface SomaFilesystemMkdirResult extends SomaOperationResult {
|
|
8969
|
+
refusal?: SomaFilesystemRefusal;
|
|
8970
|
+
}
|
|
8971
|
+
interface SomaTerminalOpenResult extends SomaOperationResult {
|
|
8972
|
+
columns?: number;
|
|
8973
|
+
rows?: number;
|
|
8974
|
+
refusal?: SomaTerminalRefusal;
|
|
8975
|
+
}
|
|
8976
|
+
interface SomaTerminalResizeResult extends SomaOperationResult {
|
|
8977
|
+
columns?: number;
|
|
8978
|
+
rows?: number;
|
|
8979
|
+
refusal?: SomaTerminalRefusal;
|
|
8980
|
+
}
|
|
8981
|
+
interface SomaTerminalWriteResult extends SomaOperationResult {
|
|
8982
|
+
written?: number;
|
|
8983
|
+
refusal?: SomaTerminalRefusal;
|
|
8984
|
+
}
|
|
8985
|
+
interface SomaTerminalReadResult extends SomaOperationResult {
|
|
8986
|
+
output?: SomaBytes;
|
|
8987
|
+
ended?: boolean;
|
|
8988
|
+
refusal?: SomaTerminalRefusal;
|
|
8989
|
+
}
|
|
8990
|
+
interface SomaTerminalCloseResult extends SomaOperationResult {
|
|
8991
|
+
refusal?: SomaTerminalRefusal;
|
|
8992
|
+
}
|
|
8993
|
+
type SandboxMethod = "GET" | "POST" | "PATCH" | "DELETE";
|
|
8994
|
+
declare class RunnerClient {
|
|
8995
|
+
readonly region: string;
|
|
8996
|
+
readonly hostname: string;
|
|
8997
|
+
private readonly baseDomain;
|
|
8998
|
+
private readonly apiKey;
|
|
8999
|
+
private readonly sessionsPerAddress;
|
|
9000
|
+
private readonly transport;
|
|
9001
|
+
private readonly fallbackCreate;
|
|
9002
|
+
/** tag -> which of the region's resolved addresses answers for it, learned from /healthz. */
|
|
9003
|
+
private readonly addressIndexByTag;
|
|
9004
|
+
/** sandbox id -> tag, set only once a 421 corrects the id-derived guess. */
|
|
9005
|
+
private readonly correctedTag;
|
|
9006
|
+
constructor(options: RunnerClientOptions);
|
|
9007
|
+
get protocol(): RunnerProtocol;
|
|
9008
|
+
/** The tag a 421 has corrected sandboxId to, if any. */
|
|
9009
|
+
correctedTagFor(sandboxId: string): string | undefined;
|
|
9010
|
+
healthzByIndex(addressIndex: number): Promise<RunnerHealth>;
|
|
9011
|
+
/**
|
|
9012
|
+
* POST /api/v1/sandboxes against the region hostname. Create shapes the
|
|
9013
|
+
* runner doesn't serve (C2) go straight to `fallbackCreate` without
|
|
9014
|
+
* ever reaching the runner; a `400 RUNNER_UNSUPPORTED_REQUEST` the
|
|
9015
|
+
* runner returns anyway falls back the same way, once. On `503
|
|
9016
|
+
* runtime_busy`/`feed_stale` or a connect failure, retries on the next
|
|
9017
|
+
* resolved IP, at most n-1 times (C6).
|
|
9018
|
+
*/
|
|
9019
|
+
createSandbox(params?: Record<string, unknown>, opts?: {
|
|
9020
|
+
idempotencyKey?: string;
|
|
9021
|
+
}): Promise<RunnerSandboxCreateResult>;
|
|
9022
|
+
exec(sandboxId: string, command: string, opts?: RunnerExecOptions): Promise<Record<string, unknown>>;
|
|
9023
|
+
/** POST /api/v1/sandboxes/{id}/exec/stream - server-sent events (C2). */
|
|
9024
|
+
execStream(sandboxId: string, command: string, opts?: RunnerExecOptions): AsyncIterableIterator<RunnerExecStreamEvent>;
|
|
9025
|
+
/** Returns the sandbox's final usage: cpu_ms, lifetime_ms (C2). */
|
|
9026
|
+
destroySandbox(sandboxId: string): Promise<RunnerDestroyResult>;
|
|
9027
|
+
get(sandboxId: string, opts?: {
|
|
9028
|
+
operationId?: string;
|
|
9029
|
+
}): Promise<SomaSandboxGetResult>;
|
|
9030
|
+
stop(sandboxId: string, opts?: {
|
|
9031
|
+
operationId?: string;
|
|
9032
|
+
}): Promise<SomaSandboxStopResult>;
|
|
9033
|
+
/**
|
|
9034
|
+
* PATCH /api/v1/sandboxes/{id} {"timeout":seconds} - resets the idle
|
|
9035
|
+
* timeout (default 300s; every call to the sandbox already resets it).
|
|
9036
|
+
* Flat C2 response shape (C2b line 84), not the envelope - errors still
|
|
9037
|
+
* use the platform shape (400 INVALID_PARAM, 404 NOT_FOUND), which
|
|
9038
|
+
* RunnerError.fromResponse already parses either way.
|
|
9039
|
+
*/
|
|
9040
|
+
setTimeout(sandboxId: string, seconds: number): Promise<RunnerSetTimeoutResult>;
|
|
9041
|
+
/**
|
|
9042
|
+
* GET /api/v1/sandboxes - scoped to ONE runner host (C2b: "the calling
|
|
9043
|
+
* tenant's sandboxes on this runner"), not the whole region. Defaults
|
|
9044
|
+
* to address 0; pass `tag` to target the host currently known for that
|
|
9045
|
+
* tag, or `addressIndex` directly.
|
|
9046
|
+
*/
|
|
9047
|
+
list(opts?: {
|
|
9048
|
+
addressIndex?: number;
|
|
9049
|
+
tag?: string;
|
|
9050
|
+
}): Promise<SomaSandboxListResult>;
|
|
9051
|
+
readonly filesystem: {
|
|
9052
|
+
read: (sandboxId: string, path: string) => Promise<SomaFilesystemReadResult>;
|
|
9053
|
+
write: (sandboxId: string, path: string, content: string | Uint8Array) => Promise<SomaFilesystemWriteResult>;
|
|
9054
|
+
list: (sandboxId: string, path: string) => Promise<SomaFilesystemListResult>;
|
|
9055
|
+
exists: (sandboxId: string, path: string) => Promise<SomaFilesystemExistsResult>;
|
|
9056
|
+
remove: (sandboxId: string, path: string, recursive?: boolean) => Promise<SomaFilesystemRemoveResult>;
|
|
9057
|
+
mkdir: (sandboxId: string, path: string) => Promise<SomaFilesystemMkdirResult>;
|
|
9058
|
+
/** Decodes a read() result's base64 `content` into bytes. */
|
|
9059
|
+
decode: typeof decodeSomaBytes;
|
|
9060
|
+
};
|
|
9061
|
+
readonly terminal: {
|
|
9062
|
+
open: (sandboxId: string, columns: number, rows: number) => Promise<SomaTerminalOpenResult>;
|
|
9063
|
+
resize: (sandboxId: string, columns: number, rows: number) => Promise<SomaTerminalResizeResult>;
|
|
9064
|
+
write: (sandboxId: string, input: string | Uint8Array) => Promise<SomaTerminalWriteResult>;
|
|
9065
|
+
read: (sandboxId: string, waitMs?: number) => Promise<SomaTerminalReadResult>;
|
|
9066
|
+
close: (sandboxId: string) => Promise<SomaTerminalCloseResult>;
|
|
9067
|
+
/** Decodes a read() result's base64 `output` into bytes. */
|
|
9068
|
+
decode: typeof decodeSomaBytes;
|
|
9069
|
+
};
|
|
9070
|
+
/**
|
|
9071
|
+
* Low-level escape hatch: sends method/path straight to sandboxId's
|
|
9072
|
+
* runner host, with the same tag-routing, 421-follow and auth every
|
|
9073
|
+
* named method above uses, parsing the response as the flat C2 shape
|
|
9074
|
+
* (not the C2b envelope - use filesystem/terminal/get/stop/list, or
|
|
9075
|
+
* requestEnvelope() for an un-wrapped route not named here yet).
|
|
9076
|
+
*/
|
|
9077
|
+
request(sandboxId: string, method: SandboxMethod, path: string, body?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
9078
|
+
/** Same as request(), but unwraps the response as a C2b soma.api.v1 envelope. */
|
|
9079
|
+
requestEnvelope<T>(sandboxId: string, method: SandboxMethod, path: string, body?: Record<string, unknown>): Promise<T>;
|
|
9080
|
+
close(): Promise<void>;
|
|
9081
|
+
private filesystemOp;
|
|
9082
|
+
private terminalOp;
|
|
9083
|
+
private createViaFallback;
|
|
9084
|
+
/**
|
|
9085
|
+
* Learns which resolved region address answers for which tag, via each
|
|
9086
|
+
* one's own unauthenticated `/healthz` (C2) - best effort, never awaited
|
|
9087
|
+
* by the constructor. A tag missed here (a host that joined after this
|
|
9088
|
+
* client started, or a transient `/healthz` failure) just costs a
|
|
9089
|
+
* repeat of this same probe on that sandbox's first real request,
|
|
9090
|
+
* instead of none at all.
|
|
9091
|
+
*/
|
|
9092
|
+
private discoverTags;
|
|
9093
|
+
/**
|
|
9094
|
+
* Sends method/path to sandboxId's runner host - the id-derived tag, or
|
|
9095
|
+
* a previously 421-corrected one - following a single `421 misdirected`
|
|
9096
|
+
* to the `runner_url` it names (C6). A connect failure here is not
|
|
9097
|
+
* retried across other hosts: a sandbox has exactly one owner. Returns
|
|
9098
|
+
* the raw response; requestToSandbox/requestEnvelopeToSandbox each
|
|
9099
|
+
* parse it according to their route's response shape (C2 vs C2b).
|
|
9100
|
+
*/
|
|
9101
|
+
private sendToSandbox;
|
|
9102
|
+
/** Same routing as sendToSandbox, for a streaming (SSE) response. */
|
|
9103
|
+
private sendToSandboxStream;
|
|
9104
|
+
/** C2's flat shape: parses >=400 with RunnerError, else JSON.parses the raw body. */
|
|
9105
|
+
private requestToSandbox;
|
|
9106
|
+
/**
|
|
9107
|
+
* C2b's envelope shape: a >=400 response may still be the flat C2 shape
|
|
9108
|
+
* (401/403/429/503/421 happen before the envelope layer) - RunnerError
|
|
9109
|
+
* .fromResponse parses either, so it's used directly rather than
|
|
9110
|
+
* routing through the envelope parser. Only a <400 response is
|
|
9111
|
+
* unwrapped as a genuine soma.api.v1 envelope.
|
|
9112
|
+
*/
|
|
9113
|
+
private requestEnvelopeToSandbox;
|
|
9114
|
+
/**
|
|
9115
|
+
* `addressIndexByTag` first; if that tag hasn't been seen yet (a host
|
|
9116
|
+
* that joined after construction, or this is the very first request
|
|
9117
|
+
* racing the background discovery), refreshes discovery once and falls
|
|
9118
|
+
* back to address 0 as a last resort - the request itself still ends up
|
|
9119
|
+
* correct either way, via a 421 follow, just one round trip slower.
|
|
9120
|
+
*/
|
|
9121
|
+
private resolveAddressIndexForTag;
|
|
9122
|
+
private runnerUrlFrom;
|
|
9123
|
+
private authHeaders;
|
|
9124
|
+
}
|
|
9125
|
+
|
|
8548
9126
|
/**
|
|
8549
9127
|
* The top-level MIOSA client.
|
|
8550
9128
|
*
|
|
@@ -8692,6 +9270,14 @@ declare class Miosa {
|
|
|
8692
9270
|
readonly network: EgressNetwork;
|
|
8693
9271
|
/** Egress audit log — every outbound request, paginated query + tail. */
|
|
8694
9272
|
readonly audit: EgressAudit;
|
|
9273
|
+
/**
|
|
9274
|
+
* SOMA one-hop runner path (opt-in via `config.runner.enabled` or
|
|
9275
|
+
* `MIOSA_RUNNER_MODE=1`) - talks straight to `run-<region>.miosa.ai` for
|
|
9276
|
+
* sandbox create/exec/destroy, bypassing the control-plane hop. `undefined`
|
|
9277
|
+
* unless enabled; every other resource above is unaffected either way.
|
|
9278
|
+
* See ONE-HOP-RUNNER-DESIGN-2026-10-02.md and RUNNER-CONTRACTS-2026-10-02.md.
|
|
9279
|
+
*/
|
|
9280
|
+
readonly runner: RunnerClient | undefined;
|
|
8695
9281
|
private readonly http;
|
|
8696
9282
|
constructor(config: MiosaClientConfig);
|
|
8697
9283
|
}
|
|
@@ -8911,4 +9497,277 @@ declare class AppAuth {
|
|
|
8911
9497
|
private _post;
|
|
8912
9498
|
}
|
|
8913
9499
|
|
|
8914
|
-
export { AGENT_BUILD_KIND_SPECS, type AcceptOrgInviteResponse, type AcceptWorkspaceInviteResponse, type AddDomainParams, type AddWorkspaceMemberParams, Admin, type AgentBuildExecutionPacket, type AgentBuildFileSpec, type AgentBuildKind, type AgentBuildKindSpec, type AgentBuildPlannerDocument, type AgentDefinitionCreateParams, type AgentDefinitionData, type AgentDefinitionListParams, type AgentDefinitionUpdateParams, AgentDefinitions, type AgentDispatchParams, type AgentEvent$1 as AgentEvent, type AgentEventType, AgentRuntimeProfiles, type AgentSessionCreateParams, type AgentSessionData, type AgentSessionListResponse$1 as AgentSessionListResponse, type AgentSessionStatus$1 as AgentSessionStatus, type AgentVersionData, type AllowParams, Analytics, type AnalyticsFilters, type ApiKeyCreateParams, type ApiKeyCreateResult, type ApiKeyData, type ApiKeyId, type ApiKeyListParams, ApiKeys, type AppActionDecision, AppAuth, type AppAuthConfig, type AppAuthResourceType, type AppAuthSession, type AppAuthTokenPayload, type AppAutomationRun, type AppCatalogEntry, type AppCollectionRecord, type AppDocument, type AppDocumentCreateParams, type AppDocumentDiagnostics, type AppDocumentRecord, type AppDocumentUpdateParams, AppDocuments, type AppInstallData, type AppInstallEvent, type AppJson, type AppReleaseApproval, type AppReleaseCandidate, type AttachAwsRoleParams, type AuditListParams, AuditLog, type AuditLogEvent, type AuditLogListParams, type AuditTailParams, AuthError, type AuthToken, type BenchmarkCompareParams, type BenchmarkCreateParams, Benchmarks, type BindingCreateParams, type BindingListParams, type BrandingData, type BrandingUpdateParams, type BucketCreateParams, type BucketData, type BucketId, type BuilderSessionListParams, BuilderSessions, type BulkUserActionParams, type ChannelCreateParams, type ChannelData, type ChannelListParams, type ChannelUpdateParams, Channels, type ChatCompletionCreateParams, type ChatCompletionCreateStreamParams, Checkpoints, type ClickParams, Cloud, type CloudAccount, type CloudAccountCreateParams, type CloudAccountMode, type CloudAccountStatus, type CloudCredentialType, type CloudListParams, type CloudPlacementScope, type CloudPool, type CloudPoolCreateParams, type CloudPoolKind, type CloudPreflightRecordParams, type CloudPreflightRun, type CloudPreflightStatus, type CloudProvider, type CloudRegion, type CloudRegionCreateParams, type ClusterCreateParams, type ClusterData, type ClusterEvent, type ClusterId, type ClusterListResponse, type ClusterStatus, CommandCenter, Community, type CompletionCreateParams, type CompletionCreateStreamParams, Completions, type ComputeProduct, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, type ComputerCreateParams, type ComputerData, ComputerEnv, type ComputerId, ComputerInbox, type ComputerListParams, type ComputerListResponse, ComputerLogs, type ComputerLogsGetParams, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, type ComputerSize, type ComputerStatus, type ComputerTemplateType, ComputerTerminal, type ComputerUpdateParams, type ComputerVisibility, ComputerVolumes, Computers, type ConnectorApplicableDefaultParams, type ConnectorCreateParams, type ConnectorData, type ConnectorDefault, type ConnectorDefaultListParams, type ConnectorDefaultParams, type ConnectorListParams, type ConnectorSubject, type ConnectorTokenParams, type ConnectorTokenResponse, Connectors, type CopyParams, type CreateAdminApiKeyParams, type CreateAgentBuildPacketParams, type CreateBuildRunParams, type CreateOrgInviteParams, type CreateWorkspaceInviteParams, type CreateWorkspaceInviteResponse, type CreditBalance, type CreditTransaction, type CreditTransactionListResponse, type CreditUsage, Credits, type CronJobCreateParams, type CronJobData, type CronJobExecutionData, type CronJobExecutionId, type CronJobId, type CronJobListParams, type CronJobUpdateParams, CronJobs, type CursorInfo, type CustomDomainCreateParams, type CustomDomainData, type CustomDomainId, type CustomDomainListParams, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, type DashboardSummary, type DatabaseCreateParams, type DatabaseCredentials, type DatabaseData, type DatabaseId, type DatabaseListParams, type DatabaseLogsParams, type DatabaseLogsResult, Databases, type DeploymentBuildData, DeploymentConnectors, type DeploymentCreateParams, type DeploymentData, DeploymentDomains, type DeploymentId, type DeploymentListParams, type DeploymentProduct, type DeploymentProofCheck, type DeploymentProofParams, type DeploymentProofProbe, type DeploymentProofResult, type DeploymentReleaseData, type DeploymentReleaseId, DeploymentReleases, DeploymentRuntimeInstances, type DeploymentServiceData, type DeploymentServiceId, type DeploymentServiceType, type DeploymentSourceType, type DeploymentState, type DeploymentUpdateParams, type DeploymentVersionData, type DeploymentVersionId, type DeploymentVersionKind, type DeploymentVersionState, DeploymentVersions, Deployments, Desktop$1 as Desktop, type DesktopActionResult, type DeviceBootstrapParams, type DeviceBootstrapResult, type DeviceBrowserResult, type DeviceCapabilities, type DeviceData, type DeviceExecParams, type DeviceExecResult, type DeviceExposeParams, type DeviceExposeResult, type DeviceExtendParams, type DeviceFileEntry, type DeviceFileListParams, type DeviceKind, type DeviceLifecycleResult, type DeviceListParams, type DeviceReadFileParams, type DeviceReadFileResult, type DeviceWriteFileParams, type DeviceWriteFileResult, Devices, type DirEntry, type DirListResult, type DiscordSendTestParams, DockerDeploy, type DockerDeployApplianceStatus, type DockerDeployCreateParams, type DockerDeployDoctorCheck, type DockerDeployDoctorParams, type DockerDeployDoctorProbe, type DockerDeployDoctorResult, type DockerDeployHostData, type DockerDeployHostEnsureParams, type DockerDeployHostId, type DockerDeployHostListParams, type DockerDeployHostListResponse, type DockerDeployHostResponse, type DockerDeployHostStatus, type DoubleClickParams, type DragParams, type EgressAllowlistRule, EgressAudit, type EgressAuditEvent, type EgressBindingData, EgressHostNotAllowedError, EgressNetwork, type EgressPolicyData, type EgressPolicyMode, type EgressRuleEffect, type EgressSecretData, type EgressSecretScope, type EgressSecretType, EgressSecrets, type EgressSuggestion, Email, EmailCampaigns, EmailInbox, EmailTemplates, type EmbeddingCreateParams, Embeddings, Exec, type ExecParams, type ExecPythonParams, type ExecResult, type ExternalAttribution, type ExternalKeyCreateParams, type ExternalKeyData, ExternalKeys, type FileDeleteParams, type FileDownloadParams, type FileEntry, type FileExportParams, type FileExportResult, type FileListParams, type FileListResult, type FileStat, Files, FlatCustomDomains, Forge, ForgeContractError, type ForgeDeleteReceipt, type ForgeOrganizationId, ForgePolicyViolationError, ForgeRepositories, type ForgeRepository, type ForgeRepositoryCreateParams, type ForgeRepositoryDeleteOptions, type ForgeRepositoryId, type ForgeRepositoryState, type ForgeRepositoryUpdateParams, type ForgeRepositoryVisibility, ForgeStorageError, ForgeUnavailableError, type FsEntry, type FsListResponse, type FsStat, type FunctionCreateParams, type FunctionData, type FunctionId, type FunctionInvokeParams, type FunctionListParams, type FunctionUpdateParams, Functions, type GithubRepo, type GithubSshKey, type HealthCheckCreateParams, type HealthCheckData, type HealthCheckId, type HealthCheckListParams, type HealthCheckUpdateParams, HealthChecks, type HostCreateParams, type HostData, type HostEvent, type HostId, type HostListResponse, type HostStatus, type HostUpdateParams, InstallationRequiredError, InsufficientCreditsError, type IntegrationCatalogEntry, type IntegrationData, Integrations, type JobData, type JobEvent, type JobEventType, type JobId, type JobListResponse, type JobRunParams, type JobStatus, type KeyParams, type LaunchParams, type LinearCreateIssueParams, type ListAdminApiKeysParams, type ListAdminComputersParams, type ListAdminTenantsParams, type ListAdminUsersParams, ManagedProviderBindingOnlyError, Mcp, type McpDispatchParams, Miosa, type MiosaClientConfig, MiosaError, type MiosaErrorBody, type MkdirParams, type ModeParams, Models, type MouseButton, NetworkError, NetworkPolicy, type NetworkPolicyData, type NetworkPolicyEffect, type NetworkPolicyProtocol, type NetworkPolicyRule, type NetworkPolicySetParams, NotFoundError, type NotificationPrefsUpdateParams, OAuthFlow, type OauthConnectParams, type OauthProvider, type OauthStartResult, type OauthStatusResult, type ObjectListParams, type AgentEvent as OcAgentEvent, type OcAgentSessionData, type AgentSessionListResponse as OcAgentSessionListResponse, type OcWorkspaceCreateParams, type OcWorkspaceData, type OcWorkspaceEvent, type OcWorkspaceListResponse, type OcWorkspaceStatus, type OcWorkspaceUpdateParams, OpenComputers, type OrgInvite, type OrgInviteCreated, type OrgInviteCreatedResponse, type OrgInviteListResponse, type OrgInvitePreview, type OrgInviteRevokeResponse, OrgInvites, type OrgRole, type OrganizationMember, type OrganizationMemberList, type OrganizationMemberRemoved, OrganizationMembers, type OrganizationRole, type OrganizationSummary, type OrganizationSwitchResult, Organizations, type OverviewData, type PolicyCreateParams, type PolicyListParams, type PolicyUpdateParams, type PresignParams, type PresignResult, type PreviewDomainData, type ProductCatalogEntry, type ProductTemplate, type ProductTemplateCatalog, ProjectAuth, type ProjectAuthEnableParams, type ProjectAuthStatus, type ProjectAuthUpdateParams, type ProjectIntegrationCatalogEntry, type ProjectIntegrationCreateParams, type ProjectIntegrationData, type ProjectIntegrationListParams, type ProjectIntegrationUpdateParams, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, type ProviderKeyUpsertParams, type PublishFromSandboxParams, type PublishParams, type PublishResult, RateLimitError, type RegionData, Regions, type RollbackParams, type RulesListParams, type Run, type RunActivity, type RunCommandOutput, type RunCreateParams, type RunDiagnostic, type RunDownload, type RunFile, type RunGroup, type RunGroupActivity, type RunGroupCounts, type RunGroupCreateParams, type RunGroupDispatchEntry, type RunGroupDispatchResult, type RunGroupFile, type RunGroupListParams, type RunGroupStatus, type RunGroupWaitOptions, RunGroups, type RunListParams, type RunMessage, type RunOutputs, type RunPreview, type RunStatus, type RunTargetKind, type RunWaitOptions, Runs, type RuntimeCapabilities, RuntimeCapabilitiesResource, RuntimeEnv, type RuntimeEnvListParams, type RuntimeEnvScope, type RuntimeEnvSetParams, type RuntimeEnvTarget, type RuntimeEnvVar, type RuntimeInstanceData, type RuntimeInstanceId, type RuntimeInstanceState, type RuntimeLogsResult, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, type SandboxBuildSpec, type SandboxBuildSpecError, type SandboxBuildSpecValidation, SandboxCommands, type SandboxConnectorAttachParams, type SandboxConnectorBinding, type SandboxConnectorPreflightParams, type SandboxConnectorPreflightResult, SandboxConnectors, type SandboxCreateParams, type SandboxData, SandboxEnv, SandboxEvents, type SandboxExecEvent, type SandboxExecOptions, type SandboxExecResult, type SandboxExecRunner, SandboxFiles, type SandboxGetOrCreateParams, type SandboxId, type SandboxListParams, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, type SandboxState, SandboxTags, type SandboxTemplate, type SandboxTemplateBuild, type SandboxTemplateBuildCreateParams, type SandboxTemplateBuildResourceData, type SandboxTemplateBuildResourceId, type SandboxTemplateCreateParams, type SandboxTemplateList, type SandboxTemplateListParams, type SandboxTemplateResourceData, type SandboxTemplateResourceId, SandboxTemplates, SandboxTerminal, type SandboxTerminalCreateParams, type SandboxTerminalSession, Sandboxes, ScopeNotAllowedError, ScopedFs, type ScrollDirection, type ScrollParams, type SecretCreateParams, type SecretData, type SecretId, type SecretListParams, type SecretRotateParams, type SecretSetParams, type SecretUpdateParams, type SessionId, Settings, type SettingsUpdateParams, type SizeData, type SlackSendTestParams, type SnapshotCreateParams, type SnapshotData, type SnapshotListResponse, type SnapshotProgressEvent, type SnapshotRestoreResult, type SnapshotStatus, SnapshotsStandalone, Storage, type StorageObjectData, SubjectNotAllowedError, type SuggestionsParams, type TemplateBenchmarkLane, type TemplateBuildCreateParams, type TemplateCreateParams, type TemplateData, type TemplateReadinessContract, type TemplateReadinessState, type TemplateSizeReadiness, Templates, type TemplatesListParams, Tenant, type TenantBrandingUpdateParams, type TenantId, type TenantPlan, type TenantSummary, type TerminalCreateParams, TimeoutError, type TimeseriesParams, TokenRefreshFailedError, type TunnelAuthMode, type TunnelCreateParams, type TunnelData, type TunnelId, type TunnelListResponse, type TunnelUpdateParams, type TypeParams, type UpdateWorkspaceMemberRoleParams, Usage, type UsageReportParams, type UsageSession, type UsageSessionsParams, type UsageSummary, UserAuthorizationRequiredError, type UserId, ValidationError, type VersionListParams, type VolumeAttachParams, type VolumeAttachmentData, type VolumeCreateParams, type VolumeData, type VolumeId, type VolumeListParams, Volumes, type WaitParams, type WebhookCreateParams, type WebhookData, type WebhookDeliveryData, type WebhookDeliveryId, type WebhookId, type WebhookListParams, type WebhookUpdateParams, Webhooks, type WindowFocusParams, type WindowInfo, type WorkspaceId, type WorkspaceInvite, type WorkspaceInviteCreatedResponse, type WorkspaceInviteListResponse, type WorkspaceInvitePreview, type WorkspaceInviteRevokeResponse, WorkspaceInvites, type WorkspaceMember, type WorkspaceMemberAddedResponse, type WorkspaceMemberDeleteResponse, type WorkspaceMemberListResponse, type WorkspaceMemberRecord, type WorkspaceMemberRecordResponse, WorkspaceMembers, type WorkspaceRole, type WsTicket, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBuildRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
|
|
9500
|
+
declare function regionFromApiKey(apiKey: string): string;
|
|
9501
|
+
|
|
9502
|
+
declare function regionHostname(region: string, baseDomain?: string): string;
|
|
9503
|
+
declare function tagHostname(region: string, tag: string, baseDomain?: string): string;
|
|
9504
|
+
/**
|
|
9505
|
+
* The host tag is the first character of a sandbox id (C1), lowercased
|
|
9506
|
+
* since DNS labels are conventionally lowercase even though hostnames are
|
|
9507
|
+
* case-insensitive.
|
|
9508
|
+
*/
|
|
9509
|
+
declare function sandboxTag(sandboxId: string): string;
|
|
9510
|
+
/** Resolves a hostname to the list of IP addresses it should be reached at. */
|
|
9511
|
+
interface AddressResolver {
|
|
9512
|
+
resolve(hostname: string): Promise<string[]>;
|
|
9513
|
+
}
|
|
9514
|
+
/**
|
|
9515
|
+
* Default resolver: plain DNS A-record lookup, with IP literals and
|
|
9516
|
+
* `localhost` passed through unchanged so tests and self-hosted runners
|
|
9517
|
+
* can point the transport straight at a fixed address without a resolver.
|
|
9518
|
+
*/
|
|
9519
|
+
declare class DnsAddressResolver implements AddressResolver {
|
|
9520
|
+
private readonly ttlMs;
|
|
9521
|
+
private readonly cache;
|
|
9522
|
+
constructor(ttlMs?: number);
|
|
9523
|
+
resolve(hostname: string): Promise<string[]>;
|
|
9524
|
+
}
|
|
9525
|
+
/** A fixed-table resolver, for tests and for pinning to known runner IPs (C1). */
|
|
9526
|
+
declare class StaticAddressResolver implements AddressResolver {
|
|
9527
|
+
private readonly table;
|
|
9528
|
+
constructor(table: ReadonlyMap<string, string[]>);
|
|
9529
|
+
resolve(hostname: string): Promise<string[]>;
|
|
9530
|
+
}
|
|
9531
|
+
|
|
9532
|
+
/**
|
|
9533
|
+
* HTTP/2 runner transport (RUNNER-CONTRACTS-2026-10-02.md, C1/C6).
|
|
9534
|
+
*
|
|
9535
|
+
* One session pool per *region* hostname, `sessionsPerAddress` sessions
|
|
9536
|
+
* per each of its `n` resolved addresses (session `i` of that address's
|
|
9537
|
+
* group, pinned to `addresses[addressIndex]`). A pool's sessions all
|
|
9538
|
+
* start connecting as soon as the region hostname is first named (by
|
|
9539
|
+
* `prewarm` or `request`), not when a request actually needs one.
|
|
9540
|
+
* `request`'s `addressIndex` selects which address's group to use (for
|
|
9541
|
+
* create's retry-next-IP, or for a per-sandbox call's known host);
|
|
9542
|
+
* within that group, concurrent callers are round-robined across its
|
|
9543
|
+
* sessions, so a burst of simultaneous requests to the same address
|
|
9544
|
+
* still spreads over every session pinned to it instead of serializing
|
|
9545
|
+
* onto one. Either way, a request waits only for the one session it
|
|
9546
|
+
* lands on - never for a sibling's.
|
|
9547
|
+
*
|
|
9548
|
+
* SNI is always the region hostname - one TLS session per address,
|
|
9549
|
+
* reused for both creates and that address's own per-sandbox calls by
|
|
9550
|
+
* varying only the HTTP/2 `:authority` per request (connection
|
|
9551
|
+
* coalescing: the cert covers `run-<region>.miosa.ai` and
|
|
9552
|
+
* `*.run-<region>.miosa.ai`, and a per-host name's one A record is the
|
|
9553
|
+
* same IP already in this pool - see transport.ts's doc comment).
|
|
9554
|
+
*/
|
|
9555
|
+
|
|
9556
|
+
interface Http2TransportOptions {
|
|
9557
|
+
/** Sessions opened per address when no explicit count is given. C6 default: 8. */
|
|
9558
|
+
defaultSessionsPerAddress?: number;
|
|
9559
|
+
/** Plaintext h2c instead of TLS+h2 - for the local test server only. */
|
|
9560
|
+
tls?: boolean;
|
|
9561
|
+
port?: number;
|
|
9562
|
+
resolver?: AddressResolver;
|
|
9563
|
+
/** Default per-request timeout when the caller doesn't set one. */
|
|
9564
|
+
defaultTimeoutMs?: number;
|
|
9565
|
+
}
|
|
9566
|
+
declare class Http2Transport implements RunnerTransport {
|
|
9567
|
+
readonly protocol: "h2";
|
|
9568
|
+
private readonly defaultSessionsPerAddress;
|
|
9569
|
+
private readonly tls;
|
|
9570
|
+
private readonly port;
|
|
9571
|
+
private readonly resolver;
|
|
9572
|
+
private readonly defaultTimeoutMs;
|
|
9573
|
+
private readonly pools;
|
|
9574
|
+
constructor(options?: Http2TransportOptions);
|
|
9575
|
+
prewarm(regionHostname: string, sessionsPerAddress?: number): void;
|
|
9576
|
+
addressCount(regionHostname: string): Promise<number>;
|
|
9577
|
+
ready(regionHostname: string, addressIndex: number): Promise<void>;
|
|
9578
|
+
request(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerResponse>;
|
|
9579
|
+
streamRequest(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerStreamResponse>;
|
|
9580
|
+
/** Shared by request() and ready() - the latter just discards the session. */
|
|
9581
|
+
private acquireSession;
|
|
9582
|
+
close(): Promise<void>;
|
|
9583
|
+
private poolFor;
|
|
9584
|
+
private buildPool;
|
|
9585
|
+
private connectSession;
|
|
9586
|
+
private sendRequest;
|
|
9587
|
+
private sendStreamRequest;
|
|
9588
|
+
}
|
|
9589
|
+
|
|
9590
|
+
/**
|
|
9591
|
+
* HTTP/3 runner transport: a napi-rs addon over quinn + h3
|
|
9592
|
+
* (native/h3-runner/), mirroring isorun's own native QUIC client.
|
|
9593
|
+
*
|
|
9594
|
+
* Built today for darwin-arm64 only - see native/h3-runner/README.md for
|
|
9595
|
+
* exactly which platforms still need a CI build before this ships
|
|
9596
|
+
* fleet-wide. `detectHttp3Support` reports unavailable on every other
|
|
9597
|
+
* platform (or if the addon fails to load for any reason), and
|
|
9598
|
+
* `createBestTransport` falls back to HTTP/2 automatically - the same
|
|
9599
|
+
* zero-cost path this file documented before the addon existed.
|
|
9600
|
+
*
|
|
9601
|
+
* Pooling mirrors Http2Transport exactly (one pool per region hostname,
|
|
9602
|
+
* sessions grouped by resolved address, round-robined within a group,
|
|
9603
|
+
* self-healing) - only `connectSession`/`sendRequest` differ, swapping
|
|
9604
|
+
* `node:http2` for the native addon's `h3Connect`/`h3Request`.
|
|
9605
|
+
*/
|
|
9606
|
+
|
|
9607
|
+
interface Http3Availability {
|
|
9608
|
+
available: boolean;
|
|
9609
|
+
reason: string;
|
|
9610
|
+
}
|
|
9611
|
+
declare function detectHttp3Support(): Http3Availability;
|
|
9612
|
+
/** Exposed for tests - clears the cached load result and availability. */
|
|
9613
|
+
declare function resetHttp3DetectionCache(): void;
|
|
9614
|
+
interface Http3TransportOptions {
|
|
9615
|
+
/** Sessions opened per address when no explicit count is given. C6: 4. */
|
|
9616
|
+
defaultSessionsPerAddress?: number;
|
|
9617
|
+
resolver?: AddressResolver;
|
|
9618
|
+
/** Per-request timeout. */
|
|
9619
|
+
defaultTimeoutMs?: number;
|
|
9620
|
+
/**
|
|
9621
|
+
* Hard cap on the QUIC handshake + h3 setup, independent of (and
|
|
9622
|
+
* shorter than) the happy-eyeballs race in transport-factory.ts - see
|
|
9623
|
+
* native/h3-runner/README.md's "known gap" for why this exists at all.
|
|
9624
|
+
*/
|
|
9625
|
+
connectTimeoutMs?: number;
|
|
9626
|
+
/** Skips certificate verification. Test-only - never set true in production. */
|
|
9627
|
+
insecure?: boolean;
|
|
9628
|
+
port?: number;
|
|
9629
|
+
}
|
|
9630
|
+
declare class Http3Transport implements RunnerTransport {
|
|
9631
|
+
readonly protocol: "h3";
|
|
9632
|
+
private readonly native;
|
|
9633
|
+
private readonly defaultSessionsPerAddress;
|
|
9634
|
+
private readonly resolver;
|
|
9635
|
+
private readonly defaultTimeoutMs;
|
|
9636
|
+
private readonly connectTimeoutMs;
|
|
9637
|
+
private readonly insecure;
|
|
9638
|
+
private readonly port;
|
|
9639
|
+
private readonly pools;
|
|
9640
|
+
constructor(options?: Http3TransportOptions);
|
|
9641
|
+
prewarm(regionHostname: string, sessionsPerAddress?: number): void;
|
|
9642
|
+
addressCount(regionHostname: string): Promise<number>;
|
|
9643
|
+
ready(regionHostname: string, addressIndex: number): Promise<void>;
|
|
9644
|
+
request(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerResponse>;
|
|
9645
|
+
/**
|
|
9646
|
+
* The native addon has no streaming request support yet - buffers the
|
|
9647
|
+
* whole response (same as request()) and hands it back as a single
|
|
9648
|
+
* chunk. Correct, not incrementally streamed; see transport.ts's doc
|
|
9649
|
+
* comment on streamRequest.
|
|
9650
|
+
*/
|
|
9651
|
+
streamRequest(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerStreamResponse>;
|
|
9652
|
+
/** Shared by request() and ready() - the latter just discards the handle. */
|
|
9653
|
+
private acquireHandle;
|
|
9654
|
+
close(): Promise<void>;
|
|
9655
|
+
private poolFor;
|
|
9656
|
+
private buildPool;
|
|
9657
|
+
private connectSession;
|
|
9658
|
+
private sendRequest;
|
|
9659
|
+
}
|
|
9660
|
+
|
|
9661
|
+
/**
|
|
9662
|
+
* Picks the best transport available, and - when HTTP/3 is available -
|
|
9663
|
+
* runs it against HTTP/2 per region host so a blocked or slow QUIC
|
|
9664
|
+
* handshake never costs a request time (RUNNER-CONTRACTS-2026-10-02.md,
|
|
9665
|
+
* C6; see http3-transport.ts's doc comment for the full requirement).
|
|
9666
|
+
*
|
|
9667
|
+
* Today, on a platform with no native HTTP/3 addon, this is unconditional
|
|
9668
|
+
* HTTP/2 with zero QUIC probing - see http3-transport.ts.
|
|
9669
|
+
*/
|
|
9670
|
+
|
|
9671
|
+
interface BestTransportOptions {
|
|
9672
|
+
http2?: Http2TransportOptions;
|
|
9673
|
+
http3?: Http3TransportOptions;
|
|
9674
|
+
}
|
|
9675
|
+
interface BestTransportResult {
|
|
9676
|
+
transport: RunnerTransport;
|
|
9677
|
+
http3: Http3Availability;
|
|
9678
|
+
}
|
|
9679
|
+
declare function createBestTransport(options?: BestTransportOptions): BestTransportResult;
|
|
9680
|
+
/**
|
|
9681
|
+
* True happy-eyeballs, no waiting window: `prewarm` starts HTTP/2 and
|
|
9682
|
+
* HTTP/3 connecting in parallel and immediately starts watching HTTP/3's
|
|
9683
|
+
* readiness in the background - it does not block on it. Every request
|
|
9684
|
+
* uses whichever protocol is already known-good for that region host at
|
|
9685
|
+
* the moment it is sent:
|
|
9686
|
+
*
|
|
9687
|
+
* - undecided or HTTP/3 still connecting -> HTTP/2 (never waits).
|
|
9688
|
+
* - HTTP/3 connected at some point -> HTTP/2 until that moment,
|
|
9689
|
+
* HTTP/3 for every request from then on (remembered per host).
|
|
9690
|
+
* - HTTP/3 failed outright -> HTTP/2 forever.
|
|
9691
|
+
*
|
|
9692
|
+
* A slow-but-alive QUIC path can only ever promote a host to HTTP/3 for
|
|
9693
|
+
* *future* requests; it never delays the request that happens to be in
|
|
9694
|
+
* flight when it finishes connecting.
|
|
9695
|
+
*/
|
|
9696
|
+
declare class RacingTransport implements RunnerTransport {
|
|
9697
|
+
private readonly http2;
|
|
9698
|
+
private readonly http3;
|
|
9699
|
+
readonly protocol: RunnerProtocol;
|
|
9700
|
+
private readonly protocolByHost;
|
|
9701
|
+
private readonly watching;
|
|
9702
|
+
constructor(http2: RunnerTransport, http3: RunnerTransport);
|
|
9703
|
+
/** The protocol a region host is currently using - "h2" until HTTP/3 proves itself, per the class doc comment. */
|
|
9704
|
+
perHostProtocol(regionHostname: string): RunnerProtocol;
|
|
9705
|
+
prewarm(regionHostname: string, sessionsPerAddress?: number): void;
|
|
9706
|
+
addressCount(regionHostname: string): Promise<number>;
|
|
9707
|
+
ready(regionHostname: string, addressIndex: number): Promise<void>;
|
|
9708
|
+
request(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerResponse>;
|
|
9709
|
+
streamRequest(regionHostname: string, addressIndex: number, authority: string, path: string, init: RunnerRequestInit): Promise<RunnerStreamResponse>;
|
|
9710
|
+
close(): Promise<void>;
|
|
9711
|
+
/** Whatever protocol is decided for regionHostname right now - never waits. */
|
|
9712
|
+
private transportFor;
|
|
9713
|
+
/**
|
|
9714
|
+
* Starts (once per host) a background wait on HTTP/3's own readiness
|
|
9715
|
+
* for address 0 - connection setup, not a request - and promotes the
|
|
9716
|
+
* host to "h3" the moment it resolves. Never awaited by any caller;
|
|
9717
|
+
* purely a side effect that later `transportFor` calls observe.
|
|
9718
|
+
*/
|
|
9719
|
+
private watchHttp3;
|
|
9720
|
+
}
|
|
9721
|
+
|
|
9722
|
+
/**
|
|
9723
|
+
* Runner-specific error bodies (RUNNER-CONTRACTS-2026-10-02.md, C2/C2b).
|
|
9724
|
+
*
|
|
9725
|
+
* Two shapes, both handled by the one `fromResponse`:
|
|
9726
|
+
* - flat (401/403/421/429/503, C2): `{"error":"runtime_busy"}`.
|
|
9727
|
+
* - nested "platform" shape (400 RUNNER_UNSUPPORTED_REQUEST/INVALID_ID,
|
|
9728
|
+
* 404 NOT_FOUND, and every soma.api.v1 envelope failure, C2/C2b):
|
|
9729
|
+
* `{"error":{"code":"...","message":"...","retryable":false},"ok":false}`.
|
|
9730
|
+
* The envelope's own top-level `error` field is this same sub-shape,
|
|
9731
|
+
* so envelope.ts's error path reuses this parser unchanged.
|
|
9732
|
+
*
|
|
9733
|
+
* Deliberately a lighter, separate parser from the control plane's
|
|
9734
|
+
* src/errors.ts MiosaError rather than overloading it.
|
|
9735
|
+
*/
|
|
9736
|
+
type RunnerErrorCode = "unauthorized" | "forbidden" | "misdirected" | "rate_limited" | "runtime_busy" | "feed_stale" | "RUNNER_UNSUPPORTED_REQUEST" | "INVALID_ID" | "NOT_FOUND" | "not_found" | (string & {});
|
|
9737
|
+
interface RunnerErrorDetail {
|
|
9738
|
+
code: string;
|
|
9739
|
+
message?: string;
|
|
9740
|
+
retryable?: boolean;
|
|
9741
|
+
}
|
|
9742
|
+
interface RunnerErrorBody {
|
|
9743
|
+
error?: string | RunnerErrorDetail;
|
|
9744
|
+
/** Present on 421 misdirected - the owning runner's URL, e.g. `https://3.run-us.miosa.ai`. */
|
|
9745
|
+
runner_url?: string;
|
|
9746
|
+
ok?: boolean;
|
|
9747
|
+
}
|
|
9748
|
+
interface RunnerErrorOptions {
|
|
9749
|
+
runnerUrl?: string | undefined;
|
|
9750
|
+
message?: string | undefined;
|
|
9751
|
+
retryable?: boolean | undefined;
|
|
9752
|
+
}
|
|
9753
|
+
declare class RunnerError extends Error {
|
|
9754
|
+
readonly status: number;
|
|
9755
|
+
readonly code: RunnerErrorCode;
|
|
9756
|
+
readonly runnerUrl: string | undefined;
|
|
9757
|
+
/** Only meaningful for the nested "platform"/envelope shape - undefined for the flat C2 shape. */
|
|
9758
|
+
readonly retryable: boolean | undefined;
|
|
9759
|
+
constructor(status: number, code: RunnerErrorCode, options?: RunnerErrorOptions);
|
|
9760
|
+
static fromResponse(status: number, body: string): RunnerError;
|
|
9761
|
+
get isMisdirected(): boolean;
|
|
9762
|
+
/**
|
|
9763
|
+
* C2 (revised): admission-cap-reached ("runtime_busy") moved from 503 to
|
|
9764
|
+
* 429 with `Retry-After: 0`; `feed_stale` stayed on 503. Checked by
|
|
9765
|
+
* code, not status, so this stays correct regardless of which of the
|
|
9766
|
+
* two carries it.
|
|
9767
|
+
*/
|
|
9768
|
+
get isBusy(): boolean;
|
|
9769
|
+
/** C2: the runner doesn't serve this create shape at all - send it to api.miosa.ai instead. */
|
|
9770
|
+
get isUnsupportedRequest(): boolean;
|
|
9771
|
+
}
|
|
9772
|
+
|
|
9773
|
+
export { AGENT_BUILD_KIND_SPECS, type AcceptOrgInviteResponse, type AcceptWorkspaceInviteResponse, type AddDomainParams, type AddWorkspaceMemberParams, type AddressResolver, Admin, type AgentBuildExecutionPacket, type AgentBuildFileSpec, type AgentBuildKind, type AgentBuildKindSpec, type AgentBuildPlannerDocument, type AgentDefinitionCreateParams, type AgentDefinitionData, type AgentDefinitionListParams, type AgentDefinitionUpdateParams, AgentDefinitions, type AgentDispatchParams, type AgentEvent$1 as AgentEvent, type AgentEventType, AgentRuntimeProfiles, type AgentSessionCreateParams, type AgentSessionData, type AgentSessionListResponse$1 as AgentSessionListResponse, type AgentSessionStatus$1 as AgentSessionStatus, type AgentVersionData, type AllowParams, Analytics, type AnalyticsFilters, type ApiKeyCreateParams, type ApiKeyCreateResult, type ApiKeyData, type ApiKeyId, type ApiKeyListParams, ApiKeys, type AppActionDecision, AppAuth, type AppAuthConfig, type AppAuthResourceType, type AppAuthSession, type AppAuthTokenPayload, type AppAutomationRun, type AppCatalogEntry, type AppCollectionRecord, type AppDocument, type AppDocumentCreateParams, type AppDocumentDiagnostics, type AppDocumentRecord, type AppDocumentUpdateParams, AppDocuments, type AppInstallData, type AppInstallEvent, type AppJson, type AppReleaseApproval, type AppReleaseCandidate, type AttachAwsRoleParams, type AuditListParams, AuditLog, type AuditLogEvent, type AuditLogListParams, type AuditTailParams, AuthError, type AuthToken, type BenchmarkCompareParams, type BenchmarkCreateParams, Benchmarks, type BestTransportOptions, type BestTransportResult, type BindingCreateParams, type BindingListParams, type BrandingData, type BrandingUpdateParams, type BucketCreateParams, type BucketData, type BucketId, type BuilderSessionListParams, BuilderSessions, type BulkUserActionParams, type ChannelCreateParams, type ChannelData, type ChannelListParams, type ChannelUpdateParams, Channels, type ChatCompletionCreateParams, type ChatCompletionCreateStreamParams, Checkpoints, type ClickParams, Cloud, type CloudAccount, type CloudAccountCreateParams, type CloudAccountMode, type CloudAccountStatus, type CloudCredentialType, type CloudListParams, type CloudPlacementScope, type CloudPool, type CloudPoolCreateParams, type CloudPoolKind, type CloudPreflightRecordParams, type CloudPreflightRun, type CloudPreflightStatus, type CloudProvider, type CloudRegion, type CloudRegionCreateParams, type ClusterCreateParams, type ClusterData, type ClusterEvent, type ClusterId, type ClusterListResponse, type ClusterStatus, CommandCenter, Community, type CompletionCreateParams, type CompletionCreateStreamParams, Completions, type ComputeProduct, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, type ComputerCreateParams, type ComputerData, ComputerEnv, type ComputerId, ComputerInbox, type ComputerListParams, type ComputerListResponse, ComputerLogs, type ComputerLogsGetParams, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, type ComputerSize, type ComputerStatus, type ComputerTemplateType, ComputerTerminal, type ComputerUpdateParams, type ComputerVisibility, ComputerVolumes, Computers, type ConnectorApplicableDefaultParams, type ConnectorCreateParams, type ConnectorData, type ConnectorDefault, type ConnectorDefaultListParams, type ConnectorDefaultParams, type ConnectorListParams, type ConnectorSubject, type ConnectorTokenParams, type ConnectorTokenResponse, Connectors, type CopyParams, type CreateAdminApiKeyParams, type CreateAgentBuildPacketParams, type CreateBuildRunParams, type CreateOrgInviteParams, type CreateWorkspaceInviteParams, type CreateWorkspaceInviteResponse, type CreditBalance, type CreditTransaction, type CreditTransactionListResponse, type CreditUsage, Credits, type CronJobCreateParams, type CronJobData, type CronJobExecutionData, type CronJobExecutionId, type CronJobId, type CronJobListParams, type CronJobUpdateParams, CronJobs, type CursorInfo, type CustomDomainCreateParams, type CustomDomainData, type CustomDomainId, type CustomDomainListParams, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, type DashboardSummary, type DatabaseCreateParams, type DatabaseCredentials, type DatabaseData, type DatabaseId, type DatabaseListParams, type DatabaseLogsParams, type DatabaseLogsResult, Databases, type DeploymentBuildData, DeploymentConnectors, type DeploymentCreateParams, type DeploymentData, DeploymentDomains, type DeploymentId, type DeploymentListParams, type DeploymentProduct, type DeploymentProofCheck, type DeploymentProofParams, type DeploymentProofProbe, type DeploymentProofResult, type DeploymentReleaseData, type DeploymentReleaseId, DeploymentReleases, DeploymentRuntimeInstances, type DeploymentServiceData, type DeploymentServiceId, type DeploymentServiceType, type DeploymentSourceType, type DeploymentState, type DeploymentUpdateParams, type DeploymentVersionData, type DeploymentVersionId, type DeploymentVersionKind, type DeploymentVersionState, DeploymentVersions, Deployments, Desktop$1 as Desktop, type DesktopActionResult, type DeviceBootstrapParams, type DeviceBootstrapResult, type DeviceBrowserResult, type DeviceCapabilities, type DeviceData, type DeviceExecParams, type DeviceExecResult, type DeviceExposeParams, type DeviceExposeResult, type DeviceExtendParams, type DeviceFileEntry, type DeviceFileListParams, type DeviceKind, type DeviceLifecycleResult, type DeviceListParams, type DeviceReadFileParams, type DeviceReadFileResult, type DeviceWriteFileParams, type DeviceWriteFileResult, Devices, type DirEntry, type DirListResult, type DiscordSendTestParams, DnsAddressResolver, DockerDeploy, type DockerDeployApplianceStatus, type DockerDeployCreateParams, type DockerDeployDoctorCheck, type DockerDeployDoctorParams, type DockerDeployDoctorProbe, type DockerDeployDoctorResult, type DockerDeployHostData, type DockerDeployHostEnsureParams, type DockerDeployHostId, type DockerDeployHostListParams, type DockerDeployHostListResponse, type DockerDeployHostResponse, type DockerDeployHostStatus, type DoubleClickParams, type DragParams, type EgressAllowlistRule, EgressAudit, type EgressAuditEvent, type EgressBindingData, EgressHostNotAllowedError, EgressNetwork, type EgressPolicyData, type EgressPolicyMode, type EgressRuleEffect, type EgressSecretData, type EgressSecretScope, type EgressSecretType, EgressSecrets, type EgressSuggestion, Email, EmailCampaigns, EmailInbox, EmailTemplates, type EmbeddingCreateParams, Embeddings, Exec, type ExecParams, type ExecPythonParams, type ExecResult, type ExternalAttribution, type ExternalKeyCreateParams, type ExternalKeyData, ExternalKeys, type FileDeleteParams, type FileDownloadParams, type FileEntry, type FileExportParams, type FileExportResult, type FileListParams, type FileListResult, type FileStat, Files, FlatCustomDomains, Forge, ForgeContractError, type ForgeDeleteReceipt, type ForgeOrganizationId, ForgePolicyViolationError, ForgeRepositories, type ForgeRepository, type ForgeRepositoryCreateParams, type ForgeRepositoryDeleteOptions, type ForgeRepositoryId, type ForgeRepositoryState, type ForgeRepositoryUpdateParams, type ForgeRepositoryVisibility, ForgeStorageError, ForgeUnavailableError, type FsEntry, type FsListResponse, type FsStat, type FunctionCreateParams, type FunctionData, type FunctionId, type FunctionInvokeParams, type FunctionListParams, type FunctionUpdateParams, Functions, type GithubRepo, type GithubSshKey, type HealthCheckCreateParams, type HealthCheckData, type HealthCheckId, type HealthCheckListParams, type HealthCheckUpdateParams, HealthChecks, type HostCreateParams, type HostData, type HostEvent, type HostId, type HostListResponse, type HostStatus, type HostUpdateParams, Http2Transport, type Http2TransportOptions, type Http3Availability, Http3Transport, type Http3TransportOptions, InstallationRequiredError, InsufficientCreditsError, type IntegrationCatalogEntry, type IntegrationData, Integrations, type JobData, type JobEvent, type JobEventType, type JobId, type JobListResponse, type JobRunParams, type JobStatus, type KeyParams, type LaunchParams, type LinearCreateIssueParams, type ListAdminApiKeysParams, type ListAdminComputersParams, type ListAdminTenantsParams, type ListAdminUsersParams, ManagedProviderBindingOnlyError, Mcp, type McpDispatchParams, Miosa, type MiosaClientConfig, MiosaError, type MiosaErrorBody, type MkdirParams, type ModeParams, Models, type MouseButton, NetworkError, NetworkPolicy, type NetworkPolicyData, type NetworkPolicyEffect, type NetworkPolicyProtocol, type NetworkPolicyRule, type NetworkPolicySetParams, NotFoundError, type NotificationPrefsUpdateParams, OAuthFlow, type OauthConnectParams, type OauthProvider, type OauthStartResult, type OauthStatusResult, type ObjectListParams, type AgentEvent as OcAgentEvent, type OcAgentSessionData, type AgentSessionListResponse as OcAgentSessionListResponse, type OcWorkspaceCreateParams, type OcWorkspaceData, type OcWorkspaceEvent, type OcWorkspaceListResponse, type OcWorkspaceStatus, type OcWorkspaceUpdateParams, OpenComputers, type OrgInvite, type OrgInviteCreated, type OrgInviteCreatedResponse, type OrgInviteListResponse, type OrgInvitePreview, type OrgInviteRevokeResponse, OrgInvites, type OrgRole, type OrganizationMember, type OrganizationMemberList, type OrganizationMemberRemoved, OrganizationMembers, type OrganizationRole, type OrganizationSummary, type OrganizationSwitchResult, Organizations, type OverviewData, type PolicyCreateParams, type PolicyListParams, type PolicyUpdateParams, type PresignParams, type PresignResult, type PreviewDomainData, type ProductCatalogEntry, type ProductTemplate, type ProductTemplateCatalog, ProjectAuth, type ProjectAuthEnableParams, type ProjectAuthStatus, type ProjectAuthUpdateParams, type ProjectIntegrationCatalogEntry, type ProjectIntegrationCreateParams, type ProjectIntegrationData, type ProjectIntegrationListParams, type ProjectIntegrationUpdateParams, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, type ProviderKeyUpsertParams, type PublishFromSandboxParams, type PublishParams, type PublishResult, RacingTransport, RateLimitError, type RegionData, Regions, type RollbackParams, type RulesListParams, type Run, type RunActivity, type RunCommandOutput, type RunCreateParams, type RunDiagnostic, type RunDownload, type RunFile, type RunGroup, type RunGroupActivity, type RunGroupCounts, type RunGroupCreateParams, type RunGroupDispatchEntry, type RunGroupDispatchResult, type RunGroupFile, type RunGroupListParams, type RunGroupStatus, type RunGroupWaitOptions, RunGroups, type RunListParams, type RunMessage, type RunOutputs, type RunPreview, type RunStatus, type RunTargetKind, type RunWaitOptions, RunnerClient, type RunnerClientOptions, RunnerConnectError, type RunnerDestroyResult, RunnerError, type RunnerErrorBody, type RunnerErrorCode, type RunnerErrorDetail, type RunnerErrorOptions, type RunnerExecOptions, type RunnerExecStreamEvent, type RunnerHealth, type RunnerProtocol, type RunnerRequestInit, type RunnerResponse, type RunnerSandboxCreateResult, type RunnerSetTimeoutResult, type RunnerStreamResponse, RunnerTimeoutError, type RunnerTransport, Runs, type RuntimeCapabilities, RuntimeCapabilitiesResource, RuntimeEnv, type RuntimeEnvListParams, type RuntimeEnvScope, type RuntimeEnvSetParams, type RuntimeEnvTarget, type RuntimeEnvVar, type RuntimeInstanceData, type RuntimeInstanceId, type RuntimeInstanceState, type RuntimeLogsResult, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, type SandboxBuildSpec, type SandboxBuildSpecError, type SandboxBuildSpecValidation, SandboxCommands, type SandboxConnectorAttachParams, type SandboxConnectorBinding, type SandboxConnectorPreflightParams, type SandboxConnectorPreflightResult, SandboxConnectors, type SandboxCreateParams, type SandboxData, SandboxEnv, SandboxEvents, type SandboxExecEvent, type SandboxExecOptions, type SandboxExecResult, type SandboxExecRunner, SandboxFiles, type SandboxGetOrCreateParams, type SandboxId, type SandboxListParams, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, type SandboxState, SandboxTags, type SandboxTemplate, type SandboxTemplateBuild, type SandboxTemplateBuildCreateParams, type SandboxTemplateBuildResourceData, type SandboxTemplateBuildResourceId, type SandboxTemplateCreateParams, type SandboxTemplateList, type SandboxTemplateListParams, type SandboxTemplateResourceData, type SandboxTemplateResourceId, SandboxTemplates, SandboxTerminal, type SandboxTerminalCreateParams, type SandboxTerminalSession, Sandboxes, ScopeNotAllowedError, ScopedFs, type ScrollDirection, type ScrollParams, type SecretCreateParams, type SecretData, type SecretId, type SecretListParams, type SecretRotateParams, type SecretSetParams, type SecretUpdateParams, type SessionId, Settings, type SettingsUpdateParams, type SizeData, type SlackSendTestParams, type SnapshotCreateParams, type SnapshotData, type SnapshotListResponse, type SnapshotProgressEvent, type SnapshotRestoreResult, type SnapshotStatus, SnapshotsStandalone, type SomaBytes, type SomaEnvelope, type SomaFilesystemExistsResult, type SomaFilesystemListEntry, type SomaFilesystemListResult, type SomaFilesystemMkdirResult, type SomaFilesystemReadResult, type SomaFilesystemRefusal, type SomaFilesystemRemoveResult, type SomaFilesystemWriteResult, type SomaSandboxGetResult, type SomaSandboxListEntry, type SomaSandboxListResult, type SomaSandboxStopResult, type SomaTerminalCloseResult, type SomaTerminalOpenResult, type SomaTerminalReadResult, type SomaTerminalRefusal, type SomaTerminalResizeResult, type SomaTerminalWriteResult, StaticAddressResolver, Storage, type StorageObjectData, SubjectNotAllowedError, type SuggestionsParams, type TemplateBenchmarkLane, type TemplateBuildCreateParams, type TemplateCreateParams, type TemplateData, type TemplateReadinessContract, type TemplateReadinessState, type TemplateSizeReadiness, Templates, type TemplatesListParams, Tenant, type TenantBrandingUpdateParams, type TenantId, type TenantPlan, type TenantSummary, type TerminalCreateParams, TimeoutError, type TimeseriesParams, TokenRefreshFailedError, type TunnelAuthMode, type TunnelCreateParams, type TunnelData, type TunnelId, type TunnelListResponse, type TunnelUpdateParams, type TypeParams, type UpdateWorkspaceMemberRoleParams, Usage, type UsageReportParams, type UsageSession, type UsageSessionsParams, type UsageSummary, UserAuthorizationRequiredError, type UserId, ValidationError, type VersionListParams, type VolumeAttachParams, type VolumeAttachmentData, type VolumeCreateParams, type VolumeData, type VolumeId, type VolumeListParams, Volumes, type WaitParams, type WebhookCreateParams, type WebhookData, type WebhookDeliveryData, type WebhookDeliveryId, type WebhookId, type WebhookListParams, type WebhookUpdateParams, Webhooks, type WindowFocusParams, type WindowInfo, type WorkspaceId, type WorkspaceInvite, type WorkspaceInviteCreatedResponse, type WorkspaceInviteListResponse, type WorkspaceInvitePreview, type WorkspaceInviteRevokeResponse, WorkspaceInvites, type WorkspaceMember, type WorkspaceMemberAddedResponse, type WorkspaceMemberDeleteResponse, type WorkspaceMemberListResponse, type WorkspaceMemberRecord, type WorkspaceMemberRecordResponse, WorkspaceMembers, type WorkspaceRole, type WsTicket, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBestTransport, createBuildRunParams, decodeSomaBytes, detectHttp3Support, encodeSomaBytes, getAgentBuildKindSpec, hyphenateInstanceId, isConnectFailure, regionFromApiKey, regionHostname, resetHttp3DetectionCache, resolveAgentBuildKind, sandboxTag, tagHostname, unwrapSomaEnvelope, verifySignature };
|