@tangle-network/sandbox 0.60.41-develop.20261012074530.e978912 → 0.60.41-develop.20261012103849.9009d74

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.
@@ -1,8 +1,8 @@
1
1
  import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-DjryqUiY.js";
2
2
  import { E as assertCurrentBackendType } from "../interactive-controller-Dxt5sW2N.js";
3
3
  import { h as StateError, l as NotFoundError, v as ValidationError } from "../errors-Cq4hMysQ.js";
4
- import { n as Sandbox } from "../client-CGbGnrBO.js";
5
- import { t as SandboxInstance } from "../sandbox-uwsfBoYj.js";
4
+ import { n as Sandbox } from "../client-BA_a3iST.js";
5
+ import { t as SandboxInstance } from "../sandbox-Bg7l8Swk.js";
6
6
  import { z } from "zod";
7
7
  //#region src/agent/instances.ts
8
8
  const managers = /* @__PURE__ */ new WeakMap();
@@ -2,7 +2,7 @@ import { r as backendTypeSchema } from "./backend-types-C7b_Gpa0.js";
2
2
  import { D as foldModelRoutingFields, E as assertCurrentBackendType, M as withProfileHarness, S as encodePromptForWire, T as applyRequestedModel, k as normalizeRuntimeBackendConfig, s as requestInteractiveSessionToken, w as parseSSEStream } from "./interactive-controller-Dxt5sW2N.js";
3
3
  import { _ as TimeoutError, b as parseResponseError, c as NetworkError, d as QuotaError, l as NotFoundError, m as ServerError, p as SandboxError, s as NON_RETRYABLE_CREATE_QUOTA_REASONS, t as AuthError, u as PartialFailureError, v as ValidationError, x as readResponseJson, y as parseErrorResponse } from "./errors-Cq4hMysQ.js";
4
4
  import { f as combineAbortSignals } from "./browser-interactive-control-controller-BJf0P_J4.js";
5
- import { A as exportTraceBundle, C as splitInlineProfileFileMounts, D as normalizeSandboxShape, E as normalizeConnection, O as rewrapResponse, T as validateDeferredProfileFileMounts, a as normalizeStartupDiagnostics, i as normalizeSandboxCreateReceipt, n as createSandboxInstanceFromResponse, r as normalizeCaptureProof, w as splitInlineProfileSkills } from "./sandbox-uwsfBoYj.js";
5
+ import { A as exportTraceBundle, C as splitInlineProfileFileMounts, D as normalizeSandboxShape, E as normalizeConnection, O as rewrapResponse, T as validateDeferredProfileFileMounts, a as normalizeStartupDiagnostics, i as normalizeSandboxCreateReceipt, n as createSandboxInstanceFromResponse, r as normalizeCaptureProof, w as splitInlineProfileSkills } from "./sandbox-Bg7l8Swk.js";
6
6
  import { LinesClient } from "./lines.js";
7
7
  import { agentProfileSchema } from "@tangle-network/agent-interface";
8
8
  import { z } from "zod";
package/dist/core.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ as TimeoutError, a as FileWriteConflictError, c as NetworkError, d as QuotaError, h as StateError, l as NotFoundError, m as ServerError, n as CapabilityError, p as SandboxError, t as AuthError, u as PartialFailureError, v as ValidationError } from "./errors-Cq4hMysQ.js";
2
- import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-CGbGnrBO.js";
3
- import { o as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-uwsfBoYj.js";
2
+ import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-BA_a3iST.js";
3
+ import { o as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-Bg7l8Swk.js";
4
4
  import { LinesClient, lineInstanceKey, profileChannelReference } from "./lines.js";
5
5
  import { i as parseLineApplicationResult, n as LINE_APPLICATION_REQUEST_MAX_BYTES, r as parseLineApplicationRequest, t as LINE_APPLICATION_REPLY_MAX_CHARS } from "./line-application-Cq6dJLBD.js";
6
6
  //#region src/core.ts
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { i as parseBackendType, r as backendTypeSchema, t as ALL_BACKEND_TYPES } from "./backend-types-C7b_Gpa0.js";
2
2
  import { A as requestedPublicProfileDigest, F as deriveAgentResultOutcome, I as deriveAgentRunOutcome, L as projectAgentTerminalRecord, P as createAgentRunOutcomeTracker, a as TERMINAL_WS_ECHO_SUBPROTOCOL, i as TerminalStreamError, k as normalizeRuntimeBackendConfig, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, w as parseSSEStream } from "./interactive-controller-Dxt5sW2N.js";
3
3
  import { _ as TimeoutError, a as FileWriteConflictError, c as NetworkError, d as QuotaError, f as ResumeEnvRequiredError, g as StreamInterruptedError, h as StateError, i as EgressProxyRecoveryError, l as NotFoundError, m as ServerError, n as CapabilityError, o as KeyBudgetExhaustedError, p as SandboxError, r as EdgeNotReadyError, t as AuthError, u as PartialFailureError, v as ValidationError } from "./errors-Cq4hMysQ.js";
4
- import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, r as RunsClient, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-CGbGnrBO.js";
4
+ import { _ as parseBackendRegistryResponse, a as InstanceRestartingError, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as HostedInstance, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as InstancesClient, p as backendRegistryEntrySchema, r as RunsClient, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-BA_a3iST.js";
5
5
  import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-BJf0P_J4.js";
6
- import { A as exportTraceBundle, C as splitInlineProfileFileMounts, M as toOtelJson, S as materializeProfileFileMounts, T as validateDeferredProfileFileMounts, _ as collectAgentFinalMessageText, b as isToolBearingEvent, c as MAX_EGRESS_DENIALS_LIMIT, d as InteractiveSessionHandle, f as agentInteractiveSessionPromptRequestDigest, g as applySandboxEventText, h as createInteractiveTerminalSession, j as otelTraceIdForTangleTrace, k as buildTraceExportPayload, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as WorkspaceImages, p as InteractiveTerminalFrameLog, s as GPU_LEASE_PROVIDER_NAMES, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as splitInlineProfileSkills, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-uwsfBoYj.js";
6
+ import { A as exportTraceBundle, C as splitInlineProfileFileMounts, M as toOtelJson, S as materializeProfileFileMounts, T as validateDeferredProfileFileMounts, _ as collectAgentFinalMessageText, b as isToolBearingEvent, c as MAX_EGRESS_DENIALS_LIMIT, d as InteractiveSessionHandle, f as agentInteractiveSessionPromptRequestDigest, g as applySandboxEventText, h as createInteractiveTerminalSession, j as otelTraceIdForTangleTrace, k as buildTraceExportPayload, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as WorkspaceImages, p as InteractiveTerminalFrameLog, s as GPU_LEASE_PROVIDER_NAMES, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as splitInlineProfileSkills, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-Bg7l8Swk.js";
7
7
  import { LinesClient, SandboxLines, lineInstanceKey, profileChannelReference } from "./lines.js";
8
8
  import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DaWEv29D.js";
9
9
  import { i as parseLineApplicationResult, n as LINE_APPLICATION_REQUEST_MAX_BYTES, r as parseLineApplicationRequest, t as LINE_APPLICATION_REPLY_MAX_CHARS } from "./line-application-Cq6dJLBD.js";
10
- import { s as TangleSandboxClient } from "./tangle-B06VSOdG.js";
10
+ import { s as TangleSandboxClient } from "./tangle-Ili8hE8y.js";
11
11
  import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
12
12
  import { z } from "zod";
13
13
  //#region src/confidential.ts
@@ -9229,13 +9229,14 @@ var DirectRuntimeHttpClient = class {
9229
9229
  const directTimeoutMs = fetchOptions?.timeoutMs;
9230
9230
  if (!init.signal && typeof directTimeoutMs === "number" && directTimeoutMs > 0) init.signal = AbortSignal.timeout(directTimeoutMs);
9231
9231
  let response = await fetch(targetUrl, init);
9232
- if (response.status === 401 && this.onUnauthorized && !headers.has("x-no-retry")) {
9232
+ if ((response.status === 401 || response.status === 403 && await isRefusedBearer(response)) && this.onUnauthorized && !headers.has("x-no-retry")) {
9233
+ const refusedStatus = response.status;
9233
9234
  await response.arrayBuffer().catch(() => void 0);
9234
9235
  try {
9235
9236
  await this.onUnauthorized();
9236
9237
  } catch {
9237
9238
  return new Response("", {
9238
- status: 401,
9239
+ status: refusedStatus,
9239
9240
  statusText: response.statusText
9240
9241
  });
9241
9242
  }
@@ -9254,6 +9255,18 @@ var DirectRuntimeHttpClient = class {
9254
9255
  return rewrapResponse(response, responseHeaders);
9255
9256
  }
9256
9257
  };
9258
+ /**
9259
+ * True when a 403 is the sidecar refusing the bearer itself, not a bearer
9260
+ * that lacks a capability. Reads a clone, so the caller keeps the body.
9261
+ */
9262
+ async function isRefusedBearer(response) {
9263
+ try {
9264
+ const body = await response.clone().json();
9265
+ return body.error?.code === "FORBIDDEN" && body.error.message === "Invalid authentication token";
9266
+ } catch {
9267
+ return false;
9268
+ }
9269
+ }
9257
9270
  function quoteForShell(value) {
9258
9271
  if (value.includes("\0")) throw new Error("Shell argument contains NUL byte");
9259
9272
  return `'${value.replace(/'/g, "'\\''")}'`;
@@ -1,2 +1,2 @@
1
- import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as JOB_SANDBOX_DELETE, f as TANGLE_CHAIN_ID, g as JsonResponseParamTypes, h as ITangleJobsAbi, i as jobQuoteDigest, l as OperatorSessionError, m as AgentSandboxBlueprintAbi, n as fetchQuote, o as validateQuote, p as TANGLE_JOBS_CONTRACT, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as JOB_SANDBOX_CREATE, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-B06VSOdG.js";
1
+ import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as JOB_SANDBOX_DELETE, f as TANGLE_CHAIN_ID, g as JsonResponseParamTypes, h as ITangleJobsAbi, i as jobQuoteDigest, l as OperatorSessionError, m as AgentSandboxBlueprintAbi, n as fetchQuote, o as validateQuote, p as TANGLE_JOBS_CONTRACT, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as JOB_SANDBOX_CREATE, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-Ili8hE8y.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,5 +1,5 @@
1
1
  import { x as readResponseJson } from "./errors-Cq4hMysQ.js";
2
- import { n as createSandboxInstanceFromResponse } from "./sandbox-uwsfBoYj.js";
2
+ import { n as createSandboxInstanceFromResponse } from "./sandbox-Bg7l8Swk.js";
3
3
  import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-B7_9Hl_z.js";
4
4
  //#region src/tangle/abi.ts
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "0.60.41-develop.20261012074530.e978912",
3
+ "version": "0.60.41-develop.20261012103849.9009d74",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -150,12 +150,12 @@
150
150
  "ws": "^8.20.0",
151
151
  "yjs": "13.6.30",
152
152
  "@products/sandbox-test-utils": "0.0.0",
153
- "@tangle-network/agent-profile-materialize": "0.23.1",
154
- "@repo/shared": "0.0.0",
153
+ "@tangle-network/runtime-contracts": "0.16.0",
155
154
  "@tangle-network/sdk": "4.0.3",
156
155
  "@tangle-network/cli-agent-registry": "0.6.2",
157
- "@tangle-network/runtime-contracts": "0.16.0",
158
- "@tangle-network/sse-core": "0.0.0"
156
+ "@tangle-network/sse-core": "0.0.0",
157
+ "@repo/shared": "0.0.0",
158
+ "@tangle-network/agent-profile-materialize": "0.23.1"
159
159
  },
160
160
  "scripts": {
161
161
  "build": "node scripts/build-dist.mjs",