@agentvault/claude-bridge 0.7.12 → 0.7.13

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 +51 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -63854,6 +63854,35 @@ var init_mls_kp_pool = __esm2({
63854
63854
  await init_dist();
63855
63855
  }
63856
63856
  });
63857
+ function ownIdentity() {
63858
+ const v22 = true ? "0.23.22" : FALLBACK;
63859
+ return `${PACKAGE}@${v22}`;
63860
+ }
63861
+ function buildClientVersion(override) {
63862
+ try {
63863
+ const candidate = (override ?? "").trim();
63864
+ if (candidate) {
63865
+ const cleaned = candidate.replace(DISALLOWED, "").slice(0, MAX_LEN);
63866
+ if (cleaned && !cleaned.includes("..")) return cleaned;
63867
+ }
63868
+ return ownIdentity().replace(DISALLOWED, "").slice(0, MAX_LEN);
63869
+ } catch {
63870
+ return FALLBACK;
63871
+ }
63872
+ }
63873
+ var PACKAGE;
63874
+ var FALLBACK;
63875
+ var MAX_LEN;
63876
+ var DISALLOWED;
63877
+ var init_client_version = __esm2({
63878
+ "src/client-version.ts"() {
63879
+ "use strict";
63880
+ PACKAGE = "@agentvault/agentvault";
63881
+ FALLBACK = "0.0.0-dev";
63882
+ MAX_LEN = 64;
63883
+ DISALLOWED = /[^A-Za-z0-9._@/+-]/g;
63884
+ }
63885
+ });
63857
63886
  var CredentialStore;
63858
63887
  var init_credential_store = __esm2({
63859
63888
  "src/credential-store.ts"() {
@@ -64743,6 +64772,7 @@ var init_channel = __esm2({
64743
64772
  await init_dist();
64744
64773
  init_mls_state();
64745
64774
  await init_mls_kp_pool();
64775
+ init_client_version();
64746
64776
  init_credential_store();
64747
64777
  await init_crypto_helpers();
64748
64778
  await init_state();
@@ -65803,7 +65833,7 @@ var init_channel = __esm2({
65803
65833
  */
65804
65834
  sendActivitySpan(spanData) {
65805
65835
  if (!this._ws || this._ws.readyState !== WebSocket2.OPEN) return;
65806
- const pluginVersion = true ? "0.23.21" : "0.0.0-dev";
65836
+ const pluginVersion = true ? "0.23.22" : "0.0.0-dev";
65807
65837
  const agentName = this.config.agentName ?? "Agent";
65808
65838
  const resource = {
65809
65839
  "service.name": "agentvault-agent",
@@ -67672,7 +67702,7 @@ var init_channel = __esm2({
67672
67702
  return;
67673
67703
  }
67674
67704
  const wsUrl = this.config.apiUrl.replace(/^http/, "ws");
67675
- const url22 = `${wsUrl}/api/v1/ws?token=${encodeURIComponent(this._deviceJwt)}&device_id=${this._deviceId}`;
67705
+ const url22 = `${wsUrl}/api/v1/ws?token=${encodeURIComponent(this._deviceJwt)}&device_id=${this._deviceId}&client_version=${encodeURIComponent(buildClientVersion(this.config.clientVersion))}`;
67676
67706
  const ws = new WebSocket2(url22);
67677
67707
  this._ws = ws;
67678
67708
  ws.on("open", async () => {
@@ -67713,7 +67743,7 @@ var init_channel = __esm2({
67713
67743
  agentVersion: this.config.agentVersion ?? "0.0.0",
67714
67744
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
67715
67745
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
67716
- pluginVersion: true ? "0.23.21" : "0.0.0-dev"
67746
+ pluginVersion: true ? "0.23.22" : "0.0.0-dev"
67717
67747
  });
67718
67748
  this._telemetryReporter.startAutoFlush(3e4);
67719
67749
  }
@@ -68037,7 +68067,7 @@ var init_channel = __esm2({
68037
68067
  agentVersion: this.config.agentVersion ?? "0.0.0",
68038
68068
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
68039
68069
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
68040
- pluginVersion: true ? "0.23.21" : "0.0.0-dev"
68070
+ pluginVersion: true ? "0.23.22" : "0.0.0-dev"
68041
68071
  });
68042
68072
  this._telemetryReporter.startAutoFlush(3e4);
68043
68073
  }
@@ -69797,8 +69827,11 @@ ${messageText}`;
69797
69827
  */
69798
69828
  async _fetchServerKpCount() {
69799
69829
  try {
69830
+ const horizonSeconds = Math.floor(
69831
+ _SecureChannel._KP_REPLENISH_INTERVAL_MS * 2 / 1e3
69832
+ );
69800
69833
  const res = await fetch(
69801
- `${this.config.apiUrl}/api/v1/mls/key-packages/count?device_id=${this._deviceId}`,
69834
+ `${this.config.apiUrl}/api/v1/mls/key-packages/count?device_id=${this._deviceId}&renew_within_seconds=${horizonSeconds}`,
69802
69835
  { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
69803
69836
  );
69804
69837
  if (!res.ok) return null;
@@ -98024,7 +98057,7 @@ var init_index = __esm2({
98024
98057
  init_skill_invoker();
98025
98058
  await init_skill_telemetry();
98026
98059
  await init_policy_enforcer();
98027
- VERSION = true ? "0.23.21" : "0.0.0-dev";
98060
+ VERSION = true ? "0.23.22" : "0.0.0-dev";
98028
98061
  }
98029
98062
  });
98030
98063
  await init_index();
@@ -134378,7 +134411,7 @@ async function main() {
134378
134411
  "[bridge] warning: passing the invite token on the command line is visible to other local users via 'ps'. Prefer: AV_INVITE_TOKEN=\u2026 npx @agentvault/claude-bridge"
134379
134412
  );
134380
134413
  }
134381
- logLine(`[bridge] version: ${true ? "0.7.12" : "dev"}`);
134414
+ logLine(`[bridge] version: ${true ? "0.7.13" : "dev"}`);
134382
134415
  logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
134383
134416
  logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
134384
134417
  if (cfg.armRoom) {
@@ -134400,7 +134433,17 @@ async function main() {
134400
134433
  dataDir: cfg.dataDir,
134401
134434
  apiUrl: cfg.apiUrl,
134402
134435
  agentName: cfg.agentName,
134403
- platform: "node"
134436
+ platform: "node",
134437
+ // #836: identify the BRIDGE, not the plugin it vendors. Two reasons this
134438
+ // must be explicit. Operators install and upgrade the bridge, so the bridge
134439
+ // build is the one they can act on — reporting the inner plugin version is
134440
+ // the exact confusion #836 was opened about (a bridge on 0.3.2 read as
134441
+ // "same bug, didn't restart"). And because this build BUNDLES the plugin,
134442
+ // the plugin's own `__AV_VERSION__` resolves to OUR package.json here, so
134443
+ // its default would render "@agentvault/agentvault@0.7.x" — the wrong
134444
+ // package name attached to the bridge's version number, which is worse
134445
+ // than either alone.
134446
+ clientVersion: `@agentvault/claude-bridge@${true ? "0.7.13" : "dev"}`
134404
134447
  });
134405
134448
  const agentSystemPrompt = cfg.systemPrompt ?? `You are ${cfg.agentName}, an AI agent on AgentVault. You talk with your owner in 1:1 direct messages and collaborate with other agents in shared rooms. That is your identity \u2014 introduce yourself by that name and do not claim to be any other agent. To speak, call the say tool. In a 1:1 with your owner, reply to what they say. In a room you see every message \u2014 call say only when you have something worth adding, and otherwise stay silent. Keep messages concise.`;
134406
134449
  const deviceJwt = () => {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@agentvault/claude-bridge",
3
- "version": "0.7.12",
3
+ "version": "0.7.13",
4
4
  "type": "module",
5
- "description": "AgentVault Claude Bridge \u2014 daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
5
+ "description": "AgentVault Claude Bridge daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "bin": {