agentfootprint-lens 0.42.0 → 0.43.0

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
@@ -111,6 +111,20 @@ Lens watches agentfootprint's typed event stream — `agentfootprint.agent.*`,
111
111
  of the 65-type registry. You never wire events yourself; `recorder.observe()`
112
112
  subscribes to all of them.
113
113
 
114
+ **A long tool call is no longer a silence.** When a tool reports from inside
115
+ its own `execute` with `ctx.progress(payload)` (agentfootprint 9.52+), each
116
+ report lands in the stream between that call's start and its end:
117
+
118
+ ```
119
+ `walk_graph` reported progress (iteration 1): {"hop":1,"of":3,"node":"svc-a"}
120
+ ```
121
+
122
+ The three identity fields are stamped by the framework, so the line states them
123
+ as facts. The payload is the tool author's own data — the Lens shows a preview
124
+ of it rather than guessing at a shape it was never promised, and says so when
125
+ it had to cut one short. A tool that never calls `ctx.progress` files nothing,
126
+ and nothing here invents a report it did not make.
127
+
114
128
  ---
115
129
 
116
130
  ## Multiple watchers, one agent
@@ -9,7 +9,7 @@ import {
9
9
  selectHops,
10
10
  selectToolChoiceCall,
11
11
  structureGraphFromRunner
12
- } from "./chunk-JE37MDVV.js";
12
+ } from "./chunk-VBMVWQUO.js";
13
13
  import {
14
14
  MODE_PALETTES,
15
15
  T,
@@ -4172,4 +4172,4 @@ export {
4172
4172
  WhereFrom,
4173
4173
  Lens
4174
4174
  };
4175
- //# sourceMappingURL=chunk-YQXVXNXK.js.map
4175
+ //# sourceMappingURL=chunk-CWKOGPOJ.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  formatBytes,
3
3
  structureGraphFromRunner
4
- } from "./chunk-JE37MDVV.js";
4
+ } from "./chunk-VBMVWQUO.js";
5
5
 
6
6
  // src/core/buildStepGraphFromSnapshot.ts
7
7
  function buildStepGraphFromSnapshot(snapshot) {
@@ -1189,4 +1189,4 @@ export {
1189
1189
  decisionSentence,
1190
1190
  isConsentDecision
1191
1191
  };
1192
- //# sourceMappingURL=chunk-VKBQYD6I.js.map
1192
+ //# sourceMappingURL=chunk-UWN5VKQ2.js.map
@@ -1464,6 +1464,36 @@ function humanizeEvidenceChecked(p) {
1464
1464
  }
1465
1465
  }
1466
1466
 
1467
+ // src/core/humanizeToolProgress.ts
1468
+ var PREVIEW_LIMIT = 120;
1469
+ function previewProgressPayload(payload) {
1470
+ if (payload === void 0) return null;
1471
+ let text;
1472
+ if (typeof payload === "string") {
1473
+ text = payload;
1474
+ } else {
1475
+ try {
1476
+ const json = JSON.stringify(payload);
1477
+ if (json === void 0) return null;
1478
+ text = json;
1479
+ } catch {
1480
+ return "(payload could not be shown)";
1481
+ }
1482
+ }
1483
+ if (text.length <= PREVIEW_LIMIT) return text;
1484
+ return `${text.slice(0, PREVIEW_LIMIT)}\u2026 (truncated; ${text.length - PREVIEW_LIMIT} more chars)`;
1485
+ }
1486
+ function humanizeToolProgress(payload) {
1487
+ const tool = payload.toolName !== void 0 ? `\`${payload.toolName}\`` : "A tool";
1488
+ const iter = typeof payload.iteration === "number" && payload.iteration > 0 ? ` (iteration ${payload.iteration})` : "";
1489
+ const preview = previewProgressPayload(payload.payload);
1490
+ return preview === null ? `${tool} reported progress${iter}.` : `${tool} reported progress${iter}: ${preview}`;
1491
+ }
1492
+ function humanizeToolProgressTeaching(payload) {
1493
+ const tool = payload.toolName !== void 0 ? `The \`${payload.toolName}\` tool` : "A tool";
1494
+ return `${tool} reported progress while it was still running.`;
1495
+ }
1496
+
1467
1497
  // src/core/humanizeArtifacts.ts
1468
1498
  var ticket = (ref, kind, bytes) => `${ref ?? "art_?"} [${kind ?? "?"} \xB7 ${formatBytes(bytes ?? 0)}]`;
1469
1499
  function humanizeArtifactMinted(p) {
@@ -1552,6 +1582,12 @@ var defaultHumanizer = (event) => {
1552
1582
  return `Model replied in ${event.payload.durationMs}ms (${event.payload.usage.input}+${event.payload.usage.output} tokens, ${event.payload.toolCallCount} tool calls, stop: ${event.payload.stopReason}).`;
1553
1583
  case "agentfootprint.stream.tool_start":
1554
1584
  return `Calling tool "${event.payload.toolName}" with ${JSON.stringify(event.payload.args)}.`;
1585
+ // One report from INSIDE a still-running tool call (agentfootprint
1586
+ // 9.52.0). It arrives between this call's tool_start and its tool_end, so
1587
+ // the stream reads as the call speaking mid-flight. See humanizeToolProgress
1588
+ // for why the author's payload is previewed rather than interpreted.
1589
+ case "agentfootprint.stream.tool_progress":
1590
+ return humanizeToolProgress(event.payload);
1555
1591
  case "agentfootprint.stream.tool_end":
1556
1592
  return `Tool "${event.payload.toolCallId}" returned in ${event.payload.durationMs}ms${event.payload.error === true ? " (error)" : ""}.`;
1557
1593
  case "agentfootprint.stream.token":
@@ -1626,6 +1662,9 @@ function makeTeachingHumanizer(options = {}) {
1626
1662
  const templates = options.commentaryTemplates ? { ...defaultCommentaryTemplates, ...options.commentaryTemplates } : defaultCommentaryTemplates;
1627
1663
  const ctx = { appName, getToolDescription };
1628
1664
  return (event) => {
1665
+ if (event.type === "agentfootprint.stream.tool_progress") {
1666
+ return humanizeToolProgressTeaching(event.payload);
1667
+ }
1629
1668
  const key = selectCommentaryKey(event);
1630
1669
  if (key === null) return null;
1631
1670
  if (key === void 0) return defaultHumanizer(event);
@@ -2765,4 +2804,4 @@ export {
2765
2804
  structureGraphFromSpec,
2766
2805
  cursorProvenance
2767
2806
  };
2768
- //# sourceMappingURL=chunk-JE37MDVV.js.map
2807
+ //# sourceMappingURL=chunk-VBMVWQUO.js.map