Expand description
Server state: the single worker held behind an async mutex, its active attachment + address
canonicalizer, the poison set, and a permit semaphore. Lazy single-flight boot (spec §5); strict
inner<outer timeouts (spec §4.7); transparent crash respawn (spec §4.3) lives in execute.rs.
Structs§
- Server
State - Worker
Holder - A booted, attached worker plus the derived per-program address canonicalizer.
Enums§
Constants§
- EXPECTED_
WORKER_ VERSION - The worker script version this binary requires; must equal
GhidraMcpWorker.java’sWORKER_SCRIPT_VERSION(bumped to “0.7.0” for M2d: theset_localwrite method + the structuredlocals[]array oninspect_function). Bump BOTH in lockstep whenever the worker’s method surface changes. Exact-match (not semver-range) is sufficient because the worker is embedded + hash-extracted, so host and worker are always the same build in practice (spec §5). - SERVER_
PERMITS - Max concurrent in-flight+queued tool calls before
SERVER_BUSY(spec §5 / §9.4).
Functions§
- boot_
env 🔒 - A structured boot/transport failure envelope (retryable).
- boot_
reattach - Re-attach
last_goodon a freshly-booted holder if it differs from the boot’s initial attachment (spec §4.3). Best-effort: a re-attach failure is swallowed (the fresh worker is still usable at its bootstrap program; the caller’s retry will surface any real problem). - check_
worker_ version - Pure: decide whether an announced worker version is compatible. Skew → a sticky
WORKER_INCOMPATIBLEenvelope (spec §5). - config_
unusable 🔒 - A configuration that could not be resolved, as the envelope every tool call will return.
- expect_
success - Turn an
RpcResponseinto itsresultValue, or map a workerFailureinto a structured envelope. - mk
- Build an RpcRequest with a fixed id=1 (single in-flight request per conn — the worker services one
at a time; the id is validated by
WorkerConnper §4.4).