Expand description
Scrybe tools — one ToolSpec registry shared by the CLI and the MCP server.
Foundation crate for the MCP rebuild (issue #122; design
docs/design/mcp-rebuild.md). A single Registry is consumed by both
front ends, so CLI↔MCP parity holds by construction: same handler, different
envelope. This first slice is deliberately additive — the core types, the
Registry, the headless Transport, and the pure render tool.
Dispatch-through-scrybe-rpc, the remaining tools, and the protocol fixes
land in later phases (design §8).
Re-exports§
pub use figures::export_figures;pub use figures::plan_figures;pub use figures::FigurePlan;pub use figures::FigureResult;
Modules§
- autolaunch
- Opt-in auto-launch of the Scrybe desktop app (issue #225).
- figures
- Export every Mermaid diagram in a document to sibling PNG figures.
- lint
- Document linter — walks the AST and produces a
LintReport. - schema
- The shared JSON-Schema envelope for every tool’s
datapayload (A4). - tools
- Built-in tool groups. Each module contributes one or more
crate::ToolSpecs via aspec()(orspecs()) constructor; [register_defaults] wires them into thecrate::Registry. Feature-gated groups (vcs,swarm) will be added here behind#[cfg(feature = ...)]in later phases.
Structs§
- Ctx
- Handler execution context — carries the transport a stateful tool would use.
- Data
Schema - Versioned schema for a tool’s stable
datapayload. Agents readdata; they never parsedescriptionprose or the humantext(design §4A). - Headless
- No socket: only the pure, GUI-free subset of tools runs. GUI/stateful tools
get a clean
NoApp. - LiveApp
- Dials the live app over
~/.scrybe/sockviascrybe-rpc’s client — the same wire the CLI uses, so a tool routed through this transport drives the running editor exactly likescrybe <cmd>does. When no app is running,callreturnsNoAppand pure tools should fall back toHeadless. - Registry
- The shared tool registry consumed by both front ends.
- Tool
Error - A business-level failure: the tool ran and said “no” (e.g. “heading not
found”). This is DATA carried inside the outcome, not an engine fault.
Each surface decides its own presentation: the MCP adapter reports a
failed invocation (
isError: truewith the{code, message}instructuredContent— A4); the CLI prints the error and keeps its exit semantics. - Tool
Outcome - The result of a successful tool invocation. A
Some(tool_error)still means the call succeeded — the tool told the agent “no”. Engine faults are the separateEngineFaulttype returned by the dispatcher. - Tool
Spec - One tool, shared verbatim by the CLI and the MCP server (design §2.2).
Enums§
- Engine
Fault - Engine fault: the dispatcher could not even run the tool (unknown tool, bad
arguments, transport down). Surfaces as a non-zero CLI exit; on MCP,
UnknownToolis a JSON-RPC-32602protocol error and the rest areisError: trueresults (A4 mapping inscrybe-mcp-server/src/server.rs). Distinct from a businessToolErrorcarried inside the outcome (design §2.2, §5). - Facet
- Tool group — drives progressive disclosure and feature gating (design §4).
- Transport
Error - Failure talking to the live app over the socket, in three semantic classes
that mirror
scrybe_rpc::ClientError’s taxonomy.
Traits§
- Transport
- Round-trips scrybe-rpc requests to the live app (design §2.3). The only place
a tool touches the outside world — the future
LiveApptransport and the modulex extraction seam both live behind this trait.