@agentvault/agentvault 0.23.74 → 0.23.75

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/index.js CHANGED
@@ -349,7 +349,7 @@ var init_room_protocol = __esm({
349
349
  MENTION_RE = /@([\w-]+)/gi;
350
350
  BROADCAST_NAMES = /* @__PURE__ */ new Set(["all", "everyone"]);
351
351
  PRIVATE_ROOM_TURN_NOTE = "(private room: just you and your person \u2014 every message here is for you; answer it)";
352
- GENERIC_AGENT_NAMES = /* @__PURE__ */ new Set(["default", "agent", "assistant", "bot", "main"]);
352
+ GENERIC_AGENT_NAMES = /* @__PURE__ */ new Set(["default", "agent", "assistant", "bot", "main", "unnamed", "unnamed agent"]);
353
353
  }
354
354
  });
355
355
 
@@ -24115,11 +24115,11 @@ var init_mls_kp_pool = __esm({
24115
24115
 
24116
24116
  // src/client-version.ts
24117
24117
  function ownIdentity() {
24118
- const v2 = true ? "0.23.74" : FALLBACK;
24118
+ const v2 = true ? "0.23.75" : FALLBACK;
24119
24119
  return `${PACKAGE}@${v2}`;
24120
24120
  }
24121
24121
  function buildSha() {
24122
- const raw = true ? "91424d1" : "";
24122
+ const raw = true ? "c389222" : "";
24123
24123
  const cleaned = (raw ?? "").trim();
24124
24124
  return !cleaned || cleaned === "unknown" ? null : cleaned;
24125
24125
  }
@@ -33557,7 +33557,7 @@ ${text}`,
33557
33557
  */
33558
33558
  sendActivitySpan(spanData) {
33559
33559
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
33560
- const pluginVersion = true ? "0.23.74" : "0.0.0-dev";
33560
+ const pluginVersion = true ? "0.23.75" : "0.0.0-dev";
33561
33561
  const agentName = this.config.agentName ?? "Agent";
33562
33562
  const resource = {
33563
33563
  "service.name": "agentvault-agent",
@@ -40342,7 +40342,7 @@ ${baseText}`;
40342
40342
  agentVersion: this.config.agentVersion ?? "0.0.0",
40343
40343
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
40344
40344
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
40345
- pluginVersion: true ? "0.23.74" : "0.0.0-dev"
40345
+ pluginVersion: true ? "0.23.75" : "0.0.0-dev"
40346
40346
  });
40347
40347
  this._telemetryReporter.startAutoFlush(3e4);
40348
40348
  }
@@ -43292,12 +43292,15 @@ function getActiveChannel(accountId = "default") {
43292
43292
  async function _handleInbound(params) {
43293
43293
  const { plaintext, metadata, channel, account, cfg, fileTurn } = params;
43294
43294
  const core = _ocRuntime;
43295
- if (metadata.roomId && metadata.senderBinding !== "bound") {
43296
- const ownDisplayName = channel.ownDisplayName ?? "";
43295
+ if (metadata.roomId) {
43297
43296
  const agentName = account.agentName ?? "";
43298
- const selfResolved = !!ownDisplayName || !!agentName && agentName.toLowerCase() !== "default";
43299
- if (!owesRoomReply(metadata.caption ?? plaintext, agentName, account.accountId ?? "", true, void 0, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
43300
- 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)}`);
43297
+ const roomSelfName = _roomSelfName(channel, metadata.roomId);
43298
+ const ownDisplayName = channel.ownDisplayName ?? "";
43299
+ const selfResolved = !!ownDisplayName || !!roomSelfName && roomSelfName !== agentName || !!agentName && agentName.toLowerCase() !== "default";
43300
+ const gateText = metadata.caption ?? plaintext;
43301
+ const gateSenderIsAgent = metadata.senderBinding === "bound" ? metadata.senderIsAgent : true;
43302
+ if (!owesRoomReply(gateText, agentName, account.accountId ?? "", gateSenderIsAgent, roomSelfName || agentName, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
43303
+ console.log(`[AgentVault] room message read, not answered \u2014 no @mention for this agent (#1107/#1859) room=${String(metadata.roomId).slice(0, 8)}`);
43301
43304
  return;
43302
43305
  }
43303
43306
  }
@@ -43326,9 +43329,16 @@ async function _handleInbound(params) {
43326
43329
  replyHost = { ...limitRoots !== void 0 ? { limitRoots } : {}, ...sandboxed ? { sandboxed: true } : {} };
43327
43330
  }
43328
43331
  noteTurnSandbox(fileTurn?.token, replyHost.sandboxed === true);
43329
- const modelBody = fileSendOn ? `${neutralizeForeignLine(plaintext)}
43332
+ const currentBody = neutralizeForeignLine(plaintext);
43333
+ const roomHistory = metadata.roomId ? _roomHistoryBlock(channel, metadata.roomId) : "";
43334
+ const contextBody = roomHistory ? `[Recent room conversation]
43335
+ ${roomHistory}
43336
+
43337
+ [Current message]
43338
+ ${currentBody}` : currentBody;
43339
+ const modelBody = fileSendOn ? `${contextBody}
43330
43340
 
43331
- ${openclawFileLines(channel, fileTarget, { roomsAllowed: false })}` : neutralizeForeignLine(plaintext);
43341
+ ${openclawFileLines(channel, fileTarget, { roomsAllowed: false })}` : contextBody;
43332
43342
  const body = core.channel.reply.formatAgentEnvelope({
43333
43343
  channel: "AgentVault",
43334
43344
  from: identity.name,
@@ -43410,6 +43420,27 @@ ${openclawFileLines(channel, fileTarget, { roomsAllowed: false })}` : neutralize
43410
43420
  const result = await trackedRun;
43411
43421
  await _legacyTurnRuns.afterDispatch(channel, runKey, fileTurn, result, trackedRun);
43412
43422
  }
43423
+ function _roomSelfName(channel, roomId) {
43424
+ try {
43425
+ const room = channel.getRooms().find((r2) => r2.roomId === roomId);
43426
+ const self2 = room?.members?.find((m2) => m2.deviceId === channel.deviceId);
43427
+ return typeof self2?.displayName === "string" ? self2.displayName : "";
43428
+ } catch {
43429
+ return "";
43430
+ }
43431
+ }
43432
+ function _roomHistoryBlock(channel, roomId) {
43433
+ const prior = channel.getRoomHistory(roomId, 20).slice(0, -1);
43434
+ return prior.map((h2) => {
43435
+ if (h2.sender === "agent") {
43436
+ const files = Array.isArray(h2.files) && h2.files.length > 0 ? `
43437
+ ${renderHistoryFiles(h2.files)}` : "";
43438
+ return `[You]: ${h2.text}${files}`;
43439
+ }
43440
+ const who = h2.sender === "unverified" ? "Unverified sender" : "Room Member";
43441
+ return `[${who}]: ${neutralizeForeignLine(String(h2.text ?? ""))}`;
43442
+ }).join("\n");
43443
+ }
43413
43444
  var _ocRuntime, _channels, _legacyTurnRuns, agentVaultPlugin;
43414
43445
  var init_openclaw_plugin = __esm({
43415
43446
  "src/openclaw-plugin.ts"() {
@@ -70803,7 +70834,7 @@ var init_index = __esm({
70803
70834
  init_tool_telemetry();
70804
70835
  init_turn_failure();
70805
70836
  init_shell_word();
70806
- VERSION = true ? "0.23.74" : "0.0.0-dev";
70837
+ VERSION = true ? "0.23.75" : "0.0.0-dev";
70807
70838
  }
70808
70839
  });
70809
70840
  init_index();