@agentvault/agentvault 0.23.72 → 0.23.73

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/index.js CHANGED
@@ -269,7 +269,8 @@ function resolveOwn(mention, names) {
269
269
  }
270
270
  return null;
271
271
  }
272
- function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience) {
272
+ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience, senderBinding) {
273
+ if (senderBinding !== void 0 && senderBinding !== "bound") senderIsAgent = true;
273
274
  if (isPrivatePairHumanMessage(senderIsAgent, roomAudience)) return true;
274
275
  const mentions = parseMentions(plaintext);
275
276
  if (senderIsAgent === false && namesAgentPlainly(plaintext, agentName, roomDisplayName, ownDisplayName)) {
@@ -279,7 +280,7 @@ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDispl
279
280
  const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
280
281
  if (mentions.some((m2) => resolveOwn(m2, ownNames) !== null)) return true;
281
282
  if (mentions.some((m2) => resolveOwn(m2, BROADCAST_NAMES) !== null)) {
282
- return senderIsAgent !== true;
283
+ return senderBinding === "bound" && senderIsAgent !== true;
283
284
  }
284
285
  if (!selfResolved) return true;
285
286
  return false;
@@ -24114,11 +24115,11 @@ var init_mls_kp_pool = __esm({
24114
24115
 
24115
24116
  // src/client-version.ts
24116
24117
  function ownIdentity() {
24117
- const v2 = true ? "0.23.72" : FALLBACK;
24118
+ const v2 = true ? "0.23.73" : FALLBACK;
24118
24119
  return `${PACKAGE}@${v2}`;
24119
24120
  }
24120
24121
  function buildSha() {
24121
- const raw = true ? "b70dedb" : "";
24122
+ const raw = true ? "cb8786f" : "";
24122
24123
  const cleaned = (raw ?? "").trim();
24123
24124
  return !cleaned || cleaned === "unknown" ? null : cleaned;
24124
24125
  }
@@ -32518,7 +32519,7 @@ ${text}`,
32518
32519
  * #952 — sends held because MLS is expected for this conversation but the
32519
32520
  * group is not joined yet.
32520
32521
  *
32521
- * ⚠️ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
32522
+ * ⚠ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
32522
32523
  * disk, and the product's entire premise is that plaintext does not rest
32523
32524
  * where it does not have to; a crash losing a held greeting is the correct
32524
32525
  * trade. This is why the existing `outboundQueue` could not be reused — that
@@ -33427,7 +33428,7 @@ ${text}`,
33427
33428
  */
33428
33429
  sendActivitySpan(spanData) {
33429
33430
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
33430
- const pluginVersion = true ? "0.23.72" : "0.0.0-dev";
33431
+ const pluginVersion = true ? "0.23.73" : "0.0.0-dev";
33431
33432
  const agentName = this.config.agentName ?? "Agent";
33432
33433
  const resource = {
33433
33434
  "service.name": "agentvault-agent",
@@ -34450,6 +34451,7 @@ ${text}`,
34450
34451
  async sendStatusAlert(alert, routing) {
34451
34452
  const priority = alert.severity === "error" || alert.severity === "critical" ? "high" : "normal";
34452
34453
  const envelope = {
34454
+ type: "status_alert",
34453
34455
  title: alert.title,
34454
34456
  message: alert.message,
34455
34457
  severity: alert.severity,
@@ -34458,6 +34460,7 @@ ${text}`,
34458
34460
  if (alert.detail !== void 0) envelope.detail = alert.detail;
34459
34461
  if (alert.detailFormat !== void 0) envelope.detail_format = alert.detailFormat;
34460
34462
  if (alert.category !== void 0) envelope.category = alert.category;
34463
+ envelope.text = `[${String(alert.severity).toUpperCase()}] ${alert.title}: ${alert.message}`;
34461
34464
  await this.send(
34462
34465
  JSON.stringify(envelope),
34463
34466
  {
@@ -38314,6 +38317,8 @@ ${baseText}`;
38314
38317
  // #1800 PR B: the bound sender only (undefined when unbound).
38315
38318
  senderDeviceId: boundSender,
38316
38319
  senderBinding: binding.verdict,
38320
+ // #1855: why it is unbound, as on the onMessage metadata above.
38321
+ ...boundSender === void 0 ? { senderBindingReason: unverifiedReason(binding) } : {},
38317
38322
  ...claimedSender ? { claimedSenderDeviceId: claimedSender } : {},
38318
38323
  senderName: senderLabel,
38319
38324
  plaintext: messageText,
@@ -39844,7 +39849,7 @@ ${baseText}`;
39844
39849
  /**
39845
39850
  * Top the pool up against the SERVER's count (#826).
39846
39851
  *
39847
- * ⚠️ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
39852
+ * ⚠ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
39848
39853
  * That function early-returns on `_pendingKpBundles.length >= _KP_POOL_TARGET`,
39849
39854
  * and that array holds PRIVATE bundles which never expire locally — so on an
39850
39855
  * agent that has been connected longer than the KeyPackage lifetime it is
@@ -40137,7 +40142,7 @@ ${baseText}`;
40137
40142
  agentVersion: this.config.agentVersion ?? "0.0.0",
40138
40143
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
40139
40144
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
40140
- pluginVersion: true ? "0.23.72" : "0.0.0-dev"
40145
+ pluginVersion: true ? "0.23.73" : "0.0.0-dev"
40141
40146
  });
40142
40147
  this._telemetryReporter.startAutoFlush(3e4);
40143
40148
  }
@@ -43070,6 +43075,15 @@ function getActiveChannel(accountId = "default") {
43070
43075
  async function _handleInbound(params) {
43071
43076
  const { plaintext, metadata, channel, account, cfg, fileTurn } = params;
43072
43077
  const core = _ocRuntime;
43078
+ if (metadata.roomId && metadata.senderBinding !== "bound") {
43079
+ const ownDisplayName = channel.ownDisplayName ?? "";
43080
+ const agentName = account.agentName ?? "";
43081
+ const selfResolved = !!ownDisplayName || !!agentName && agentName.toLowerCase() !== "default";
43082
+ if (!owesRoomReply(metadata.caption ?? plaintext, agentName, account.accountId ?? "", true, void 0, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
43083
+ 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)}`);
43084
+ return;
43085
+ }
43086
+ }
43073
43087
  const sessionKey = `agentvault:${account.accountId}:${(metadata.conversationId ?? "default").slice(0, 8)}`;
43074
43088
  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);
43075
43089
  const senderId = identity.id;
@@ -43191,6 +43205,7 @@ var init_openclaw_plugin = __esm({
43191
43205
  init_file_send_failure();
43192
43206
  init_openclaw_file_send();
43193
43207
  init_openclaw_sender();
43208
+ init_room_protocol();
43194
43209
  _ocRuntime = null;
43195
43210
  _channels = /* @__PURE__ */ new Map();
43196
43211
  _legacyTurnRuns = new OpenClawTurnRuns();
@@ -70535,7 +70550,7 @@ var init_index = __esm({
70535
70550
  init_room_protocol();
70536
70551
  init_tool_telemetry();
70537
70552
  init_turn_failure();
70538
- VERSION = true ? "0.23.72" : "0.0.0-dev";
70553
+ VERSION = true ? "0.23.73" : "0.0.0-dev";
70539
70554
  }
70540
70555
  });
70541
70556
  init_index();