@tangle-network/agent-provider-tangle 3.6.1 → 3.6.4
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 +7 -2
- package/dist/tangle-evidence.js +12 -0
- package/dist/tangle-terminal.d.ts +1 -5
- package/dist/tangle-terminal.js +0 -15
- package/dist/tangle-workspace-branching.js +15 -33
- package/dist/tangle-workspace-recovery.d.ts +0 -1
- package/dist/tangle-workspace-recovery.js +2 -25
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -54,6 +54,7 @@ Evidence capture retains full workspace files that exceed the Sandbox JSON read
|
|
|
54
54
|
This requires a Sandbox SDK whose filesystem advertises `supportsBoundedDownload`.
|
|
55
55
|
Capture verifies the downloaded size and SHA-256 receipt before adding bytes to the archive.
|
|
56
56
|
Aggregate limits, credential exclusions, and exact native-session proof remain enforced.
|
|
57
|
+
Capture lists no directory below a credential directory such as `.opencode` or `.config`: it records the directory as excluded and accounts for its subtree with one complete usage scan, so the workspace totals still reconcile.
|
|
57
58
|
An unsupported downloader or incomplete transfer fails capture and preserves the source environment.
|
|
58
59
|
|
|
59
60
|
## Named model credentials at creation
|
|
@@ -447,8 +448,12 @@ metadata so a fresh process can recover the exact interface digest.
|
|
|
447
448
|
Snapshot-created children are validated through the marker and complete
|
|
448
449
|
account inventory, while legacy fork markers also require the Sandbox fork
|
|
449
450
|
ledger to report a settled success.
|
|
450
|
-
Checkpoint deletion
|
|
451
|
-
|
|
451
|
+
Checkpoint deletion reads only the source's own snapshots. A child created
|
|
452
|
+
from a checkpoint holds a full restore of it in its own volume, so deleting the
|
|
453
|
+
checkpoint neither waits for nor changes its children. One Sandbox path still
|
|
454
|
+
names the checkpoint after create: last-resort sidecar recreation replays the
|
|
455
|
+
child's original create request, and once the checkpoint is deleted that replay
|
|
456
|
+
fails with `SNAPSHOT_NOT_FOUND` (agent-dev-container#9388).
|
|
452
457
|
The adapter never treats an SDK response without an explicit idempotency or
|
|
453
458
|
deletion outcome as success.
|
|
454
459
|
|
package/dist/tangle-evidence.js
CHANGED
|
@@ -242,6 +242,18 @@ async function captureSandboxEvidence(box, options, writer) {
|
|
|
242
242
|
scannedDirectories++;
|
|
243
243
|
if (path.split("/").some((part) => blockedNames.has(part))) {
|
|
244
244
|
excludedPaths.push({ ...item, reason: "credential-path" });
|
|
245
|
+
// Nothing below a credential directory is read, so none of it is listed either: one
|
|
246
|
+
// complete usage scan accounts for its subtree against the workspace totals. Listing it
|
|
247
|
+
// cost one request per directory; .opencode/node_modules alone was 271 of a capture's
|
|
248
|
+
// 302 list calls and about 100 s of each two-minute workspace capture on 2026-10-06.
|
|
249
|
+
options.signal?.throwIfAborted();
|
|
250
|
+
const subtree = await fs.usage(sourcePath);
|
|
251
|
+
if (!subtree.complete || subtree.skippedEntries !== 0)
|
|
252
|
+
throw new Error("Tangle workspace usage scan is incomplete");
|
|
253
|
+
scannedDirectories += subtree.directoryCount;
|
|
254
|
+
scannedFiles += subtree.fileCount;
|
|
255
|
+
scannedSize += subtree.sizeBytes;
|
|
256
|
+
continue;
|
|
245
257
|
}
|
|
246
258
|
stack.push(sourcePath);
|
|
247
259
|
continue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgentTerminalSession, TerminalAttachRequest, TerminalAttachResult } from "@tangle-network/agent-interface";
|
|
2
2
|
import type { SandboxInstanceLike, SandboxTerminalReadyLike, SandboxTerminalStreamLike, SandboxTerminalsLike } from "./tangle-types.js";
|
|
3
3
|
import { TerminalFrameLog } from "./tangle-terminal-frames.js";
|
|
4
4
|
/** Terminal handles this environment holds, keyed by terminal session id. */
|
|
@@ -72,7 +72,3 @@ export declare function prepareTangleTerminalAttachment(input: {
|
|
|
72
72
|
release?: (terminalSessionId: string, stream: SandboxTerminalStreamLike) => void;
|
|
73
73
|
}): Promise<PreparedTangleTerminal>;
|
|
74
74
|
export declare function createTangleTerminalRegistry(box: SandboxInstanceLike): TangleTerminalRegistry;
|
|
75
|
-
/** Close a stream that has not been handed to a caller. */
|
|
76
|
-
export declare function closeTangleStreamQuietly(stream: SandboxTerminalStreamLike): Promise<void>;
|
|
77
|
-
/** Add the exact claim identity without replacing the terminal implementation. */
|
|
78
|
-
export declare function bindTangleInteractiveControl(session: AgentTerminalSession, control: AgentInteractiveSessionControlClaim): AgentInteractiveTerminalSession;
|
package/dist/tangle-terminal.js
CHANGED
|
@@ -476,21 +476,6 @@ async function closeQuietly(stream) {
|
|
|
476
476
|
// caller's failure is reported from the attach result it receives.
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
/** Close a stream that has not been handed to a caller. */
|
|
480
|
-
export async function closeTangleStreamQuietly(stream) {
|
|
481
|
-
await closeQuietly(stream);
|
|
482
|
-
}
|
|
483
|
-
/** Add the exact claim identity without replacing the terminal implementation. */
|
|
484
|
-
export function bindTangleInteractiveControl(session, control) {
|
|
485
|
-
return Object.create(session, {
|
|
486
|
-
control: {
|
|
487
|
-
configurable: false,
|
|
488
|
-
enumerable: true,
|
|
489
|
-
value: Object.freeze({ ...control }),
|
|
490
|
-
writable: false,
|
|
491
|
-
},
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
479
|
function boundedLabel(value) {
|
|
495
480
|
return typeof value === "string" && value.length > 0 && value.length <= 512
|
|
496
481
|
? value
|
|
@@ -3,7 +3,7 @@ import { ConfidentialAttestationSchema, ConfidentialExecutionRequestSchema, Fork
|
|
|
3
3
|
import { awaitWithSignal, boundedIdentifier, boundedString, MAX_STRING_LENGTH, cloneJson, safeIdentifier, safeString, } from "./tangle-contract-safety.js";
|
|
4
4
|
import { encodeTangleConfidentialAttestationQuote } from "./tangle-confidential-attestation.js";
|
|
5
5
|
import { checkpointMarkerTags, forkMarkerMetadata, markerBelongsToSource, checkpointMarkerBelongsToSource, checkpointMarkerFromTags, forkMarkerFromMetadata, } from "./tangle-workspace-markers.js";
|
|
6
|
-
import { checkpointRecordFromSnapshot, validSnapshotResult, reconcileCheckpoint, findManagedCheckpoint, findForkByKey, findForkChildById, completeForkChild,
|
|
6
|
+
import { checkpointRecordFromSnapshot, validSnapshotResult, reconcileCheckpoint, findManagedCheckpoint, findForkByKey, findForkChildById, completeForkChild, lookupOutcomeFromSandbox, isoDate, } from "./tangle-workspace-recovery.js";
|
|
7
7
|
const TANGLE_ATTESTATION_NONCE_PATTERN = /^(?:0x)?[0-9a-fA-F]{64}(?:[0-9a-fA-F]{64})?$/;
|
|
8
8
|
function confidentialForkRefusal(request) {
|
|
9
9
|
const confidential = request.confidential;
|
|
@@ -220,30 +220,20 @@ export function createTangleWorkspaceBranching(options) {
|
|
|
220
220
|
if (previous.requestDigest !== request.requestDigest) {
|
|
221
221
|
return cleanupConflict(request, previous.requestDigest);
|
|
222
222
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return cleanupUnknown(request, "Sandbox child inventory is unavailable; deletion was not attempted", true);
|
|
238
|
-
}
|
|
239
|
-
if (blocking.length > 0) {
|
|
240
|
-
const acknowledgement = cleanupInUse(request, blocking);
|
|
241
|
-
cleanup.set(request.operationId, {
|
|
242
|
-
requestDigest: request.requestDigest,
|
|
243
|
-
acknowledgement,
|
|
244
|
-
});
|
|
245
|
-
return acknowledgement;
|
|
246
|
-
}
|
|
223
|
+
return previous.acknowledgement.status === "deleted"
|
|
224
|
+
? cleanupAlreadyAbsent(request)
|
|
225
|
+
: previous.acknowledgement;
|
|
226
|
+
}
|
|
227
|
+
// A child created from a checkpoint holds a full restore of it in its own
|
|
228
|
+
// volume, and Sandbox deletes a snapshot without regard to children, so
|
|
229
|
+
// deletion reads only this source's snapshots. One Sandbox path still names
|
|
230
|
+
// the checkpoint after create: last-resort sidecar recreation replays the
|
|
231
|
+
// child's original create request, and after deletion that replay fails
|
|
232
|
+
// with SNAPSHOT_NOT_FOUND instead of restoring the checkpoint
|
|
233
|
+
// (agent-dev-container#9388). The
|
|
234
|
+
// account-wide child scan this replaces paged a listing that Sandbox
|
|
235
|
+
// rebuilds and re-sorts on every page; on a busy account a page failed or
|
|
236
|
+
// repeated, deletion was never attempted, and the source was kept running.
|
|
247
237
|
const known = await findManagedCheckpoint(box, provider, request.targetId, undefined, operation?.signal);
|
|
248
238
|
if (known === "unknown") {
|
|
249
239
|
return cleanupUnknown(request, "Sandbox checkpoint inventory is unavailable; deletion was not attempted", true);
|
|
@@ -870,14 +860,6 @@ function cleanupConflict(request, existingRequestDigest) {
|
|
|
870
860
|
message: "Cleanup operation id is bound to another target",
|
|
871
861
|
});
|
|
872
862
|
}
|
|
873
|
-
function cleanupInUse(request, blockingTargetIds) {
|
|
874
|
-
return WorkspaceCleanupAcknowledgementSchema.parse({
|
|
875
|
-
...request,
|
|
876
|
-
status: "in_use",
|
|
877
|
-
blockingTargetIds,
|
|
878
|
-
message: "Checkpoint is still referenced by forked environments",
|
|
879
|
-
});
|
|
880
|
-
}
|
|
881
863
|
function cleanupUnknown(request, message, retryable) {
|
|
882
864
|
return WorkspaceCleanupAcknowledgementSchema.parse({
|
|
883
865
|
...request,
|
|
@@ -49,7 +49,6 @@ export declare function findForkChildById(client: SandboxClientLike, box: Sandbo
|
|
|
49
49
|
* marker is absent. Never invent either field from the request.
|
|
50
50
|
*/
|
|
51
51
|
export declare function completeForkChild(client: SandboxClientLike, child: SandboxInstanceLike, signal?: AbortSignal): Promise<SandboxInstanceLike | undefined>;
|
|
52
|
-
export declare function findBlockingForks(box: SandboxInstanceLike, client: SandboxClientLike, provider: string, checkpointId: string, signal?: AbortSignal): Promise<string[] | undefined>;
|
|
53
52
|
/**
|
|
54
53
|
* Read a fork ledger answer for a key that left no marked resource behind.
|
|
55
54
|
*
|
|
@@ -383,28 +383,6 @@ export async function completeForkChild(client, child, signal) {
|
|
|
383
383
|
return undefined;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
export async function findBlockingForks(box, client, provider, checkpointId, signal) {
|
|
387
|
-
const candidates = await listMarkedForkChildren(client, box, provider, undefined, signal);
|
|
388
|
-
if (candidates === undefined)
|
|
389
|
-
return undefined;
|
|
390
|
-
const blocking = new Set();
|
|
391
|
-
for (const { child, marker } of candidates) {
|
|
392
|
-
if (marker.request.checkpoint.checkpointId !== checkpointId)
|
|
393
|
-
continue;
|
|
394
|
-
try {
|
|
395
|
-
// A candidate that cannot be confirmed leaves the dependency set
|
|
396
|
-
// unknown, so cleanup must not proceed on a partial answer.
|
|
397
|
-
if (!(await forkOperationSucceeded(box, marker, signal)))
|
|
398
|
-
return undefined;
|
|
399
|
-
blocking.add(child.id);
|
|
400
|
-
}
|
|
401
|
-
catch {
|
|
402
|
-
signal?.throwIfAborted();
|
|
403
|
-
return undefined;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
return [...blocking].sort();
|
|
407
|
-
}
|
|
408
386
|
/**
|
|
409
387
|
* Read the complete account inventory through Sandbox offset pages.
|
|
410
388
|
*
|
|
@@ -460,9 +438,8 @@ async function listAllSandboxChildren(client, signal) {
|
|
|
460
438
|
/**
|
|
461
439
|
* Read every account child that carries a fork marker this source produced.
|
|
462
440
|
*
|
|
463
|
-
* The scan is the
|
|
464
|
-
*
|
|
465
|
-
* closed on the same condition.
|
|
441
|
+
* The scan is the front half of fork recovery. It returns undefined when the
|
|
442
|
+
* inventory itself cannot be trusted, so recovery fails closed.
|
|
466
443
|
*/
|
|
467
444
|
async function listMarkedForkChildren(client, box, provider, key, signal) {
|
|
468
445
|
const children = await listAllSandboxChildren(client, signal);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-provider-tangle",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"description": "AgentEnvironmentProvider adapter for Tangle sandboxes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"dist/model-credential-capacity.d.ts"
|
|
129
129
|
],
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@tangle-network/agent-interface": "^
|
|
131
|
+
"@tangle-network/agent-interface": "^3.0.0"
|
|
132
132
|
},
|
|
133
133
|
"peerDependencies": {
|
|
134
134
|
"@tangle-network/sandbox": ">=0.58.7 <1.0.0"
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"@tangle-network/agent-provider-testkit": "0.10.
|
|
142
|
+
"@tangle-network/agent-provider-testkit": "0.10.2",
|
|
143
143
|
"@tangle-network/agent-runtime": "0.292.3",
|
|
144
144
|
"@tangle-network/sandbox": "0.58.7",
|
|
145
145
|
"@types/node": "26.6.3",
|