@cabane/companion 0.6.200 → 0.6.201

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/cli.js +17 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2379,6 +2379,20 @@ function summarizeToolInput(input) {
2379
2379
  }
2380
2380
  return "";
2381
2381
  }
2382
+ function summarizeToolIo(input) {
2383
+ const capped = typeof input === "string" ? input : capStrings(input, /* @__PURE__ */ new WeakSet());
2384
+ return truncate(renderToolIo(capped), TOOL_IO_MAX_CHARS);
2385
+ }
2386
+ function capStrings(value, ancestors) {
2387
+ if (typeof value === "string") return truncate(value, TOOL_IO_VALUE_MAX_CHARS);
2388
+ if (!value || typeof value !== "object" || ancestors.has(value)) return value;
2389
+ ancestors.add(value);
2390
+ const capped = Array.isArray(value) ? value.map((item) => capStrings(item, ancestors)) : Object.fromEntries(
2391
+ Object.entries(value).map(([key, item]) => [key, capStrings(item, ancestors)])
2392
+ );
2393
+ ancestors.delete(value);
2394
+ return capped;
2395
+ }
2382
2396
  function renderToolIo(input) {
2383
2397
  if (input === void 0 || input === null) return "";
2384
2398
  if (typeof input === "string") return input.trim();
@@ -2416,11 +2430,12 @@ function truncate(s, max) {
2416
2430
  if (s.length <= max) return s;
2417
2431
  return `${s.slice(0, max)}\u2026[+${s.length - max} chars]`;
2418
2432
  }
2419
- var TOOL_IO_MAX_CHARS;
2433
+ var TOOL_IO_MAX_CHARS, TOOL_IO_VALUE_MAX_CHARS;
2420
2434
  var init_transcript = __esm({
2421
2435
  "packages/agent-runtime/src/transcript.ts"() {
2422
2436
  "use strict";
2423
2437
  TOOL_IO_MAX_CHARS = 1e4;
2438
+ TOOL_IO_VALUE_MAX_CHARS = 2e3;
2424
2439
  }
2425
2440
  });
2426
2441
 
@@ -2440,7 +2455,7 @@ function sinkEmitter(sink, _onError) {
2440
2455
  toolUseId: event.id,
2441
2456
  toolName: event.name,
2442
2457
  summary: event.summary,
2443
- input: truncate(input, TOOL_IO_MAX_CHARS),
2458
+ input: summarizeToolIo(event.input),
2444
2459
  result: result === null ? "" : truncate(result, TOOL_IO_MAX_CHARS),
2445
2460
  // Only when the event carried an input: a completion whose start this process never saw has
2446
2461
  // none, and a zero would overwrite the size its start recorded.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabane/companion",
3
- "version": "0.6.200",
3
+ "version": "0.6.201",
4
4
  "type": "module",
5
5
  "description": "The Cabane Companion (headless): connect an agent on your machine to your Cabane workspace as a responder — drive work against your own codebase, files, and MCP servers without putting any of it in Cabane.",
6
6
  "license": "UNLICENSED",