@agentvault/muse-bridge 0.1.46 → 0.1.47

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/bridge.d.ts CHANGED
@@ -18,6 +18,10 @@ export interface RoomMessage {
18
18
  /** #1800 PR D: `true` for a sender that is not BOUND (`roomSenderView`), so
19
19
  * the room protocol never treats an unverified sender as a known human. */
20
20
  senderIsAgent?: boolean;
21
+ /** #1855 — SecureChannel's binding verdict for this frame, as emitted. Handed
22
+ * to owesRoomReply (9th argument), which refuses @all unless it is "bound";
23
+ * absent (a RoomMessage built without it) reads as unverified there. */
24
+ senderBinding?: unknown;
21
25
  /** #1574 — SecureChannel: the room's audience, "private_pair" or "group".
22
26
  * Passed through to owesRoomReply untyped; anything but "private_pair"
23
27
  * (absent on emitters before #1574) reads as a group room. */
package/dist/index.js CHANGED
@@ -278,7 +278,8 @@ function resolveOwn(mention, names) {
278
278
  }
279
279
  return null;
280
280
  }
281
- function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience) {
281
+ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience, senderBinding) {
282
+ if (senderBinding !== void 0 && senderBinding !== "bound") senderIsAgent = true;
282
283
  if (isPrivatePairHumanMessage(senderIsAgent, roomAudience)) return true;
283
284
  const mentions = parseMentions(plaintext);
284
285
  if (senderIsAgent === false && namesAgentPlainly(plaintext, agentName, roomDisplayName, ownDisplayName)) {
@@ -288,7 +289,7 @@ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDispl
288
289
  const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
289
290
  if (mentions.some((m2) => resolveOwn(m2, ownNames) !== null)) return true;
290
291
  if (mentions.some((m2) => resolveOwn(m2, BROADCAST_NAMES) !== null)) {
291
- return senderIsAgent !== true;
292
+ return senderBinding === "bound" && senderIsAgent !== true;
292
293
  }
293
294
  if (!selfResolved) return true;
294
295
  return false;
@@ -13186,11 +13187,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
13186
13187
  return null;
13187
13188
  }
13188
13189
  function ownIdentity() {
13189
- const v2 = true ? "0.23.72" : FALLBACK;
13190
+ const v2 = true ? "0.23.73" : FALLBACK;
13190
13191
  return `${PACKAGE}@${v2}`;
13191
13192
  }
13192
13193
  function buildSha() {
13193
- const raw = true ? "b70dedb" : "";
13194
+ const raw = true ? "cb8786f" : "";
13194
13195
  const cleaned = (raw ?? "").trim();
13195
13196
  return !cleaned || cleaned === "unknown" ? null : cleaned;
13196
13197
  }
@@ -16194,6 +16195,15 @@ function getActiveChannel(accountId = "default") {
16194
16195
  async function _handleInbound(params) {
16195
16196
  const { plaintext, metadata, channel, account, cfg, fileTurn } = params;
16196
16197
  const core = _ocRuntime;
16198
+ if (metadata.roomId && metadata.senderBinding !== "bound") {
16199
+ const ownDisplayName = channel.ownDisplayName ?? "";
16200
+ const agentName = account.agentName ?? "";
16201
+ const selfResolved = !!ownDisplayName || !!agentName && agentName.toLowerCase() !== "default";
16202
+ if (!owesRoomReply(metadata.caption ?? plaintext, agentName, account.accountId ?? "", true, void 0, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
16203
+ console.log(`[AgentVault] room message from an unverified sender not addressed to this agent \u2014 not dispatched (#1855) room=${String(metadata.roomId).slice(0, 8)}`);
16204
+ return;
16205
+ }
16206
+ }
16197
16207
  const sessionKey = `agentvault:${account.accountId}:${(metadata.conversationId ?? "default").slice(0, 8)}`;
16198
16208
  const identity = metadata.roomId ? { id: `agentvault:room:${metadata.roomId}`, name: "Room Member", owner: false } : metadata.a2aChannelId ? { id: `a2a:${metadata.a2aChannelId}`, name: "Agent", owner: false } : dmSenderIdentity(metadata);
16199
16209
  const senderId = identity.id;
@@ -37606,7 +37616,7 @@ ${text}`,
37606
37616
  * #952 — sends held because MLS is expected for this conversation but the
37607
37617
  * group is not joined yet.
37608
37618
  *
37609
- * ⚠️ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
37619
+ * ⚠ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
37610
37620
  * disk, and the product's entire premise is that plaintext does not rest
37611
37621
  * where it does not have to; a crash losing a held greeting is the correct
37612
37622
  * trade. This is why the existing `outboundQueue` could not be reused — that
@@ -38515,7 +38525,7 @@ ${text}`,
38515
38525
  */
38516
38526
  sendActivitySpan(spanData) {
38517
38527
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
38518
- const pluginVersion = true ? "0.23.72" : "0.0.0-dev";
38528
+ const pluginVersion = true ? "0.23.73" : "0.0.0-dev";
38519
38529
  const agentName = this.config.agentName ?? "Agent";
38520
38530
  const resource = {
38521
38531
  "service.name": "agentvault-agent",
@@ -39538,6 +39548,7 @@ ${text}`,
39538
39548
  async sendStatusAlert(alert, routing) {
39539
39549
  const priority = alert.severity === "error" || alert.severity === "critical" ? "high" : "normal";
39540
39550
  const envelope = {
39551
+ type: "status_alert",
39541
39552
  title: alert.title,
39542
39553
  message: alert.message,
39543
39554
  severity: alert.severity,
@@ -39546,6 +39557,7 @@ ${text}`,
39546
39557
  if (alert.detail !== void 0) envelope.detail = alert.detail;
39547
39558
  if (alert.detailFormat !== void 0) envelope.detail_format = alert.detailFormat;
39548
39559
  if (alert.category !== void 0) envelope.category = alert.category;
39560
+ envelope.text = `[${String(alert.severity).toUpperCase()}] ${alert.title}: ${alert.message}`;
39549
39561
  await this.send(
39550
39562
  JSON.stringify(envelope),
39551
39563
  {
@@ -43402,6 +43414,8 @@ ${baseText}`;
43402
43414
  // #1800 PR B: the bound sender only (undefined when unbound).
43403
43415
  senderDeviceId: boundSender,
43404
43416
  senderBinding: binding.verdict,
43417
+ // #1855: why it is unbound, as on the onMessage metadata above.
43418
+ ...boundSender === void 0 ? { senderBindingReason: unverifiedReason(binding) } : {},
43405
43419
  ...claimedSender ? { claimedSenderDeviceId: claimedSender } : {},
43406
43420
  senderName: senderLabel,
43407
43421
  plaintext: messageText,
@@ -44932,7 +44946,7 @@ ${baseText}`;
44932
44946
  /**
44933
44947
  * Top the pool up against the SERVER's count (#826).
44934
44948
  *
44935
- * ⚠️ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
44949
+ * ⚠ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
44936
44950
  * That function early-returns on `_pendingKpBundles.length >= _KP_POOL_TARGET`,
44937
44951
  * and that array holds PRIVATE bundles which never expire locally — so on an
44938
44952
  * agent that has been connected longer than the KeyPackage lifetime it is
@@ -45225,7 +45239,7 @@ ${baseText}`;
45225
45239
  agentVersion: this.config.agentVersion ?? "0.0.0",
45226
45240
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
45227
45241
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
45228
- pluginVersion: true ? "0.23.72" : "0.0.0-dev"
45242
+ pluginVersion: true ? "0.23.73" : "0.0.0-dev"
45229
45243
  });
45230
45244
  this._telemetryReporter.startAutoFlush(3e4);
45231
45245
  }
@@ -47779,6 +47793,7 @@ ${baseText}`;
47779
47793
  init_file_send_failure();
47780
47794
  init_openclaw_file_send();
47781
47795
  init_openclaw_sender();
47796
+ init_room_protocol();
47782
47797
  _ocRuntime = null;
47783
47798
  _channels = /* @__PURE__ */ new Map();
47784
47799
  _legacyTurnRuns = new OpenClawTurnRuns();
@@ -69519,7 +69534,7 @@ data:
69519
69534
  init_room_protocol();
69520
69535
  init_tool_telemetry();
69521
69536
  init_turn_failure();
69522
- VERSION = true ? "0.23.72" : "0.0.0-dev";
69537
+ VERSION = true ? "0.23.73" : "0.0.0-dev";
69523
69538
  }
69524
69539
  });
69525
69540
  init_index();
@@ -72398,7 +72413,9 @@ function _makeOwesReply(agentName, channel, log) {
72398
72413
  // #1574: a person's message in a private room (one person + this agent)
72399
72414
  // owes a reply with no name. The rule lives in the plugin's owesRoomReply;
72400
72415
  // never re-derive it here — just hand the audience through.
72401
- e.roomAudience
72416
+ e.roomAudience,
72417
+ // #1855: the verdict too — the shared rule refuses @all unless "bound".
72418
+ e.senderBinding
72402
72419
  );
72403
72420
  };
72404
72421
  }
@@ -72410,6 +72427,7 @@ function roomMessageFrom(metadata) {
72410
72427
  plaintext: metadata.plaintext,
72411
72428
  caption: metadata.caption,
72412
72429
  senderIsAgent: sender.senderIsAgent,
72430
+ senderBinding: metadata.senderBinding,
72413
72431
  roomAudience: metadata.roomAudience,
72414
72432
  senderIsOwner: sender.senderIsOwner,
72415
72433
  foreignContent: metadata.foreignContent,
@@ -72923,7 +72941,7 @@ function mkdir700(path) {
72923
72941
  chmodSync5(path, 448);
72924
72942
  }
72925
72943
  function packageVersion() {
72926
- return true ? "0.1.46" : void 0;
72944
+ return true ? "0.1.47" : void 0;
72927
72945
  }
72928
72946
  function helpText(version2) {
72929
72947
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/muse-bridge",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "type": "module",
5
5
  "description": "AgentVault Muse Bridge — daemon bridging a Muse agent into E2E-encrypted AgentVault direct messages and rooms.",
6
6
  "main": "dist/index.js",