Backend for file-picking UIs (the @ mention picker, TUI + web).
Everything here rides the ONE canonical pooled fff index
(internal.fff-index) that the grep tool use: fff owns the
tree walk, the gitignore policy, the git-status metadata and the
frecency-ranked fuzzy match. This namespace only leases that index and turns
fff rows into display rows.
There is deliberately NO Clojure-side directory walk, git-status subprocess, ignore matcher or scoring heuristic left in here — reintroducing one means the picker and the search tools would rank and see different files.
Backend for file-picking UIs (the `@` mention picker, TUI + web). Everything here rides the ONE canonical pooled fff index (`internal.fff-index`) that the `grep` tool use: fff owns the tree walk, the gitignore policy, the git-status metadata and the frecency-ranked fuzzy match. This namespace only leases that index and turns fff rows into display rows. There is deliberately NO Clojure-side directory walk, git-status subprocess, ignore matcher or scoring heuristic left in here — reintroducing one means the picker and the search tools would rank and see different files.
(->wire {:keys [path size-label age-label status-label]})Project ONE rich fuzzy/picker row (:path :size-label :age-label :status-label, the shape fuzzy-file-rows yields) into the channel-agnostic
WIRE shape {:name :size :age :status} the gateway /v1/sessions/:sid/suggest
service serves to the web composer.
This is the SINGLE web-specific step: both the web and the TUI start from the
SAME rich rows; the TUI renders them in-process (richer size · age · status
chip), the web projects them last through here.
Project ONE rich fuzzy/picker row (`:path :size-label :age-label
:status-label`, the shape `fuzzy-file-rows` yields) into the channel-agnostic
WIRE shape `{:name :size :age :status}` the gateway `/v1/sessions/:sid/suggest`
service serves to the web composer.
This is the SINGLE web-specific step: both the web and the TUI start from the
SAME rich rows; the TUI renders them in-process (richer `size · age · status`
chip), the web projects them last through here.(cwd-lease)The canonical pooled-fff lease for the current workspace cwd: gitignore
respected, exactly like the @ picker and the grep tool. Every
picker search goes through this so the UI shares ONE index with the search
tools instead of scanning the tree again per popup.
The canonical pooled-fff lease for the current workspace cwd: gitignore respected, exactly like the `@` picker and the `grep` tool. Every picker search goes through this so the UI shares ONE index with the search tools instead of scanning the tree again per popup.
(cwd-path)Current explicit workspace cwd as a Path. Indirected for tests.
Current explicit workspace cwd as a Path. Indirected for tests.
(format-relative-age now-ms mtime-ms)Compact relative age for picker rows.
Compact relative age for picker rows.
(fuzzy-file-rows query)(fuzzy-file-rows query
{:keys [now-ms limit]
:or {now-ms (util/now-ms) limit max-results}})Frecency-ranked, typo-tolerant fuzzy file search via fff — the SAME pooled
index (and therefore the same ranking) the grep tool use.
Returns display rows (:path :label :status-label :size-label :age-label),
capped at limit.
The index is leased from internal.fff-index for the call only: callers own
nothing and must not close anything. The FIRST call on a cold pool blocks for
the tree scan — a render thread should gate on index-warm? / prewarm-index!.
A blank query yields fff's default frecency/recency ordering.
Frecency-ranked, typo-tolerant fuzzy file search via fff — the SAME pooled index (and therefore the same ranking) the `grep` tool use. Returns display rows (`:path :label :status-label :size-label :age-label`), capped at `limit`. The index is leased from `internal.fff-index` for the call only: callers own nothing and must not close anything. The FIRST call on a cold pool blocks for the tree scan — a render thread should gate on `index-warm?` / `prewarm-index!`. A blank `query` yields fff's default frecency/recency ordering.
(index-warm?)True when the picker's pooled index is already built, so fuzzy-file-rows
costs only a search.
True when the picker's pooled index is already built, so `fuzzy-file-rows` costs only a search.
(prewarm-index!)Kick the picker's pooled index build off the caller's thread (no-op when it is already warm).
Kick the picker's pooled index build off the caller's thread (no-op when it is already warm).
(suggest-file-rows query)(suggest-file-rows query {:keys [limit] :or {limit max-results}})Self-contained fuzzy file suggestion for the shared @/suggest surface: the
gateway /v1/sessions/:sid/suggest service and any other caller project the
SAME fuzzy-file-rows engine the TUI picker uses through ->wire, so web and
TUI never diverge on ranking or field derivation — only on the final shape.
Returns the channel-agnostic WIRE rows {:name :size :age :status} (bare
relative path in :name). Never throws; on any error yields [].
Self-contained fuzzy file suggestion for the shared `@`/suggest surface: the
gateway `/v1/sessions/:sid/suggest` service and any other caller project the
SAME `fuzzy-file-rows` engine the TUI picker uses through `->wire`, so web and
TUI never diverge on ranking or field derivation — only on the final shape.
Returns the channel-agnostic WIRE rows `{:name :size :age :status}` (bare
relative path in `:name`). Never throws; on any error yields `[]`.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |