@agentvault/agentvault 0.20.10 → 0.20.11
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 +87 -85
- package/dist/cli.js.map +2 -2
- package/dist/index.js +87 -85
- package/dist/index.js.map +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67039,103 +67039,105 @@ ${messageText}`;
|
|
|
67039
67039
|
return;
|
|
67040
67040
|
}
|
|
67041
67041
|
const { messages } = await res.json();
|
|
67042
|
-
|
|
67043
|
-
|
|
67044
|
-
|
|
67045
|
-
|
|
67046
|
-
|
|
67047
|
-
|
|
67048
|
-
|
|
67049
|
-
|
|
67050
|
-
|
|
67051
|
-
|
|
67052
|
-
|
|
67053
|
-
|
|
67054
|
-
|
|
67055
|
-
|
|
67056
|
-
|
|
67057
|
-
|
|
67058
|
-
|
|
67059
|
-
|
|
67060
|
-
|
|
67061
|
-
sender_device_id: msg.sender_device_id,
|
|
67062
|
-
payload: msg.payload,
|
|
67063
|
-
room_id: msg.room_id,
|
|
67064
|
-
conversation_id: msg.conversation_id,
|
|
67065
|
-
a2a_channel_id: msg.a2a_channel_id
|
|
67066
|
-
});
|
|
67067
|
-
} else if (msg.message_type === "commit") {
|
|
67068
|
-
await this._handleMlsCommit({
|
|
67069
|
-
group_id: msg.group_id,
|
|
67070
|
-
sender_device_id: msg.sender_device_id,
|
|
67071
|
-
epoch: msg.epoch,
|
|
67072
|
-
payload: msg.payload
|
|
67073
|
-
});
|
|
67074
|
-
} else if (msg.message_type === "application") {
|
|
67075
|
-
if (msg.room_id) {
|
|
67076
|
-
await this._handleRoomMessageMLS({
|
|
67077
|
-
message_id: msg.message_id,
|
|
67042
|
+
const hasMessages = messages && messages.length > 0;
|
|
67043
|
+
if (hasMessages) {
|
|
67044
|
+
const order = { welcome: 0, commit: 1, application: 2 };
|
|
67045
|
+
messages.sort((a2, b2) => {
|
|
67046
|
+
const ao = order[a2.message_type] ?? 2;
|
|
67047
|
+
const bo = order[b2.message_type] ?? 2;
|
|
67048
|
+
if (ao !== bo) return ao - bo;
|
|
67049
|
+
return new Date(a2.created_at).getTime() - new Date(b2.created_at).getTime();
|
|
67050
|
+
});
|
|
67051
|
+
const ackedIds = [];
|
|
67052
|
+
const nackedIds = [];
|
|
67053
|
+
for (const msg of messages) {
|
|
67054
|
+
try {
|
|
67055
|
+
if (msg.sender_device_id === this._deviceId) {
|
|
67056
|
+
ackedIds.push(msg.queue_id);
|
|
67057
|
+
continue;
|
|
67058
|
+
}
|
|
67059
|
+
if (msg.message_type === "welcome") {
|
|
67060
|
+
await this._handleMlsWelcome({
|
|
67078
67061
|
group_id: msg.group_id,
|
|
67079
67062
|
sender_device_id: msg.sender_device_id,
|
|
67080
|
-
epoch: msg.epoch,
|
|
67081
67063
|
payload: msg.payload,
|
|
67082
67064
|
room_id: msg.room_id,
|
|
67083
|
-
|
|
67084
|
-
|
|
67085
|
-
} else if (msg.a2a_channel_id) {
|
|
67086
|
-
await this._handleA2AMessageMLS({
|
|
67087
|
-
message_id: msg.message_id,
|
|
67088
|
-
group_id: msg.group_id,
|
|
67089
|
-
sender_device_id: msg.sender_device_id,
|
|
67090
|
-
epoch: msg.epoch,
|
|
67091
|
-
payload: msg.payload,
|
|
67092
|
-
a2a_channel_id: msg.a2a_channel_id,
|
|
67093
|
-
created_at: msg.created_at
|
|
67065
|
+
conversation_id: msg.conversation_id,
|
|
67066
|
+
a2a_channel_id: msg.a2a_channel_id
|
|
67094
67067
|
});
|
|
67095
|
-
} else if (msg.
|
|
67096
|
-
await this.
|
|
67097
|
-
message_id: msg.message_id,
|
|
67068
|
+
} else if (msg.message_type === "commit") {
|
|
67069
|
+
await this._handleMlsCommit({
|
|
67098
67070
|
group_id: msg.group_id,
|
|
67099
67071
|
sender_device_id: msg.sender_device_id,
|
|
67100
67072
|
epoch: msg.epoch,
|
|
67101
|
-
payload: msg.payload
|
|
67102
|
-
conversation_id: msg.conversation_id,
|
|
67103
|
-
created_at: msg.created_at
|
|
67073
|
+
payload: msg.payload
|
|
67104
67074
|
});
|
|
67075
|
+
} else if (msg.message_type === "application") {
|
|
67076
|
+
if (msg.room_id) {
|
|
67077
|
+
await this._handleRoomMessageMLS({
|
|
67078
|
+
message_id: msg.message_id,
|
|
67079
|
+
group_id: msg.group_id,
|
|
67080
|
+
sender_device_id: msg.sender_device_id,
|
|
67081
|
+
epoch: msg.epoch,
|
|
67082
|
+
payload: msg.payload,
|
|
67083
|
+
room_id: msg.room_id,
|
|
67084
|
+
created_at: msg.created_at
|
|
67085
|
+
});
|
|
67086
|
+
} else if (msg.a2a_channel_id) {
|
|
67087
|
+
await this._handleA2AMessageMLS({
|
|
67088
|
+
message_id: msg.message_id,
|
|
67089
|
+
group_id: msg.group_id,
|
|
67090
|
+
sender_device_id: msg.sender_device_id,
|
|
67091
|
+
epoch: msg.epoch,
|
|
67092
|
+
payload: msg.payload,
|
|
67093
|
+
a2a_channel_id: msg.a2a_channel_id,
|
|
67094
|
+
created_at: msg.created_at
|
|
67095
|
+
});
|
|
67096
|
+
} else if (msg.conversation_id) {
|
|
67097
|
+
await this._handleMessageMLS({
|
|
67098
|
+
message_id: msg.message_id,
|
|
67099
|
+
group_id: msg.group_id,
|
|
67100
|
+
sender_device_id: msg.sender_device_id,
|
|
67101
|
+
epoch: msg.epoch,
|
|
67102
|
+
payload: msg.payload,
|
|
67103
|
+
conversation_id: msg.conversation_id,
|
|
67104
|
+
created_at: msg.created_at
|
|
67105
|
+
});
|
|
67106
|
+
}
|
|
67105
67107
|
}
|
|
67108
|
+
ackedIds.push(msg.queue_id);
|
|
67109
|
+
} catch (err) {
|
|
67110
|
+
console.warn(`[SecureChannel] Delivery ${msg.message_type} processing failed:`, err);
|
|
67111
|
+
nackedIds.push(msg.queue_id);
|
|
67106
67112
|
}
|
|
67107
|
-
ackedIds.push(msg.queue_id);
|
|
67108
|
-
} catch (err) {
|
|
67109
|
-
console.warn(`[SecureChannel] Delivery ${msg.message_type} processing failed:`, err);
|
|
67110
|
-
nackedIds.push(msg.queue_id);
|
|
67111
67113
|
}
|
|
67112
|
-
|
|
67113
|
-
|
|
67114
|
-
|
|
67115
|
-
|
|
67116
|
-
|
|
67117
|
-
|
|
67118
|
-
|
|
67119
|
-
|
|
67120
|
-
|
|
67121
|
-
|
|
67122
|
-
}
|
|
67123
|
-
|
|
67114
|
+
if (nackedIds.length > 0) {
|
|
67115
|
+
try {
|
|
67116
|
+
await fetch(`${this.config.apiUrl}/api/v1/mls/delivery/nack`, {
|
|
67117
|
+
method: "POST",
|
|
67118
|
+
headers: {
|
|
67119
|
+
Authorization: `Bearer ${this._deviceJwt}`,
|
|
67120
|
+
"Content-Type": "application/json"
|
|
67121
|
+
},
|
|
67122
|
+
body: JSON.stringify({ queue_ids: nackedIds })
|
|
67123
|
+
});
|
|
67124
|
+
} catch {
|
|
67125
|
+
}
|
|
67124
67126
|
}
|
|
67125
|
-
|
|
67126
|
-
|
|
67127
|
-
|
|
67128
|
-
|
|
67129
|
-
|
|
67130
|
-
|
|
67131
|
-
|
|
67132
|
-
|
|
67133
|
-
|
|
67134
|
-
|
|
67135
|
-
|
|
67136
|
-
|
|
67137
|
-
|
|
67138
|
-
|
|
67127
|
+
if (ackedIds.length > 0) {
|
|
67128
|
+
try {
|
|
67129
|
+
await fetch(`${this.config.apiUrl}/api/v1/mls/delivery/ack`, {
|
|
67130
|
+
method: "POST",
|
|
67131
|
+
headers: {
|
|
67132
|
+
Authorization: `Bearer ${this._deviceJwt}`,
|
|
67133
|
+
"Content-Type": "application/json"
|
|
67134
|
+
},
|
|
67135
|
+
body: JSON.stringify({ queue_ids: ackedIds, device_id: this._deviceId })
|
|
67136
|
+
});
|
|
67137
|
+
console.log(`[SecureChannel] Delivery acked ${ackedIds.length}/${messages.length}`);
|
|
67138
|
+
} catch (ackErr) {
|
|
67139
|
+
console.warn("[SecureChannel] Delivery ack failed:", ackErr);
|
|
67140
|
+
}
|
|
67139
67141
|
}
|
|
67140
67142
|
}
|
|
67141
67143
|
for (const [roomId, mlsGroup] of this._mlsGroups) {
|
|
@@ -94550,7 +94552,7 @@ var init_index = __esm({
|
|
|
94550
94552
|
init_skill_invoker();
|
|
94551
94553
|
await init_skill_telemetry();
|
|
94552
94554
|
await init_policy_enforcer();
|
|
94553
|
-
VERSION = true ? "0.20.
|
|
94555
|
+
VERSION = true ? "0.20.11" : "0.0.0-dev";
|
|
94554
94556
|
}
|
|
94555
94557
|
});
|
|
94556
94558
|
await init_index();
|