cookbook-bridge 0.1.6 → 0.1.7

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 (3) hide show
  1. package/bridge.mjs +1 -2
  2. package/live.mjs +7 -1
  3. package/package.json +1 -1
package/bridge.mjs CHANGED
@@ -30,6 +30,7 @@ import os from "node:os";
30
30
  import path from "node:path";
31
31
  import { fileURLToPath } from "node:url";
32
32
  import { spawn } from "node:child_process";
33
+ import { callsFromStreamLine, foldCallEvent, wireCalls } from "./live.mjs";
33
34
 
34
35
  // LOCAL modules load LAZILY (loadRuntime below), not statically: a Bridge with a
35
36
  // missing/corrupt module file must still be able to run `node bridge.mjs update` and
@@ -48,14 +49,12 @@ let createLocalServer, toolsForMode, modeForTools, vendorOf;
48
49
  let connectAgentsProgrammatic, detectClis;
49
50
  let serveCalls, describeCall, hostingMode;
50
51
  let fetchHands, claimHandsCall, reportHandsResult;
51
- let callsFromStreamLine, foldCallEvent, wireCalls;
52
52
 
53
53
  async function loadRuntime() {
54
54
  ({ createLocalServer, toolsForMode, modeForTools, vendorOf } = await import("./local.mjs"));
55
55
  ({ connectAgentsProgrammatic, detectClis } = await import("./device.mjs"));
56
56
  ({ listWorkspaces, listTasks, listOpenWork, getTask, threadResumeContext, completeTaskApi, resolveDelegation, reportTaskUsage, reportTaskProgress, volunteerClaim, dispatchClaim, abandonTask, recallMemories, recallAcrossWorkspaces, creditRecall, getVolunteerSettings, fetchHands, claimHandsCall, reportHandsResult, agentsQuery } = await import("./cookbook.mjs"));
57
57
  ({ serveCalls, describeCall, hostingMode } = await import("./hands.mjs"));
58
- ({ callsFromStreamLine, foldCallEvent, wireCalls } = await import("./live.mjs"));
59
58
  ({ agentEnv, checkGeminiVersion, isGeminiCommand, GEMINI_MIN_VERSION, checkAgyVersion, isAgyCommand, AGY_MIN_VERSION, withCookbookMcp, isClaudeCommand } = await import("./harden.mjs"));
60
59
  ({ extractUsage, displayText } = await import("./usage.mjs"));
61
60
  ({ volunteeringEnabled, volunteerCandidates, decisionPrompt, parseDecision, MAX_DECISIONS_PER_POLL, mergeVolunteerSettings, effectiveCapabilities } = await import("./volunteer.mjs"));
package/live.mjs CHANGED
@@ -17,6 +17,9 @@
17
17
  * The server re-validates every field (src/lib/workspaces/live-calls.ts).
18
18
  */
19
19
 
20
+ import os from "node:os";
21
+ import { redact } from "./hands.mjs";
22
+
20
23
  export const LIVE_CALLS_CAP = 12;
21
24
  const NAME_CAP = 60;
22
25
  const ARG_CAP = 120;
@@ -71,7 +74,9 @@ export function argFor(input) {
71
74
  }
72
75
 
73
76
  function clip(s) {
74
- const one = String(s).replace(/\s+/g, " ").trim();
77
+ // Redact FIRST: a `curl -H "Authorization: Bearer …"` or an exported key must never
78
+ // reach the work log (every viewer of the thread sees it, and it persists).
79
+ const one = redact(String(s).replace(/\s+/g, " ").trim(), { home: os.homedir() });
75
80
  return one.length > ARG_CAP ? one.slice(0, ARG_CAP - 1) + "…" : one;
76
81
  }
77
82
 
@@ -151,6 +156,7 @@ export function foldCallEvent(list, ev, now = Date.now()) {
151
156
  const cur = Array.isArray(list) ? list : [];
152
157
  if (!ev) return cur;
153
158
  if (ev.kind === "call") {
159
+ if (ev.id && cur.some((c) => c.id === ev.id)) return cur; // vendor re-emitted the same call
154
160
  const next = [...cur, { id: ev.id || "", n: ev.name, a: ev.arg || "", s: "run", at: now }];
155
161
  return next.length > LIVE_CALLS_CAP ? next.slice(next.length - LIVE_CALLS_CAP) : next;
156
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cookbook-bridge",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Run your own Claude, Codex and Gemini subscriptions against your Cookbook workspaces. One approval connects every agent CLI on your machine, with a receipt for every run.",
5
5
  "type": "module",
6
6
  "bin": {