@xynogen/pix-find 0.3.1 → 0.3.4
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/LICENSE +21 -0
- package/README.md +8 -8
- package/package.json +4 -4
- package/src/extension.ts +6 -11
- package/src/find.ts +5 -3
- package/src/index.ts +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xynogen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -28,22 +28,22 @@ Set `collapse.tools.find: false` to disable for this tool only. See `@xynogen/pi
|
|
|
28
28
|
pi install npm:@xynogen/pix-find
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
>
|
|
32
|
-
>
|
|
33
|
-
> ```bash
|
|
34
|
-
> pi install npm:@xynogen/pix-core
|
|
35
|
-
> ```
|
|
31
|
+
> Bundled in [`@xynogen/pix-core`](https://www.npmjs.com/package/@xynogen/pix-core). Install it alone only if you do not use pix-core.
|
|
36
32
|
|
|
37
33
|
## Full distro
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
To install the complete pix suite (all packages + Pi itself):
|
|
35
|
+
This package is part of [Pix](https://github.com/xynogen/pix-mono). The installer sets up Pi and the full distro. See [Install](https://github.com/xynogen/pix-mono#install) for the notes for each OS.
|
|
42
36
|
|
|
43
37
|
```bash
|
|
38
|
+
# Linux / macOS
|
|
44
39
|
curl -fsSL https://raw.githubusercontent.com/xynogen/pix-mono/main/scripts/install.sh | sh
|
|
45
40
|
```
|
|
46
41
|
|
|
42
|
+
```powershell
|
|
43
|
+
# Windows
|
|
44
|
+
irm https://raw.githubusercontent.com/xynogen/pix-mono/main/scripts/install.ps1 | iex
|
|
45
|
+
```
|
|
46
|
+
|
|
47
47
|
## License
|
|
48
48
|
|
|
49
49
|
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-find",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Pi tool
|
|
3
|
+
"version": "0.3.4",
|
|
4
|
+
"description": "Pi tool \u2014 glob file search",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"exports": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@xynogen/pix-pretty": "^1.
|
|
43
|
-
"@xynogen/pix-runtime": "^0.
|
|
42
|
+
"@xynogen/pix-pretty": "^1.30.0",
|
|
43
|
+
"@xynogen/pix-runtime": "^0.13.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@earendil-works/pi-coding-agent": "*"
|
package/src/extension.ts
CHANGED
|
@@ -4,11 +4,13 @@ import {
|
|
|
4
4
|
type ExtensionAPI,
|
|
5
5
|
type FindToolInput,
|
|
6
6
|
} from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
7
8
|
import { CursorStore, fffState } from "@xynogen/pix-pretty/fff";
|
|
8
|
-
import type { PiPrettyApi,
|
|
9
|
+
import type { PiPrettyApi, ToolFactory } from "@xynogen/pix-pretty/types";
|
|
9
10
|
import { shortPath, viewportTextConstructor } from "@xynogen/pix-pretty/utils";
|
|
10
11
|
import { once } from "@xynogen/pix-runtime/once";
|
|
11
|
-
import {
|
|
12
|
+
import { homeDir } from "@xynogen/pix-runtime/paths";
|
|
13
|
+
import { registerFindTool } from "./find.ts";
|
|
12
14
|
|
|
13
15
|
export default function pixFindExtension(pi: ExtensionAPI): void {
|
|
14
16
|
const prettyPi = pi as unknown as PiPrettyApi;
|
|
@@ -17,20 +19,13 @@ export default function pixFindExtension(pi: ExtensionAPI): void {
|
|
|
17
19
|
createFindToolFallback) as unknown as ToolFactory<FindToolInput>;
|
|
18
20
|
if (!createFindTool) return;
|
|
19
21
|
|
|
20
|
-
let TextComponent: TextComponentCtor;
|
|
21
|
-
try {
|
|
22
|
-
TextComponent = require("@earendil-works/pi-tui").Text;
|
|
23
|
-
} catch {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
const cwd = process.cwd();
|
|
28
|
-
const home =
|
|
23
|
+
const home = homeDir();
|
|
29
24
|
|
|
30
25
|
registerFindTool(prettyPi, createFindTool, {
|
|
31
26
|
cwd,
|
|
32
27
|
sp: (p: string) => shortPath(cwd, home, p),
|
|
33
|
-
TextComponent: viewportTextConstructor(
|
|
28
|
+
TextComponent: viewportTextConstructor(Text),
|
|
34
29
|
fffState,
|
|
35
30
|
cursorStore: new CursorStore(),
|
|
36
31
|
});
|
package/src/find.ts
CHANGED
|
@@ -28,7 +28,9 @@ import type {
|
|
|
28
28
|
import {
|
|
29
29
|
appendNotices,
|
|
30
30
|
fillToolBackground,
|
|
31
|
+
formatToolCallTitle,
|
|
31
32
|
frameToolResult,
|
|
33
|
+
getErrorMessage,
|
|
32
34
|
getTextContent,
|
|
33
35
|
hideCollapsedToolCall,
|
|
34
36
|
makeTextResult,
|
|
@@ -173,7 +175,7 @@ export function registerFindTool(
|
|
|
173
175
|
try {
|
|
174
176
|
return await runOne(targets[0] ?? "", tid);
|
|
175
177
|
} catch (error) {
|
|
176
|
-
const text =
|
|
178
|
+
const text = getErrorMessage(error);
|
|
177
179
|
if (sig?.aborted || /aborted/i.test(text)) throw error;
|
|
178
180
|
return {
|
|
179
181
|
content: [{ type: "text" as const, text }],
|
|
@@ -196,7 +198,7 @@ export function registerFindTool(
|
|
|
196
198
|
return { pattern, result: await runOne(pattern, `${tid}:${i}`) };
|
|
197
199
|
} catch (error) {
|
|
198
200
|
if (sig?.aborted) throw error;
|
|
199
|
-
return { pattern, error:
|
|
201
|
+
return { pattern, error: getErrorMessage(error) };
|
|
200
202
|
}
|
|
201
203
|
}),
|
|
202
204
|
);
|
|
@@ -252,7 +254,7 @@ export function registerFindTool(
|
|
|
252
254
|
return text;
|
|
253
255
|
text.setText(
|
|
254
256
|
fillToolBackground(
|
|
255
|
-
`${theme
|
|
257
|
+
`${formatToolCallTitle(theme, "find", renderCtx)} ${theme.fg("dim", pattern)}${path}`,
|
|
256
258
|
),
|
|
257
259
|
);
|
|
258
260
|
return text;
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { registerFindTool } from "./find.
|
|
1
|
+
export { registerFindTool } from "./find.ts";
|