F8.1 — CLI / MCP / API surface matrix
The single reference for how every hot workflow maps across the three surfaces — CLI (@driftless-sh/cli), MCP (@driftless/mcp), and the API
(@driftless/api) — plus what each read returns by default and how to opt into a
heavier payload.
Read it to answer: “which command/tool/route do these three things share, what
shape comes back, and what is fast by default?”
Conventions:
- Default view is the payload tier a read returns when no
viewis passed (summary/brief/full— seeviews.md).fullis never a default; a caller opts in. - Full-view opt-in is how you ask for the heavy body when you actually need it.
- The MCP names are the literal tool names in
apps/mcp/src/tools/tool-registry.ts; the CLI names are the literal subcommands inapps/cli/src/commands/*; the API rows are the Nest routes underapps/api/src/*(all under/workspaces/:slug).
Topics — read
Retrieve is the START-HERE primitive when you have a task but no slug. It
composes search + match-files + list filters, ranks them drifted-first, and
annotates each hit with
match_type / why_matched / confidence /
next_action. The unified ranker is exposed on all three surfaces: CLI
(context retrieve "<task>", --explain for why_matched), API (POST /topics/retrieve), and MCP (driftless_context_retrieve); context get --files/--diff remain the file/diff-shaped reads.
Topics — write & govern
Tags & Areas
Collections — the operational substrate
collection retrieve is the operational analogue of topic retrieve: relevant
records plus the criterion Knowledge to read before acting, in one GET.
Records paginate by keyset ({ records, nextCursor }).
Integrations (SETUP) vs Broker (EXECUTION)
These are deliberately two separate concerns. Setup connects/configures a provider (the privileged connect flow); the broker only operates a connection that already exists. Authoring/deploying a Nango action is a third, human-only lane that neither surface touches (the no-agent-scripting rule).
Operations are served from materialized metadata;
--refresh (CLI) /
refresh:true re-pulls the live list from Nango. Records mirror a synced model and
are delta-aware (--modified-after / cursor). Broker reads and writes both
run inline + audited — Driftless is a tooling proxy; the human-in-the-loop is
your own agent harness.
Connector document indexing is the explicit bridge from external source data to
Driftless-owned retrieve substrate. Preview first; execute writes only
connector_documents. Default context retrieve stays Topics-only. Connector
retrieve is opt-in (sources:["connectors"] / include_external) and returns
trust:"external" with citations and freshness.
STOP rule: if an agent needs a broker operation that
broker operations <provider> does not list, it must report the missing
capability — never author or deploy an integration script to fill the gap.
Comments — annotate either plane
A comment points at a topic / record — it carries no governance and
resolves into an edit (
open → resolved → wont_fix).
What is fast by default
The matrix encodes one rule: the interactive default never ships a heavy body.- Lists and search default to
summary(an index row) and are bounded (top 5 search, top 40 list). - Match-files and
retrievedefault tobrief— the durable why, not the fullcontent— and are bounded drifted-first (top 10). - A single
context get <slug>defaults tofull, because you named the one topic you want. fulleverywhere else is an explicit opt-in (--fullis never the default); pair it with a smalllimit.- Records (collection + broker) paginate by keyset; broker output is hard-capped.
budgets.md;
the view/pagination vocabulary in views.md; how a perf claim is
accepted in gates.md.