@agentvault/claude-bridge 0.7.9 → 0.7.10

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
@@ -64124,6 +64124,31 @@ var init_transport2 = __esm2({
64124
64124
  "use strict";
64125
64125
  }
64126
64126
  });
64127
+ function a2aChannelSignature(channels) {
64128
+ return JSON.stringify(
64129
+ channels.map((c22) => ({
64130
+ id: c22.channelId?.slice(0, 8),
64131
+ status: c22.status,
64132
+ participants: c22.participant_count
64133
+ })).sort((a2, b22) => (a2.id ?? "").localeCompare(b22.id ?? ""))
64134
+ );
64135
+ }
64136
+ var A2ALogGate;
64137
+ var init_a2a_log_gate = __esm2({
64138
+ "src/a2a-log-gate.ts"() {
64139
+ "use strict";
64140
+ A2ALogGate = class {
64141
+ last = null;
64142
+ /** True when this state differs from the last reported one. Records it. */
64143
+ shouldReport(channels) {
64144
+ const sig = a2aChannelSignature(channels);
64145
+ if (sig === this.last) return false;
64146
+ this.last = sig;
64147
+ return true;
64148
+ }
64149
+ };
64150
+ }
64151
+ });
64127
64152
  var openclaw_compat_exports = {};
64128
64153
  __export2(openclaw_compat_exports, {
64129
64154
  AGENT_EVENT_CANDIDATES: () => AGENT_EVENT_CANDIDATES,
@@ -64683,6 +64708,7 @@ var init_channel = __esm2({
64683
64708
  await init_crypto_helpers();
64684
64709
  await init_state();
64685
64710
  init_transport2();
64711
+ init_a2a_log_gate();
64686
64712
  ROOM_AGENT_TYPES = /* @__PURE__ */ new Set([
64687
64713
  "message",
64688
64714
  "text",
@@ -64748,6 +64774,11 @@ var init_channel = __esm2({
64748
64774
  _heartbeatTimer = null;
64749
64775
  _heartbeatCallback = null;
64750
64776
  _heartbeatIntervalSeconds = 0;
64777
+ /** #798: report the A2A channel set only when it CHANGES. This line polls
64778
+ * every 30s and produced 90.2% of bridge.log (90,841/100,702 lines) and a
64779
+ * 27.9MB gateway.log on wren, every one reading `channels=0`. Not deleted —
64780
+ * #794's A2A watch needs the transitions. */
64781
+ _a2aLogGate = new A2ALogGate();
64751
64782
  _wakeDetectorTimer = null;
64752
64783
  _lastWakeTick = Date.now();
64753
64784
  _trustToken = null;
@@ -67201,7 +67232,9 @@ var init_channel = __esm2({
67201
67232
  }
67202
67233
  const myHub = this._persisted.hubAddress || "";
67203
67234
  const myHubId = this._persisted.hubId || "";
67204
- console.log(`[listA2AChannels] myHub=${myHub}, channels=${channels.length}, raw=${JSON.stringify(channels.map((c22) => ({ id: c22.channelId?.slice(0, 8), status: c22.status, participants: c22.participant_count })))}`);
67235
+ if (this._a2aLogGate.shouldReport(channels)) {
67236
+ console.log(`[listA2AChannels] myHub=${myHub}, channels=${channels.length}, raw=${JSON.stringify(channels.map((c22) => ({ id: c22.channelId?.slice(0, 8), status: c22.status, participants: c22.participant_count })))}`);
67237
+ }
67205
67238
  for (const ch2 of channels) {
67206
67239
  if (ch2.status === "active" || ch2.status === "approved") {
67207
67240
  const myParticipant = ch2.participants?.find(
@@ -133430,13 +133463,17 @@ var PersistentClaudeSession = class {
133430
133463
  const r7 = m6;
133431
133464
  const num = (k2) => typeof r7[k2] === "number" ? r7[k2] : void 0;
133432
133465
  const str = (k2) => typeof r7[k2] === "string" ? r7[k2] : void 0;
133466
+ const usage = r7.usage ?? {};
133467
+ const unum = (k2) => typeof usage[k2] === "number" ? usage[k2] : void 0;
133433
133468
  this.resultTelemetry = {
133434
133469
  durationMs: num("duration_ms"),
133435
133470
  durationApiMs: num("duration_api_ms"),
133436
133471
  numTurns: num("num_turns"),
133437
133472
  subtype: str("subtype"),
133438
133473
  stopReason: str("stop_reason"),
133439
- apiErrorStatus: num("api_error_status")
133474
+ apiErrorStatus: num("api_error_status"),
133475
+ cacheReadTokens: unum("cache_read_input_tokens"),
133476
+ cacheCreationTokens: unum("cache_creation_input_tokens")
133440
133477
  };
133441
133478
  const reply = this.activeReply;
133442
133479
  if (this.currentReplyExpected && !this.saidThisTurn && this.turnText.trim()) {
@@ -134148,7 +134185,7 @@ async function main() {
134148
134185
  "[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"
134149
134186
  );
134150
134187
  }
134151
- logLine(`[bridge] version: ${true ? "0.7.9" : "dev"}`);
134188
+ logLine(`[bridge] version: ${true ? "0.7.10" : "dev"}`);
134152
134189
  logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
134153
134190
  logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
134154
134191
  if (cfg.armRoom) {
package/dist/session.d.ts CHANGED
@@ -213,6 +213,8 @@ export declare class PersistentClaudeSession {
213
213
  subtype?: string;
214
214
  stopReason?: string;
215
215
  apiErrorStatus?: number;
216
+ cacheReadTokens?: number;
217
+ cacheCreationTokens?: number;
216
218
  };
217
219
  private input;
218
220
  /**
@@ -82,6 +82,12 @@ export type WorkerIncident = {
82
82
  subtype?: string;
83
83
  stopReason?: string;
84
84
  apiErrorStatus?: number;
85
+ /** Prompt-cache state — `cacheReadTokens === 0` with a large
86
+ * `cacheCreationTokens` marks a COLD turn, which costs ~2x a warm one for
87
+ * reasons unrelated to the code under test. Without it, a latency figure
88
+ * in this file cannot be read honestly. */
89
+ cacheReadTokens?: number;
90
+ cacheCreationTokens?: number;
85
91
  };
86
92
  };
87
93
  export interface WorkerQueueDeps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/claude-bridge",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "type": "module",
5
5
  "description": "AgentVault Claude Bridge \u2014 daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
6
6
  "main": "dist/index.js",