@tangle-network/agent-provider-tangle 1.9.0 → 1.9.1
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/dist/tangle-events.d.ts +2 -3
- package/dist/tangle-events.js +11 -14
- package/package.json +2 -2
package/dist/tangle-events.d.ts
CHANGED
|
@@ -6,9 +6,8 @@ export declare function isSandboxConnectionMarker(event: SandboxEvent): boolean;
|
|
|
6
6
|
* The session ids a Sandbox event carries, kept separate by field position.
|
|
7
7
|
*
|
|
8
8
|
* `runFrameSessionId` is `data.sessionId`/`data.sessionID`. The run/stream lane
|
|
9
|
-
* copies
|
|
10
|
-
*
|
|
11
|
-
* runtime session id.
|
|
9
|
+
* copies the public resume key from the adapter on `session.updated`.
|
|
10
|
+
* That key can differ from the Runtime session and is not native identity evidence.
|
|
12
11
|
*
|
|
13
12
|
* `envelopeSessionId` is the `properties` and `properties.info` position of an
|
|
14
13
|
* /agents/events frame, plus `properties.part` on a frame type that publishes a
|
package/dist/tangle-events.js
CHANGED
|
@@ -138,17 +138,15 @@ export function environmentEventFromSandboxEvent(event, expected = {}) {
|
|
|
138
138
|
if (Object.prototype.hasOwnProperty.call(data, "contextTransferReceipt")) {
|
|
139
139
|
throw new Error("Tangle Sandbox emitted an unsolicited context transfer receipt");
|
|
140
140
|
}
|
|
141
|
-
// A
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// every position of every other frame type, names the runtime session and is
|
|
148
|
-
// compared to the expected id.
|
|
141
|
+
// A bound public stream can carry the adapter's resume key in session.updated.
|
|
142
|
+
// It is content, not evidence of provider-native identity or Runtime ownership.
|
|
143
|
+
// Envelope identities still bind the frame to the expected Runtime session.
|
|
144
|
+
if (record.type === "native.session.observed") {
|
|
145
|
+
throw new Error("Tangle public stream exposed a private native identity event");
|
|
146
|
+
}
|
|
149
147
|
const identity = sandboxEventIdentity(event);
|
|
150
|
-
const
|
|
151
|
-
const identityBearingSessionIds = carriedSessionIds(
|
|
148
|
+
const runFrameCarriesPublicResumeKey = expected.streamBound === true && record.type === "session.updated";
|
|
149
|
+
const identityBearingSessionIds = carriedSessionIds(runFrameCarriesPublicResumeKey
|
|
152
150
|
? { envelopeSessionId: identity.envelopeSessionId }
|
|
153
151
|
: identity);
|
|
154
152
|
if (expected.executionId !== undefined) {
|
|
@@ -180,8 +178,7 @@ export function environmentEventFromSandboxEvent(event, expected = {}) {
|
|
|
180
178
|
// Other event names do not prove whether their usage is incremental.
|
|
181
179
|
const usageMode = declaredModes[0] ??
|
|
182
180
|
(record.type === "result" || record.type === "done" ? "cumulative" : undefined);
|
|
183
|
-
//
|
|
184
|
-
// including the native id an execution-bound stream just accepted as content.
|
|
181
|
+
// Preserve the public resume key without promoting it to native attribution.
|
|
185
182
|
const normalized = normalizeSandboxEvent(record.type, data, identity);
|
|
186
183
|
return {
|
|
187
184
|
type: record.type,
|
|
@@ -210,8 +207,8 @@ function normalizeSandboxEvent(type, data, identity) {
|
|
|
210
207
|
// of the frame's own positions carries and introduces none of its own. Each
|
|
211
208
|
// position it can repeat is already bound: the check above compared every
|
|
212
209
|
// position that names the runtime session, and the run-frame position of a
|
|
213
|
-
// stream-bound `session.updated` holds the
|
|
214
|
-
// carries too. A frame that carries no session id can supply none either.
|
|
210
|
+
// stream-bound `session.updated` holds the public resume key the computed
|
|
211
|
+
// block carries too. A frame that carries no session id can supply none either.
|
|
215
212
|
if (parsed.data.type === "session.updated") {
|
|
216
213
|
if (!carriedSessionIds(identity).includes(parsed.data.sessionId)) {
|
|
217
214
|
throw new Error("Tangle Sandbox normalized event named a session the frame does not carry");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-provider-tangle",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "AgentEnvironmentProvider adapter for Tangle sandboxes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"LICENSE"
|
|
104
104
|
],
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@tangle-network/agent-interface": "^2.
|
|
106
|
+
"@tangle-network/agent-interface": "^2.15.0"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"@tangle-network/sandbox": ">=0.58.0 <1.0.0"
|