pi-tool-duration 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## [0.1.2] - 2026-07-11
6
+
7
+ ### Changed
8
+
9
+ - Measure from Pi's `tool_execution_start` event so timing matches the full current execution lifecycle, including preflight hooks.
10
+ - Clear abandoned timing state when the agent fully settles.
11
+
3
12
  ## [0.1.1] - 2026-07-03
4
13
 
5
14
  ### Changed
package/README.md CHANGED
@@ -13,7 +13,7 @@ Pi already shows tool timing in the TUI (`Took Xs`), but that timing is UI-only.
13
13
 
14
14
  ## How it works
15
15
 
16
- The extension matches Pi `tool_call` and `tool_result` events by `toolCallId`. When elapsed time is at or above the configured threshold, or a result reports a non-zero exit code, it appends one text block:
16
+ The extension matches Pi `tool_execution_start` and `tool_result` events by `toolCallId`. When elapsed time is at or above the configured threshold, or a result reports a non-zero exit code, it appends one text block:
17
17
 
18
18
  ```text
19
19
  [duration: 5.0s]
@@ -51,7 +51,7 @@ export default function (pi: ExtensionAPI) {
51
51
  type: "string",
52
52
  });
53
53
 
54
- pi.on("tool_call", async (event) => {
54
+ pi.on("tool_execution_start", async (event) => {
55
55
  starts.set(event.toolCallId, performance.now());
56
56
  });
57
57
 
@@ -76,4 +76,5 @@ export default function (pi: ExtensionAPI) {
76
76
  pi.on("session_start", clearStarts);
77
77
  pi.on("session_shutdown", clearStarts);
78
78
  pi.on("agent_end", clearStarts);
79
+ pi.on("agent_settled", clearStarts);
79
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-tool-duration",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Append model-visible durations to slow Pi tool results",
5
5
  "type": "module",
6
6
  "author": "Mitch Fultz (https://github.com/fitchmultz)",
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "devDependencies": {
43
- "@earendil-works/pi-coding-agent": "^0.80.3",
43
+ "@earendil-works/pi-coding-agent": "^0.80.6",
44
44
  "typescript": "^5.9.3"
45
45
  },
46
46
  "peerDependencies": {