@xynogen/pix-find 0.1.20 → 0.1.23
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 +1 -1
- package/package.json +4 -4
- package/src/find.test.ts +2 -1
- package/src/find.ts +14 -2
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ After a configurable delay (default 10 seconds), completed output collapses to a
|
|
|
20
20
|
}
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Set `collapse.tools.find: false` to disable for this tool only. See `@xynogen/pix-
|
|
23
|
+
Set `collapse.tools.find: false` to disable for this tool only. See `@xynogen/pix-runtime/collapse` for the full API.
|
|
24
24
|
|
|
25
25
|
## Install
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-find",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Pi tool — glob file search",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xynogen/pix-data": "^0.4.
|
|
38
|
-
"@xynogen/pix-pretty": "^1.
|
|
39
|
-
"@xynogen/pix-runtime": "^0.
|
|
37
|
+
"@xynogen/pix-data": "^0.4.3",
|
|
38
|
+
"@xynogen/pix-pretty": "^1.11.2",
|
|
39
|
+
"@xynogen/pix-runtime": "^0.5.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@earendil-works/pi-coding-agent": "*"
|
package/src/find.test.ts
CHANGED
|
@@ -110,7 +110,8 @@ describe("registerFindTool", () => {
|
|
|
110
110
|
|
|
111
111
|
expect(result?.getText()).toContain("src/one.ts");
|
|
112
112
|
expect(result?.getText()).toContain("src/two.ts");
|
|
113
|
-
|
|
113
|
+
// Framed view shows the same semantic count as the collapsed row (no drift).
|
|
114
|
+
expect(result?.getText()).toContain("2 files");
|
|
114
115
|
});
|
|
115
116
|
|
|
116
117
|
it("collapses structured errors and restores the exact diagnostic on expansion", () => {
|
package/src/find.ts
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
getTextContent,
|
|
21
21
|
hideCollapsedToolCall,
|
|
22
22
|
makeTextResult,
|
|
23
|
+
pluralize,
|
|
23
24
|
renderCollapsedToolRow,
|
|
24
25
|
renderDimPreview,
|
|
25
26
|
renderToolError,
|
|
@@ -148,7 +149,9 @@ export function registerFindTool(
|
|
|
148
149
|
const cs = renderCtx.state as CollapseState;
|
|
149
150
|
if (!isPartial && tickCollapse("find", cs, renderCtx.invalidate, renderCtx.expanded)) {
|
|
150
151
|
const summary =
|
|
151
|
-
d?._type === "findResult" && d.matchCount != null
|
|
152
|
+
d?._type === "findResult" && d.matchCount != null
|
|
153
|
+
? pluralize(d.matchCount, "file")
|
|
154
|
+
: "found";
|
|
152
155
|
const target = d?._type === "findResult" ? d.pattern : "";
|
|
153
156
|
const scope = d?._type === "findResult" && d.path ? ` in ${sp(d.path)}` : "";
|
|
154
157
|
text.setText(
|
|
@@ -169,7 +172,16 @@ export function registerFindTool(
|
|
|
169
172
|
}
|
|
170
173
|
|
|
171
174
|
const output = getTextContent(result) || "found";
|
|
172
|
-
text.setText(
|
|
175
|
+
text.setText(
|
|
176
|
+
renderDimPreview(output, theme, {
|
|
177
|
+
frame: true,
|
|
178
|
+
// Same semantic count the collapsed row shows — one source, no drift.
|
|
179
|
+
header:
|
|
180
|
+
d?._type === "findResult" && d.matchCount != null
|
|
181
|
+
? pluralize(d.matchCount, "file")
|
|
182
|
+
: undefined,
|
|
183
|
+
}),
|
|
184
|
+
);
|
|
173
185
|
return text;
|
|
174
186
|
},
|
|
175
187
|
});
|