@tangle-network/sandbox 0.60.14 → 0.60.16-develop.20261006020509.71b03b7
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 +36 -12
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +3 -3
- package/dist/agent/preview.d.ts +1 -1
- package/dist/{agent-run-outcome-CG7bb9lr.d.ts → agent-run-outcome-C8oSKngX.d.ts} +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/{cli-auth-bundle-CJSdRlx0.js → cli-auth-bundle-D_1bUPSo.js} +388 -1
- package/dist/{client-Cd8xKjQZ.js → client-CT9Td-BV.js} +40 -15
- package/dist/{client-BCX8_Mu-.d.ts → client-CbOQtx9b.d.ts} +14 -4
- package/dist/core.d.ts +5 -5
- package/dist/core.js +2 -2
- package/dist/{index-BgFIcLar.d.ts → index-BWmtGiyF.d.ts} +2 -2
- package/dist/index.d.ts +19 -11
- package/dist/index.js +4 -4
- package/dist/{interactive-controller-f_ePJqoh.js → interactive-controller-5_ixpFnR.js} +105 -9
- package/dist/{lines-BbvLx7pi.d.ts → lines-BTZTbYDz.d.ts} +31 -2
- package/dist/lines.d.ts +2 -2
- package/dist/{local-cli-auth-BH9A-PW_.js → local-cli-auth-DRXaIXAj.js} +1 -1
- package/dist/{preview-Ddy1fJyc.d.ts → preview-T96_mF5c.d.ts} +3 -3
- package/dist/{raw-evidence-archive-FxWK99KW.js → raw-evidence-archive-Bi-Lt83d.js} +46 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +1 -1
- package/dist/{sandbox-D3SjjeDp.js → sandbox-D3VcDY8b.js} +27 -11
- package/dist/{sandbox-BCygk0lS.d.ts → sandbox-DalvAflZ.d.ts} +10 -202
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-fMCqH1ig.js → tangle-CLrVMWGG.js} +1 -1
- package/dist/{types-BlA8Cly0.d.ts → types-CdT-paBK.d.ts} +405 -38
- package/package.json +5 -5
|
@@ -1139,6 +1139,275 @@ interface BatchResult$1 {
|
|
|
1139
1139
|
};
|
|
1140
1140
|
}
|
|
1141
1141
|
//#endregion
|
|
1142
|
+
//#region ../../../packages/runtime-contracts/dist/interaction-response.d.ts
|
|
1143
|
+
/** Canonical result returned after a response is recorded by Sidecar. */
|
|
1144
|
+
declare const interactionResolutionAcknowledgementSchema: z.ZodObject<{
|
|
1145
|
+
status: z.ZodEnum<{
|
|
1146
|
+
accepted: "accepted";
|
|
1147
|
+
already_resolved_same: "already_resolved_same";
|
|
1148
|
+
}>;
|
|
1149
|
+
operationId: z.ZodString;
|
|
1150
|
+
responseDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
1151
|
+
interactionId: z.ZodString;
|
|
1152
|
+
sessionId: z.ZodString;
|
|
1153
|
+
outcome: z.ZodEnum<{
|
|
1154
|
+
accepted: "accepted";
|
|
1155
|
+
declined: "declined";
|
|
1156
|
+
cancelled: "cancelled";
|
|
1157
|
+
}>;
|
|
1158
|
+
deliveryState: z.ZodEnum<{
|
|
1159
|
+
pending: "pending";
|
|
1160
|
+
delivering: "delivering";
|
|
1161
|
+
delivered: "delivered";
|
|
1162
|
+
delivery_failed: "delivery_failed";
|
|
1163
|
+
backend_lost: "backend_lost";
|
|
1164
|
+
effect_unknown: "effect_unknown";
|
|
1165
|
+
}>;
|
|
1166
|
+
delivered: z.ZodBoolean;
|
|
1167
|
+
resolvedAt: z.ZodString;
|
|
1168
|
+
binding: z.ZodOptional<z.ZodObject<{
|
|
1169
|
+
runId: z.ZodString;
|
|
1170
|
+
provider: z.ZodString;
|
|
1171
|
+
environmentId: z.ZodString;
|
|
1172
|
+
sessionId: z.ZodString;
|
|
1173
|
+
executionId: z.ZodString;
|
|
1174
|
+
interactionId: z.ZodString;
|
|
1175
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
1176
|
+
}, z.core.$strict>>;
|
|
1177
|
+
}, z.core.$strict>;
|
|
1178
|
+
type InteractionResolutionAcknowledgement = z.infer<typeof interactionResolutionAcknowledgementSchema>;
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region ../../../packages/runtime-contracts/dist/workspace-image-types.d.ts
|
|
1181
|
+
/** A port declared by the published OCI image. */
|
|
1182
|
+
interface WorkspaceImageExposedPort {
|
|
1183
|
+
port: number;
|
|
1184
|
+
protocol: "tcp" | "udp" | "sctp";
|
|
1185
|
+
}
|
|
1186
|
+
/** Successful workspace image publication returned by the Sandbox API. */
|
|
1187
|
+
interface WorkspaceImagePublishResult {
|
|
1188
|
+
/** Immutable registry reference. */
|
|
1189
|
+
image: string;
|
|
1190
|
+
/** Operation-stable tag used during publication. */
|
|
1191
|
+
taggedImage: string;
|
|
1192
|
+
digest: string;
|
|
1193
|
+
imageId: string;
|
|
1194
|
+
sizeBytes: number;
|
|
1195
|
+
contextBytes: number;
|
|
1196
|
+
contextEntries: number;
|
|
1197
|
+
buildDurationMs: number;
|
|
1198
|
+
pushDurationMs: number;
|
|
1199
|
+
/** Network ports from the final image configuration, not source inspection. */
|
|
1200
|
+
exposedPorts: WorkspaceImageExposedPort[];
|
|
1201
|
+
}
|
|
1202
|
+
//#endregion
|
|
1203
|
+
//#region ../../../packages/runtime-contracts/dist/raw-evidence-export.d.ts
|
|
1204
|
+
/** Wire contract for bounded, session-owned native evidence archives. */
|
|
1205
|
+
interface RawEvidencePayloadFile {
|
|
1206
|
+
/** Safe relative path below the exported directory; never an absolute native path. */
|
|
1207
|
+
path: string;
|
|
1208
|
+
sizeBytes: number;
|
|
1209
|
+
sha256: `sha256:${string}`;
|
|
1210
|
+
}
|
|
1211
|
+
interface RawEvidenceRecordsFile extends RawEvidencePayloadFile {
|
|
1212
|
+
format: "ndjson";
|
|
1213
|
+
/** Number of complete records, in original order. */
|
|
1214
|
+
records: number;
|
|
1215
|
+
}
|
|
1216
|
+
interface RawEvidenceNativeMetadata {
|
|
1217
|
+
sourceId?: string;
|
|
1218
|
+
rootScope: "session-home" | "workspace-session";
|
|
1219
|
+
path: string;
|
|
1220
|
+
kind: "file" | "directory" | "symlink";
|
|
1221
|
+
mode: number;
|
|
1222
|
+
uid: number;
|
|
1223
|
+
gid: number;
|
|
1224
|
+
mtimeMs: number;
|
|
1225
|
+
ctimeMs: number;
|
|
1226
|
+
sizeBytes: number;
|
|
1227
|
+
}
|
|
1228
|
+
type RawEvidenceNativeFile = RawEvidenceNativeMetadata & {
|
|
1229
|
+
sha256?: string;
|
|
1230
|
+
linkTarget?: string; /** Replaces contentBase64 for regular files. Symlinks remain metadata only. */
|
|
1231
|
+
content?: RawEvidencePayloadFile;
|
|
1232
|
+
};
|
|
1233
|
+
interface RawEvidenceArchiveAttempt {
|
|
1234
|
+
executionId: string;
|
|
1235
|
+
ordinal: number;
|
|
1236
|
+
providerSessionId: string;
|
|
1237
|
+
nativeSessionIds: string[];
|
|
1238
|
+
processIds: string[];
|
|
1239
|
+
outcome: "succeeded" | "failed" | "cancelled" | "unknown";
|
|
1240
|
+
missingReasons: string[];
|
|
1241
|
+
}
|
|
1242
|
+
interface RawEvidenceArchiveEventMetadata {
|
|
1243
|
+
executionId: string;
|
|
1244
|
+
sessionId: string;
|
|
1245
|
+
status: "active" | "completed" | "failed" | "cancelled";
|
|
1246
|
+
startedAt: number;
|
|
1247
|
+
completedAt?: number;
|
|
1248
|
+
eventCount: number;
|
|
1249
|
+
lastEventId: string;
|
|
1250
|
+
}
|
|
1251
|
+
/** Payload references replace only inline content and aggregate record arrays. */
|
|
1252
|
+
interface RawEvidenceArchiveManifest {
|
|
1253
|
+
schema: "tangle.raw-evidence-archive.v1";
|
|
1254
|
+
status: "captured" | "partial";
|
|
1255
|
+
sessionId: string;
|
|
1256
|
+
backendType: string;
|
|
1257
|
+
nativeSessionId: string | null;
|
|
1258
|
+
proofStatus: "verified" | "unverified";
|
|
1259
|
+
containerId?: string;
|
|
1260
|
+
sidecarImageDigest: string;
|
|
1261
|
+
sidecarBundleRevision: string;
|
|
1262
|
+
sidecarBundleChecksum?: string;
|
|
1263
|
+
nativeRoots: Array<{
|
|
1264
|
+
sourceId?: string;
|
|
1265
|
+
rootScope: "session-home" | "workspace-session";
|
|
1266
|
+
path: string;
|
|
1267
|
+
}>;
|
|
1268
|
+
files: RawEvidenceNativeFile[];
|
|
1269
|
+
excluded: Array<RawEvidenceNativeMetadata & {
|
|
1270
|
+
reason: "credential";
|
|
1271
|
+
}>;
|
|
1272
|
+
skipped: Array<{
|
|
1273
|
+
sourceId?: string;
|
|
1274
|
+
rootScope: "session-home" | "workspace-session";
|
|
1275
|
+
path: string;
|
|
1276
|
+
reason: string;
|
|
1277
|
+
}>;
|
|
1278
|
+
inventory: Record<string, number>;
|
|
1279
|
+
/** NDJSON rows preserve legacy processIo fields, replacing contentBase64 with content: RawEvidencePayloadFile. */
|
|
1280
|
+
processIo: RawEvidenceRecordsFile;
|
|
1281
|
+
/** NDJSON rows have exactly the fields of legacy processTerminals entries. */
|
|
1282
|
+
processTerminals: RawEvidenceRecordsFile;
|
|
1283
|
+
processSources: Array<{
|
|
1284
|
+
sourceId: string;
|
|
1285
|
+
sizeBytes: number;
|
|
1286
|
+
sha256: string; /** Exact source spool bytes; replaces contentBase64. */
|
|
1287
|
+
content: RawEvidencePayloadFile;
|
|
1288
|
+
}>;
|
|
1289
|
+
events: Array<{
|
|
1290
|
+
metadata: RawEvidenceArchiveEventMetadata; /** Canonical reconstructed BufferedEvent rows, in original event order. */
|
|
1291
|
+
frames: RawEvidenceRecordsFile;
|
|
1292
|
+
}>;
|
|
1293
|
+
attempts: RawEvidenceArchiveAttempt[];
|
|
1294
|
+
evidenceSources: Array<{
|
|
1295
|
+
executionId: string;
|
|
1296
|
+
sourceId: string;
|
|
1297
|
+
backendType: string;
|
|
1298
|
+
runtimeHome: string;
|
|
1299
|
+
credentialPaths: string[];
|
|
1300
|
+
}>;
|
|
1301
|
+
completeness: {
|
|
1302
|
+
nativeStore: boolean;
|
|
1303
|
+
processIo: boolean;
|
|
1304
|
+
events: boolean;
|
|
1305
|
+
};
|
|
1306
|
+
coverageComplete: boolean;
|
|
1307
|
+
missingReasons: string[];
|
|
1308
|
+
}
|
|
1309
|
+
/** One store file of a native session copy (harness session contract). */
|
|
1310
|
+
interface NativeSessionCopyFile extends RawEvidencePayloadFile {
|
|
1311
|
+
/** The store root the file belongs to, relative to the runtime HOME, e.g. `.pi/agent/sessions`. */
|
|
1312
|
+
store: string;
|
|
1313
|
+
/** The file's own path relative to the runtime HOME, e.g. `.pi/agent/sessions/<ts>_<id>.jsonl`. */
|
|
1314
|
+
storePath: string;
|
|
1315
|
+
/** A `@tangle-network/harness-sessions` SessionFormatId. */
|
|
1316
|
+
format: string;
|
|
1317
|
+
/** byte-prefix: append-only JSONL cut at its last complete line; atomic-file: a whole file read twice the same; sqlite-backup: VACUUM INTO. */
|
|
1318
|
+
method: "byte-prefix" | "atomic-file" | "sqlite-backup";
|
|
1319
|
+
/** The source was larger than the per-file bound; this is its prefix. */
|
|
1320
|
+
truncated: boolean;
|
|
1321
|
+
/** Source size when copied. */
|
|
1322
|
+
sourceBytes: number;
|
|
1323
|
+
}
|
|
1324
|
+
/**
|
|
1325
|
+
* One execution attempt's native session. `snapshot` was taken while the
|
|
1326
|
+
* harness ran; `settled` after its process exited, whatever the outcome.
|
|
1327
|
+
* Consumers find sessions here, never by matching paths in `files`.
|
|
1328
|
+
*/
|
|
1329
|
+
interface NativeSessionCopy {
|
|
1330
|
+
harness: string;
|
|
1331
|
+
/** Format of the session files found (the first, when a harness has several stores). */
|
|
1332
|
+
format: string | null;
|
|
1333
|
+
executionId: string;
|
|
1334
|
+
attempt: number;
|
|
1335
|
+
nativeSessionId: string;
|
|
1336
|
+
copy: "snapshot" | "settled";
|
|
1337
|
+
capturedAt: string;
|
|
1338
|
+
/** Null fields are not observed at the copy point; the archive's process records carry them. */
|
|
1339
|
+
process: {
|
|
1340
|
+
pid: number | null;
|
|
1341
|
+
exitedAt: string | null;
|
|
1342
|
+
exitCode: number | null;
|
|
1343
|
+
signal: string | null;
|
|
1344
|
+
outcome: "succeeded" | "failed" | "cancelled" | "unknown";
|
|
1345
|
+
};
|
|
1346
|
+
files: NativeSessionCopyFile[];
|
|
1347
|
+
complete: boolean;
|
|
1348
|
+
/** native_session_id_unobserved | native_session_files_missing | over_bound:<path> | ... */
|
|
1349
|
+
missingReasons: string[];
|
|
1350
|
+
}
|
|
1351
|
+
/** v1 plus the per-attempt native session copies. Served when the caller asks for a copy. */
|
|
1352
|
+
interface RawEvidenceArchiveManifestV2 extends Omit<RawEvidenceArchiveManifest, "schema"> {
|
|
1353
|
+
schema: "tangle.raw-evidence-archive.v2";
|
|
1354
|
+
nativeSessions: NativeSessionCopy[];
|
|
1355
|
+
}
|
|
1356
|
+
interface RawEvidenceUnavailable {
|
|
1357
|
+
status: "unavailable";
|
|
1358
|
+
sessionId: string;
|
|
1359
|
+
backendType: string;
|
|
1360
|
+
reason: string;
|
|
1361
|
+
}
|
|
1362
|
+
interface RawEvidenceExportOptions {
|
|
1363
|
+
/** Bound all uncompressed archive member bytes, including metadata and records. */
|
|
1364
|
+
maxBytes: number;
|
|
1365
|
+
/**
|
|
1366
|
+
* Request native session copies (manifest v2). `latest` returns the
|
|
1367
|
+
* settled copy when one exists, otherwise a fresh snapshot; `settled`
|
|
1368
|
+
* fails with 409 not_settled while the harness still runs.
|
|
1369
|
+
*/
|
|
1370
|
+
copy?: "latest" | "settled";
|
|
1371
|
+
/** Restrict native session copies to one sidecar execution. */
|
|
1372
|
+
executionId?: string;
|
|
1373
|
+
/** Bound all archive file entries, including empty files. */
|
|
1374
|
+
maxFiles: number;
|
|
1375
|
+
/** Compressed transport bound; defaults to maxBytes plus bounded tar overhead. */
|
|
1376
|
+
maxArchiveBytes?: number;
|
|
1377
|
+
signal?: AbortSignal;
|
|
1378
|
+
}
|
|
1379
|
+
type RawEvidenceDirectoryExport = RawEvidenceUnavailable | {
|
|
1380
|
+
status: "captured" | "partial";
|
|
1381
|
+
directory: string;
|
|
1382
|
+
manifestPath: string;
|
|
1383
|
+
manifestSha256: `sha256:${string}`;
|
|
1384
|
+
transfer: {
|
|
1385
|
+
sizeBytes: number;
|
|
1386
|
+
sha256: string;
|
|
1387
|
+
}; /** Bounded metadata only. No inline payload or aggregate frame contents. */
|
|
1388
|
+
manifest: RawEvidenceArchiveManifest | RawEvidenceArchiveManifestV2;
|
|
1389
|
+
coverageComplete: boolean;
|
|
1390
|
+
missingReasons: string[];
|
|
1391
|
+
};
|
|
1392
|
+
//#endregion
|
|
1393
|
+
//#region ../../../packages/runtime-contracts/dist/index.d.ts
|
|
1394
|
+
/** Names only: the caller must keep a separate source and pass values to resume({ env }). */
|
|
1395
|
+
declare const sandboxEnvRecoverySchema: z.ZodObject<{
|
|
1396
|
+
callerResupplies: z.ZodArray<z.ZodString>;
|
|
1397
|
+
}, z.core.$strict>;
|
|
1398
|
+
type SandboxEnvRecovery = z.infer<typeof sandboxEnvRecoverySchema>;
|
|
1399
|
+
/** Policy inspection is metadata only; it does not establish snapshot or runtime health. */
|
|
1400
|
+
declare const sandboxEnvRecoveryViewSchema: z.ZodObject<{
|
|
1401
|
+
envRecovery: z.ZodObject<{
|
|
1402
|
+
callerResupplies: z.ZodArray<z.ZodString>;
|
|
1403
|
+
}, z.core.$strict>;
|
|
1404
|
+
eligibleCallerResupplyKeys: z.ZodArray<z.ZodString>;
|
|
1405
|
+
requiredOnColdResumeKeys: z.ZodArray<z.ZodString>;
|
|
1406
|
+
automaticCredentialRecovery: z.ZodLiteral<false>;
|
|
1407
|
+
dryRun: z.ZodBoolean;
|
|
1408
|
+
}, z.core.$strict>;
|
|
1409
|
+
type SandboxEnvRecoveryView = z.infer<typeof sandboxEnvRecoveryViewSchema>;
|
|
1410
|
+
//#endregion
|
|
1142
1411
|
//#region src/managed-process.d.ts
|
|
1143
1412
|
interface ManagedProcessSpec {
|
|
1144
1413
|
id: string;
|
|
@@ -1474,13 +1743,12 @@ interface SandboxShapesInfo {
|
|
|
1474
1743
|
* @example Minimal sandbox (managed mode with defaults)
|
|
1475
1744
|
* ```typescript
|
|
1476
1745
|
* const box = await client.create();
|
|
1477
|
-
* // Uses '
|
|
1746
|
+
* // Uses the server's default image and managed runtime
|
|
1478
1747
|
* ```
|
|
1479
1748
|
*
|
|
1480
|
-
* @example Sandbox with
|
|
1749
|
+
* @example Sandbox with a Git repository
|
|
1481
1750
|
* ```typescript
|
|
1482
1751
|
* const box = await client.create({
|
|
1483
|
-
* environment: "ethereum", // Stack name — tools provisioned via Nix profile
|
|
1484
1752
|
* git: {
|
|
1485
1753
|
* url: "https://github.com/user/dapp.git",
|
|
1486
1754
|
* ref: "main",
|
|
@@ -1508,7 +1776,6 @@ interface SandboxShapesInfo {
|
|
|
1508
1776
|
* @example With BYOS3 storage for snapshots
|
|
1509
1777
|
* ```typescript
|
|
1510
1778
|
* const box = await client.create({
|
|
1511
|
-
* environment: "universal",
|
|
1512
1779
|
* storage: {
|
|
1513
1780
|
* type: "s3",
|
|
1514
1781
|
* bucket: "my-snapshots",
|
|
@@ -1524,17 +1791,16 @@ interface CreateSandboxOptions {
|
|
|
1524
1791
|
/** Require proven native session capture on the selected host. */
|
|
1525
1792
|
requireNativeSessionCapture?: boolean;
|
|
1526
1793
|
/**
|
|
1527
|
-
*
|
|
1794
|
+
* Optional environment or container image override.
|
|
1795
|
+
* Omit this field to use the server's default image.
|
|
1528
1796
|
*
|
|
1529
1797
|
* Pass a named environment returned by `client.environments.list()`, a
|
|
1530
1798
|
* container image reference such as `"python:3.12-slim"`, or an image ID
|
|
1531
1799
|
* returned by the SDK image builder.
|
|
1532
1800
|
*
|
|
1533
|
-
* When omitted, the server applies its default environment.
|
|
1534
|
-
*
|
|
1535
1801
|
* @example
|
|
1536
1802
|
* ```typescript
|
|
1537
|
-
* environment: "
|
|
1803
|
+
* environment: "python:3.12-slim"
|
|
1538
1804
|
* ```
|
|
1539
1805
|
*/
|
|
1540
1806
|
environment?: string;
|
|
@@ -1634,6 +1900,14 @@ interface CreateSandboxOptions {
|
|
|
1634
1900
|
gpuLease?: CreateGpuLeaseOptions;
|
|
1635
1901
|
/** Environment variables injected into the sandbox */
|
|
1636
1902
|
env?: Record<string, string>;
|
|
1903
|
+
/**
|
|
1904
|
+
* Opt named withheld public env keys into cold reclamation after the platform's
|
|
1905
|
+
* idle bound and uploaded snapshot. The caller must keep a separate source and
|
|
1906
|
+
* supply their values to resume({ env }); no automatic credential recovery is
|
|
1907
|
+
* promised. Omit to retain the existing conservative policy. Hub/model keys
|
|
1908
|
+
* retain their separate recovery rules.
|
|
1909
|
+
*/
|
|
1910
|
+
envRecovery?: SandboxEnvRecovery;
|
|
1637
1911
|
/**
|
|
1638
1912
|
* Maximum continuous runtime in seconds for each create or resume interval.
|
|
1639
1913
|
*
|
|
@@ -1669,6 +1943,18 @@ interface CreateSandboxOptions {
|
|
|
1669
1943
|
* its own default of 900.
|
|
1670
1944
|
*/
|
|
1671
1945
|
idleTimeoutSeconds?: number;
|
|
1946
|
+
/**
|
|
1947
|
+
* Stopped-container grace in seconds before durable cold reclamation.
|
|
1948
|
+
* Must be an integer from 1 through 9007199254740. Omit to use the
|
|
1949
|
+
* platform cold window (6 hours by default). The lifecycle sweep removes
|
|
1950
|
+
* compute only after the grace and a confirmed, uploaded workspace snapshot;
|
|
1951
|
+
* the sandbox record and snapshot remain available to resume().
|
|
1952
|
+
*
|
|
1953
|
+
* Withheld credentials still require a recovery source. Use envRecovery for
|
|
1954
|
+
* keys the caller can supply again on cold resume. This does not shorten
|
|
1955
|
+
* idle suspension or the separate deleteAfterStoppedSeconds retention.
|
|
1956
|
+
*/
|
|
1957
|
+
coldTimeoutSeconds?: number;
|
|
1672
1958
|
/**
|
|
1673
1959
|
* Retention after stop, in seconds. After the sandbox has sat
|
|
1674
1960
|
* stopped/suspended continuously for this long, the platform deletes it —
|
|
@@ -1801,7 +2087,6 @@ interface CreateSandboxOptions {
|
|
|
1801
2087
|
* @example
|
|
1802
2088
|
* ```typescript
|
|
1803
2089
|
* const box = await client.create({
|
|
1804
|
-
* environment: "universal",
|
|
1805
2090
|
* tangleSecrets: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
|
|
1806
2091
|
* });
|
|
1807
2092
|
* ```
|
|
@@ -1846,7 +2131,6 @@ interface CreateSandboxOptions {
|
|
|
1846
2131
|
* @example
|
|
1847
2132
|
* ```typescript
|
|
1848
2133
|
* const box = await client.create({
|
|
1849
|
-
* environment: "universal",
|
|
1850
2134
|
* capabilities: ["computer_use"],
|
|
1851
2135
|
* });
|
|
1852
2136
|
* const { token } = await box.getMcpAccessToken({
|
|
@@ -2342,6 +2626,23 @@ interface ListSandboxOptions {
|
|
|
2342
2626
|
limit?: number;
|
|
2343
2627
|
/** Offset for pagination */
|
|
2344
2628
|
offset?: number;
|
|
2629
|
+
/** Only sandboxes created with this `metadata.run` (the caller's run id). */
|
|
2630
|
+
run?: string;
|
|
2631
|
+
}
|
|
2632
|
+
/**
|
|
2633
|
+
* One compute generation of a sandbox created for a caller run
|
|
2634
|
+
* (`metadata.run`). Deleted sandboxes keep theirs.
|
|
2635
|
+
*/
|
|
2636
|
+
interface SandboxRunGeneration {
|
|
2637
|
+
sandboxId: string;
|
|
2638
|
+
/** The sandbox's own compute generation id, not the caller run. */
|
|
2639
|
+
generation: string;
|
|
2640
|
+
generationSeq: number;
|
|
2641
|
+
orgId: string;
|
|
2642
|
+
state: string;
|
|
2643
|
+
startedAt: number;
|
|
2644
|
+
closedAt: number | null;
|
|
2645
|
+
closedReason: string | null;
|
|
2345
2646
|
}
|
|
2346
2647
|
/**
|
|
2347
2648
|
* Result of executing a command.
|
|
@@ -5156,6 +5457,44 @@ interface McpServerConfig {
|
|
|
5156
5457
|
/** Headers for remote connections */
|
|
5157
5458
|
headers?: Record<string, string>;
|
|
5158
5459
|
}
|
|
5460
|
+
/**
|
|
5461
|
+
* Nested model routing and auth. The role-named fields on
|
|
5462
|
+
* {@link BackendConfig} (`modelId`, `provider`, `apiKey`, `baseUrl`, ...)
|
|
5463
|
+
* are the supported spelling; this shape is accepted for compatibility and
|
|
5464
|
+
* normalized into them.
|
|
5465
|
+
*
|
|
5466
|
+
* @deprecated set the fields directly on the backend config instead.
|
|
5467
|
+
*/
|
|
5468
|
+
interface ModelRoutingConfig {
|
|
5469
|
+
/** Provider name (e.g., "anthropic", "openai", "google") */
|
|
5470
|
+
provider?: string;
|
|
5471
|
+
/** Model identifier (e.g., "claude-sonnet-4-20250514") */
|
|
5472
|
+
model?: string;
|
|
5473
|
+
/** BYOK (Bring Your Own Key) API key */
|
|
5474
|
+
apiKey?: string;
|
|
5475
|
+
/** Custom API base URL (for proxies or on-prem) */
|
|
5476
|
+
baseUrl?: string;
|
|
5477
|
+
/** Maximum thinking tokens for extended reasoning */
|
|
5478
|
+
maxThinkingTokens?: number;
|
|
5479
|
+
/** API mode: "api" for direct calls, "cli" for CLI wrapper */
|
|
5480
|
+
mode?: "api" | "cli";
|
|
5481
|
+
/**
|
|
5482
|
+
* Name of a box env var (a stored secret listed in `secrets`) holding this
|
|
5483
|
+
* provider's API key. Caller-owned auth by reference: no Router key is
|
|
5484
|
+
* minted and the named provider is kept.
|
|
5485
|
+
*/
|
|
5486
|
+
apiKeyEnv?: string;
|
|
5487
|
+
/** Named stored-secret reference for native subscription authentication. */
|
|
5488
|
+
cliAuth?: CliAuthReference;
|
|
5489
|
+
/** Authentication mode for CLI-native backends */
|
|
5490
|
+
authMode?: "api-key" | "oauth";
|
|
5491
|
+
/** Auth files to write into the sandbox home directory before CLI startup */
|
|
5492
|
+
authFiles?: Array<{
|
|
5493
|
+
path: string;
|
|
5494
|
+
content: string;
|
|
5495
|
+
mode?: number;
|
|
5496
|
+
}>;
|
|
5497
|
+
}
|
|
5159
5498
|
/**
|
|
5160
5499
|
* AI coding agent backend configuration.
|
|
5161
5500
|
*
|
|
@@ -5168,17 +5507,27 @@ interface McpServerConfig {
|
|
|
5168
5507
|
* ```typescript
|
|
5169
5508
|
* backend: {
|
|
5170
5509
|
* type: "claude-code",
|
|
5171
|
-
*
|
|
5172
|
-
*
|
|
5173
|
-
*
|
|
5174
|
-
* apiKey: process.env.ANTHROPIC_API_KEY,
|
|
5175
|
-
* }
|
|
5510
|
+
* modelId: "claude-sonnet-4-20250514",
|
|
5511
|
+
* provider: "anthropic",
|
|
5512
|
+
* apiKey: process.env.ANTHROPIC_API_KEY,
|
|
5176
5513
|
* }
|
|
5177
5514
|
* ```
|
|
5178
5515
|
*/
|
|
5179
5516
|
interface BackendConfig {
|
|
5180
5517
|
/** Runtime MCP bindings, separate from the authored profile. Headers may use secret references. */
|
|
5181
5518
|
runtimeAttachments?: AgentRuntimeAttachments;
|
|
5519
|
+
/**
|
|
5520
|
+
* Per-turn credential VALUES resolved by secret references in this turn's
|
|
5521
|
+
* runtime MCP attachments. Accepted on session message requests only
|
|
5522
|
+
* (`driveConversationTurn`, `session.sendMessage`): the value travels with
|
|
5523
|
+
* the turn, resolves only for that turn's backend materialization, and is
|
|
5524
|
+
* never written to the box environment, the admission journal, session
|
|
5525
|
+
* metadata, or logs. Sandbox and session creation reject it — creation-time
|
|
5526
|
+
* credentials belong to the stored-secret channel (`secrets`). Rotating a
|
|
5527
|
+
* value names a new backend identity, so a refreshed credential never
|
|
5528
|
+
* resolves beside stale authority.
|
|
5529
|
+
*/
|
|
5530
|
+
runtimeSecrets?: Record<string, string>;
|
|
5182
5531
|
/** Backend type identifier. Defaults to the platform's configured backend. */
|
|
5183
5532
|
type?: BackendType;
|
|
5184
5533
|
/**
|
|
@@ -5189,29 +5538,47 @@ interface BackendConfig {
|
|
|
5189
5538
|
*/
|
|
5190
5539
|
profile?: AgentProfile;
|
|
5191
5540
|
/**
|
|
5192
|
-
*
|
|
5541
|
+
* Which model this backend runs. The model id has exactly one home per
|
|
5542
|
+
* config: `modelId` here, or the `model` shorthand on per-turn options
|
|
5543
|
+
* (which folds into it). A disagreeing pair is a `ValidationError`, never
|
|
5544
|
+
* a silent preference.
|
|
5193
5545
|
*/
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5546
|
+
modelId?: string;
|
|
5547
|
+
/** Provider name (e.g., "anthropic", "openai", "openai-compat") */
|
|
5548
|
+
provider?: string;
|
|
5549
|
+
/** BYOK (Bring Your Own Key) API key */
|
|
5550
|
+
apiKey?: string;
|
|
5551
|
+
/** Custom API base URL (for proxies or on-prem) */
|
|
5552
|
+
baseUrl?: string;
|
|
5553
|
+
/** Maximum thinking tokens for extended reasoning */
|
|
5554
|
+
maxThinkingTokens?: number;
|
|
5555
|
+
/** API mode: "api" for direct calls, "cli" for CLI wrapper */
|
|
5556
|
+
mode?: "api" | "cli";
|
|
5557
|
+
/**
|
|
5558
|
+
* Name of a box env var (a stored secret listed in `secrets`) holding this
|
|
5559
|
+
* provider's API key. Caller-owned auth by reference: no Router key is
|
|
5560
|
+
* minted and the named provider is kept.
|
|
5561
|
+
*/
|
|
5562
|
+
apiKeyEnv?: string;
|
|
5563
|
+
/** Named stored-secret reference for native subscription authentication. */
|
|
5564
|
+
cliAuth?: CliAuthReference;
|
|
5565
|
+
/** Authentication mode for CLI-native backends */
|
|
5566
|
+
authMode?: "api-key" | "oauth";
|
|
5567
|
+
/** Auth files to write into the sandbox home directory before CLI startup */
|
|
5568
|
+
authFiles?: Array<{
|
|
5569
|
+
path: string;
|
|
5570
|
+
content: string;
|
|
5571
|
+
mode?: number;
|
|
5572
|
+
}>;
|
|
5573
|
+
/**
|
|
5574
|
+
* Model routing and auth, nested. Deprecated: the same fields now sit
|
|
5575
|
+
* role-named directly on the backend (`modelId`, `provider`, `apiKey`,
|
|
5576
|
+
* `baseUrl`, ...), so a model id is never spelled `backend.model.model`.
|
|
5577
|
+
* Still accepted and normalized; a field set both ways must agree.
|
|
5578
|
+
*
|
|
5579
|
+
* @deprecated use `modelId` + `provider`/`apiKey`/`baseUrl`/...
|
|
5580
|
+
*/
|
|
5581
|
+
model?: ModelRoutingConfig;
|
|
5215
5582
|
/**
|
|
5216
5583
|
* Backend server configuration.
|
|
5217
5584
|
*/
|
|
@@ -6999,4 +7366,4 @@ interface CodeExecutionOptions {
|
|
|
6999
7366
|
idempotencyKey?: string;
|
|
7000
7367
|
}
|
|
7001
7368
|
//#endregion
|
|
7002
|
-
export { DownloadOptions as $,
|
|
7369
|
+
export { DownloadOptions as $, BatchEvent as $a, SessionStatus as $i, PublicTemplateInfo as $n, SandboxFleetTraceEvent as $r, GPU_LEASE_PROVIDER_NAMES as $t, CommitTaskSessionOptions as A, WorkspaceOperationLookup as Aa, SandboxTraceExport as Ai, NetworkConfig as An, SandboxFleetArtifact as Ar, FileUsageOptions as At, CreateSandboxOptions as B, ManagedProcessState as Ba, SessionBackendCredentials as Bi, ProcessListOptions as Bn, SandboxFleetMachineMeteredUsage as Br, FleetDispatchStreamOptions as Bt, BranchOptions as C, TurnDriveResult as Ca, SandboxTerminalCreateOptions as Ci, ListMessagesOptions as Cn, SandboxDeleteAcknowledgement as Cr, FileReadError as Ct, CodeExecutionResult as D, UsageInfo as Da, SandboxTerminals as Di, MAX_EGRESS_DENIALS_LIMIT as Dn, SandboxEvent as Dr, FileTreeFile as Dt, CodeExecutionOptions as E, UploadProgress as Ea, SandboxTerminalRequestOptions as Ei, ListSandboxOptions as En, SandboxEnvironment as Er, FileSystem as Et, CreateIntelligenceReportOptions as F, ManagedProcessJobs as Fa, SecretInfo as Fi, PreviewLinkInfo as Fn, SandboxFleetDriverCapability as Fr, FleetAgentResult as Ft, DeleteMatchingSandboxesFilter as G, RawEvidenceExportOptions as Ga, SessionForkOptions as Gi, ProcessStatus as Gn, SandboxFleetOperationsSummary as Gr, FleetMachineId as Gt, CreateTaskSessionOptions as H, SandboxEnvRecoveryView as Ha, SessionExecutionInfo as Hi, ProcessManager as Hn, SandboxFleetMachineSpec as Hr, FleetDriveTurnRequest as Ht, CreateRequestOptions as I, ManagedProcessOptions as Ia, SecretsManager as Ii, PreviewLinkManager as In, SandboxFleetDriverTimings as Ir, FleetAgentRunStatus as It, DeleteOptions as J, RawEvidenceRecordsFile as Ja, SessionListOptions as Ji, PromptResult as Jn, SandboxFleetPolicy as Jr, FleetRunEvent as Jt, DeleteMatchingSandboxesOptions as K, RawEvidenceNativeFile as Ka, SessionInfo as Ki, PromptInputPart as Kn, SandboxFleetParent as Kr, FleetPromptDispatchOptions as Kt, CreateSandboxFleetOptions as L, ManagedProcessRecord as La, SendSessionMessageOptions as Li, PreviewLinkWaitOptions as Ln, SandboxFleetInfo as Lr, FleetDispatchCancelResult as Lt, ConversationTurnOptions as M, WriteManyFile as Ma, SandboxUser as Mi, NonHostAgentDriverConfig as Mn, SandboxFleetCostEstimate as Mr, FileWriteResult as Mt, ConversationTurnResult as N, WriteManyOptions as Na, SearchMatch as Ni, PermissionLevel as Nn, SandboxFleetDispatchFailureClass as Nr, FleetAgentId as Nt, CodeLanguage as O, WaitForOptions as Oa, SandboxTraceBundle as Oi, McpServerConfig as On, SandboxFleetAgent as Or, FileTreeOptions as Ot, CreateGpuLeaseOptions as P, ManagedProcessClient as Pa, SearchOptions as Pi, PermissionsManager as Pn, SandboxFleetDispatchResponse as Pr, FleetAgentPlacement as Pt, DispatchedSession as Q, BatchBackendStats as Qa, SessionResultOptions as Qi, ProvisionStep as Qn, SandboxFleetTraceBundle as Qr, ForkLookupOptions as Qt, CreateSandboxFleetTokenOptions as R, ManagedProcessResumeOptions as Ra, SendSessionMessageRequest as Ri, Process as Rn, SandboxFleetIntelligenceEnvelope as Rr, FleetDispatchResultBuffer as Rt, BatchTaskResult as S, TokenUsage as Sa, SandboxTerminalAttachOptions as Si, JsonValue as Sn, SandboxCreateReceipt as Sr, FileReadBatchResult as St, ChunkedUploadResult as T, UploadOptions as Ta, SandboxTerminalManager as Ti, ListSandboxFleetOptions as Tn, SandboxDeleteOutcome as Tr, FileRenameResult as Tt, DeleteMatchingSandboxOutcome as U, RawEvidenceArchiveManifest as Ua, SessionExecutionStatus as Ui, ProcessSignal as Un, SandboxFleetManifest as Ur, FleetExecDispatchOptions as Ut, CreateSessionOptions as V, SandboxEnvRecovery as Va, SessionEventStreamOptions as Vi, ProcessLogEntry as Vn, SandboxFleetMachineRecord as Vr, FleetDriveTurnOutcome as Vt, DeleteMatchingSandboxResult as W, RawEvidenceDirectoryExport as Wa, SessionFailureReason as Wi, ProcessSpawnOptions as Wn, SandboxFleetManifestMachine as Wr, FleetExecDispatchResult as Wt, DirectoryPermission as X, InteractionResolutionAcknowledgement as Xa, SessionMessageAdmission as Xi, ProvisionResult as Xn, SandboxFleetSpend as Xr, ForkCounts as Xt, DevServerInfo as Y, WorkspaceImagePublishResult as Ya, SessionMessage as Yi, ProvisionEvent as Yn, SandboxFleetProfileRef as Yr, FleetRunOptions as Yt, DispatchPromptOptions as Z, PublicBatchRunRequest as Za, SessionMessageInputPart as Zi, ProvisionStatus as Zn, SandboxFleetToken as Zr, ForkIdempotency as Zt, BatchBackend as _, TeeAttestationReport as _a, SandboxRuntimeHealth as _i, IntelligenceReport as _n, SSHCommandDescriptor as _r, ExactProcessSpawnOptions as _t, AgentQuestionRequest as a, SnapshotResult as aa, SandboxFleetWorkspaceRestoreResult as ai, GitStatus as an, parseBackendType as ao, ReconcileSandboxFleetsOptions as ar, DriverType as at, BatchRunRequest as b, TeePublicKeyResponse as ba, SandboxShapesInfo as bi, IntelligenceReportSubjectType as bn, SandboxConnection as br, FileInfo as bt, AttachGpuLeaseOptions as c, StartupOperation as ca, SandboxInfo as ci, GpuLeaseCommandResult as cn, RestoreSnapshotOptions as cr, DurablePlanSnapshot as ct, BackendConfig as d, TaskSessionChanges as da, SandboxPortPreviewLink as di, GpuLeaseManager as dn, RolloutChildResult as dr, EffectiveBackendSource as dt, SnapshotDeleteAcknowledgement as ea, SandboxFleetTraceExport as ei, GitAuth as en, BatchEventDataMap as eo, PublicTemplateVersionInfo as er, DownloadProgress as et, BackendInfo as f, TaskSessionCommitResult as fa, SandboxRemovalState as fi, GpuLeaseProviderName as fn, RolloutOptions as fr, EgressDenial as ft, BackendStatus as g, TeeAttestationOptions as ga, SandboxRuntimeCapabilities as gi, InstalledTool as gn, RolloutTurnPart as gr, EventStreamOptions as gt, BackendRuntimeConfigUpdate as h, TaskSessionProfile as ha, SandboxRunGeneration as hi, HostAgentRuntimeBackend as hn, RolloutStatus as hr, EnsureDevServerOptions as ht, AgentApprovalRequirement as i, SnapshotOptions as ia, SandboxFleetWorkspaceReconcileResult as ii, GitDiff as in, BackendType as io, ReapExpiredSandboxFleetsResult as ir, DriverInfo as it, CompletedTurnResult as j, WriteFileOptions as ja, SandboxTraceOptions as ji, NetworkManager as jn, SandboxFleetArtifactSpec as jr, FileUsageResult as jt, CodeResultPart as k, WaitForRolloutOptions as ka, SandboxTraceEvent as ki, MkdirOptions as kn, SandboxFleetAgentSpec as kr, FileTreeResult as kt, AttachSandboxFleetMachineOptions as l, StorageConfig as la, SandboxIntelligenceEnvelope as li, GpuLeaseExecOptions as ln, ResumeOptions as lr, EffectiveBackend as lt, BackendMcpServerStatus as m, TaskSessionInfo as ma, SandboxResources as mi, HostAgentDriverConfig as mn, RolloutStartResult as mr, EgressPolicy as mt, AccessPolicyRule as n, SnapshotIdempotency as na, SandboxFleetUsage as ni, GitCommit as nn, BatchTaskUsage as no, PublishPublicTemplateVersionOptions as nr, DriveTurnOptions as nt, AgentRunStatus as o, SshKeysManager as oa, SandboxFleetWorkspaceSnapshotResult as oi, GpuLease as on, ReconcileSandboxFleetsResult as or, DurablePlan as ot, BackendManager as p, TaskSessionFileChange as pa, SandboxResourceUsage as pi, GpuLeaseStatus as pn, RolloutScorer as pr, EgressManager as pt, DeleteMatchingSandboxesResult as q, RawEvidencePayloadFile as qa, SessionInterruptOptions as qi, PromptOptions as qn, SandboxFleetPlacement as qr, FleetPromptDispatchResult as qt, AddUserOptions as r, SnapshotInfo as ra, SandboxFleetWorkspace as ri, GitConfig as rn, ALL_BACKEND_TYPES as ro, ReapExpiredSandboxFleetsOptions as rr, DriverConfig as rt, AgentToolInvocation as s, StartupDiagnostics as sa, SandboxIdentity as si, GpuLeaseBilling as sn, RenameOptions as sr, DurablePlanDecisionResult as st, AcceleratorKind as t, SnapshotDeleteOutcome as ta, SandboxFleetTraceOptions as ti, GitBranch as tn, BatchSidecarGroup as to, PublishPublicTemplateOptions as tr, DownloadResult as tt, BackendCapabilities as u, SubscriptionInfo as ua, SandboxPortBinding as ui, GpuLeaseExecResult as un, Rollout as ur, EffectiveBackendProfile as ut, BatchResult as v, TeeAttestationResponse as va, SandboxShape as vi, IntelligenceReportBudget as vn, SSHCredentials as vr, ExecOptions as vt, ChunkedUploadOptions as w, UpdateUserOptions as wa, SandboxTerminalInfo as wi, ListOptions as wn, SandboxDeleteOptions as wr, FileReadResult as wt, BatchTask as x, TokenRefreshHandler as xa, SandboxStatus as xi, IntelligenceReportWindow as xn, SandboxCreateOutcome as xr, FileReadBatchOptions as xt, BatchRunOptions as y, TeePublicKey as ya, SandboxShapePreset as yi, IntelligenceReportCompareTo as yn, SandboxConfig as yr, ExecResult as yt, CreateSandboxFleetWithCoordinatorOptions as z, ManagedProcessSpec as za, SentSessionMessage as zi, ProcessInfo as zn, SandboxFleetMachine as zr, FleetDispatchResultBufferOptions as zt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.16-develop.20261006020509.71b03b7",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -151,11 +151,11 @@
|
|
|
151
151
|
"ws": "^8.20.0",
|
|
152
152
|
"yjs": "13.6.30",
|
|
153
153
|
"@products/sandbox-test-utils": "0.0.0",
|
|
154
|
+
"@tangle-network/agent-profile-materialize": "0.20.9",
|
|
154
155
|
"@repo/shared": "0.0.0",
|
|
155
|
-
"@tangle-network/
|
|
156
|
-
"@tangle-network/cli-agent-registry": "0.
|
|
157
|
-
"@tangle-network/
|
|
158
|
-
"@tangle-network/sdk": "3.3.39",
|
|
156
|
+
"@tangle-network/runtime-contracts": "0.14.0",
|
|
157
|
+
"@tangle-network/cli-agent-registry": "0.5.0",
|
|
158
|
+
"@tangle-network/sdk": "3.3.41",
|
|
159
159
|
"@tangle-network/sse-core": "0.0.0"
|
|
160
160
|
},
|
|
161
161
|
"scripts": {
|