Expand description
Provider seam (plans/0005): the TUI talks to source-control backends
through this trait — never to a concrete API. github is the
in-tree reference implementation; external providers are child
processes speaking NDJSON-RPC over stdio (stdio.rs), so any
internal system can be wrapped with a small script.
Contract rules that matter:
- Repos are opaque “group/project” strings; the UI never parses them.
shais an opaque content id: it MUST change when content changes (the cache design is content-keyed and immutable).- URL building (yank) and cloning use provider-supplied fields — no GitHub URL grammar outside the GitHub impl.
Re-exports§
pub use id::Generation;pub use id::GitRef;pub use id::OwnerId;pub use id::RepoId;pub use id::RepoPath;pub use id::Sha;
Modules§
- id
- Typed identity for the provider seam (plans/0025): the three
nouns that cross every boundary — which repo, which content, which
revision — as opaque newtypes instead of naked
Strings. The bug classes this kills: a sha where a ref was meant, a ref where a repo id was meant, a repo id formatted differently at two sites. - paths
- XDG base dirs on every platform, macOS included.
Structs§
- Blame
Range repo/blamerange — 1-based inclusive lines, coalesced by sha.- Capabilities
- What a provider supports; the UI degrades on
false.file_search(v1.3) covers path-only search (thepath:grammar); absent on the wire it inheritscode_search— a forge with filename search but no global content index (Bitbucket Cloud, GitLab without Advanced Search) sayscode_search: false, file_search: true. - Code
Match - One code-search hit.
matchesare the matched substrings — an empty vec is a legal path-only hit (“this file matched”). Whenmatchesis non-empty the UI locates them in the blob for real line numbers;line, when the provider knows it, is the anchor used as-is (the first occurrence of a substring is often not the occurrence that matched). - Commit
Detail - Commit
File - Commit
Statistics - LogEntry
repo/logitem — newest first on the wire.- Provider
Error - Structured provider error (plans/0008 §2): the protocol v1.1
data.kindtaxonomy carried from the wire to the UI instead of a bare string. Unknown or absent kinds degrade toOther, which renders exactly like the old unstructured toast. - RefInfo
- One ref (branch or tag) —
repo/refsitem. - Repo
Info - One repo in an org listing (protocol v1.4): the name plus whatever
metadata the backend reports. Everything past
nameis optional — a provider with only names sends the string form on the wire and every field here stays default. - Repo
Refs repo/refsreply.- Search
Code Result - Code-search outcome metadata: the provider’s own truncation signal
(plans/0008 §4) and, for indexed backends, when the index was
built (
located: falsecovers the per-hit case; this is the index-wide one — a lagging index is worth a badge next to the results). - Tree
Node - UI-facing tree node (path relative to repo root).
- Tree
Result - A repo’s recursive tree plus routing metadata.
Enums§
- Error
Kind - The v1.1
data.kindopen enum. Wire-unknown kinds map toOther. - File
Status - Search
Item - Repo/org search result for the launch popup.
Constants§
- RENDER_
BUDGET - The client’s search render budget (protocol v1.4 advisory,
doc/provider-protocol.md): sent as
limiton everysearch/codeso the provider stops scanning at ~N and setstruncated: trueinstead of computing hits the view would clip. The view’s render cap is this same number.
Traits§
- Provider
- The backend contract. Blocking; calls run on worker threads.