@tangle-network/sandbox 0.43.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-BSZbRoHp.d.ts → agent-run-outcome-B_DRpTxx.d.ts} +1 -1
- package/dist/{client-DuC9Z9zp.js → client-BSNkAx2K.js} +53 -5
- package/dist/{client-Bd-hvjk_.d.ts → client-DdmHMuCL.d.ts} +23 -2
- package/dist/core.d.ts +12 -4
- package/dist/core.js +10 -3
- package/dist/{index-BpO7MMIC.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-BpOFn4cB.js → runtime-api-D7CdKcbu.js} +121 -28
- package/dist/runtime.d.ts +11 -10
- package/dist/runtime.js +1 -1
- package/dist/{sandbox-CWoNC94K.js → sandbox-BRZLdcud.js} +483 -68
- package/dist/{sandbox-DVJ-rfdd.d.ts → sandbox-cTa_FF5p.d.ts} +58 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-O1Hi84be.js → tangle-D7KgC1Xb.js} +1 -1
- package/dist/{types-DKtPjwgd.d.ts → types-C3Kw-Tml.d.ts} +134 -4
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -33,6 +33,9 @@ export SANDBOX_BASE_URL=https://sandbox.tangle.tools
|
|
|
33
33
|
| Browser-safe trace reads from Tangle Intelligence | `@tangle-network/sandbox/intelligence` |
|
|
34
34
|
|
|
35
35
|
Install an optional peer dependency only when the selected integration requires it.
|
|
36
|
+
The AI SDK tool pack supports the declared AI 6 and AI 7 peer ranges.
|
|
37
|
+
The Mastra tool pack validates arguments before it calls a Sandbox operation.
|
|
38
|
+
Both tool packs pass the selected session to operations that support sessions.
|
|
36
39
|
|
|
37
40
|
## Credential boundary
|
|
38
41
|
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-
|
|
2
|
-
import { D as CodeExecutionResult,
|
|
3
|
-
import { i as Sandbox } from "../client-
|
|
1
|
+
import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-cTa_FF5p.js";
|
|
2
|
+
import { D as CodeExecutionResult, Di as SessionInfo, E as CodeExecutionOptions, O as CodeLanguage, d as BackendConfig, k as CodeResultPart, ki as SessionListOptions } from "../types-C3Kw-Tml.js";
|
|
3
|
+
import { i as Sandbox } from "../client-DdmHMuCL.js";
|
|
4
4
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
|
+
import { JSONSchema } from "zod/v4/core";
|
|
5
6
|
|
|
6
7
|
//#region src/agent/instances.d.ts
|
|
7
8
|
/**
|
|
@@ -97,7 +98,7 @@ declare module "../sandbox.js" {
|
|
|
97
98
|
/** JSON-schema-ish object describing tool inputs. Plain object literal — no Zod required. */
|
|
98
99
|
type ToolJSONSchema = {
|
|
99
100
|
type: "object";
|
|
100
|
-
properties: Record<string,
|
|
101
|
+
properties: Record<string, JSONSchema.JSONSchema>;
|
|
101
102
|
required?: string[];
|
|
102
103
|
additionalProperties?: boolean;
|
|
103
104
|
};
|
|
@@ -502,7 +503,6 @@ interface MastraToolPackOptions {
|
|
|
502
503
|
allow?: ToolName[];
|
|
503
504
|
sessionId?: string;
|
|
504
505
|
}
|
|
505
|
-
type AnyTool$1 = unknown;
|
|
506
506
|
/**
|
|
507
507
|
* Build a Mastra tool pack bound to one sandbox.
|
|
508
508
|
*
|
|
@@ -516,7 +516,7 @@ type AnyTool$1 = unknown;
|
|
|
516
516
|
* await agent.generate("Plot sin(x).");
|
|
517
517
|
* ```
|
|
518
518
|
*/
|
|
519
|
-
declare function mastraTools(box: SandboxInstance, options?: MastraToolPackOptions): Promise<Record<string,
|
|
519
|
+
declare function mastraTools(box: SandboxInstance, options?: MastraToolPackOptions): Promise<Record<string, unknown>>;
|
|
520
520
|
//#endregion
|
|
521
521
|
//#region src/agent/tools/openai.d.ts
|
|
522
522
|
interface OpenAITool {
|
package/dist/agent/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as assertCurrentBackendType } from "../runtime-api-D7CdKcbu.js";
|
|
2
2
|
import { c as NotFoundError, h as ValidationError, p as StateError } from "../errors-CdDyExth.js";
|
|
3
|
-
import { n as Sandbox } from "../client-
|
|
4
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
3
|
+
import { n as Sandbox } from "../client-BSNkAx2K.js";
|
|
4
|
+
import { t as SandboxInstance } from "../sandbox-BRZLdcud.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
|
+
import { z } from "zod";
|
|
6
7
|
//#region src/agent/instances.ts
|
|
7
8
|
const managers = /* @__PURE__ */ new WeakMap();
|
|
8
9
|
function generateAgentId() {
|
|
@@ -682,6 +683,23 @@ function selectFleetSpecs(allow) {
|
|
|
682
683
|
}
|
|
683
684
|
//#endregion
|
|
684
685
|
//#region src/agent/tools/fleet/index.ts
|
|
686
|
+
/**
|
|
687
|
+
* Fleet tool packs — one per framework. The shape mirrors the per-box
|
|
688
|
+
* packs (`anthropicTools`, `openaiTools`, etc.), bound to a Sandbox
|
|
689
|
+
* instead of a single SandboxInstance because fleet lifecycle is multi-
|
|
690
|
+
* machine and outlives any one sandbox handle.
|
|
691
|
+
*
|
|
692
|
+
* Fleet tools default-OFF in the agent's allow-list discipline: the
|
|
693
|
+
* operator passes `allow: ["sandbox_fleet_spawn", "sandbox_fleet_dispatch", ...]`
|
|
694
|
+
* to opt in. This is a cost gate — a single `sandbox_fleet_spawn({workers: 16})`
|
|
695
|
+
* provisions 17 sandboxes (16 workers + 1 coordinator) and bills linearly.
|
|
696
|
+
*
|
|
697
|
+
* Operationally: the agent threads `fleetId` through its tool-use history.
|
|
698
|
+
* After a `sandbox_fleet_spawn` returns `{fleetId, machineIds}`, every
|
|
699
|
+
* subsequent fleet call carries that `fleetId`. The agent is also
|
|
700
|
+
* responsible for calling `sandbox_fleet_destroy` when the campaign ends;
|
|
701
|
+
* orphaned fleets keep accruing cost.
|
|
702
|
+
*/
|
|
685
703
|
function anthropicFleetTools(client, options = {}) {
|
|
686
704
|
const specs = selectFleetSpecs(options.allow);
|
|
687
705
|
const handlers = buildFleetHandlers(specs, { client });
|
|
@@ -770,7 +788,7 @@ async function vercelAiFleetTools(client, options = {}) {
|
|
|
770
788
|
const result = {};
|
|
771
789
|
for (const spec of specs) result[spec.name] = ai.tool({
|
|
772
790
|
description: spec.description,
|
|
773
|
-
inputSchema:
|
|
791
|
+
inputSchema: z.fromJSONSchema(spec.inputSchema).pipe(z.record(z.string(), z.unknown())),
|
|
774
792
|
execute: async (args) => {
|
|
775
793
|
const h = handlers.get(spec.name);
|
|
776
794
|
if (!h) throw new Error(`Unknown fleet tool: ${spec.name}`);
|
|
@@ -782,7 +800,7 @@ async function vercelAiFleetTools(client, options = {}) {
|
|
|
782
800
|
async function mastraFleetTools(client, options = {}) {
|
|
783
801
|
let mastra;
|
|
784
802
|
try {
|
|
785
|
-
mastra = await import("@mastra/core");
|
|
803
|
+
mastra = await import("@mastra/core/tools");
|
|
786
804
|
} catch {
|
|
787
805
|
throw new Error("mastraFleetTools(): the `@mastra/core` package is not installed. Install via `pnpm add @mastra/core`.");
|
|
788
806
|
}
|
|
@@ -792,11 +810,11 @@ async function mastraFleetTools(client, options = {}) {
|
|
|
792
810
|
for (const spec of specs) result[spec.name] = mastra.createTool({
|
|
793
811
|
id: spec.name,
|
|
794
812
|
description: spec.description,
|
|
795
|
-
inputSchema:
|
|
813
|
+
inputSchema: z.fromJSONSchema(spec.inputSchema).pipe(z.record(z.string(), z.unknown())),
|
|
796
814
|
execute: async (input) => {
|
|
797
815
|
const h = handlers.get(spec.name);
|
|
798
816
|
if (!h) throw new Error(`Unknown fleet tool: ${spec.name}`);
|
|
799
|
-
return { result: serializeToolResult(await h(input
|
|
817
|
+
return { result: serializeToolResult(await h(input)) };
|
|
800
818
|
}
|
|
801
819
|
});
|
|
802
820
|
return result;
|
|
@@ -994,6 +1012,15 @@ function buildLifecycleHandlers(specs, ctx) {
|
|
|
994
1012
|
//#endregion
|
|
995
1013
|
//#region src/agent/tools/mastra.ts
|
|
996
1014
|
/**
|
|
1015
|
+
* Mastra tool pack.
|
|
1016
|
+
*
|
|
1017
|
+
* Returns a `Record<id, Tool>` ready for `new Agent({ tools })`.
|
|
1018
|
+
* The registry's JSON schemas become validated object inputs.
|
|
1019
|
+
*
|
|
1020
|
+
* `@mastra/core` is dynamically imported. Install it in your app:
|
|
1021
|
+
* pnpm add @mastra/core
|
|
1022
|
+
*/
|
|
1023
|
+
/**
|
|
997
1024
|
* Build a Mastra tool pack bound to one sandbox.
|
|
998
1025
|
*
|
|
999
1026
|
* @example
|
|
@@ -1009,7 +1036,7 @@ function buildLifecycleHandlers(specs, ctx) {
|
|
|
1009
1036
|
async function mastraTools(box, options = {}) {
|
|
1010
1037
|
let mastra;
|
|
1011
1038
|
try {
|
|
1012
|
-
mastra = await import("@mastra/core");
|
|
1039
|
+
mastra = await import("@mastra/core/tools");
|
|
1013
1040
|
} catch {
|
|
1014
1041
|
throw new Error("mastraTools(): the `@mastra/core` package is not installed. Install it via `pnpm add @mastra/core`.");
|
|
1015
1042
|
}
|
|
@@ -1024,9 +1051,9 @@ async function mastraTools(box, options = {}) {
|
|
|
1024
1051
|
result[spec.name] = mastra.createTool({
|
|
1025
1052
|
id: spec.name,
|
|
1026
1053
|
description: spec.description,
|
|
1027
|
-
inputSchema:
|
|
1054
|
+
inputSchema: z.fromJSONSchema(spec.inputSchema).pipe(z.record(z.string(), z.unknown())),
|
|
1028
1055
|
execute: async (input) => {
|
|
1029
|
-
return { result: serializeToolResult(await handler(input
|
|
1056
|
+
return { result: serializeToolResult(await handler(input)) };
|
|
1030
1057
|
}
|
|
1031
1058
|
});
|
|
1032
1059
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AgentQuestionRequest,
|
|
1
|
+
import { a as AgentQuestionRequest, hr as SandboxEvent, i as AgentApprovalRequirement, nt as DurablePlanSnapshot, o as AgentRunStatus, s as AgentToolInvocation } from "./types-C3Kw-Tml.js";
|
|
2
2
|
import { InteractionRequest } from "@tangle-network/agent-interface";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-run-outcome.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as backendTypeSchema, _ as normalizeRuntimeBackendConfig, d as encodePromptForWire, f as encodeTextForWire, h as assertCurrentBackendType, l as SANDBOX_PROXY_REQUEST_MAX_BYTES, m as applyRequestedModel, p as parseSSEStream } from "./runtime-api-D7CdKcbu.js";
|
|
2
2
|
import { c as NotFoundError, d as SandboxError, f as ServerError, g as parseErrorResponse, h as ValidationError, l as PartialFailureError, m as TimeoutError, s as NetworkError, t as AuthError } from "./errors-CdDyExth.js";
|
|
3
3
|
import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
|
|
4
|
-
import {
|
|
4
|
+
import { D as normalizeSandboxShape, E as normalizeConnection, b as requestInteractiveSessionToken, i as normalizeStartupDiagnostics, k as exportTraceBundle, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt } from "./sandbox-BRZLdcud.js";
|
|
5
5
|
import { agentProfileSchema } from "@tangle-network/agent-interface";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/backend-registry.ts
|
|
@@ -2758,6 +2758,16 @@ var Sandbox = class {
|
|
|
2758
2758
|
* });
|
|
2759
2759
|
* ```
|
|
2760
2760
|
*/
|
|
2761
|
+
/** Fresh execution with no ambient owner context. Old hosts reject this
|
|
2762
|
+
* explicit field before provisioning; no best-effort security downgrade. */
|
|
2763
|
+
async createIsolated(options, requestOptions) {
|
|
2764
|
+
return this.create({
|
|
2765
|
+
...options,
|
|
2766
|
+
ownerContext: "isolated",
|
|
2767
|
+
secrets: options.secrets ?? [],
|
|
2768
|
+
sshEnabled: options.sshEnabled ?? false
|
|
2769
|
+
}, requestOptions);
|
|
2770
|
+
}
|
|
2761
2771
|
async create(inputOptions, requestOptions) {
|
|
2762
2772
|
let options = inputOptions;
|
|
2763
2773
|
if (options?.backend?.runtimeAttachments !== void 0) {
|
|
@@ -2784,7 +2794,7 @@ var Sandbox = class {
|
|
|
2784
2794
|
auth: options.git.auth
|
|
2785
2795
|
} : void 0;
|
|
2786
2796
|
const environment = options?.environment;
|
|
2787
|
-
const backend = await hydrateLocalCliBackendAuth(options?.backend, this.baseUrl, this.trustLocalCliAuth);
|
|
2797
|
+
const backend = options?.ownerContext === "isolated" ? options.backend : await hydrateLocalCliBackendAuth(options?.backend, this.baseUrl, this.trustLocalCliAuth);
|
|
2788
2798
|
const resolvedBackend = backend ? {
|
|
2789
2799
|
...backend,
|
|
2790
2800
|
type: backend.type ?? "opencode"
|
|
@@ -2855,6 +2865,7 @@ var Sandbox = class {
|
|
|
2855
2865
|
publicTemplateId: options?.publicTemplateId,
|
|
2856
2866
|
publicTemplateVersionId: options?.publicTemplateVersionId,
|
|
2857
2867
|
secrets: options?.secrets,
|
|
2868
|
+
ownerContext: options?.ownerContext,
|
|
2858
2869
|
confidential: options?.confidential,
|
|
2859
2870
|
metadata: options?.metadata,
|
|
2860
2871
|
teamId: options?.teamId,
|
|
@@ -2932,7 +2943,16 @@ var Sandbox = class {
|
|
|
2932
2943
|
}
|
|
2933
2944
|
if (!response) throw createTimeoutError();
|
|
2934
2945
|
const data = await response.json();
|
|
2935
|
-
const
|
|
2946
|
+
const info = this.parseInfo(data);
|
|
2947
|
+
const injectedSecrets = data.createReceipt?.injectedSecrets;
|
|
2948
|
+
if (options?.ownerContext === "isolated" && (info.createReceipt?.ownerContext !== "isolated" || injectedSecrets !== void 0 && (!Array.isArray(injectedSecrets) || injectedSecrets.length !== 0))) throw new PartialFailureError("The host did not confirm isolated owner context. No post-create work was started. Inspect the recorded sandbox and retry identity before allocating a replacement.", "SANDBOX_ISOLATION_UNVERIFIED", 502, {
|
|
2949
|
+
origin: "sandbox-api",
|
|
2950
|
+
endpoint: "/v1/sandboxes"
|
|
2951
|
+
}, [{
|
|
2952
|
+
sandboxId: info.id,
|
|
2953
|
+
idempotencyKey
|
|
2954
|
+
}]);
|
|
2955
|
+
const instance = createSandboxInstanceFromResponse(this, info, handleBackend, data);
|
|
2936
2956
|
if (instance.status === "provisioning" || instance.status === "pending") {
|
|
2937
2957
|
const remainingMs = Math.max(0, deadline - Date.now());
|
|
2938
2958
|
await instance.waitFor("running", {
|
|
@@ -3069,7 +3089,7 @@ var Sandbox = class {
|
|
|
3069
3089
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
3070
3090
|
}
|
|
3071
3091
|
const data = await response.json();
|
|
3072
|
-
return createSandboxInstanceFromResponse(this, this.parseInfo(data));
|
|
3092
|
+
return createSandboxInstanceFromResponse(this, this.parseInfo(data), void 0, data);
|
|
3073
3093
|
}
|
|
3074
3094
|
/**
|
|
3075
3095
|
* Mint the terminal-capable token for one exact interactive session.
|
|
@@ -3082,6 +3102,33 @@ var Sandbox = class {
|
|
|
3082
3102
|
return requestInteractiveSessionToken(this, ref, options);
|
|
3083
3103
|
}
|
|
3084
3104
|
/**
|
|
3105
|
+
* The named sandbox sizes, which one is the platform's default, and the
|
|
3106
|
+
* largest shape this account can be granted on the serving deployment.
|
|
3107
|
+
*
|
|
3108
|
+
* The platform owns these numbers; a client that sizes a request from
|
|
3109
|
+
* `ceiling` is never refused with `RESOURCES_EXCEED_LIMIT`, and
|
|
3110
|
+
* {@link sandboxResourcesForSize} accepts `presets` so a named tier expands
|
|
3111
|
+
* to what this deployment actually sells.
|
|
3112
|
+
*
|
|
3113
|
+
* @example
|
|
3114
|
+
* ```typescript
|
|
3115
|
+
* const shapes = await client.shapes();
|
|
3116
|
+
* const box = await client.create({
|
|
3117
|
+
* resources: sandboxResourcesForSize("medium", shapes.presets),
|
|
3118
|
+
* });
|
|
3119
|
+
* ```
|
|
3120
|
+
*/
|
|
3121
|
+
async shapes() {
|
|
3122
|
+
const response = await this.fetch("/v1/shapes");
|
|
3123
|
+
if (!response.ok) {
|
|
3124
|
+
const body = await response.text();
|
|
3125
|
+
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
3126
|
+
}
|
|
3127
|
+
const data = await response.json();
|
|
3128
|
+
if (!Array.isArray(data?.presets) || typeof data.default !== "string" || !data.ceiling || typeof data.ceiling.cpuCores !== "number" || typeof data.ceiling.memoryMB !== "number" || typeof data.ceiling.diskGB !== "number") throw new SandboxError("GET /v1/shapes returned no usable shape catalogue", "INVALID_RESPONSE", 502);
|
|
3129
|
+
return data;
|
|
3130
|
+
}
|
|
3131
|
+
/**
|
|
3085
3132
|
* Return the identity the public Sandbox API observed for this credential.
|
|
3086
3133
|
*
|
|
3087
3134
|
* This is useful for deployment checks that must confirm which account and
|
|
@@ -3356,6 +3403,7 @@ var Sandbox = class {
|
|
|
3356
3403
|
expiresAt: data.expiresAt ? new Date(data.expiresAt) : void 0,
|
|
3357
3404
|
error: data.error,
|
|
3358
3405
|
gpuLease: data.gpuLease,
|
|
3406
|
+
resources: normalizeSandboxShape(data.resources),
|
|
3359
3407
|
startupDiagnostics: normalizeStartupDiagnostics(data.startupDiagnostics) ?? void 0,
|
|
3360
3408
|
createReceipt: normalizeSandboxCreateReceipt(data.createReceipt) ?? void 0
|
|
3361
3409
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-
|
|
1
|
+
import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-cTa_FF5p.js";
|
|
2
2
|
import { l as ScopedToken, s as MintInteractiveSessionTokenOptions } from "./terminal-stream-CcaBTVg3.js";
|
|
3
|
-
import { At as
|
|
3
|
+
import { At as FleetDispatchStreamOptions, B as CreateSandboxOptions, Br as SandboxFleetWorkspaceReconcileResult, Cr as SandboxFleetInfo, Dr as SandboxFleetMachineRecord, Dt as FleetDispatchCancelResult, F as CreateIntelligenceReportOptions, Fn as PromptOptions, Ft as FleetMachineId, Gi as SubscriptionInfo, Gn as ReapExpiredSandboxFleetsOptions, Hn as PublicTemplateVersionInfo, Hr as SandboxFleetWorkspaceSnapshotResult, I as CreateRequestOptions, In as PromptResult, It as FleetPromptDispatchOptions, Jn as ReconcileSandboxFleetsResult, Kn as ReapExpiredSandboxFleetsResult, L as CreateSandboxFleetOptions, Lr as SandboxFleetTraceOptions, Lt as FleetPromptDispatchResult, Mt as FleetDriveTurnRequest, Nr as SandboxFleetToken, Nt as FleetExecDispatchOptions, Ot as FleetDispatchResultBuffer, Pn as PromptInputPart, Pr as SandboxFleetTraceBundle, Pt as FleetExecDispatchResult, R as CreateSandboxFleetTokenOptions, Rr as SandboxFleetUsage, Un as PublishPublicTemplateOptions, Ur as SandboxIdentity, Vi as SshKeysManager, Vn as PublicTemplateInfo, Vr as SandboxFleetWorkspaceRestoreResult, Wn as PublishPublicTemplateVersionOptions, Wr as SandboxInfo, _i as SecretsManager, _r as SandboxFleetArtifactSpec, an as IntelligenceReport, b as BatchRunRequest, br as SandboxFleetDispatchResponse, ca as UsageInfo, ft as ExecOptions, ga as BatchEvent, gr as SandboxFleetArtifact, jr as SandboxFleetOperationsSummary, jt as FleetDriveTurnOutcome, kr as SandboxFleetManifest, kt as FleetDispatchResultBufferOptions, l as AttachSandboxFleetMachineOptions, ln as IntelligenceReportWindow, mn as ListSandboxOptions, mr as SandboxEnvironment, na as TokenRefreshHandler, on as IntelligenceReportBudget, pn as ListSandboxFleetOptions, pt as ExecResult, qn as ReconcileSandboxFleetsOptions, sn as IntelligenceReportCompareTo, sr as SandboxConfig, ti as SandboxShapesInfo, v as BatchResult, vr as SandboxFleetCostEstimate, xr as SandboxFleetDriverCapability, y as BatchRunOptions, z as CreateSandboxFleetWithCoordinatorOptions } from "./types-C3Kw-Tml.js";
|
|
4
4
|
import { AgentInteractiveSessionRef } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -431,6 +431,9 @@ declare class Sandbox implements HttpClient, ScopedTokenHttpClient {
|
|
|
431
431
|
* });
|
|
432
432
|
* ```
|
|
433
433
|
*/
|
|
434
|
+
/** Fresh execution with no ambient owner context. Old hosts reject this
|
|
435
|
+
* explicit field before provisioning; no best-effort security downgrade. */
|
|
436
|
+
createIsolated(options: Omit<CreateSandboxOptions, "ownerContext">, requestOptions?: CreateRequestOptions): Promise<SandboxInstance>;
|
|
434
437
|
create(inputOptions?: CreateSandboxOptions, requestOptions?: CreateRequestOptions): Promise<SandboxInstance>;
|
|
435
438
|
/**
|
|
436
439
|
* Poll a sandbox to `running` by id. Surfaces a real provision failure
|
|
@@ -497,6 +500,24 @@ declare class Sandbox implements HttpClient, ScopedTokenHttpClient {
|
|
|
497
500
|
* and makes one scoped-token request without loading the sandbox first.
|
|
498
501
|
*/
|
|
499
502
|
mintInteractiveSessionToken(ref: AgentInteractiveSessionRef, options?: MintInteractiveSessionTokenOptions): Promise<ScopedToken>;
|
|
503
|
+
/**
|
|
504
|
+
* The named sandbox sizes, which one is the platform's default, and the
|
|
505
|
+
* largest shape this account can be granted on the serving deployment.
|
|
506
|
+
*
|
|
507
|
+
* The platform owns these numbers; a client that sizes a request from
|
|
508
|
+
* `ceiling` is never refused with `RESOURCES_EXCEED_LIMIT`, and
|
|
509
|
+
* {@link sandboxResourcesForSize} accepts `presets` so a named tier expands
|
|
510
|
+
* to what this deployment actually sells.
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* ```typescript
|
|
514
|
+
* const shapes = await client.shapes();
|
|
515
|
+
* const box = await client.create({
|
|
516
|
+
* resources: sandboxResourcesForSize("medium", shapes.presets),
|
|
517
|
+
* });
|
|
518
|
+
* ```
|
|
519
|
+
*/
|
|
520
|
+
shapes(): Promise<SandboxShapesInfo>;
|
|
500
521
|
/**
|
|
501
522
|
* Return the identity the public Sandbox API observed for this credential.
|
|
502
523
|
*
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-
|
|
2
|
-
import { Cn as
|
|
3
|
-
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-
|
|
1
|
+
import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-cTa_FF5p.js";
|
|
2
|
+
import { B as CreateSandboxOptions, Cn as PreviewLinkInfo, M as ConversationTurnOptions, N as ConversationTurnResult, Pn as PromptInputPart, Tn as PreviewLinkWaitOptions, Wr as SandboxInfo, ft as ExecOptions, ji as SessionMessageAdmission, ni as SandboxStatus, pt as ExecResult, sr as SandboxConfig, vn as NetworkConfig, wn as PreviewLinkManager } from "./types-C3Kw-Tml.js";
|
|
3
|
+
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-DdmHMuCL.js";
|
|
4
4
|
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";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
//#region src/core.d.ts
|
|
7
|
+
/** Local SDK protocol support only, not a deployed-host readiness assertion.
|
|
8
|
+
* Version 1 refuses unconfirmed isolated receipts before materializing any
|
|
9
|
+
* profile/files and suppresses ambient CLI credential discovery. Callers must
|
|
10
|
+
* still inspect the host receipt and their own customer/workspace binding. */
|
|
11
|
+
declare const ISOLATED_CREATION_ATTESTATION_VERSION: 1;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { AuthError, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, CapabilityError, type ConversationTurnOptions, type ConversationTurnResult, type CreateSandboxOptions, type ExecOptions, type ExecResult, FileWriteConflictError, ISOLATED_CREATION_ATTESTATION_VERSION, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type PromptInputPart, QuotaError, Sandbox, type SandboxConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, type SessionMessageAdmission, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
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";
|
|
2
|
-
import { _ as parseBackendRegistryResponse, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-
|
|
3
|
-
import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox-
|
|
4
|
-
|
|
2
|
+
import { _ as parseBackendRegistryResponse, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-BSNkAx2K.js";
|
|
3
|
+
import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox-BRZLdcud.js";
|
|
4
|
+
//#region src/core.ts
|
|
5
|
+
/** Local SDK protocol support only, not a deployed-host readiness assertion.
|
|
6
|
+
* Version 1 refuses unconfirmed isolated receipts before materializing any
|
|
7
|
+
* profile/files and suppresses ambient CLI credential discovery. Callers must
|
|
8
|
+
* still inspect the host receipt and their own customer/workspace binding. */
|
|
9
|
+
const ISOLATED_CREATION_ATTESTATION_VERSION = 1;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AuthError, CapabilityError, FileWriteConflictError, ISOLATED_CREATION_ATTESTATION_VERSION, NetworkError, NotFoundError, PartialFailureError, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as HttpClient, r as SandboxInstance } from "./sandbox-
|
|
2
|
-
import {
|
|
1
|
+
import { n as HttpClient, r as SandboxInstance } from "./sandbox-cTa_FF5p.js";
|
|
2
|
+
import { B as CreateSandboxOptions } from "./types-C3Kw-Tml.js";
|
|
3
3
|
|
|
4
4
|
//#region src/tangle/abi.d.ts
|
|
5
5
|
/**
|