@tangle-network/sandbox 0.55.3 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -2
- package/dist/agent/index.d.ts +59 -19
- package/dist/agent/index.js +39 -357
- package/dist/agent/preview.d.ts +2 -0
- package/dist/agent/preview.js +74 -0
- package/dist/{agent-run-outcome-CWo6e5lW.d.ts → agent-run-outcome-DV-9cNsk.d.ts} +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/{browser-interactive-control-controller-Dv0gbFMu.js → browser-interactive-control-controller-CVGqjPgs.js} +1 -1
- package/dist/{browser-interactive-control-controller-BELrFH4f.d.ts → browser-interactive-control-controller-knjCl8Zp.d.ts} +1 -1
- package/dist/{client-B-LZQQ51.d.ts → client-B1I66sl_.d.ts} +10 -4
- package/dist/{client-B6Jo-v5w.js → client-BMdV_CeM.js} +30 -7
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-DLPFc9-W.js → collaboration-CSHswAOI.js} +1 -1
- package/dist/core.d.ts +5 -5
- package/dist/core.js +3 -3
- package/dist/{index-ATSSTK2A.d.ts → index-CGnI-q1g.d.ts} +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +7 -7
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{local-cli-auth-BAJuMBZU.js → local-cli-auth-DfuFJCcs.js} +1 -1
- package/dist/mcp-local-DXO-9rtB.js +440 -0
- package/dist/preview-Bz7TXYSf.d.ts +72 -0
- package/dist/preview-operations-Dgbi46FH.js +212 -0
- package/dist/{runtime-api-DoZsOiOR.js → runtime-api-BZg34WGd.js} +10 -5
- package/dist/runtime.d.ts +6 -4
- package/dist/runtime.js +3 -3
- package/dist/{sandbox-C7KqjY6Y.d.ts → sandbox-BMSWYvdP.d.ts} +144 -10
- package/dist/{sandbox-DzSE1u7d.js → sandbox-DyrDBnjp.js} +130 -10
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-CmpR_07-.js → tangle-BtQkJqfz.js} +2 -2
- package/dist/{types-UOIM3RS6.d.ts → types-DRyvWIJf.d.ts} +24 -2
- package/package.json +11 -6
- /package/dist/{abort-signal-si1WMfJb.js → abort-signal-CgFhjY_v.js} +0 -0
- /package/dist/{cli-auth-bundle-DUsK57rK.js → cli-auth-bundle-bRJOyaJO.js} +0 -0
- /package/dist/{errors-CmYPVl-k.js → errors-BkhlSDW-.js} +0 -0
- /package/dist/{errors-Cz23YNu2.d.ts → errors-CNsmhCen.d.ts} +0 -0
- /package/dist/{index-BWiG3Vcw.d.ts → index-BN7zNEUB.d.ts} +0 -0
- /package/dist/{index-BfVsF6yU.d.ts → index-X4EEZlMi.d.ts} +0 -0
- /package/dist/{terminal-stream-CcaBTVg3.d.ts → terminal-stream-BW4veIsI.d.ts} +0 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
//#region src/agent/preview-operations.ts
|
|
2
|
+
async function authorize(context, request) {
|
|
3
|
+
context.signal?.throwIfAborted();
|
|
4
|
+
await context.authorize?.(request);
|
|
5
|
+
context.signal?.throwIfAborted();
|
|
6
|
+
}
|
|
7
|
+
function validPort(port) {
|
|
8
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new AgentPreviewError("PREVIEW_INVALID_INPUT", "Port must be an integer between 1 and 65535");
|
|
9
|
+
}
|
|
10
|
+
function validName(name) {
|
|
11
|
+
let hasControlCharacters = false;
|
|
12
|
+
if (typeof name === "string") for (const character of name) {
|
|
13
|
+
const codePoint = character.codePointAt(0);
|
|
14
|
+
if (codePoint !== void 0 && (codePoint < 32 || codePoint === 127)) {
|
|
15
|
+
hasControlCharacters = true;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (name !== void 0 && (typeof name !== "string" || !name.trim() || name.length > 128 || hasControlCharacters)) throw new AgentPreviewError("PREVIEW_INVALID_INPUT", "App name must be 1-128 printable characters");
|
|
20
|
+
}
|
|
21
|
+
function assertPreviewId(id) {
|
|
22
|
+
if (typeof id !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(id)) throw new AgentPreviewError("PREVIEW_INVALID_INPUT", "A valid previewId is required");
|
|
23
|
+
}
|
|
24
|
+
/** A failed preview never becomes a fabricated URL or an account-wide lookup. */
|
|
25
|
+
var AgentPreviewError = class extends Error {
|
|
26
|
+
constructor(code, message, status) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.code = code;
|
|
29
|
+
this.status = status;
|
|
30
|
+
this.name = "AgentPreviewError";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Resolve only the sandbox bound to this credential. No list/name lookup, env
|
|
35
|
+
* id, owner fallback, or key delegation is allowed on this path. An ordinary
|
|
36
|
+
* owner client should select a sandbox explicitly instead.
|
|
37
|
+
*/
|
|
38
|
+
async function resolveSelfSandbox(client) {
|
|
39
|
+
const response = await client.fetch("/v1/sandboxes/self/identity", {
|
|
40
|
+
method: "GET",
|
|
41
|
+
redirect: "error"
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
await response.body?.cancel().catch(() => void 0);
|
|
45
|
+
throw new AgentPreviewError("SANDBOX_SELF_REFUSED", `Sandbox self identity was refused (HTTP ${response.status}); use a sandbox-bound runtime credential and a host supporting self identity`, response.status);
|
|
46
|
+
}
|
|
47
|
+
const body = await response.json();
|
|
48
|
+
if (!body || typeof body !== "object" || !("sandboxId" in body) || typeof body.sandboxId !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$/.test(body.sandboxId)) throw new AgentPreviewError("SANDBOX_SELF_INVALID_RESPONSE", "Sandbox self identity returned no valid bound sandbox id");
|
|
49
|
+
const box = await client.get(body.sandboxId);
|
|
50
|
+
if (!box || box.id !== body.sandboxId) throw new AgentPreviewError("SANDBOX_SELF_INVALID_RESPONSE", "The credential's sandbox is unavailable; self resolution never selects another sandbox");
|
|
51
|
+
return box;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Start/reuse the selected workspace's managed server and publish its preview.
|
|
55
|
+
* This is an explicit publishing operation, not a background post-turn hook.
|
|
56
|
+
* The returned URL has passed the existing routing readiness check; that is
|
|
57
|
+
* not proof of application correctness or per-recipient access control.
|
|
58
|
+
*/
|
|
59
|
+
async function ensureAgentPreview(box, options = {}, context = {}) {
|
|
60
|
+
if (!options || typeof options !== "object" || Array.isArray(options) || Object.keys(options).some((key) => key !== "sessionId" && key !== "cwd" && key !== "name") || Object.values(options).some((value) => value !== void 0 && (typeof value !== "string" || !value.trim() || value.includes("\0")))) throw new AgentPreviewError("PREVIEW_INVALID_INPUT", "Preview accepts only nonempty cwd, sessionId and name strings");
|
|
61
|
+
validName(options.name);
|
|
62
|
+
await authorize(context, {
|
|
63
|
+
operation: "start",
|
|
64
|
+
phase: "before",
|
|
65
|
+
sessionId: options.sessionId,
|
|
66
|
+
cwd: options.cwd
|
|
67
|
+
});
|
|
68
|
+
const server = await box.process.ensureDevServer({
|
|
69
|
+
sessionId: options.sessionId,
|
|
70
|
+
cwd: options.cwd
|
|
71
|
+
});
|
|
72
|
+
const port = server.port;
|
|
73
|
+
if (typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535) throw new AgentPreviewError("PREVIEW_INVALID_RESPONSE", "Managed server returned no valid listening port");
|
|
74
|
+
return publishPreview(box, {
|
|
75
|
+
port,
|
|
76
|
+
name: options.name
|
|
77
|
+
}, context, {
|
|
78
|
+
operation: "start",
|
|
79
|
+
sessionId: options.sessionId,
|
|
80
|
+
cwd: options.cwd,
|
|
81
|
+
workspaceRoot: server.workspaceRoot
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/** Publish an already-running service, including multiple services in one repo. */
|
|
85
|
+
async function publishAgentPreview(box, options, context = {}) {
|
|
86
|
+
if (!options || typeof options !== "object" || Array.isArray(options) || Object.keys(options).some((key) => key !== "port" && key !== "name")) throw new AgentPreviewError("PREVIEW_INVALID_INPUT", "Publishing accepts only port and name");
|
|
87
|
+
validPort(options.port);
|
|
88
|
+
validName(options.name);
|
|
89
|
+
await authorize(context, {
|
|
90
|
+
operation: "publish",
|
|
91
|
+
phase: "before",
|
|
92
|
+
port: options.port
|
|
93
|
+
});
|
|
94
|
+
return publishPreview(box, options, context, { operation: "publish" });
|
|
95
|
+
}
|
|
96
|
+
function managedAppIdentity(link) {
|
|
97
|
+
const app = link.metadata?.app;
|
|
98
|
+
if (!app || typeof app !== "object" || Array.isArray(app)) return;
|
|
99
|
+
const cwd = app.cwd;
|
|
100
|
+
const sessionId = app.sessionId;
|
|
101
|
+
if (typeof cwd !== "string" || !cwd) return;
|
|
102
|
+
return {
|
|
103
|
+
cwd,
|
|
104
|
+
...typeof sessionId === "string" && sessionId ? { sessionId } : {}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async function publishPreview(box, options, context, scope) {
|
|
108
|
+
const { port } = options;
|
|
109
|
+
const request = {
|
|
110
|
+
operation: scope.operation,
|
|
111
|
+
sessionId: scope.sessionId,
|
|
112
|
+
cwd: scope.cwd,
|
|
113
|
+
port
|
|
114
|
+
};
|
|
115
|
+
await authorize(context, {
|
|
116
|
+
...request,
|
|
117
|
+
phase: "publish"
|
|
118
|
+
});
|
|
119
|
+
const before = await box.previewLinks.list();
|
|
120
|
+
const metadata = { app: {
|
|
121
|
+
...options.name ? { name: options.name } : {},
|
|
122
|
+
...scope.workspaceRoot ? { cwd: scope.workspaceRoot } : {},
|
|
123
|
+
...scope.sessionId ? { sessionId: scope.sessionId } : {}
|
|
124
|
+
} };
|
|
125
|
+
let creation;
|
|
126
|
+
try {
|
|
127
|
+
creation = await box.previewLinks.create(port, { metadata });
|
|
128
|
+
assertPreviewId(creation.previewId);
|
|
129
|
+
if (creation.port !== port) throw new AgentPreviewError("PREVIEW_INVALID_RESPONSE", "Preview creation returned a different service port");
|
|
130
|
+
const link = await box.previewLinks.waitUntilReady(creation.previewId, { signal: context.signal });
|
|
131
|
+
validateReadyPreview(link, port, creation.previewId);
|
|
132
|
+
await authorize(context, {
|
|
133
|
+
...request,
|
|
134
|
+
previewId: link.previewId,
|
|
135
|
+
phase: "after"
|
|
136
|
+
});
|
|
137
|
+
if (scope.operation === "start" && scope.workspaceRoot) for (const previous of before) {
|
|
138
|
+
if (previous.previewId === link.previewId) continue;
|
|
139
|
+
const identity = managedAppIdentity(previous);
|
|
140
|
+
if (identity?.cwd !== scope.workspaceRoot || identity.sessionId !== scope.sessionId) continue;
|
|
141
|
+
await authorize(context, {
|
|
142
|
+
operation: "remove",
|
|
143
|
+
phase: "before",
|
|
144
|
+
previewId: previous.previewId,
|
|
145
|
+
port: previous.port,
|
|
146
|
+
sessionId: scope.sessionId,
|
|
147
|
+
cwd: scope.cwd
|
|
148
|
+
});
|
|
149
|
+
await box.previewLinks.remove(previous.previewId);
|
|
150
|
+
}
|
|
151
|
+
return link;
|
|
152
|
+
} catch (error) {
|
|
153
|
+
if (creation?.created) await box.previewLinks.remove(creation.previewId).catch(() => void 0);
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function validateReadyPreview(link, port, previewId) {
|
|
158
|
+
if (link.status !== "ready") throw new AgentPreviewError("PREVIEW_NOT_READY", "Preview routing is not ready");
|
|
159
|
+
let url;
|
|
160
|
+
try {
|
|
161
|
+
url = new URL(link.url);
|
|
162
|
+
} catch {
|
|
163
|
+
throw new AgentPreviewError("PREVIEW_INVALID_RESPONSE", "Preview returned an invalid URL");
|
|
164
|
+
}
|
|
165
|
+
if (link.port !== port || link.previewId !== previewId || !["http:", "https:"].includes(url.protocol) || url.username || url.password) throw new AgentPreviewError("PREVIEW_INVALID_RESPONSE", "Preview does not identify the selected HTTP service");
|
|
166
|
+
}
|
|
167
|
+
/** Lists recorded publications, not every listening port. Never auto-publishes. */
|
|
168
|
+
async function listAgentPreviews(box, context = {}) {
|
|
169
|
+
await authorize(context, {
|
|
170
|
+
operation: "list",
|
|
171
|
+
phase: "before"
|
|
172
|
+
});
|
|
173
|
+
const links = await box.previewLinks.list();
|
|
174
|
+
await authorize(context, {
|
|
175
|
+
operation: "list",
|
|
176
|
+
phase: "after"
|
|
177
|
+
});
|
|
178
|
+
return links;
|
|
179
|
+
}
|
|
180
|
+
async function getAgentPreview(box, previewId, context = {}) {
|
|
181
|
+
assertPreviewId(previewId);
|
|
182
|
+
await authorize(context, {
|
|
183
|
+
operation: "get",
|
|
184
|
+
phase: "before",
|
|
185
|
+
previewId
|
|
186
|
+
});
|
|
187
|
+
const link = await box.previewLinks.get(previewId);
|
|
188
|
+
await authorize(context, {
|
|
189
|
+
operation: "get",
|
|
190
|
+
phase: "after",
|
|
191
|
+
previewId,
|
|
192
|
+
port: link.port
|
|
193
|
+
});
|
|
194
|
+
return link;
|
|
195
|
+
}
|
|
196
|
+
/** Unpublishes one service; does not stop it or affect other app URLs. */
|
|
197
|
+
async function removeAgentPreview(box, previewId, context = {}) {
|
|
198
|
+
assertPreviewId(previewId);
|
|
199
|
+
await authorize(context, {
|
|
200
|
+
operation: "remove",
|
|
201
|
+
phase: "before",
|
|
202
|
+
previewId
|
|
203
|
+
});
|
|
204
|
+
await box.previewLinks.remove(previewId);
|
|
205
|
+
await authorize(context, {
|
|
206
|
+
operation: "remove",
|
|
207
|
+
phase: "after",
|
|
208
|
+
previewId
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
export { listAgentPreviews as a, resolveSelfSandbox as c, getAgentPreview as i, assertPreviewId as n, publishAgentPreview as o, ensureAgentPreview as r, removeAgentPreview as s, AgentPreviewError as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as parseErrorResponse, f as SandboxError, g as ValidationError, h as TimeoutError, n as CapabilityError, p as ServerError, s as NetworkError, u as QuotaError } from "./errors-
|
|
2
|
-
import { n as combineAbortSignals } from "./abort-signal-
|
|
1
|
+
import { _ as parseErrorResponse, f as SandboxError, g as ValidationError, h as TimeoutError, n as CapabilityError, p as ServerError, s as NetworkError, u as QuotaError } from "./errors-BkhlSDW-.js";
|
|
2
|
+
import { n as combineAbortSignals } from "./abort-signal-CgFhjY_v.js";
|
|
3
3
|
import { AgentExactRunControlRefSchema, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, DurablePlanSchema, InteractionRequestSchema, agentProfileSchema, canonicalCandidateDigest, harnessTypeSchema } from "@tangle-network/agent-interface";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region ../../../packages/runtime-contracts/dist/backend-types.js
|
|
@@ -1183,13 +1183,16 @@ var SandboxRuntimeApi = class {
|
|
|
1183
1183
|
await this.transport.ensureRunning();
|
|
1184
1184
|
return this.json("/health", { method: "GET" });
|
|
1185
1185
|
}
|
|
1186
|
-
async setRuntimeEnv(env) {
|
|
1186
|
+
async setRuntimeEnv(env, options = {}) {
|
|
1187
1187
|
const count = Object.keys(env).length;
|
|
1188
1188
|
if (count === 0) throw new ValidationError("No environment variables provided");
|
|
1189
1189
|
await this.transport.ensureRunning();
|
|
1190
|
-
if ((await this.json("/config/config/app-env", {
|
|
1190
|
+
if ((await this.json(options.ttlMs === void 0 ? "/config/config/app-env" : "/config/config/app-env/ttl", {
|
|
1191
1191
|
method: "POST",
|
|
1192
|
-
body: JSON.stringify({
|
|
1192
|
+
body: JSON.stringify({
|
|
1193
|
+
env,
|
|
1194
|
+
...options
|
|
1195
|
+
})
|
|
1193
1196
|
})).injected !== count) throw new NetworkError("Runtime did not acknowledge every environment variable");
|
|
1194
1197
|
}
|
|
1195
1198
|
async ports() {
|
|
@@ -1674,8 +1677,10 @@ function normalizeSessionInfo(raw) {
|
|
|
1674
1677
|
}
|
|
1675
1678
|
/** The admission check must hash the same wire request as dispatch. */
|
|
1676
1679
|
function sessionMessageRequestBody(request) {
|
|
1680
|
+
if (request.managedQuoteVersion !== void 0 && !/^mmq_[a-f0-9]{40}$/.test(request.managedQuoteVersion)) throw new ValidationError("managedQuoteVersion is invalid");
|
|
1677
1681
|
return {
|
|
1678
1682
|
...request.backend !== void 0 ? { backend: normalizeRuntimeBackendConfig(request.backend) } : {},
|
|
1683
|
+
...request.managedQuoteVersion !== void 0 ? { managedQuoteVersion: request.managedQuoteVersion } : {},
|
|
1679
1684
|
...request.runControlRef !== void 0 ? { runControlRef: AgentExactRunControlRefSchema.parse(request.runControlRef) } : {},
|
|
1680
1685
|
...request.messageId !== void 0 ? { messageID: request.messageId } : {},
|
|
1681
1686
|
parts: request.parts.map((part) => part.type === "text" ? {
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as CommitTaskSessionOptions, At as FileUsageResult, Bi as SessionExecutionInfo, Ci as SandboxTerminalManager, Dt as FileTreeOptions, Er as SandboxEvent, Fi as SendSessionMessageOptions, H as CreateTaskSessionOptions, Ii as SendSessionMessageRequest, Ji as SessionMessageAdmission, Li as SentSessionMessage, Ot as FileTreeResult, Si as SandboxTerminalInfo, Sn as ListMessagesOptions, T as ChunkedUploadResult, V as CreateSessionOptions, Vi as SessionExecutionStatus, Wi as SessionInfo, bt as FileReadBatchOptions, fa as TaskSessionInfo, hi as SandboxRuntimeHealth, jt as FileWriteResult, ka as WriteFileOptions, kt as FileUsageOptions, la as TaskSessionChanges, li as SandboxPortBinding, or as RenameOptions, qi as SessionMessage, ua as TaskSessionCommitResult, w as ChunkedUploadOptions, wa as UploadProgress, wi as SandboxTerminalRequestOptions, wt as FileRenameResult, xi as SandboxTerminalCreateOptions, xt as FileReadBatchResult, zi as SessionEventStreamOptions } from "./types-
|
|
2
|
-
import { _ as TimeoutError, a as FileWriteConflictError, c as NotFoundError, f as SandboxError, g as StateError, h as ServerError, l as PartialFailureError, m as SandboxFailureDetail, n as CapabilityError, p as SandboxErrorJson, s as NetworkError, t as AuthError, u as QuotaError, v as ValidationError } from "./errors-
|
|
3
|
-
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-
|
|
1
|
+
import { A as CommitTaskSessionOptions, At as FileUsageResult, Bi as SessionExecutionInfo, Ci as SandboxTerminalManager, Dt as FileTreeOptions, Er as SandboxEvent, Fi as SendSessionMessageOptions, H as CreateTaskSessionOptions, Ii as SendSessionMessageRequest, Ji as SessionMessageAdmission, Li as SentSessionMessage, Ot as FileTreeResult, Si as SandboxTerminalInfo, Sn as ListMessagesOptions, T as ChunkedUploadResult, V as CreateSessionOptions, Vi as SessionExecutionStatus, Wi as SessionInfo, bt as FileReadBatchOptions, fa as TaskSessionInfo, hi as SandboxRuntimeHealth, jt as FileWriteResult, ka as WriteFileOptions, kt as FileUsageOptions, la as TaskSessionChanges, li as SandboxPortBinding, or as RenameOptions, qi as SessionMessage, ua as TaskSessionCommitResult, w as ChunkedUploadOptions, wa as UploadProgress, wi as SandboxTerminalRequestOptions, wt as FileRenameResult, xi as SandboxTerminalCreateOptions, xt as FileReadBatchResult, zi as SessionEventStreamOptions } from "./types-DRyvWIJf.js";
|
|
2
|
+
import { _ as TimeoutError, a as FileWriteConflictError, c as NotFoundError, f as SandboxError, g as StateError, h as ServerError, l as PartialFailureError, m as SandboxFailureDetail, n as CapabilityError, p as SandboxErrorJson, s as NetworkError, t as AuthError, u as QuotaError, v as ValidationError } from "./errors-CNsmhCen.js";
|
|
3
|
+
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-DV-9cNsk.js";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/chunked-upload.d.ts
|
|
6
6
|
/** The transport a caller wires this module to — {@link SandboxInstance.runtimeFetch}
|
|
@@ -39,7 +39,9 @@ declare class SandboxRuntimeApi {
|
|
|
39
39
|
readonly terminals: SandboxTerminalManager;
|
|
40
40
|
constructor(transport: RuntimeTransport);
|
|
41
41
|
health(): Promise<SandboxRuntimeHealth>;
|
|
42
|
-
setRuntimeEnv(env: Record<string, string
|
|
42
|
+
setRuntimeEnv(env: Record<string, string>, options?: {
|
|
43
|
+
ttlMs?: number;
|
|
44
|
+
}): Promise<void>;
|
|
43
45
|
ports(): Promise<SandboxPortBinding[]>;
|
|
44
46
|
/**
|
|
45
47
|
* Subscribe to a session's agent event stream (`/agents/events`).
|
package/dist/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as deriveAgentRunOutcome, T as deriveAgentResultOutcome, f as uploadChunked, t as SandboxRuntimeApi, w as createAgentRunOutcomeTracker } from "./runtime-api-
|
|
2
|
-
import { a as FileWriteConflictError, c as NotFoundError, f as SandboxError, g as ValidationError, h as TimeoutError, l as PartialFailureError, m as StateError, n as CapabilityError, p as ServerError, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-
|
|
3
|
-
import { n as combineAbortSignals } from "./abort-signal-
|
|
1
|
+
import { E as deriveAgentRunOutcome, T as deriveAgentResultOutcome, f as uploadChunked, t as SandboxRuntimeApi, w as createAgentRunOutcomeTracker } from "./runtime-api-BZg34WGd.js";
|
|
2
|
+
import { a as FileWriteConflictError, c as NotFoundError, f as SandboxError, g as ValidationError, h as TimeoutError, l as PartialFailureError, m as StateError, n as CapabilityError, p as ServerError, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-BkhlSDW-.js";
|
|
3
|
+
import { n as combineAbortSignals } from "./abort-signal-CgFhjY_v.js";
|
|
4
4
|
//#region src/runtime-client.ts
|
|
5
5
|
const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
|
|
6
6
|
function requireToken(token) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as TerminalStreamReconnectAuthority, c as MintScopedTokenOptions, h as TerminalReadyInfo, l as ScopedToken, r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-
|
|
2
|
-
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-
|
|
3
|
-
import { A as CommitTaskSessionOptions, Aa as WriteManyFile, An as NetworkManager, B as CreateSandboxOptions, Bi as SessionExecutionInfo, C as BranchOptions, Cr as SandboxDeleteOptions, D as CodeExecutionResult, Da as WaitForRolloutOptions, E as CodeExecutionOptions, Ea as WaitForOptions, Ei as SandboxTraceBundle, Er as SandboxEvent, Fi as SendSessionMessageOptions, Fn as PreviewLinkManager, Gi as SessionInterruptOptions, Gn as PromptInputPart, H as CreateTaskSessionOptions, Ii as SendSessionMessageRequest, Ji as SessionMessageAdmission, Jn as ProvisionEvent, Ki as SessionListOptions, Kn as PromptOptions, Li as SentSessionMessage, M as ConversationTurnOptions, Mi as SearchOptions, N as ConversationTurnResult, Nn as PermissionsManager, O as CodeLanguage, Oa as WorkspaceOperationLookup, Q as DispatchedSession, Qi as SnapshotDeleteAcknowledgement, Sn as ListMessagesOptions, Sr as SandboxDeleteAcknowledgement, Ti as SandboxTerminals, Tt as FileSystem, Ui as SessionForkOptions, V as CreateSessionOptions, Vn as ProcessManager, Wi as SessionInfo, Xi as SessionResultOptions, Xt as ForkIdempotency, Yn as ProvisionResult, Yt as ForkCounts, Z as DispatchPromptOptions, Zr as SandboxFleetTraceBundle, Zt as ForkLookupOptions, _n as IntelligenceReportBudget, _r as SSHCredentials, _t as ExecOptions, aa as StartupDiagnostics, an as GpuLease, at as DurablePlan, bi as SandboxTerminalAttachOptions, bn as IntelligenceReportWindow, cr as ResumeOptions, d as BackendConfig, dr as RolloutOptions, en as GitBranch, fa as TaskSessionInfo, fi as SandboxResourceUsage, ft as EgressManager, ga as TeeAttestationResponse, gi as SandboxShape, gn as IntelligenceReport, gr as SSHCommandDescriptor, hi as SandboxRuntimeHealth, hn as InstalledTool, ht as EventStreamOptions, in as GitStatus, j as CompletedTurnResult, ja as WriteManyOptions, ji as SearchMatch, jt as FileWriteResult, ka as WriteFileOptions, ki as SandboxTraceOptions, la as TaskSessionChanges, li as SandboxPortBinding, lr as Rollout, ma as TeeAttestationOptions, mi as SandboxRuntimeCapabilities, na as SnapshotOptions, ot as DurablePlanDecisionResult, p as BackendManager, pr as RolloutStartResult, qi as SessionMessage, qn as PromptResult, ra as SnapshotResult, rn as GitDiff, rt as DriverInfo, si as SandboxInfo, sr as RestoreSnapshotOptions, ta as SnapshotInfo, tn as GitCommit, tt as DriveTurnOptions, ua as TaskSessionCommitResult, un as GpuLeaseManager, va as TeePublicKeyResponse, vn as IntelligenceReportCompareTo, vt as ExecResult, xa as TurnDriveResult, xn as JsonValue, xr as SandboxCreateReceipt, yi as SandboxStatus, yr as SandboxConnection, zi as SessionEventStreamOptions } from "./types-
|
|
1
|
+
import { a as TerminalStreamReconnectAuthority, c as MintScopedTokenOptions, h as TerminalReadyInfo, l as ScopedToken, r as TerminalStreamHandlers, t as TerminalStream } from "./terminal-stream-BW4veIsI.js";
|
|
2
|
+
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, s as InteractiveSessionControlTransport } from "./browser-interactive-control-controller-knjCl8Zp.js";
|
|
3
|
+
import { A as CommitTaskSessionOptions, Aa as WriteManyFile, An as NetworkManager, B as CreateSandboxOptions, Bi as SessionExecutionInfo, C as BranchOptions, Cr as SandboxDeleteOptions, D as CodeExecutionResult, Da as WaitForRolloutOptions, E as CodeExecutionOptions, Ea as WaitForOptions, Ei as SandboxTraceBundle, Er as SandboxEvent, Fi as SendSessionMessageOptions, Fn as PreviewLinkManager, Gi as SessionInterruptOptions, Gn as PromptInputPart, H as CreateTaskSessionOptions, Ii as SendSessionMessageRequest, Ji as SessionMessageAdmission, Jn as ProvisionEvent, Ki as SessionListOptions, Kn as PromptOptions, Li as SentSessionMessage, M as ConversationTurnOptions, Mi as SearchOptions, N as ConversationTurnResult, Nn as PermissionsManager, O as CodeLanguage, Oa as WorkspaceOperationLookup, Q as DispatchedSession, Qi as SnapshotDeleteAcknowledgement, Sn as ListMessagesOptions, Sr as SandboxDeleteAcknowledgement, Ti as SandboxTerminals, Tt as FileSystem, Ui as SessionForkOptions, V as CreateSessionOptions, Vn as ProcessManager, Wi as SessionInfo, Xi as SessionResultOptions, Xt as ForkIdempotency, Yn as ProvisionResult, Yt as ForkCounts, Z as DispatchPromptOptions, Zr as SandboxFleetTraceBundle, Zt as ForkLookupOptions, _n as IntelligenceReportBudget, _r as SSHCredentials, _t as ExecOptions, aa as StartupDiagnostics, an as GpuLease, at as DurablePlan, bi as SandboxTerminalAttachOptions, bn as IntelligenceReportWindow, cr as ResumeOptions, d as BackendConfig, dr as RolloutOptions, en as GitBranch, fa as TaskSessionInfo, fi as SandboxResourceUsage, ft as EgressManager, ga as TeeAttestationResponse, gi as SandboxShape, gn as IntelligenceReport, gr as SSHCommandDescriptor, hi as SandboxRuntimeHealth, hn as InstalledTool, ht as EventStreamOptions, in as GitStatus, j as CompletedTurnResult, ja as WriteManyOptions, ji as SearchMatch, jt as FileWriteResult, ka as WriteFileOptions, ki as SandboxTraceOptions, la as TaskSessionChanges, li as SandboxPortBinding, lr as Rollout, ma as TeeAttestationOptions, mi as SandboxRuntimeCapabilities, na as SnapshotOptions, ot as DurablePlanDecisionResult, p as BackendManager, pr as RolloutStartResult, qi as SessionMessage, qn as PromptResult, ra as SnapshotResult, rn as GitDiff, rt as DriverInfo, si as SandboxInfo, sr as RestoreSnapshotOptions, ta as SnapshotInfo, tn as GitCommit, tt as DriveTurnOptions, ua as TaskSessionCommitResult, un as GpuLeaseManager, va as TeePublicKeyResponse, vn as IntelligenceReportCompareTo, vt as ExecResult, xa as TurnDriveResult, xn as JsonValue, xr as SandboxCreateReceipt, yi as SandboxStatus, yr as SandboxConnection, zi as SessionEventStreamOptions } from "./types-DRyvWIJf.js";
|
|
4
4
|
import { AgentInteractiveSessionAttach, AgentInteractiveSessionControlClaim, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionControlClaimRequest, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentInteractiveSessionStopAcknowledgement, AgentInteractiveSessionStopCommand, AgentInteractiveTerminalSession, AgentInteractiveTerminalSession as AgentInteractiveTerminalSession$1, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, InteractionAcknowledgement, InteractionData, InteractionRequest, InteractionResponseCommand, TerminalOutputEvent, TerminalReplayWindow, agentInteractiveSessionPromptRequestDigest } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -412,6 +412,27 @@ interface LineRole {
|
|
|
412
412
|
/** `chat`: the member's session has no shell, cannot read, search or change files, starts no subagents, and gets none of the backend's MCP servers, connections or hooks. */
|
|
413
413
|
tools: "act" | "chat";
|
|
414
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* An opt-in, fail-closed role boundary for a general hosted agent. Hub resolves
|
|
417
|
+
* roles from its authenticated member record, never from message text.
|
|
418
|
+
*
|
|
419
|
+
* General access is reserved for owner and manager. Every other role names
|
|
420
|
+
* only its product MCP servers and needs an explicit member backend. Product
|
|
421
|
+
* servers still authorize the enrolled actor; an MCP name grants no authority.
|
|
422
|
+
*/
|
|
423
|
+
interface LineAgentRolePolicy {
|
|
424
|
+
version: 1;
|
|
425
|
+
roles: Record<string, {
|
|
426
|
+
kind: "general";
|
|
427
|
+
} | {
|
|
428
|
+
kind: "scoped";
|
|
429
|
+
mcpServers: string[];
|
|
430
|
+
}>;
|
|
431
|
+
/** Normalized member address -> actor-scoped backend; no shared fallback. */
|
|
432
|
+
members: Record<string, {
|
|
433
|
+
backend: Partial<BackendConfig>;
|
|
434
|
+
}>;
|
|
435
|
+
}
|
|
415
436
|
/** A sender an attachment admits. */
|
|
416
437
|
interface LineMemberSpec {
|
|
417
438
|
/** E.164 number, or the email / Apple ID the sender texts from. */
|
|
@@ -481,15 +502,20 @@ interface LineRespondAgent {
|
|
|
481
502
|
kind: "agent";
|
|
482
503
|
/** Backend for member sessions. Omit to use the sandbox's default. */
|
|
483
504
|
backend?: Partial<BackendConfig>;
|
|
505
|
+
rolePolicy?: LineAgentRolePolicy;
|
|
484
506
|
gate?: LineReplyGate;
|
|
507
|
+
/** Default true. Set false to disable tapbacks and typing. */
|
|
508
|
+
acknowledgement?: boolean;
|
|
485
509
|
}
|
|
486
510
|
/** The stored respond config; the gate's secret is never returned. */
|
|
487
511
|
interface LineRespondView {
|
|
488
512
|
kind: "agent";
|
|
489
513
|
backend?: Partial<BackendConfig>;
|
|
514
|
+
rolePolicy?: LineAgentRolePolicy;
|
|
490
515
|
gate?: Omit<LineReplyGate, "secret"> & {
|
|
491
516
|
audience: "owner" | "members";
|
|
492
517
|
};
|
|
518
|
+
acknowledgement: boolean;
|
|
493
519
|
}
|
|
494
520
|
interface LineAttachOptions {
|
|
495
521
|
/** A line id (`ln_...`) or an address of one of your lines. */
|
|
@@ -511,7 +537,7 @@ interface LineAttachOptions {
|
|
|
511
537
|
clientReference?: string;
|
|
512
538
|
}
|
|
513
539
|
/** The sandbox options a member's own sandbox is created with. */
|
|
514
|
-
type LineInstanceCreate = Pick<CreateSandboxOptions, "name" | "environment" | "resources" | "egressPolicy" | "idleTimeoutSeconds" | "maxLifetimeSeconds" | "deleteAfterStoppedSeconds"> & {
|
|
540
|
+
type LineInstanceCreate = Pick<CreateSandboxOptions, "name" | "environment" | "ownerContext" | "capabilities" | "resources" | "egressPolicy" | "idleTimeoutSeconds" | "maxLifetimeSeconds" | "deleteAfterStoppedSeconds"> & {
|
|
515
541
|
metadata?: Record<string, string>;
|
|
516
542
|
};
|
|
517
543
|
/**
|
|
@@ -544,18 +570,42 @@ interface LineFromConnectionCommon {
|
|
|
544
570
|
/** Your idempotency reference: the same value returns the same line. */
|
|
545
571
|
clientReference?: string;
|
|
546
572
|
}
|
|
547
|
-
/** Input to `client.lines.fromConnection()`.
|
|
573
|
+
/** Input to `client.lines.fromConnection()`. Phone connections select an owned number. */
|
|
548
574
|
type LineFromConnectionInput = LineFromConnectionCommon & ({
|
|
549
|
-
transport: "imessage";
|
|
550
|
-
phoneNumberId?:
|
|
551
|
-
} /**
|
|
575
|
+
transport: "imessage" /** Required for a numbered provider; omit for Inkbox identity. */;
|
|
576
|
+
phoneNumberId?: string;
|
|
577
|
+
} /** Inkbox discovers its mailbox; Resend requires an address on a verified domain. */ | {
|
|
552
578
|
transport: "email";
|
|
579
|
+
address?: string;
|
|
553
580
|
phoneNumberId?: never;
|
|
581
|
+
} | {
|
|
582
|
+
transport: "sms";
|
|
583
|
+
phoneNumberId: string;
|
|
554
584
|
} | {
|
|
555
585
|
transport: "whatsapp";
|
|
556
586
|
phoneNumberId: string;
|
|
557
587
|
});
|
|
558
588
|
/** Fields a member update may change. */
|
|
589
|
+
interface LineSendInput {
|
|
590
|
+
memberId: string;
|
|
591
|
+
text: string;
|
|
592
|
+
idempotencyKey: string;
|
|
593
|
+
/** Optional ISO instant less than seven days away. Workflows own schedules. */
|
|
594
|
+
notBefore?: string;
|
|
595
|
+
}
|
|
596
|
+
interface LineSendReceipt {
|
|
597
|
+
message: LineMessage;
|
|
598
|
+
eligibleAt: string | null;
|
|
599
|
+
expiresAt: string;
|
|
600
|
+
}
|
|
601
|
+
interface LineReminderPreferences {
|
|
602
|
+
enabled: boolean;
|
|
603
|
+
timezone: string | null;
|
|
604
|
+
quietStart: string | null;
|
|
605
|
+
quietEnd: string | null;
|
|
606
|
+
consentMessageId: string | null;
|
|
607
|
+
updatedAt: string | null;
|
|
608
|
+
}
|
|
559
609
|
interface LineMemberPatch {
|
|
560
610
|
role?: string;
|
|
561
611
|
label?: string;
|
|
@@ -626,6 +676,11 @@ interface Line {
|
|
|
626
676
|
connectionId: string;
|
|
627
677
|
/** The provider's phone number id, or null for a line without a pinned number. */
|
|
628
678
|
providerNumberId: string | null;
|
|
679
|
+
/** Null means Hub has no verified workspace binding for this line. */
|
|
680
|
+
workspace: {
|
|
681
|
+
resourceType: "workspace";
|
|
682
|
+
resourceId: string;
|
|
683
|
+
} | null;
|
|
629
684
|
label: string | null;
|
|
630
685
|
clientReference: string | null;
|
|
631
686
|
status: "active" | "suspended" | "released";
|
|
@@ -699,6 +754,12 @@ declare class LinesClient {
|
|
|
699
754
|
* false when the line was not attached.
|
|
700
755
|
*/
|
|
701
756
|
detach(number: string): Promise<boolean>;
|
|
757
|
+
/**
|
|
758
|
+
* Retire a detached line's Hub routing and free its workspace transport slot.
|
|
759
|
+
* Hub refuses an attached or voice-enabled line. A retry by line id returns
|
|
760
|
+
* false; the provider connection and message history remain.
|
|
761
|
+
*/
|
|
762
|
+
release(number: string): Promise<boolean>;
|
|
702
763
|
/**
|
|
703
764
|
* Take calls on a line (Inkbox iMessage lines). Hub points the identity's
|
|
704
765
|
* incoming calls at itself, binds the ph0ny agent to the line and adds the
|
|
@@ -707,6 +768,16 @@ declare class LinesClient {
|
|
|
707
768
|
enableVoice(lineId: string, options: LineVoiceOptions): Promise<Line>;
|
|
708
769
|
/** Stop taking calls on a line: Hub refuses them and Inkbox rejects them. */
|
|
709
770
|
disableVoice(lineId: string): Promise<Line>;
|
|
771
|
+
/**
|
|
772
|
+
* Queue a proactive message to an active, consenting member. Hub reuses the
|
|
773
|
+
* member's authenticated provider conversation, rechecks STOP immediately
|
|
774
|
+
* before delivery, and defers delivery during the recipient's saved quiet hours.
|
|
775
|
+
*/
|
|
776
|
+
send(lineId: string, input: LineSendInput): Promise<LineSendReceipt>;
|
|
777
|
+
/** Read the native outbox receipt. Queued is not a delivery confirmation. */
|
|
778
|
+
sentMessage(lineId: string, messageId: string): Promise<LineSendReceipt>;
|
|
779
|
+
/** Only the recipient's proven message can enable reminders or choose quiet hours. */
|
|
780
|
+
reminders(lineId: string, memberId: string): Promise<LineReminderPreferences>;
|
|
710
781
|
/** Members of the line's active attachment. */
|
|
711
782
|
members(lineId: string): {
|
|
712
783
|
list(): Promise<LineMember[]>;
|
|
@@ -739,6 +810,55 @@ declare class SandboxLines {
|
|
|
739
810
|
}
|
|
740
811
|
//#endregion
|
|
741
812
|
//#region src/session.d.ts
|
|
813
|
+
type RawEvidenceExport = {
|
|
814
|
+
status: "captured";
|
|
815
|
+
sessionId: string;
|
|
816
|
+
backendType: string;
|
|
817
|
+
nativeSessionId: string;
|
|
818
|
+
proofStatus: "verified" | "unverified";
|
|
819
|
+
containerId?: string;
|
|
820
|
+
sidecarImageDigest: string;
|
|
821
|
+
sidecarBundleRevision: string;
|
|
822
|
+
sidecarBundleChecksum?: string;
|
|
823
|
+
nativeRoots: Array<{
|
|
824
|
+
rootScope: "session-home" | "workspace-session";
|
|
825
|
+
path: string;
|
|
826
|
+
}>;
|
|
827
|
+
files: Array<Record<string, unknown>>;
|
|
828
|
+
excluded: Array<Record<string, unknown>>;
|
|
829
|
+
inventory: Record<string, number>;
|
|
830
|
+
processIo: Array<Record<string, unknown>>;
|
|
831
|
+
processTerminals: Array<Record<string, unknown>>;
|
|
832
|
+
events: Array<Record<string, unknown>>;
|
|
833
|
+
completeness: {
|
|
834
|
+
nativeStore: true;
|
|
835
|
+
processIo: true;
|
|
836
|
+
events: true;
|
|
837
|
+
};
|
|
838
|
+
coverageComplete: true;
|
|
839
|
+
} | {
|
|
840
|
+
status: "unavailable";
|
|
841
|
+
sessionId: string;
|
|
842
|
+
backendType: string;
|
|
843
|
+
reason: string;
|
|
844
|
+
};
|
|
845
|
+
type NativeRolloutExport = {
|
|
846
|
+
status: "captured";
|
|
847
|
+
sessionId: string;
|
|
848
|
+
backendType: "opencode";
|
|
849
|
+
nativeSessionId: string;
|
|
850
|
+
format: "opencode-session-export-json";
|
|
851
|
+
sizeBytes: number;
|
|
852
|
+
sha256: string;
|
|
853
|
+
contentBase64: string;
|
|
854
|
+
content: Uint8Array;
|
|
855
|
+
} | {
|
|
856
|
+
status: "unavailable";
|
|
857
|
+
sessionId: string;
|
|
858
|
+
backendType: string;
|
|
859
|
+
nativeSessionId?: string;
|
|
860
|
+
reason: string;
|
|
861
|
+
};
|
|
742
862
|
/**
|
|
743
863
|
* The subset of `SandboxInstance` a `SandboxSession` drives. Declared here
|
|
744
864
|
* (rather than importing the concrete class) so `session.ts` stays a leaf
|
|
@@ -750,6 +870,8 @@ interface SandboxSessionHost extends InteractiveSessionHost {
|
|
|
750
870
|
_sessionStatus(id: string): Promise<SessionInfo | null>;
|
|
751
871
|
_sessionEvents(id: string, opts?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
|
|
752
872
|
_sessionRuns(id: string): Promise<SessionExecutionInfo[]>;
|
|
873
|
+
_sessionNativeRollout(id: string): Promise<NativeRolloutExport>;
|
|
874
|
+
_sessionRawEvidence(id: string): Promise<RawEvidenceExport>;
|
|
753
875
|
_sessionAdmission(id: string, turnId: string, options?: {
|
|
754
876
|
signal?: AbortSignal;
|
|
755
877
|
}): Promise<SessionMessageAdmission | null>;
|
|
@@ -820,6 +942,10 @@ declare class SandboxSession {
|
|
|
820
942
|
* count provider runs without inferring execution from model-written files.
|
|
821
943
|
*/
|
|
822
944
|
runs(): Promise<SessionExecutionInfo[]>;
|
|
945
|
+
/** Export the exact provider session before this sandbox is deleted. */
|
|
946
|
+
nativeRollout(): Promise<NativeRolloutExport>;
|
|
947
|
+
/** Capture the complete attributed native store and process stream before deletion. */
|
|
948
|
+
rawEvidence(): Promise<RawEvidenceExport>;
|
|
823
949
|
/** Read the exact execution admitted for a turn, including server-owned plan follow-ups.
|
|
824
950
|
* This never admits work or verifies the input of a proposed retry.
|
|
825
951
|
*/
|
|
@@ -1198,6 +1324,8 @@ declare class SandboxInstance {
|
|
|
1198
1324
|
* ```
|
|
1199
1325
|
*/
|
|
1200
1326
|
createReceipt(): SandboxCreateReceipt | null;
|
|
1327
|
+
/** Verified identity of the currently running container, if available. */
|
|
1328
|
+
captureProof(): SandboxCreateReceipt["captureProof"] | null;
|
|
1201
1329
|
/**
|
|
1202
1330
|
* Serialize to the public sandbox shape for logs and structured
|
|
1203
1331
|
* output. Secrets in `connection` (currently `authToken`) are
|
|
@@ -1553,7 +1681,9 @@ declare class SandboxInstance {
|
|
|
1553
1681
|
* Older runtimes without app-variable registration fail this call.
|
|
1554
1682
|
* Credential values must stay outside profiles, receipts, and logs.
|
|
1555
1683
|
*/
|
|
1556
|
-
setRuntimeEnv(env: Record<string, string
|
|
1684
|
+
setRuntimeEnv(env: Record<string, string>, options?: {
|
|
1685
|
+
ttlMs?: number;
|
|
1686
|
+
}): Promise<void>;
|
|
1557
1687
|
/**
|
|
1558
1688
|
* Return the runtime's current listening-port snapshot.
|
|
1559
1689
|
*
|
|
@@ -2394,6 +2524,10 @@ declare class SandboxInstance {
|
|
|
2394
2524
|
mintScopedToken(opts: MintScopedTokenOptions): Promise<ScopedToken>;
|
|
2395
2525
|
/** @internal — invoked by SandboxSession.status(). */
|
|
2396
2526
|
_sessionStatus(id: string): Promise<SessionInfo | null>;
|
|
2527
|
+
/** @internal — invoked before the sandbox is deleted. */
|
|
2528
|
+
_sessionNativeRollout(id: string): Promise<NativeRolloutExport>;
|
|
2529
|
+
/** @internal — invoked before the sandbox is deleted. */
|
|
2530
|
+
_sessionRawEvidence(id: string): Promise<RawEvidenceExport>;
|
|
2397
2531
|
/** @internal — invoked by SandboxSession.runs(). */
|
|
2398
2532
|
_sessionRuns(id: string): Promise<SessionExecutionInfo[]>;
|
|
2399
2533
|
/** @internal — invoked by SandboxSession.admission(). */
|
|
@@ -2460,4 +2594,4 @@ declare class SandboxInstance {
|
|
|
2460
2594
|
}): Promise<DurablePlanDecisionResult>;
|
|
2461
2595
|
}
|
|
2462
2596
|
//#endregion
|
|
2463
|
-
export {
|
|
2597
|
+
export { InteractiveSessionHost as $, LineMemberPatch as A, SandboxMcpServerEntry as At, LineThread as B, LineAttachment as C, SandboxInteractionResult as Ct, LineLimits as D, SANDBOX_MCP_SERVER_NAME as Dt, LineInstanceCreate as E, CONTROL_PLANE_MCP_SERVER_NAME as Et, LineRespondAgent as F, SandboxLines as G, LineVoice as H, LineRespondView as I, InteractiveControlClaimRequest as J, lineInstanceKey as K, LineRole as L, LineMessage as M, buildSandboxMcpConfig as Mt, LineReminderPreferences as N, LineMember as O, SandboxMcpConfig as Ot, LineReplyGate as P, InteractiveSessionHandleOptions as Q, LineSendInput as R, LineAttachOptions as S, SandboxInteractionResolution as St, LineInstanceAttachOptions as T, BuildSandboxMcpConfigOptions as Tt, LineVoiceOptions as U, LineTransport as V, LinesClient as W, InteractiveSessionControlClaim as X, InteractivePromptCommand as Y, InteractiveSessionHandle as Z, RawEvidenceExport as _, InteractiveSessionController as _t, WorkspaceImagePublishRequestOptions as a, InteractiveStopCommand as at, LineAgentRolePolicy as b, SandboxInteractionCommandResult as bt, TraceExportFormat as c, agentInteractiveSessionPromptRequestDigest as ct, buildTraceExportPayload as d, InteractiveTerminalMetadata as dt, InteractiveSessionIncarnationId as et, exportTraceBundle as f, createInteractiveTerminalCapture as ft, NativeRolloutExport as g, InteractiveAttachRequest as gt, SandboxTaskSession as h, BrowserInteractiveSessionControllerOptions as ht, WorkspaceImagePublishInput as i, InteractiveSessionStartResult as it, LineMemberSpec as j, buildControlPlaneMcpConfig as jt, LineMemberInstance as k, SandboxMcpEndpoint as kt, TraceExportResult as l, InteractiveTerminalCapture as lt, toOtelJson as m, BrowserInteractiveSessionController as mt, HttpClient as n, InteractiveSessionRef as nt, WorkspaceImagePublishResult as o, InterruptResult as ot, otelTraceIdForTangleTrace as p, createInteractiveTerminalSession as pt, AgentInteractiveTerminalSession$1 as q, SandboxInstance as r, InteractiveSessionStartOptions as rt, WorkspaceImages as s, RespondToPermissionOptions as st, ForkAcknowledgement as t, InteractiveSessionInfo as tt, TraceExportSink as u, InteractiveTerminalFrameLog as ut, SandboxSession as v, InteractiveSessionControllerOptions as vt, LineFromConnectionInput as w, BuildControlPlaneMcpConfigOptions as wt, LineAllowance as x, SandboxInteractionConflict as xt, Line as y, InteractiveSessionControllerTransport as yt, LineSendReceipt as z };
|