@agentvault/muse-bridge 0.1.6 → 0.1.7

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 +30 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11465,11 +11465,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11465
11465
  return null;
11466
11466
  }
11467
11467
  function ownIdentity() {
11468
- const v2 = true ? "0.23.31" : FALLBACK;
11468
+ const v2 = true ? "0.23.32" : FALLBACK;
11469
11469
  return `${PACKAGE}@${v2}`;
11470
11470
  }
11471
11471
  function buildSha() {
11472
- const raw = true ? "3e1243a-dirty" : "";
11472
+ const raw = true ? "564f8b1-dirty" : "";
11473
11473
  const cleaned = (raw ?? "").trim();
11474
11474
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11475
11475
  }
@@ -68283,6 +68283,8 @@ var init_dist = __esm({
68283
68283
  continue;
68284
68284
  seenIdentities.push(identity);
68285
68285
  const leaf = this.memberLeafIndex(identity);
68286
+ if (leaf !== null && leaf === this.ownLeafIndex())
68287
+ continue;
68286
68288
  if (leaf !== null)
68287
68289
  leavesToRemove.push(leaf);
68288
68290
  }
@@ -68338,6 +68340,20 @@ var init_dist = __esm({
68338
68340
  * then re-adds it with a fresh KeyPackage so it gets a Welcome at the
68339
68341
  * current epoch it can actually apply.
68340
68342
  */
68343
+ /**
68344
+ * The leaf index THIS manager occupies — the leaf whose private key it holds.
68345
+ *
68346
+ * Read from `privatePath.leafIndex`, which is the same value ts-mls uses to
68347
+ * decide whether a commit removes its own committer, so a caller checking
68348
+ * against this cannot disagree with the library about who "we" are.
68349
+ *
68350
+ * Exists so a fulfiller can tell a request from ANOTHER device apart from one
68351
+ * from itself (#1147) without any "who am I" plumbing: the manager already
68352
+ * knows, and a guard that reads it here cannot be forgotten by a call site.
68353
+ */
68354
+ ownLeafIndex() {
68355
+ return this._requireState().privatePath.leafIndex;
68356
+ }
68341
68357
  memberLeafIndex(identity) {
68342
68358
  const s2 = this._requireState();
68343
68359
  const tree = s2.ratchetTree;
@@ -70148,7 +70164,7 @@ var init_dist = __esm({
70148
70164
  */
70149
70165
  sendActivitySpan(spanData) {
70150
70166
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
70151
- const pluginVersion = true ? "0.23.31" : "0.0.0-dev";
70167
+ const pluginVersion = true ? "0.23.32" : "0.0.0-dev";
70152
70168
  const agentName = this.config.agentName ?? "Agent";
70153
70169
  const resource = {
70154
70170
  "service.name": "agentvault-agent",
@@ -72086,7 +72102,7 @@ var init_dist = __esm({
72086
72102
  agentVersion: this.config.agentVersion ?? "0.0.0",
72087
72103
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72088
72104
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72089
- pluginVersion: true ? "0.23.31" : "0.0.0-dev"
72105
+ pluginVersion: true ? "0.23.32" : "0.0.0-dev"
72090
72106
  });
72091
72107
  this._telemetryReporter.startAutoFlush(3e4);
72092
72108
  }
@@ -72410,7 +72426,7 @@ var init_dist = __esm({
72410
72426
  agentVersion: this.config.agentVersion ?? "0.0.0",
72411
72427
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72412
72428
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72413
- pluginVersion: true ? "0.23.31" : "0.0.0-dev"
72429
+ pluginVersion: true ? "0.23.32" : "0.0.0-dev"
72414
72430
  });
72415
72431
  this._telemetryReporter.startAutoFlush(3e4);
72416
72432
  }
@@ -73213,7 +73229,8 @@ ${baseText}`;
73213
73229
  async _downloadAndDecryptAttachment(info) {
73214
73230
  const attachDir = join42(this.config.dataDir, "attachments");
73215
73231
  await mkdir3(attachDir, { recursive: true });
73216
- const url22 = `${this.config.apiUrl}${info.blobUrl}`;
73232
+ const sep2 = info.blobUrl.includes("?") ? "&" : "?";
73233
+ const url22 = `${this.config.apiUrl}${info.blobUrl}${sep2}device_id=${encodeURIComponent(this._deviceId ?? "")}`;
73217
73234
  const res = await fetch(url22, {
73218
73235
  headers: { Authorization: `Bearer ${this._deviceJwt}` }
73219
73236
  });
@@ -73765,10 +73782,12 @@ ${baseText}`;
73765
73782
  const rawPlaintext = new TextDecoder().decode(result.plaintext);
73766
73783
  let messageText;
73767
73784
  let messageType;
73785
+ let roomAttachment = null;
73768
73786
  try {
73769
73787
  const parsed = JSON.parse(rawPlaintext);
73770
73788
  messageType = parsed.type || "message";
73771
73789
  messageText = parsed.text || rawPlaintext;
73790
+ if (parsed.attachment) roomAttachment = parsed.attachment;
73772
73791
  } catch {
73773
73792
  messageType = "message";
73774
73793
  messageText = rawPlaintext;
@@ -73808,6 +73827,9 @@ ${baseText}`;
73808
73827
  await this._refreshRoomRoster(resolvedRoomId);
73809
73828
  }
73810
73829
  }
73830
+ if (roomAttachment) {
73831
+ messageText = await this._augmentWithAttachment(roomAttachment, messageText);
73832
+ }
73811
73833
  const roomMembers = this._persisted?.rooms?.[resolvedRoomId]?.members ?? [];
73812
73834
  const senderMember = roomMembers.find((m2) => m2.deviceId === senderDeviceId);
73813
73835
  const senderIsAgent = senderMember?.entityType === "agent";
@@ -97717,7 +97739,7 @@ data:
97717
97739
  await init_skill_telemetry();
97718
97740
  await init_policy_enforcer();
97719
97741
  init_room_protocol();
97720
- VERSION = true ? "0.23.31" : "0.0.0-dev";
97742
+ VERSION = true ? "0.23.32" : "0.0.0-dev";
97721
97743
  }
97722
97744
  });
97723
97745
  await init_index();
@@ -99093,7 +99115,7 @@ function mkdir700(path2) {
99093
99115
  chmodSync5(path2, 448);
99094
99116
  }
99095
99117
  function packageVersion() {
99096
- return true ? "0.1.6" : void 0;
99118
+ return true ? "0.1.7" : void 0;
99097
99119
  }
99098
99120
  function helpText(version2) {
99099
99121
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/muse-bridge",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
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",