Skip to main content

Crate opencode_ctl

Crate opencode_ctl 

Source
Expand description

Shared engine for the opencode-ctl MCP servers.

Modules§

cli
Argv routing and the dispatch skeleton.
clock
Time seam: SystemClock for production, TestClock for deterministic tests.
compact
Output compaction, byte caps and redaction.
created_set
The per-directory set of sessions this controller created (OpenCode host guard).
doctor
doctor-json: the eighteen checks behind the opencode-ctl-doctor skill (spec Skills).
engine
The engine: settings, host, environment and the transport behind every tool.
error
Stable error codes and the tool error envelope.
gc
gc: the shared startup sweep, then the pair-record collector with the dead-seen grace (spec “Pairing contract”, gc).
host
Host identity: which agent fronts the engine and what it may do.
launcher
The launcher: pair, the tab wrappers, the terminal walk, install-launcher and the pure Windows resolvers (spec “Launcher”), and resume and attach (Task 19), which reuse claim_file, write_wrapper, controller_env and LauncherCtx::before_claim.
liveness
Process identity probing, the pid sentinels and the per-side liveness rules.
logging
File logging (spec “Logging”): <home>/logs/serve-<pid>.log and pair-<pair-id>.log, level info (debug on request), a 5 MiB cap that rolls once to .1, and retention. Nothing here ever writes to stdout: stdout is the MCP channel.
openapi
OpenAPI operation table (v2.0.32 snapshot) and the escape-hatch gate.
pairing
The pairing contract on disk: identity resolution, the pair record, the claim_file primitive and the liveness sentinels (spec “Pairing contract”; files are pair.<pair-id>.* in the ctl home).
server
The rmcp server: twenty tools over the engine.
settings
Settings: env, user file, workspace file, defaults, with clamps, the protected-key rule and the sticky permission lock.
skill_asset
The two opencode-ctl skills, embedded as templates and rendered per host.
startup
Everything serve does before it builds the server, callable from tests without stdio. (resolve_identity / apply_identity live in pairing.rs and run before this; startup takes the already-applied environment.)
sweep
The startup sweep: the one list of housekeeping that serve runs at startup and gc reuses (spec “gc”). Every failure is collected, never fatal.
testing
Test support shared with the front crates.
tools
Tool argument structs (all twenty, final schemas) and tool bodies.
transport
The seam between the engine and the opencode CLI.