@xynogen/pix-find 0.1.13 → 0.1.14
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/package.json +2 -2
- package/src/find.ts +13 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-find",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Pi tool — glob file search",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xynogen/pix-pretty": "^1.7.
|
|
37
|
+
"@xynogen/pix-pretty": "^1.7.20",
|
|
38
38
|
"@xynogen/pix-data": "^0.3.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/find.ts
CHANGED
|
@@ -18,7 +18,9 @@ import {
|
|
|
18
18
|
appendNotices,
|
|
19
19
|
fillToolBackground,
|
|
20
20
|
getTextContent,
|
|
21
|
+
hideCollapsedToolCall,
|
|
21
22
|
makeTextResult,
|
|
23
|
+
renderCollapsedToolRow,
|
|
22
24
|
renderDimPreview,
|
|
23
25
|
renderToolError,
|
|
24
26
|
setResultDetails,
|
|
@@ -80,6 +82,7 @@ export function registerFindTool(
|
|
|
80
82
|
_type: "findResult",
|
|
81
83
|
text: textContent,
|
|
82
84
|
pattern: effectiveParams.pattern,
|
|
85
|
+
path: effectiveParams.path,
|
|
83
86
|
matchCount: trimmed.length,
|
|
84
87
|
});
|
|
85
88
|
}
|
|
@@ -97,6 +100,7 @@ export function registerFindTool(
|
|
|
97
100
|
_type: "findResult",
|
|
98
101
|
text: textContent,
|
|
99
102
|
pattern: params.pattern,
|
|
103
|
+
path: params.path,
|
|
100
104
|
matchCount,
|
|
101
105
|
});
|
|
102
106
|
|
|
@@ -107,6 +111,12 @@ export function registerFindTool(
|
|
|
107
111
|
const pattern = args.pattern ?? "";
|
|
108
112
|
const path = args.path ? ` ${theme.fg("muted", `in ${sp(args.path)}`)}` : "";
|
|
109
113
|
const text = renderCtx.lastComponent ?? new TextComponent("", 0, 0);
|
|
114
|
+
if (
|
|
115
|
+
hideCollapsedToolCall(renderCtx.state as CollapseState, renderCtx.expanded, (value) =>
|
|
116
|
+
text.setText(value),
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
return text;
|
|
110
120
|
text.setText(
|
|
111
121
|
fillToolBackground(
|
|
112
122
|
`${theme.fg("toolTitle", theme.bold("find"))} ${theme.fg("accent", pattern)}${path}`,
|
|
@@ -134,7 +144,9 @@ export function registerFindTool(
|
|
|
134
144
|
const d = result.details;
|
|
135
145
|
const summary =
|
|
136
146
|
d?._type === "findResult" && d.matchCount != null ? `${d.matchCount} files` : "found";
|
|
137
|
-
|
|
147
|
+
const target = d?._type === "findResult" ? d.pattern : "";
|
|
148
|
+
const scope = d?._type === "findResult" && d.path ? ` in ${sp(d.path)}` : "";
|
|
149
|
+
text.setText(renderCollapsedToolRow(theme, "find", `${target}${scope}`, summary));
|
|
138
150
|
return text;
|
|
139
151
|
}
|
|
140
152
|
|