@tangle-network/agent-provider-tangle 0.12.0 → 0.12.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentInteractiveSessionAttachSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimRequestSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionPromptCommandSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentInteractiveSessionStopCommandSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionStopAcknowledgementMatchesCommand, exactAgentInteractiveSessionStart, } from "@tangle-network/agent-interface";
|
|
1
|
+
import { AgentInteractiveSessionAttachSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimRequestSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionPromptCommandSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentInteractiveSessionStopCommandSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionStopAcknowledgementMatchesCommand, canonicalCandidateDigest, exactAgentInteractiveSessionStart, } from "@tangle-network/agent-interface";
|
|
2
2
|
import { parseBackendType } from "@tangle-network/sandbox";
|
|
3
3
|
import { assertOptionKeys } from "./tangle-environment-validation.js";
|
|
4
4
|
import { transportFailureReason } from "./tangle-failure-reason.js";
|
|
@@ -46,10 +46,7 @@ export function createTangleInteractiveAgentRegistry(box, providerName, environm
|
|
|
46
46
|
return ref;
|
|
47
47
|
};
|
|
48
48
|
const assertRef = (expected, candidate) => {
|
|
49
|
-
if (expected
|
|
50
|
-
expected.run.requestDigest !== candidate.run.requestDigest ||
|
|
51
|
-
expected.incarnationId !== candidate.incarnationId ||
|
|
52
|
-
expected.preparationReceipt.digest !== candidate.preparationReceipt.digest) {
|
|
49
|
+
if (!sameExactSessionRef(expected, candidate)) {
|
|
53
50
|
throw new Error("the Sandbox returned a different interactive session ref");
|
|
54
51
|
}
|
|
55
52
|
};
|
|
@@ -297,14 +294,13 @@ function statusFromSandbox(ref, observed) {
|
|
|
297
294
|
});
|
|
298
295
|
}
|
|
299
296
|
const observedRef = AgentInteractiveSessionRefSchema.parse({
|
|
300
|
-
run: ref.run,
|
|
297
|
+
run: { ...ref.run, sessionId: observed.sessionId },
|
|
301
298
|
preparationReceipt: observed.preparationReceipt,
|
|
302
299
|
incarnationId: observed.incarnationId,
|
|
303
300
|
startedAt: observed.startedAt,
|
|
304
301
|
});
|
|
305
|
-
if (observed.
|
|
306
|
-
|
|
307
|
-
observedRef.preparationReceipt.digest !== ref.preparationReceipt.digest) {
|
|
302
|
+
if (observed.harness !== ref.preparationReceipt.harness ||
|
|
303
|
+
!sameExactSessionRef(ref, observedRef)) {
|
|
308
304
|
throw new Error("the Sandbox reported a different interactive agent session identity");
|
|
309
305
|
}
|
|
310
306
|
if (observed.state === "running") {
|
|
@@ -326,3 +322,6 @@ function statusFromSandbox(ref, observed) {
|
|
|
326
322
|
: {}),
|
|
327
323
|
});
|
|
328
324
|
}
|
|
325
|
+
function sameExactSessionRef(expected, candidate) {
|
|
326
|
+
return canonicalCandidateDigest(expected) === canonicalCandidateDigest(candidate);
|
|
327
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-provider-tangle",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "AgentEnvironmentProvider adapter for Tangle sandboxes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"LICENSE"
|
|
86
86
|
],
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@tangle-network/agent-interface": "0.
|
|
88
|
+
"@tangle-network/agent-interface": "^1.0.0"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"@tangle-network/sandbox": ">=0.23.0 <1.0.0"
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@types/node": "25.6.0",
|
|
103
103
|
"typescript": "^6.0.3",
|
|
104
104
|
"vitest": "^4.1.5",
|
|
105
|
-
"@tangle-network/agent-provider-testkit": "0.8.
|
|
105
|
+
"@tangle-network/agent-provider-testkit": "0.8.2"
|
|
106
106
|
},
|
|
107
107
|
"scripts": {
|
|
108
108
|
"build": "tsc -p tsconfig.json",
|