Expand description
Shared logic for the rtk-mcp-cc plugin.
Everything here is pure and unit-tested: settings resolution, the argument
vectors handed to rtk, and the hook’s pass-through decision. The binaries
in src/bin/ only move bytes and spawn processes.
The guiding constraint is that this plugin owns no rewriting logic.
rtk already speaks Claude Code’s PreToolUse schema natively via
rtk hook claude — it reads the event on stdin and writes
hookSpecificOutput.updatedInput on stdout. Re-implementing that here would
duplicate knowledge rtk owns and drift the moment rtk changes. So the hook
delegates, and this crate’s job is only to delegate safely.
Structs§
- Config
- Resolved plugin settings.
- Discover
Options - Options for the
rtk_discovertool. - Gain
Options - Options for the
rtk_gaintool.
Functions§
- check_
args - Build the argv for
rtk hook check <command>— a dry run that reports how a command would be rewritten, without executing anything. - delegate
- Decide what this hook writes to stdout.
- discover_
args - Build the argv for
rtk discover. - extract_
frontmatter 🔒 - Return the text between the leading
---fences, if present. - gain_
args - Build the argv for
rtk gain. - hook_
args - The argument vector for the delegated hook call:
rtk hook claude [flags]. - parse_
bool 🔒 - Accept the spellings people actually write in config files and shells.
- proxy_
args - Build the argv for
rtk proxy -- <argv>. - validate_
format 🔒