@agentvault/agentvault 0.20.1 → 0.20.3
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/channel.d.ts.map +1 -1
- package/dist/cli.js +77 -23
- package/dist/cli.js.map +2 -2
- package/dist/index.js +77 -23
- package/dist/index.js.map +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -65758,30 +65758,27 @@ var init_channel = __esm({
|
|
|
65758
65758
|
}
|
|
65759
65759
|
} else if (this._persisted && convId && channelId && role === "member") {
|
|
65760
65760
|
try {
|
|
65761
|
-
const
|
|
65762
|
-
|
|
65763
|
-
|
|
65764
|
-
|
|
65765
|
-
|
|
65766
|
-
|
|
65767
|
-
|
|
65768
|
-
|
|
65769
|
-
|
|
65770
|
-
|
|
65761
|
+
const mgr = new MLSGroupManager();
|
|
65762
|
+
const identity = new TextEncoder().encode(this._persisted.deviceId);
|
|
65763
|
+
const kp = await mgr.generateKeyPackage(identity);
|
|
65764
|
+
this._pendingMlsKpBundle = kp;
|
|
65765
|
+
const kpBytes = MLSGroupManager.serializeKeyPackage(kp.publicPackage);
|
|
65766
|
+
await fetch(`${this.config.apiUrl}/api/v1/mls/key-packages`, {
|
|
65767
|
+
method: "POST",
|
|
65768
|
+
headers: {
|
|
65769
|
+
Authorization: `Bearer ${this._deviceJwt}`,
|
|
65770
|
+
"Content-Type": "application/json"
|
|
65771
|
+
},
|
|
65772
|
+
body: JSON.stringify({
|
|
65773
|
+
key_package: Buffer.from(kpBytes).toString("hex"),
|
|
65774
|
+
device_id: this._persisted.deviceId
|
|
65775
|
+
})
|
|
65776
|
+
});
|
|
65777
|
+
console.log(
|
|
65778
|
+
`[SecureChannel] A2A ${channelId.slice(0, 8)} member published KeyPackage, awaiting Welcome from creator`
|
|
65771
65779
|
);
|
|
65772
|
-
if (mlsInitRes.ok) {
|
|
65773
|
-
const mlsData = await mlsInitRes.json();
|
|
65774
|
-
const entry = this._persisted.a2aChannels?.[channelId];
|
|
65775
|
-
if (entry) {
|
|
65776
|
-
entry.mlsGroupId = mlsData.group_id;
|
|
65777
|
-
await this._persistState();
|
|
65778
|
-
console.log(
|
|
65779
|
-
`[SecureChannel] A2A ${channelId.slice(0, 8)} MLS registered as member (groupId=${mlsData.group_id.slice(0, 8)}, awaiting Welcome)`
|
|
65780
|
-
);
|
|
65781
|
-
}
|
|
65782
|
-
}
|
|
65783
65780
|
} catch (err) {
|
|
65784
|
-
console.warn(`[SecureChannel] A2A
|
|
65781
|
+
console.warn(`[SecureChannel] A2A member KeyPackage publish failed (non-fatal):`, err);
|
|
65785
65782
|
}
|
|
65786
65783
|
}
|
|
65787
65784
|
}
|
|
@@ -67197,6 +67194,63 @@ ${messageText}`;
|
|
|
67197
67194
|
} catch {
|
|
67198
67195
|
}
|
|
67199
67196
|
}
|
|
67197
|
+
for (const [chId, chState] of Object.entries(this._persisted?.a2aChannels ?? {})) {
|
|
67198
|
+
if (!chState.mlsGroupId) continue;
|
|
67199
|
+
const mlsGroup = this._mlsGroups.get(`a2a:${chId}`);
|
|
67200
|
+
if (!mlsGroup?.isInitialized) continue;
|
|
67201
|
+
try {
|
|
67202
|
+
const pendingRes = await fetch(
|
|
67203
|
+
`${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/pending-welcomes`,
|
|
67204
|
+
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
67205
|
+
);
|
|
67206
|
+
if (!pendingRes.ok) continue;
|
|
67207
|
+
const pending = await pendingRes.json();
|
|
67208
|
+
if (pending.length === 0) continue;
|
|
67209
|
+
console.log(`[SecureChannel] ${pending.length} pending A2A Welcome requests for channel ${chId.slice(0, 8)}`);
|
|
67210
|
+
for (const req of pending) {
|
|
67211
|
+
try {
|
|
67212
|
+
const kpRes = await fetch(
|
|
67213
|
+
`${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${req.requesting_device_id}`,
|
|
67214
|
+
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
67215
|
+
);
|
|
67216
|
+
if (!kpRes.ok) continue;
|
|
67217
|
+
const kpArr = await kpRes.json();
|
|
67218
|
+
if (kpArr.length === 0) continue;
|
|
67219
|
+
const kpBytes = new Uint8Array(Buffer.from(kpArr[0].key_package, "hex"));
|
|
67220
|
+
const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
|
|
67221
|
+
const { commit, welcome } = await mlsGroup.addMembers([memberKp]);
|
|
67222
|
+
if (welcome && this._ws) {
|
|
67223
|
+
this._ws.send(JSON.stringify({
|
|
67224
|
+
event: "mls_commit",
|
|
67225
|
+
data: { group_id: chState.mlsGroupId, epoch: Number(mlsGroup.epoch), payload: Buffer.from(commit).toString("hex") }
|
|
67226
|
+
}));
|
|
67227
|
+
this._ws.send(JSON.stringify({
|
|
67228
|
+
event: "mls_welcome",
|
|
67229
|
+
data: {
|
|
67230
|
+
target_device_id: req.requesting_device_id,
|
|
67231
|
+
group_id: chState.mlsGroupId,
|
|
67232
|
+
a2a_channel_id: chId,
|
|
67233
|
+
payload: Buffer.from(welcome).toString("hex")
|
|
67234
|
+
}
|
|
67235
|
+
}));
|
|
67236
|
+
}
|
|
67237
|
+
await fetch(
|
|
67238
|
+
`${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/fulfill-welcome`,
|
|
67239
|
+
{
|
|
67240
|
+
method: "POST",
|
|
67241
|
+
headers: { Authorization: `Bearer ${this._deviceJwt}`, "Content-Type": "application/json" },
|
|
67242
|
+
body: JSON.stringify({ request_id: req.id })
|
|
67243
|
+
}
|
|
67244
|
+
);
|
|
67245
|
+
await saveMlsState(this.config.dataDir, chState.mlsGroupId, JSON.stringify(mlsGroup.exportState()));
|
|
67246
|
+
console.log(`[SecureChannel] Fulfilled A2A Welcome for ${req.requesting_device_id.slice(0, 8)} in channel ${chId.slice(0, 8)}`);
|
|
67247
|
+
} catch (fulfillErr) {
|
|
67248
|
+
console.warn(`[SecureChannel] A2A Welcome fulfill failed:`, fulfillErr);
|
|
67249
|
+
}
|
|
67250
|
+
}
|
|
67251
|
+
} catch {
|
|
67252
|
+
}
|
|
67253
|
+
}
|
|
67200
67254
|
} catch (err) {
|
|
67201
67255
|
console.warn("[SecureChannel] Delivery pull error:", err);
|
|
67202
67256
|
} finally {
|
|
@@ -94434,7 +94488,7 @@ var init_index = __esm({
|
|
|
94434
94488
|
init_skill_invoker();
|
|
94435
94489
|
await init_skill_telemetry();
|
|
94436
94490
|
await init_policy_enforcer();
|
|
94437
|
-
VERSION = true ? "0.20.
|
|
94491
|
+
VERSION = true ? "0.20.3" : "0.0.0-dev";
|
|
94438
94492
|
}
|
|
94439
94493
|
});
|
|
94440
94494
|
await init_index();
|