@tangle-network/sandbox 1.0.264 → 1.0.266
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -7
- package/dist/abi-pcDt2Adp.js +136 -0
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +5 -5
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +2 -2
- package/dist/{agent-run-outcome-DLLvOkbe.d.ts → agent-run-outcome-DThM9ULE.d.ts} +2 -2
- package/dist/{api-request-SBaqnuZB.js → api-request-gkPDymqn.js} +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/{browser-interactive-control-controller-Bg7mWDLX.d.ts → browser-interactive-control-controller-ClykJB9N.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-PiCGGheb.js → browser-interactive-control-controller-S_Uo-Zy7.js} +1 -1
- package/dist/{chunked-upload-D2S7tOJO.js → chunked-upload-ChZB-dYE.js} +1 -1
- package/dist/{chunked-upload-file-CfuaCSja.js → chunked-upload-file-BGaOS3iK.js} +1 -1
- package/dist/cli-auth-bundle-DXKH215p.js +2 -0
- package/dist/{cli-auth-bundle-C6DtK7GX-D8681c7j.js → cli-auth-bundle-DcxhAW23-C22MMIvx.js} +36 -36
- package/dist/{client-CkpH8MsM.js → client-BWD7-uaL.js} +40 -57
- package/dist/{client-DaZwQeOS.d.ts → client-BYGLoEiU.d.ts} +153 -198
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-Corlo5N0.js → collaboration-Bqk4jYQe.js} +2 -2
- package/dist/core.d.ts +6 -6
- package/dist/core.js +5 -5
- package/dist/{error-catalog-CWtp7Yg1.js → error-catalog-GS97N-Cm.js} +1 -1
- package/dist/{errors-C0S3TzhR.js → errors-D44qyFpy.js} +1 -1
- package/dist/{file-download-7lcgh1LR.js → file-download-BO-Hmn3x.js} +1 -1
- package/dist/gpu-lease/index.d.ts +192 -184
- package/dist/gpu-lease/index.js +390 -281
- package/dist/{index-dxhLhM8L.d.ts → index-DkB8WbjK.d.ts} +43 -99
- package/dist/index.d.ts +13 -13
- package/dist/index.js +178 -61
- package/dist/intelligence/index.d.ts +1 -1
- package/dist/intelligence/index.js +4 -4
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-CRp4VQKD.d.ts → interactive-controller-DSYQTRwh.d.ts} +3 -3
- package/dist/{interactive-controller-CqJX-LcO.js → interactive-controller-llj6EdlZ.js} +4 -4
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/{lines-BTStaSM2.d.ts → lines-D7lE49lV.d.ts} +1 -1
- package/dist/{lines-NECw0OhS.js → lines-DwJ7AKx7.js} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-wyO74fdb.js → local-cli-auth-C2cETxK4.js} +1 -1
- package/dist/{mcp-local-CpQncJsf.js → mcp-local-DVzsBlqX.js} +3 -3
- package/dist/{preview-D6bMarHf.d.ts → preview-DsHoo8BC.d.ts} +3 -3
- package/dist/{public-templates-3diq9yKD.d.ts → public-templates-DRqOkshE.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-B0oCpHY3.js → raw-evidence-archive-BJ1cA-sP.js} +3 -3
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +5 -5
- package/dist/{sandbox-BVN_aNT1.js → sandbox-C3PqmwfU.js} +136 -196
- package/dist/{secp256k1-ZiYFbGjz.js → secp256k1-DIwypP5B.js} +1 -1
- package/dist/{select-seat-Cu-9jRO-.js → select-seat-Dc7cQ8To.js} +3 -3
- package/dist/select-seat-command.d.ts +2 -2
- package/dist/select-seat-command.js +2 -2
- package/dist/session-gateway/index.js +1 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +2 -1
- package/dist/{tangle-Bpv3pIjM.js → tangle-BP8F3ZN0.js} +58 -185
- package/dist/{terminal-stream-types-DLaXWiSA.d.ts → terminal-stream-types-Cdz3xrux.d.ts} +1 -1
- package/dist/{types-COnts0u7.d.ts → types-BikjtQi3.d.ts} +202 -224
- package/package.json +11 -11
- package/dist/cli-auth-bundle-D5ZBMpZ7.js +0 -2
- /package/dist/{cli-auth-bundle-eUl7Sa1x.d.ts → cli-auth-bundle-CQCt2mcZ.d.ts} +0 -0
- /package/dist/{direct-http2-zLxsvF44.js → direct-http2-CzeIT93P.js} +0 -0
- /package/dist/{index-ClusTWYM.d.ts → index-B6aMEMDR.d.ts} +0 -0
- /package/dist/{index-BTXyTVq4.d.ts → index-BsT3M4X-.d.ts} +0 -0
- /package/dist/{prepared-evidence-ibAysmX8.js → prepared-evidence-DIFfn4Ki.js} +0 -0
- /package/dist/{preview-operations-DWL78boI.js → preview-operations-BTHZR1w2.js} +0 -0
- /package/dist/{raw-evidence-export-C0ieFpi2.d.ts → raw-evidence-export-C-TDdAgC.d.ts} +0 -0
- /package/dist/{raw-evidence-export-C6Xdl3nC.js → raw-evidence-export-Dog7W5zP.js} +0 -0
- /package/dist/{utils-BT2q9nkO.js → utils-BvN0Mk3j.js} +0 -0
package/README.md
CHANGED
|
@@ -226,17 +226,27 @@ const box = await client.create({
|
|
|
226
226
|
});
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
### Runtime and image
|
|
230
|
+
|
|
231
|
+
`runtime` chooses the isolation on the platform's hosts and `environment` what runs inside it.
|
|
232
|
+
Omit `runtime` for the platform default.
|
|
233
|
+
|
|
234
|
+
| Field | Meaning | `docker` | `firecracker` |
|
|
235
|
+
|---|---|---|---|
|
|
236
|
+
| `runtime` | Isolation on the platform's hosts | A container on the host kernel | A microVM with its own kernel |
|
|
237
|
+
| `environment` | A catalog environment, a container image reference, or a built image ID | Any of the three | An environment whose `runtimes` include `firecracker`, or an image pinned by `repository@sha256` that the cell's Firecracker hosts carry |
|
|
232
238
|
|
|
233
239
|
```typescript
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
console.log(environment.id, environment.description);
|
|
240
|
+
for (const environment of await client.environments.list()) {
|
|
241
|
+
console.log(environment.id, environment.runtimes.join(", "));
|
|
237
242
|
}
|
|
243
|
+
const microvm = await client.create({ runtime: "firecracker" });
|
|
238
244
|
```
|
|
239
245
|
|
|
246
|
+
Language names such as `python` are not environments; use an image reference such as `python:3.12-slim`.
|
|
247
|
+
A Firecracker create never falls back to Docker: a tag is refused with `UNSUPPORTED_FOR_RUNTIME`, an image no Firecracker host carries with `FIRECRACKER_IMAGE_UNAVAILABLE`, and an account the cell does not place on Firecracker with `RUNTIME_DISABLED`.
|
|
248
|
+
`driver: { type: "tangle" }` runs on Tangle network operators instead; it takes no `runtime`.
|
|
249
|
+
|
|
240
250
|
Use `bare: true` for a minimal container with command execution and lifecycle controls.
|
|
241
251
|
Use `agent: false` for managed files, processes, and telemetry without configuring an agent backend.
|
|
242
252
|
|
|
@@ -530,7 +540,7 @@ console.log(config);
|
|
|
530
540
|
|
|
531
541
|
Read the owning [file limits](../../../packages/runtime-contracts/src/file-limits.ts) and [request limits](../../../packages/runtime-contracts/src/request-limits.ts) for current write, proxy, direct-runtime, multipart and chunked-upload bounds.
|
|
532
542
|
|
|
533
|
-
Inline `resources.files` use the same file delivery path
|
|
543
|
+
Inline `resources.files` use the same file delivery path on the handle's first runtime call (create's POST carries none) and fresh prompt turns. A full per-turn profile (including one passed to a recovered `get()` handle) is preserved in the caller and in its retained control reference, while the SDK writes the mounts before sending a profile without inline file bodies. Successful delivery is reused for the same mount set and filesystem incarnation; a changed set or a recovered handle stages the bytes and publishes only absent files. Existing files with identical bytes and modes are accepted; different content, permissions, and symlinks are refused before dispatch. Live agent edits remain untouched when the original handle reuses its receipt; a recovered handle without that receipt fails closed on conflicting mounts. Guarded publication uses the sandbox image’s Node executable. Explicit execution-event replay performs no materialization. `primeProfile()` also delivers files separately and caches the remaining profile; its returned hash names that transport profile. Skills and other non-file resources must still fit the gateway request bound.
|
|
534
544
|
|
|
535
545
|
Use `fs.upload()` for local files or `fs.uploadData()` for in-memory content larger than the single-request limit.
|
|
536
546
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
//#region src/tangle/abi.ts
|
|
2
|
+
/**
|
|
3
|
+
* Tangle Contract ABI Definitions
|
|
4
|
+
*
|
|
5
|
+
* Viem-compatible ABI for the ITangleJobs precompile.
|
|
6
|
+
*/
|
|
7
|
+
const ITangleJobsAbi = [
|
|
8
|
+
{
|
|
9
|
+
type: "function",
|
|
10
|
+
name: "submitJob",
|
|
11
|
+
inputs: [
|
|
12
|
+
{
|
|
13
|
+
name: "serviceId",
|
|
14
|
+
type: "uint64"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "jobIndex",
|
|
18
|
+
type: "uint8"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "inputs",
|
|
22
|
+
type: "bytes"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
outputs: [{
|
|
26
|
+
name: "callId",
|
|
27
|
+
type: "uint64"
|
|
28
|
+
}],
|
|
29
|
+
stateMutability: "payable"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: "function",
|
|
33
|
+
name: "getJobCall",
|
|
34
|
+
inputs: [{
|
|
35
|
+
name: "serviceId",
|
|
36
|
+
type: "uint64"
|
|
37
|
+
}, {
|
|
38
|
+
name: "callId",
|
|
39
|
+
type: "uint64"
|
|
40
|
+
}],
|
|
41
|
+
outputs: [{
|
|
42
|
+
name: "",
|
|
43
|
+
type: "tuple",
|
|
44
|
+
components: [
|
|
45
|
+
{
|
|
46
|
+
name: "jobIndex",
|
|
47
|
+
type: "uint8"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "caller",
|
|
51
|
+
type: "address"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "createdAt",
|
|
55
|
+
type: "uint64"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "resultCount",
|
|
59
|
+
type: "uint32"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "completed",
|
|
63
|
+
type: "bool"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "isRFQ",
|
|
67
|
+
type: "bool"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "payment",
|
|
71
|
+
type: "uint256"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}],
|
|
75
|
+
stateMutability: "view"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: "event",
|
|
79
|
+
name: "JobSubmitted",
|
|
80
|
+
inputs: [
|
|
81
|
+
{
|
|
82
|
+
name: "serviceId",
|
|
83
|
+
type: "uint64",
|
|
84
|
+
indexed: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "callId",
|
|
88
|
+
type: "uint64",
|
|
89
|
+
indexed: true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "jobIndex",
|
|
93
|
+
type: "uint8",
|
|
94
|
+
indexed: false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "caller",
|
|
98
|
+
type: "address",
|
|
99
|
+
indexed: false
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "inputs",
|
|
103
|
+
type: "bytes",
|
|
104
|
+
indexed: false
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: "event",
|
|
110
|
+
name: "JobResultSubmitted",
|
|
111
|
+
inputs: [
|
|
112
|
+
{
|
|
113
|
+
name: "serviceId",
|
|
114
|
+
type: "uint64",
|
|
115
|
+
indexed: true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "callId",
|
|
119
|
+
type: "uint64",
|
|
120
|
+
indexed: true
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "operator",
|
|
124
|
+
type: "address",
|
|
125
|
+
indexed: true
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "result",
|
|
129
|
+
type: "bytes",
|
|
130
|
+
indexed: false
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
];
|
|
135
|
+
//#endregion
|
|
136
|
+
export { ITangleJobsAbi as t };
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-
|
|
2
|
-
import {
|
|
3
|
-
import { t as Sandbox } from "../client-
|
|
4
|
-
import { u as PreviewAuthorizer } from "../preview-
|
|
1
|
+
import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-DkB8WbjK.js";
|
|
2
|
+
import { Ba as CodeExecutionResult, Bt as SandboxFleetParent, Ha as CodeResultPart, Qi as SessionInfo, Va as CodeLanguage, ea as SessionListOptions, eo as BackendType, fa as BackendConfig, zr as CodeExecutionOptions } from "../types-BikjtQi3.js";
|
|
3
|
+
import { t as Sandbox } from "../client-BYGLoEiU.js";
|
|
4
|
+
import { u as PreviewAuthorizer } from "../preview-DsHoo8BC.js";
|
|
5
5
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
6
6
|
import { JSONSchema } from "zod/v4/core";
|
|
7
7
|
import { ToolSet } from "ai";
|
package/dist/agent/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-
|
|
2
|
-
import { D as assertCurrentBackendType } from "../interactive-controller-
|
|
3
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
4
|
-
import { O as ValidationError, T as StateError, v as NotFoundError } from "../errors-
|
|
5
|
-
import { t as Sandbox } from "../client-
|
|
1
|
+
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-DVzsBlqX.js";
|
|
2
|
+
import { D as assertCurrentBackendType } from "../interactive-controller-llj6EdlZ.js";
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-C3PqmwfU.js";
|
|
4
|
+
import { O as ValidationError, T as StateError, v as NotFoundError } from "../errors-D44qyFpy.js";
|
|
5
|
+
import { t as Sandbox } from "../client-BWD7-uaL.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/agent/instances.ts
|
|
8
8
|
const managers = /* @__PURE__ */ new WeakMap();
|
package/dist/agent/preview.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-
|
|
1
|
+
import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-DsHoo8BC.js";
|
|
2
2
|
export { AgentPreviewError, AgentPreviewOptions, PREVIEW_MCP_ALIAS, PREVIEW_TOOLS, PreviewAuthorizationRequest, PreviewAuthorizer, PreviewExecutionContext, PreviewTool, PublishAgentPreviewOptions, assertPreviewId, ensureAgentPreview, getAgentPreview, listAgentPreviews, previewOperationTool, previewToolsForProfile, publishAgentPreview, removeAgentPreview, resolveSelfSandbox, servePreviewMcp };
|
package/dist/agent/preview.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as agentProfileSchema } from "../profile-schema-B11dRfGB.js";
|
|
2
|
-
import { a as listAgentPreviews, c as resolveSelfSandbox, i as getAgentPreview, n as assertPreviewId, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "../preview-operations-
|
|
2
|
+
import { a as listAgentPreviews, c as resolveSelfSandbox, i as getAgentPreview, n as assertPreviewId, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "../preview-operations-BTHZR1w2.js";
|
|
3
3
|
//#region src/agent/preview-policy.ts
|
|
4
4
|
/** Channel-neutral preview tool selection from a host-authored profile. */
|
|
5
5
|
const PREVIEW_TOOLS = [
|
|
@@ -66,7 +66,7 @@ async function servePreviewMcp(request, config) {
|
|
|
66
66
|
if (typeof config.authorize !== "function") throw new Error("Preview MCP requires a host authorization callback");
|
|
67
67
|
const tools = config.tools ?? PREVIEW_TOOLS;
|
|
68
68
|
if (!tools.length || tools.some((tool) => !PREVIEW_TOOLS.includes(tool))) throw new Error("Preview MCP requires an explicit nonempty preview-only tool grant");
|
|
69
|
-
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-
|
|
69
|
+
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-DVzsBlqX.js").then((n) => n.n), import("@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js")]);
|
|
70
70
|
const handle = await createMcpServer(config.box, {
|
|
71
71
|
name: "tangle-previews",
|
|
72
72
|
sessionId: config.sessionId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tt as InteractionRequest } from "./terminal-stream-types-
|
|
2
|
-
import {
|
|
1
|
+
import { Tt as InteractionRequest } from "./terminal-stream-types-Cdz3xrux.js";
|
|
2
|
+
import { Ci as SandboxEvent, ai as AgentQuestionRequest, ii as AgentApprovalRequirement, oi as AgentRunStatus, pi as DurablePlanSnapshot, si as AgentToolInvocation } from "./types-BikjtQi3.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-run-outcome.d.ts
|
|
5
5
|
interface AgentRunOutcome {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as catalogEntry, t as ERROR_CATALOG } from "./error-catalog-
|
|
1
|
+
import { r as catalogEntry, t as ERROR_CATALOG } from "./error-catalog-GS97N-Cm.js";
|
|
2
2
|
import { t as parseSandboxRetryAfterHeader } from "./retry-after-header-BZbs5rig.js";
|
|
3
3
|
import { c as retryBudget, n as SANDBOX_API_RETRY_SCOPE, o as isUndelivered, r as abortableSleep, s as planResend } from "./retry-policy-oW3_ljoc.js";
|
|
4
4
|
//#region src/lib/response-rewrap.mjs
|
|
@@ -30,7 +30,7 @@ function rewrapResponse(original, headers, body = original.body) {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/lib/api-request.mjs
|
|
32
32
|
/** The package version tsdown.config.ts defines; unbuilt source reports 0.0.0. */
|
|
33
|
-
const SDK_VERSION = "1.0.
|
|
33
|
+
const SDK_VERSION = "1.0.266";
|
|
34
34
|
function withRequestContextHeaders(response, path, method, body = response.body) {
|
|
35
35
|
const headers = new Headers(response.headers);
|
|
36
36
|
headers.set("x-tangle-request-path", path);
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema, t as CliAuthReference } from "../cli-auth-bundle-
|
|
2
|
-
import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-
|
|
1
|
+
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema, t as CliAuthReference } from "../cli-auth-bundle-CQCt2mcZ.js";
|
|
2
|
+
import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-B6aMEMDR.js";
|
|
3
3
|
export { AnyTokenPayload, BatchScopedTokenPayload, CliAuthReference, CollaborationAccess, CollaborationTokenPayload, IssueCollaborationTokenOptions, ProductTokenIssuer, ProjectScopedTokenPayload, ReadTokenPayload, SessionScopedTokenPayload, TokenScope, assertCliAuthReferenceSupported, cliAuthReferenceSchema, getTokenTTL, isTokenExpiringSoon, issueBatchScopedToken, issueCollaborationToken, issueProjectScopedToken, issueReadToken, issueSessionScopedToken, materializeCliAuthBundle, unsafeDecodeToken, verifyToken };
|
package/dist/auth/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-
|
|
2
|
-
import "../cli-auth-bundle-
|
|
1
|
+
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-DcxhAW23-C22MMIvx.js";
|
|
2
|
+
import "../cli-auth-bundle-DXKH215p.js";
|
|
3
3
|
//#region src/auth/tokens.ts
|
|
4
4
|
const textEncoder = new TextEncoder();
|
|
5
5
|
const textDecoder = new TextDecoder();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ct as AgentInteractiveSessionControlClaimAcknowledgement, ft as AgentInteractiveSessionRef, i as TerminalStreamHandlers, lt as AgentInteractiveSessionControlClaimRequest, ot as AgentInteractiveSessionAttach, pt as AgentInteractiveSessionStatus, st as AgentInteractiveSessionControlClaim } from "./terminal-stream-types-
|
|
1
|
+
import { ct as AgentInteractiveSessionControlClaimAcknowledgement, ft as AgentInteractiveSessionRef, i as TerminalStreamHandlers, lt as AgentInteractiveSessionControlClaimRequest, ot as AgentInteractiveSessionAttach, pt as AgentInteractiveSessionStatus, st as AgentInteractiveSessionControlClaim } from "./terminal-stream-types-Cdz3xrux.js";
|
|
2
2
|
|
|
3
3
|
//#region src/interactive-types.d.ts
|
|
4
4
|
/** Cancellation for an interactive SDK request. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as boundedIdentifierSchema, D as isBoundedEventContentJson, E as boundedStringSchema, S as boundedEventContentStringSchema, T as boundedJsonSchema, _ as CONTRACT_MAX_ARRAY_LENGTH, b as boundedEventContentJsonSchema, g as sha256DigestSchema, o as canonicalCandidateDigest, w as boundedJsonRecordSchema, x as boundedEventContentRecordSchema, y as CONTRACT_MAX_STRING_LENGTH } from "./harness--g8UQ5TZ.js";
|
|
2
2
|
import { t as agentExecutionPreparationReceiptSchema } from "./agent-execution-preparation-receipt-j1Z7Om0k.js";
|
|
3
3
|
import { t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
|
|
4
|
-
import { i as fetchSandboxApi } from "./api-request-
|
|
4
|
+
import { i as fetchSandboxApi } from "./api-request-gkPDymqn.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.20/node_modules/@tangle-network/agent-interface/dist/native-session-event.js
|
|
7
7
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as SandboxError, n as isTransientWrite, r as parseErrorResponse } from "./errors-
|
|
1
|
+
import { C as SandboxError, n as isTransientWrite, r as parseErrorResponse } from "./errors-D44qyFpy.js";
|
|
2
2
|
import { c as retryBudget, i as awaitResend, n as SANDBOX_API_RETRY_SCOPE, r as abortableSleep } from "./retry-policy-oW3_ljoc.js";
|
|
3
3
|
import { i as FILE_UPLOAD_SESSION_MAX_BYTES, n as isFileTooLargeErrorBody, r as isPayloadTooLargeErrorBody } from "./file-transfer-DOSTbUSR.js";
|
|
4
4
|
//#region src/lib/sdk-retry.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as FILE_UPLOAD_SESSION_MAX_BYTES } from "./file-transfer-DOSTbUSR.js";
|
|
2
|
-
import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-
|
|
2
|
+
import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-ChZB-dYE.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { open } from "node:fs/promises";
|
|
5
5
|
//#region src/lib/chunked-upload-file.ts
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { n as agentProfileJsonSchema, r as agentProfileSchema } from "./profile-schema-B11dRfGB.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import "@tangle-network/agent-interface/harness-capabilities";
|
|
4
|
-
//#region ../../../packages/cli-agent-registry/dist/harness-contracts-
|
|
4
|
+
//#region ../../../packages/cli-agent-registry/dist/harness-contracts-B1vAJ1yx.mjs
|
|
5
5
|
/** The CLI version infra/nix ships for each registered harness. */
|
|
6
6
|
const HARNESS_CLI_VERSIONS = {
|
|
7
|
-
"claude-code": "2.1.
|
|
7
|
+
"claude-code": "2.1.318",
|
|
8
8
|
codex: "0.164.0",
|
|
9
|
-
cursor: "2026.
|
|
9
|
+
cursor: "2026.11.05-86047df",
|
|
10
10
|
opencode: "1.19.4",
|
|
11
|
-
pi: "1.
|
|
11
|
+
pi: "1.5.0",
|
|
12
12
|
"kimi-code": "1.49.0",
|
|
13
|
-
"factory-droids": "
|
|
14
|
-
amp: "0.0.
|
|
15
|
-
prime: "0.10.
|
|
13
|
+
"factory-droids": "1.5.0",
|
|
14
|
+
amp: "0.0.1793937652-gdc5d48",
|
|
15
|
+
prime: "0.10.2",
|
|
16
16
|
hermes: "0.22.4",
|
|
17
|
-
openclaw: "2026.
|
|
18
|
-
acp: "claude-agent-acp 0.
|
|
17
|
+
openclaw: "2026.11.1",
|
|
18
|
+
acp: "claude-agent-acp 0.101.0; codex-acp 0.16.0; gemini-cli 0.67.0",
|
|
19
19
|
grok: "0.1.220",
|
|
20
20
|
nanoclaw: "2.1.54"
|
|
21
21
|
};
|
|
@@ -809,7 +809,13 @@ const HARNESSES = {
|
|
|
809
809
|
],
|
|
810
810
|
write: "sqlite-wal",
|
|
811
811
|
shared: true,
|
|
812
|
-
format: "opencode.sqlite"
|
|
812
|
+
format: "opencode.sqlite",
|
|
813
|
+
credentialTables: [
|
|
814
|
+
"account",
|
|
815
|
+
"control_account",
|
|
816
|
+
"credential",
|
|
817
|
+
"session_share"
|
|
818
|
+
]
|
|
813
819
|
}],
|
|
814
820
|
identity: {
|
|
815
821
|
kind: "first-event",
|
|
@@ -1055,7 +1061,7 @@ function isBackendType(value) {
|
|
|
1055
1061
|
return BACKEND_TYPE_SET.has(value);
|
|
1056
1062
|
}
|
|
1057
1063
|
//#endregion
|
|
1058
|
-
//#region ../../../packages/cli-agent-registry/dist/specs-
|
|
1064
|
+
//#region ../../../packages/cli-agent-registry/dist/specs-D_iuiC3T.mjs
|
|
1059
1065
|
z.globalRegistry.add(agentProfileSchema, {
|
|
1060
1066
|
id: "AgentProfile",
|
|
1061
1067
|
...agentProfileJsonSchema
|
|
@@ -1066,6 +1072,16 @@ const BASE_CAPABILITIES = {
|
|
|
1066
1072
|
reasoning: true,
|
|
1067
1073
|
multimodal: false
|
|
1068
1074
|
};
|
|
1075
|
+
/** amp, Factory Droids and Grok: text in, no reasoning stream, MCP or config. */
|
|
1076
|
+
const TEXT_CLI_CAPABILITIES = {
|
|
1077
|
+
...BASE_CAPABILITIES,
|
|
1078
|
+
reasoning: false,
|
|
1079
|
+
contextWindow: 128e3,
|
|
1080
|
+
mcp: false,
|
|
1081
|
+
sessions: true,
|
|
1082
|
+
configurable: false,
|
|
1083
|
+
imageInput: false
|
|
1084
|
+
};
|
|
1069
1085
|
/**
|
|
1070
1086
|
* claude-code is the only provider that demotes uid + forces HOME=/home/agent
|
|
1071
1087
|
* when the sidecar runs as root. All other CLIs inherit the sidecar HOME.
|
|
@@ -1073,6 +1089,7 @@ const BASE_CAPABILITIES = {
|
|
|
1073
1089
|
const CLI_AGENT_SPECS = [
|
|
1074
1090
|
{
|
|
1075
1091
|
name: BACKEND_TYPE.OPENCODE,
|
|
1092
|
+
executionCorrelation: true,
|
|
1076
1093
|
nativeSession: NATIVE_SESSION_CONTRACTS.opencode,
|
|
1077
1094
|
messageStorageDir: ".opencode",
|
|
1078
1095
|
cliDirLayout: {
|
|
@@ -1191,6 +1208,7 @@ const CLI_AGENT_SPECS = [
|
|
|
1191
1208
|
},
|
|
1192
1209
|
{
|
|
1193
1210
|
name: BACKEND_TYPE.CLAUDE_CODE,
|
|
1211
|
+
executionCorrelation: true,
|
|
1194
1212
|
nativeSession: NATIVE_SESSION_CONTRACTS["claude-code"],
|
|
1195
1213
|
runtime: HARNESSES["claude-code"].lifecycle.runtime,
|
|
1196
1214
|
messageStorageDir: ".claude-code",
|
|
@@ -1358,14 +1376,8 @@ const CLI_AGENT_SPECS = [
|
|
|
1358
1376
|
callerCredentialOnly: true,
|
|
1359
1377
|
envVars: HARNESSES["amp"].config.envVars,
|
|
1360
1378
|
capabilities: {
|
|
1361
|
-
...
|
|
1362
|
-
|
|
1363
|
-
contextWindow: 128e3,
|
|
1364
|
-
mcp: false,
|
|
1365
|
-
sessions: true,
|
|
1366
|
-
configurable: false,
|
|
1367
|
-
interactions: [],
|
|
1368
|
-
imageInput: false
|
|
1379
|
+
...TEXT_CLI_CAPABILITIES,
|
|
1380
|
+
interactions: []
|
|
1369
1381
|
},
|
|
1370
1382
|
cliAuthHome: { kind: "inherit-home" },
|
|
1371
1383
|
hasCliAuth: true
|
|
@@ -1378,14 +1390,8 @@ const CLI_AGENT_SPECS = [
|
|
|
1378
1390
|
description: "Factory Droids CLI-based agent backend. A managed box runs its Tangle Router model as a droid custom model; a caller's FACTORY_API_KEY runs on the caller's Factory account.",
|
|
1379
1391
|
envVars: HARNESSES["factory-droids"].config.envVars,
|
|
1380
1392
|
capabilities: {
|
|
1381
|
-
...
|
|
1382
|
-
|
|
1383
|
-
contextWindow: 128e3,
|
|
1384
|
-
mcp: false,
|
|
1385
|
-
sessions: true,
|
|
1386
|
-
configurable: false,
|
|
1387
|
-
interactions: ["question"],
|
|
1388
|
-
imageInput: false
|
|
1393
|
+
...TEXT_CLI_CAPABILITIES,
|
|
1394
|
+
interactions: ["question"]
|
|
1389
1395
|
},
|
|
1390
1396
|
cliAuthHome: { kind: "inherit-home" },
|
|
1391
1397
|
hasCliAuth: true
|
|
@@ -1559,14 +1565,8 @@ const CLI_AGENT_SPECS = [
|
|
|
1559
1565
|
description: "Grok Build CLI. Headless grok -p against a caller base URL.",
|
|
1560
1566
|
envVars: HARNESSES.grok.config.envVars,
|
|
1561
1567
|
capabilities: {
|
|
1562
|
-
...
|
|
1563
|
-
|
|
1564
|
-
contextWindow: 128e3,
|
|
1565
|
-
mcp: false,
|
|
1566
|
-
sessions: true,
|
|
1567
|
-
configurable: false,
|
|
1568
|
-
interactions: [],
|
|
1569
|
-
imageInput: false
|
|
1568
|
+
...TEXT_CLI_CAPABILITIES,
|
|
1569
|
+
interactions: []
|
|
1570
1570
|
},
|
|
1571
1571
|
cliAuthHome: { kind: "inherit-home" },
|
|
1572
1572
|
hasCliAuth: false
|
|
@@ -1597,7 +1597,7 @@ function getSpec(name) {
|
|
|
1597
1597
|
return CLI_AGENT_SPECS.find((spec) => spec.name === name);
|
|
1598
1598
|
}
|
|
1599
1599
|
//#endregion
|
|
1600
|
-
//#region ../../../packages/cli-agent-registry/dist/cli-auth-bundle-
|
|
1600
|
+
//#region ../../../packages/cli-agent-registry/dist/cli-auth-bundle-DcxhAW23.mjs
|
|
1601
1601
|
const cliAuthReferenceSchema = z.strictObject({
|
|
1602
1602
|
account: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9@._+-]{0,127}$/),
|
|
1603
1603
|
secretEnv: z.string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}$/),
|