@tangle-network/agent-provider-tangle 4.0.0 → 4.1.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 +2 -1
- package/dist/tangle-environment-session.js +1 -1
- package/dist/tangle-evidence-writer.d.ts +1 -1
- package/dist/tangle-evidence-writer.js +5 -2
- package/dist/tangle-evidence.d.ts +7 -6
- package/dist/tangle-evidence.js +2 -2
- package/dist/tangle-step-usage.js +1 -1
- package/dist/tangle-workspace-branching.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -456,7 +456,7 @@ from a checkpoint holds a full restore of it in its own volume, so deleting the
|
|
|
456
456
|
checkpoint neither waits for nor changes its children. One Sandbox path still
|
|
457
457
|
names the checkpoint after create: last-resort sidecar recreation replays the
|
|
458
458
|
child's original create request, and once the checkpoint is deleted that replay
|
|
459
|
-
fails with `SNAPSHOT_NOT_FOUND` (agent-
|
|
459
|
+
fails with `SNAPSHOT_NOT_FOUND` (agent-container#9388).
|
|
460
460
|
The adapter never treats an SDK response without an explicit idempotency or
|
|
461
461
|
deletion outcome as success.
|
|
462
462
|
|
|
@@ -649,6 +649,7 @@ Pass `destination` alongside the same capture options.
|
|
|
649
649
|
The destination must not exist; its parent must exist.
|
|
650
650
|
The result contains `directory` and `provenance`; callers own removal after durable persistence.
|
|
651
651
|
Failed captures remove their private destination and native-export staging.
|
|
652
|
+
Directory capture syncs each staged file by default. A caller that keeps the source environment until the captured bytes have been verified and stored durably may pass `syncStagedFiles: false` to avoid a sync for each temporary file. The option does not change byte, digest, mode, or completeness checks; it does not make the staging tree durable across a host failure.
|
|
652
653
|
|
|
653
654
|
Directory capture streams workspace files, native payloads, and event records into private files.
|
|
654
655
|
It requires Sandbox `session.exportRawEvidence()` and its dedicated server archive route.
|
|
@@ -278,7 +278,7 @@ export function sandboxSessionAsAgentSession(session, controlRef, provider, envi
|
|
|
278
278
|
...(useExactExecutionStream ? { streamBound: true } : {}),
|
|
279
279
|
});
|
|
280
280
|
// The sidecar stamps `id:` only on frames that have a replay-buffer position
|
|
281
|
-
// (agent-
|
|
281
|
+
// (agent-container apps/sidecar/src/routes/agents-events.ts). A frame with no
|
|
282
282
|
// position carries no id by the SSE contract, so a reconnect resumes from the last
|
|
283
283
|
// frame that had one. Refusing such a frame ended the whole stream, and with it the
|
|
284
284
|
// terminal receipt that carries the execution's token usage: three long pi turns on
|
|
@@ -22,7 +22,7 @@ export declare function createMemoryEvidenceWriter(maxBytes: number, signal?: Ab
|
|
|
22
22
|
files: EvidenceFile[];
|
|
23
23
|
};
|
|
24
24
|
/** One fresh private tree, streamed writes and hash-verified bounded downloads. */
|
|
25
|
-
export declare function createDirectoryEvidenceWriter(destination: string, maxBytes: number, signal?: AbortSignal): Promise<EvidenceWriter & {
|
|
25
|
+
export declare function createDirectoryEvidenceWriter(destination: string, maxBytes: number, signal?: AbortSignal, syncStagedFiles?: boolean): Promise<EvidenceWriter & {
|
|
26
26
|
directory: string;
|
|
27
27
|
remove(): Promise<void>;
|
|
28
28
|
}>;
|
|
@@ -48,7 +48,7 @@ export function createMemoryEvidenceWriter(maxBytes, signal) {
|
|
|
48
48
|
return writer;
|
|
49
49
|
}
|
|
50
50
|
/** One fresh private tree, streamed writes and hash-verified bounded downloads. */
|
|
51
|
-
export async function createDirectoryEvidenceWriter(destination, maxBytes, signal) {
|
|
51
|
+
export async function createDirectoryEvidenceWriter(destination, maxBytes, signal, syncStagedFiles = true) {
|
|
52
52
|
limits(maxBytes);
|
|
53
53
|
signal?.throwIfAborted();
|
|
54
54
|
if (!destination)
|
|
@@ -93,7 +93,10 @@ export async function createDirectoryEvidenceWriter(destination, maxBytes, signa
|
|
|
93
93
|
}
|
|
94
94
|
signal?.throwIfAborted();
|
|
95
95
|
await output.chmod(mode);
|
|
96
|
-
|
|
96
|
+
// A caller that keeps the source until a verified durable copy exists may skip
|
|
97
|
+
// syncing each temporary file. Other callers retain the original durability.
|
|
98
|
+
if (syncStagedFiles !== false)
|
|
99
|
+
await output.sync();
|
|
97
100
|
}
|
|
98
101
|
finally {
|
|
99
102
|
await output.close();
|
|
@@ -44,6 +44,11 @@ export interface TangleSandboxEvidenceOptions extends Omit<TangleEnvironmentEvid
|
|
|
44
44
|
/** Exact relative worker directory. Defaults to the Sandbox workspace root. */
|
|
45
45
|
workspaceRoot?: string;
|
|
46
46
|
}
|
|
47
|
+
/** Directory capture alone may stage without per-file sync when the caller guards durable offload. */
|
|
48
|
+
export interface TangleDirectoryEvidenceOptions {
|
|
49
|
+
destination: string;
|
|
50
|
+
syncStagedFiles?: boolean;
|
|
51
|
+
}
|
|
47
52
|
export interface TangleEnvironmentEvidence {
|
|
48
53
|
files: Array<{
|
|
49
54
|
path: string;
|
|
@@ -187,13 +192,9 @@ export interface TangleDirectoryEvidence {
|
|
|
187
192
|
provenance: TangleEnvironmentEvidence["provenance"];
|
|
188
193
|
}
|
|
189
194
|
/** Capture to a new private directory without accumulating workspace content in memory. */
|
|
190
|
-
export declare function captureTangleEnvironmentEvidenceToDirectory(environment: AgentEnvironment, options: TangleEnvironmentEvidenceOptions &
|
|
191
|
-
destination: string;
|
|
192
|
-
}): Promise<TangleDirectoryEvidence>;
|
|
195
|
+
export declare function captureTangleEnvironmentEvidenceToDirectory(environment: AgentEnvironment, options: TangleEnvironmentEvidenceOptions & TangleDirectoryEvidenceOptions): Promise<TangleDirectoryEvidence>;
|
|
193
196
|
/** The caller owns a successful directory; incomplete captures are removed. */
|
|
194
|
-
export declare function captureTangleSandboxEvidenceToDirectory(box: SandboxInstanceLike, options: TangleSandboxEvidenceOptions &
|
|
195
|
-
destination: string;
|
|
196
|
-
}): Promise<TangleDirectoryEvidence>;
|
|
197
|
+
export declare function captureTangleSandboxEvidenceToDirectory(box: SandboxInstanceLike, options: TangleSandboxEvidenceOptions & TangleDirectoryEvidenceOptions): Promise<TangleDirectoryEvidence>;
|
|
197
198
|
/** Export exact Sandbox session and workspace evidence before its owning box is deleted. */
|
|
198
199
|
export declare function captureTangleSandboxEvidence(box: SandboxInstanceLike, options: TangleSandboxEvidenceOptions): Promise<TangleEnvironmentEvidence>;
|
|
199
200
|
export {};
|
package/dist/tangle-evidence.js
CHANGED
|
@@ -79,11 +79,11 @@ export async function captureTangleEnvironmentEvidence(environment, options) {
|
|
|
79
79
|
/** Capture to a new private directory without accumulating workspace content in memory. */
|
|
80
80
|
export async function captureTangleEnvironmentEvidenceToDirectory(environment, options) {
|
|
81
81
|
const context = evidenceContext(environment, options);
|
|
82
|
-
return captureTangleSandboxEvidenceToDirectory(context.box, { ...context.options, destination: options.destination });
|
|
82
|
+
return captureTangleSandboxEvidenceToDirectory(context.box, { ...context.options, destination: options.destination, syncStagedFiles: options.syncStagedFiles });
|
|
83
83
|
}
|
|
84
84
|
/** The caller owns a successful directory; incomplete captures are removed. */
|
|
85
85
|
export async function captureTangleSandboxEvidenceToDirectory(box, options) {
|
|
86
|
-
const writer = await createDirectoryEvidenceWriter(options.destination, options.maxBytes, options.signal);
|
|
86
|
+
const writer = await createDirectoryEvidenceWriter(options.destination, options.maxBytes, options.signal, options.syncStagedFiles);
|
|
87
87
|
try {
|
|
88
88
|
const provenance = await captureSandboxEvidence(box, options, writer);
|
|
89
89
|
return { directory: writer.directory, provenance };
|
|
@@ -40,7 +40,7 @@ export function createStepUsageFold() {
|
|
|
40
40
|
/**
|
|
41
41
|
* The step an OpenCode `step_finish` frame reports, in either wire shape.
|
|
42
42
|
*
|
|
43
|
-
* The sidecar (agent-
|
|
43
|
+
* The sidecar (agent-container `packages/sdk-provider-opencode/src/cli-events.ts`)
|
|
44
44
|
* wraps the harness event as `{ type: "raw", backend: "opencode", event }`.
|
|
45
45
|
* The live run stream writes only `event` as the frame data; the execution
|
|
46
46
|
* replay writes the whole buffered envelope. Both frames carry one event id.
|
|
@@ -241,7 +241,7 @@ export function createTangleWorkspaceBranching(options) {
|
|
|
241
241
|
// the checkpoint after create: last-resort sidecar recreation replays the
|
|
242
242
|
// child's original create request, and after deletion that replay fails
|
|
243
243
|
// with SNAPSHOT_NOT_FOUND instead of restoring the checkpoint
|
|
244
|
-
// (agent-
|
|
244
|
+
// (agent-container#9388). The
|
|
245
245
|
// account-wide child scan this replaces paged a listing that Sandbox
|
|
246
246
|
// rebuilds and re-sorts on every page; on a busy account a page failed or
|
|
247
247
|
// repeated, deletion was never attempted, and the source was kept running.
|