@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/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { _ as deriveAgentRunOutcome, b as parseBackendType, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, m as normalizeRuntimeBackendConfig, u as parseSSEStream, v as ALL_BACKEND_TYPES, y as backendTypeSchema } from "./runtime-api-C10Hg1OF.js";
1
+ import { C as parseBackendType, S as backendTypeSchema, _ as normalizeRuntimeBackendConfig, b as deriveAgentRunOutcome, p as parseSSEStream, v as createAgentRunOutcomeTracker, x as ALL_BACKEND_TYPES, y as deriveAgentResultOutcome } from "./runtime-api-D7CdKcbu.js";
2
2
  import { a as FileWriteConflictError, c as NotFoundError, d as SandboxError, f as ServerError, h as ValidationError, i as EgressProxyRecoveryError, l as PartialFailureError, m as TimeoutError, n as CapabilityError, o as KeyBudgetExhaustedError, p as StateError, r as EdgeNotReadyError, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-CdDyExth.js";
3
- import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-C2AGfwGT.js";
3
+ import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-BSNkAx2K.js";
4
4
  import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, c as createInteractiveControlHolderId, l as interactiveSessionIdentityDigest, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-Dv0gbFMu.js";
5
- import { A as toOtelJson, C as collectAgentResponseText, D as buildTraceExportPayload, O as exportTraceBundle, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as TerminalStream, a as WorkspaceImages, c as SandboxTaskSession, d as agentInteractiveSessionPromptRequestDigest, f as InteractiveTerminalFrameLog, g as InteractiveSessionController, h as BrowserInteractiveSessionController, k as otelTraceIdForTangleTrace, l as SandboxSession, m as createInteractiveTerminalSession, o as GPU_LEASE_PROVIDER_NAMES, p as createInteractiveTerminalCapture, s as MAX_EGRESS_DENIALS_LIMIT, t as SandboxInstance, u as InteractiveSessionHandle, v as TerminalStreamError, w as getSandboxEventText, x as applySandboxEventText, y as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./sandbox-9IUdHeyj.js";
5
+ import { A as otelTraceIdForTangleTrace, C as collectAgentResponseText, O as buildTraceExportPayload, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as TerminalStream, a as WorkspaceImages, c as SandboxTaskSession, d as agentInteractiveSessionPromptRequestDigest, f as InteractiveTerminalFrameLog, g as InteractiveSessionController, h as BrowserInteractiveSessionController, j as toOtelJson, k as exportTraceBundle, l as SandboxSession, m as createInteractiveTerminalSession, o as GPU_LEASE_PROVIDER_NAMES, p as createInteractiveTerminalCapture, s as MAX_EGRESS_DENIALS_LIMIT, t as SandboxInstance, u as InteractiveSessionHandle, v as TerminalStreamError, w as getSandboxEventText, x as applySandboxEventText, y as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./sandbox-BRZLdcud.js";
6
6
  import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DilBgjXG.js";
7
- import { t as TangleSandboxClient } from "./tangle-B-w03_fQ.js";
7
+ import { t as TangleSandboxClient } from "./tangle-D7KgC1Xb.js";
8
8
  import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
9
9
  import { z } from "zod";
10
10
  //#region src/confidential.ts
@@ -1010,64 +1010,79 @@ function buildControlPlaneMcpConfig(options) {
1010
1010
  //#endregion
1011
1011
  //#region src/resources.ts
1012
1012
  /**
1013
- * The concrete compute behind each {@link SandboxSizePreset} — the SINGLE source
1014
- * of truth for what a tier means. `@tangle-network/agent-interface` owns the
1015
- * tier NAMES (so the lowest layer can reference a size); this owns the numbers.
1013
+ * The compute behind each {@link SandboxSizePreset} as the sandbox API
1014
+ * defines it. The API owns these numbers and serves them from
1015
+ * `GET /v1/shapes` ({@link Sandbox.shapes}); this table is the offline
1016
+ * mirror for a caller that must resolve a tier before it holds a client (a
1017
+ * workflow definition, a tool spec) and is pinned to the API's table by a
1018
+ * drift test. `@tangle-network/agent-interface` owns the tier NAMES so the
1019
+ * lowest layer can reference a size.
1016
1020
  *
1017
- * Values stay within the sandbox-api default plan caps (8 vCPU / 16 GB / 100 GB)
1018
- * and keep memory at or above the driver's firecracker-snapshot floor (1536 MB),
1019
- * so a requested tier is never silently bumped. `diskGB` is in gigabytes;
1020
- * `memoryMB` in megabytes. The server still clamps every request to the owner's
1021
- * actual plan limits — these are the unclamped tier definitions, not guarantees.
1021
+ * `large` equals the deployment's default per-box ceiling (8 vCPU / 16 GB /
1022
+ * 100 GB), so every tier is creatable on a deployment that leaves
1023
+ * `MAX_SANDBOX_*` unset. The server still clamps an advisory request and
1024
+ * refuses an explicit one above the account's ceiling — read `shapes()` for
1025
+ * that ceiling.
1022
1026
  */
1023
1027
  const SANDBOX_SIZE_PRESETS = {
1024
1028
  nano: {
1025
1029
  cpuCores: 1,
1026
1030
  memoryMB: 2048,
1027
- diskGB: 5
1031
+ diskGB: 10
1028
1032
  },
1029
1033
  small: {
1030
1034
  cpuCores: 2,
1031
1035
  memoryMB: 4096,
1032
- diskGB: 10
1036
+ diskGB: 20
1033
1037
  },
1034
1038
  medium: {
1035
1039
  cpuCores: 4,
1036
1040
  memoryMB: 8192,
1037
- diskGB: 20
1041
+ diskGB: 50
1038
1042
  },
1039
1043
  large: {
1040
1044
  cpuCores: 8,
1041
1045
  memoryMB: 16384,
1042
- diskGB: 50
1046
+ diskGB: 100
1043
1047
  }
1044
1048
  };
1045
1049
  /**
1046
- * Default tier when a caller provisions without picking a size. The smallest
1047
- * tier that comfortably runs an agent harness (opencode + a repo clone + a
1048
- * build) — deliberately NOT a maxed box, so a thin task is cheap by default and
1049
- * a heavy one opts up explicitly.
1050
+ * The platform's default tier, served as `default` by `GET /v1/shapes`. An
1051
+ * unsized create is granted this tier's CPU and memory and reports the grant
1052
+ * in `resources`; its DISK is currently held below this tier (see that
1053
+ * endpoint's description), so expand the tier locally only when you also send
1054
+ * it as a request.
1050
1055
  */
1051
1056
  const DEFAULT_SANDBOX_SIZE = "small";
1052
- /** The resources for a named tier, as a fresh object (never the shared preset).
1053
- * Fails loud on an unknown key rather than spreading `undefined` into an empty
1054
- * resources object — a silent zero would send no compute request downstream. */
1055
- function sandboxResourcesForSize(size) {
1056
- const preset = SANDBOX_SIZE_PRESETS[size];
1057
+ /**
1058
+ * The resources for a named tier, as a fresh object (never the shared preset).
1059
+ * Pass the `presets` from {@link Sandbox.shapes} to expand the tier to what
1060
+ * the serving deployment defines; without them the pinned mirror applies.
1061
+ * Fails loud on an unknown key rather than spreading `undefined` into an
1062
+ * empty resources object — a silent zero would send no compute request
1063
+ * downstream.
1064
+ */
1065
+ function sandboxResourcesForSize(size, presets) {
1066
+ const served = presets?.find((preset) => preset.name === size);
1067
+ const preset = served ? {
1068
+ cpuCores: served.cpuCores,
1069
+ memoryMB: served.memoryMB,
1070
+ diskGB: served.diskGB
1071
+ } : SANDBOX_SIZE_PRESETS[size];
1057
1072
  if (!preset) throw new Error(`sandboxResourcesForSize: unknown size preset '${size}' (expected one of ${SANDBOX_SIZE_PRESET_NAMES.join(", ")})`);
1058
1073
  return { ...preset };
1059
1074
  }
1060
1075
  /**
1061
1076
  * Resolve a caller's size intent to concrete {@link SandboxResources}. Raw
1062
1077
  * `resources` win (an explicit cpu/memory request is authoritative); else a
1063
- * named `size` expands to its preset; else `undefined` (the caller applies its
1064
- * own default). Raw and preset are intentionally exclusive at the schema layer —
1065
- * if both arrive here, the explicit numbers take precedence rather than being
1066
- * silently merged.
1078
+ * named `size` expands to its preset; else `undefined` (the API applies
1079
+ * {@link DEFAULT_SANDBOX_SIZE}). Raw and preset are intentionally exclusive at
1080
+ * the schema layer — if both arrive here, the explicit numbers take precedence
1081
+ * rather than being silently merged.
1067
1082
  */
1068
1083
  function resolveSandboxResources(opts) {
1069
1084
  if (opts.resources) return opts.resources;
1070
- if (opts.size) return sandboxResourcesForSize(opts.size);
1085
+ if (opts.size) return sandboxResourcesForSize(opts.size, opts.presets);
1071
1086
  }
1072
1087
  //#endregion
1073
1088
  //#region src/router-search.ts
@@ -1,6 +1,6 @@
1
1
  import { d as SandboxError, f as ServerError, g as parseErrorResponse, h as ValidationError, m as TimeoutError, n as CapabilityError, s as NetworkError, u as QuotaError } from "./errors-CdDyExth.js";
2
2
  import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
3
- import { AgentExactRunControlRefSchema, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, DurablePlanSchema, InteractionRequestSchema, agentProfileSchema, harnessTypeSchema } from "@tangle-network/agent-interface";
3
+ import { AgentExactRunControlRefSchema, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, DurablePlanSchema, InteractionRequestSchema, agentProfileSchema, canonicalCandidateDigest, harnessTypeSchema } from "@tangle-network/agent-interface";
4
4
  import { z } from "zod";
5
5
  //#region ../../../packages/runtime-contracts/dist/backend-types.js
6
6
  /**
@@ -796,6 +796,57 @@ function isFileTooLargeErrorBody(value) {
796
796
  return isSizeLimitErrorBodyFor(value, FILE_TOO_LARGE_CODE);
797
797
  }
798
798
  //#endregion
799
+ //#region src/dispatch-run-control.ts
800
+ const DISPATCH_RUN_PROVIDER = "tangle-sandbox";
801
+ function generateRuntimeId(prefix) {
802
+ const crypto = globalThis.crypto;
803
+ if (crypto?.randomUUID) return `${prefix}-${crypto.randomUUID()}`;
804
+ if (crypto?.getRandomValues) {
805
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
806
+ return `${prefix}-${Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
807
+ }
808
+ throw new ValidationError("Run identity generation requires global crypto");
809
+ }
810
+ function resolveDispatchRunIdentity(sandboxId, message, options) {
811
+ const sessionId = options?.sessionId ?? options?.runControlRef?.sessionId ?? generateRuntimeId("session");
812
+ const executionId = options?.executionId ?? options?.runControlRef?.executionId ?? generateRuntimeId("execution");
813
+ return {
814
+ sessionId,
815
+ executionId,
816
+ runControlRef: options?.runControlRef ?? {
817
+ runId: generateRuntimeId("run"),
818
+ provider: DISPATCH_RUN_PROVIDER,
819
+ environmentId: sandboxId,
820
+ sessionId,
821
+ executionId,
822
+ requestDigest: canonicalCandidateDigest({
823
+ message,
824
+ sessionId,
825
+ turnId: options?.turnId ?? null,
826
+ backend: options?.backend ?? null,
827
+ model: options?.model ?? null,
828
+ context: options?.context ?? null
829
+ })
830
+ }
831
+ };
832
+ }
833
+ function sameExactRunControlRef(left, right) {
834
+ return left.runId === right.runId && left.provider === right.provider && left.environmentId === right.environmentId && left.sessionId === right.sessionId && left.executionId === right.executionId && left.requestDigest === right.requestDigest;
835
+ }
836
+ function validateAcceptedDispatchRunRef(raw, expected, sandboxId, sessionId, executionId, endpoint = "/agents/run/stream") {
837
+ const parsed = AgentExactRunControlRefSchema.safeParse(raw);
838
+ if (!parsed.success) throw new ServerError("Sandbox returned an invalid exact run reference on admission", 502, {
839
+ origin: "runtime",
840
+ endpoint
841
+ });
842
+ const accepted = parsed.data;
843
+ if (accepted.environmentId !== sandboxId || accepted.sessionId !== sessionId || accepted.executionId !== executionId || !sameExactRunControlRef(accepted, expected)) throw new ServerError("Sandbox returned an exact run reference for another execution", 502, {
844
+ origin: "runtime",
845
+ endpoint
846
+ });
847
+ return accepted;
848
+ }
849
+ //#endregion
799
850
  //#region src/lib/chunked-upload.ts
800
851
  /**
801
852
  * Chunked upload — the sanctioned SDK path for delivering payloads larger
@@ -1144,16 +1195,48 @@ var SandboxRuntimeApi = class {
1144
1195
  }
1145
1196
  if (options.executionId !== void 0 && !sawTerminal) throw new NetworkError("event stream ended before a terminal event — the connection dropped mid-turn");
1146
1197
  }
1147
- /**
1148
- * List the durable execution records for one session.
1149
- *
1150
- * The sidecar owns this ledger and returns records newest first. Validate
1151
- * the response here so malformed payloads cannot become false run evidence.
1152
- */
1153
- async runs(sessionId) {
1198
+ /** Read a turn's retained admission without proposing or admitting a message. */
1199
+ async admission(sessionId, turnId, options = {}) {
1200
+ if (!sessionId.trim() || !turnId.trim()) throw new ValidationError("sessionId and turnId are required");
1201
+ await this.transport.ensureRunning();
1202
+ const endpoint = `/agents/sessions/${encodeURIComponent(sessionId)}/admissions/${encodeURIComponent(turnId)}`;
1203
+ const payload = await this.json(endpoint, {
1204
+ method: "GET",
1205
+ signal: options.signal
1206
+ });
1207
+ if (payload?.receipt === null) return null;
1208
+ const receipt = payload?.receipt;
1209
+ if (!receipt || typeof receipt.info?.id !== "string" || !receipt.info.id || receipt.processing !== true) throw new ServerError("Runtime returned an invalid message admission receipt", 502, {
1210
+ origin: "runtime",
1211
+ endpoint
1212
+ });
1213
+ const parsedRef = receipt.runControlRef === void 0 ? void 0 : AgentExactRunControlRefSchema.safeParse(receipt.runControlRef);
1214
+ if (parsedRef && !parsedRef.success) throw new ServerError("Admission returned an invalid exact run reference", 502, {
1215
+ origin: "runtime",
1216
+ endpoint
1217
+ });
1218
+ const runControlRef = parsedRef?.data;
1219
+ if (runControlRef && (runControlRef.sessionId !== sessionId || runControlRef.executionId !== receipt.info.id)) throw new ServerError("Admission control reference does not match its execution", 502, {
1220
+ origin: "runtime",
1221
+ endpoint
1222
+ });
1223
+ const run = (await this.runs(sessionId, options)).find((candidate) => candidate.executionId === receipt.info.id);
1224
+ return {
1225
+ sessionId,
1226
+ turnId,
1227
+ executionId: receipt.info.id,
1228
+ status: run?.status ?? "unavailable",
1229
+ ...runControlRef ? { runControlRef } : {}
1230
+ };
1231
+ }
1232
+ /** List validated execution records from the runtime ledger, newest first. */
1233
+ async runs(sessionId, options = {}) {
1154
1234
  await this.transport.ensureRunning();
1155
1235
  const endpoint = `/agents/sessions/${encodeURIComponent(sessionId)}/runs`;
1156
- const payload = await this.json(endpoint, { method: "GET" });
1236
+ const payload = await this.json(endpoint, {
1237
+ method: "GET",
1238
+ signal: options.signal
1239
+ });
1157
1240
  if (payload.success !== true || !Array.isArray(payload.executions)) throw new ServerError("Session runs response has an invalid shape", 502, {
1158
1241
  origin: "runtime",
1159
1242
  endpoint
@@ -1363,30 +1446,18 @@ var SandboxRuntimeApi = class {
1363
1446
  method: "POST",
1364
1447
  headers,
1365
1448
  signal,
1366
- body: JSON.stringify({
1367
- ...request.messageId !== void 0 ? { messageID: request.messageId } : {},
1368
- parts: request.parts.map((part) => part.type === "text" ? {
1369
- ...part,
1370
- text: encodeTextForWire(part.text)
1371
- } : part),
1372
- ...request.system !== void 0 ? { system: request.system } : {},
1373
- ...request.agent !== void 0 ? { agent: request.agent } : {},
1374
- ...request.model !== void 0 ? { model: {
1375
- providerID: request.model.providerId,
1376
- modelID: request.model.modelId
1377
- } } : {},
1378
- ...request.reasoningEffort !== void 0 ? { reasoningEffort: request.reasoningEffort } : {},
1379
- ...request.turnId !== void 0 ? { turnId: request.turnId } : {},
1380
- ...request.interactions !== void 0 ? { interactions: request.interactions } : {}
1381
- })
1449
+ body: JSON.stringify(sessionMessageRequestBody(request))
1382
1450
  };
1451
+ let receipt;
1383
1452
  try {
1384
- return await this.json(path, init);
1453
+ receipt = await this.json(path, init);
1385
1454
  } catch (error) {
1386
1455
  if (!isRetryableCredentialRefusal(error)) throw error;
1387
1456
  await waitForRetryAfter(error.retryAfterMs ?? 1e3, signal);
1388
- return this.json(path, init);
1457
+ receipt = await this.json(path, init);
1389
1458
  }
1459
+ if (request.runControlRef) validateAcceptedDispatchRunRef(receipt.runControlRef, request.runControlRef, request.runControlRef.environmentId, id, receipt.info.id, path);
1460
+ return receipt;
1390
1461
  }
1391
1462
  async deleteSession(id) {
1392
1463
  await this.transport.ensureRunning();
@@ -1554,5 +1625,26 @@ function normalizeSessionInfo(raw) {
1554
1625
  raw
1555
1626
  };
1556
1627
  }
1628
+ /** The admission check must hash the same wire request as dispatch. */
1629
+ function sessionMessageRequestBody(request) {
1630
+ return {
1631
+ ...request.backend !== void 0 ? { backend: normalizeRuntimeBackendConfig(request.backend) } : {},
1632
+ ...request.runControlRef !== void 0 ? { runControlRef: AgentExactRunControlRefSchema.parse(request.runControlRef) } : {},
1633
+ ...request.messageId !== void 0 ? { messageID: request.messageId } : {},
1634
+ parts: request.parts.map((part) => part.type === "text" ? {
1635
+ ...part,
1636
+ text: encodeTextForWire(part.text)
1637
+ } : part),
1638
+ ...request.system !== void 0 ? { system: request.system } : {},
1639
+ ...request.agent !== void 0 ? { agent: request.agent } : {},
1640
+ ...request.model !== void 0 ? { model: {
1641
+ providerID: request.model.providerId,
1642
+ modelID: request.model.modelId
1643
+ } } : {},
1644
+ ...request.reasoningEffort !== void 0 ? { reasoningEffort: request.reasoningEffort } : {},
1645
+ ...request.turnId !== void 0 ? { turnId: request.turnId } : {},
1646
+ ...request.interactions !== void 0 ? { interactions: request.interactions } : {}
1647
+ };
1648
+ }
1557
1649
  //#endregion
1558
- export { deriveAgentRunOutcome as _, uploadChunked as a, parseBackendType as b, encodePromptForWire as c, applyRequestedModel as d, assertCurrentBackendType as f, deriveAgentResultOutcome as g, createAgentRunOutcomeTracker as h, sessionHeaders as i, encodeTextForWire as l, normalizeRuntimeBackendConfig as m, normalizeSessionInfo as n, SANDBOX_PROXY_REQUEST_MAX_BYTES as o, mergeRuntimeBackendConfig as p, appendSessionIdQuery as r, FILE_DECODED_WRITE_MAX_BYTES as s, SandboxRuntimeApi as t, parseSSEStream as u, ALL_BACKEND_TYPES as v, backendTypeSchema as y };
1650
+ export { parseBackendType as C, backendTypeSchema as S, normalizeRuntimeBackendConfig as _, sessionHeaders as a, deriveAgentRunOutcome as b, validateAcceptedDispatchRunRef as c, encodePromptForWire as d, encodeTextForWire as f, mergeRuntimeBackendConfig as g, assertCurrentBackendType as h, appendSessionIdQuery as i, SANDBOX_PROXY_REQUEST_MAX_BYTES as l, applyRequestedModel as m, normalizeSessionInfo as n, uploadChunked as o, parseSSEStream as p, sessionMessageRequestBody as r, resolveDispatchRunIdentity as s, SandboxRuntimeApi as t, FILE_DECODED_WRITE_MAX_BYTES as u, createAgentRunOutcomeTracker as v, ALL_BACKEND_TYPES as x, deriveAgentResultOutcome as y };
package/dist/runtime.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { A as CommitTaskSessionOptions, Ct as FileTreeResult, Di as SessionMessage, Et as FileWriteResult, Gi as TaskSessionInfo, H as CreateTaskSessionOptions, Hi as TaskSessionChanges, Kr as SandboxPortBinding, Qr as SandboxRuntimeHealth, St as FileTreeOptions, T as ChunkedUploadResult, Tt as FileUsageResult, Ui as TaskSessionCommitResult, V as CreateSessionOptions, Yn as RenameOptions, _i as SentSessionMessage, bi as SessionExecutionInfo, ca as WriteFileOptions, dn as ListMessagesOptions, gi as SendSessionMessageRequest, gt as FileReadBatchResult, hi as SendSessionMessageOptions, hr as SandboxEvent, ht as FileReadBatchOptions, ii as SandboxTerminalRequestOptions, ni as SandboxTerminalInfo, ra as UploadProgress, ri as SandboxTerminalManager, ti as SandboxTerminalCreateOptions, w as ChunkedUploadOptions, wi as SessionInfo, wt as FileUsageOptions, xi as SessionExecutionStatus, yi as SessionEventStreamOptions, yt as FileRenameResult } from "./types-B3C-MizG.js";
1
+ import { A as CommitTaskSessionOptions, Ai as SessionMessage, Ci as SessionExecutionInfo, Ct as FileTreeResult, Di as SessionInfo, Et as FileWriteResult, H as CreateTaskSessionOptions, Ki as TaskSessionChanges, Kr as SandboxPortBinding, Qr as SandboxRuntimeHealth, Si as SessionEventStreamOptions, St as FileTreeOptions, T as ChunkedUploadResult, Tt as FileUsageResult, V as CreateSessionOptions, Yi as TaskSessionInfo, Yn as RenameOptions, ai as SandboxTerminalInfo, bi as SentSessionMessage, dn as ListMessagesOptions, fa as WriteFileOptions, gt as FileReadBatchResult, hr as SandboxEvent, ht as FileReadBatchOptions, ii as SandboxTerminalCreateOptions, ji as SessionMessageAdmission, oi as SandboxTerminalManager, qi as TaskSessionCommitResult, sa as UploadProgress, si as SandboxTerminalRequestOptions, vi as SendSessionMessageOptions, w as ChunkedUploadOptions, wi as SessionExecutionStatus, wt as FileUsageOptions, yi as SendSessionMessageRequest, yt as FileRenameResult } from "./types-C3Kw-Tml.js";
2
2
  import { _ as ValidationError, a as FileWriteConflictError, c as NotFoundError, d as SandboxError, f as SandboxErrorJson, g as TimeoutError, h as StateError, l as PartialFailureError, m as ServerError, n as CapabilityError, p as SandboxFailureDetail, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-BoD3Ifbd.js";
3
- import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-BpQhOdXp.js";
3
+ import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-B_DRpTxx.js";
4
4
 
5
5
  //#region src/lib/chunked-upload.d.ts
6
6
  /** The transport a caller wires this module to — {@link SandboxInstance.runtimeFetch}
@@ -56,13 +56,14 @@ declare class SandboxRuntimeApi {
56
56
  * the token for.
57
57
  */
58
58
  events(sessionId: string, options?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
59
- /**
60
- * List the durable execution records for one session.
61
- *
62
- * The sidecar owns this ledger and returns records newest first. Validate
63
- * the response here so malformed payloads cannot become false run evidence.
64
- */
65
- runs(sessionId: string): Promise<SessionExecutionInfo[]>;
59
+ /** Read a turn's retained admission without proposing or admitting a message. */
60
+ admission(sessionId: string, turnId: string, options?: {
61
+ signal?: AbortSignal;
62
+ }): Promise<SessionMessageAdmission | null>;
63
+ /** List validated execution records from the runtime ledger, newest first. */
64
+ runs(sessionId: string, options?: {
65
+ signal?: AbortSignal;
66
+ }): Promise<SessionExecutionInfo[]>;
66
67
  readFiles(paths: string[], options?: FileReadBatchOptions): Promise<FileReadBatchResult>;
67
68
  writeFile(path: string, content: string, options?: WriteFileOptions): Promise<FileWriteResult>;
68
69
  /**
@@ -128,4 +129,4 @@ declare class SandboxRuntimeClient extends SandboxRuntimeApi {
128
129
  }
129
130
  declare function createSandboxRuntimeClient(config: SandboxRuntimeClientConfig): SandboxRuntimeClient;
130
131
  //#endregion
131
- export { type AgentRunOutcome, type AgentRunOutcomeTracker, AuthError, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type ChunkedUploadTransport, type FileReadBatchOptions, type FileReadBatchResult, type FileRenameResult, type FileTreeOptions, type FileTreeResult, FileWriteConflictError, type FileWriteResult, type ListMessagesOptions, NetworkError, NotFoundError, PartialFailureError, QuotaError, type RenameOptions, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxRuntimeClient, type SandboxRuntimeClientConfig, type SandboxRuntimeHealth, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, ServerError, type SessionEventStreamOptions, type SessionExecutionInfo, type SessionExecutionStatus, type SessionMessage, StateError, TimeoutError, type UploadProgress, ValidationError, type WriteFileOptions, createAgentRunOutcomeTracker, createSandboxRuntimeClient, deriveAgentResultOutcome, deriveAgentRunOutcome, uploadChunked };
132
+ export { type AgentRunOutcome, type AgentRunOutcomeTracker, AuthError, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type ChunkedUploadTransport, type FileReadBatchOptions, type FileReadBatchResult, type FileRenameResult, type FileTreeOptions, type FileTreeResult, FileWriteConflictError, type FileWriteResult, type ListMessagesOptions, NetworkError, NotFoundError, PartialFailureError, QuotaError, type RenameOptions, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxRuntimeClient, type SandboxRuntimeClientConfig, type SandboxRuntimeHealth, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, ServerError, type SessionEventStreamOptions, type SessionExecutionInfo, type SessionExecutionStatus, type SessionMessage, type SessionMessageAdmission, StateError, TimeoutError, type UploadProgress, ValidationError, type WriteFileOptions, createAgentRunOutcomeTracker, createSandboxRuntimeClient, deriveAgentResultOutcome, deriveAgentRunOutcome, uploadChunked };
package/dist/runtime.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as deriveAgentRunOutcome, a as uploadChunked, g as deriveAgentResultOutcome, h as createAgentRunOutcomeTracker, t as SandboxRuntimeApi } from "./runtime-api-C10Hg1OF.js";
1
+ import { b as deriveAgentRunOutcome, o as uploadChunked, t as SandboxRuntimeApi, v as createAgentRunOutcomeTracker, y as deriveAgentResultOutcome } from "./runtime-api-D7CdKcbu.js";
2
2
  import { a as FileWriteConflictError, c as NotFoundError, d as SandboxError, f as ServerError, h as ValidationError, l as PartialFailureError, m as TimeoutError, n as CapabilityError, p as StateError, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-CdDyExth.js";
3
3
  import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
4
4
  //#region src/runtime-client.ts