pi-tool-display 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
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.2] - 2026-03-01
11
+
12
+ ### Fixed
13
+ - Corrected `write` call rendering state handling so path changes without new content no longer reuse stale line/size metadata from previous writes.
14
+ - Restored write call suffix rendering (`(X lines, Y)`) when content is available, improving call summary consistency.
15
+
10
16
  ## [0.1.1] - 2026-03-01
11
17
 
12
18
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-tool-display",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "OpenCode-style tool call/result rendering extension for Pi coding agent.",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -892,14 +892,34 @@ export function registerToolDisplayOverrides(
892
892
  );
893
893
  },
894
894
  renderCall(args, theme) {
895
- lastWritePath = typeof args.path === "string" ? args.path : undefined;
896
- lastWriteContent =
895
+ const incomingPath = typeof args.path === "string" ? args.path : undefined;
896
+ const incomingContent =
897
897
  typeof args.content === "string" ? args.content : undefined;
898
- lastWriteLineCount = countWriteContentLines(args.content);
899
- lastWriteSizeBytes = getWriteContentSizeBytes(args.content);
898
+
899
+ if (incomingPath !== undefined) {
900
+ const pathChanged = incomingPath !== lastWritePath;
901
+ lastWritePath = incomingPath;
902
+
903
+ if (pathChanged && incomingContent === undefined) {
904
+ lastWriteContent = undefined;
905
+ lastWriteLineCount = 0;
906
+ lastWriteSizeBytes = 0;
907
+ }
908
+ }
909
+
910
+ if (incomingContent !== undefined) {
911
+ lastWriteContent = incomingContent;
912
+ lastWriteLineCount = countWriteContentLines(incomingContent);
913
+ lastWriteSizeBytes = getWriteContentSizeBytes(incomingContent);
914
+ }
915
+
900
916
  const path = shortenPath(lastWritePath);
917
+ const suffix =
918
+ incomingContent !== undefined || lastWriteContent !== undefined
919
+ ? formatWriteCallSuffix(lastWriteLineCount, lastWriteSizeBytes, theme)
920
+ : "";
901
921
  return new Text(
902
- `${theme.fg("toolTitle", theme.bold("write"))} ${theme.fg("accent", path || "...")}`,
922
+ `${theme.fg("toolTitle", theme.bold("write"))} ${theme.fg("accent", path || "...")}${suffix}`,
903
923
  0,
904
924
  0,
905
925
  );