@tangle-network/sandbox 0.11.1-develop.20260720081515.70709ad → 0.11.1-develop.20260721214535.0e31f17
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/agent/index.d.ts +3 -3
- package/dist/{client-CEKvv9MJ.d.ts → client-BV3kKzze.d.ts} +2 -2
- package/dist/{client-CPeSqZZS.js → client-DAGPD4d-.js} +66 -13
- package/dist/core.d.ts +3 -3
- package/dist/core.js +2 -2
- package/dist/{index-C-tmqYod.d.ts → index-wJTgrUG8.d.ts} +2 -2
- package/dist/index.d.ts +23 -5
- package/dist/index.js +4 -4
- package/dist/runtime.d.ts +1 -1
- package/dist/{sandbox-C02suXVt.d.ts → sandbox-CuXnqd7a.d.ts} +38 -1
- package/dist/{sandbox-Cyy9YMhi.js → sandbox-DnDmHM5x.js} +110 -8
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-CD0kXNuo.js → tangle-BaTM5dI_.js} +1 -1
- package/dist/{types-wRX4Rp-w.d.ts → types-CKKO6y8K.d.ts} +200 -140
- package/package.json +1 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as SandboxInstance } from "../sandbox-
|
|
3
|
-
import { i as SandboxClient } from "../client-
|
|
1
|
+
import { C as CodeExecutionResult, E as CodeResultPart, S as CodeExecutionOptions, w as CodeLanguage } from "../types-CKKO6y8K.js";
|
|
2
|
+
import { n as SandboxInstance } from "../sandbox-CuXnqd7a.js";
|
|
3
|
+
import { i as SandboxClient } from "../client-BV3kKzze.js";
|
|
4
4
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
|
|
6
6
|
//#region src/agent/tools/_specs.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
import { a as TraceExportSink, i as TraceExportResult, n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { $n as SandboxFleetDispatchResponse, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, An as ReconcileSandboxFleetsOptions, Ct as FleetPromptDispatchOptions, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, Ei as TokenRefreshHandler, En as PublishPublicTemplateOptions, F as CreateSandboxOptions, Gn as SandboxClientConfig, Gt as IntelligenceReportBudget, Jr as SecretsManager, Jt as IntelligenceReportWindow, Kt as IntelligenceReportCompareTo, M as CreateSandboxFleetOptions, Mi as UsageInfo, N as CreateSandboxFleetTokenOptions, On as ReapExpiredSandboxFleetsOptions, P as CreateSandboxFleetWithCoordinatorOptions, Qt as ListSandboxFleetOptions, Sr as SandboxInfo, St as FleetMachineId, Tn as PublicTemplateVersionInfo, Wt as IntelligenceReport, Xn as SandboxFleetArtifactSpec, Yn as SandboxFleetArtifact, Zn as SandboxFleetCostEstimate, _ as BatchTask, _n as PromptInputPart, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, cr as SandboxFleetManifest, er as SandboxFleetDriverCapability, fr as SandboxFleetToken, g as BatchRunRequest, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, j as CreateRequestOptions, jn as ReconcileSandboxFleetsResult, kn as ReapExpiredSandboxFleetsResult, li as SshKeysManager, m as BatchResult, nr as SandboxFleetInfo, nt as ExecResult, or as SandboxFleetMachineRecord, p as BatchOptions, pi as SubscriptionInfo, pr as SandboxFleetTraceBundle, qn as SandboxEnvironment, tt as ExecOptions, ur as SandboxFleetOperationsSummary, vn as PromptOptions, vt as FleetDispatchResultBufferOptions, wn as PublicTemplateInfo, wt as FleetPromptDispatchResult, xr as SandboxFleetWorkspaceSnapshotResult, xt as FleetExecDispatchResult, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions, zi as BatchEvent } from "./types-CKKO6y8K.js";
|
|
2
|
+
import { a as TraceExportSink, i as TraceExportResult, n as SandboxInstance, t as HttpClient } from "./sandbox-CuXnqd7a.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/sse-parser.d.ts
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as encodeTextForWire, i as SANDBOX_PROXY_REQUEST_MAX_BYTES, o as combineAbortSignals, s as encodePromptForWire } from "./runtime-api-DCMrscis.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, o as PartialFailureError, p as parseErrorResponse, t as AuthError } from "./errors-hbpL_-S6.js";
|
|
3
|
-
import { f as exportTraceBundle, h as parseSSEStream, n as createSandboxInstanceFromResponse, r as normalizeStartupDiagnostics, u as normalizeConnection } from "./sandbox-
|
|
3
|
+
import { f as exportTraceBundle, h as parseSSEStream, n as createSandboxInstanceFromResponse, r as normalizeStartupDiagnostics, u as normalizeConnection } from "./sandbox-DnDmHM5x.js";
|
|
4
4
|
//#region src/resources.ts
|
|
5
5
|
/**
|
|
6
6
|
* Compute tiers, ordered smallest → largest. Defined HERE (not imported from
|
|
@@ -1007,6 +1007,34 @@ function validateDeferredProfileFileMounts(files) {
|
|
|
1007
1007
|
validateProfileFilePath(mount.path);
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Split inline `resources.skills` out of a profile the way
|
|
1012
|
+
* {@link splitInlineProfileFileMounts} splits inline files: the returned
|
|
1013
|
+
* `leanProfile` drops them so the create POST fits its wire cap. Unlike file
|
|
1014
|
+
* mounts, skills are NOT materialized to disk here — they are harness-specific
|
|
1015
|
+
* (each turn's harness needs them in its own dir), so they must ride the
|
|
1016
|
+
* per-turn profile. The full profile is delivered once (create-time priming)
|
|
1017
|
+
* and referenced by hash thereafter.
|
|
1018
|
+
*/
|
|
1019
|
+
function splitInlineProfileSkills(profile) {
|
|
1020
|
+
const skills = profile.resources?.skills ?? [];
|
|
1021
|
+
const kept = skills.filter((ref) => ref.kind !== "inline");
|
|
1022
|
+
const deferredSkillCount = skills.length - kept.length;
|
|
1023
|
+
if (deferredSkillCount === 0) return {
|
|
1024
|
+
leanProfile: profile,
|
|
1025
|
+
deferredSkillCount: 0
|
|
1026
|
+
};
|
|
1027
|
+
return {
|
|
1028
|
+
leanProfile: {
|
|
1029
|
+
...profile,
|
|
1030
|
+
resources: {
|
|
1031
|
+
...profile.resources ?? {},
|
|
1032
|
+
skills: kept
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
deferredSkillCount
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1010
1038
|
function splitInlineProfileFileMounts(profile) {
|
|
1011
1039
|
const files = profile.resources?.files ?? [];
|
|
1012
1040
|
const deferredFiles = [];
|
|
@@ -1663,19 +1691,38 @@ var SandboxClient = class {
|
|
|
1663
1691
|
type: backend.type ?? "opencode"
|
|
1664
1692
|
} : void 0;
|
|
1665
1693
|
const autoMaterializeProfileFiles = options?.autoMaterializeProfileFiles ?? true;
|
|
1694
|
+
const autoDeferProfile = options?.autoDeferProfile ?? true;
|
|
1666
1695
|
let deferredProfileFiles = [];
|
|
1667
1696
|
let profileFilesFailOnError = true;
|
|
1668
1697
|
let requestBackend = resolvedBackend;
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
if (
|
|
1698
|
+
let handleBackend = resolvedBackend;
|
|
1699
|
+
let deferredProfileForPriming;
|
|
1700
|
+
if (resolvedBackend?.profile && typeof resolvedBackend.profile === "object") {
|
|
1701
|
+
const inlineProfile = resolvedBackend.profile;
|
|
1702
|
+
let handleProfile = inlineProfile;
|
|
1703
|
+
if (autoMaterializeProfileFiles) {
|
|
1704
|
+
const split = splitInlineProfileFileMounts(inlineProfile);
|
|
1705
|
+
deferredProfileFiles = split.deferredFiles;
|
|
1706
|
+
handleProfile = split.leanProfile;
|
|
1707
|
+
if (deferredProfileFiles.length > 0) {
|
|
1708
|
+
profileFilesFailOnError = inlineProfile.resources?.failOnError !== false;
|
|
1709
|
+
if (profileFilesFailOnError) validateDeferredProfileFileMounts(deferredProfileFiles);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
handleBackend = {
|
|
1713
|
+
...resolvedBackend,
|
|
1714
|
+
profile: handleProfile
|
|
1715
|
+
};
|
|
1716
|
+
requestBackend = handleBackend;
|
|
1717
|
+
if (autoDeferProfile) {
|
|
1718
|
+
const skillSplit = splitInlineProfileSkills(handleProfile);
|
|
1719
|
+
if (skillSplit.deferredSkillCount > 0) {
|
|
1720
|
+
requestBackend = {
|
|
1721
|
+
...resolvedBackend,
|
|
1722
|
+
profile: skillSplit.leanProfile
|
|
1723
|
+
};
|
|
1724
|
+
deferredProfileForPriming = handleProfile;
|
|
1725
|
+
}
|
|
1679
1726
|
}
|
|
1680
1727
|
}
|
|
1681
1728
|
const resources = normalizeSandboxResources(options?.resources, options?.driver);
|
|
@@ -1690,6 +1737,7 @@ var SandboxClient = class {
|
|
|
1690
1737
|
git,
|
|
1691
1738
|
tools: options?.tools,
|
|
1692
1739
|
bare: options?.bare,
|
|
1740
|
+
agent: options?.agent,
|
|
1693
1741
|
...options?.publicEdge === false ? { publicEdge: false } : {},
|
|
1694
1742
|
driver: options?.driver,
|
|
1695
1743
|
backend: requestBackend,
|
|
@@ -1753,7 +1801,7 @@ var SandboxClient = class {
|
|
|
1753
1801
|
}
|
|
1754
1802
|
if (!response) throw createTimeoutError();
|
|
1755
1803
|
const data = await response.json();
|
|
1756
|
-
const instance = createSandboxInstanceFromResponse(this, this.parseInfo(data),
|
|
1804
|
+
const instance = createSandboxInstanceFromResponse(this, this.parseInfo(data), handleBackend);
|
|
1757
1805
|
if (instance.status === "provisioning" || instance.status === "pending") {
|
|
1758
1806
|
const remainingMs = Math.max(0, deadline - Date.now());
|
|
1759
1807
|
await instance.waitFor("running", {
|
|
@@ -1783,6 +1831,11 @@ var SandboxClient = class {
|
|
|
1783
1831
|
throw new PartialFailureError(message, "PROFILE_FILES_MATERIALIZE_FAILED", 502, void 0, paths.map((path) => ({ path })));
|
|
1784
1832
|
}
|
|
1785
1833
|
}
|
|
1834
|
+
if (deferredProfileForPriming !== void 0) try {
|
|
1835
|
+
await instance._primeDeferredProfile(deferredProfileForPriming);
|
|
1836
|
+
} catch (err) {
|
|
1837
|
+
console.warn(`[sandbox.create] Profile priming failed for ${instance.id}; turns will send the full profile inline. Cause: ${err instanceof Error ? err.message : String(err)}`);
|
|
1838
|
+
}
|
|
1786
1839
|
return instance;
|
|
1787
1840
|
}
|
|
1788
1841
|
/**
|
|
@@ -2672,4 +2725,4 @@ var TeamsClient = class {
|
|
|
2672
2725
|
}
|
|
2673
2726
|
};
|
|
2674
2727
|
//#endregion
|
|
2675
|
-
export {
|
|
2728
|
+
export { splitInlineProfileSkills as a, SandboxFleetClient as c, SANDBOX_SIZE_PRESET_NAMES as d, resolveSandboxResources as f, splitInlineProfileFileMounts as i, DEFAULT_SANDBOX_SIZE as l, SandboxClient as n, validateDeferredProfileFileMounts as o, sandboxResourcesForSize as p, materializeProfileFileMounts as r, SandboxFleet as s, IntelligenceClient as t, SANDBOX_SIZE_PRESETS as u };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as SandboxInstance } from "./sandbox-
|
|
3
|
-
import { i as SandboxClient } from "./client-
|
|
1
|
+
import { F as CreateSandboxOptions, Gn as SandboxClientConfig, Nr as SandboxStatus, Sr as SandboxInfo, cn as PreviewLinkInfo, ln as PreviewLinkManager, nt as ExecResult, rn as NetworkConfig, tt as ExecOptions } from "./types-CKKO6y8K.js";
|
|
2
|
+
import { n as SandboxInstance } from "./sandbox-CuXnqd7a.js";
|
|
3
|
+
import { i as SandboxClient } from "./client-BV3kKzze.js";
|
|
4
4
|
import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
|
|
5
5
|
export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, QuotaError, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
|
|
2
|
-
import { t as SandboxInstance } from "./sandbox-
|
|
3
|
-
import { n as SandboxClient } from "./client-
|
|
2
|
+
import { t as SandboxInstance } from "./sandbox-DnDmHM5x.js";
|
|
3
|
+
import { n as SandboxClient } from "./client-DAGPD4d-.js";
|
|
4
4
|
export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { F as CreateSandboxOptions } from "./types-CKKO6y8K.js";
|
|
2
|
+
import { n as SandboxInstance, t as HttpClient } from "./sandbox-CuXnqd7a.js";
|
|
3
3
|
|
|
4
4
|
//#region src/tangle/abi.d.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { C as SANDBOX_MCP_SERVER_NAME, D as buildControlPlaneMcpConfig, E as SandboxMcpServerEntry, O as buildSandboxMcpConfig, S as CONTROL_PLANE_MCP_SERVER_NAME, T as SandboxMcpEndpoint, _ as InterruptResult, a as TraceExportSink, b as BuildControlPlaneMcpConfigOptions, c as otelTraceIdForTangleTrace, d as SandboxSession, f as InteractiveAuthFile, g as InteractiveSessionStatus, h as InteractiveSessionInfo, i as TraceExportResult, l as toOtelJson, m as InteractiveSessionHost, n as SandboxInstance, o as buildTraceExportPayload, p as InteractiveSessionHandle, r as TraceExportFormat, s as exportTraceBundle, u as SandboxTaskSession, v as RespondToPermissionOptions, w as SandboxMcpConfig, x as BuildSandboxMcpConfigOptions, y as StartInteractiveOptions } from "./sandbox-
|
|
3
|
-
import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as SandboxClient, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet } from "./client-
|
|
1
|
+
import { $ as EventStreamOptions, $i as AgentProfileResources, $n as SandboxFleetDispatchResponse, $r as SessionEventStreamOptions, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, Ai as UploadOptions, An as ReconcileSandboxFleetsOptions, Ar as SandboxRuntimeHealth, At as GitDiff, B as DirectoryPermission, Bi as BatchEventDataMap, Bn as RolloutStatus, Br as SandboxTraceExport, Bt as GpuType, Ci as TeeAttestationResponse, Cn as ProvisionStep, Cr as SandboxIntelligenceEnvelope, Ct as FleetPromptDispatchOptions, D as CommitTaskSessionOptions, Di as ToolsConfig, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, Dt as GitBranch, Ei as TokenRefreshHandler, En as PublishPublicTemplateOptions, Er as SandboxPortPreviewLink, Et as GitAuth, F as CreateSandboxOptions, Fi as WriteFileOptions, Fn as Rollout, Fr as SandboxTerminalInfo, Ft as GpuLeaseExecOptions, G as DriveTurnOptions, Gi as AgentProfileConfidential, Gn as SandboxClientConfig, Gr as SearchMatch, Gt as IntelligenceReportBudget, H as DispatchedSession, Hi as BatchTaskUsage, Hn as RunCodeOptions, Hr as SandboxUser, Ht as HostAgentRuntimeBackend, I as CreateSessionOptions, Ii as WriteManyFile, In as RolloutChildResult, Ir as SandboxTerminalManager, It as GpuLeaseExecResult, J as DriverType, Ji as AgentProfileMcpServer, Jn as SandboxEvent, Jr as SecretsManager, Jt as IntelligenceReportWindow, K as DriverConfig, Ki as AgentProfileConnection, Kn as SandboxConnection, Kr as SearchOptions, Kt as IntelligenceReportCompareTo, L as CreateTaskSessionOptions, Li as WriteManyOptions, Ln as RolloutOptions, Lr as SandboxTerminalRequestOptions, Lt as GpuLeaseManager, M as CreateSandboxFleetOptions, Mi as UsageInfo, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Mt as GpuLease, Ni as WaitForOptions, Nr as SandboxStatus, Nt as GpuLeaseBilling, O as CompletedTurnResult, Oi as TurnDriveResult, On as ReapExpiredSandboxFleetsOptions, Or as SandboxResourceUsage, Ot as GitCommit, P as CreateSandboxFleetWithCoordinatorOptions, Pi as WaitForRolloutOptions, Pr as SandboxTerminalCreateOptions, Pt as GpuLeaseCommandResult, Q as EnsureDevServerOptions, Qi as AgentProfileResourceRef, Qn as SandboxFleetDispatchFailureClass, Qr as SessionBackendCredentials, Qt as ListSandboxFleetOptions, R as DeleteOptions, Ri as BatchBackendStats, Rn as RolloutScorer, Rr as SandboxTraceBundle, Rt as GpuLeaseProviderName, Si as TeeAttestationReport, Sn as ProvisionStatus, Sr as SandboxInfo, St as FleetMachineId, T as CodeResult, Ti as TeePublicKeyResponse, Tn as PublicTemplateVersionInfo, Tr as SandboxPortBinding, Tt as GPU_LEASE_PROVIDER_NAMES, U as DownloadOptions, Ui as AgentProfile, Un as SSHCommandDescriptor, Ur as ScopedToken, Ut as InstalledTool, V as DispatchPromptOptions, Vi as BatchSidecarGroup, Vn as RolloutTurnPart, Vr as SandboxTraceOptions, Vt as HostAgentDriverConfig, W as DownloadProgress, Wi as AgentProfileCapabilities, Wn as SSHCredentials, Wr as ScopedTokenScope, Wt as IntelligenceReport, X as EgressManager, Xi as AgentProfilePermissionValue, Xn as SandboxFleetArtifactSpec, Xr as SendSessionMessageRequest, Xt as ListMessagesOptions, Yi as AgentProfileModelHints, Yn as SandboxFleetArtifact, Yr as SendSessionMessageOptions, Z as EgressPolicy, Zi as AgentProfilePrompt, Zn as SandboxFleetCostEstimate, Zr as SentSessionMessage, Zt as ListOptions, _ as BatchTask, _i as TaskSessionCommitResult, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, aa as agentProfileSchema, ai as SessionStatus, an as NonHostAgentDriverConfig, ar as SandboxFleetMachineMeteredUsage, at as FileReadBatchResult, b as ChunkedUploadOptions, bi as TaskSessionProfile, bn as ProvisionEvent, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, c as BackendInfo, ca as defineGitHubResource, ci as SnapshotResult, cn as PreviewLinkInfo, cr as SandboxFleetManifest, ct as FileRenameResult, d as BackendType, da as validateAgentProfileSecurity, di as StartupOperation, dn as ProcessInfo, dr as SandboxFleetPolicy, dt as FileTreeOptions, ea as AgentProfileSecurityPolicy, ei as SessionForkOptions, en as McpServerConfig, er as SandboxFleetDriverCapability, et as ExactProcessSpawnOptions, f as BatchBackend, fi as StorageConfig, fn as ProcessLogEntry, fr as SandboxFleetToken, ft as FileTreeResult, g as BatchRunRequest, gi as TaskSessionChanges, gn as ProcessStatus, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, hi as TaskResult, hn as ProcessSpawnOptions, hr as SandboxFleetTraceExport, ht as FileWriteResult, i as AttachGpuLeaseOptions, ia as Capability, ii as SessionMessageInputPart, in as NetworkManager, ir as SandboxFleetMachine, it as FileReadBatchOptions, j as CreateRequestOptions, ji as UploadProgress, jn as ReconcileSandboxFleetsResult, jr as SandboxRuntimeProfile, jt as GitStatus, k as CreateGpuLeaseOptions, ki as UpdateUserOptions, kn as ReapExpiredSandboxFleetsResult, kr as SandboxResources, kt as GitConfig, l as BackendManager, la as defineInlineResource, ln as PreviewLinkManager, lr as SandboxFleetManifestMachine, lt as FileSystem, m as BatchResult, mi as TaskOptions, mn as ProcessSignal, mr as SandboxFleetTraceEvent, mt as FileUsageResult, n as AccessPolicyRule, na as AgentProfileValidationResult, ni as SessionListOptions, nn as MkdirOptions, nr as SandboxFleetInfo, nt as ExecResult, o as BackendCapabilities, oa as capabilitySchema, oi as SnapshotInfo, on as PermissionLevel, or as SandboxFleetMachineRecord, ot as FileReadError, p as BatchOptions, pi as SubscriptionInfo, pn as ProcessManager, pr as SandboxFleetTraceBundle, pt as FileUsageOptions, q as DriverInfo, qi as AgentProfileFileMount, qn as SandboxEnvironment, qr as SecretInfo, qt as IntelligenceReportSubjectType, r as AddUserOptions, ra as AgentSubagentProfile, ri as SessionMessage, rn as NetworkConfig, rr as SandboxFleetIntelligenceEnvelope, rt as FileInfo, s as BackendConfig, sa as defineAgentProfile, si as SnapshotOptions, sn as PermissionsManager, sr as SandboxFleetMachineSpec, st as FileReadResult, t as AcceleratorKind, ta as AgentProfileValidationIssue, ti as SessionInfo, tn as MintScopedTokenOptions, tr as SandboxFleetDriverTimings, tt as ExecOptions, u as BackendStatus, ua as mergeAgentProfiles, ui as StartupDiagnostics, un as Process, ur as SandboxFleetOperationsSummary, ut as FileTreeFile, v as BatchTaskResult, vi as TaskSessionFileChange, vn as PromptOptions, vr as SandboxFleetWorkspace, vt as FleetDispatchResultBufferOptions, wi as TeePublicKey, wn as PublicTemplateInfo, wr as SandboxPermissionsConfig, x as ChunkedUploadResult, xi as TeeAttestationOptions, xn as ProvisionResult, xr as SandboxFleetWorkspaceSnapshotResult, y as BranchOptions, yi as TaskSessionInfo, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions, z as DevServerInfo, zi as BatchEvent, zn as RolloutStartResult, zr as SandboxTraceEvent, zt as GpuLeaseStatus } from "./types-CKKO6y8K.js";
|
|
2
|
+
import { C as SANDBOX_MCP_SERVER_NAME, D as buildControlPlaneMcpConfig, E as SandboxMcpServerEntry, O as buildSandboxMcpConfig, S as CONTROL_PLANE_MCP_SERVER_NAME, T as SandboxMcpEndpoint, _ as InterruptResult, a as TraceExportSink, b as BuildControlPlaneMcpConfigOptions, c as otelTraceIdForTangleTrace, d as SandboxSession, f as InteractiveAuthFile, g as InteractiveSessionStatus, h as InteractiveSessionInfo, i as TraceExportResult, l as toOtelJson, m as InteractiveSessionHost, n as SandboxInstance, o as buildTraceExportPayload, p as InteractiveSessionHandle, r as TraceExportFormat, s as exportTraceBundle, u as SandboxTaskSession, v as RespondToPermissionOptions, w as SandboxMcpConfig, x as BuildSandboxMcpConfigOptions, y as StartInteractiveOptions } from "./sandbox-CuXnqd7a.js";
|
|
3
|
+
import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as SandboxClient, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet } from "./client-BV3kKzze.js";
|
|
4
4
|
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-CyHojkuA.js";
|
|
5
5
|
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "./index-DKzapw-9.js";
|
|
6
6
|
import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
|
|
7
|
-
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
7
|
+
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-wJTgrUG8.js";
|
|
8
8
|
|
|
9
9
|
//#region src/attestation-heartbeat.d.ts
|
|
10
10
|
interface TeeAttestationHeartbeatSample {
|
|
@@ -1082,6 +1082,24 @@ type ProfileFileMountBox = Pick<SandboxInstance, "exec"> & {
|
|
|
1082
1082
|
* orphaned by the post-provision throw.
|
|
1083
1083
|
*/
|
|
1084
1084
|
declare function validateDeferredProfileFileMounts(files: readonly AgentProfileFileMount[]): void;
|
|
1085
|
+
interface SplitInlineProfileSkillsResult {
|
|
1086
|
+
/** Profile with inline skill refs removed (github refs kept — they resolve
|
|
1087
|
+
* server-side). Suitable for the create body, whose wire cap the full skill
|
|
1088
|
+
* corpus would exceed. */
|
|
1089
|
+
leanProfile: AgentProfile;
|
|
1090
|
+
/** How many inline skill refs were stripped. Zero means nothing to defer. */
|
|
1091
|
+
deferredSkillCount: number;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Split inline `resources.skills` out of a profile the way
|
|
1095
|
+
* {@link splitInlineProfileFileMounts} splits inline files: the returned
|
|
1096
|
+
* `leanProfile` drops them so the create POST fits its wire cap. Unlike file
|
|
1097
|
+
* mounts, skills are NOT materialized to disk here — they are harness-specific
|
|
1098
|
+
* (each turn's harness needs them in its own dir), so they must ride the
|
|
1099
|
+
* per-turn profile. The full profile is delivered once (create-time priming)
|
|
1100
|
+
* and referenced by hash thereafter.
|
|
1101
|
+
*/
|
|
1102
|
+
declare function splitInlineProfileSkills(profile: AgentProfile): SplitInlineProfileSkillsResult;
|
|
1085
1103
|
declare function splitInlineProfileFileMounts(profile: AgentProfile): SplitInlineProfileFileMountsResult;
|
|
1086
1104
|
declare function materializeProfileFileMounts(box: ProfileFileMountBox, files: readonly AgentProfileFileMount[], options?: MaterializeProfileFileMountsOptions): Promise<MaterializeProfileFileMountsResult>;
|
|
1087
1105
|
//#endregion
|
|
@@ -1386,4 +1404,4 @@ interface RouterEvalMatrixCaseResult {
|
|
|
1386
1404
|
}
|
|
1387
1405
|
declare function runTangleRouterEvalMatrixInSandbox(options: RunTangleRouterEvalMatrixInSandboxOptions): Promise<RunTangleRouterEvalMatrixInSandboxResult>;
|
|
1388
1406
|
//#endregion
|
|
1389
|
-
export { type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, type AgentProfile, type AgentProfileCapabilities, type AgentProfileConnection, type AgentProfileFileMount, type AgentProfileMcpServer, type AgentProfileModelHints, type AgentProfilePermissionValue, type AgentProfilePrompt, type AgentProfileResourceRef, type AgentProfileResources, type AgentProfileSecurityPolicy, type AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendStatus, type BackendType, type BatchBackend, type BatchBackendStats, type BatchEvent, type BatchEventDataMap, type BatchOptions, type BatchResult, type BatchRunOptions, type BatchRunRequest, type BatchSidecarGroup, type BatchTask, type BatchTaskResult, type BatchTaskUsage, type BranchOptions, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, type Capability, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type CodeResult, type CollaborationAccess, type CollaborationBootstrapRequest, type CollaborationBootstrapResponse, CollaborationClient, type CollaborationClientConfig, type CollaborationDocumentAdapter, type CollaborationDocumentChange, type CollaborationDocumentRef, CollaborationFileBridge, type CollaborationFileBridgeOptions, type CollaborationFileEvent, type CollaborationPermissions, type CollaborationTokenPayload, type CollaborationTokenRefreshRequest, type CollaborationTokenRefreshResponse, type CollaborationTransportConfig, type CommitTaskSessionOptions, type CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type CreateConfidentialSandboxOptions, type CreateGpuLeaseOptions, type CreateIntelligenceReportOptions, type CreateRequestOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateSessionOptions, type CreateTaskSessionOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DevServerInfo, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type EgressManager, type EgressPolicy, EgressProxyRecoveryError, type EnsureDevServerOptions, type EventStreamOptions, type ExactProcessSpawnOptions, type ExecOptions, type ExecResult, type FileInfo, type FileReadBatchOptions, type FileReadBatchResult, type FileReadError, type FileReadResult, type FileRenameResult, type FileSystem, type FileTreeFile, type FileTreeOptions, type FileTreeResult, type FileUsageOptions, type FileUsageResult, type FileWriteResult, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, GPU_LEASE_PROVIDER_NAMES, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuLease, type GpuLeaseBilling, type GpuLeaseCommandResult, type GpuLeaseExecOptions, type GpuLeaseExecResult, type GpuLeaseManager, type GpuLeaseProviderName, type GpuLeaseStatus, type GpuType, type HostAgentDriverConfig, type HostAgentRuntimeBackend, Image, type ImageBuildClient, type ImageBuildClientConfig, type ImageBuildFetchClient, type ImageBuildOptions, type ImageBuildResult, ImageBuilder, type ImageSpec, type InstalledTool, IntelligenceClient, type IntelligenceReport, type IntelligenceReportBudget, type IntelligenceReportCompareTo, type IntelligenceReportSubjectType, type IntelligenceReportWindow, type InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, type InteractiveSessionStatus, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, type MintScopedTokenOptions, type MkdirOptions, type NetworkConfig, NetworkError, type NetworkManager, type NonHostAgentDriverConfig, NotFoundError, type ParseSSEStreamOptions, type ParsedSSEEvent, PartialFailureError, type PermissionLevel, type PermissionsManager, type PreviewLinkInfo, type PreviewLinkManager, type Process, type ProcessInfo, type ProcessLogEntry, type ProcessManager, type ProcessSignal, type ProcessSpawnOptions, type ProcessStatus, type PromptOptions, type PromptResult, type ProvisionEvent, type ProvisionResult, type ProvisionStatus, type ProvisionStep, type PublicTemplateInfo, type PublicTemplateVersionInfo, type PublishPublicTemplateOptions, type PublishPublicTemplateVersionOptions, QuotaError, type ReapExpiredSandboxFleetsOptions, type ReapExpiredSandboxFleetsResult, type ReconcileSandboxFleetsOptions, type ReconcileSandboxFleetsResult, type RenameOptions, type RespondToPermissionOptions, type Rollout, type RolloutChildResult, type RolloutOptions, type RolloutScorer, type RolloutStartResult, type RolloutStatus, type RolloutTurnPart, type RouterEvalMatrixAgentProfile, type RouterEvalMatrixCaseResult, type RouterEvalMatrixHarness, type RouterEvalMatrixPayload, type RouterEvalMatrixSandboxBox, type RouterEvalMatrixSandboxClient, type RouterEvalMatrixScenario, type RouterEvalMatrixSuiteResponse, type RouterImportedRunResponse, type RouterSearchConfig, type RouterSearchConfigOptions, type RunCodeOptions, type RunTangleRouterEvalMatrixInSandboxOptions, type RunTangleRouterEvalMatrixInSandboxResult, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, type SSHCommandDescriptor, type SSHCredentials, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, type SandboxConnection, type SandboxEnvironment, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxFleet, type SandboxFleetArtifact, type SandboxFleetArtifactSpec, SandboxFleetClient, type SandboxFleetCostEstimate, type SandboxFleetDispatchFailureClass, type SandboxFleetDispatchResponse, type SandboxFleetDriverCapability, type SandboxFleetDriverTimings, type SandboxFleetInfo, type SandboxFleetIntelligenceEnvelope, type SandboxFleetMachine, type SandboxFleetMachineMeteredUsage, type SandboxFleetMachineRecord, type SandboxFleetMachineSpec, type SandboxFleetManifest, type SandboxFleetManifestMachine, type SandboxFleetOperationsSummary, type SandboxFleetPolicy, type SandboxFleetToken, type SandboxFleetTraceBundle, type SandboxFleetTraceEvent, type SandboxFleetTraceExport, type SandboxFleetTraceOptions, type SandboxFleetUsage, type SandboxFleetWorkspace, type SandboxFleetWorkspaceReconcileResult, type SandboxFleetWorkspaceRestoreResult, type SandboxFleetWorkspaceSnapshotResult, type SandboxInfo, SandboxInstance, type SandboxIntelligenceEnvelope, type SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPermissionsConfig, type SandboxPortBinding, type SandboxPortPreviewLink, type SandboxProfileSummary, type SandboxResourceUsage, type SandboxResources, type SandboxRuntimeHealth, type SandboxRuntimeProfile, type SandboxRuntimeProfileList, SandboxSession, type SandboxSizePreset, type SandboxStatus, SandboxTaskSession, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, type SandboxTraceBundle, type SandboxTraceEvent, type SandboxTraceExport, type SandboxTraceOptions, type SandboxUser, type SaveCollaborationSnapshotRequest, type SaveCollaborationSnapshotResponse, type ScopedToken, type ScopedTokenScope, type SearchMatch, type SearchOptions, type SecretInfo, type SecretsManager, type SendSessionMessageOptions, type SendSessionMessageRequest, type SentSessionMessage, ServerError, type SessionBackendCredentials, type SessionBroadcastEvent, type SessionBroadcastResult, type SessionEventStreamOptions, type SessionForkOptions, type SessionInfo, type SessionListOptions, type SessionMessage, type SessionMessageInputPart, type SessionStatus, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type StartInteractiveOptions, type StartupDiagnostics, type StartupOperation, StateError, type StorageConfig, type SubscriptionInfo, TangleSandboxClient, type TangleSandboxClientConfig, type TangleSearchProvider, type TaskOptions, type TaskResult, type TaskSessionChanges, type TaskSessionCommitResult, type TaskSessionFileChange, type TaskSessionInfo, type TaskSessionProfile, type Team, type TeamInvitation, type TeamMember, type TeeAttestationHeartbeat, type TeeAttestationHeartbeatOptions, type TeeAttestationHeartbeatSample, type TeeAttestationOptions, type TeeAttestationReport, type TeeAttestationResponse, type TeePublicKey, type TeePublicKeyResponse, TimeoutError, type TokenRefreshHandler, type ToolsConfig, type TraceExportFormat, type TraceExportResult, type TraceExportSink, type TurnDriveResult, type UpdateUserOptions, type UploadOptions, type UploadProgress, type UsageInfo, ValidationError, type WaitForOptions, type WaitForRolloutOptions, type WriteFileOptions, type WriteManyFile, type WriteManyOptions, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
|
|
1407
|
+
export { type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, type AgentProfile, type AgentProfileCapabilities, type AgentProfileConnection, type AgentProfileFileMount, type AgentProfileMcpServer, type AgentProfileModelHints, type AgentProfilePermissionValue, type AgentProfilePrompt, type AgentProfileResourceRef, type AgentProfileResources, type AgentProfileSecurityPolicy, type AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendStatus, type BackendType, type BatchBackend, type BatchBackendStats, type BatchEvent, type BatchEventDataMap, type BatchOptions, type BatchResult, type BatchRunOptions, type BatchRunRequest, type BatchSidecarGroup, type BatchTask, type BatchTaskResult, type BatchTaskUsage, type BranchOptions, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, type Capability, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type CodeResult, type CollaborationAccess, type CollaborationBootstrapRequest, type CollaborationBootstrapResponse, CollaborationClient, type CollaborationClientConfig, type CollaborationDocumentAdapter, type CollaborationDocumentChange, type CollaborationDocumentRef, CollaborationFileBridge, type CollaborationFileBridgeOptions, type CollaborationFileEvent, type CollaborationPermissions, type CollaborationTokenPayload, type CollaborationTokenRefreshRequest, type CollaborationTokenRefreshResponse, type CollaborationTransportConfig, type CommitTaskSessionOptions, type CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type CreateConfidentialSandboxOptions, type CreateGpuLeaseOptions, type CreateIntelligenceReportOptions, type CreateRequestOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateSessionOptions, type CreateTaskSessionOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DevServerInfo, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type EgressManager, type EgressPolicy, EgressProxyRecoveryError, type EnsureDevServerOptions, type EventStreamOptions, type ExactProcessSpawnOptions, type ExecOptions, type ExecResult, type FileInfo, type FileReadBatchOptions, type FileReadBatchResult, type FileReadError, type FileReadResult, type FileRenameResult, type FileSystem, type FileTreeFile, type FileTreeOptions, type FileTreeResult, type FileUsageOptions, type FileUsageResult, type FileWriteResult, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, GPU_LEASE_PROVIDER_NAMES, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuLease, type GpuLeaseBilling, type GpuLeaseCommandResult, type GpuLeaseExecOptions, type GpuLeaseExecResult, type GpuLeaseManager, type GpuLeaseProviderName, type GpuLeaseStatus, type GpuType, type HostAgentDriverConfig, type HostAgentRuntimeBackend, Image, type ImageBuildClient, type ImageBuildClientConfig, type ImageBuildFetchClient, type ImageBuildOptions, type ImageBuildResult, ImageBuilder, type ImageSpec, type InstalledTool, IntelligenceClient, type IntelligenceReport, type IntelligenceReportBudget, type IntelligenceReportCompareTo, type IntelligenceReportSubjectType, type IntelligenceReportWindow, type InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, type InteractiveSessionStatus, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, type MintScopedTokenOptions, type MkdirOptions, type NetworkConfig, NetworkError, type NetworkManager, type NonHostAgentDriverConfig, NotFoundError, type ParseSSEStreamOptions, type ParsedSSEEvent, PartialFailureError, type PermissionLevel, type PermissionsManager, type PreviewLinkInfo, type PreviewLinkManager, type Process, type ProcessInfo, type ProcessLogEntry, type ProcessManager, type ProcessSignal, type ProcessSpawnOptions, type ProcessStatus, type PromptOptions, type PromptResult, type ProvisionEvent, type ProvisionResult, type ProvisionStatus, type ProvisionStep, type PublicTemplateInfo, type PublicTemplateVersionInfo, type PublishPublicTemplateOptions, type PublishPublicTemplateVersionOptions, QuotaError, type ReapExpiredSandboxFleetsOptions, type ReapExpiredSandboxFleetsResult, type ReconcileSandboxFleetsOptions, type ReconcileSandboxFleetsResult, type RenameOptions, type RespondToPermissionOptions, type Rollout, type RolloutChildResult, type RolloutOptions, type RolloutScorer, type RolloutStartResult, type RolloutStatus, type RolloutTurnPart, type RouterEvalMatrixAgentProfile, type RouterEvalMatrixCaseResult, type RouterEvalMatrixHarness, type RouterEvalMatrixPayload, type RouterEvalMatrixSandboxBox, type RouterEvalMatrixSandboxClient, type RouterEvalMatrixScenario, type RouterEvalMatrixSuiteResponse, type RouterImportedRunResponse, type RouterSearchConfig, type RouterSearchConfigOptions, type RunCodeOptions, type RunTangleRouterEvalMatrixInSandboxOptions, type RunTangleRouterEvalMatrixInSandboxResult, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, type SSHCommandDescriptor, type SSHCredentials, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, type SandboxConnection, type SandboxEnvironment, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxFleet, type SandboxFleetArtifact, type SandboxFleetArtifactSpec, SandboxFleetClient, type SandboxFleetCostEstimate, type SandboxFleetDispatchFailureClass, type SandboxFleetDispatchResponse, type SandboxFleetDriverCapability, type SandboxFleetDriverTimings, type SandboxFleetInfo, type SandboxFleetIntelligenceEnvelope, type SandboxFleetMachine, type SandboxFleetMachineMeteredUsage, type SandboxFleetMachineRecord, type SandboxFleetMachineSpec, type SandboxFleetManifest, type SandboxFleetManifestMachine, type SandboxFleetOperationsSummary, type SandboxFleetPolicy, type SandboxFleetToken, type SandboxFleetTraceBundle, type SandboxFleetTraceEvent, type SandboxFleetTraceExport, type SandboxFleetTraceOptions, type SandboxFleetUsage, type SandboxFleetWorkspace, type SandboxFleetWorkspaceReconcileResult, type SandboxFleetWorkspaceRestoreResult, type SandboxFleetWorkspaceSnapshotResult, type SandboxInfo, SandboxInstance, type SandboxIntelligenceEnvelope, type SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPermissionsConfig, type SandboxPortBinding, type SandboxPortPreviewLink, type SandboxProfileSummary, type SandboxResourceUsage, type SandboxResources, type SandboxRuntimeHealth, type SandboxRuntimeProfile, type SandboxRuntimeProfileList, SandboxSession, type SandboxSizePreset, type SandboxStatus, SandboxTaskSession, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, type SandboxTraceBundle, type SandboxTraceEvent, type SandboxTraceExport, type SandboxTraceOptions, type SandboxUser, type SaveCollaborationSnapshotRequest, type SaveCollaborationSnapshotResponse, type ScopedToken, type ScopedTokenScope, type SearchMatch, type SearchOptions, type SecretInfo, type SecretsManager, type SendSessionMessageOptions, type SendSessionMessageRequest, type SentSessionMessage, ServerError, type SessionBackendCredentials, type SessionBroadcastEvent, type SessionBroadcastResult, type SessionEventStreamOptions, type SessionForkOptions, type SessionInfo, type SessionListOptions, type SessionMessage, type SessionMessageInputPart, type SessionStatus, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type SplitInlineProfileSkillsResult, type StartInteractiveOptions, type StartupDiagnostics, type StartupOperation, StateError, type StorageConfig, type SubscriptionInfo, TangleSandboxClient, type TangleSandboxClientConfig, type TangleSearchProvider, type TaskOptions, type TaskResult, type TaskSessionChanges, type TaskSessionCommitResult, type TaskSessionFileChange, type TaskSessionInfo, type TaskSessionProfile, type Team, type TeamInvitation, type TeamMember, type TeeAttestationHeartbeat, type TeeAttestationHeartbeatOptions, type TeeAttestationHeartbeatSample, type TeeAttestationOptions, type TeeAttestationReport, type TeeAttestationResponse, type TeePublicKey, type TeePublicKeyResponse, TimeoutError, type TokenRefreshHandler, type ToolsConfig, type TraceExportFormat, type TraceExportResult, type TraceExportSink, type TurnDriveResult, type UpdateUserOptions, type UploadOptions, type UploadProgress, type UsageInfo, ValidationError, type WaitForOptions, type WaitForRolloutOptions, type WriteFileOptions, type WriteManyFile, type WriteManyOptions, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as serializeForSidecar, l as normalizeRuntimeBackendConfig } from "./runtime-api-DCMrscis.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
|
|
3
|
-
import { a as SandboxSession, c as collectAgentResponseText, d as buildTraceExportPayload, f as exportTraceBundle, h as parseSSEStream, i as SandboxTaskSession, l as getSandboxEventText, m as toOtelJson, o as InteractiveSessionHandle, p as otelTraceIdForTangleTrace, s as applySandboxEventText, t as SandboxInstance } from "./sandbox-
|
|
4
|
-
import { a as
|
|
3
|
+
import { a as SandboxSession, c as collectAgentResponseText, d as buildTraceExportPayload, f as exportTraceBundle, h as parseSSEStream, i as SandboxTaskSession, l as getSandboxEventText, m as toOtelJson, o as InteractiveSessionHandle, p as otelTraceIdForTangleTrace, s as applySandboxEventText, t as SandboxInstance } from "./sandbox-DnDmHM5x.js";
|
|
4
|
+
import { a as splitInlineProfileSkills, c as SandboxFleetClient, d as SANDBOX_SIZE_PRESET_NAMES, f as resolveSandboxResources, i as splitInlineProfileFileMounts, l as DEFAULT_SANDBOX_SIZE, n as SandboxClient, o as validateDeferredProfileFileMounts, p as sandboxResourcesForSize, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as SANDBOX_SIZE_PRESETS } from "./client-DAGPD4d-.js";
|
|
5
5
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CeNQA9H_.js";
|
|
6
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
6
|
+
import { t as TangleSandboxClient } from "./tangle-BaTM5dI_.js";
|
|
7
7
|
import { agentProfileSchema, capabilitySchema, defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
8
8
|
//#region src/confidential.ts
|
|
9
9
|
function generateAttestationNonce(bytes = 32) {
|
|
@@ -1454,4 +1454,4 @@ function stripUndefined(value) {
|
|
|
1454
1454
|
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0).map(([k, v]) => [k, stripUndefined(v)]));
|
|
1455
1455
|
}
|
|
1456
1456
|
//#endregion
|
|
1457
|
-
export { AuthError, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, CollaborationClient, CollaborationFileBridge, DEFAULT_SANDBOX_SIZE, EgressProxyRecoveryError, GPU_LEASE_PROVIDER_NAMES, Image, ImageBuilder, IntelligenceClient, InteractiveSessionHandle, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, NetworkError, NotFoundError, PartialFailureError, QuotaError, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxFleet, SandboxFleetClient, SandboxInstance, SandboxSession, SandboxTaskSession, ServerError, StateError, TangleSandboxClient, TimeoutError, ValidationError, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
|
|
1457
|
+
export { AuthError, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, CollaborationClient, CollaborationFileBridge, DEFAULT_SANDBOX_SIZE, EgressProxyRecoveryError, GPU_LEASE_PROVIDER_NAMES, Image, ImageBuilder, IntelligenceClient, InteractiveSessionHandle, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, NetworkError, NotFoundError, PartialFailureError, QuotaError, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxFleet, SandboxFleetClient, SandboxInstance, SandboxSession, SandboxTaskSession, ServerError, StateError, TangleSandboxClient, TimeoutError, ValidationError, agentProfileSchema, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, capabilitySchema, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, materializeProfileFileMounts, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateAgentProfileSecurity, validateDeferredProfileFileMounts };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ar as
|
|
1
|
+
import { Ar as SandboxRuntimeHealth, D as CommitTaskSessionOptions, Fi as WriteFileOptions, Fr as SandboxTerminalInfo, I as CreateSessionOptions, Ir as SandboxTerminalManager, L as CreateTaskSessionOptions, Lr as SandboxTerminalRequestOptions, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Pr as SandboxTerminalCreateOptions, Tr as SandboxPortBinding, Xr as SendSessionMessageRequest, Xt as ListMessagesOptions, Yr as SendSessionMessageOptions, Zr as SentSessionMessage, _i as TaskSessionCommitResult, at as FileReadBatchResult, b as ChunkedUploadOptions, ct as FileRenameResult, dt as FileTreeOptions, ft as FileTreeResult, gi as TaskSessionChanges, ht as FileWriteResult, it as FileReadBatchOptions, ji as UploadProgress, mt as FileUsageResult, pt as FileUsageOptions, ri as SessionMessage, ti as SessionInfo, x as ChunkedUploadResult, yi as TaskSessionInfo } from "./types-CKKO6y8K.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/chunked-upload.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $ as EventStreamOptions, $r as SessionEventStreamOptions, Ar as SandboxRuntimeHealth, At as GitDiff, C as CodeExecutionResult, Ci as TeeAttestationResponse, D as CommitTaskSessionOptions, Dt as GitBranch, Fi as WriteFileOptions, Fn as Rollout, G as DriveTurnOptions, Gr as SearchMatch, Gt as IntelligenceReportBudget, H as DispatchedSession, I as CreateSessionOptions, Ii as WriteManyFile, Ir as SandboxTerminalManager, Jn as SandboxEvent, Jt as IntelligenceReportWindow, Kn as SandboxConnection, Kr as SearchOptions, Kt as IntelligenceReportCompareTo, L as CreateTaskSessionOptions, Li as WriteManyOptions, Ln as RolloutOptions, Lt as GpuLeaseManager, Mr as SandboxRuntimeProfileList, Mt as GpuLease, Ni as WaitForOptions, Nn as RestoreSnapshotOptions, Nr as SandboxStatus, O as CompletedTurnResult, Oi as TurnDriveResult, Or as SandboxResourceUsage, Ot as GitCommit, Pi as WaitForRolloutOptions, Pn as ResumeOptions, Rr as SandboxTraceBundle, S as CodeExecutionOptions, Sr as SandboxInfo, Ti as TeePublicKeyResponse, Tr as SandboxPortBinding, Un as SSHCommandDescriptor, Ur as ScopedToken, Ut as InstalledTool, V as DispatchPromptOptions, Vr as SandboxTraceOptions, Wn as SSHCredentials, Wt as IntelligenceReport, X as EgressManager, Xr as SendSessionMessageRequest, Xt as ListMessagesOptions, Y as DurablePlan, Yr as SendSessionMessageOptions, Yt as JsonValue, Zr as SentSessionMessage, _i as TaskSessionCommitResult, _n as PromptInputPart, bn as ProvisionEvent, ci as SnapshotResult, ei as SessionForkOptions, gi as TaskSessionChanges, hi as TaskResult, ht as FileWriteResult, in as NetworkManager, jt as GitStatus, l as BackendManager, ln as PreviewLinkManager, lt as FileSystem, mi as TaskOptions, ni as SessionListOptions, nt as ExecResult, oi as SnapshotInfo, pn as ProcessManager, pr as SandboxFleetTraceBundle, q as DriverInfo, ri as SessionMessage, s as BackendConfig, si as SnapshotOptions, sn as PermissionsManager, ti as SessionInfo, tn as MintScopedTokenOptions, tt as ExecOptions, ui as StartupDiagnostics, vn as PromptOptions, w as CodeLanguage, xi as TeeAttestationOptions, xn as ProvisionResult, y as BranchOptions, yi as TaskSessionInfo, yn as PromptResult, zn as RolloutStartResult } from "./types-CKKO6y8K.js";
|
|
2
2
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -506,6 +506,17 @@ declare class SandboxInstance {
|
|
|
506
506
|
private refreshInFlight?;
|
|
507
507
|
private readonly defaultRuntimeBackend?;
|
|
508
508
|
private readonly runtime;
|
|
509
|
+
/**
|
|
510
|
+
* A profile the runtime has cached (create-time priming), letting turns
|
|
511
|
+
* send `backend.profileSha256` instead of re-shipping the profile's static
|
|
512
|
+
* corpus. Set only when priming succeeded; when unset every turn sends the
|
|
513
|
+
* full profile (unchanged legacy behavior). `snapshot` is the serialized
|
|
514
|
+
* content at prime time — a turn substitutes the reference only when the
|
|
515
|
+
* outgoing profile serializes identically, so a caller that mutates the
|
|
516
|
+
* profile in place (or passes an equivalent object) is compared by CONTENT,
|
|
517
|
+
* never by object identity, and a changed profile is sent inline.
|
|
518
|
+
*/
|
|
519
|
+
private deferredProfileReference?;
|
|
509
520
|
constructor(client: HttpClient, info: SandboxInfo, defaultRuntimeBackend?: BackendConfig);
|
|
510
521
|
/** Unique sandbox identifier */
|
|
511
522
|
get id(): string;
|
|
@@ -757,6 +768,32 @@ declare class SandboxInstance {
|
|
|
757
768
|
* received. Reconnection is transparent — replayed events that were
|
|
758
769
|
* already yielded (based on event ID tracking) are deduplicated.
|
|
759
770
|
*/
|
|
771
|
+
/**
|
|
772
|
+
* Record that the runtime holds `profile` under `sha256` (from create-time
|
|
773
|
+
* priming), so later turns can reference it by hash. Captures a content
|
|
774
|
+
* snapshot so a later mutation of the same object is detected and sent
|
|
775
|
+
* inline. Internal — called by the client after a successful prime; never
|
|
776
|
+
* part of the public surface.
|
|
777
|
+
*/
|
|
778
|
+
_setDeferredProfileReference(profile: object, sha256: string): void;
|
|
779
|
+
/**
|
|
780
|
+
* Store `profile` on the runtime and record its hash so subsequent turns
|
|
781
|
+
* send `backend.profileSha256` instead of the full corpus. Internal; called
|
|
782
|
+
* by the client after the sandbox is running. Throws on transport/HTTP
|
|
783
|
+
* failure — the caller decides whether a prime failure is fatal (it is not:
|
|
784
|
+
* turns fall back to sending the full profile inline).
|
|
785
|
+
*/
|
|
786
|
+
_primeDeferredProfile(profile: object): Promise<string>;
|
|
787
|
+
/**
|
|
788
|
+
* Build the run request's `backend` body. When the outgoing profile's CONTENT
|
|
789
|
+
* matches the one the runtime already holds (and we are not resending after a
|
|
790
|
+
* cache miss), swap the inline `profile` for its `profileSha256` so a large
|
|
791
|
+
* static corpus does not ride every turn. The match is by serialized content,
|
|
792
|
+
* not object identity, so a mutated-in-place profile — or an equivalent
|
|
793
|
+
* object passed as a per-turn override — is compared correctly: unchanged
|
|
794
|
+
* content references by hash, changed content sends inline (the legacy shape).
|
|
795
|
+
*/
|
|
796
|
+
private buildRunBackendBody;
|
|
760
797
|
streamPrompt(message: string | PromptInputPart[], options?: PromptOptions): AsyncGenerator<SandboxEvent>;
|
|
761
798
|
/**
|
|
762
799
|
* Inner prompt stream: opens the SSE connection and reconnects on silent
|
|
@@ -919,6 +919,18 @@ function questionsFromAnswerSpec(request) {
|
|
|
919
919
|
multiSelect: field.multi === true
|
|
920
920
|
} : { question: field.label });
|
|
921
921
|
}
|
|
922
|
+
function isProfileNotCachedError(err) {
|
|
923
|
+
return err instanceof SandboxError && err.code === "PROFILE_NOT_CACHED";
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Stable-enough serialization for detecting whether a profile's content has
|
|
927
|
+
* changed since it was primed. Not a canonical hash — key reordering yields a
|
|
928
|
+
* different string, which only forgoes the optimization (the turn sends
|
|
929
|
+
* inline), never breaks correctness. Used purely for the local content check.
|
|
930
|
+
*/
|
|
931
|
+
function serializeProfileSnapshot(profile) {
|
|
932
|
+
return JSON.stringify(profile);
|
|
933
|
+
}
|
|
922
934
|
/**
|
|
923
935
|
* Convert a thrown error into an in-band `error` SandboxEvent so a streaming
|
|
924
936
|
* generator can surface a failure as an event followed by a terminal `done`
|
|
@@ -991,6 +1003,17 @@ var SandboxInstance = class SandboxInstance {
|
|
|
991
1003
|
refreshInFlight;
|
|
992
1004
|
defaultRuntimeBackend;
|
|
993
1005
|
runtime;
|
|
1006
|
+
/**
|
|
1007
|
+
* A profile the runtime has cached (create-time priming), letting turns
|
|
1008
|
+
* send `backend.profileSha256` instead of re-shipping the profile's static
|
|
1009
|
+
* corpus. Set only when priming succeeded; when unset every turn sends the
|
|
1010
|
+
* full profile (unchanged legacy behavior). `snapshot` is the serialized
|
|
1011
|
+
* content at prime time — a turn substitutes the reference only when the
|
|
1012
|
+
* outgoing profile serializes identically, so a caller that mutates the
|
|
1013
|
+
* profile in place (or passes an equivalent object) is compared by CONTENT,
|
|
1014
|
+
* never by object identity, and a changed profile is sent inline.
|
|
1015
|
+
*/
|
|
1016
|
+
deferredProfileReference;
|
|
994
1017
|
constructor(client, info, defaultRuntimeBackend) {
|
|
995
1018
|
this.client = client;
|
|
996
1019
|
this.info = info;
|
|
@@ -1121,6 +1144,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1121
1144
|
const client = this.client;
|
|
1122
1145
|
if (next && typeof client._emitTokenRefresh === "function") client._emitTokenRefresh(this.id, next);
|
|
1123
1146
|
}), { ...this.info }, this.defaultRuntimeBackend);
|
|
1147
|
+
if (this.deferredProfileReference !== void 0) directInstance.deferredProfileReference = this.deferredProfileReference;
|
|
1124
1148
|
directRuntimeInstances.add(directInstance);
|
|
1125
1149
|
return directInstance;
|
|
1126
1150
|
}
|
|
@@ -1582,18 +1606,96 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1582
1606
|
* received. Reconnection is transparent — replayed events that were
|
|
1583
1607
|
* already yielded (based on event ID tracking) are deduplicated.
|
|
1584
1608
|
*/
|
|
1609
|
+
/**
|
|
1610
|
+
* Record that the runtime holds `profile` under `sha256` (from create-time
|
|
1611
|
+
* priming), so later turns can reference it by hash. Captures a content
|
|
1612
|
+
* snapshot so a later mutation of the same object is detected and sent
|
|
1613
|
+
* inline. Internal — called by the client after a successful prime; never
|
|
1614
|
+
* part of the public surface.
|
|
1615
|
+
*/
|
|
1616
|
+
_setDeferredProfileReference(profile, sha256) {
|
|
1617
|
+
this.deferredProfileReference = {
|
|
1618
|
+
snapshot: serializeProfileSnapshot(profile),
|
|
1619
|
+
sha256
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Store `profile` on the runtime and record its hash so subsequent turns
|
|
1624
|
+
* send `backend.profileSha256` instead of the full corpus. Internal; called
|
|
1625
|
+
* by the client after the sandbox is running. Throws on transport/HTTP
|
|
1626
|
+
* failure — the caller decides whether a prime failure is fatal (it is not:
|
|
1627
|
+
* turns fall back to sending the full profile inline).
|
|
1628
|
+
*/
|
|
1629
|
+
async _primeDeferredProfile(profile) {
|
|
1630
|
+
const response = await this.runtimeFetch("/agents/profiles", {
|
|
1631
|
+
method: "POST",
|
|
1632
|
+
headers: { "content-type": "application/json" },
|
|
1633
|
+
body: JSON.stringify({ profile })
|
|
1634
|
+
});
|
|
1635
|
+
if (!response.ok) {
|
|
1636
|
+
const body = await response.text();
|
|
1637
|
+
throw parseErrorResponse(response.status, body, {
|
|
1638
|
+
method: "POST",
|
|
1639
|
+
path: "/agents/profiles"
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
const data = await response.json();
|
|
1643
|
+
if (typeof data.sha256 !== "string" || data.sha256.length === 0) throw new Error("Profile priming returned no sha256; runtime response malformed");
|
|
1644
|
+
this._setDeferredProfileReference(profile, data.sha256);
|
|
1645
|
+
return data.sha256;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Build the run request's `backend` body. When the outgoing profile's CONTENT
|
|
1649
|
+
* matches the one the runtime already holds (and we are not resending after a
|
|
1650
|
+
* cache miss), swap the inline `profile` for its `profileSha256` so a large
|
|
1651
|
+
* static corpus does not ride every turn. The match is by serialized content,
|
|
1652
|
+
* not object identity, so a mutated-in-place profile — or an equivalent
|
|
1653
|
+
* object passed as a per-turn override — is compared correctly: unchanged
|
|
1654
|
+
* content references by hash, changed content sends inline (the legacy shape).
|
|
1655
|
+
*/
|
|
1656
|
+
buildRunBackendBody(overrideBackend, forceFullProfile) {
|
|
1657
|
+
const normalized = normalizeRuntimeBackendConfig(overrideBackend ?? this.defaultRuntimeBackend);
|
|
1658
|
+
if (!normalized) return normalized;
|
|
1659
|
+
const deferred = this.deferredProfileReference;
|
|
1660
|
+
if (!forceFullProfile && deferred !== void 0 && normalized.profile !== void 0 && serializeProfileSnapshot(normalized.profile) === deferred.snapshot) {
|
|
1661
|
+
const { profile: _omitted, ...rest } = normalized;
|
|
1662
|
+
return {
|
|
1663
|
+
...rest,
|
|
1664
|
+
profileSha256: deferred.sha256
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
return normalized;
|
|
1668
|
+
}
|
|
1585
1669
|
async *streamPrompt(message, options) {
|
|
1586
1670
|
const isCallerAbort = () => options?.signal?.aborted === true;
|
|
1587
1671
|
let receivedTerminal = false;
|
|
1588
1672
|
let sessionId = options?.sessionId;
|
|
1589
1673
|
let executionId = options?.executionId;
|
|
1674
|
+
let profileResendAttempted = false;
|
|
1590
1675
|
try {
|
|
1591
|
-
for
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1676
|
+
for (;;) {
|
|
1677
|
+
let yieldedThisAttempt = false;
|
|
1678
|
+
try {
|
|
1679
|
+
for await (const event of this.streamPromptInner(message, options, { forceFullProfile: profileResendAttempted })) {
|
|
1680
|
+
yieldedThisAttempt = true;
|
|
1681
|
+
if (event.type === "result" || event.type === "done") receivedTerminal = true;
|
|
1682
|
+
if (event.type === "execution.started" && event.data.executionId) executionId = event.data.executionId;
|
|
1683
|
+
const sid = event.data.sessionId;
|
|
1684
|
+
if (typeof sid === "string" && sid.length > 0) sessionId = sid;
|
|
1685
|
+
yield event;
|
|
1686
|
+
}
|
|
1687
|
+
break;
|
|
1688
|
+
} catch (err) {
|
|
1689
|
+
if (!yieldedThisAttempt && !profileResendAttempted && isProfileNotCachedError(err)) {
|
|
1690
|
+
this.logStreamCheckpoint("profile_reference_miss_resend", {
|
|
1691
|
+
sessionId,
|
|
1692
|
+
executionId
|
|
1693
|
+
});
|
|
1694
|
+
profileResendAttempted = true;
|
|
1695
|
+
continue;
|
|
1696
|
+
}
|
|
1697
|
+
throw err;
|
|
1698
|
+
}
|
|
1597
1699
|
}
|
|
1598
1700
|
} catch (err) {
|
|
1599
1701
|
if (isCallerAbort()) return;
|
|
@@ -1626,7 +1728,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1626
1728
|
* the public `streamPrompt` wrapper converts those throws into a terminal
|
|
1627
1729
|
* `error` + `done` so callers never see a thrown generator.
|
|
1628
1730
|
*/
|
|
1629
|
-
async *streamPromptInner(message, options) {
|
|
1731
|
+
async *streamPromptInner(message, options, internal) {
|
|
1630
1732
|
if (options?.lastEventId && !options.executionId) throw new ValidationError("lastEventId requires executionId so the SDK can replay the correct execution", { executionId: "Required when lastEventId is set" });
|
|
1631
1733
|
await this.ensureRunning();
|
|
1632
1734
|
const timeoutMs = typeof options?.timeoutMs === "number" && options.timeoutMs > 0 ? options.timeoutMs : void 0;
|
|
@@ -1693,7 +1795,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1693
1795
|
requireVisibleAssistantOutput: options?.requireVisibleAssistantOutput,
|
|
1694
1796
|
...timeoutMs ? { timeoutMs } : {},
|
|
1695
1797
|
...options?.detach ? { detach: true } : {},
|
|
1696
|
-
backend:
|
|
1798
|
+
backend: this.buildRunBackendBody(options?.backend, internal?.forceFullProfile ?? false),
|
|
1697
1799
|
...options?.model ? { model: normalizeRuntimeModelOverride(options.model) } : {}
|
|
1698
1800
|
})
|
|
1699
1801
|
};
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-wJTgrUG8.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
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 TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-
|
|
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 TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-BaTM5dI_.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as parseErrorResponse } from "./errors-hbpL_-S6.js";
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-DnDmHM5x.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -1,5 +1,172 @@
|
|
|
1
1
|
import { AgentProfile as AgentProfile$1, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileConnection, AgentProfileFileMount, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileSecurityPolicy, AgentProfileValidationIssue, AgentProfileValidationResult, AgentSubagentProfile, Capability, agentProfileSchema, capabilitySchema, defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
2
2
|
|
|
3
|
+
//#region ../../../packages/runtime-contracts/dist/batch-events.d.ts
|
|
4
|
+
/** Token and tool usage emitted when one batch task completes. */
|
|
5
|
+
interface BatchTaskUsage {
|
|
6
|
+
inputTokens: number;
|
|
7
|
+
outputTokens: number;
|
|
8
|
+
cacheReadTokens?: number;
|
|
9
|
+
cacheWriteTokens?: number;
|
|
10
|
+
toolCallCount?: number;
|
|
11
|
+
reasoningTokens?: number;
|
|
12
|
+
cost?: number;
|
|
13
|
+
}
|
|
14
|
+
/** Per-backend aggregate emitted by `batch.completed`. */
|
|
15
|
+
interface BatchBackendStats {
|
|
16
|
+
backend: string;
|
|
17
|
+
backendLabel?: string;
|
|
18
|
+
backendModel?: string;
|
|
19
|
+
success: number;
|
|
20
|
+
failure: number;
|
|
21
|
+
retries: number;
|
|
22
|
+
successRate: number;
|
|
23
|
+
}
|
|
24
|
+
/** One sidecar allocated to a backend group. */
|
|
25
|
+
interface BatchSidecarGroup {
|
|
26
|
+
backend: string;
|
|
27
|
+
sidecarId: string;
|
|
28
|
+
variants: number;
|
|
29
|
+
}
|
|
30
|
+
interface BatchTaskEventIdentity {
|
|
31
|
+
taskId: string;
|
|
32
|
+
backend: string;
|
|
33
|
+
backendLabel?: string;
|
|
34
|
+
backendModel?: string;
|
|
35
|
+
}
|
|
36
|
+
/** Whether a streamed text value appends to or replaces prior text. */
|
|
37
|
+
type BatchTextValueMode = "delta" | "snapshot";
|
|
38
|
+
/** Data payloads keyed by the SSE event name emitted by `/batch/run`. */
|
|
39
|
+
interface BatchEventDataMap {
|
|
40
|
+
"batch.provisioning": {
|
|
41
|
+
desiredCapacity: number;
|
|
42
|
+
currentCapacity: number;
|
|
43
|
+
provisionTimeoutMs: number;
|
|
44
|
+
};
|
|
45
|
+
"batch.provisioned": {
|
|
46
|
+
capacity: number;
|
|
47
|
+
};
|
|
48
|
+
"batch.started": {
|
|
49
|
+
taskCount: number;
|
|
50
|
+
backendCount: number;
|
|
51
|
+
totalExecutions: number;
|
|
52
|
+
backends: string[];
|
|
53
|
+
backendGroups: number;
|
|
54
|
+
executionClass: string;
|
|
55
|
+
maxConcurrentPerSidecar: number;
|
|
56
|
+
maxSidecarsTotal: number;
|
|
57
|
+
driverCapacity: number;
|
|
58
|
+
policyMaxConcurrentPerSidecar: number | null;
|
|
59
|
+
policyMaxSidecarsPerHost: number | null;
|
|
60
|
+
};
|
|
61
|
+
"sidecars.allocated": {
|
|
62
|
+
count: number;
|
|
63
|
+
groups: BatchSidecarGroup[];
|
|
64
|
+
executionClass: string;
|
|
65
|
+
maxConcurrentPerSidecar: number;
|
|
66
|
+
maxSidecarsTotal: number;
|
|
67
|
+
driverCapacity: number;
|
|
68
|
+
policyMaxConcurrentPerSidecar: number | null;
|
|
69
|
+
policyMaxSidecarsPerHost: number | null;
|
|
70
|
+
};
|
|
71
|
+
"batch.completed": {
|
|
72
|
+
taskCount: number;
|
|
73
|
+
backendCount: number;
|
|
74
|
+
totalExecutions: number;
|
|
75
|
+
totalSuccess: number;
|
|
76
|
+
totalFailure: number;
|
|
77
|
+
totalRetries: number;
|
|
78
|
+
successRate: number;
|
|
79
|
+
byBackend: BatchBackendStats[];
|
|
80
|
+
};
|
|
81
|
+
"batch.failed": {
|
|
82
|
+
error: string;
|
|
83
|
+
backends?: string[];
|
|
84
|
+
};
|
|
85
|
+
"batch.persistent": {
|
|
86
|
+
message: string;
|
|
87
|
+
sidecarCount: number;
|
|
88
|
+
};
|
|
89
|
+
"batch.grace_period": {
|
|
90
|
+
message: string;
|
|
91
|
+
sidecarCount: number;
|
|
92
|
+
graceMs: number;
|
|
93
|
+
sidecarIds: string[];
|
|
94
|
+
};
|
|
95
|
+
"task.started": BatchTaskEventIdentity & {
|
|
96
|
+
index: number;
|
|
97
|
+
total: number;
|
|
98
|
+
attempt: number;
|
|
99
|
+
retries: number;
|
|
100
|
+
sidecarId: string;
|
|
101
|
+
projectRef?: string;
|
|
102
|
+
};
|
|
103
|
+
"task.message.delta": BatchTaskEventIdentity & {
|
|
104
|
+
sidecarId: string;
|
|
105
|
+
projectRef?: string;
|
|
106
|
+
value: string;
|
|
107
|
+
valueMode: BatchTextValueMode;
|
|
108
|
+
part: Record<string, unknown>;
|
|
109
|
+
};
|
|
110
|
+
"task.reasoning": BatchTaskEventIdentity & {
|
|
111
|
+
sidecarId: string;
|
|
112
|
+
projectRef?: string;
|
|
113
|
+
value: string;
|
|
114
|
+
valueMode: BatchTextValueMode;
|
|
115
|
+
part: Record<string, unknown>;
|
|
116
|
+
};
|
|
117
|
+
"task.tool.updated": BatchTaskEventIdentity & {
|
|
118
|
+
sidecarId: string;
|
|
119
|
+
projectRef?: string;
|
|
120
|
+
part: Record<string, unknown>;
|
|
121
|
+
};
|
|
122
|
+
"task.completed": BatchTaskEventIdentity & {
|
|
123
|
+
durationMs: number;
|
|
124
|
+
attempt: number;
|
|
125
|
+
retries: number;
|
|
126
|
+
sidecarId: string;
|
|
127
|
+
projectRef?: string;
|
|
128
|
+
resultSummary?: string;
|
|
129
|
+
sessionId?: string;
|
|
130
|
+
usage: BatchTaskUsage;
|
|
131
|
+
};
|
|
132
|
+
"task.failed": BatchTaskEventIdentity & {
|
|
133
|
+
durationMs: number;
|
|
134
|
+
attempt: number;
|
|
135
|
+
retries: number;
|
|
136
|
+
error: string;
|
|
137
|
+
sidecarId?: string;
|
|
138
|
+
projectRef?: string;
|
|
139
|
+
};
|
|
140
|
+
"task.retry": BatchTaskEventIdentity & {
|
|
141
|
+
attempt: number;
|
|
142
|
+
maxRetries: number;
|
|
143
|
+
error: string;
|
|
144
|
+
delayMs: number;
|
|
145
|
+
executionClass: string;
|
|
146
|
+
sidecarId: string;
|
|
147
|
+
projectRef?: string;
|
|
148
|
+
};
|
|
149
|
+
"backend.completed": {
|
|
150
|
+
backend: string;
|
|
151
|
+
backendLabel?: string;
|
|
152
|
+
backendModel?: string;
|
|
153
|
+
sidecarIds?: string[];
|
|
154
|
+
success: number;
|
|
155
|
+
failure: number;
|
|
156
|
+
retries: number;
|
|
157
|
+
successRate: number;
|
|
158
|
+
};
|
|
159
|
+
"sidecar.releasing": {
|
|
160
|
+
sidecarId: string;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/** Discriminated SSE event from a batch execution. */
|
|
164
|
+
type BatchEvent = { [K in keyof BatchEventDataMap]: {
|
|
165
|
+
type: K;
|
|
166
|
+
data: BatchEventDataMap[K]; /** Optional SSE id used by reconnecting consumers. */
|
|
167
|
+
id?: string;
|
|
168
|
+
} }[keyof BatchEventDataMap];
|
|
169
|
+
//#endregion
|
|
3
170
|
//#region src/types.d.ts
|
|
4
171
|
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
5
172
|
[key: string]: JsonValue;
|
|
@@ -343,6 +510,16 @@ interface CreateSandboxOptions {
|
|
|
343
510
|
* @default false
|
|
344
511
|
*/
|
|
345
512
|
bare?: boolean;
|
|
513
|
+
/**
|
|
514
|
+
* Start the managed sandbox runtime without configuring an AI agent.
|
|
515
|
+
*
|
|
516
|
+
* Files, exact process execution, lifecycle controls, and telemetry remain
|
|
517
|
+
* available. No model credentials or default backend are provisioned.
|
|
518
|
+
* Use this for CI jobs, evaluators, and other process-driven workloads.
|
|
519
|
+
*
|
|
520
|
+
* @default true
|
|
521
|
+
*/
|
|
522
|
+
agent?: boolean;
|
|
346
523
|
/**
|
|
347
524
|
* Provision a public preview URL for this sandbox (the default). Set to
|
|
348
525
|
* `false` for the fast lane: the server skips the public-edge tunnel
|
|
@@ -681,6 +858,28 @@ interface CreateSandboxOptions {
|
|
|
681
858
|
* @default true
|
|
682
859
|
*/
|
|
683
860
|
autoMaterializeProfileFiles?: boolean;
|
|
861
|
+
/**
|
|
862
|
+
* Auto-defer an inline `backend.profile`'s static corpus so it is delivered
|
|
863
|
+
* once instead of on every turn. At create time the SDK strips inline
|
|
864
|
+
* `resources.skills` from the create request (keeping the create body under
|
|
865
|
+
* its wire cap), then primes the running sandbox with the full profile and
|
|
866
|
+
* references it by hash (`backend.profileSha256`) on subsequent turns. The
|
|
867
|
+
* handle still holds the full profile, so a cache miss transparently resends
|
|
868
|
+
* it.
|
|
869
|
+
*
|
|
870
|
+
* When `false`, the full profile (skills included) rides the create request
|
|
871
|
+
* and every turn — the legacy wire shape. Only applies to an inline
|
|
872
|
+
* `AgentProfile` object on `backend.profile`, and is independent of
|
|
873
|
+
* {@link autoMaterializeProfileFiles}.
|
|
874
|
+
*
|
|
875
|
+
* A turn only substitutes the hash reference when the outgoing profile's
|
|
876
|
+
* content still matches what was primed: mutate the profile (or pass a
|
|
877
|
+
* changed per-turn `backend.profile`) and that turn sends the full profile
|
|
878
|
+
* inline again, so the runtime always runs the profile you passed.
|
|
879
|
+
*
|
|
880
|
+
* @default true
|
|
881
|
+
*/
|
|
882
|
+
autoDeferProfile?: boolean;
|
|
684
883
|
}
|
|
685
884
|
/**
|
|
686
885
|
* Per-call overrides for {@link SandboxClient.create}.
|
|
@@ -2301,145 +2500,6 @@ interface BatchResult {
|
|
|
2301
2500
|
/** Individual task results */
|
|
2302
2501
|
results: BatchTaskResult[];
|
|
2303
2502
|
}
|
|
2304
|
-
/** Token and tool usage emitted when one batch task completes. */
|
|
2305
|
-
interface BatchTaskUsage {
|
|
2306
|
-
inputTokens: number;
|
|
2307
|
-
outputTokens: number;
|
|
2308
|
-
cacheReadTokens?: number;
|
|
2309
|
-
cacheWriteTokens?: number;
|
|
2310
|
-
toolCallCount?: number;
|
|
2311
|
-
}
|
|
2312
|
-
/** Per-backend aggregate emitted by `batch.completed`. */
|
|
2313
|
-
interface BatchBackendStats {
|
|
2314
|
-
backend: string;
|
|
2315
|
-
backendLabel?: string;
|
|
2316
|
-
backendModel?: string;
|
|
2317
|
-
success: number;
|
|
2318
|
-
failure: number;
|
|
2319
|
-
retries: number;
|
|
2320
|
-
successRate: number;
|
|
2321
|
-
}
|
|
2322
|
-
/** Sidecars allocated to one backend configuration. */
|
|
2323
|
-
interface BatchSidecarGroup {
|
|
2324
|
-
backend: string;
|
|
2325
|
-
sidecarIds: string[];
|
|
2326
|
-
}
|
|
2327
|
-
interface BatchTaskEventIdentity {
|
|
2328
|
-
taskId: string;
|
|
2329
|
-
backend: string;
|
|
2330
|
-
backendLabel?: string;
|
|
2331
|
-
backendModel?: string;
|
|
2332
|
-
}
|
|
2333
|
-
/** Data payloads keyed by the SSE event name emitted by `/batch/run`. */
|
|
2334
|
-
interface BatchEventDataMap {
|
|
2335
|
-
"batch.provisioning": {
|
|
2336
|
-
desiredCapacity: number;
|
|
2337
|
-
currentCapacity: number;
|
|
2338
|
-
provisionTimeoutMs: number;
|
|
2339
|
-
};
|
|
2340
|
-
"batch.provisioned": {
|
|
2341
|
-
capacity: number;
|
|
2342
|
-
};
|
|
2343
|
-
"batch.started": {
|
|
2344
|
-
taskCount: number;
|
|
2345
|
-
backendCount: number;
|
|
2346
|
-
totalExecutions: number;
|
|
2347
|
-
maxConcurrent: number;
|
|
2348
|
-
scalingMode: string;
|
|
2349
|
-
backends: string[];
|
|
2350
|
-
};
|
|
2351
|
-
"sidecars.allocated": {
|
|
2352
|
-
count: number;
|
|
2353
|
-
groups: BatchSidecarGroup[];
|
|
2354
|
-
};
|
|
2355
|
-
"batch.completed": {
|
|
2356
|
-
taskCount: number;
|
|
2357
|
-
backendCount: number;
|
|
2358
|
-
totalExecutions: number;
|
|
2359
|
-
totalSuccess: number;
|
|
2360
|
-
totalFailure: number;
|
|
2361
|
-
totalRetries: number;
|
|
2362
|
-
successRate: number;
|
|
2363
|
-
byBackend: BatchBackendStats[];
|
|
2364
|
-
};
|
|
2365
|
-
"batch.failed": {
|
|
2366
|
-
error: string;
|
|
2367
|
-
backends?: string[];
|
|
2368
|
-
};
|
|
2369
|
-
"batch.persistent": {
|
|
2370
|
-
message: string;
|
|
2371
|
-
sidecarCount: number;
|
|
2372
|
-
};
|
|
2373
|
-
"batch.grace_period": {
|
|
2374
|
-
message: string;
|
|
2375
|
-
sidecarCount: number;
|
|
2376
|
-
graceMs: number;
|
|
2377
|
-
sidecarIds: string[];
|
|
2378
|
-
};
|
|
2379
|
-
"task.started": BatchTaskEventIdentity & {
|
|
2380
|
-
sidecarId: string;
|
|
2381
|
-
projectRef?: string;
|
|
2382
|
-
attempt: number;
|
|
2383
|
-
};
|
|
2384
|
-
"task.message.delta": BatchTaskEventIdentity & {
|
|
2385
|
-
sidecarId: string;
|
|
2386
|
-
projectRef?: string;
|
|
2387
|
-
value: string;
|
|
2388
|
-
part: Record<string, unknown>;
|
|
2389
|
-
};
|
|
2390
|
-
"task.reasoning": BatchTaskEventIdentity & {
|
|
2391
|
-
sidecarId: string;
|
|
2392
|
-
projectRef?: string;
|
|
2393
|
-
value: string;
|
|
2394
|
-
part: Record<string, unknown>;
|
|
2395
|
-
};
|
|
2396
|
-
"task.tool.updated": BatchTaskEventIdentity & {
|
|
2397
|
-
sidecarId: string;
|
|
2398
|
-
projectRef?: string;
|
|
2399
|
-
part: Record<string, unknown>;
|
|
2400
|
-
};
|
|
2401
|
-
"task.completed": BatchTaskEventIdentity & {
|
|
2402
|
-
durationMs: number;
|
|
2403
|
-
attempt: number;
|
|
2404
|
-
retries: number;
|
|
2405
|
-
sidecarId: string;
|
|
2406
|
-
projectRef?: string;
|
|
2407
|
-
resultSummary?: string;
|
|
2408
|
-
sessionId?: string;
|
|
2409
|
-
usage: BatchTaskUsage;
|
|
2410
|
-
};
|
|
2411
|
-
"task.failed": BatchTaskEventIdentity & {
|
|
2412
|
-
durationMs: number;
|
|
2413
|
-
attempt: number;
|
|
2414
|
-
retries: number;
|
|
2415
|
-
error: string;
|
|
2416
|
-
sidecarId?: string;
|
|
2417
|
-
};
|
|
2418
|
-
"task.retry": BatchTaskEventIdentity & {
|
|
2419
|
-
attempt: number;
|
|
2420
|
-
maxRetries: number;
|
|
2421
|
-
error: string;
|
|
2422
|
-
delayMs: number;
|
|
2423
|
-
};
|
|
2424
|
-
"backend.completed": {
|
|
2425
|
-
backend: string;
|
|
2426
|
-
backendLabel?: string;
|
|
2427
|
-
backendModel?: string;
|
|
2428
|
-
success: number;
|
|
2429
|
-
failure: number;
|
|
2430
|
-
retries: number;
|
|
2431
|
-
successRate: number;
|
|
2432
|
-
};
|
|
2433
|
-
"sidecar.releasing": {
|
|
2434
|
-
sidecarId: string;
|
|
2435
|
-
};
|
|
2436
|
-
}
|
|
2437
|
-
/** Discriminated SSE event from a batch execution. */
|
|
2438
|
-
type BatchEvent = { [K in keyof BatchEventDataMap]: {
|
|
2439
|
-
type: K;
|
|
2440
|
-
data: BatchEventDataMap[K]; /** Optional SSE id used by reconnecting consumers. */
|
|
2441
|
-
id?: string;
|
|
2442
|
-
} }[keyof BatchEventDataMap];
|
|
2443
2503
|
/**
|
|
2444
2504
|
* Stable worker identifier inside a sandbox fleet.
|
|
2445
2505
|
*
|
|
@@ -5091,4 +5151,4 @@ interface CodeExecutionOptions {
|
|
|
5091
5151
|
idempotencyKey?: string;
|
|
5092
5152
|
}
|
|
5093
5153
|
//#endregion
|
|
5094
|
-
export {
|
|
5154
|
+
export { EventStreamOptions as $, AgentProfileResources as $i, SandboxFleetDispatchResponse as $n, SessionEventStreamOptions as $r, ListSandboxOptions as $t, CreateIntelligenceReportOptions as A, UploadOptions as Ai, ReconcileSandboxFleetsOptions as An, SandboxRuntimeHealth as Ar, GitDiff as At, DirectoryPermission as B, BatchEventDataMap as Bi, RolloutStatus as Bn, SandboxTraceExport as Br, GpuType as Bt, CodeExecutionResult as C, TeeAttestationResponse as Ci, ProvisionStep as Cn, SandboxIntelligenceEnvelope as Cr, FleetPromptDispatchOptions as Ct, CommitTaskSessionOptions as D, ToolsConfig as Di, PublishPublicTemplateVersionOptions as Dn, SandboxProfileSummary as Dr, GitBranch as Dt, CodeResultPart as E, TokenRefreshHandler as Ei, PublishPublicTemplateOptions as En, SandboxPortPreviewLink as Er, GitAuth as Et, CreateSandboxOptions as F, WriteFileOptions as Fi, Rollout as Fn, SandboxTerminalInfo as Fr, GpuLeaseExecOptions as Ft, DriveTurnOptions as G, AgentProfileConfidential as Gi, SandboxClientConfig as Gn, SearchMatch as Gr, IntelligenceReportBudget as Gt, DispatchedSession as H, BatchTaskUsage as Hi, RunCodeOptions as Hn, SandboxUser as Hr, HostAgentRuntimeBackend as Ht, CreateSessionOptions as I, WriteManyFile as Ii, RolloutChildResult as In, SandboxTerminalManager as Ir, GpuLeaseExecResult as It, DriverType as J, AgentProfileMcpServer as Ji, SandboxEvent as Jn, SecretsManager as Jr, IntelligenceReportWindow as Jt, DriverConfig as K, AgentProfileConnection as Ki, SandboxConnection as Kn, SearchOptions as Kr, IntelligenceReportCompareTo as Kt, CreateTaskSessionOptions as L, WriteManyOptions as Li, RolloutOptions as Ln, SandboxTerminalRequestOptions as Lr, GpuLeaseManager as Lt, CreateSandboxFleetOptions as M, UsageInfo as Mi, RenameOptions as Mn, SandboxRuntimeProfileList as Mr, GpuLease as Mt, CreateSandboxFleetTokenOptions as N, WaitForOptions as Ni, RestoreSnapshotOptions as Nn, SandboxStatus as Nr, GpuLeaseBilling as Nt, CompletedTurnResult as O, TurnDriveResult as Oi, ReapExpiredSandboxFleetsOptions as On, SandboxResourceUsage as Or, GitCommit as Ot, CreateSandboxFleetWithCoordinatorOptions as P, WaitForRolloutOptions as Pi, ResumeOptions as Pn, SandboxTerminalCreateOptions as Pr, GpuLeaseCommandResult as Pt, EnsureDevServerOptions as Q, AgentProfileResourceRef as Qi, SandboxFleetDispatchFailureClass as Qn, SessionBackendCredentials as Qr, ListSandboxFleetOptions as Qt, DeleteOptions as R, BatchBackendStats as Ri, RolloutScorer as Rn, SandboxTraceBundle as Rr, GpuLeaseProviderName as Rt, CodeExecutionOptions as S, TeeAttestationReport as Si, ProvisionStatus as Sn, SandboxInfo as Sr, FleetMachineId as St, CodeResult as T, TeePublicKeyResponse as Ti, PublicTemplateVersionInfo as Tn, SandboxPortBinding as Tr, GPU_LEASE_PROVIDER_NAMES as Tt, DownloadOptions as U, AgentProfile$1 as Ui, SSHCommandDescriptor as Un, ScopedToken as Ur, InstalledTool as Ut, DispatchPromptOptions as V, BatchSidecarGroup as Vi, RolloutTurnPart as Vn, SandboxTraceOptions as Vr, HostAgentDriverConfig as Vt, DownloadProgress as W, AgentProfileCapabilities as Wi, SSHCredentials as Wn, ScopedTokenScope as Wr, IntelligenceReport as Wt, EgressManager as X, AgentProfilePermissionValue as Xi, SandboxFleetArtifactSpec as Xn, SendSessionMessageRequest as Xr, ListMessagesOptions as Xt, DurablePlan as Y, AgentProfileModelHints as Yi, SandboxFleetArtifact as Yn, SendSessionMessageOptions as Yr, JsonValue as Yt, EgressPolicy as Z, AgentProfilePrompt as Zi, SandboxFleetCostEstimate as Zn, SentSessionMessage as Zr, ListOptions as Zt, BatchTask as _, TaskSessionCommitResult as _i, PromptInputPart as _n, SandboxFleetUsage as _r, FleetDispatchResultBuffer as _t, AttachSandboxFleetMachineOptions as a, agentProfileSchema as aa, SessionStatus as ai, NonHostAgentDriverConfig as an, SandboxFleetMachineMeteredUsage as ar, FileReadBatchResult as at, ChunkedUploadOptions as b, TaskSessionProfile as bi, ProvisionEvent as bn, SandboxFleetWorkspaceRestoreResult as br, FleetExecDispatchOptions as bt, BackendInfo as c, defineGitHubResource as ca, SnapshotResult as ci, PreviewLinkInfo as cn, SandboxFleetManifest as cr, FileRenameResult as ct, BackendType as d, validateAgentProfileSecurity as da, StartupOperation as di, ProcessInfo as dn, SandboxFleetPolicy as dr, FileTreeOptions as dt, AgentProfileSecurityPolicy as ea, SessionForkOptions as ei, McpServerConfig as en, SandboxFleetDriverCapability as er, ExactProcessSpawnOptions as et, BatchBackend as f, StorageConfig as fi, ProcessLogEntry as fn, SandboxFleetToken as fr, FileTreeResult as ft, BatchRunRequest as g, TaskSessionChanges as gi, ProcessStatus as gn, SandboxFleetTraceOptions as gr, FleetDispatchCancelResult as gt, BatchRunOptions as h, TaskResult as hi, ProcessSpawnOptions as hn, SandboxFleetTraceExport as hr, FileWriteResult as ht, AttachGpuLeaseOptions as i, Capability as ia, SessionMessageInputPart as ii, NetworkManager as in, SandboxFleetMachine as ir, FileReadBatchOptions as it, CreateRequestOptions as j, UploadProgress as ji, ReconcileSandboxFleetsResult as jn, SandboxRuntimeProfile as jr, GitStatus as jt, CreateGpuLeaseOptions as k, UpdateUserOptions as ki, ReapExpiredSandboxFleetsResult as kn, SandboxResources as kr, GitConfig as kt, BackendManager as l, defineInlineResource as la, SshKeysManager as li, PreviewLinkManager as ln, SandboxFleetManifestMachine as lr, FileSystem as lt, BatchResult as m, TaskOptions as mi, ProcessSignal as mn, SandboxFleetTraceEvent as mr, FileUsageResult as mt, AccessPolicyRule as n, AgentProfileValidationResult as na, SessionListOptions as ni, MkdirOptions as nn, SandboxFleetInfo as nr, ExecResult as nt, BackendCapabilities as o, capabilitySchema as oa, SnapshotInfo as oi, PermissionLevel as on, SandboxFleetMachineRecord as or, FileReadError as ot, BatchOptions as p, SubscriptionInfo as pi, ProcessManager as pn, SandboxFleetTraceBundle as pr, FileUsageOptions as pt, DriverInfo as q, AgentProfileFileMount as qi, SandboxEnvironment as qn, SecretInfo as qr, IntelligenceReportSubjectType as qt, AddUserOptions as r, AgentSubagentProfile as ra, SessionMessage as ri, NetworkConfig as rn, SandboxFleetIntelligenceEnvelope as rr, FileInfo as rt, BackendConfig as s, defineAgentProfile as sa, SnapshotOptions as si, PermissionsManager as sn, SandboxFleetMachineSpec as sr, FileReadResult as st, AcceleratorKind as t, AgentProfileValidationIssue as ta, SessionInfo as ti, MintScopedTokenOptions as tn, SandboxFleetDriverTimings as tr, ExecOptions as tt, BackendStatus as u, mergeAgentProfiles as ua, StartupDiagnostics as ui, Process as un, SandboxFleetOperationsSummary as ur, FileTreeFile as ut, BatchTaskResult as v, TaskSessionFileChange as vi, PromptOptions as vn, SandboxFleetWorkspace as vr, FleetDispatchResultBufferOptions as vt, CodeLanguage as w, TeePublicKey as wi, PublicTemplateInfo as wn, SandboxPermissionsConfig as wr, FleetPromptDispatchResult as wt, ChunkedUploadResult as x, TeeAttestationOptions as xi, ProvisionResult as xn, SandboxFleetWorkspaceSnapshotResult as xr, FleetExecDispatchResult as xt, BranchOptions as y, TaskSessionInfo as yi, PromptResult as yn, SandboxFleetWorkspaceReconcileResult as yr, FleetDispatchStreamOptions as yt, DevServerInfo as z, BatchEvent as zi, RolloutStartResult as zn, SandboxTraceEvent as zr, GpuLeaseStatus as zt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.11.1-develop.
|
|
3
|
+
"version": "0.11.1-develop.20260721214535.0e31f17",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|