@agentvault/openai-bridge 0.1.23 → 0.1.24

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,15 @@ 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 needs 0.162.1 (the previous one needed 0.154.0). Install that Codex FIRST, check `codex --version`, and, if the saved `config.json` pins a `binary` path, point it at the new executable — then install the new bridge and restart. A host still on the old Codex refuses every turn, text included, with "Unsupported Codex CLI". Codex sessions made by 0.154.0 resume under 0.162.1. If Codex is upgraded on its own, install the supported version again before restarting. If authentication expires, run `uninstall`, run `login` again with the same name, then run `install` again. These commands retain the agent credentials and history. For replacement enrollment, stop the existing service with `uninstall`, obtain a fresh recovery invite from the app, then run:
39
+ **Upgrading the bridge can need a new Codex.** Each bridge release runs with one exact Codex version; this one (0.1.24) needs 0.162.1, as 0.1.23 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
+
41
+ 1. Stop the service: `AV_AGENT_NAME=<name> agentvault-openai-bridge uninstall` (credentials and history are kept).
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.
43
+ 3. Set `binary` to the absolute path of the native executable, for example `<that folder>/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin/codex` on Apple silicon (other platforms have their own `@openai/codex-<platform>` folder). Or delete the `binary` key so the next `install` looks `codex` up again on your PATH; the first `codex` there must then be the native 0.162.1 executable.
44
+ 4. Update the bridge: `npm i -g @agentvault/openai-bridge`.
45
+ 5. Start the service: `AV_AGENT_NAME=<name> agentvault-openai-bridge install`.
46
+
47
+ A host still on the old Codex refuses every turn, text included, with "Unsupported Codex CLI". Codex sessions made by 0.154.0 resume under 0.162.1. If Codex is upgraded on its own, install the supported version again before restarting. If authentication expires, run `uninstall`, run `login` again with the same name, then run `install` again. These commands retain the agent credentials and history. For replacement enrollment, stop the existing service with `uninstall`, obtain a fresh recovery invite from the app, then run:
40
48
 
41
49
  ```sh
42
50
  AV_AGENT_NAME=aster AV_INVITE_TOKEN='<fresh-invite>' agentvault-openai-bridge replace
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.23";
3
+ export declare const VERSION = "0.1.24";
4
4
  export interface RunConfig {
5
5
  name: string;
6
6
  apiUrl: string;
package/dist/index.js CHANGED
@@ -278,7 +278,8 @@ function resolveOwn(mention, names) {
278
278
  }
279
279
  return null;
280
280
  }
281
- function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience) {
281
+ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true, roomAudience, senderBinding) {
282
+ if (senderBinding !== void 0 && senderBinding !== "bound") senderIsAgent = true;
282
283
  if (isPrivatePairHumanMessage(senderIsAgent, roomAudience)) return true;
283
284
  const mentions = parseMentions(plaintext);
284
285
  if (senderIsAgent === false && namesAgentPlainly(plaintext, agentName, roomDisplayName, ownDisplayName)) {
@@ -288,7 +289,7 @@ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDispl
288
289
  const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
289
290
  if (mentions.some((m2) => resolveOwn(m2, ownNames) !== null)) return true;
290
291
  if (mentions.some((m2) => resolveOwn(m2, BROADCAST_NAMES) !== null)) {
291
- return senderIsAgent !== true;
292
+ return senderBinding === "bound" && senderIsAgent !== true;
292
293
  }
293
294
  if (!selfResolved) return true;
294
295
  return false;
@@ -13186,11 +13187,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
13186
13187
  return null;
13187
13188
  }
13188
13189
  function ownIdentity() {
13189
- const v2 = true ? "0.23.72" : FALLBACK;
13190
+ const v2 = true ? "0.23.73" : FALLBACK;
13190
13191
  return `${PACKAGE}@${v2}`;
13191
13192
  }
13192
13193
  function buildSha() {
13193
- const raw = true ? "b70dedb" : "";
13194
+ const raw = true ? "cb8786f" : "";
13194
13195
  const cleaned = (raw ?? "").trim();
13195
13196
  return !cleaned || cleaned === "unknown" ? null : cleaned;
13196
13197
  }
@@ -16194,6 +16195,15 @@ function getActiveChannel(accountId = "default") {
16194
16195
  async function _handleInbound(params) {
16195
16196
  const { plaintext, metadata, channel, account, cfg, fileTurn } = params;
16196
16197
  const core = _ocRuntime;
16198
+ if (metadata.roomId && metadata.senderBinding !== "bound") {
16199
+ const ownDisplayName = channel.ownDisplayName ?? "";
16200
+ const agentName = account.agentName ?? "";
16201
+ const selfResolved = !!ownDisplayName || !!agentName && agentName.toLowerCase() !== "default";
16202
+ if (!owesRoomReply(metadata.caption ?? plaintext, agentName, account.accountId ?? "", true, void 0, ownDisplayName, selfResolved, metadata.roomAudience, metadata.senderBinding)) {
16203
+ 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)}`);
16204
+ return;
16205
+ }
16206
+ }
16197
16207
  const sessionKey = `agentvault:${account.accountId}:${(metadata.conversationId ?? "default").slice(0, 8)}`;
16198
16208
  const identity = metadata.roomId ? { id: `agentvault:room:${metadata.roomId}`, name: "Room Member", owner: false } : metadata.a2aChannelId ? { id: `a2a:${metadata.a2aChannelId}`, name: "Agent", owner: false } : dmSenderIdentity(metadata);
16199
16209
  const senderId = identity.id;
@@ -37606,7 +37616,7 @@ ${text}`,
37606
37616
  * #952 — sends held because MLS is expected for this conversation but the
37607
37617
  * group is not joined yet.
37608
37618
  *
37609
- * ⚠️ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
37619
+ * ⚠ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
37610
37620
  * disk, and the product's entire premise is that plaintext does not rest
37611
37621
  * where it does not have to; a crash losing a held greeting is the correct
37612
37622
  * trade. This is why the existing `outboundQueue` could not be reused — that
@@ -38515,7 +38525,7 @@ ${text}`,
38515
38525
  */
38516
38526
  sendActivitySpan(spanData) {
38517
38527
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
38518
- const pluginVersion = true ? "0.23.72" : "0.0.0-dev";
38528
+ const pluginVersion = true ? "0.23.73" : "0.0.0-dev";
38519
38529
  const agentName = this.config.agentName ?? "Agent";
38520
38530
  const resource = {
38521
38531
  "service.name": "agentvault-agent",
@@ -39538,6 +39548,7 @@ ${text}`,
39538
39548
  async sendStatusAlert(alert, routing) {
39539
39549
  const priority = alert.severity === "error" || alert.severity === "critical" ? "high" : "normal";
39540
39550
  const envelope = {
39551
+ type: "status_alert",
39541
39552
  title: alert.title,
39542
39553
  message: alert.message,
39543
39554
  severity: alert.severity,
@@ -39546,6 +39557,7 @@ ${text}`,
39546
39557
  if (alert.detail !== void 0) envelope.detail = alert.detail;
39547
39558
  if (alert.detailFormat !== void 0) envelope.detail_format = alert.detailFormat;
39548
39559
  if (alert.category !== void 0) envelope.category = alert.category;
39560
+ envelope.text = `[${String(alert.severity).toUpperCase()}] ${alert.title}: ${alert.message}`;
39549
39561
  await this.send(
39550
39562
  JSON.stringify(envelope),
39551
39563
  {
@@ -43402,6 +43414,8 @@ ${baseText}`;
43402
43414
  // #1800 PR B: the bound sender only (undefined when unbound).
43403
43415
  senderDeviceId: boundSender,
43404
43416
  senderBinding: binding.verdict,
43417
+ // #1855: why it is unbound, as on the onMessage metadata above.
43418
+ ...boundSender === void 0 ? { senderBindingReason: unverifiedReason(binding) } : {},
43405
43419
  ...claimedSender ? { claimedSenderDeviceId: claimedSender } : {},
43406
43420
  senderName: senderLabel,
43407
43421
  plaintext: messageText,
@@ -44932,7 +44946,7 @@ ${baseText}`;
44932
44946
  /**
44933
44947
  * Top the pool up against the SERVER's count (#826).
44934
44948
  *
44935
- * ⚠️ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
44949
+ * ⚠ DO NOT replace this with a periodic call to `_ensureKpPoolPublished()`.
44936
44950
  * That function early-returns on `_pendingKpBundles.length >= _KP_POOL_TARGET`,
44937
44951
  * and that array holds PRIVATE bundles which never expire locally — so on an
44938
44952
  * agent that has been connected longer than the KeyPackage lifetime it is
@@ -45225,7 +45239,7 @@ ${baseText}`;
45225
45239
  agentVersion: this.config.agentVersion ?? "0.0.0",
45226
45240
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
45227
45241
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
45228
- pluginVersion: true ? "0.23.72" : "0.0.0-dev"
45242
+ pluginVersion: true ? "0.23.73" : "0.0.0-dev"
45229
45243
  });
45230
45244
  this._telemetryReporter.startAutoFlush(3e4);
45231
45245
  }
@@ -47779,6 +47793,7 @@ ${baseText}`;
47779
47793
  init_file_send_failure();
47780
47794
  init_openclaw_file_send();
47781
47795
  init_openclaw_sender();
47796
+ init_room_protocol();
47782
47797
  _ocRuntime = null;
47783
47798
  _channels = /* @__PURE__ */ new Map();
47784
47799
  _legacyTurnRuns = new OpenClawTurnRuns();
@@ -69519,7 +69534,7 @@ data:
69519
69534
  init_room_protocol();
69520
69535
  init_tool_telemetry();
69521
69536
  init_turn_failure();
69522
- VERSION = true ? "0.23.72" : "0.0.0-dev";
69537
+ VERSION = true ? "0.23.73" : "0.0.0-dev";
69523
69538
  }
69524
69539
  });
69525
69540
  init_index();
@@ -70552,7 +70567,7 @@ var init_cli = __esm({
70552
70567
  "use strict";
70553
70568
  init_dist();
70554
70569
  init_driver();
70555
- VERSION2 = "0.1.23";
70570
+ VERSION2 = "0.1.24";
70556
70571
  HELP = `AgentVault OpenAI Bridge ${VERSION2}
70557
70572
  Usage: AV_AGENT_NAME=<name> agentvault-openai-bridge <command>
70558
70573
 
@@ -71700,7 +71715,7 @@ var init_bridge = __esm({
71700
71715
  }
71701
71716
  const roomName = this.channel.getRooms?.().find((room) => room.roomId === roomId)?.members.find((member) => member.deviceId === this.channel.deviceId)?.displayName;
71702
71717
  const sender = roomSenderView(e);
71703
- if (!owesRoomReply(e.caption ?? e.plaintext, this.name, this.channel.deviceId ?? "", sender.senderIsAgent, roomName, this.channel.ownDisplayName, true, e.roomAudience)) {
71718
+ if (!owesRoomReply(e.caption ?? e.plaintext, this.name, this.channel.deviceId ?? "", sender.senderIsAgent, roomName, this.channel.ownDisplayName, true, e.roomAudience, e.senderBinding)) {
71704
71719
  void fileTurn?.drop();
71705
71720
  return;
71706
71721
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@agentvault/openai-bridge", "version": "0.1.23", "type": "module",
2
+ "name": "@agentvault/openai-bridge", "version": "0.1.24", "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" },