@tangle-network/sandbox 0.45.0 → 0.46.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 +3 -0
- package/dist/agent/index.d.ts +6 -6
- package/dist/agent/index.js +37 -10
- package/dist/{agent-run-outcome-BpQhOdXp.d.ts → agent-run-outcome-B_DRpTxx.d.ts} +1 -1
- package/dist/{client-C2AGfwGT.js → client-BSNkAx2K.js} +44 -7
- package/dist/{client-C_mFKZwS.d.ts → client-DdmHMuCL.d.ts} +20 -2
- package/dist/core.d.ts +12 -4
- package/dist/core.js +10 -3
- package/dist/{index-DT_pNtbV.d.ts → index-B6eCXD1R.d.ts} +2 -2
- package/dist/index.d.ts +40 -31
- package/dist/index.js +45 -30
- package/dist/{runtime-api-C10Hg1OF.js → runtime-api-D7CdKcbu.js} +120 -28
- package/dist/runtime.d.ts +11 -10
- package/dist/runtime.js +1 -1
- package/dist/{sandbox-9IUdHeyj.js → sandbox-BRZLdcud.js} +369 -79
- package/dist/{sandbox-CQ2YTLtO.d.ts → sandbox-cTa_FF5p.d.ts} +54 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-B-w03_fQ.js → tangle-D7KgC1Xb.js} +1 -1
- package/dist/{types-B3C-MizG.d.ts → types-C3Kw-Tml.d.ts} +89 -3
- package/package.json +7 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as TerminalStreamReconnectAuthority, c as MintScopedTokenOptions, h as TerminalReadyInfo, l as ScopedToken, r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-CcaBTVg3.js";
|
|
2
2
|
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-BELrFH4f.js";
|
|
3
|
-
import { $r as
|
|
3
|
+
import { $i as TeeAttestationResponse, $r as SandboxShape, $t as GpuLeaseManager, A as CommitTaskSessionOptions, Ai as SessionMessage, An as ProcessManager, Bi as SnapshotResult, Bt as ForkLookupOptions, C as BranchOptions, Ci as SessionExecutionInfo, D as CodeExecutionResult, Di as SessionInfo, E as CodeExecutionOptions, Ei as SessionForkOptions, Et as FileWriteResult, Fi as SnapshotDeleteAcknowledgement, Fn as PromptOptions, H as CreateTaskSessionOptions, Hi as StartupDiagnostics, In as PromptResult, Jt as GpuLease, K as DispatchPromptOptions, Ki as TaskSessionChanges, Kr as SandboxPortBinding, Kt as GitDiff, Ln as ProvisionEvent, M as ConversationTurnOptions, N as ConversationTurnResult, Ni as SessionResultOptions, O as CodeLanguage, Oi as SessionInterruptOptions, Pn as PromptInputPart, Pr as SandboxFleetTraceBundle, Q as DriverInfo, Qn as Rollout, Qr as SandboxRuntimeHealth, Ri as SnapshotInfo, Rn as ProvisionResult, Rt as ForkCounts, Si as SessionEventStreamOptions, Sn as PermissionsManager, Ut as GitBranch, V as CreateSessionOptions, Wr as SandboxInfo, Wt as GitCommit, X as DriveTurnOptions, Xn as RestoreSnapshotOptions, Yi as TaskSessionInfo, Yr as SandboxResourceUsage, Zi as TeeAttestationOptions, Zn as ResumeOptions, Zr as SandboxRuntimeCapabilities, an as IntelligenceReport, ar as SSHCommandDescriptor, bi as SentSessionMessage, bt as FileSystem, ci as SandboxTerminals, cr as SandboxConnection, d as BackendConfig, da as WorkspaceOperationLookup, dn as ListMessagesOptions, dr as SandboxDeleteAcknowledgement, er as RolloutOptions, et as DurablePlan, fa as WriteFileOptions, fi as SandboxTraceOptions, fr as SandboxDeleteOptions, ft as ExecOptions, hi as SearchOptions, hr as SandboxEvent, ia as TurnDriveResult, in as InstalledTool, j as CompletedTurnResult, ji as SessionMessageAdmission, ki as SessionListOptions, la as WaitForOptions, li as SandboxTraceBundle, ln as IntelligenceReportWindow, ma as WriteManyOptions, mi as SearchMatch, ni as SandboxStatus, nr as RolloutStartResult, on as IntelligenceReportBudget, or as SSHCredentials, p as BackendManager, pa as WriteManyFile, pt as ExecResult, q as DispatchedSession, qi as TaskSessionCommitResult, qt as GitStatus, ri as SandboxTerminalAttachOptions, sn as IntelligenceReportCompareTo, st as EgressManager, ta as TeePublicKeyResponse, tt as DurablePlanDecisionResult, ua as WaitForRolloutOptions, un as JsonValue, ur as SandboxCreateReceipt, ut as EventStreamOptions, vi as SendSessionMessageOptions, wn as PreviewLinkManager, yi as SendSessionMessageRequest, yn as NetworkManager, zi as SnapshotOptions, zt as ForkIdempotency } from "./types-C3Kw-Tml.js";
|
|
4
4
|
import { AgentInteractiveSessionAttach, AgentInteractiveSessionControlClaim, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionControlClaimRequest, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentInteractiveSessionStopAcknowledgement, AgentInteractiveSessionStopCommand, AgentInteractiveTerminalSession, AgentInteractiveTerminalSession as AgentInteractiveTerminalSession$1, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, InteractionAcknowledgement, InteractionData, InteractionRequest, InteractionResponseCommand, TerminalOutputEvent, TerminalReplayWindow, agentInteractiveSessionPromptRequestDigest } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -115,6 +115,22 @@ declare function buildControlPlaneMcpConfig(options: BuildControlPlaneMcpConfigO
|
|
|
115
115
|
config: SandboxMcpConfig;
|
|
116
116
|
};
|
|
117
117
|
//#endregion
|
|
118
|
+
//#region src/direct-read-route.d.ts
|
|
119
|
+
type DirectReadFallbackReason = "expired" | "refused" | "unreachable" | "timeout" | "malformed" | "cooldown";
|
|
120
|
+
/** What the route has done, for the caller and for the probe. */
|
|
121
|
+
interface DirectReadStats {
|
|
122
|
+
/** Reads offered to this route. */
|
|
123
|
+
attempts: number;
|
|
124
|
+
/** Direct reads that proved the state had not moved; no API call followed. */
|
|
125
|
+
unchanged: number;
|
|
126
|
+
/** Direct reads that saw a change and sent the caller to the API. */
|
|
127
|
+
changed: number;
|
|
128
|
+
/** Reads that went to the API because the direct route could NOT serve. */
|
|
129
|
+
fallbacks: number;
|
|
130
|
+
/** Why the last fallback happened; null until one does. */
|
|
131
|
+
lastReason: DirectReadFallbackReason | null;
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
118
134
|
//#region ../../../packages/runtime-contracts/dist/interaction-response.d.ts
|
|
119
135
|
/** Canonical result returned after a response is recorded by Sidecar. */
|
|
120
136
|
declare const interactionResolutionAcknowledgementSchema: z.ZodObject<{
|
|
@@ -398,6 +414,9 @@ interface SandboxSessionHost extends InteractiveSessionHost {
|
|
|
398
414
|
_sessionStatus(id: string): Promise<SessionInfo | null>;
|
|
399
415
|
_sessionEvents(id: string, opts?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
|
|
400
416
|
_sessionRuns(id: string): Promise<SessionExecutionInfo[]>;
|
|
417
|
+
_sessionAdmission(id: string, turnId: string, options?: {
|
|
418
|
+
signal?: AbortSignal;
|
|
419
|
+
}): Promise<SessionMessageAdmission | null>;
|
|
401
420
|
_sessionResult(id: string, options?: SessionResultOptions, session?: SessionInfo): Promise<PromptResult>;
|
|
402
421
|
_sessionDelete(id: string): Promise<void>;
|
|
403
422
|
_sessionSendMessage(id: string, request: SendSessionMessageRequest, options?: SendSessionMessageOptions): Promise<SentSessionMessage>;
|
|
@@ -465,6 +484,12 @@ declare class SandboxSession {
|
|
|
465
484
|
* count provider runs without inferring execution from model-written files.
|
|
466
485
|
*/
|
|
467
486
|
runs(): Promise<SessionExecutionInfo[]>;
|
|
487
|
+
/** Read the exact execution admitted for a turn, including server-owned plan follow-ups.
|
|
488
|
+
* This never admits work or verifies the input of a proposed retry.
|
|
489
|
+
*/
|
|
490
|
+
admission(turnId: string, options?: {
|
|
491
|
+
signal?: AbortSignal;
|
|
492
|
+
}): Promise<SessionMessageAdmission | null>;
|
|
468
493
|
/**
|
|
469
494
|
* Await a terminal result. With `executionId`, drains only that execution;
|
|
470
495
|
* without it, reads status and selects the latest execution. Event replay
|
|
@@ -758,6 +783,12 @@ declare class SandboxInstance {
|
|
|
758
783
|
* never by object identity, and a changed profile is sent inline.
|
|
759
784
|
*/
|
|
760
785
|
private deferredProfileReference?;
|
|
786
|
+
/**
|
|
787
|
+
* Direct regional status reads for THIS sandbox. Inert until the API
|
|
788
|
+
* relays a grant, and it retreats to the API path on any failure — see
|
|
789
|
+
* direct-read-route.ts.
|
|
790
|
+
*/
|
|
791
|
+
private readonly directRead;
|
|
761
792
|
constructor(client: HttpClient, info: SandboxInfo, defaultRuntimeBackend?: BackendConfig);
|
|
762
793
|
/** Unique sandbox identifier */
|
|
763
794
|
get id(): string;
|
|
@@ -787,6 +818,13 @@ declare class SandboxInstance {
|
|
|
787
818
|
get error(): string | undefined;
|
|
788
819
|
/** GPU lease attached during sandbox creation, when requested. */
|
|
789
820
|
get gpuLease(): GpuLease | undefined;
|
|
821
|
+
/**
|
|
822
|
+
* The shape this sandbox was granted: the cgroup and volume limits it runs
|
|
823
|
+
* at and the numbers it is billed at. Present on a freshly created box and
|
|
824
|
+
* on one resolved by `get`; `undefined` for a box from a list row until it
|
|
825
|
+
* is refreshed, and for a sandbox created before the platform recorded it.
|
|
826
|
+
*/
|
|
827
|
+
get resources(): SandboxShape | undefined;
|
|
790
828
|
/** Web terminal URL for browser-based access */
|
|
791
829
|
get url(): string | undefined;
|
|
792
830
|
/** Build and publish this sandbox's workspace without exposing registry credentials to it. */
|
|
@@ -882,6 +920,17 @@ declare class SandboxInstance {
|
|
|
882
920
|
*/
|
|
883
921
|
refresh(signal?: AbortSignal): Promise<void>;
|
|
884
922
|
private refreshInfo;
|
|
923
|
+
/**
|
|
924
|
+
* What the direct regional read route has done for this sandbox: attempts,
|
|
925
|
+
* reads it served, reads that fell back to the API, and the last reason.
|
|
926
|
+
* Read by the lifecycle probe; safe for a caller to read too.
|
|
927
|
+
*/
|
|
928
|
+
directReadStats(): DirectReadStats;
|
|
929
|
+
/**
|
|
930
|
+
* Arm the direct regional read from an API payload this instance did not
|
|
931
|
+
* fetch itself. @internal — called by `createSandboxInstanceFromResponse`.
|
|
932
|
+
*/
|
|
933
|
+
adoptDirectRead(payload: Record<string, unknown>): void;
|
|
885
934
|
/**
|
|
886
935
|
* Fetch fresh TEE attestation evidence for this sandbox.
|
|
887
936
|
*
|
|
@@ -2004,6 +2053,10 @@ declare class SandboxInstance {
|
|
|
2004
2053
|
_sessionStatus(id: string): Promise<SessionInfo | null>;
|
|
2005
2054
|
/** @internal — invoked by SandboxSession.runs(). */
|
|
2006
2055
|
_sessionRuns(id: string): Promise<SessionExecutionInfo[]>;
|
|
2056
|
+
/** @internal — invoked by SandboxSession.admission(). */
|
|
2057
|
+
_sessionAdmission(id: string, turnId: string, options?: {
|
|
2058
|
+
signal?: AbortSignal;
|
|
2059
|
+
}): Promise<SessionMessageAdmission | null>;
|
|
2007
2060
|
/** @internal — invoked by SandboxSession.events(). */
|
|
2008
2061
|
_sessionEvents(id: string, opts?: SessionEventStreamOptions, stopOnTurnTerminal?: boolean): AsyncGenerator<SandboxEvent>;
|
|
2009
2062
|
/** Replay one execution without subscribing to other runs on its session. */
|
package/dist/tangle/index.d.ts
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 TangleSandboxClientConfig, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../index-
|
|
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 TangleSandboxClientConfig, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../index-B6eCXD1R.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as JsonResponseParamTypes, d as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as SandboxCreateParamTypes, n as JOB_SANDBOX_CREATE, o as AgentSandboxBlueprintAbi, r as JOB_SANDBOX_DELETE, s as ITangleJobsAbi, t as TangleSandboxClient, u as SandboxCreateResponseParamTypes } from "../tangle-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as JsonResponseParamTypes, d as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as SandboxCreateParamTypes, n as JOB_SANDBOX_CREATE, o as AgentSandboxBlueprintAbi, r as JOB_SANDBOX_DELETE, s as ITangleJobsAbi, t as TangleSandboxClient, u as SandboxCreateResponseParamTypes } from "../tangle-D7KgC1Xb.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as parseErrorResponse } from "./errors-CdDyExth.js";
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-BRZLdcud.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-CcaBTVg3.js";
|
|
2
2
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
3
|
-
import { AgentExactRunControlRef, AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileValidationResult, AgentRuntimeAttachments, HarnessType, ReasoningEffort } from "@tangle-network/agent-interface";
|
|
3
|
+
import { AgentExactRunControlRef, AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileValidationResult, AgentRuntimeAttachments, HarnessType, ReasoningEffort, SandboxSizePreset } from "@tangle-network/agent-interface";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region ../../../packages/runtime-contracts/dist/backend-types.d.ts
|
|
@@ -1354,6 +1354,46 @@ interface SandboxResources {
|
|
|
1354
1354
|
*/
|
|
1355
1355
|
advisoryFields?: ReadonlyArray<"cpuCores" | "memoryMB" | "diskGB">;
|
|
1356
1356
|
}
|
|
1357
|
+
/**
|
|
1358
|
+
* The shape a sandbox was GRANTED: the cgroup and volume limits it runs at,
|
|
1359
|
+
* and the numbers the ledger bills. One vocabulary with the request
|
|
1360
|
+
* ({@link SandboxResources}), but never advisory and never clamped after the
|
|
1361
|
+
* fact — this is what the create resolved.
|
|
1362
|
+
*/
|
|
1363
|
+
interface SandboxShape {
|
|
1364
|
+
/** Whole cores; the cgroup CPU quota is `cpuCores * 1e9` NanoCpus. */
|
|
1365
|
+
cpuCores: number;
|
|
1366
|
+
/** Cgroup memory limit in MiB. */
|
|
1367
|
+
memoryMB: number;
|
|
1368
|
+
/** Workspace volume quota in GiB. */
|
|
1369
|
+
diskGB: number;
|
|
1370
|
+
/** The host pool that placed the sandbox (e.g. `general`), once reported. */
|
|
1371
|
+
pool?: string;
|
|
1372
|
+
/** Execution time limit per prompt in ms; absent means the deployment default. */
|
|
1373
|
+
ttlMs?: number;
|
|
1374
|
+
}
|
|
1375
|
+
/** One named size from `GET /v1/shapes`. */
|
|
1376
|
+
interface SandboxShapePreset {
|
|
1377
|
+
name: SandboxSizePreset;
|
|
1378
|
+
cpuCores: number;
|
|
1379
|
+
memoryMB: number;
|
|
1380
|
+
diskGB: number;
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* `GET /v1/shapes`: the named sizes, which one is the platform's default, and
|
|
1384
|
+
* the largest shape this account can be granted on the serving deployment.
|
|
1385
|
+
* The ceiling is the one the create path refuses above, so a request sized
|
|
1386
|
+
* at or below it is never refused with `RESOURCES_EXCEED_LIMIT`.
|
|
1387
|
+
*/
|
|
1388
|
+
interface SandboxShapesInfo {
|
|
1389
|
+
presets: SandboxShapePreset[];
|
|
1390
|
+
default: SandboxSizePreset;
|
|
1391
|
+
ceiling: {
|
|
1392
|
+
cpuCores: number;
|
|
1393
|
+
memoryMB: number;
|
|
1394
|
+
diskGB: number;
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1357
1397
|
/**
|
|
1358
1398
|
* Configuration for creating a new sandbox.
|
|
1359
1399
|
*
|
|
@@ -1952,6 +1992,10 @@ type SandboxCreateOutcome = "created" | "idempotent_replay" | "unknown";
|
|
|
1952
1992
|
interface SandboxCreateReceipt {
|
|
1953
1993
|
outcome: SandboxCreateOutcome;
|
|
1954
1994
|
idempotencyKeyApplied: boolean;
|
|
1995
|
+
/** Host-confirmed credential-inheritance policy, not a VM-isolation or
|
|
1996
|
+
* privacy-from-operator attestation. Missing on older hosts and on unverified
|
|
1997
|
+
* replays; isolated creation requires an explicit isolated verdict. */
|
|
1998
|
+
ownerContext?: "inherit" | "isolated";
|
|
1955
1999
|
/**
|
|
1956
2000
|
* Names of the stored secrets this call decrypted into the sandbox.
|
|
1957
2001
|
* Read it to size what the box can read. The set is sorted and
|
|
@@ -1994,6 +2038,15 @@ interface SandboxInfo {
|
|
|
1994
2038
|
error?: string;
|
|
1995
2039
|
/** GPU lease attached during sandbox creation, when requested. */
|
|
1996
2040
|
gpuLease?: GpuLease;
|
|
2041
|
+
/**
|
|
2042
|
+
* The shape the sandbox was granted. Always present on the create response
|
|
2043
|
+
* and on a `get` whose billing record could be read; absent on a list row
|
|
2044
|
+
* and when the platform has no record to read, where it reports no grant
|
|
2045
|
+
* rather than a default the box may not be running at. A sandbox created
|
|
2046
|
+
* before the platform recorded shapes reports what its billing row holds,
|
|
2047
|
+
* which for such a row is the repair value the ledger charges.
|
|
2048
|
+
*/
|
|
2049
|
+
resources?: SandboxShape;
|
|
1997
2050
|
/**
|
|
1998
2051
|
* Startup phase breakdown, present only on the create response (the
|
|
1999
2052
|
* platform emits it once, at provision time). Use
|
|
@@ -3097,6 +3150,14 @@ interface SessionExecutionInfo {
|
|
|
3097
3150
|
eventCount: number;
|
|
3098
3151
|
lastEventId: string;
|
|
3099
3152
|
}
|
|
3153
|
+
/** Admission identity survives replay retention; unavailable never means completed. */
|
|
3154
|
+
interface SessionMessageAdmission {
|
|
3155
|
+
sessionId: string;
|
|
3156
|
+
turnId: string;
|
|
3157
|
+
executionId: string;
|
|
3158
|
+
status: SessionExecutionStatus | "unavailable";
|
|
3159
|
+
runControlRef?: AgentExactRunControlRef;
|
|
3160
|
+
}
|
|
3100
3161
|
/** Secret-free model tuple selected by the sandbox runtime. */
|
|
3101
3162
|
/**
|
|
3102
3163
|
* Which layer supplied the model id that executed. `request` means the model
|
|
@@ -3229,6 +3290,10 @@ type SessionMessageInputPart = PromptInputPart | {
|
|
|
3229
3290
|
/** Message body accepted by `SandboxSession.sendMessage`. */
|
|
3230
3291
|
interface SendSessionMessageRequest {
|
|
3231
3292
|
messageId?: string;
|
|
3293
|
+
/** Per-turn overrides within the session's native backend. */
|
|
3294
|
+
backend?: Partial<BackendConfig>;
|
|
3295
|
+
/** Exact caller-owned execution identity for canonical cancellation. */
|
|
3296
|
+
runControlRef?: AgentExactRunControlRef;
|
|
3232
3297
|
parts: SessionMessageInputPart[];
|
|
3233
3298
|
system?: string;
|
|
3234
3299
|
agent?: string;
|
|
@@ -3256,6 +3321,7 @@ interface SentSessionMessage {
|
|
|
3256
3321
|
parts: [];
|
|
3257
3322
|
userMessageId: string;
|
|
3258
3323
|
processing: true;
|
|
3324
|
+
runControlRef?: AgentExactRunControlRef;
|
|
3259
3325
|
}
|
|
3260
3326
|
/** Canonical portable profile attached to a task session. */
|
|
3261
3327
|
type TaskSessionProfile = AgentProfile & {
|
|
@@ -3480,6 +3546,12 @@ interface DispatchedSession {
|
|
|
3480
3546
|
interface ConversationTurnOptions {
|
|
3481
3547
|
sessionId: string;
|
|
3482
3548
|
turnId: string;
|
|
3549
|
+
/** Per-turn backend, profile, runtime attachments, and interaction settings. */
|
|
3550
|
+
backend?: Partial<BackendConfig>;
|
|
3551
|
+
/** Model shorthand; conflicts with backend.model.model are rejected. */
|
|
3552
|
+
model?: string;
|
|
3553
|
+
/** Exact execution identity retained by admission and cancellation. */
|
|
3554
|
+
runControlRef?: AgentExactRunControlRef;
|
|
3483
3555
|
/** False is a passive settlement/cancellation lookup; never admits new work. */
|
|
3484
3556
|
allowDispatch?: boolean;
|
|
3485
3557
|
timeoutMs?: number;
|
|
@@ -3526,10 +3598,11 @@ interface DriveTurnOptions {
|
|
|
3526
3598
|
* one pass. Discriminated on `state`:
|
|
3527
3599
|
* - `completed` — the turn finished with a text payload; `result` is
|
|
3528
3600
|
* the full cached AgentExecutionResult-shape record.
|
|
3601
|
+
* - Waiting states preserve the response request and original result.
|
|
3529
3602
|
* - `running` — the session is queued or executing; re-invoke after a
|
|
3530
3603
|
* delay of your choosing.
|
|
3531
3604
|
* - `failed` — terminal and deterministic: a failed/cancelled session,
|
|
3532
|
-
* a wall-cap cancellation, or
|
|
3605
|
+
* a wall-cap cancellation, or an invalid terminal result.
|
|
3533
3606
|
* Re-invoking will not change the outcome.
|
|
3534
3607
|
*/
|
|
3535
3608
|
type TurnDriveResult = {
|
|
@@ -3545,6 +3618,19 @@ type TurnDriveResult = {
|
|
|
3545
3618
|
state: "awaiting_plan_decision";
|
|
3546
3619
|
plan: DurablePlanSnapshot;
|
|
3547
3620
|
result: Record<string, unknown>;
|
|
3621
|
+
} | {
|
|
3622
|
+
state: "blocked_on_approval";
|
|
3623
|
+
approval: AgentApprovalRequirement;
|
|
3624
|
+
result: Record<string, unknown>;
|
|
3625
|
+
} | {
|
|
3626
|
+
state: "awaiting_question";
|
|
3627
|
+
question: AgentQuestionRequest;
|
|
3628
|
+
interaction?: _$_tangle_network_agent_interface0.InteractionRequest;
|
|
3629
|
+
result: Record<string, unknown>;
|
|
3630
|
+
} | {
|
|
3631
|
+
state: "awaiting_interaction";
|
|
3632
|
+
interaction: _$_tangle_network_agent_interface0.InteractionRequest;
|
|
3633
|
+
result: Record<string, unknown>;
|
|
3548
3634
|
} | {
|
|
3549
3635
|
state: "running"; /** When the session began executing, if the runtime reported it. */
|
|
3550
3636
|
startedAt?: Date; /** Milliseconds since `startedAt` at the moment of the poll. */
|
|
@@ -6474,4 +6560,4 @@ interface CodeExecutionOptions {
|
|
|
6474
6560
|
idempotencyKey?: string;
|
|
6475
6561
|
}
|
|
6476
6562
|
//#endregion
|
|
6477
|
-
export { DriverType as $,
|
|
6563
|
+
export { DriverType as $, TeeAttestationResponse as $i, RolloutChildResult as $n, SandboxShape as $r, GpuLeaseManager as $t, CommitTaskSessionOptions as A, SessionMessage as Ai, ProcessManager as An, SandboxFleetManifestMachine as Ar, FleetDispatchStreamOptions as At, CreateSandboxOptions as B, SnapshotResult as Bi, ProvisionStep as Bn, SandboxFleetWorkspaceReconcileResult as Br, ForkLookupOptions as Bt, BranchOptions as C, parseBackendType as Ca, SessionExecutionInfo as Ci, PreviewLinkInfo as Cn, SandboxFleetInfo as Cr, FileTreeResult as Ct, CodeExecutionResult as D, SessionInfo as Di, ProcessInfo as Dn, SandboxFleetMachineRecord as Dr, FleetDispatchCancelResult as Dt, CodeExecutionOptions as E, SessionForkOptions as Ei, Process as En, SandboxFleetMachineMeteredUsage as Er, FileWriteResult as Et, CreateIntelligenceReportOptions as F, SnapshotDeleteAcknowledgement as Fi, PromptOptions as Fn, SandboxFleetTraceEvent as Fr, FleetMachineId as Ft, DirectoryPermission as G, SubscriptionInfo as Gi, ReapExpiredSandboxFleetsOptions as Gn, SandboxIntelligenceEnvelope as Gr, GitConfig as Gt, CreateTaskSessionOptions as H, StartupDiagnostics as Hi, PublicTemplateVersionInfo as Hn, SandboxFleetWorkspaceSnapshotResult as Hr, GitAuth as Ht, CreateRequestOptions as I, SnapshotDeleteOutcome as Ii, PromptResult as In, SandboxFleetTraceExport as Ir, FleetPromptDispatchOptions as It, DownloadOptions as J, TaskSessionFileChange as Ji, ReconcileSandboxFleetsResult as Jn, SandboxRemovalState as Jr, GpuLease as Jt, DispatchPromptOptions as K, TaskSessionChanges as Ki, ReapExpiredSandboxFleetsResult as Kn, SandboxPortBinding as Kr, GitDiff as Kt, CreateSandboxFleetOptions as L, SnapshotIdempotency as Li, ProvisionEvent as Ln, SandboxFleetTraceOptions as Lr, FleetPromptDispatchResult as Lt, ConversationTurnOptions as M, SessionMessageInputPart as Mi, ProcessSpawnOptions as Mn, SandboxFleetPolicy as Mr, FleetDriveTurnRequest as Mt, ConversationTurnResult as N, SessionResultOptions as Ni, ProcessStatus as Nn, SandboxFleetToken as Nr, FleetExecDispatchOptions as Nt, CodeLanguage as O, SessionInterruptOptions as Oi, ProcessListOptions as On, SandboxFleetMachineSpec as Or, FleetDispatchResultBuffer as Ot, CreateGpuLeaseOptions as P, SessionStatus as Pi, PromptInputPart as Pn, SandboxFleetTraceBundle as Pr, FleetExecDispatchResult as Pt, DriverInfo as Q, TeeAttestationReport as Qi, Rollout as Qn, SandboxRuntimeHealth as Qr, GpuLeaseExecResult as Qt, CreateSandboxFleetTokenOptions as R, SnapshotInfo as Ri, ProvisionResult as Rn, SandboxFleetUsage as Rr, ForkCounts as Rt, BatchTaskResult as S, BackendType as Sa, SessionEventStreamOptions as Si, PermissionsManager as Sn, SandboxFleetDriverTimings as Sr, FileTreeOptions as St, ChunkedUploadResult as T, SessionFailureReason as Ti, PreviewLinkWaitOptions as Tn, SandboxFleetMachine as Tr, FileUsageResult as Tt, DeleteOptions as U, StartupOperation as Ui, PublishPublicTemplateOptions as Un, SandboxIdentity as Ur, GitBranch as Ut, CreateSessionOptions as V, SshKeysManager as Vi, PublicTemplateInfo as Vn, SandboxFleetWorkspaceRestoreResult as Vr, GPU_LEASE_PROVIDER_NAMES as Vt, DevServerInfo as W, StorageConfig as Wi, PublishPublicTemplateVersionOptions as Wn, SandboxInfo as Wr, GitCommit as Wt, DriveTurnOptions as X, TaskSessionProfile as Xi, RestoreSnapshotOptions as Xn, SandboxResources as Xr, GpuLeaseCommandResult as Xt, DownloadProgress as Y, TaskSessionInfo as Yi, RenameOptions as Yn, SandboxResourceUsage as Yr, GpuLeaseBilling as Yt, DriverConfig as Z, TeeAttestationOptions as Zi, ResumeOptions as Zn, SandboxRuntimeCapabilities as Zr, GpuLeaseExecOptions as Zt, BatchBackend as _, BatchEventDataMap as _a, SecretsManager as _i, MkdirOptions as _n, SandboxFleetArtifactSpec as _r, FileReadError as _t, AgentQuestionRequest as a, UpdateUserOptions as aa, SandboxTerminalInfo as ai, IntelligenceReport as an, SSHCommandDescriptor as ar, EffectiveBackendSource as at, BatchRunRequest as b, PublicBatchRunRequest as ba, SentSessionMessage as bi, NonHostAgentDriverConfig as bn, SandboxFleetDispatchResponse as br, FileSystem as bt, AttachGpuLeaseOptions as c, UsageInfo as ca, SandboxTerminals as ci, IntelligenceReportSubjectType as cn, SandboxConnection as cr, EgressPolicy as ct, BackendConfig as d, WorkspaceOperationLookup as da, SandboxTraceExport as di, ListMessagesOptions as dn, SandboxDeleteAcknowledgement as dr, ExactProcessSpawnOptions as dt, TeePublicKey as ea, SandboxShapePreset as ei, GpuLeaseProviderName as en, RolloutOptions as er, DurablePlan as et, BackendInfo as f, WriteFileOptions as fa, SandboxTraceOptions as fi, ListOptions as fn, SandboxDeleteOptions as fr, ExecOptions as ft, BackendStatus as g, BatchEvent as ga, SecretInfo as gi, McpServerConfig as gn, SandboxFleetArtifact as gr, FileReadBatchResult as gt, BackendRuntimeConfigUpdate as h, BatchBackendStats as ha, SearchOptions as hi, MAX_EGRESS_DENIALS_LIMIT as hn, SandboxEvent as hr, FileReadBatchOptions as ht, AgentApprovalRequirement as i, TurnDriveResult as ia, SandboxTerminalCreateOptions as ii, InstalledTool as in, RolloutTurnPart as ir, EffectiveBackendProfile as it, CompletedTurnResult as j, SessionMessageAdmission as ji, ProcessSignal as jn, SandboxFleetOperationsSummary as jr, FleetDriveTurnOutcome as jt, CodeResultPart as k, SessionListOptions as ki, ProcessLogEntry as kn, SandboxFleetManifest as kr, FleetDispatchResultBufferOptions as kt, AttachSandboxFleetMachineOptions as l, WaitForOptions as la, SandboxTraceBundle as li, IntelligenceReportWindow as ln, SandboxCreateOutcome as lr, EnsureDevServerOptions as lt, BackendMcpServerStatus as m, WriteManyOptions as ma, SearchMatch as mi, ListSandboxOptions as mn, SandboxEnvironment as mr, FileInfo as mt, AccessPolicyRule as n, TokenRefreshHandler as na, SandboxStatus as ni, HostAgentDriverConfig as nn, RolloutStartResult as nr, DurablePlanSnapshot as nt, AgentRunStatus as o, UploadOptions as oa, SandboxTerminalManager as oi, IntelligenceReportBudget as on, SSHCredentials as or, EgressDenial as ot, BackendManager as p, WriteManyFile as pa, SandboxUser as pi, ListSandboxFleetOptions as pn, SandboxDeleteOutcome as pr, ExecResult as pt, DispatchedSession as q, TaskSessionCommitResult as qi, ReconcileSandboxFleetsOptions as qn, SandboxPortPreviewLink as qr, GitStatus as qt, AddUserOptions as r, TokenUsage as ra, SandboxTerminalAttachOptions as ri, HostAgentRuntimeBackend as rn, RolloutStatus as rr, EffectiveBackend as rt, AgentToolInvocation as s, UploadProgress as sa, SandboxTerminalRequestOptions as si, IntelligenceReportCompareTo as sn, SandboxConfig as sr, EgressManager as st, AcceleratorKind as t, TeePublicKeyResponse as ta, SandboxShapesInfo as ti, GpuLeaseStatus as tn, RolloutScorer as tr, DurablePlanDecisionResult as tt, BackendCapabilities as u, WaitForRolloutOptions as ua, SandboxTraceEvent as ui, JsonValue as un, SandboxCreateReceipt as ur, EventStreamOptions as ut, BatchResult as v, BatchSidecarGroup as va, SendSessionMessageOptions as vi, NetworkConfig as vn, SandboxFleetCostEstimate as vr, FileReadResult as vt, ChunkedUploadOptions as w, SessionExecutionStatus as wi, PreviewLinkManager as wn, SandboxFleetIntelligenceEnvelope as wr, FileUsageOptions as wt, BatchTask as x, ALL_BACKEND_TYPES as xa, SessionBackendCredentials as xi, PermissionLevel as xn, SandboxFleetDriverCapability as xr, FileTreeFile as xt, BatchRunOptions as y, BatchTaskUsage as ya, SendSessionMessageRequest as yi, NetworkManager as yn, SandboxFleetDispatchFailureClass as yr, FileRenameResult as yt, CreateSandboxFleetWithCoordinatorOptions as z, SnapshotOptions as zi, ProvisionStatus as zn, SandboxFleetWorkspace as zr, ForkIdempotency as zt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@mastra/core": "^1.36.0",
|
|
104
104
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
105
|
-
"ai": "^6.0.175",
|
|
105
|
+
"ai": "^6.0.175 || ^7.0.107",
|
|
106
106
|
"openai": "^6.36.0",
|
|
107
107
|
"viem": "^2.0.0"
|
|
108
108
|
},
|
|
@@ -125,8 +125,10 @@
|
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@hocuspocus/provider": "^4.0.0",
|
|
128
|
+
"@mastra/core": "1.67.0",
|
|
128
129
|
"@types/node": "25.6.0",
|
|
129
130
|
"@vitest/coverage-v8": "^4.1.5",
|
|
131
|
+
"ai": "7.0.107",
|
|
130
132
|
"dotenv": "^16.4.5",
|
|
131
133
|
"openai": "^6.36.0",
|
|
132
134
|
"proper-lockfile": "4.1.2",
|
|
@@ -136,10 +138,10 @@
|
|
|
136
138
|
"ws": "^8.20.0",
|
|
137
139
|
"yjs": "13.6.30",
|
|
138
140
|
"@repo/shared": "0.0.0",
|
|
139
|
-
"@tangle-network/
|
|
141
|
+
"@tangle-network/cli-agent-registry": "0.4.6",
|
|
140
142
|
"@tangle-network/agent-profile-materialize": "0.20.1",
|
|
141
|
-
"@tangle-network/
|
|
142
|
-
"@tangle-network/
|
|
143
|
+
"@tangle-network/runtime-contracts": "0.7.0",
|
|
144
|
+
"@tangle-network/sse-core": "0.0.0"
|
|
143
145
|
},
|
|
144
146
|
"scripts": {
|
|
145
147
|
"build": "node scripts/build-dist.mjs",
|