@xynogen/pix-find 0.1.9 → 0.1.10

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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/package.json +3 -2
  3. package/src/find.ts +13 -0
package/README.md CHANGED
@@ -6,6 +6,22 @@ Pi tool — glob file search with FFF acceleration.
6
6
 
7
7
  Replaces Pi's default `find` tool with an enhanced version backed by `pix-pretty`. Uses FFF (frecency-ranked, SIMD-accelerated file finder) when available, falling back to the standard glob search. Results are rendered as a dim preview of the matched relative paths; the call label shows the glob pattern and search directory inline. The finder is shared with `pix-grep` (owned there) — install `pix-grep` alongside to actually populate the index. Depends on `@xynogen/pix-pretty`, installed automatically as a dependency.
8
8
 
9
+ ## Auto-collapse
10
+
11
+ After a configurable delay (default 10 seconds) the output card automatically collapses. Controlled via the `collapse` section of `~/.pi/agent/pix.json`:
12
+
13
+ ```jsonc
14
+ {
15
+ "collapse": {
16
+ "enabled": true,
17
+ "delayMs": 10000,
18
+ "tools": { "find": true }
19
+ }
20
+ }
21
+ ```
22
+
23
+ Set `collapse.tools.find: false` to disable for this tool only. See `@xynogen/pix-data/collapse` for the full API.
24
+
9
25
  ## Install
10
26
 
11
27
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-find",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Pi tool — glob file search",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -34,7 +34,8 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@xynogen/pix-pretty": "^1.7.9"
37
+ "@xynogen/pix-pretty": "^1.7.9",
38
+ "@xynogen/pix-data": "workspace:*"
38
39
  },
39
40
  "peerDependencies": {
40
41
  "@earendil-works/pi-coding-agent": "*"
package/src/find.ts CHANGED
@@ -3,6 +3,7 @@ import type {
3
3
  FindToolInput,
4
4
  ToolRenderResultOptions,
5
5
  } from "@earendil-works/pi-coding-agent";
6
+ import { type CollapseState, tickCollapse } from "@xynogen/pix-data/collapse";
6
7
  import type { ToolContext } from "@xynogen/pix-pretty/context";
7
8
  import type {
8
9
  FindParams,
@@ -134,6 +135,18 @@ export function registerFindTool(
134
135
  return text;
135
136
  }
136
137
 
138
+ // Auto-collapse: show summary line after delay
139
+ const cs = renderCtx.state as CollapseState;
140
+ if (tickCollapse("find", cs, renderCtx.invalidate)) {
141
+ const d = result.details;
142
+ const summary =
143
+ d?._type === "findResult" && d.matchCount != null
144
+ ? `${d.matchCount} files`
145
+ : "found";
146
+ text.setText(fillToolBackground(` ${theme.fg("muted", summary)}`));
147
+ return text;
148
+ }
149
+
137
150
  const output = getTextContent(result) || "found";
138
151
  text.setText(renderDimPreview(output, theme));
139
152
  return text;