@agentvault/agentvault 0.20.25 → 0.20.27
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/cli.js +20 -12
- package/dist/cli.js.map +2 -2
- package/dist/index.js +20 -12
- package/dist/index.js.map +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -62735,10 +62735,10 @@ async function hasPendingWelcome(dataDir2, groupId) {
|
|
|
62735
62735
|
return false;
|
|
62736
62736
|
}
|
|
62737
62737
|
}
|
|
62738
|
-
async function savePendingKpBundle(dataDir2, groupId, kp) {
|
|
62738
|
+
async function savePendingKpBundle(dataDir2, groupId, kp, serializePublicFn) {
|
|
62739
62739
|
await mkdir(dataDir2, { recursive: true, mode: DIR_MODE });
|
|
62740
62740
|
const serialized = {
|
|
62741
|
-
|
|
62741
|
+
publicPackageBytes: Buffer.from(serializePublicFn(kp.publicPackage)).toString("base64"),
|
|
62742
62742
|
privatePackage: {
|
|
62743
62743
|
initPrivateKey: Buffer.from(kp.privatePackage.initPrivateKey).toString("base64"),
|
|
62744
62744
|
hpkePrivateKey: Buffer.from(kp.privatePackage.hpkePrivateKey).toString("base64"),
|
|
@@ -62752,7 +62752,7 @@ async function loadPendingKpBundle(dataDir2, groupId) {
|
|
|
62752
62752
|
const raw = await readFile(pendingKpPath(dataDir2, groupId), "utf-8");
|
|
62753
62753
|
const parsed = JSON.parse(raw);
|
|
62754
62754
|
return {
|
|
62755
|
-
|
|
62755
|
+
publicPackageBytes: new Uint8Array(Buffer.from(parsed.publicPackageBytes, "base64")),
|
|
62756
62756
|
privatePackage: {
|
|
62757
62757
|
initPrivateKey: new Uint8Array(Buffer.from(parsed.privatePackage.initPrivateKey, "base64")),
|
|
62758
62758
|
hpkePrivateKey: new Uint8Array(Buffer.from(parsed.privatePackage.hpkePrivateKey, "base64")),
|
|
@@ -65281,12 +65281,11 @@ var init_channel = __esm({
|
|
|
65281
65281
|
console.log(`[SecureChannel] A2A ${chId.slice(0, 8)} sync fallback: skipping \u2014 Welcome already pending for group=${groupId.slice(0, 8)}`);
|
|
65282
65282
|
continue;
|
|
65283
65283
|
}
|
|
65284
|
-
await setPendingWelcome(this.config.dataDir, groupId);
|
|
65285
65284
|
const mgr = new MLSGroupManager();
|
|
65286
65285
|
const identity = new TextEncoder().encode(this._persisted.deviceId);
|
|
65287
65286
|
const kp = await mgr.generateKeyPackage(identity);
|
|
65288
65287
|
this._pendingMlsKpBundle = kp;
|
|
65289
|
-
await savePendingKpBundle(this.config.dataDir, groupId, kp);
|
|
65288
|
+
await savePendingKpBundle(this.config.dataDir, groupId, kp, MLSGroupManager.serializeKeyPackage);
|
|
65290
65289
|
const kpBytes = MLSGroupManager.serializeKeyPackage(kp.publicPackage);
|
|
65291
65290
|
await fetch(`${this.config.apiUrl}/api/v1/mls/key-packages`, {
|
|
65292
65291
|
method: "POST",
|
|
@@ -67150,17 +67149,26 @@ ${messageText}`;
|
|
|
67150
67149
|
async _handleMlsWelcome(data) {
|
|
67151
67150
|
const groupId = data.group_id;
|
|
67152
67151
|
const conversationId = data.conversation_id;
|
|
67153
|
-
const
|
|
67154
|
-
const kpSource = this._pendingMlsKpBundle ? "pending" : persistedKpAvailable ? "persisted" : this._mlsKeyPackage ? "connect" : "generated";
|
|
67152
|
+
const kpSource = this._pendingMlsKpBundle ? "pending" : this._mlsKeyPackage ? "connect" : await hasPendingWelcome(this.config.dataDir, groupId) ? "persisted" : "generated";
|
|
67155
67153
|
console.log(`[SecureChannel] Received MLS welcome for group ${groupId?.slice(0, 8)}${conversationId ? ` conv=${conversationId.slice(0, 8)}` : ""} kpSource=${kpSource}`);
|
|
67156
67154
|
try {
|
|
67157
67155
|
const welcomeBytes = new Uint8Array(Buffer.from(data.payload, "hex"));
|
|
67158
67156
|
const mgr = new MLSGroupManager();
|
|
67159
|
-
|
|
67160
|
-
|
|
67157
|
+
let kp = this._pendingMlsKpBundle ?? this._mlsKeyPackage;
|
|
67158
|
+
if (!kp) {
|
|
67159
|
+
const persisted = await loadPendingKpBundle(this.config.dataDir, groupId);
|
|
67160
|
+
if (persisted) {
|
|
67161
|
+
kp = {
|
|
67162
|
+
publicPackage: MLSGroupManager.deserializeKeyPackage(persisted.publicPackageBytes),
|
|
67163
|
+
privatePackage: persisted.privatePackage
|
|
67164
|
+
};
|
|
67165
|
+
console.log(`[SecureChannel] Loaded persisted KP bundle for group ${groupId?.slice(0, 8)}`);
|
|
67166
|
+
}
|
|
67167
|
+
}
|
|
67168
|
+
if (!kp) {
|
|
67161
67169
|
const identity = new TextEncoder().encode(this._deviceId);
|
|
67162
|
-
|
|
67163
|
-
}
|
|
67170
|
+
kp = await mgr.generateKeyPackage(identity);
|
|
67171
|
+
}
|
|
67164
67172
|
console.log(`[SecureChannel] Welcome joinFromWelcome: group=${groupId?.slice(0, 8)} kpSource=${kpSource} welcomeLen=${welcomeBytes.length}`);
|
|
67165
67173
|
await mgr.joinFromWelcome(welcomeBytes, kp);
|
|
67166
67174
|
if (conversationId) {
|
|
@@ -88964,7 +88972,7 @@ var init_index = __esm({
|
|
|
88964
88972
|
init_skill_invoker();
|
|
88965
88973
|
await init_skill_telemetry();
|
|
88966
88974
|
await init_policy_enforcer();
|
|
88967
|
-
VERSION = true ? "0.20.
|
|
88975
|
+
VERSION = true ? "0.20.27" : "0.0.0-dev";
|
|
88968
88976
|
}
|
|
88969
88977
|
});
|
|
88970
88978
|
|