Expand description
Shared engine for the opencode-ctl MCP servers.
Modules§
- cli
- Argv routing and the dispatch skeleton.
- clock
- Time seam:
SystemClockfor production,TestClockfor 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 theopencode-ctl-doctorskill (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-launcherand the pure Windows resolvers (spec “Launcher”), andresumeandattach(Task 19), which reuseclaim_file,write_wrapper,controller_envandLauncherCtx::before_claim. - liveness
- Process identity probing, the pid sentinels and the per-side liveness rules.
- logging
- File logging (spec “Logging”):
<home>/logs/serve-<pid>.logandpair-<pair-id>.log, levelinfo(debugon 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_fileprimitive and the liveness sentinels (spec “Pairing contract”; files arepair.<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
servedoes before it builds the server, callable from tests without stdio. (resolve_identity/apply_identitylive inpairing.rsand run before this;startuptakes the already-applied environment.) - sweep
- The startup sweep: the one list of housekeeping that
serveruns at startup andgcreuses (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.