@tangle-network/sandbox 0.45.0 → 0.47.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 +25 -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-CDpN0lAh.d.ts} +1 -1
- package/dist/{client-C_mFKZwS.d.ts → client-BVnci7-6.d.ts} +51 -2
- package/dist/{client-C2AGfwGT.js → client-DWX9LVU8.js} +177 -7
- package/dist/core.d.ts +12 -4
- package/dist/core.js +10 -3
- package/dist/{index-DT_pNtbV.d.ts → index-ByUvixzl.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-CQ2YTLtO.d.ts → sandbox-CpCVgm4V.d.ts} +54 -1
- package/dist/{sandbox-9IUdHeyj.js → sandbox-f9NE1NPU.js} +379 -85
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-B-w03_fQ.js → tangle-CBTGyeMO.js} +1 -1
- package/dist/{types-B3C-MizG.d.ts → types-CDksqyD4.d.ts} +167 -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 { $
|
|
3
|
+
import { $t as GpuLease, A as CommitTaskSessionOptions, Bi as SnapshotDeleteAcknowledgement, Bn as PromptOptions, C as BranchOptions, Ci as SendSessionMessageOptions, D as CodeExecutionResult, Di as SessionEventStreamOptions, Dn as PermissionsManager, E as CodeExecutionOptions, Fi as SessionMessage, Fn as ProcessManager, Gi as SnapshotResult, Gt as ForkLookupOptions, H as CreateTaskSessionOptions, Hn as ProvisionEvent, Ii as SessionMessageAdmission, Jt as GitBranch, M as ConversationTurnOptions, Mi as SessionInfo, N as ConversationTurnResult, Ni as SessionInterruptOptions, O as CodeLanguage, Oi as SessionExecutionInfo, Pi as SessionListOptions, Q as DispatchedSession, Qi as TaskSessionCommitResult, Qt as GitStatus, Ri as SessionResultOptions, Ti as SentSessionMessage, Tt as FileSystem, Ui as SnapshotInfo, Un as ProvisionResult, Ut as ForkCounts, V as CreateSessionOptions, Vn as PromptResult, Wi as SnapshotOptions, Wt as ForkIdempotency, Yr as SandboxInfo, Yt as GitCommit, Z as DispatchPromptOptions, Zi as TaskSessionChanges, Zr as SandboxPortBinding, Zt as GitDiff, _a as WriteFileOptions, _i as SandboxTraceOptions, _r as SandboxDeleteOptions, _t as ExecOptions, ar as RolloutOptions, at as DurablePlan, bi as SearchOptions, br as SandboxEvent, ci as SandboxTerminalAttachOptions, d as BackendConfig, dn as IntelligenceReportBudget, dr as SSHCredentials, ea as TaskSessionInfo, ei as SandboxResourceUsage, fn as IntelligenceReportCompareTo, ft as EgressManager, ga as WorkspaceOperationLookup, gn as ListMessagesOptions, gr as SandboxDeleteAcknowledgement, ha as WaitForRolloutOptions, hn as JsonValue, hr as SandboxCreateReceipt, ht as EventStreamOptions, ia as TeeAttestationResponse, ii as SandboxShape, in as GpuLeaseManager, j as CompletedTurnResult, ji as SessionForkOptions, jt as FileWriteResult, kn as PreviewLinkManager, la as TurnDriveResult, ln as InstalledTool, ma as WaitForOptions, mi as SandboxTraceBundle, mn as IntelligenceReportWindow, na as TeeAttestationOptions, ni as SandboxRuntimeCapabilities, nr as ResumeOptions, oa as TeePublicKeyResponse, ot as DurablePlanDecisionResult, p as BackendManager, pi as SandboxTerminals, pr as SandboxConnection, qi as StartupDiagnostics, ri as SandboxRuntimeHealth, rr as Rollout, rt as DriverInfo, si as SandboxStatus, sr as RolloutStartResult, tr as RestoreSnapshotOptions, tt as DriveTurnOptions, un as IntelligenceReport, ur as SSHCommandDescriptor, va as WriteManyFile, vt as ExecResult, wi as SendSessionMessageRequest, wn as NetworkManager, ya as WriteManyOptions, yi as SearchMatch, zn as PromptInputPart, zr as SandboxFleetTraceBundle } from "./types-CDksqyD4.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. */
|