Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.channel.file-picker

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.
raw docstring

->wireclj

(->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.
sourceraw docstring

cwd-leaseclj

(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.
sourceraw docstring

cwd-pathclj

(cwd-path)

Current explicit workspace cwd as a Path. Indirected for tests.

Current explicit workspace cwd as a Path. Indirected for tests.
sourceraw docstring

format-relative-ageclj

(format-relative-age now-ms mtime-ms)

Compact relative age for picker rows.

Compact relative age for picker rows.
sourceraw docstring

fuzzy-file-rowsclj

(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.
sourceraw docstring

index-warm?clj

(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.
sourceraw docstring

max-resultsclj

source

prewarm-index!clj

(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).
sourceraw docstring

suggest-file-rowsclj

(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 `[]`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close