@tangle-network/agent-provider-tangle 0.8.0 → 0.9.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 -0
- package/dist/tangle-environment.js +12 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,6 +15,8 @@ const provider = createTangleProvider({
|
|
|
15
15
|
|
|
16
16
|
Detached dispatch returns the immutable Sandbox execution receipt in `controlRef`.
|
|
17
17
|
The adapter validates its complete capability document and omits optional environment methods whose capabilities are disabled.
|
|
18
|
+
Created and reconstructed environments expose a recursively frozen Sandbox metadata snapshot for constant-time annotation checks.
|
|
19
|
+
Sandbox metadata can include caller-authored values and does not authenticate its author.
|
|
18
20
|
Reconstruct an exact session with `environment.session(reference.id, { controlRef: reference.controlRef })`; replay cursors are exclusive at both the agent interface and Sandbox session stream.
|
|
19
21
|
Result, replay, and cancel operations select that exact execution instead of whichever execution most recently changed the shared session.
|
|
20
22
|
Session status with an exact control reference reports a state only when the payload names that execution; a payload bound to a different or unnamed execution reports `unknown`.
|
|
@@ -60,6 +60,7 @@ export async function sandboxInstanceAsEnvironment(box, providerName, client, de
|
|
|
60
60
|
id: environmentId,
|
|
61
61
|
provider: providerName,
|
|
62
62
|
...(box.name ? { name: boundedString(box.name, "Tangle environment name") } : {}),
|
|
63
|
+
...(box.metadata ? { metadata: snapshotMetadata(box.metadata) } : {}),
|
|
63
64
|
capabilities,
|
|
64
65
|
async status(options) {
|
|
65
66
|
assertOptionKeys(options, ["signal"], "Tangle environment status");
|
|
@@ -212,3 +213,14 @@ export async function sandboxInstanceAsEnvironment(box, providerName, client, de
|
|
|
212
213
|
: {}),
|
|
213
214
|
};
|
|
214
215
|
}
|
|
216
|
+
function snapshotMetadata(metadata) {
|
|
217
|
+
return deepFreeze(structuredClone(metadata));
|
|
218
|
+
}
|
|
219
|
+
function deepFreeze(value, seen = new Set()) {
|
|
220
|
+
if (value === null || typeof value !== "object" || seen.has(value))
|
|
221
|
+
return value;
|
|
222
|
+
seen.add(value);
|
|
223
|
+
for (const child of Object.values(value))
|
|
224
|
+
deepFreeze(child, seen);
|
|
225
|
+
return Object.freeze(value);
|
|
226
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-provider-tangle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "AgentEnvironmentProvider adapter for Tangle sandboxes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"LICENSE"
|
|
70
70
|
],
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@tangle-network/agent-interface": "0.
|
|
72
|
+
"@tangle-network/agent-interface": "0.51.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@tangle-network/sandbox": ">=0.19.6 <1.0.0"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/node": "25.6.0",
|
|
87
87
|
"typescript": "^6.0.3",
|
|
88
88
|
"vitest": "^4.1.5",
|
|
89
|
-
"@tangle-network/agent-provider-testkit": "0.7.
|
|
89
|
+
"@tangle-network/agent-provider-testkit": "0.7.1"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"build": "tsc -p tsconfig.json",
|