@agentvault/claude-bridge 0.8.4 → 0.8.5

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.
Files changed (2) hide show
  1. package/dist/index.js +31 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -64011,6 +64011,8 @@ var init_mls_group = __esm2({
64011
64011
  continue;
64012
64012
  seenIdentities.push(identity);
64013
64013
  const leaf = this.memberLeafIndex(identity);
64014
+ if (leaf !== null && leaf === this.ownLeafIndex())
64015
+ continue;
64014
64016
  if (leaf !== null)
64015
64017
  leavesToRemove.push(leaf);
64016
64018
  }
@@ -64066,6 +64068,20 @@ var init_mls_group = __esm2({
64066
64068
  * then re-adds it with a fresh KeyPackage so it gets a Welcome at the
64067
64069
  * current epoch it can actually apply.
64068
64070
  */
64071
+ /**
64072
+ * The leaf index THIS manager occupies — the leaf whose private key it holds.
64073
+ *
64074
+ * Read from `privatePath.leafIndex`, which is the same value ts-mls uses to
64075
+ * decide whether a commit removes its own committer, so a caller checking
64076
+ * against this cannot disagree with the library about who "we" are.
64077
+ *
64078
+ * Exists so a fulfiller can tell a request from ANOTHER device apart from one
64079
+ * from itself (#1147) without any "who am I" plumbing: the manager already
64080
+ * knows, and a guard that reads it here cannot be forgotten by a call site.
64081
+ */
64082
+ ownLeafIndex() {
64083
+ return this._requireState().privatePath.leafIndex;
64084
+ }
64069
64085
  memberLeafIndex(identity) {
64070
64086
  const s22 = this._requireState();
64071
64087
  const tree = s22.ratchetTree;
@@ -64596,11 +64612,11 @@ var init_mls_kp_pool = __esm2({
64596
64612
  }
64597
64613
  });
64598
64614
  function ownIdentity() {
64599
- const v22 = true ? "0.23.31" : FALLBACK;
64615
+ const v22 = true ? "0.23.32" : FALLBACK;
64600
64616
  return `${PACKAGE}@${v22}`;
64601
64617
  }
64602
64618
  function buildSha() {
64603
- const raw = true ? "3e1243a-dirty" : "";
64619
+ const raw = true ? "564f8b1-dirty" : "";
64604
64620
  const cleaned = (raw ?? "").trim();
64605
64621
  return !cleaned || cleaned === "unknown" ? null : cleaned;
64606
64622
  }
@@ -66794,7 +66810,7 @@ var init_channel = __esm2({
66794
66810
  */
66795
66811
  sendActivitySpan(spanData) {
66796
66812
  if (!this._ws || this._ws.readyState !== WebSocket2.OPEN) return;
66797
- const pluginVersion = true ? "0.23.31" : "0.0.0-dev";
66813
+ const pluginVersion = true ? "0.23.32" : "0.0.0-dev";
66798
66814
  const agentName = this.config.agentName ?? "Agent";
66799
66815
  const resource = {
66800
66816
  "service.name": "agentvault-agent",
@@ -68732,7 +68748,7 @@ var init_channel = __esm2({
68732
68748
  agentVersion: this.config.agentVersion ?? "0.0.0",
68733
68749
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
68734
68750
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
68735
- pluginVersion: true ? "0.23.31" : "0.0.0-dev"
68751
+ pluginVersion: true ? "0.23.32" : "0.0.0-dev"
68736
68752
  });
68737
68753
  this._telemetryReporter.startAutoFlush(3e4);
68738
68754
  }
@@ -69056,7 +69072,7 @@ var init_channel = __esm2({
69056
69072
  agentVersion: this.config.agentVersion ?? "0.0.0",
69057
69073
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
69058
69074
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
69059
- pluginVersion: true ? "0.23.31" : "0.0.0-dev"
69075
+ pluginVersion: true ? "0.23.32" : "0.0.0-dev"
69060
69076
  });
69061
69077
  this._telemetryReporter.startAutoFlush(3e4);
69062
69078
  }
@@ -69859,7 +69875,8 @@ ${baseText}`;
69859
69875
  async _downloadAndDecryptAttachment(info) {
69860
69876
  const attachDir = join4(this.config.dataDir, "attachments");
69861
69877
  await mkdir3(attachDir, { recursive: true });
69862
- const url22 = `${this.config.apiUrl}${info.blobUrl}`;
69878
+ const sep3 = info.blobUrl.includes("?") ? "&" : "?";
69879
+ const url22 = `${this.config.apiUrl}${info.blobUrl}${sep3}device_id=${encodeURIComponent(this._deviceId ?? "")}`;
69863
69880
  const res = await fetch(url22, {
69864
69881
  headers: { Authorization: `Bearer ${this._deviceJwt}` }
69865
69882
  });
@@ -70411,10 +70428,12 @@ ${baseText}`;
70411
70428
  const rawPlaintext = new TextDecoder().decode(result.plaintext);
70412
70429
  let messageText;
70413
70430
  let messageType;
70431
+ let roomAttachment = null;
70414
70432
  try {
70415
70433
  const parsed = JSON.parse(rawPlaintext);
70416
70434
  messageType = parsed.type || "message";
70417
70435
  messageText = parsed.text || rawPlaintext;
70436
+ if (parsed.attachment) roomAttachment = parsed.attachment;
70418
70437
  } catch {
70419
70438
  messageType = "message";
70420
70439
  messageText = rawPlaintext;
@@ -70454,6 +70473,9 @@ ${baseText}`;
70454
70473
  await this._refreshRoomRoster(resolvedRoomId);
70455
70474
  }
70456
70475
  }
70476
+ if (roomAttachment) {
70477
+ messageText = await this._augmentWithAttachment(roomAttachment, messageText);
70478
+ }
70457
70479
  const roomMembers = this._persisted?.rooms?.[resolvedRoomId]?.members ?? [];
70458
70480
  const senderMember = roomMembers.find((m22) => m22.deviceId === senderDeviceId);
70459
70481
  const senderIsAgent = senderMember?.entityType === "agent";
@@ -99410,7 +99432,7 @@ var init_index = __esm2({
99410
99432
  await init_skill_telemetry();
99411
99433
  await init_policy_enforcer();
99412
99434
  init_room_protocol();
99413
- VERSION = true ? "0.23.31" : "0.0.0-dev";
99435
+ VERSION = true ? "0.23.32" : "0.0.0-dev";
99414
99436
  }
99415
99437
  });
99416
99438
  await init_index();
@@ -135814,7 +135836,7 @@ async function main() {
135814
135836
  "[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"
135815
135837
  );
135816
135838
  }
135817
- logLine(`[bridge] version: ${true ? "0.8.4" : "dev"}`);
135839
+ logLine(`[bridge] version: ${true ? "0.8.5" : "dev"}`);
135818
135840
  logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
135819
135841
  logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
135820
135842
  if (cfg.armRoom) {
@@ -135846,7 +135868,7 @@ async function main() {
135846
135868
  // its default would render "@agentvault/agentvault@0.7.x" — the wrong
135847
135869
  // package name attached to the bridge's version number, which is worse
135848
135870
  // than either alone.
135849
- clientVersion: `@agentvault/claude-bridge@${true ? "0.8.4" : "dev"}`
135871
+ clientVersion: `@agentvault/claude-bridge@${true ? "0.8.5" : "dev"}`
135850
135872
  });
135851
135873
  const agentSystemPrompt = cfg.systemPrompt ?? `You are ${cfg.agentName}, an AI agent on AgentVault. You talk with your owner in 1:1 direct messages and collaborate with other agents in shared rooms. That is your identity \u2014 introduce yourself by that name and do not claim to be any other agent. To speak, call the say tool. In a 1:1 with your owner, reply to what they say. In a room you see every message \u2014 call say only when you have something worth adding, and otherwise stay silent. Keep messages concise.`;
135852
135874
  const deviceJwt = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/claude-bridge",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
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",