@tangle-network/agent-provider-tangle 1.1.3 → 1.1.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 -1
- package/dist/tangle-interactive.js +7 -14
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @tangle-network/agent-provider-tangle
|
|
2
2
|
|
|
3
3
|
Wraps `@tangle-network/sandbox` as an `AgentEnvironmentProvider`.
|
|
4
|
-
The peer range is `>=0.34.6 <1.0.0`, and this package is developed and tested against 0.
|
|
4
|
+
The peer range is `>=0.34.6 <1.0.0`, and this package is developed and tested against 0.37.0.
|
|
5
5
|
The floor is 0.34.6 because exact interactive attachment needs the host receiver, and workspace branching needs keyed snapshots, durable restores, inventory recovery, and cleanup.
|
|
6
6
|
The provider fails closed when the configured backend or its catalog entry cannot be read.
|
|
7
7
|
Newer SDKs may also provide `getBackend()` as a lookup over the same catalog.
|
|
@@ -119,6 +119,7 @@ Each deployment flag this adapter reads gates the claims it backs, and no flag i
|
|
|
119
119
|
| `runs.eventReplay` | `streaming.replay`, `sessions.continue`, `retainedControl`, `session.cancelRun` |
|
|
120
120
|
| `runs.executionScopedStatus` | `sessions.continue`, `retainedControl`, `session.cancelRun` |
|
|
121
121
|
| `interactions.responseDedupe` | `interactions`, `environment.respondToInteraction`, `session.respondToInteraction` |
|
|
122
|
+
| `interactiveAgent.*` | `interactiveAgent`, exact control, and generation-fenced terminal input and resize |
|
|
122
123
|
|
|
123
124
|
Detached dispatch carries the caller's exact reference and refuses a receipt that does not name the execution back, so it needs both `dispatch` flags and a session handle to reach the run through.
|
|
124
125
|
`sessions.continue`, `retainedControl`, and `session.cancelRun` need every flag in the table, because the capability schema refuses a partial retained-control block and each identity rests on its own flag.
|
|
@@ -333,6 +334,11 @@ Every reference states an expiry one detach window past the newest activity the
|
|
|
333
334
|
`close()` reports `closed` only when the socket delivered an exit; Sandbox exposes no terminal delete, so an unproven close reports `unknown` rather than claiming a termination that did not happen.
|
|
334
335
|
An attach whose runtime metadata lacks a name, shell, working directory, geometry, timestamps, running state, or detach window fails closed with `unknown`, because a reference cannot state facts the runtime did not report.
|
|
335
336
|
|
|
337
|
+
The exact interactive adapter validates control before attach, prompt, and stop operations.
|
|
338
|
+
An attached terminal sends input and resize operations through its authenticated terminal connection.
|
|
339
|
+
The sidecar authorizes those mutations, so the provider does not add a second REST request before each operation.
|
|
340
|
+
Terminal close only detaches the caller's socket, so it stays available after control moves to a newer coordinator.
|
|
341
|
+
|
|
336
342
|
Pass `exactProcess: {}` only when the Sandbox deployment supports `agent: false` creates and reports `metadata.runtimeMode: "control"`.
|
|
337
343
|
The optional capability creates an ephemeral sandbox with an authenticated control service but no managed agent workload or agent credentials, explicit resources, exact blocked/domain egress, bounded binary file reads, shell-free launch, and recoverable process output plus terminal reason.
|
|
338
344
|
Set `teamId` inside `exactProcess` to scope create, lookup, and recovery to one team.
|
|
@@ -186,7 +186,7 @@ export function createTangleInteractiveAgentRegistry(box, providerName, environm
|
|
|
186
186
|
await terminal.detach().catch(() => undefined);
|
|
187
187
|
throw error;
|
|
188
188
|
}
|
|
189
|
-
return validatedTerminal(terminal, exactRequest.control,
|
|
189
|
+
return validatedTerminal(terminal, exactRequest.control, ref);
|
|
190
190
|
},
|
|
191
191
|
async sendPrompt(command, options) {
|
|
192
192
|
assertOptionKeys(options, ["signal"], "Tangle interactive agent prompt");
|
|
@@ -246,7 +246,7 @@ function isSandboxInteractiveSession(value) {
|
|
|
246
246
|
"stop",
|
|
247
247
|
].every((key) => typeof candidate[key] === "function");
|
|
248
248
|
}
|
|
249
|
-
function validatedTerminal(terminal, control,
|
|
249
|
+
function validatedTerminal(terminal, control, expectedRef) {
|
|
250
250
|
const boundControl = Object.freeze({ ...control });
|
|
251
251
|
return {
|
|
252
252
|
get ref() {
|
|
@@ -261,19 +261,12 @@ function validatedTerminal(terminal, control, validate, expectedRef) {
|
|
|
261
261
|
return TerminalReplayWindowSchema.parse(terminal.cursors);
|
|
262
262
|
},
|
|
263
263
|
control: boundControl,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
async resize(resize, options) {
|
|
269
|
-
await validate(boundControl, options);
|
|
270
|
-
await terminal.resize(resize, options);
|
|
271
|
-
},
|
|
264
|
+
// The authenticated terminal transport authorizes input and resize.
|
|
265
|
+
// A REST preflight adds latency and can race the authoritative operation.
|
|
266
|
+
input: (input, options) => terminal.input(input, options),
|
|
267
|
+
resize: (resize, options) => terminal.resize(resize, options),
|
|
272
268
|
detach: (options) => terminal.detach(options),
|
|
273
|
-
|
|
274
|
-
await validate(boundControl, options);
|
|
275
|
-
return terminal.close(options);
|
|
276
|
-
},
|
|
269
|
+
close: (options) => terminal.close(options),
|
|
277
270
|
events: (options) => terminal.events(options),
|
|
278
271
|
};
|
|
279
272
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-provider-tangle",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "AgentEnvironmentProvider adapter for Tangle sandboxes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -102,13 +102,13 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
|
-
"@tangle-network/agent-eval": "0.173.
|
|
106
|
-
"@tangle-network/agent-runtime": "0.
|
|
107
|
-
"@tangle-network/sandbox": "0.
|
|
108
|
-
"@types/node": "26.4.
|
|
105
|
+
"@tangle-network/agent-eval": "0.173.1",
|
|
106
|
+
"@tangle-network/agent-runtime": "0.192.2",
|
|
107
|
+
"@tangle-network/sandbox": "0.37.0",
|
|
108
|
+
"@types/node": "26.4.1",
|
|
109
109
|
"typescript": "7.0.2",
|
|
110
110
|
"vitest": "4.1.11",
|
|
111
|
-
"@tangle-network/agent-provider-testkit": "0.9.
|
|
111
|
+
"@tangle-network/agent-provider-testkit": "0.9.2"
|
|
112
112
|
},
|
|
113
113
|
"scripts": {
|
|
114
114
|
"build": "tsc -p tsconfig.json",
|