@agentvault/muse-bridge 0.1.14 → 0.1.15

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 +33 -9
  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.38" : FALLBACK;
11468
+ const v2 = true ? "0.23.39" : FALLBACK;
11469
11469
  return `${PACKAGE}@${v2}`;
11470
11470
  }
11471
11471
  function buildSha() {
11472
- const raw = true ? "c0acb44-dirty" : "";
11472
+ const raw = true ? "9982fc8-dirty" : "";
11473
11473
  const cleaned = (raw ?? "").trim();
11474
11474
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11475
11475
  }
@@ -69072,6 +69072,27 @@ var init_dist = __esm({
69072
69072
  * this process (GH #366). Cleared on (re)join so the next first message
69073
69073
  * re-fetches the authoritative roster. Prevents per-message refetch storms. */
69074
69074
  _roomRosterRefreshed = /* @__PURE__ */ new Set();
69075
+ /**
69076
+ * #1181: the last attachment saved per room, so the NEXT room turn can name
69077
+ * it. wren saved an un-mentioned file (no reply, #1107), was asked "@wren can
69078
+ * you read this file?" 14 s later, and answered "I don't see a file
69079
+ * attached" — the note lived only in the prior history line. Hermes defers
69080
+ * un-mentioned attachments and fetches on the next addressed turn (#1162);
69081
+ * this is the plugin's equivalent surface. In-memory: a restart forgets it,
69082
+ * which is the right default for "this file".
69083
+ */
69084
+ _recentRoomAttachments = /* @__PURE__ */ new Map();
69085
+ static RECENT_ROOM_ATTACHMENT_MS = 10 * 60 * 1e3;
69086
+ /** #1181: prefix a room turn that carries no attachment with the one saved in this room recently. */
69087
+ _withRecentRoomAttachmentNote(roomId, text) {
69088
+ const recent = this._recentRoomAttachments.get(roomId);
69089
+ if (!recent) return text;
69090
+ const ageMs = Date.now() - recent.at;
69091
+ if (ageMs > _SecureChannel.RECENT_ROOM_ATTACHMENT_MS) return text;
69092
+ return `[Most recent file in this room: ${recent.filePath} (${recent.name}, received ${Math.round(ageMs / 1e3)}s ago). If this message refers to "the file" or "this file", it means that one \u2014 use your Read tool on it.]
69093
+
69094
+ ${text}`;
69095
+ }
69075
69096
  /** In-flight roster-refresh promises (per room) — dedup concurrent refreshes. */
69076
69097
  _roomRosterRefreshInFlight = /* @__PURE__ */ new Map();
69077
69098
  /** Dedup buffer for A2A message IDs (prevents double-delivery via direct + Redis) */
@@ -70167,7 +70188,7 @@ var init_dist = __esm({
70167
70188
  */
70168
70189
  sendActivitySpan(spanData) {
70169
70190
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
70170
- const pluginVersion = true ? "0.23.38" : "0.0.0-dev";
70191
+ const pluginVersion = true ? "0.23.39" : "0.0.0-dev";
70171
70192
  const agentName = this.config.agentName ?? "Agent";
70172
70193
  const resource = {
70173
70194
  "service.name": "agentvault-agent",
@@ -72105,7 +72126,7 @@ var init_dist = __esm({
72105
72126
  agentVersion: this.config.agentVersion ?? "0.0.0",
72106
72127
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72107
72128
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72108
- pluginVersion: true ? "0.23.38" : "0.0.0-dev"
72129
+ pluginVersion: true ? "0.23.39" : "0.0.0-dev"
72109
72130
  });
72110
72131
  this._telemetryReporter.startAutoFlush(3e4);
72111
72132
  }
@@ -72429,7 +72450,7 @@ var init_dist = __esm({
72429
72450
  agentVersion: this.config.agentVersion ?? "0.0.0",
72430
72451
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72431
72452
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72432
- pluginVersion: true ? "0.23.38" : "0.0.0-dev"
72453
+ pluginVersion: true ? "0.23.39" : "0.0.0-dev"
72433
72454
  });
72434
72455
  this._telemetryReporter.startAutoFlush(3e4);
72435
72456
  }
@@ -73202,12 +73223,13 @@ ${messageText}`;
73202
73223
  * Returns the text unchanged when there is no attachment or the fetch fails —
73203
73224
  * but a failure is LOGGED and announced in the text, never silent.
73204
73225
  */
73205
- async _augmentWithAttachment(attachmentInfo, baseText) {
73226
+ async _augmentWithAttachment(attachmentInfo, baseText, roomId) {
73206
73227
  if (!attachmentInfo) return baseText;
73207
73228
  try {
73208
73229
  const { filePath, decrypted } = await this._downloadAndDecryptAttachment(attachmentInfo);
73209
73230
  const mime = String(attachmentInfo.mime ?? "application/octet-stream");
73210
73231
  const name = String(attachmentInfo.filename ?? "attachment");
73232
+ if (roomId) this._recentRoomAttachments.set(roomId, { filePath, name, at: Date.now() });
73211
73233
  const textMimes = ["text/", "application/json", "application/xml", "application/csv"];
73212
73234
  if (textMimes.some((m2) => mime.startsWith(m2))) {
73213
73235
  const content = new TextDecoder().decode(decrypted);
@@ -73837,7 +73859,9 @@ ${baseText}`;
73837
73859
  }
73838
73860
  }
73839
73861
  if (roomAttachment) {
73840
- messageText = await this._augmentWithAttachment(roomAttachment, messageText);
73862
+ messageText = await this._augmentWithAttachment(roomAttachment, messageText, resolvedRoomId);
73863
+ } else {
73864
+ messageText = this._withRecentRoomAttachmentNote(resolvedRoomId, messageText);
73841
73865
  }
73842
73866
  const roomMembers = this._persisted?.rooms?.[resolvedRoomId]?.members ?? [];
73843
73867
  const senderMember = roomMembers.find((m2) => m2.deviceId === senderDeviceId);
@@ -97832,7 +97856,7 @@ data:
97832
97856
  await init_skill_telemetry();
97833
97857
  await init_policy_enforcer();
97834
97858
  init_room_protocol();
97835
- VERSION = true ? "0.23.38" : "0.0.0-dev";
97859
+ VERSION = true ? "0.23.39" : "0.0.0-dev";
97836
97860
  }
97837
97861
  });
97838
97862
  await init_index();
@@ -99215,7 +99239,7 @@ function mkdir700(path2) {
99215
99239
  chmodSync5(path2, 448);
99216
99240
  }
99217
99241
  function packageVersion() {
99218
- return true ? "0.1.14" : void 0;
99242
+ return true ? "0.1.15" : void 0;
99219
99243
  }
99220
99244
  function helpText(version2) {
99221
99245
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/muse-bridge",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
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",