@agentvault/claude-bridge 0.8.43 → 0.8.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
@@ -16,6 +16,10 @@ export interface RoomMessage {
16
16
  * #1800 PR D: `true` for a sender that is not BOUND (`roomSenderView`), so
17
17
  * the room protocol never treats an unverified sender as a known human. */
18
18
  senderIsAgent?: boolean;
19
+ /** #1855 — SecureChannel's binding verdict for this frame, as emitted. Handed
20
+ * to owesRoomReply (9th argument), which refuses @all unless it is "bound";
21
+ * absent (a RoomMessage built without it) reads as unverified there. */
22
+ senderBinding?: unknown;
19
23
  /** #1574 — SecureChannel: the room's audience, "private_pair" or "group".
20
24
  * Passed through to owesRoomReply untyped; anything but "private_pair"
21
25
  * (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((m22) => resolveOwn(m22, ownNames) !== null)) return true;
199
200
  if (mentions.some((m22) => resolveOwn(m22, 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 v22 = true ? "0.23.72" : FALLBACK;
13077
+ const v22 = true ? "0.23.73" : FALLBACK;
13077
13078
  return `${PACKAGE}@${v22}`;
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 !== WebSocket2.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();
@@ -113198,7 +113213,9 @@ function _makeOwesReply(agentName, channel, log) {
113198
113213
  // #1574: a person's message in a private room (one person + this agent)
113199
113214
  // owes a reply with no name. The rule lives in the plugin's owesRoomReply;
113200
113215
  // never re-derive it here — just hand the audience through.
113201
- e7.roomAudience
113216
+ e7.roomAudience,
113217
+ // #1855: the verdict too — the shared rule refuses @all unless "bound".
113218
+ e7.senderBinding
113202
113219
  );
113203
113220
  };
113204
113221
  }
@@ -113210,6 +113227,7 @@ function roomMessageFrom(metadata) {
113210
113227
  plaintext: metadata.plaintext,
113211
113228
  caption: metadata.caption,
113212
113229
  senderIsAgent: sender.senderIsAgent,
113230
+ senderBinding: metadata.senderBinding,
113213
113231
  roomAudience: metadata.roomAudience,
113214
113232
  senderIsOwner: sender.senderIsOwner,
113215
113233
  foreignContent: metadata.foreignContent,
@@ -113689,7 +113707,7 @@ function makeShutdown(deps) {
113689
113707
 
113690
113708
  // src/index.ts
113691
113709
  async function main() {
113692
- if (answerInfoFlags(process.argv, true ? "0.8.43" : void 0, printLine)) {
113710
+ if (answerInfoFlags(process.argv, true ? "0.8.44" : void 0, printLine)) {
113693
113711
  process.exit(0);
113694
113712
  }
113695
113713
  if (process.argv[2] === "recovery" && await (await Promise.resolve().then(() => (init_recovery(), recovery_exports))).maybeRunRecoverySubcommand()) {
@@ -113717,7 +113735,7 @@ async function main() {
113717
113735
  "[bridge] warning: passing the invite token on the command line is visible to other local users via 'ps'. Prefer: AV_INVITE_TOKEN=\u2026 npx @agentvault/claude-bridge"
113718
113736
  );
113719
113737
  }
113720
- logLine(`[bridge] version: ${true ? "0.8.43" : "dev"}`);
113738
+ logLine(`[bridge] version: ${true ? "0.8.44" : "dev"}`);
113721
113739
  logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
113722
113740
  logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
113723
113741
  if (cfg.armRoom) {
@@ -113750,7 +113768,7 @@ async function main() {
113750
113768
  // its default would render "@agentvault/agentvault@0.7.x" — the wrong
113751
113769
  // package name attached to the bridge's version number, which is worse
113752
113770
  // than either alone.
113753
- clientVersion: `@agentvault/claude-bridge@${true ? "0.8.43" : "dev"}`
113771
+ clientVersion: `@agentvault/claude-bridge@${true ? "0.8.44" : "dev"}`
113754
113772
  }, inbox));
113755
113773
  inbox.bindChannel(channel);
113756
113774
  const agentSystemPrompt = withFileSendRule(cfg.systemPrompt ?? identityPrompt(cfg.agentName));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/claude-bridge",
3
- "version": "0.8.43",
3
+ "version": "0.8.44",
4
4
  "type": "module",
5
5
  "description": "AgentVault Claude Bridge — daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "prepublishOnly": "npm run build"
31
31
  },
32
32
  "dependencies": {
33
- "@anthropic-ai/claude-agent-sdk": "^0.2.114",
33
+ "@anthropic-ai/claude-agent-sdk": "0.2.141",
34
34
  "ws": "^8.22.1",
35
35
  "zod": "^4.6.7"
36
36
  },