@agentvault/openai-bridge 0.1.25 → 0.1.26

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/README.md CHANGED
@@ -36,7 +36,7 @@ AV_AGENT_NAME=aster agentvault-openai-bridge uninstall
36
36
 
37
37
  macOS uses a per-user launchd service; Linux uses user systemd. Linux services normally require an active user manager; configure user lingering separately if you need execution after logout. Services use the resolved stable Node and bridge paths, and the saved absolute Codex path. `uninstall` removes the service definition and retains credentials/history. `status` reports service-manager state; `doctor` checks binary compatibility and file presence, without opening credentials or claiming that the account is valid.
38
38
 
39
- **Upgrading the bridge can need a new Codex.** Each bridge release runs with one exact Codex version; this one (0.1.25) needs 0.162.1, as 0.1.23 and 0.1.24 did (0.1.22 and earlier needed 0.154.0). The bridge **always** records the Codex executable it uses as `binary` in `~/.agentvault/openai/<name>/config.json` (on every `run`, `replace` and `install`), so installing a new Codex on your PATH does not change an existing agent, and a running bridge refuses every turn if the executable at `binary` changes under it. Do it in this order:
39
+ **Upgrading the bridge can need a new Codex.** Each bridge release runs with one exact Codex version; this one (0.1.26) needs 0.162.1, as 0.1.23 through 0.1.25 did (0.1.22 and earlier needed 0.154.0). The bridge **always** records the Codex executable it uses as `binary` in `~/.agentvault/openai/<name>/config.json` (on every `run`, `replace` and `install`), so installing a new Codex on your PATH does not change an existing agent, and a running bridge refuses every turn if the executable at `binary` changes under it. Do it in this order:
40
40
 
41
41
  1. Stop the service: `AV_AGENT_NAME='<name>' agentvault-openai-bridge uninstall` (credentials and history are kept).
42
42
  2. Install Codex 0.162.1 as the **native** executable: `npm install @openai/codex@0.162.1` in a folder you keep, or the standalone install. npm's `codex` launcher is a Node script and will not run, because the bridge gives Codex only `/usr/bin:/bin` as its PATH.
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type HistoryRecoveryCommandInput } from "@agentvault/agentvault";
2
2
  import { type Layout } from "./driver.js";
3
- export declare const VERSION = "0.1.25";
3
+ export declare const VERSION = "0.1.26";
4
4
  export interface RunConfig {
5
5
  name: string;
6
6
  apiUrl: string;
package/dist/index.js CHANGED
@@ -13188,11 +13188,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
13188
13188
  return null;
13189
13189
  }
13190
13190
  function ownIdentity() {
13191
- const v2 = true ? "0.23.74" : FALLBACK;
13191
+ const v2 = true ? "0.23.75" : FALLBACK;
13192
13192
  return `${PACKAGE}@${v2}`;
13193
13193
  }
13194
13194
  function buildSha() {
13195
- const raw = true ? "91424d1" : "";
13195
+ const raw = true ? "c389222" : "";
13196
13196
  const cleaned = (raw ?? "").trim();
13197
13197
  return !cleaned || cleaned === "unknown" ? null : cleaned;
13198
13198
  }
@@ -16256,12 +16256,15 @@ function getActiveChannel(accountId = "default") {
16256
16256
  async function _handleInbound(params) {
16257
16257
  const { plaintext, metadata, channel, account, cfg, fileTurn } = params;
16258
16258
  const core = _ocRuntime;
16259
- if (metadata.roomId && metadata.senderBinding !== "bound") {
16260
- const ownDisplayName = channel.ownDisplayName ?? "";
16259
+ if (metadata.roomId) {
16261
16260
  const agentName = account.agentName ?? "";
16262
- const selfResolved = !!ownDisplayName || !!agentName && agentName.toLowerCase() !== "default";
16263
- if (!owesRoomReply(metadata.caption ?? plaintext, agentName, account.accountId ?? "", true, void 0, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
16264
- 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)}`);
16261
+ const roomSelfName = _roomSelfName(channel, metadata.roomId);
16262
+ const ownDisplayName = channel.ownDisplayName ?? "";
16263
+ const selfResolved = !!ownDisplayName || !!roomSelfName && roomSelfName !== agentName || !!agentName && agentName.toLowerCase() !== "default";
16264
+ const gateText = metadata.caption ?? plaintext;
16265
+ const gateSenderIsAgent = metadata.senderBinding === "bound" ? metadata.senderIsAgent : true;
16266
+ if (!owesRoomReply(gateText, agentName, account.accountId ?? "", gateSenderIsAgent, roomSelfName || agentName, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
16267
+ console.log(`[AgentVault] room message read, not answered \u2014 no @mention for this agent (#1107/#1859) room=${String(metadata.roomId).slice(0, 8)}`);
16265
16268
  return;
16266
16269
  }
16267
16270
  }
@@ -16290,9 +16293,16 @@ async function _handleInbound(params) {
16290
16293
  replyHost = { ...limitRoots !== void 0 ? { limitRoots } : {}, ...sandboxed ? { sandboxed: true } : {} };
16291
16294
  }
16292
16295
  noteTurnSandbox(fileTurn?.token, replyHost.sandboxed === true);
16293
- const modelBody = fileSendOn ? `${neutralizeForeignLine(plaintext)}
16296
+ const currentBody = neutralizeForeignLine(plaintext);
16297
+ const roomHistory = metadata.roomId ? _roomHistoryBlock(channel, metadata.roomId) : "";
16298
+ const contextBody = roomHistory ? `[Recent room conversation]
16299
+ ${roomHistory}
16300
+
16301
+ [Current message]
16302
+ ${currentBody}` : currentBody;
16303
+ const modelBody = fileSendOn ? `${contextBody}
16294
16304
 
16295
- ${openclawFileLines(channel, fileTarget, { roomsAllowed: false })}` : neutralizeForeignLine(plaintext);
16305
+ ${openclawFileLines(channel, fileTarget, { roomsAllowed: false })}` : contextBody;
16296
16306
  const body = core.channel.reply.formatAgentEnvelope({
16297
16307
  channel: "AgentVault",
16298
16308
  from: identity.name,
@@ -16374,6 +16384,27 @@ ${openclawFileLines(channel, fileTarget, { roomsAllowed: false })}` : neutralize
16374
16384
  const result = await trackedRun;
16375
16385
  await _legacyTurnRuns.afterDispatch(channel, runKey, fileTurn, result, trackedRun);
16376
16386
  }
16387
+ function _roomSelfName(channel, roomId) {
16388
+ try {
16389
+ const room = channel.getRooms().find((r2) => r2.roomId === roomId);
16390
+ const self2 = room?.members?.find((m2) => m2.deviceId === channel.deviceId);
16391
+ return typeof self2?.displayName === "string" ? self2.displayName : "";
16392
+ } catch {
16393
+ return "";
16394
+ }
16395
+ }
16396
+ function _roomHistoryBlock(channel, roomId) {
16397
+ const prior = channel.getRoomHistory(roomId, 20).slice(0, -1);
16398
+ return prior.map((h2) => {
16399
+ if (h2.sender === "agent") {
16400
+ const files = Array.isArray(h2.files) && h2.files.length > 0 ? `
16401
+ ${renderHistoryFiles(h2.files)}` : "";
16402
+ return `[You]: ${h2.text}${files}`;
16403
+ }
16404
+ const who = h2.sender === "unverified" ? "Unverified sender" : "Room Member";
16405
+ return `[${who}]: ${neutralizeForeignLine(String(h2.text ?? ""))}`;
16406
+ }).join("\n");
16407
+ }
16377
16408
  function resolveBaseUrl(options) {
16378
16409
  const host = options?.host ?? "127.0.0.1";
16379
16410
  const port = options?.port ?? (process.env.GATEWAY_SEND_PORT ? Number(process.env.GATEWAY_SEND_PORT) : 18790);
@@ -21723,7 +21754,7 @@ var init_dist = __esm({
21723
21754
  MENTION_RE = /@([\w-]+)/gi;
21724
21755
  BROADCAST_NAMES = /* @__PURE__ */ new Set(["all", "everyone"]);
21725
21756
  PRIVATE_ROOM_TURN_NOTE = "(private room: just you and your person \u2014 every message here is for you; answer it)";
21726
- GENERIC_AGENT_NAMES = /* @__PURE__ */ new Set(["default", "agent", "assistant", "bot", "main"]);
21757
+ GENERIC_AGENT_NAMES = /* @__PURE__ */ new Set(["default", "agent", "assistant", "bot", "main", "unnamed", "unnamed agent"]);
21727
21758
  }
21728
21759
  });
21729
21760
  init_safe_attachment_name = __esm2({
@@ -38672,7 +38703,7 @@ ${text}`,
38672
38703
  */
38673
38704
  sendActivitySpan(spanData) {
38674
38705
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
38675
- const pluginVersion = true ? "0.23.74" : "0.0.0-dev";
38706
+ const pluginVersion = true ? "0.23.75" : "0.0.0-dev";
38676
38707
  const agentName = this.config.agentName ?? "Agent";
38677
38708
  const resource = {
38678
38709
  "service.name": "agentvault-agent",
@@ -45457,7 +45488,7 @@ ${baseText}`;
45457
45488
  agentVersion: this.config.agentVersion ?? "0.0.0",
45458
45489
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
45459
45490
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
45460
- pluginVersion: true ? "0.23.74" : "0.0.0-dev"
45491
+ pluginVersion: true ? "0.23.75" : "0.0.0-dev"
45461
45492
  });
45462
45493
  this._telemetryReporter.startAutoFlush(3e4);
45463
45494
  }
@@ -69782,7 +69813,7 @@ data:
69782
69813
  init_tool_telemetry();
69783
69814
  init_turn_failure();
69784
69815
  init_shell_word();
69785
- VERSION = true ? "0.23.74" : "0.0.0-dev";
69816
+ VERSION = true ? "0.23.75" : "0.0.0-dev";
69786
69817
  }
69787
69818
  });
69788
69819
  init_index();
@@ -70815,7 +70846,7 @@ var init_cli = __esm({
70815
70846
  "use strict";
70816
70847
  init_dist();
70817
70848
  init_driver();
70818
- VERSION2 = "0.1.25";
70849
+ VERSION2 = "0.1.26";
70819
70850
  HELP = `AgentVault OpenAI Bridge ${VERSION2}
70820
70851
  Usage: AV_AGENT_NAME=<name> agentvault-openai-bridge <command>
70821
70852
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@agentvault/openai-bridge", "version": "0.1.25", "type": "module",
2
+ "name": "@agentvault/openai-bridge", "version": "0.1.26", "type": "module",
3
3
  "description": "AgentVault OpenAI Codex bridge for encrypted owner messages and rooms",
4
4
  "main": "dist/index.js", "types": "dist/index.d.ts",
5
5
  "bin": { "agentvault-openai-bridge": "dist/index.js" },