@agentvault/grok-bridge 0.4.43 → 0.4.44

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
@@ -33,6 +33,10 @@ export interface RoomMessage {
33
33
  * #1800 PR D: `true` for a sender that is not BOUND (`roomSenderView`), so
34
34
  * the room protocol never treats an unverified sender as a known human. */
35
35
  senderIsAgent?: boolean;
36
+ /** #1855 — SecureChannel's binding verdict for this frame, as emitted. Handed
37
+ * to owesRoomReply (9th argument), which refuses @all unless it is "bound";
38
+ * absent (a RoomMessage built without it) reads as unverified there. */
39
+ senderBinding?: unknown;
36
40
  /** #1574 — SecureChannel: the room's audience, "private_pair" or "group".
37
41
  * Passed through to owesRoomReply untyped; anything but "private_pair"
38
42
  * (absent on emitters before #1574) reads as a group room. */
package/dist/index.js CHANGED
@@ -187,7 +187,8 @@ function resolveOwn(mention, names) {
187
187
  }
188
188
  return null;
189
189
  }
190
- function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience) {
190
+ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience, senderBinding) {
191
+ if (senderBinding !== void 0 && senderBinding !== "bound") senderIsAgent = true;
191
192
  if (isPrivatePairHumanMessage(senderIsAgent, roomAudience)) return true;
192
193
  const mentions = parseMentions(plaintext);
193
194
  if (senderIsAgent === false && namesAgentPlainly(plaintext, agentName, roomDisplayName, ownDisplayName)) {
@@ -197,7 +198,7 @@ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDispl
197
198
  const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
198
199
  if (mentions.some((m2) => resolveOwn(m2, ownNames) !== null)) return true;
199
200
  if (mentions.some((m2) => resolveOwn(m2, BROADCAST_NAMES) !== null)) {
200
- return senderIsAgent !== true;
201
+ return senderBinding === "bound" && senderIsAgent !== true;
201
202
  }
202
203
  if (!selfResolved) return true;
203
204
  return false;
@@ -13073,11 +13074,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
13073
13074
  return null;
13074
13075
  }
13075
13076
  function ownIdentity() {
13076
- const v2 = true ? "0.23.72" : FALLBACK;
13077
+ const v2 = true ? "0.23.73" : FALLBACK;
13077
13078
  return `${PACKAGE}@${v2}`;
13078
13079
  }
13079
13080
  function buildSha() {
13080
- const raw = true ? "b70dedb" : "";
13081
+ const raw = true ? "cb8786f" : "";
13081
13082
  const cleaned = (raw ?? "").trim();
13082
13083
  return !cleaned || cleaned === "unknown" ? null : cleaned;
13083
13084
  }
@@ -15967,6 +15968,15 @@ function dmSenderIdentity(metadata) {
15967
15968
  async function _handleInbound(params) {
15968
15969
  const { plaintext, metadata, channel, account, cfg, fileTurn } = params;
15969
15970
  const core = _ocRuntime;
15971
+ if (metadata.roomId && metadata.senderBinding !== "bound") {
15972
+ const ownDisplayName = channel.ownDisplayName ?? "";
15973
+ const agentName = account.agentName ?? "";
15974
+ const selfResolved = !!ownDisplayName || !!agentName && agentName.toLowerCase() !== "default";
15975
+ if (!owesRoomReply(metadata.caption ?? plaintext, agentName, account.accountId ?? "", true, void 0, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
15976
+ 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)}`);
15977
+ return;
15978
+ }
15979
+ }
15970
15980
  const sessionKey = `agentvault:${account.accountId}:${(metadata.conversationId ?? "default").slice(0, 8)}`;
15971
15981
  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);
15972
15982
  const senderId = identity.id;
@@ -36764,7 +36774,7 @@ ${text}`,
36764
36774
  * #952 — sends held because MLS is expected for this conversation but the
36765
36775
  * group is not joined yet.
36766
36776
  *
36767
- * ⚠️ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
36777
+ * ⚠ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
36768
36778
  * disk, and the product's entire premise is that plaintext does not rest
36769
36779
  * where it does not have to; a crash losing a held greeting is the correct
36770
36780
  * trade. This is why the existing `outboundQueue` could not be reused — that
@@ -37673,7 +37683,7 @@ ${text}`,
37673
37683
  */
37674
37684
  sendActivitySpan(spanData) {
37675
37685
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
37676
- const pluginVersion = true ? "0.23.72" : "0.0.0-dev";
37686
+ const pluginVersion = true ? "0.23.73" : "0.0.0-dev";
37677
37687
  const agentName = this.config.agentName ?? "Agent";
37678
37688
  const resource = {
37679
37689
  "service.name": "agentvault-agent",
@@ -38696,6 +38706,7 @@ ${text}`,
38696
38706
  async sendStatusAlert(alert, routing) {
38697
38707
  const priority = alert.severity === "error" || alert.severity === "critical" ? "high" : "normal";
38698
38708
  const envelope = {
38709
+ type: "status_alert",
38699
38710
  title: alert.title,
38700
38711
  message: alert.message,
38701
38712
  severity: alert.severity,
@@ -38704,6 +38715,7 @@ ${text}`,
38704
38715
  if (alert.detail !== void 0) envelope.detail = alert.detail;
38705
38716
  if (alert.detailFormat !== void 0) envelope.detail_format = alert.detailFormat;
38706
38717
  if (alert.category !== void 0) envelope.category = alert.category;
38718
+ envelope.text = `[${String(alert.severity).toUpperCase()}] ${alert.title}: ${alert.message}`;
38707
38719
  await this.send(
38708
38720
  JSON.stringify(envelope),
38709
38721
  {
@@ -42560,6 +42572,8 @@ ${baseText}`;
42560
42572
  // #1800 PR B: the bound sender only (undefined when unbound).
42561
42573
  senderDeviceId: boundSender,
42562
42574
  senderBinding: binding.verdict,
42575
+ // #1855: why it is unbound, as on the onMessage metadata above.
42576
+ ...boundSender === void 0 ? { senderBindingReason: unverifiedReason(binding) } : {},
42563
42577
  ...claimedSender ? { claimedSenderDeviceId: claimedSender } : {},
42564
42578
  senderName: senderLabel,
42565
42579
  plaintext: messageText,
@@ -44090,7 +44104,7 @@ ${baseText}`;
44090
44104
  /**
44091
44105
  * Top the pool up against the SERVER's count (#826).
44092
44106
  *
44093
- * ⚠️ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
44107
+ * ⚠ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
44094
44108
  * That function early-returns on `_pendingKpBundles.length >= _KP_POOL_TARGET`,
44095
44109
  * and that array holds PRIVATE bundles which never expire locally — so on an
44096
44110
  * agent that has been connected longer than the KeyPackage lifetime it is
@@ -44383,7 +44397,7 @@ ${baseText}`;
44383
44397
  agentVersion: this.config.agentVersion ?? "0.0.0",
44384
44398
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
44385
44399
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
44386
- pluginVersion: true ? "0.23.72" : "0.0.0-dev"
44400
+ pluginVersion: true ? "0.23.73" : "0.0.0-dev"
44387
44401
  });
44388
44402
  this._telemetryReporter.startAutoFlush(3e4);
44389
44403
  }
@@ -46937,6 +46951,7 @@ ${baseText}`;
46937
46951
  init_file_send_failure();
46938
46952
  init_openclaw_file_send();
46939
46953
  init_openclaw_sender();
46954
+ init_room_protocol();
46940
46955
  _ocRuntime = null;
46941
46956
  _channels = /* @__PURE__ */ new Map();
46942
46957
  _legacyTurnRuns = new OpenClawTurnRuns();
@@ -68677,7 +68692,7 @@ data:
68677
68692
  init_room_protocol();
68678
68693
  init_tool_telemetry();
68679
68694
  init_turn_failure();
68680
- VERSION = true ? "0.23.72" : "0.0.0-dev";
68695
+ VERSION = true ? "0.23.73" : "0.0.0-dev";
68681
68696
  }
68682
68697
  });
68683
68698
  init_index();
@@ -72308,7 +72323,9 @@ function _makeOwesReply(agentName, channel, log) {
72308
72323
  // #1574: a person's message in a private room (one person + this agent)
72309
72324
  // owes a reply with no name. The rule lives in the plugin's owesRoomReply;
72310
72325
  // never re-derive it here — just hand the audience through.
72311
- e.roomAudience
72326
+ e.roomAudience,
72327
+ // #1855: the verdict too — the shared rule refuses @all unless "bound".
72328
+ e.senderBinding
72312
72329
  );
72313
72330
  };
72314
72331
  }
@@ -72320,6 +72337,7 @@ function roomMessageFrom(metadata) {
72320
72337
  plaintext: metadata.plaintext,
72321
72338
  caption: metadata.caption,
72322
72339
  senderIsAgent: sender.senderIsAgent,
72340
+ senderBinding: metadata.senderBinding,
72323
72341
  roomAudience: metadata.roomAudience,
72324
72342
  senderIsOwner: sender.senderIsOwner,
72325
72343
  foreignContent: metadata.foreignContent,
@@ -73585,7 +73603,7 @@ async function main() {
73585
73603
  const info = parseInfoFlags(process.argv.slice(2));
73586
73604
  if (info.showVersion || info.showHelp) {
73587
73605
  const version2 = buildClientVersion2(
73588
- true ? "0.4.43" : void 0
73606
+ true ? "0.4.44" : void 0
73589
73607
  );
73590
73608
  if (info.showVersion) printLine(version2);
73591
73609
  if (info.showHelp) {
@@ -73624,7 +73642,7 @@ async function main() {
73624
73642
  process.exit(0);
73625
73643
  }
73626
73644
  const cfg = loadConfig(process.env, process.argv.slice(2));
73627
- logLine(`[grok-bridge] version: ${true ? "0.4.43" : "dev"}`);
73645
+ logLine(`[grok-bridge] version: ${true ? "0.4.44" : "dev"}`);
73628
73646
  mkdirSync11(cfg.workspaceDir, { recursive: true });
73629
73647
  mkdirSync11(cfg.fenceHome, { recursive: true });
73630
73648
  seedFenceCredential({
@@ -73641,7 +73659,7 @@ async function main() {
73641
73659
  agentName: cfg.agentName,
73642
73660
  workspaceDir: cfg.workspaceDir,
73643
73661
  clientVersion: buildClientVersion2(
73644
- true ? "0.4.43" : void 0
73662
+ true ? "0.4.44" : void 0
73645
73663
  )
73646
73664
  }, inbox));
73647
73665
  inbox.bindChannel(channel);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/grok-bridge",
3
- "version": "0.4.43",
3
+ "version": "0.4.44",
4
4
  "type": "module",
5
5
  "description": "AgentVault Grok Bridge — daemon bridging a Grok agent into E2E-encrypted AgentVault direct messages and rooms.",
6
6
  "main": "dist/index.js",