@tangle-network/agent-provider-tangle 3.6.12 → 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 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-dev-container#9388).
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-dev-container apps/sidecar/src/routes/agents-events.ts). A frame with no
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
- await output.sync();
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 {};
@@ -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 };
@@ -46,6 +46,12 @@ export function createTangleProvider(options) {
46
46
  ? await options.capabilities()
47
47
  : options.capabilities
48
48
  : defaultTangleSandboxCapabilities(harness.success ? harness.data : undefined);
49
+ if (configured.create?.workspaceSnapshot === true) {
50
+ throw new Error("Tangle provider does not support portable workspace snapshots in this receiver deployment");
51
+ }
52
+ if (configured.contextTransfer?.attach === true) {
53
+ throw new Error("Tangle context transfer attachment is not qualified by this receiver deployment");
54
+ }
49
55
  if (!exactProcess && configured.exactProcess) {
50
56
  throw new Error("Tangle capabilities cannot advertise exactProcess without exactProcess configuration");
51
57
  }
@@ -66,6 +72,9 @@ export function createTangleProvider(options) {
66
72
  const resolveCapabilities = async () => narrowedProviderCapabilities(await resolveDeclaredCapabilities(options.defaultBackend));
67
73
  const createRecords = new Map();
68
74
  const createEnvironment = async (input) => {
75
+ if (input.workspace?.snapshot !== undefined) {
76
+ throw new Error("Tangle provider does not support portable workspace snapshots in this receiver deployment");
77
+ }
69
78
  const parsedWorkspace = assertCreateInputShape(input);
70
79
  input.signal?.throwIfAborted();
71
80
  assertNoInlineSecretValues(input, parsedWorkspace);
@@ -297,6 +306,9 @@ export function createTangleProvider(options) {
297
306
  ...(options.client.get
298
307
  ? {
299
308
  async get(id, operation) {
309
+ if (operation?.contextTransfer !== undefined) {
310
+ throw new Error("Tangle context transfer attachment is not qualified by this receiver deployment");
311
+ }
300
312
  assertProviderOperationOptions(operation, "Tangle get");
301
313
  boundedIdentifier(id, "Tangle environment id");
302
314
  await resolveCapabilities();
@@ -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-dev-container `packages/sdk-provider-opencode/src/cli-events.ts`)
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-dev-container#9388). The
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-provider-tangle",
3
- "version": "3.6.12",
3
+ "version": "4.1.0",
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": "^4.0.0"
131
+ "@tangle-network/agent-interface": "^5.0.0"
132
132
  },
133
133
  "peerDependencies": {
134
134
  "@tangle-network/sandbox": ">=0.60.27 <1.0.0"
@@ -139,7 +139,7 @@
139
139
  }
140
140
  },
141
141
  "devDependencies": {
142
- "@tangle-network/agent-provider-testkit": "0.11.0",
142
+ "@tangle-network/agent-provider-testkit": "0.12.0",
143
143
  "@tangle-network/agent-runtime": "0.292.3",
144
144
  "@tangle-network/sandbox": "0.60.27",
145
145
  "@types/node": "26.6.3",