@tangle-network/sandbox 0.63.19 → 0.63.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +5 -5
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +2 -2
- package/dist/{agent-run-outcome-DlYhZnhD.d.ts → agent-run-outcome-C-VR-L0I.d.ts} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{backend-types-D6bYbvMB.js → backend-types-zuUBEJO1.js} +35 -1
- package/dist/{browser-interactive-control-controller-B6sySQFu.d.ts → browser-interactive-control-controller-CvObO_Kf.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-BJf0P_J4.js → browser-interactive-control-controller-DHx53yre.js} +16 -1
- package/dist/{chunked-upload-KJyRCAiC.js → chunked-upload-DN2twsUu.js} +1 -1
- package/dist/{chunked-upload-file-DfiGzqaR.js → chunked-upload-file-Dpv1YsoA.js} +2 -2
- package/dist/{cli-auth-bundle-CMgB8Ec3.js → cli-auth-bundle-AvhkWJHX.js} +1 -1
- package/dist/{client-Dl22CVOz.js → client-5yqzAcFJ.js} +3271 -3271
- package/dist/client-CqpKC6n3.d.ts +6066 -0
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-XHg5BEUI.js → collaboration-g_HzXa6f.js} +1 -1
- package/dist/core.d.ts +6 -7
- package/dist/core.js +5 -5
- package/dist/{direct-http2-Dq7tq6jV.js → direct-http2-CoGVOqVR.js} +1 -1
- package/dist/{errors-AB5BD3FM.js → errors-BfbOP_rx.js} +19 -1
- package/dist/{sandbox-DDdPhk2j.d.ts → index-D4OBUP5M.d.ts} +2105 -1461
- package/dist/index.d.ts +12 -4747
- package/dist/index.js +15 -11
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-BSWoA0YE.d.ts → interactive-controller-BBwB_5QQ.d.ts} +3 -2
- package/dist/{interactive-controller-zE6hwv3C.js → interactive-controller-D4N4zqmu.js} +578 -610
- package/dist/{lines-hsXVdk60.d.ts → lines-5m11CEj-.d.ts} +21 -17
- package/dist/lines-C5ER4aN_.js +298 -0
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -295
- package/dist/{local-cli-auth-C4QcPdZt.js → local-cli-auth-CSnvjLAP.js} +1 -1
- package/dist/{mcp-local-BYHcA72Z.js → mcp-local-BjLG7VHY.js} +1 -1
- package/dist/{preview-D8UAF7F9.d.ts → preview-CcJBQSjB.d.ts} +3 -3
- package/dist/{public-templates-BP3sTaSb.d.ts → public-templates-nv4AFFVc.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/runtime.d.ts +47 -40
- package/dist/runtime.js +4 -4
- package/dist/{sandbox-BJkpVtLN.js → sandbox-BGIam_wK.js} +9256 -9215
- package/dist/{secp256k1-DoWlH6ff.js → secp256k1-CmLpsmWl.js} +1 -1
- package/dist/session-gateway/index.d.ts +16 -17
- package/dist/session-gateway/index.js +20 -23
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-BBpguPfj.js → tangle--i0MX6UC.js} +144 -138
- package/dist/terminal-stream-types-ClZCArRg.d.ts +662 -0
- package/dist/{types-BxZX2EVj.d.ts → types-BjyQe_CI.d.ts} +393 -315
- package/package.json +5 -5
- package/dist/client-DraGbXEP.d.ts +0 -1249
- package/dist/error-classes-BWS1a9HO.d.ts +0 -321
- package/dist/index-xS3mRl69.d.ts +0 -578
- package/dist/managed-process-B-pXdMLC.d.ts +0 -15
- package/dist/terminal-stream-DgD7GlFi.d.ts +0 -388
- /package/dist/{cli-auth-bundle-BKsrsbxy.d.ts → cli-auth-bundle-Dyw3hCGx.d.ts} +0 -0
- /package/dist/{index-DfA_usrZ.d.ts → index-C8VSFtWl.d.ts} +0 -0
- /package/dist/{index-CWUW8pqr.d.ts → index-CVjTnRWP.d.ts} +0 -0
- /package/dist/{keep-alive-fetch-CXvfSczd.js → keep-alive-fetch-CuwGi7gz.js} +0 -0
- /package/dist/{line-application-UtPFP0o4.js → line-application-DY9ZTdgF.js} +0 -0
- /package/dist/{preview-operations-Bvo5YcIq.js → preview-operations-Ca02vPDJ.js} +0 -0
- /package/dist/{raw-evidence-archive-Bxk6fUjS.js → raw-evidence-archive-CDYDqHNv.js} +0 -0
- /package/dist/{utils-B6gap92T.js → utils-BGvM02yJ.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
1
|
+
import { G as SandboxCreateReceipt, a as TerminalStreamOptions, g as TerminalReadyInfo, i as TerminalStreamHandlers, s as TerminalStreamToken, t as TerminalAttachTimings } from "./terminal-stream-types-ClZCArRg.js";
|
|
2
|
+
import { t as CliAuthReference } from "./cli-auth-bundle-Dyw3hCGx.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
5
5
|
import { AgentExactRunControlRef, AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileValidationResult, AgentRuntimeAttachments, PlanContinuation, ReasoningEffort, SandboxSizePreset } from "@tangle-network/agent-interface";
|
|
@@ -36,6 +36,23 @@ type BackendType = (typeof BACKEND_TYPE)[keyof typeof BACKEND_TYPE];
|
|
|
36
36
|
/** Stable declaration order; registry tests check the shipped spec composition. */
|
|
37
37
|
declare const ALL_BACKEND_TYPES: [BackendType, ...BackendType[]];
|
|
38
38
|
declare function parseBackendType(value: string): BackendType;
|
|
39
|
+
/**
|
|
40
|
+
* Which layer supplied the model id that executed. `request` means the model
|
|
41
|
+
* the caller sent survived transport; anything else means it did not, and the
|
|
42
|
+
* caller's own record of the turn is wrong unless it reconciles against this.
|
|
43
|
+
*/
|
|
44
|
+
type EffectiveBackendSource = "request" | "environment" | "profile";
|
|
45
|
+
interface EffectiveBackendProfile {
|
|
46
|
+
name?: string;
|
|
47
|
+
/** Stable hash of the materialized profile; equal digests ran the same profile. */
|
|
48
|
+
digest: string;
|
|
49
|
+
}
|
|
50
|
+
interface EffectiveBackend {
|
|
51
|
+
provider?: string;
|
|
52
|
+
model?: string;
|
|
53
|
+
source?: EffectiveBackendSource;
|
|
54
|
+
profile?: EffectiveBackendProfile;
|
|
55
|
+
}
|
|
39
56
|
//#endregion
|
|
40
57
|
//#region ../../../packages/runtime-contracts/dist/batch-events.d.ts
|
|
41
58
|
/** Token and tool usage emitted when one batch task completes. */
|
|
@@ -1112,7 +1129,7 @@ type PublicBatchRunRequestInput = z.input<typeof publicBatchRunRequestSchema>;
|
|
|
1112
1129
|
type PublicBatchRunRequest = z.output<typeof publicBatchRunRequestSchema>;
|
|
1113
1130
|
//#endregion
|
|
1114
1131
|
//#region ../../../packages/runtime-contracts/dist/batch-stream.d.ts
|
|
1115
|
-
type BatchTaskResult
|
|
1132
|
+
type BatchTaskResult = (BatchEventDataMap["task.completed"] & {
|
|
1116
1133
|
success: true;
|
|
1117
1134
|
}) | (BatchEventDataMap["task.failed"] & {
|
|
1118
1135
|
success: false;
|
|
@@ -1130,7 +1147,7 @@ type BatchCleanupResult = ({
|
|
|
1130
1147
|
pendingSidecarIds: string[];
|
|
1131
1148
|
isComplete: boolean;
|
|
1132
1149
|
};
|
|
1133
|
-
interface BatchResult
|
|
1150
|
+
interface BatchResult {
|
|
1134
1151
|
totalTasks: number;
|
|
1135
1152
|
totalBackends: number;
|
|
1136
1153
|
totalExecutions: number;
|
|
@@ -1139,7 +1156,7 @@ interface BatchResult$1 {
|
|
|
1139
1156
|
totalRetries: number;
|
|
1140
1157
|
successRate: number;
|
|
1141
1158
|
byBackend: BatchBackendResult[];
|
|
1142
|
-
results: BatchTaskResult
|
|
1159
|
+
results: BatchTaskResult[];
|
|
1143
1160
|
execution: {
|
|
1144
1161
|
provisioning?: {
|
|
1145
1162
|
requested: BatchEventDataMap["batch.provisioning"];
|
|
@@ -1549,6 +1566,42 @@ declare const sandboxEnvRecoveryViewSchema: z.ZodObject<{
|
|
|
1549
1566
|
}, z.core.$strict>;
|
|
1550
1567
|
type SandboxEnvRecoveryView = z.infer<typeof sandboxEnvRecoveryViewSchema>;
|
|
1551
1568
|
//#endregion
|
|
1569
|
+
//#region ../../../packages/runtime-contracts/dist/sandbox-wire-types.d.ts
|
|
1570
|
+
/** Lifecycle state of an agent session inside a sandbox. */
|
|
1571
|
+
type SessionStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
1572
|
+
/** Languages supported by the persistent code kernel. */
|
|
1573
|
+
type CodeLanguage = "python" | "node" | "typescript" | "bash";
|
|
1574
|
+
/** Select retained process records by their exact-process launch identity. */
|
|
1575
|
+
interface ProcessListOptions {
|
|
1576
|
+
idempotencyKey?: string;
|
|
1577
|
+
}
|
|
1578
|
+
/** Status of a spawned process. */
|
|
1579
|
+
interface ProcessStatus {
|
|
1580
|
+
/** Process ID */
|
|
1581
|
+
pid: number;
|
|
1582
|
+
/** Opaque exact-process launch identity when one was supplied. */
|
|
1583
|
+
idempotencyKey?: string;
|
|
1584
|
+
/** Command that was executed */
|
|
1585
|
+
command: string;
|
|
1586
|
+
/** Working directory */
|
|
1587
|
+
cwd?: string;
|
|
1588
|
+
/** Whether the process is still running */
|
|
1589
|
+
running: boolean;
|
|
1590
|
+
/** Exit code (-1 if still running) */
|
|
1591
|
+
exitCode: number;
|
|
1592
|
+
/** Signal that killed the process (if any) */
|
|
1593
|
+
exitSignal?: string;
|
|
1594
|
+
/** When the process started */
|
|
1595
|
+
startedAt: Date;
|
|
1596
|
+
/** When the process exited (if exited) */
|
|
1597
|
+
exitedAt?: Date;
|
|
1598
|
+
}
|
|
1599
|
+
/** Full process information including environment. */
|
|
1600
|
+
interface ProcessInfo extends ProcessStatus {
|
|
1601
|
+
/** Environment variables used */
|
|
1602
|
+
env?: Record<string, string>;
|
|
1603
|
+
}
|
|
1604
|
+
//#endregion
|
|
1552
1605
|
//#region ../../../packages/runtime-contracts/dist/workspace-image-types.d.ts
|
|
1553
1606
|
/** A port declared by the published OCI image. */
|
|
1554
1607
|
interface WorkspaceImageExposedPort {
|
|
@@ -1572,55 +1625,142 @@ interface WorkspaceImagePublishResult {
|
|
|
1572
1625
|
exposedPorts: WorkspaceImageExposedPort[];
|
|
1573
1626
|
}
|
|
1574
1627
|
//#endregion
|
|
1575
|
-
//#region
|
|
1576
|
-
|
|
1577
|
-
|
|
1628
|
+
//#region ../../../packages/runtime-contracts/dist/workspace-image.d.ts
|
|
1629
|
+
declare const workspaceImagePublishInputSchema: z.ZodObject<{
|
|
1630
|
+
contextPath: z.ZodDefault<z.ZodString>;
|
|
1631
|
+
dockerfilePath: z.ZodDefault<z.ZodString>;
|
|
1632
|
+
repository: z.ZodString;
|
|
1633
|
+
auth: z.ZodObject<{
|
|
1634
|
+
username: z.ZodString;
|
|
1635
|
+
password: z.ZodString;
|
|
1636
|
+
}, z.core.$strict>;
|
|
1637
|
+
platform: z.ZodOptional<z.ZodEnum<{
|
|
1638
|
+
"linux/amd64": "linux/amd64";
|
|
1639
|
+
"linux/arm64": "linux/arm64";
|
|
1640
|
+
}>>;
|
|
1641
|
+
}, z.core.$strict>;
|
|
1642
|
+
type WorkspaceImagePublishInput = z.input<typeof workspaceImagePublishInputSchema>;
|
|
1643
|
+
//#endregion
|
|
1644
|
+
//#region ../../../packages/runtime-contracts/dist/gpu-lease.d.ts
|
|
1645
|
+
/**
|
|
1646
|
+
* GPU lease wire vocabulary shared by the orchestrator's GPU lease service and
|
|
1647
|
+
* the sandbox SDK's customer-facing GPU lease types.
|
|
1648
|
+
*/
|
|
1649
|
+
declare const GPU_LEASE_PROVIDER_NAMES: readonly ["runpod", "vast-ai", "lambda-labs", "tensordock", "paperspace", "aws", "gcp", "azure", "crusoe", "fluidstack", "modal"];
|
|
1650
|
+
type GpuLeaseProviderName = (typeof GPU_LEASE_PROVIDER_NAMES)[number];
|
|
1651
|
+
type GpuLeaseStatus = "provisioning" | "ready" | "detaching" | "destroyed" | "failed";
|
|
1578
1652
|
/**
|
|
1579
|
-
*
|
|
1653
|
+
* Whether a deployment can place a GPU lease on a provider right now.
|
|
1654
|
+
*
|
|
1655
|
+
* - `ready`: configured, and the provider accepted the credential just now.
|
|
1656
|
+
* - `credential-invalid`: configured, but the provider refused the
|
|
1657
|
+
* credential; it is never selected until the key is rotated.
|
|
1658
|
+
* - `unverified`: configured, but the check could not reach a verdict or the
|
|
1659
|
+
* provider has none.
|
|
1660
|
+
* - `not-configured`: a required orchestrator variable is missing.
|
|
1661
|
+
* - `disabled`: configured but excluded by GPU_LEASE_PROVIDERS.
|
|
1580
1662
|
*
|
|
1581
|
-
*
|
|
1582
|
-
* only when the create identity belonged to the call alone.
|
|
1583
|
-
* - `idempotent_replay`: the platform returned the environment that an earlier
|
|
1584
|
-
* call with the same idempotency key allocated. The call allocated nothing.
|
|
1585
|
-
* - `unknown`: the platform cannot prove either outcome, so another caller can
|
|
1586
|
-
* hold the environment.
|
|
1663
|
+
* Only `ready` and `unverified` providers are ever selected for a lease.
|
|
1587
1664
|
*/
|
|
1588
|
-
type
|
|
1665
|
+
type GpuLeaseProviderState = "ready" | "credential-invalid" | "unverified" | "not-configured" | "disabled";
|
|
1666
|
+
type GpuLeaseProviderCredentialCheck = {
|
|
1667
|
+
verdict: "working" | "rejected" | "absent" | "indeterminate"; /** Operator-facing reason; never carries a credential value. */
|
|
1668
|
+
detail: string;
|
|
1669
|
+
checkedAt: string;
|
|
1670
|
+
latencyMs: number;
|
|
1671
|
+
};
|
|
1672
|
+
/** One provider's answer to "can this deployment lease from you right now?". */
|
|
1673
|
+
type GpuLeaseProviderStatus = {
|
|
1674
|
+
provider: GpuLeaseProviderName;
|
|
1675
|
+
state: GpuLeaseProviderState; /** Orchestrator environment variables the provider needs (`A|B`: either). */
|
|
1676
|
+
envVars: string[]; /** Where an operator creates the credential. */
|
|
1677
|
+
keyUrl?: string;
|
|
1678
|
+
credential?: GpuLeaseProviderCredentialCheck; /** Price of the requested accelerator on this provider, per hour. */
|
|
1679
|
+
estimate?: {
|
|
1680
|
+
providerInstanceType?: string;
|
|
1681
|
+
region?: string;
|
|
1682
|
+
pricingSource?: "live" | "configured" | "static";
|
|
1683
|
+
providerCostPerHourUsd: number;
|
|
1684
|
+
customerPricePerHourUsd: number;
|
|
1685
|
+
}; /** Why no price could be quoted, e.g. the provider has no such GPU. */
|
|
1686
|
+
estimateError?: string;
|
|
1687
|
+
};
|
|
1688
|
+
//#endregion
|
|
1689
|
+
//#region ../../../packages/runtime-contracts/dist/provision-status.d.ts
|
|
1690
|
+
/** Status of one provisioning step, shared by the orchestrator and SDK clients. */
|
|
1691
|
+
type ProvisionStatus = "started" | "progress" | "completed" | "skipped" | "error";
|
|
1692
|
+
//#endregion
|
|
1693
|
+
//#region ../../../packages/runtime-contracts/dist/rollout.d.ts
|
|
1694
|
+
/** Speculative rollout wire shapes shared by the orchestrator and the SDK. */
|
|
1589
1695
|
/**
|
|
1590
|
-
*
|
|
1696
|
+
* One message part of the agent turn sent to every rollout child.
|
|
1697
|
+
* `type` selects the part kind (e.g. `"text"`); the remaining fields are
|
|
1698
|
+
* validated structurally by the child's agent runtime.
|
|
1699
|
+
*/
|
|
1700
|
+
type RolloutTurnPart = {
|
|
1701
|
+
type: string;
|
|
1702
|
+
} & Record<string, unknown>;
|
|
1703
|
+
/**
|
|
1704
|
+
* How each rollout child is scored after its turn completes.
|
|
1591
1705
|
*
|
|
1592
|
-
*
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1706
|
+
* `command` runs inside the child's sandbox: exit 0 passes and stdout is
|
|
1707
|
+
* parsed as the numeric score (highest score wins). A non-zero exit records
|
|
1708
|
+
* the exit code with no score; exit 0 with non-numeric stdout is reported as
|
|
1709
|
+
* a per-child error rather than silently ranking score-less.
|
|
1710
|
+
*/
|
|
1711
|
+
type RolloutScorer = {
|
|
1712
|
+
type: "none";
|
|
1713
|
+
} | {
|
|
1714
|
+
type: "command";
|
|
1715
|
+
command: string;
|
|
1716
|
+
};
|
|
1717
|
+
/**
|
|
1718
|
+
* Rollout lifecycle. `partial` means some children produced results while
|
|
1719
|
+
* others failed or timed out — failed children appear as error entries,
|
|
1720
|
+
* never dropped.
|
|
1721
|
+
*/
|
|
1722
|
+
type RolloutStatus = "running" | "completed" | "partial" | "failed";
|
|
1723
|
+
/** One child's outcome inside a rollout. */
|
|
1724
|
+
interface RolloutChildResult {
|
|
1725
|
+
/** The child sandbox id — a first-class sandbox the caller may keep. */
|
|
1726
|
+
sandboxId: string;
|
|
1727
|
+
/** Final assistant text of the turn. Absent when the turn failed. */
|
|
1728
|
+
output?: string;
|
|
1729
|
+
/** Why this child produced no usable result (turn failure or timeout). */
|
|
1730
|
+
error?: string;
|
|
1731
|
+
/** Scorer command exit code. Present only when the scorer ran. */
|
|
1732
|
+
exitCode?: number;
|
|
1733
|
+
/** Parsed scorer stdout. Present only when the scorer exited 0 with a number. */
|
|
1734
|
+
score?: number;
|
|
1735
|
+
/** Wall-clock duration of this child's turn (and scorer) in ms. */
|
|
1736
|
+
durationMs: number;
|
|
1622
1737
|
}
|
|
1623
1738
|
//#endregion
|
|
1739
|
+
//#region ../../../packages/runtime-contracts/dist/secret-info.d.ts
|
|
1740
|
+
/** Secret metadata returned by the secrets API (never the value). */
|
|
1741
|
+
interface SecretInfo {
|
|
1742
|
+
/** Secret name (e.g., HF_TOKEN, AWS_ACCESS_KEY) */
|
|
1743
|
+
name: string;
|
|
1744
|
+
/** When the secret was created */
|
|
1745
|
+
createdAt: Date;
|
|
1746
|
+
/** When the secret was last updated */
|
|
1747
|
+
updatedAt: Date;
|
|
1748
|
+
}
|
|
1749
|
+
//#endregion
|
|
1750
|
+
//#region ../../../packages/runtime-contracts/dist/router-model-search.d.ts
|
|
1751
|
+
/**
|
|
1752
|
+
* Tangle Router provider routing for every model call of the box, sent as
|
|
1753
|
+
* `providerOptions.gateway.{only, allowFallbacks, requireModel}`: the Router's
|
|
1754
|
+
* own option names (tangle-router lib/gateway-options.ts and
|
|
1755
|
+
* lib/model-substitution.ts). `only` names Router provider ids, e.g. "zai".
|
|
1756
|
+
*/
|
|
1757
|
+
declare const routerRoutingOptionsSchema: z.ZodObject<{
|
|
1758
|
+
only: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1759
|
+
allowFallbacks: z.ZodOptional<z.ZodBoolean>;
|
|
1760
|
+
requireModel: z.ZodOptional<z.ZodBoolean>;
|
|
1761
|
+
}, z.core.$strict>;
|
|
1762
|
+
type RouterRoutingOptions = z.infer<typeof routerRoutingOptionsSchema>;
|
|
1763
|
+
//#endregion
|
|
1624
1764
|
//#region src/types/backend.d.ts
|
|
1625
1765
|
/**
|
|
1626
1766
|
* MCP (Model Context Protocol) server configuration.
|
|
@@ -1639,19 +1779,6 @@ interface McpServerConfig {
|
|
|
1639
1779
|
/** Headers for remote connections */
|
|
1640
1780
|
headers?: Record<string, string>;
|
|
1641
1781
|
}
|
|
1642
|
-
/**
|
|
1643
|
-
* Tangle Router provider routing for every model call of a Router-backed
|
|
1644
|
-
* OpenCode sandbox. Set at creation; the Sandbox API refuses it for any other
|
|
1645
|
-
* harness or endpoint rather than ignoring it.
|
|
1646
|
-
*/
|
|
1647
|
-
interface RouterRoutingOptions {
|
|
1648
|
-
/** Router provider ids the calls may use, e.g. `["zai"]`. */
|
|
1649
|
-
only?: string[];
|
|
1650
|
-
/** `false`: the Router does not fall back to another candidate provider. */
|
|
1651
|
-
allowFallbacks?: boolean;
|
|
1652
|
-
/** `true`: fail rather than substitute another model. */
|
|
1653
|
-
requireModel?: boolean;
|
|
1654
|
-
}
|
|
1655
1782
|
/**
|
|
1656
1783
|
* Nested model routing and auth. The role-named fields on
|
|
1657
1784
|
* {@link BackendConfig} (`modelId`, `provider`, `apiKey`, `baseUrl`, ...)
|
|
@@ -1940,26 +2067,6 @@ interface BackendArtifact {
|
|
|
1940
2067
|
sizeBytes?: number;
|
|
1941
2068
|
updatedAt?: string;
|
|
1942
2069
|
}
|
|
1943
|
-
/** Secret-free model tuple selected by the sandbox runtime. */
|
|
1944
|
-
/**
|
|
1945
|
-
* Which layer supplied the model id that executed. `request` means the model
|
|
1946
|
-
* you sent survived transport; anything else means it did not, and a record
|
|
1947
|
-
* that attributes the turn to your requested model is wrong.
|
|
1948
|
-
*/
|
|
1949
|
-
type EffectiveBackendSource = "request" | "environment" | "profile";
|
|
1950
|
-
interface EffectiveBackendProfile {
|
|
1951
|
-
/** Profile name, when the profile declared one. */
|
|
1952
|
-
name?: string;
|
|
1953
|
-
/** Stable hash of the materialized profile; equal digests ran the same profile. */
|
|
1954
|
-
digest: string;
|
|
1955
|
-
}
|
|
1956
|
-
interface EffectiveBackend {
|
|
1957
|
-
provider?: string;
|
|
1958
|
-
model?: string;
|
|
1959
|
-
source?: EffectiveBackendSource;
|
|
1960
|
-
/** Identity of the agent profile bound to the turn. */
|
|
1961
|
-
profile?: EffectiveBackendProfile;
|
|
1962
|
-
}
|
|
1963
2070
|
//#endregion
|
|
1964
2071
|
//#region src/types/agents.d.ts
|
|
1965
2072
|
/**
|
|
@@ -2489,8 +2596,6 @@ interface EventStreamOptions {
|
|
|
2489
2596
|
}
|
|
2490
2597
|
//#endregion
|
|
2491
2598
|
//#region src/types/batch.d.ts
|
|
2492
|
-
/** A single task in a batch execution. */
|
|
2493
|
-
type BatchTask = BatchTaskInput;
|
|
2494
2599
|
/** Backend configuration accepted by batch execution. */
|
|
2495
2600
|
type BatchBackend = BatchBackendInput;
|
|
2496
2601
|
/** Complete request accepted by `runBatch` and `streamBatch`. */
|
|
@@ -2509,12 +2614,6 @@ interface BatchRunOptions {
|
|
|
2509
2614
|
*/
|
|
2510
2615
|
signal?: AbortSignal;
|
|
2511
2616
|
}
|
|
2512
|
-
/**
|
|
2513
|
-
* Result of a single task in a batch.
|
|
2514
|
-
*/
|
|
2515
|
-
type BatchTaskResult = BatchTaskResult$1;
|
|
2516
|
-
/** Complete validated batch result. */
|
|
2517
|
-
type BatchResult = BatchResult$1;
|
|
2518
2617
|
//#endregion
|
|
2519
2618
|
//#region src/types/branch.d.ts
|
|
2520
2619
|
/**
|
|
@@ -2572,28 +2671,6 @@ interface ForkLookupOptions {
|
|
|
2572
2671
|
env?: Record<string, string>;
|
|
2573
2672
|
metadata?: Record<string, unknown>;
|
|
2574
2673
|
}
|
|
2575
|
-
/**
|
|
2576
|
-
* One message part of the agent turn sent to every rollout child.
|
|
2577
|
-
* `type` selects the part kind (e.g. `"text"`); the remaining fields are
|
|
2578
|
-
* validated structurally by the child's agent runtime.
|
|
2579
|
-
*/
|
|
2580
|
-
type RolloutTurnPart = {
|
|
2581
|
-
type: string;
|
|
2582
|
-
} & Record<string, unknown>;
|
|
2583
|
-
/**
|
|
2584
|
-
* How each rollout child is scored after its turn completes.
|
|
2585
|
-
*
|
|
2586
|
-
* `command` runs inside the child's sandbox: exit 0 passes and stdout is
|
|
2587
|
-
* parsed as the numeric score (highest score wins). A non-zero exit records
|
|
2588
|
-
* the exit code with no score; exit 0 with non-numeric stdout is reported as
|
|
2589
|
-
* a per-child error rather than silently ranking score-less.
|
|
2590
|
-
*/
|
|
2591
|
-
type RolloutScorer = {
|
|
2592
|
-
type: "none";
|
|
2593
|
-
} | {
|
|
2594
|
-
type: "command";
|
|
2595
|
-
command: string;
|
|
2596
|
-
};
|
|
2597
2674
|
/**
|
|
2598
2675
|
* Options for {@link SandboxInstance.rollout} — speculative rollouts.
|
|
2599
2676
|
*/
|
|
@@ -2605,27 +2682,6 @@ interface RolloutOptions {
|
|
|
2605
2682
|
/** Optional per-child scorer. Defaults to no scoring. */
|
|
2606
2683
|
scorer?: RolloutScorer;
|
|
2607
2684
|
}
|
|
2608
|
-
/**
|
|
2609
|
-
* Rollout lifecycle. `partial` means some children produced results while
|
|
2610
|
-
* others failed or timed out — failed children appear as error entries,
|
|
2611
|
-
* never dropped.
|
|
2612
|
-
*/
|
|
2613
|
-
type RolloutStatus = "running" | "completed" | "partial" | "failed";
|
|
2614
|
-
/** One child's outcome inside a rollout. */
|
|
2615
|
-
interface RolloutChildResult {
|
|
2616
|
-
/** The child sandbox id — a first-class sandbox the caller may keep. */
|
|
2617
|
-
sandboxId: string;
|
|
2618
|
-
/** Final assistant text of the turn. Absent when the turn failed. */
|
|
2619
|
-
output?: string;
|
|
2620
|
-
/** Why this child produced no usable result (turn failure or timeout). */
|
|
2621
|
-
error?: string;
|
|
2622
|
-
/** Scorer command exit code. Present only when the scorer ran. */
|
|
2623
|
-
exitCode?: number;
|
|
2624
|
-
/** Parsed scorer stdout. Present only when the scorer exited 0 with a number. */
|
|
2625
|
-
score?: number;
|
|
2626
|
-
/** Wall-clock duration of this child's turn (and scorer) in ms. */
|
|
2627
|
-
durationMs: number;
|
|
2628
|
-
}
|
|
2629
2685
|
/**
|
|
2630
2686
|
* Immediate response of `POST /v1/sandboxes/{id}/rollouts`: the children
|
|
2631
2687
|
* exist and their turns are running. Poll {@link SandboxInstance.getRollout}
|
|
@@ -2736,8 +2792,6 @@ type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
|
2736
2792
|
};
|
|
2737
2793
|
//#endregion
|
|
2738
2794
|
//#region src/types/code-execution.d.ts
|
|
2739
|
-
/** Languages supported by the persistent code kernel. */
|
|
2740
|
-
type CodeLanguage = "python" | "node" | "typescript" | "bash";
|
|
2741
2795
|
/**
|
|
2742
2796
|
* One structured result produced by a runCode() call. The kernel emits these
|
|
2743
2797
|
* alongside stdout — matplotlib figures arrive as `image`, pandas DataFrames
|
|
@@ -2901,43 +2955,6 @@ interface SandboxAccelerator {
|
|
|
2901
2955
|
/** Minimum device memory in megabytes when the exact GPU class is flexible. */
|
|
2902
2956
|
memoryMB?: number;
|
|
2903
2957
|
}
|
|
2904
|
-
declare const GPU_LEASE_PROVIDER_NAMES: readonly ["runpod", "vast-ai", "lambda-labs", "tensordock", "paperspace", "aws", "gcp", "azure", "crusoe", "fluidstack", "modal"];
|
|
2905
|
-
type GpuLeaseProviderName = (typeof GPU_LEASE_PROVIDER_NAMES)[number];
|
|
2906
|
-
/**
|
|
2907
|
-
* Whether a deployment can place a GPU lease on a provider right now.
|
|
2908
|
-
*
|
|
2909
|
-
* - `ready`: configured, and the provider accepted the credential just now.
|
|
2910
|
-
* - `credential-invalid`: configured, but the provider refused the
|
|
2911
|
-
* credential; it is never selected until the key is rotated.
|
|
2912
|
-
* - `unverified`: configured, but the check could not reach a verdict.
|
|
2913
|
-
* - `not-configured`: a required orchestrator variable is missing.
|
|
2914
|
-
* - `disabled`: configured but excluded by GPU_LEASE_PROVIDERS.
|
|
2915
|
-
*/
|
|
2916
|
-
type GpuLeaseProviderState = "ready" | "credential-invalid" | "unverified" | "not-configured" | "disabled";
|
|
2917
|
-
interface GpuLeaseProviderStatus {
|
|
2918
|
-
provider: GpuLeaseProviderName;
|
|
2919
|
-
state: GpuLeaseProviderState;
|
|
2920
|
-
/** Orchestrator environment variables the provider needs (`A|B`: either). */
|
|
2921
|
-
envVars: string[];
|
|
2922
|
-
/** Where an operator creates the credential. */
|
|
2923
|
-
keyUrl?: string;
|
|
2924
|
-
credential?: {
|
|
2925
|
-
verdict: "working" | "rejected" | "absent" | "indeterminate"; /** Operator-facing reason; never carries a credential value. */
|
|
2926
|
-
detail: string;
|
|
2927
|
-
checkedAt: string;
|
|
2928
|
-
latencyMs: number;
|
|
2929
|
-
};
|
|
2930
|
-
/** Price of the requested accelerator on this provider, per hour. */
|
|
2931
|
-
estimate?: {
|
|
2932
|
-
providerInstanceType?: string;
|
|
2933
|
-
region?: string;
|
|
2934
|
-
pricingSource?: "live" | "configured" | "static";
|
|
2935
|
-
providerCostPerHourUsd: number;
|
|
2936
|
-
customerPricePerHourUsd: number;
|
|
2937
|
-
};
|
|
2938
|
-
/** Why no price could be quoted, e.g. the provider has no such GPU. */
|
|
2939
|
-
estimateError?: string;
|
|
2940
|
-
}
|
|
2941
2958
|
interface GpuLeaseProvidersOptions {
|
|
2942
2959
|
/** Quote a price for this accelerator kind, e.g. `nvidia-h100`. */
|
|
2943
2960
|
accelerator?: SandboxAccelerator;
|
|
@@ -2971,7 +2988,6 @@ interface GpuLeaseProviderSelection {
|
|
|
2971
2988
|
error: string;
|
|
2972
2989
|
}>;
|
|
2973
2990
|
}
|
|
2974
|
-
type GpuLeaseStatus = "provisioning" | "ready" | "detaching" | "destroyed" | "failed";
|
|
2975
2991
|
interface GpuLeaseBilling {
|
|
2976
2992
|
seconds: number;
|
|
2977
2993
|
providerCostUsd: number;
|
|
@@ -4115,49 +4131,84 @@ interface GitConfig {
|
|
|
4115
4131
|
auth?: GitAuth;
|
|
4116
4132
|
}
|
|
4117
4133
|
//#endregion
|
|
4118
|
-
//#region
|
|
4134
|
+
//#region ../../../packages/runtime-contracts/dist/egress-activity.d.ts
|
|
4119
4135
|
/**
|
|
4120
|
-
*
|
|
4136
|
+
* The egress activity record a sandbox's proxy log is read into, shared by the
|
|
4137
|
+
* host-agent parser, the orchestrator and both client SDKs. Pure types and
|
|
4138
|
+
* constants: it imports no Node module, so a Worker bundle can use it.
|
|
4139
|
+
*/
|
|
4140
|
+
/**
|
|
4141
|
+
* Most distinct hosts a denial read may return.
|
|
4121
4142
|
*
|
|
4122
|
-
*
|
|
4123
|
-
*
|
|
4124
|
-
*
|
|
4125
|
-
|
|
4143
|
+
* The host-agent is the canonical clamp: it owns the log read, so a request
|
|
4144
|
+
* that reaches it can never pull an unbounded slice regardless of which caller
|
|
4145
|
+
* asked.
|
|
4146
|
+
*/
|
|
4147
|
+
declare const MAX_EGRESS_DENIALS_LIMIT = 50;
|
|
4148
|
+
/** One destination a sandbox tried to reach and was refused. */
|
|
4149
|
+
interface EgressDenial {
|
|
4150
|
+
/** Destination host (no port), e.g. "google.com". */
|
|
4151
|
+
host: string;
|
|
4152
|
+
/** Which proxy transform refused it, e.g. "allowlist". */
|
|
4153
|
+
rejectedBy: string;
|
|
4154
|
+
/** How many times this host was refused in the inspected window. */
|
|
4155
|
+
count: number;
|
|
4156
|
+
/** ISO timestamp of the most recent refusal, when the line carried one. */
|
|
4157
|
+
lastAt?: string;
|
|
4158
|
+
}
|
|
4159
|
+
/** Whether the proxy allowed or refused a request. */
|
|
4160
|
+
type EgressAction = "allow" | "reject";
|
|
4161
|
+
/** One destination a sandbox reached, or was refused, in the inspected window. */
|
|
4162
|
+
interface EgressDestination {
|
|
4163
|
+
/** Destination host, port removed, e.g. "api.openai.com". */
|
|
4164
|
+
host: string;
|
|
4165
|
+
action: EgressAction;
|
|
4166
|
+
/** Requests to this host with this action, inside the inspected window. */
|
|
4167
|
+
count: number;
|
|
4168
|
+
/** ISO timestamp of the earliest such request the window carried. */
|
|
4169
|
+
firstAt?: string;
|
|
4170
|
+
/** ISO timestamp of the latest such request the window carried. */
|
|
4171
|
+
lastAt?: string;
|
|
4172
|
+
/** Which proxy transform refused it. Only set when `action` is "reject". */
|
|
4173
|
+
rejectedBy?: string;
|
|
4174
|
+
}
|
|
4175
|
+
/**
|
|
4176
|
+
* Why a record cannot support a claim that a sandbox reached nothing.
|
|
4126
4177
|
*
|
|
4127
|
-
*
|
|
4128
|
-
*
|
|
4129
|
-
|
|
4130
|
-
|
|
4178
|
+
* Each value names something the record is missing, so a caller can report the
|
|
4179
|
+
* specific gap instead of a bare "unknown".
|
|
4180
|
+
*/
|
|
4181
|
+
declare const EGRESS_INCOMPLETE_REASONS: readonly ["window-truncated", "unparsed-lines", "host-limit-reached", "log-unreadable", "hop-unreachable"];
|
|
4182
|
+
/**
|
|
4183
|
+
* Why a record cannot support a claim that a sandbox reached nothing.
|
|
4131
4184
|
*
|
|
4132
|
-
*
|
|
4133
|
-
*
|
|
4134
|
-
*
|
|
4135
|
-
*
|
|
4185
|
+
* Derived from the tuple above rather than written twice, so the vocabulary is
|
|
4186
|
+
* a value a caller can enumerate — a hop's wire schema, or a contract test that
|
|
4187
|
+
* has to populate every member, needs the list at runtime and must not restate
|
|
4188
|
+
* it.
|
|
4136
4189
|
*/
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
/**
|
|
4147
|
-
* @deprecated Not enforceable and rejected with a 409. Egress enforcement
|
|
4148
|
-
* allowlists domains, not CIDRs, so there is no destination-IP filter to
|
|
4149
|
-
* apply. Use `box.egress.update({ mode: "strict", allowDomains: [...] })`.
|
|
4150
|
-
*/
|
|
4151
|
-
allowList?: string[];
|
|
4190
|
+
type EgressIncompleteReason = (typeof EGRESS_INCOMPLETE_REASONS)[number];
|
|
4191
|
+
/** What a sandbox reached in one inspected window, and whether that is decidable. */
|
|
4192
|
+
interface EgressActivityRecord {
|
|
4193
|
+
/** Every distinct host/action pair observed, allowed and refused alike. */
|
|
4194
|
+
destinations: EgressDestination[];
|
|
4195
|
+
/** Audit lines successfully interpreted as a request. */
|
|
4196
|
+
requestsObserved: number;
|
|
4197
|
+
/** Lines that looked like audit output but could not be interpreted. */
|
|
4198
|
+
unparsedLines: number;
|
|
4152
4199
|
/**
|
|
4153
|
-
*
|
|
4200
|
+
* Whether this record can carry a NEGATIVE claim.
|
|
4154
4201
|
*
|
|
4155
|
-
*
|
|
4156
|
-
*
|
|
4157
|
-
*
|
|
4202
|
+
* True only when the caller attested a whole window, every line parsed, and
|
|
4203
|
+
* no host was dropped for the limit. Fail-closed: any doubt makes it false,
|
|
4204
|
+
* so `destinations: []` is never mistaken for proof by default.
|
|
4158
4205
|
*/
|
|
4159
|
-
|
|
4206
|
+
complete: boolean;
|
|
4207
|
+
/** Empty exactly when `complete` is true. */
|
|
4208
|
+
incompleteReasons: EgressIncompleteReason[];
|
|
4160
4209
|
}
|
|
4210
|
+
//#endregion
|
|
4211
|
+
//#region ../../../packages/runtime-contracts/dist/egress-policy.d.ts
|
|
4161
4212
|
/**
|
|
4162
4213
|
* Egress firewall policy for controlling outbound internet access.
|
|
4163
4214
|
*
|
|
@@ -4208,66 +4259,49 @@ interface EgressPolicy {
|
|
|
4208
4259
|
*/
|
|
4209
4260
|
includeImplicitDomains?: boolean;
|
|
4210
4261
|
}
|
|
4262
|
+
//#endregion
|
|
4263
|
+
//#region src/types/network.d.ts
|
|
4211
4264
|
/**
|
|
4212
|
-
*
|
|
4213
|
-
*/
|
|
4214
|
-
interface EgressDenial {
|
|
4215
|
-
/** Destination host the sandbox tried to reach. */
|
|
4216
|
-
host: string;
|
|
4217
|
-
/** Which rule refused it — the policy layer that produced the denial. */
|
|
4218
|
-
rejectedBy: string;
|
|
4219
|
-
/** How many times this host was refused. */
|
|
4220
|
-
count: number;
|
|
4221
|
-
/** ISO-8601 time of the most recent refusal, when the proxy recorded one. */
|
|
4222
|
-
lastAt?: string;
|
|
4223
|
-
}
|
|
4224
|
-
/** Largest `limit` the denials route accepts; it rejects anything above. */
|
|
4225
|
-
declare const MAX_EGRESS_DENIALS_LIMIT = 50;
|
|
4226
|
-
/** Whether the egress proxy allowed or refused a request. */
|
|
4227
|
-
type EgressAction = "allow" | "reject";
|
|
4228
|
-
/** One destination a sandbox reached, or was refused, in the inspected window. */
|
|
4229
|
-
interface EgressDestination {
|
|
4230
|
-
/** Destination host, port removed, e.g. "api.openai.com". */
|
|
4231
|
-
host: string;
|
|
4232
|
-
action: EgressAction;
|
|
4233
|
-
/** Requests to this host with this action, inside the inspected window. */
|
|
4234
|
-
count: number;
|
|
4235
|
-
/** ISO-8601 time of the earliest such request the window carried. */
|
|
4236
|
-
firstAt?: string;
|
|
4237
|
-
/** ISO-8601 time of the latest such request the window carried. */
|
|
4238
|
-
lastAt?: string;
|
|
4239
|
-
/** Which proxy transform refused it. Only set when `action` is "reject". */
|
|
4240
|
-
rejectedBy?: string;
|
|
4241
|
-
}
|
|
4242
|
-
/**
|
|
4243
|
-
* Why an activity record cannot support a claim that a sandbox reached nothing.
|
|
4265
|
+
* Runtime network state for a sandbox.
|
|
4244
4266
|
*
|
|
4245
|
-
* `
|
|
4246
|
-
*
|
|
4247
|
-
*
|
|
4248
|
-
*
|
|
4249
|
-
*/
|
|
4250
|
-
type EgressIncompleteReason = "window-truncated" | "unparsed-lines" | "host-limit-reached" | "log-unreadable" | "hop-unreachable";
|
|
4251
|
-
/**
|
|
4252
|
-
* What a sandbox reached in one inspected window, and whether that is decidable.
|
|
4267
|
+
* `ports` is the only field the platform reports: it lists ports exposed via
|
|
4268
|
+
* {@link NetworkManager.exposePort}. The outbound-policy fields are retained
|
|
4269
|
+
* for source compatibility and are rejected by the server — see
|
|
4270
|
+
* {@link NetworkManager.update}.
|
|
4253
4271
|
*
|
|
4254
|
-
* Read
|
|
4255
|
-
*
|
|
4256
|
-
*
|
|
4257
|
-
*
|
|
4258
|
-
*
|
|
4272
|
+
* @example Read the exposed ports
|
|
4273
|
+
* ```typescript
|
|
4274
|
+
* const { ports } = await box.network.getConfig();
|
|
4275
|
+
* ```
|
|
4276
|
+
*
|
|
4277
|
+
* @example Restrict outbound traffic (the enforced surface)
|
|
4278
|
+
* ```typescript
|
|
4279
|
+
* await box.egress.update({ mode: "blocked" });
|
|
4280
|
+
* ```
|
|
4259
4281
|
*/
|
|
4260
|
-
interface
|
|
4261
|
-
/**
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
/**
|
|
4270
|
-
|
|
4282
|
+
interface NetworkConfig {
|
|
4283
|
+
/**
|
|
4284
|
+
* @deprecated Not enforceable and rejected with a 409. No driver applies
|
|
4285
|
+
* per-sandbox outbound rules: sandboxes are never granted NET_ADMIN, and a
|
|
4286
|
+
* rule set written inside a sandbox could be flushed by the code it is
|
|
4287
|
+
* meant to constrain. Block all outbound traffic with
|
|
4288
|
+
* `box.egress.update({ mode: "blocked" })`.
|
|
4289
|
+
*/
|
|
4290
|
+
blockOutbound?: boolean;
|
|
4291
|
+
/**
|
|
4292
|
+
* @deprecated Not enforceable and rejected with a 409. Egress enforcement
|
|
4293
|
+
* allowlists domains, not CIDRs, so there is no destination-IP filter to
|
|
4294
|
+
* apply. Use `box.egress.update({ mode: "strict", allowDomains: [...] })`.
|
|
4295
|
+
*/
|
|
4296
|
+
allowList?: string[];
|
|
4297
|
+
/**
|
|
4298
|
+
* Ports currently exposed for the sandbox.
|
|
4299
|
+
*
|
|
4300
|
+
* Read-only in practice: sending `ports` to `update()` is rejected with a
|
|
4301
|
+
* 409 because it never exposed anything. Expose a port with
|
|
4302
|
+
* {@link NetworkManager.exposePort}.
|
|
4303
|
+
*/
|
|
4304
|
+
ports?: number[];
|
|
4271
4305
|
}
|
|
4272
4306
|
/**
|
|
4273
4307
|
* Egress policy manager for runtime egress configuration.
|
|
@@ -5364,6 +5398,95 @@ interface CreateRequestOptions {
|
|
|
5364
5398
|
signal?: AbortSignal;
|
|
5365
5399
|
}
|
|
5366
5400
|
//#endregion
|
|
5401
|
+
//#region src/terminal-stream.d.ts
|
|
5402
|
+
/**
|
|
5403
|
+
* Client for one terminal WebSocket connection. Construct via
|
|
5404
|
+
* {@link TerminalStream.connect}, which resolves once the server
|
|
5405
|
+
* acknowledges the attach with `ready` (history replay then streams through
|
|
5406
|
+
* `handlers.onData`).
|
|
5407
|
+
*/
|
|
5408
|
+
declare class TerminalStream {
|
|
5409
|
+
#private;
|
|
5410
|
+
private readonly ws;
|
|
5411
|
+
private readonly interactiveIdentity;
|
|
5412
|
+
private readonly handlers;
|
|
5413
|
+
private readonly attachTraceId;
|
|
5414
|
+
private readonly initOnUpgrade;
|
|
5415
|
+
private readonly dialStartedAt;
|
|
5416
|
+
private openedAt;
|
|
5417
|
+
private readyAt;
|
|
5418
|
+
private firstByteAt;
|
|
5419
|
+
private firstWriteAt;
|
|
5420
|
+
private echoRttMs;
|
|
5421
|
+
private readyInfo;
|
|
5422
|
+
private closed;
|
|
5423
|
+
private closeWaiters;
|
|
5424
|
+
private readonly textDecoder;
|
|
5425
|
+
private reconnectInFlight?;
|
|
5426
|
+
/**
|
|
5427
|
+
* Dial the endpoint, send `init` as the first frame, and resolve once the
|
|
5428
|
+
* server responds `ready`. Rejects on a protocol `error` frame, a socket
|
|
5429
|
+
* close/failure before `ready`, or the connect timeout — always with the
|
|
5430
|
+
* reason the server gave. A token PROVIDER is awaited here, before the
|
|
5431
|
+
* socket opens, so every dial (first connect and each reconnect) carries a
|
|
5432
|
+
* fresh credential.
|
|
5433
|
+
*/
|
|
5434
|
+
static connect(options: TerminalStreamOptions): Promise<TerminalStream>;
|
|
5435
|
+
private constructor();
|
|
5436
|
+
private establish;
|
|
5437
|
+
private handleMessage;
|
|
5438
|
+
/** PTY connection id this stream is attached to. */
|
|
5439
|
+
get connectionId(): string;
|
|
5440
|
+
/** The server's `ready` acknowledgement. Set once `connect()` resolves. */
|
|
5441
|
+
get ready(): TerminalReadyInfo;
|
|
5442
|
+
/** Correlation id of this attach (`x-tangle-trace-id` / `traceId`). */
|
|
5443
|
+
get traceId(): string;
|
|
5444
|
+
/**
|
|
5445
|
+
* Timings of this attach. `firstByteMs` and `echoRttMs` appear once the
|
|
5446
|
+
* stream has produced the output they measure.
|
|
5447
|
+
*/
|
|
5448
|
+
get timings(): TerminalAttachTimings;
|
|
5449
|
+
/** Stamp the first output byte after `ready`, and the first one after the first write. */
|
|
5450
|
+
private noteOutput;
|
|
5451
|
+
/** True while the socket is open. */
|
|
5452
|
+
get isOpen(): boolean;
|
|
5453
|
+
/**
|
|
5454
|
+
* Send input keystrokes to the PTY. `Uint8Array` input is decoded as
|
|
5455
|
+
* UTF-8 (the wire protocol carries input as JSON text). Input larger than
|
|
5456
|
+
* the server's 1 MiB frame cap is split across multiple `input` frames in
|
|
5457
|
+
* order on the same socket, so delivery order is preserved.
|
|
5458
|
+
*/
|
|
5459
|
+
write(data: string | Uint8Array): void;
|
|
5460
|
+
/** Resize the PTY. */
|
|
5461
|
+
resize(cols: number, rows: number): void;
|
|
5462
|
+
/**
|
|
5463
|
+
* Detach cleanly: close the socket and resolve once the close completes.
|
|
5464
|
+
* The PTY survives server-side for `ready.detachTimeoutMs` (5 minutes
|
|
5465
|
+
* today) — reattach within that window via {@link reconnect} (or a fresh
|
|
5466
|
+
* `connect()` with the same connectionId) to replay history and continue.
|
|
5467
|
+
*/
|
|
5468
|
+
close(): Promise<void>;
|
|
5469
|
+
/**
|
|
5470
|
+
* Re-dial the same endpoint with the same connectionId on a fresh socket
|
|
5471
|
+
* — the server reattaches the PTY and replays its buffered history. When
|
|
5472
|
+
* the stream was constructed with a token PROVIDER, it is re-invoked for
|
|
5473
|
+
* the new dial (scoped terminal tokens expire within minutes, so the
|
|
5474
|
+
* original credential may be dead by reconnect time); with a plain string
|
|
5475
|
+
* token, pass a fresh `token` override yourself when it may have expired.
|
|
5476
|
+
* `handlers` rebinds callbacks for the new stream.
|
|
5477
|
+
*/
|
|
5478
|
+
reconnect(overrides?: {
|
|
5479
|
+
token?: TerminalStreamToken;
|
|
5480
|
+
handlers?: TerminalStreamHandlers;
|
|
5481
|
+
cols?: number;
|
|
5482
|
+
rows?: number;
|
|
5483
|
+
signal?: AbortSignal;
|
|
5484
|
+
}): Promise<TerminalStream>;
|
|
5485
|
+
private reconnectOnce;
|
|
5486
|
+
private handlersForReconnect;
|
|
5487
|
+
private assertOpen;
|
|
5488
|
+
}
|
|
5489
|
+
//#endregion
|
|
5367
5490
|
//#region src/types/sandbox-info.d.ts
|
|
5368
5491
|
/**
|
|
5369
5492
|
* SSH connection credentials.
|
|
@@ -5500,6 +5623,14 @@ interface SandboxInfo {
|
|
|
5500
5623
|
startedAt?: Date;
|
|
5501
5624
|
/** Last activity timestamp */
|
|
5502
5625
|
lastActivityAt?: Date;
|
|
5626
|
+
/**
|
|
5627
|
+
* Under `status: "stopped"`: `suspending` while the stop's final snapshot is
|
|
5628
|
+
* still being committed, `suspended` once it is. Absent otherwise, and from
|
|
5629
|
+
* an API that predates the field.
|
|
5630
|
+
*/
|
|
5631
|
+
lifecycleState?: "suspending" | "suspended";
|
|
5632
|
+
/** When the sandbox entered its current stop. */
|
|
5633
|
+
suspendedAt?: Date;
|
|
5503
5634
|
/** When the sandbox will expire */
|
|
5504
5635
|
expiresAt?: Date;
|
|
5505
5636
|
/** Error message if status is 'failed' */
|
|
@@ -6412,10 +6543,6 @@ interface ListSandboxFleetOptions extends ListSandboxOptions {
|
|
|
6412
6543
|
}
|
|
6413
6544
|
//#endregion
|
|
6414
6545
|
//#region src/types/sessions.d.ts
|
|
6415
|
-
/**
|
|
6416
|
-
* Lifecycle state of an agent session inside a sandbox.
|
|
6417
|
-
*/
|
|
6418
|
-
type SessionStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
6419
6546
|
/** Lifecycle state of an execution retained in the session replay ledger. */
|
|
6420
6547
|
type SessionExecutionStatus = "active" | "completed" | "failed" | "cancelled";
|
|
6421
6548
|
/**
|
|
@@ -7437,40 +7564,6 @@ interface ExactProcessSpawnOptions extends ProcessSpawnOptions {
|
|
|
7437
7564
|
*/
|
|
7438
7565
|
retentionMs?: number;
|
|
7439
7566
|
}
|
|
7440
|
-
/** Select retained process records by their exact-process launch identity. */
|
|
7441
|
-
interface ProcessListOptions {
|
|
7442
|
-
idempotencyKey?: string;
|
|
7443
|
-
}
|
|
7444
|
-
/**
|
|
7445
|
-
* Status of a spawned process.
|
|
7446
|
-
*/
|
|
7447
|
-
interface ProcessStatus {
|
|
7448
|
-
/** Process ID */
|
|
7449
|
-
pid: number;
|
|
7450
|
-
/** Opaque exact-process launch identity when one was supplied. */
|
|
7451
|
-
idempotencyKey?: string;
|
|
7452
|
-
/** Command that was executed */
|
|
7453
|
-
command: string;
|
|
7454
|
-
/** Working directory */
|
|
7455
|
-
cwd?: string;
|
|
7456
|
-
/** Whether the process is still running */
|
|
7457
|
-
running: boolean;
|
|
7458
|
-
/** Exit code (-1 if still running) */
|
|
7459
|
-
exitCode: number;
|
|
7460
|
-
/** Signal that killed the process (if any) */
|
|
7461
|
-
exitSignal?: string;
|
|
7462
|
-
/** When the process started */
|
|
7463
|
-
startedAt: Date;
|
|
7464
|
-
/** When the process exited (if exited) */
|
|
7465
|
-
exitedAt?: Date;
|
|
7466
|
-
}
|
|
7467
|
-
/**
|
|
7468
|
-
* Full process information including environment.
|
|
7469
|
-
*/
|
|
7470
|
-
interface ProcessInfo extends ProcessStatus {
|
|
7471
|
-
/** Environment variables used */
|
|
7472
|
-
env?: Record<string, string>;
|
|
7473
|
-
}
|
|
7474
7567
|
/** A development server started and tracked by the sandbox runtime. */
|
|
7475
7568
|
interface DevServerInfo {
|
|
7476
7569
|
/** Supervisor process ID. */
|
|
@@ -7660,10 +7753,6 @@ interface ProcessManager {
|
|
|
7660
7753
|
* Provisioning step identifier for progress reporting.
|
|
7661
7754
|
*/
|
|
7662
7755
|
type ProvisionStep = "match" | "networking" | "git" | "host-select" | "storage" | "image-check" | "image-pull" | "image-build" | "container-create" | "container-start" | "health-check" | "runtime-ready" | "workspace";
|
|
7663
|
-
/**
|
|
7664
|
-
* Status of a provisioning step.
|
|
7665
|
-
*/
|
|
7666
|
-
type ProvisionStatus = "started" | "progress" | "completed" | "skipped" | "error";
|
|
7667
7756
|
/**
|
|
7668
7757
|
* Provisioning progress event emitted during sandbox creation.
|
|
7669
7758
|
*
|
|
@@ -7819,17 +7908,6 @@ interface SubscriptionInfo {
|
|
|
7819
7908
|
}
|
|
7820
7909
|
//#endregion
|
|
7821
7910
|
//#region src/types/secrets.d.ts
|
|
7822
|
-
/**
|
|
7823
|
-
* Information about a stored secret (without the value).
|
|
7824
|
-
*/
|
|
7825
|
-
interface SecretInfo {
|
|
7826
|
-
/** Secret name (e.g., HF_TOKEN, AWS_ACCESS_KEY) */
|
|
7827
|
-
name: string;
|
|
7828
|
-
/** When the secret was created */
|
|
7829
|
-
createdAt: Date;
|
|
7830
|
-
/** When the secret was last updated */
|
|
7831
|
-
updatedAt: Date;
|
|
7832
|
-
}
|
|
7833
7911
|
interface SshKeyInfo {
|
|
7834
7912
|
id: string;
|
|
7835
7913
|
name: string;
|
|
@@ -8252,4 +8330,4 @@ interface InstalledTool {
|
|
|
8252
8330
|
active: boolean;
|
|
8253
8331
|
}
|
|
8254
8332
|
//#endregion
|
|
8255
|
-
export {
|
|
8333
|
+
export { UpdateUserOptions as $, ProcessListOptions as $a, WaitForRolloutOptions as $i, SandboxTerminalAttachOptions as $n, ListOptions as $r, FleetExecDispatchOptions as $t, ResumeOptions as A, BackendCapabilities as Aa, GpuLeaseProvidersOptions as Ai, SandboxFleetPlacement as An, parseBackendType as Ao, EgressDenial as Ar, SessionListOptions as At, ProcessManager as B, RolloutScorer as Ba, ManagedProcessResumeOptions as Bi, SandboxFleetWorkspace as Bn, FileInfo as Br, TurnDriveResult as Bt, StopOptions as C, SandboxIntelligenceEnvelope as Ca, GpuLease as Ci, SandboxFleetMachineMeteredUsage as Cn, BatchSidecarGroup as Co, SandboxRuntimeCapabilities as Cr, SessionEventStreamOptions as Ct, ProvisionEvent as D, SandboxTraceOptions as Da, GpuLeaseExecResult as Di, SandboxFleetManifestMachine as Dn, EffectiveBackend as Do, NetworkManager as Dr, SessionForkOptions as Dt, SshKeysManager as E, SandboxTraceExport as Ea, GpuLeaseExecOptions as Ei, SandboxFleetManifest as En, BackendType as Eo, NetworkConfig as Er, SessionFailureReason as Et, DevServerInfo as F, BackendStatus as Fa, CodeExecutionResult as Fi, SandboxFleetTraceBundle as Fn, ChunkedUploadResult as Fr, TaskSessionChanges as Ft, PreviewLinkWaitOptions as G, GpuLeaseProviderName as Ga, SdkTimingHook as Gi, SSHCommandDescriptor as Gn, FileRenameResult as Gr, FleetAgentId as Gt, ProcessSpawnOptions as H, RolloutTurnPart as Ha, ManagedProcessState as Hi, SandboxFleetWorkspaceRestoreResult as Hn, FileReadBatchResult as Hr, CreateSandboxFleetOptions as Ht, EnsureDevServerOptions as I, McpServerConfig as Ia, CodeResultPart as Ii, SandboxFleetTraceEvent as In, DeleteOptions as Ir, TaskSessionCommitResult as It, BackendManager as J, GpuLeaseStatus as Ja, ForkIdempotency as Ji, SandboxInfo as Jn, FileTreeOptions as Jr, FleetAgentRunStatus as Jt, AccessPolicyRule as K, GpuLeaseProviderState as Ka, BranchOptions as Ki, SSHCredentials as Kn, FileSystem as Kr, FleetAgentPlacement as Kt, ExactProcessSpawnOptions as L, RouterRoutingOptions as La, ManagedProcessJobs as Li, SandboxFleetTraceExport as Ln, DownloadOptions as Lr, TaskSessionFileChange as Lt, SubscriptionInfo as M, BackendInfo as Ma, HostAgentRuntimeBackend as Mi, SandboxFleetProfileRef as Mn, GitAuth as Mr, SessionMessageAdmission as Mt, UsageInfo as N, BackendMcpServerStatus as Na, NonHostAgentDriverConfig as Ni, SandboxFleetSpend as Nn, GitConfig as Nr, SessionMessageInputPart as Nt, ProvisionResult as O, TokenUsage as Oa, GpuLeaseManager as Oi, SandboxFleetOperationsSummary as On, EffectiveBackendProfile as Oo, SandboxEgressUsage as Or, SessionInfo as Ot, WaitForOptions as P, BackendRuntimeConfigUpdate as Pa, CodeExecutionOptions as Pi, SandboxFleetToken as Pn, ChunkedUploadOptions as Pr, SessionResultOptions as Pt, SandboxUser as Q, ProcessInfo as Qa, RolloutStartResult as Qi, SandboxRuntimeHealth as Qn, FileWriteResult as Qr, FleetDispatchStreamOptions as Qt, Process as R, SecretInfo as Ra, ManagedProcessOptions as Ri, SandboxFleetTraceOptions as Rn, DownloadProgress as Rr, TaskSessionInfo as Rt, SnapshotResult as S, SandboxEvent as Sa, DriverType as Si, SandboxFleetMachine as Sn, BatchEventDataMap as So, SandboxResourceUsage as Sr, SessionBackendCredentials as St, SecretsManager as T, SandboxTraceEvent as Ta, GpuLeaseCommandResult as Ti, SandboxFleetMachineSpec as Tn, ALL_BACKEND_TYPES as To, EgressManager as Tr, SessionExecutionStatus as Tt, PreviewLinkInfo as U, ProvisionStatus as Ua, HttpClient as Ui, SandboxFleetWorkspaceSnapshotResult as Un, FileReadError as Ur, CreateSandboxFleetTokenOptions as Ut, ProcessSignal as V, RolloutStatus as Va, ManagedProcessSpec as Vi, SandboxFleetWorkspaceReconcileResult as Vn, FileReadBatchOptions as Vr, AttachSandboxFleetMachineOptions as Vt, PreviewLinkManager as W, GPU_LEASE_PROVIDER_NAMES as Wa, JsonValue as Wi, ListSandboxOptions as Wn, FileReadResult as Wr, CreateSandboxFleetWithCoordinatorOptions as Wt, PermissionLevel as X, WorkspaceImagePublishResult as Xa, Rollout as Xi, SandboxPortPreviewLink as Xn, FileUsageOptions as Xr, FleetDispatchResultBuffer as Xt, DirectoryPermission as Y, WorkspaceImagePublishInput as Ya, ForkLookupOptions as Yi, SandboxPortBinding as Yn, FileTreeResult as Yr, FleetDispatchCancelResult as Yt, PermissionsManager as Z, CodeLanguage as Za, RolloutOptions as Zi, SandboxRunGeneration as Zn, FileUsageResult as Zr, FleetDispatchResultBufferOptions as Zt, SnapshotIdempotency as _, IntelligenceReportSubjectType as _a, AttachGpuLeaseOptions as _i, SandboxFleetDispatchResponse as _n, BatchTaskResult as _o, SandboxShape as _r, ListMessagesOptions as _t, DeleteMatchingSandboxesOptions as a, AgentRunStatus as aa, WriteManyFile as ai, FleetRunOptions as an, RawEvidenceArchiveManifest as ao, StartupDiagnostics as ar, FleetDriveTurnRequest as at, SnapshotProvenance as b, PromptOptions as ba, DriverConfig as bi, SandboxFleetInfo as bn, BatchBackendStats as bo, SandboxStatus as br, SendSessionMessageRequest as bt, SandboxDeleteAcknowledgement as c, DurablePlan as ca, SearchOptions as ci, ReapExpiredSandboxFleetsResult as cn, RawEvidenceBoxDirectoryExport as co, TeeAttestationReport as cr, CompletedTurnPayload as ct, SandboxOperationInfo as d, DurablePlanFollowUpResume as da, PublicTemplateInfo as di, SandboxFleetAgent as dn, RawEvidenceExportOptions as do, TeePublicKeyResponse as dr, ConversationTurnResult as dt, BatchBackend as ea, MkdirOptions as ei, FleetExecDispatchResult as en, ProcessStatus as eo, SandboxTerminalCreateOptions as er, GitBranch as et, SandboxOperationKind as f, DurablePlanSnapshot as fa, PublicTemplateVersionInfo as fi, SandboxFleetAgentSpec as fn, RawEvidenceNativeFile as fo, TerminalStream as fr, CreateSessionOptions as ft, SnapshotDeleteOutcome as g, IntelligenceReportCompareTo as ga, AcceleratorKind as gi, SandboxFleetDispatchFailureClass as gn, BatchResult as go, SandboxResources as gr, DriveTurnOptions as gt, SnapshotDeleteAcknowledgement as h, IntelligenceReportBudget as ha, SandboxEnvironment as hi, SandboxFleetCostEstimate as hn, InteractionResolutionAcknowledgement as ho, SandboxConfig as hr, DispatchedSession as ht, DeleteMatchingSandboxesFilter as i, AgentQuestionRequest as ia, WriteFileOptions as ii, FleetRunEvent as in, NativeStoreHomeCopy as io, SandboxTerminals as ir, FleetDriveTurnOutcome as it, SandboxIdentity as j, BackendConfig as ja, HostAgentDriverConfig as ji, SandboxFleetPolicy as jn, MAX_EGRESS_DENIALS_LIMIT as jr, SessionMessage as jt, ProvisionStep as k, TurnBackendConfig as ka, GpuLeaseProviders as ki, SandboxFleetParent as kn, EffectiveBackendSource as ko, EgressPolicy as kr, SessionInterruptOptions as kt, SandboxDeleteOptions as l, DurablePlanDecisionOptions as la, ExecOptions as li, ReconcileSandboxFleetsOptions as ln, RawEvidenceBoxExportOptions as lo, TeeAttestationResponse as lr, CompletedTurnResult as lt, SandboxRemovalState as m, IntelligenceReport as ma, PublishPublicTemplateVersionOptions as mi, SandboxFleetArtifactSpec as mn, RawEvidenceRecordsFile as mo, CreateSandboxOptions as mr, DispatchPromptOptions as mt, DeleteMatchingSandboxOutcome as n, BatchRunRequest as na, UploadOptions as ni, FleetPromptDispatchOptions as nn, SandboxEnvRecovery as no, SandboxTerminalManager as nr, GitDiff as nt, DeleteMatchingSandboxesResult as o, AgentToolInvocation as oa, WriteManyOptions as oi, ListSandboxFleetOptions as on, RawEvidenceArchiveManifestNative as oo, StartupOperation as or, TokenRefreshHandler as ot, SandboxOperationState as p, EventStreamOptions as pa, PublishPublicTemplateOptions as pi, SandboxFleetArtifact as pn, RawEvidencePayloadFile as po, CreateRequestOptions as pr, CreateTaskSessionOptions as pt, AddUserOptions as q, GpuLeaseProviderStatus as qa, ForkCounts as qi, SandboxConnection as qn, FileTreeFile as qr, FleetAgentResult as qt, DeleteMatchingSandboxResult as r, AgentApprovalRequirement as ra, UploadProgress as ri, FleetPromptDispatchResult as rn, SandboxEnvRecoveryView as ro, SandboxTerminalRequestOptions as rr, GitStatus as rt, RestoreSnapshotOptions as s, CreateIntelligenceReportOptions as sa, SearchMatch as si, ReapExpiredSandboxFleetsOptions as sn, RawEvidenceBoxArchiveManifest as so, TeeAttestationOptions as sr, CommitTaskSessionOptions as st, InstalledTool as t, BatchRunOptions as ta, RenameOptions as ti, FleetMachineId as tn, SessionStatus as to, SandboxTerminalInfo as tr, GitCommit as tt, SandboxDeleteOutcome as u, DurablePlanDecisionResult as ua, ExecResult as ui, ReconcileSandboxFleetsResult as un, RawEvidenceDirectoryExport as uo, TeePublicKey as ur, ConversationTurnOptions as ut, SnapshotInfo as v, IntelligenceReportWindow as va, CreateGpuLeaseOptions as vi, SandboxFleetDriverCapability as vn, BatchTaskInput as vo, SandboxShapePreset as vr, PublicProfileConflict as vt, WorkspaceOperationLookup as w, SandboxTraceBundle as wa, GpuLeaseBilling as wi, SandboxFleetMachineRecord as wn, BatchTaskUsage as wo, StorageConfig as wr, SessionExecutionInfo as wt, SnapshotRemoteSync as x, PromptResult as xa, DriverInfo as xi, SandboxFleetIntelligenceEnvelope as xn, BatchEvent as xo, SecretBinding as xr, SentSessionMessage as xt, SnapshotOptions as y, PromptInputPart as ya, DockerDriverConfig as yi, SandboxFleetDriverTimings as yn, PublicBatchRunRequest as yo, SandboxShapesInfo as yr, SendSessionMessageOptions as yt, ProcessLogEntry as z, RolloutChildResult as za, ManagedProcessRecord as zi, SandboxFleetUsage as zn, DownloadResult as zr, TaskSessionProfile as zt };
|