@tangle-network/sandbox 0.10.5 → 0.11.1-develop.20260717054349.4472dd9
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 +109 -0
- package/dist/agent/index.d.ts +3 -3
- package/dist/{client-Dv93EI90.js → client-1LKomw8A.js} +481 -63
- package/dist/{client-CtdFU_nx.d.ts → client-mpqiRmdi.d.ts} +7 -3
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-QZXrXdIb.js → collaboration-DDnuTcZd.js} +1 -1
- package/dist/core.d.ts +4 -4
- package/dist/core.js +3 -3
- package/dist/{errors-DSz87Rkk.js → errors-Cbs78OlF.js} +6 -6
- package/dist/{errors--P_nbLzM.d.ts → errors-ntvaf0_F.d.ts} +2 -2
- package/dist/{index-DF36P3Ew.d.ts → index-DD8we2b9.d.ts} +2 -2
- package/dist/index.d.ts +32 -17
- package/dist/index.js +10 -286
- package/dist/intelligence/index.js +1 -1
- package/dist/runtime-api-fqaQ3CN2.js +678 -0
- package/dist/runtime.d.ts +49 -6
- package/dist/runtime.js +7 -5
- package/dist/{sandbox-tksuLdrT.d.ts → sandbox-BhbAxbub.d.ts} +36 -12
- package/dist/{sandbox-Vh7Aog8b.js → sandbox-Cf25Dgrc.js} +259 -124
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-Bqbf3dA8.js → tangle-DcGiYTx3.js} +2 -2
- package/dist/{types-BGGfKALh.d.ts → types-Di5KUpoc.d.ts} +180 -42
- package/package.json +4 -3
- package/dist/runtime-api-CvAUrnHc.js +0 -448
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-DD8we2b9.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-DcGiYTx3.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as parseErrorResponse } from "./errors-
|
|
2
|
-
import { t as SandboxInstance } from "./sandbox-
|
|
1
|
+
import { p as parseErrorResponse } from "./errors-Cbs78OlF.js";
|
|
2
|
+
import { t as SandboxInstance } from "./sandbox-Cf25Dgrc.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileConnection, AgentProfileFileMount, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileValidationIssue, AgentProfileValidationResult, AgentSubagentProfile, defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles } from "@tangle-network/agent-interface";
|
|
1
|
+
import { AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileConnection, AgentProfileFileMount, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileSecurityPolicy, AgentProfileValidationIssue, AgentProfileValidationResult, AgentSubagentProfile, Capability, agentProfileSchema, capabilitySchema, defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
2
2
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
@@ -662,6 +662,25 @@ interface CreateSandboxOptions {
|
|
|
662
662
|
* timeout-driven retries.
|
|
663
663
|
*/
|
|
664
664
|
idempotencyKey?: string;
|
|
665
|
+
/**
|
|
666
|
+
* Auto-split inline file mounts out of an inline `backend.profile` object
|
|
667
|
+
* at create time, send the lean profile (mount refs stripped) in the
|
|
668
|
+
* create request, then write the deferred files back once the sandbox is
|
|
669
|
+
* running.
|
|
670
|
+
*
|
|
671
|
+
* When `true` (the default), a profile with sizeable inline mounts (e.g.
|
|
672
|
+
* skills, tool scripts) does not bloat the create POST; the SDK
|
|
673
|
+
* materializes those files via {@link FileSystem.writeMany} /
|
|
674
|
+
* {@link FileSystem.uploadData} after the sandbox reaches `running`. Only
|
|
675
|
+
* applies to an inline `AgentProfile` object on `backend.profile` — a
|
|
676
|
+
* named-profile string is never split, and the deprecated untyped
|
|
677
|
+
* `backend.inlineProfile` passthrough is not split either. Set `false`
|
|
678
|
+
* to send the full profile inline in the create request (no post-create
|
|
679
|
+
* materialization step).
|
|
680
|
+
*
|
|
681
|
+
* @default true
|
|
682
|
+
*/
|
|
683
|
+
autoMaterializeProfileFiles?: boolean;
|
|
665
684
|
}
|
|
666
685
|
/**
|
|
667
686
|
* Per-call overrides for {@link SandboxClient.create}.
|
|
@@ -984,10 +1003,10 @@ interface ExecResult {
|
|
|
984
1003
|
* Options for executing a command.
|
|
985
1004
|
*/
|
|
986
1005
|
interface ExecOptions {
|
|
987
|
-
/** Working directory for the command.
|
|
988
|
-
*
|
|
989
|
-
*
|
|
990
|
-
*
|
|
1006
|
+
/** Working directory for the command. It must resolve within the active
|
|
1007
|
+
* workspace; paths outside that boundary are rejected. When `sessionId`
|
|
1008
|
+
* is set, the runtime resolves the path against that task's isolated
|
|
1009
|
+
* workspace. */
|
|
991
1010
|
cwd?: string;
|
|
992
1011
|
/** Environment variables */
|
|
993
1012
|
env?: Record<string, string>;
|
|
@@ -1139,7 +1158,32 @@ interface InstalledTool {
|
|
|
1139
1158
|
* - `awaiting_question` — the agent asked a question and the turn ended without
|
|
1140
1159
|
* an answer. See {@link AgentQuestionRequest}.
|
|
1141
1160
|
*/
|
|
1142
|
-
type AgentRunStatus = "success" | "failed" | "blocked_on_approval" | "awaiting_question";
|
|
1161
|
+
type AgentRunStatus = "success" | "failed" | "blocked_on_approval" | "awaiting_question" | "awaiting_plan_decision";
|
|
1162
|
+
interface DurablePlanSnapshot {
|
|
1163
|
+
id: string;
|
|
1164
|
+
revision: number;
|
|
1165
|
+
title?: string;
|
|
1166
|
+
body: string;
|
|
1167
|
+
submittedAt: string;
|
|
1168
|
+
}
|
|
1169
|
+
type DurablePlan = DurablePlanSnapshot & ({
|
|
1170
|
+
status: "pending";
|
|
1171
|
+
} | {
|
|
1172
|
+
status: "approved";
|
|
1173
|
+
decidedAt: string;
|
|
1174
|
+
} | {
|
|
1175
|
+
status: "rejected";
|
|
1176
|
+
decidedAt: string;
|
|
1177
|
+
feedback: string;
|
|
1178
|
+
} | {
|
|
1179
|
+
status: "superseded";
|
|
1180
|
+
supersededAt: string;
|
|
1181
|
+
supersededByPlanId: string;
|
|
1182
|
+
} | {
|
|
1183
|
+
status: "withdrawn";
|
|
1184
|
+
withdrawnAt: string;
|
|
1185
|
+
reason: string;
|
|
1186
|
+
});
|
|
1143
1187
|
/**
|
|
1144
1188
|
* A tool the agent invoked during a run. `isError` flags a failed call
|
|
1145
1189
|
* (errored, timed out, or rejected — e.g. a hub approval gate). Failed tools
|
|
@@ -1201,6 +1245,8 @@ interface PromptResult {
|
|
|
1201
1245
|
approval?: AgentApprovalRequirement;
|
|
1202
1246
|
/** Set when `status === "awaiting_question"`. */
|
|
1203
1247
|
question?: AgentQuestionRequest;
|
|
1248
|
+
/** Set when `status === "awaiting_plan_decision"`. */
|
|
1249
|
+
plan?: DurablePlanSnapshot;
|
|
1204
1250
|
/** Trace ID for debugging */
|
|
1205
1251
|
traceId?: string;
|
|
1206
1252
|
/** Duration in milliseconds */
|
|
@@ -1254,18 +1300,19 @@ interface PromptOptions {
|
|
|
1254
1300
|
/** AbortSignal for cancellation */
|
|
1255
1301
|
signal?: AbortSignal;
|
|
1256
1302
|
/**
|
|
1257
|
-
* Stable execution id for
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
*
|
|
1261
|
-
*
|
|
1262
|
-
*
|
|
1303
|
+
* Stable execution id for tracing a first dispatch or selecting an existing
|
|
1304
|
+
* execution for replay. Forwarded as `X-Execution-ID` on a first dispatch.
|
|
1305
|
+
* When combined with `lastEventId`, the SDK replays the existing execution
|
|
1306
|
+
* without sending the prompt again. An execution ID alone does not make a
|
|
1307
|
+
* repeated POST idempotent; use `turnId` for application-level retries.
|
|
1308
|
+
* Omit to let the SDK read the id from `execution.started` for in-call
|
|
1309
|
+
* reconnects.
|
|
1263
1310
|
*/
|
|
1264
1311
|
executionId?: string;
|
|
1265
1312
|
/**
|
|
1266
|
-
* Last event id the caller has already acknowledged.
|
|
1267
|
-
* replays strictly after this id
|
|
1268
|
-
*
|
|
1313
|
+
* Last event id the caller has already acknowledged. Requires `executionId`;
|
|
1314
|
+
* the SDK replays strictly after this id without dispatching a new prompt.
|
|
1315
|
+
* Omit on the first attempt.
|
|
1269
1316
|
*/
|
|
1270
1317
|
lastEventId?: string;
|
|
1271
1318
|
/**
|
|
@@ -1863,6 +1910,9 @@ interface SessionEventStreamOptions {
|
|
|
1863
1910
|
/** Replay starting from this event id (inclusive). Omit to start at
|
|
1864
1911
|
* the live tail. Useful for reconnect-after-disconnect flows. */
|
|
1865
1912
|
since?: string;
|
|
1913
|
+
/** Restrict replay to one execution within the session. Required with
|
|
1914
|
+
* `since` when attaching after a server-dispatched turn has already begun. */
|
|
1915
|
+
executionId?: string;
|
|
1866
1916
|
/** Cancel the stream by aborting this signal. */
|
|
1867
1917
|
signal?: AbortSignal;
|
|
1868
1918
|
}
|
|
@@ -2013,6 +2063,10 @@ type TurnDriveResult = {
|
|
|
2013
2063
|
state: "completed"; /** Final assistant text of the turn. */
|
|
2014
2064
|
text: string; /** The full turn payload (text, toolInvocations, tokenUsage, etc.). */
|
|
2015
2065
|
result: Record<string, unknown>;
|
|
2066
|
+
} | {
|
|
2067
|
+
state: "awaiting_plan_decision";
|
|
2068
|
+
plan: DurablePlanSnapshot;
|
|
2069
|
+
result: Record<string, unknown>;
|
|
2016
2070
|
} | {
|
|
2017
2071
|
state: "running"; /** When the session began executing, if the runtime reported it. */
|
|
2018
2072
|
startedAt?: Date; /** Milliseconds since `startedAt` at the moment of the poll. */
|
|
@@ -2022,18 +2076,18 @@ type TurnDriveResult = {
|
|
|
2022
2076
|
error: string;
|
|
2023
2077
|
};
|
|
2024
2078
|
/**
|
|
2025
|
-
* Scope of a `box.mintScopedToken()` request.
|
|
2026
|
-
*
|
|
2027
|
-
*
|
|
2079
|
+
* Scope of a `box.mintScopedToken()` request. `session` and `project` mint
|
|
2080
|
+
* SessionGateway read tokens. `session-runtime` and `read-only` mint sidecar
|
|
2081
|
+
* capability tokens for browser-safe runtime access.
|
|
2028
2082
|
*/
|
|
2029
2083
|
type ScopedTokenScope = "session" | "session-runtime" | "project" | "read-only";
|
|
2030
2084
|
/**
|
|
2031
2085
|
* Options for `box.mintScopedToken()`.
|
|
2032
2086
|
*/
|
|
2033
2087
|
interface MintScopedTokenOptions {
|
|
2034
|
-
/** Scope to mint. `session`
|
|
2035
|
-
*
|
|
2036
|
-
*
|
|
2088
|
+
/** Scope to mint. `session` and `project` are for SessionGateway streams;
|
|
2089
|
+
* `session-runtime` permits typed files, messages, and terminals for one
|
|
2090
|
+
* session; `read-only` permits read-only runtime requests. */
|
|
2037
2091
|
scope: ScopedTokenScope;
|
|
2038
2092
|
/** Required when `scope` is `session` or `session-runtime`. */
|
|
2039
2093
|
sessionId?: string;
|
|
@@ -2043,18 +2097,17 @@ interface MintScopedTokenOptions {
|
|
|
2043
2097
|
ttlMinutes?: number;
|
|
2044
2098
|
}
|
|
2045
2099
|
/**
|
|
2046
|
-
* Returned by `box.mintScopedToken()`.
|
|
2047
|
-
*
|
|
2048
|
-
*
|
|
2100
|
+
* Returned by `box.mintScopedToken()`. Use session/project tokens with
|
|
2101
|
+
* `SessionGatewayClient`; use session-runtime/read-only tokens with
|
|
2102
|
+
* `SandboxRuntimeClient`.
|
|
2049
2103
|
*/
|
|
2050
2104
|
interface ScopedToken {
|
|
2051
|
-
/** Bearer token (JWT)
|
|
2052
|
-
* via the `EventSource` URL with token query param. */
|
|
2105
|
+
/** Bearer token (JWT) for the consumer selected by `scope`. */
|
|
2053
2106
|
token: string;
|
|
2054
2107
|
/** When the token expires. */
|
|
2055
2108
|
expiresAt: Date;
|
|
2056
|
-
/** The runtime's direct edge URL.
|
|
2057
|
-
*
|
|
2109
|
+
/** The runtime's direct edge URL. Use with runtime scopes; session/project
|
|
2110
|
+
* tokens instead connect to the Sandbox API's `/session` WebSocket. */
|
|
2058
2111
|
runtimeUrl: string;
|
|
2059
2112
|
/** Browser-safe Sandbox API proxy base for terminal and runtime requests. */
|
|
2060
2113
|
sidecarProxyUrl: string;
|
|
@@ -2586,7 +2639,7 @@ interface SandboxFleetArtifactSpec {
|
|
|
2586
2639
|
*/
|
|
2587
2640
|
path: string;
|
|
2588
2641
|
label?: string;
|
|
2589
|
-
/** Maximum allowed artifact content size in bytes. Defaults to
|
|
2642
|
+
/** Maximum allowed artifact content size in bytes. Defaults to 10 MiB. */
|
|
2590
2643
|
maxBytes?: number;
|
|
2591
2644
|
}
|
|
2592
2645
|
interface SandboxFleetArtifact extends SandboxFleetArtifactSpec {
|
|
@@ -3585,8 +3638,6 @@ interface EgressPolicy {
|
|
|
3585
3638
|
* Ignored in `open` and `blocked` modes.
|
|
3586
3639
|
*/
|
|
3587
3640
|
allowDomains?: string[];
|
|
3588
|
-
/** Include platform-default and secret-derived domains. Defaults to true. */
|
|
3589
|
-
includeImplicitDomains?: boolean;
|
|
3590
3641
|
/**
|
|
3591
3642
|
* Denied domains. Only enforced when the proxy supports denylist transforms.
|
|
3592
3643
|
* @deprecated Deferred — not supported by iron-proxy v0.41.
|
|
@@ -3974,15 +4025,10 @@ interface ProcessSpawnOptions {
|
|
|
3974
4025
|
/** Timeout in milliseconds (0 = no timeout) */
|
|
3975
4026
|
timeoutMs?: number;
|
|
3976
4027
|
}
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
/** The complete process environment. Host variables are not inherited. */
|
|
3981
|
-
env?: Record<string, string>;
|
|
3982
|
-
/** Optional UTF-8 stdin. The stream is always closed after spawn. */
|
|
4028
|
+
/** Options for an exact argv spawn with optional initial stdin bytes. */
|
|
4029
|
+
interface ExactProcessSpawnOptions extends ProcessSpawnOptions {
|
|
4030
|
+
/** UTF-8 bytes written before stdin is closed. */
|
|
3983
4031
|
stdin?: string;
|
|
3984
|
-
/** Timeout in milliseconds. */
|
|
3985
|
-
timeoutMs?: number;
|
|
3986
4032
|
}
|
|
3987
4033
|
/**
|
|
3988
4034
|
* Options for running Python code.
|
|
@@ -4031,6 +4077,31 @@ interface ProcessInfo extends ProcessStatus {
|
|
|
4031
4077
|
/** Environment variables used */
|
|
4032
4078
|
env?: Record<string, string>;
|
|
4033
4079
|
}
|
|
4080
|
+
/** A development server started and tracked by the sandbox runtime. */
|
|
4081
|
+
interface DevServerInfo {
|
|
4082
|
+
/** Supervisor process ID. */
|
|
4083
|
+
pid: number;
|
|
4084
|
+
/** Detected project family, such as node-npm or rust-cargo. */
|
|
4085
|
+
family: string;
|
|
4086
|
+
/** Command managed by the runtime. */
|
|
4087
|
+
command: string;
|
|
4088
|
+
/** Canonical workspace root used for project detection. */
|
|
4089
|
+
workspaceRoot: string;
|
|
4090
|
+
/** When the managed process started. */
|
|
4091
|
+
startedAt: Date;
|
|
4092
|
+
/** True when this call started the process; false when it reused one. */
|
|
4093
|
+
startedNow: boolean;
|
|
4094
|
+
/** True when dependency installation ran before startup. */
|
|
4095
|
+
installRan: boolean;
|
|
4096
|
+
/** Time spent installing dependencies during this call. */
|
|
4097
|
+
installDurationMs: number;
|
|
4098
|
+
/** Assigned listening port, once the server is ready. */
|
|
4099
|
+
port?: number;
|
|
4100
|
+
}
|
|
4101
|
+
interface EnsureDevServerOptions {
|
|
4102
|
+
/** Agent session whose isolated workspace contains the project. */
|
|
4103
|
+
sessionId?: string;
|
|
4104
|
+
}
|
|
4034
4105
|
/**
|
|
4035
4106
|
* A log entry from process stdout/stderr.
|
|
4036
4107
|
*/
|
|
@@ -4177,6 +4248,12 @@ interface Process {
|
|
|
4177
4248
|
* ```
|
|
4178
4249
|
*/
|
|
4179
4250
|
interface ProcessManager {
|
|
4251
|
+
/**
|
|
4252
|
+
* Detect the workspace project and idempotently start its development server.
|
|
4253
|
+
* The runtime owns installation, process tracking, port assignment, and
|
|
4254
|
+
* stale-Vite compatibility handling.
|
|
4255
|
+
*/
|
|
4256
|
+
ensureDevServer(options?: EnsureDevServerOptions): Promise<DevServerInfo>;
|
|
4180
4257
|
/**
|
|
4181
4258
|
* Spawn a process without blocking.
|
|
4182
4259
|
* Returns immediately with a Process handle.
|
|
@@ -4186,7 +4263,7 @@ interface ProcessManager {
|
|
|
4186
4263
|
* @returns Process handle for control and monitoring
|
|
4187
4264
|
*/
|
|
4188
4265
|
spawn(command: string, options?: ProcessSpawnOptions): Promise<Process>;
|
|
4189
|
-
/** Spawn
|
|
4266
|
+
/** Spawn an executable with exact argument boundaries and no shell parsing. */
|
|
4190
4267
|
spawnExact(executable: string, args: readonly string[], options?: ExactProcessSpawnOptions): Promise<Process>;
|
|
4191
4268
|
/**
|
|
4192
4269
|
* Run Python code directly.
|
|
@@ -4466,6 +4543,36 @@ interface UploadProgress {
|
|
|
4466
4543
|
/** Percentage complete (0-100) */
|
|
4467
4544
|
percentage: number;
|
|
4468
4545
|
}
|
|
4546
|
+
/**
|
|
4547
|
+
* Options for {@link FileSystem.uploadData}.
|
|
4548
|
+
*/
|
|
4549
|
+
interface ChunkedUploadOptions {
|
|
4550
|
+
/** Unix mode bits applied to the file after upload, e.g. 0o644. */
|
|
4551
|
+
mode?: number;
|
|
4552
|
+
/** Progress callback fired after each part completes. On the rare
|
|
4553
|
+
* checksum-mismatch recovery (one automatic full re-upload),
|
|
4554
|
+
* `bytesUploaded` restarts from 0 for the second pass. */
|
|
4555
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
4556
|
+
/** Cancel the upload. A pending upload session is best-effort deleted
|
|
4557
|
+
* server-side when the signal fires mid-flow. */
|
|
4558
|
+
signal?: AbortSignal;
|
|
4559
|
+
/** Delay between part PUTs (ms) to pace bursts. 0 disables pacing (default). */
|
|
4560
|
+
paceMs?: number;
|
|
4561
|
+
/** Max retries per part on a transient error before failing loud. Default 4. */
|
|
4562
|
+
maxRetries?: number;
|
|
4563
|
+
}
|
|
4564
|
+
/**
|
|
4565
|
+
* Result of a successful {@link FileSystem.uploadData} call — the
|
|
4566
|
+
* upload-session commit response.
|
|
4567
|
+
*/
|
|
4568
|
+
interface ChunkedUploadResult {
|
|
4569
|
+
/** The path the runtime wrote the assembled payload to. */
|
|
4570
|
+
path: string;
|
|
4571
|
+
/** Total assembled size in bytes. */
|
|
4572
|
+
size: number;
|
|
4573
|
+
/** Server-computed content hash of the assembled payload. */
|
|
4574
|
+
hash: string;
|
|
4575
|
+
}
|
|
4469
4576
|
/**
|
|
4470
4577
|
* Options for downloading files.
|
|
4471
4578
|
*/
|
|
@@ -4574,10 +4681,12 @@ interface RenameOptions {
|
|
|
4574
4681
|
interface WriteManyFile {
|
|
4575
4682
|
/** Destination path. Relative paths resolve from the workspace root. */
|
|
4576
4683
|
path: string;
|
|
4577
|
-
/** File content
|
|
4684
|
+
/** File content: UTF-8 by default, or base64 when `encoding: "base64"` (for binary payloads). */
|
|
4578
4685
|
content: string;
|
|
4579
4686
|
/** Unix mode bits applied after write, e.g. 0o755. */
|
|
4580
4687
|
mode?: number;
|
|
4688
|
+
/** Encoding of `content` on the wire. */
|
|
4689
|
+
encoding?: "utf8" | "base64";
|
|
4581
4690
|
}
|
|
4582
4691
|
/** Options for {@link FileSystem.write}. */
|
|
4583
4692
|
interface WriteFileOptions {
|
|
@@ -4668,6 +4777,35 @@ interface FileSystem {
|
|
|
4668
4777
|
* ```
|
|
4669
4778
|
*/
|
|
4670
4779
|
upload(localPath: string, remotePath: string, options?: UploadOptions): Promise<void>;
|
|
4780
|
+
/**
|
|
4781
|
+
* Upload in-memory binary or text data to the sandbox over the chunked
|
|
4782
|
+
* upload-session protocol, without touching the local filesystem.
|
|
4783
|
+
*
|
|
4784
|
+
* Browser/Worker-safe (no `node:` APIs) — this is the sanctioned path for
|
|
4785
|
+
* delivering payloads over ~1 MiB from a browser tab, a Worker, or any
|
|
4786
|
+
* runtime without `node:fs`, where {@link FileSystem.upload}'s local-file
|
|
4787
|
+
* read isn't available. Binary-safe: accepts a `Blob`, `ArrayBuffer`,
|
|
4788
|
+
* `ArrayBufferView`, or UTF-8 `string`. The upload is chunked into
|
|
4789
|
+
* server-sized parts transparently — callers see one call and one
|
|
4790
|
+
* awaited result — and verified end-to-end with a whole-payload SHA-256
|
|
4791
|
+
* at commit. Works identically whether the sandbox is reached through
|
|
4792
|
+
* the gateway proxy or a direct sidecar connection.
|
|
4793
|
+
*
|
|
4794
|
+
* @param remotePath - Destination path in the sandbox.
|
|
4795
|
+
* @param data - Payload to upload. Strings encode as UTF-8.
|
|
4796
|
+
* @param options - Chunking, retry, progress, and cancellation options.
|
|
4797
|
+
* @throws {SandboxError} `PAYLOAD_TOO_LARGE` immediately, before any
|
|
4798
|
+
* request, if the payload exceeds the chunked-upload session cap.
|
|
4799
|
+
*
|
|
4800
|
+
* @example
|
|
4801
|
+
* ```typescript
|
|
4802
|
+
* const blob = await fetch("https://example.com/model.bin").then((r) => r.blob());
|
|
4803
|
+
* await box.fs.uploadData("/workspace/models/model.bin", blob, {
|
|
4804
|
+
* onProgress: (p) => console.log(`${p.percentage.toFixed(1)}%`),
|
|
4805
|
+
* });
|
|
4806
|
+
* ```
|
|
4807
|
+
*/
|
|
4808
|
+
uploadData(remotePath: string, data: Blob | ArrayBuffer | ArrayBufferView | string, options?: ChunkedUploadOptions): Promise<ChunkedUploadResult>;
|
|
4671
4809
|
/**
|
|
4672
4810
|
* Download a file from the sandbox.
|
|
4673
4811
|
* Handles binary files correctly.
|
|
@@ -4894,4 +5032,4 @@ interface CodeExecutionOptions {
|
|
|
4894
5032
|
idempotencyKey?: string;
|
|
4895
5033
|
}
|
|
4896
5034
|
//#endregion
|
|
4897
|
-
export {
|
|
5035
|
+
export { DriverType as $, AgentProfileValidationIssue as $i, SandboxFleetArtifactSpec as $n, SendSessionMessageRequest as $r, ListMessagesOptions as $t, CodeResult as A, ToolsConfig as Ai, PublishPublicTemplateVersionOptions as An, SandboxProfileSummary as Ar, GitBranch as At, CreateSandboxOptions as B, WriteManyOptions as Bi, RolloutOptions as Bn, SandboxTerminalRequestOptions as Br, GpuLeaseManager as Bt, BatchTaskUsage as C, TaskSessionProfile as Ci, ProvisionEvent as Cn, SandboxFleetWorkspaceRestoreResult as Cr, FleetExecDispatchOptions as Ct, CodeExecutionOptions as D, TeePublicKey as Di, PublicTemplateInfo as Dn, SandboxPermissionsConfig as Dr, FleetPromptDispatchResult as Dt, ChunkedUploadResult as E, TeeAttestationResponse as Ei, ProvisionStep as En, SandboxIntelligenceEnvelope as Er, FleetPromptDispatchOptions as Et, CreateIntelligenceReportOptions as F, UsageInfo as Fi, RenameOptions as Fn, SandboxRuntimeProfileList as Fr, GpuLease as Ft, DirectoryPermission as G, AgentProfileFileMount as Gi, RunCodeOptions as Gn, SandboxUser as Gr, HostAgentRuntimeBackend as Gt, CreateTaskSessionOptions as H, AgentProfileCapabilities as Hi, RolloutStartResult as Hn, SandboxTraceEvent as Hr, GpuLeaseStatus as Ht, CreateRequestOptions as I, WaitForOptions as Ii, RestoreSnapshotOptions as In, SandboxStatus as Ir, GpuLeaseBilling as It, DownloadOptions as J, AgentProfilePermissionValue as Ji, SandboxClientConfig as Jn, SearchMatch as Jr, IntelligenceReportBudget as Jt, DispatchPromptOptions as K, AgentProfileMcpServer as Ki, SSHCommandDescriptor as Kn, ScopedToken as Kr, InstalledTool as Kt, CreateSandboxFleetOptions as L, WaitForRolloutOptions as Li, ResumeOptions as Ln, SandboxTerminalCreateOptions as Lr, GpuLeaseCommandResult as Lt, CommitTaskSessionOptions as M, UpdateUserOptions as Mi, ReapExpiredSandboxFleetsResult as Mn, SandboxResources as Mr, GitConfig as Mt, CompletedTurnResult as N, UploadOptions as Ni, ReconcileSandboxFleetsOptions as Nn, SandboxRuntimeHealth as Nr, GitDiff as Nt, CodeExecutionResult as O, TeePublicKeyResponse as Oi, PublicTemplateVersionInfo as On, SandboxPortBinding as Or, GPU_LEASE_PROVIDER_NAMES as Ot, CreateGpuLeaseOptions as P, UploadProgress as Pi, ReconcileSandboxFleetsResult as Pn, SandboxRuntimeProfile as Pr, GitStatus as Pt, DriverInfo as Q, AgentProfileSecurityPolicy as Qi, SandboxFleetArtifact as Qn, SendSessionMessageOptions as Qr, JsonValue as Qt, CreateSandboxFleetTokenOptions as R, WriteFileOptions as Ri, Rollout as Rn, SandboxTerminalInfo as Rr, GpuLeaseExecOptions as Rt, BatchTaskResult as S, TaskSessionInfo as Si, PromptResult as Sn, SandboxFleetWorkspaceReconcileResult as Sr, FleetDispatchStreamOptions as St, ChunkedUploadOptions as T, TeeAttestationReport as Ti, ProvisionStatus as Tn, SandboxInfo as Tr, FleetMachineId as Tt, DeleteOptions as U, AgentProfileConfidential as Ui, RolloutStatus as Un, SandboxTraceExport as Ur, GpuType as Ut, CreateSessionOptions as V, AgentProfile as Vi, RolloutScorer as Vn, SandboxTraceBundle as Vr, GpuLeaseProviderName as Vt, DevServerInfo as W, AgentProfileConnection as Wi, RolloutTurnPart as Wn, SandboxTraceOptions as Wr, HostAgentDriverConfig as Wt, DriveTurnOptions as X, AgentProfileResourceRef as Xi, SandboxEnvironment as Xn, SecretInfo as Xr, IntelligenceReportSubjectType as Xt, DownloadProgress as Y, AgentProfilePrompt as Yi, SandboxConnection as Yn, SearchOptions as Yr, IntelligenceReportCompareTo as Yt, DriverConfig as Z, AgentProfileResources as Zi, SandboxEvent as Zn, SecretsManager as Zr, IntelligenceReportWindow as Zt, BatchResult as _, TaskOptions as _i, ProcessSignal as _n, SandboxFleetTraceEvent as _r, FileTreeResult as _t, AttachSandboxFleetMachineOptions as a, defineAgentProfile as aa, SessionListOptions as ai, MkdirOptions as an, SandboxFleetInfo as ar, ExactProcessSpawnOptions as at, BatchSidecarGroup as b, TaskSessionCommitResult as bi, PromptInputPart as bn, SandboxFleetUsage as br, FleetDispatchResultBuffer as bt, BackendInfo as c, mergeAgentProfiles as ca, SessionStatus as ci, NonHostAgentDriverConfig as cn, SandboxFleetMachineMeteredUsage as cr, FileInfo as ct, BackendType as d, SnapshotResult as di, PreviewLinkInfo as dn, SandboxFleetManifest as dr, FileReadError as dt, AgentProfileValidationResult as ea, SentSessionMessage as ei, ListOptions as en, SandboxFleetCostEstimate as er, DurablePlan as et, BatchBackend as f, SshKeysManager as fi, PreviewLinkManager as fn, SandboxFleetManifestMachine as fr, FileReadResult as ft, BatchOptions as g, SubscriptionInfo as gi, ProcessManager as gn, SandboxFleetTraceBundle as gr, FileTreeOptions as gt, BatchEventDataMap as h, StorageConfig as hi, ProcessLogEntry as hn, SandboxFleetToken as hr, FileTreeFile as ht, AttachGpuLeaseOptions as i, capabilitySchema as ia, SessionInfo as ii, MintScopedTokenOptions as in, SandboxFleetDriverTimings as ir, EventStreamOptions as it, CodeResultPart as j, TurnDriveResult as ji, ReapExpiredSandboxFleetsOptions as jn, SandboxResourceUsage as jr, GitCommit as jt, CodeLanguage as k, TokenRefreshHandler as ki, PublishPublicTemplateOptions as kn, SandboxPortPreviewLink as kr, GitAuth as kt, BackendManager as l, validateAgentProfileSecurity as la, SnapshotInfo as li, PermissionLevel as ln, SandboxFleetMachineRecord as lr, FileReadBatchOptions as lt, BatchEvent as m, StartupOperation as mi, ProcessInfo as mn, SandboxFleetPolicy as mr, FileSystem as mt, AccessPolicyRule as n, Capability as na, SessionEventStreamOptions as ni, ListSandboxOptions as nn, SandboxFleetDispatchResponse as nr, EgressPolicy as nt, BackendCapabilities as o, defineGitHubResource as oa, SessionMessage as oi, NetworkConfig as on, SandboxFleetIntelligenceEnvelope as or, ExecOptions as ot, BatchBackendStats as p, StartupDiagnostics as pi, Process as pn, SandboxFleetOperationsSummary as pr, FileRenameResult as pt, DispatchedSession as q, AgentProfileModelHints as qi, SSHCredentials as qn, ScopedTokenScope as qr, IntelligenceReport as qt, AddUserOptions as r, agentProfileSchema as ra, SessionForkOptions as ri, McpServerConfig as rn, SandboxFleetDriverCapability as rr, EnsureDevServerOptions as rt, BackendConfig as s, defineInlineResource as sa, SessionMessageInputPart as si, NetworkManager as sn, SandboxFleetMachine as sr, ExecResult as st, AcceleratorKind as t, AgentSubagentProfile as ta, SessionBackendCredentials as ti, ListSandboxFleetOptions as tn, SandboxFleetDispatchFailureClass as tr, EgressManager as tt, BackendStatus as u, SnapshotOptions as ui, PermissionsManager as un, SandboxFleetMachineSpec as ur, FileReadBatchResult as ut, BatchRunOptions as v, TaskResult as vi, ProcessSpawnOptions as vn, SandboxFleetTraceExport as vr, FileWriteResult as vt, BranchOptions as w, TeeAttestationOptions as wi, ProvisionResult as wn, SandboxFleetWorkspaceSnapshotResult as wr, FleetExecDispatchResult as wt, BatchTask as x, TaskSessionFileChange as xi, PromptOptions as xn, SandboxFleetWorkspace as xr, FleetDispatchResultBufferOptions as xt, BatchRunRequest as y, TaskSessionChanges as yi, ProcessStatus as yn, SandboxFleetTraceOptions as yr, FleetDispatchCancelResult as yt, CreateSandboxFleetWithCoordinatorOptions as z, WriteManyFile as zi, RolloutChildResult as zn, SandboxTerminalManager as zr, GpuLeaseExecResult as zt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1-develop.20260717054349.4472dd9",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@tangle-network/agent-core": "^0.4.0",
|
|
91
|
-
"@tangle-network/agent-interface": "
|
|
91
|
+
"@tangle-network/agent-interface": "0.30.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"@mastra/core": "^1.36.0",
|
|
@@ -124,7 +124,8 @@
|
|
|
124
124
|
"typescript": "^6.0.3",
|
|
125
125
|
"vitest": "^4.1.5",
|
|
126
126
|
"ws": "^8.20.0",
|
|
127
|
-
"yjs": "13.6.30"
|
|
127
|
+
"yjs": "13.6.30",
|
|
128
|
+
"@tangle-network/runtime-contracts": "0.1.0"
|
|
128
129
|
},
|
|
129
130
|
"scripts": {
|
|
130
131
|
"build": "tsdown",
|