Skip to main content

Module parse

Module parse 

Source
Expand description

Free-standing parsing/path utilities used by the rest of subagent_watcher — none of these need &self. Covers: JSONL line parsing, journal-count reading, workflow/session id derivation from a path, the block-delete cascade subscriber, and Claude config dir resolution.

Functions§

derive_claude_config_dir
Derive the Claude Code config directory for a host agent. Only matches reality for an agent with an explicit per-account auth dir — prefer resolve_claude_config_dir when the block’s meta is available.
resolve_claude_config_dir
The authoritative Claude Code config directory for a block.
spawn_block_prune_subscriber
Subscribe to the reducer’s srv_events_tx broadcast and prune watcher’s per-block state on Event::BlockDeleted/TabDeleted/WorkspaceDeleted — the robust backstop described on SubagentWatcher::prune_block’s doc comment. Mirrors crates/cef/src/srv_ipc.rs’s cascaded-block-id extraction (same three-arm match, same rationale: TabDeleted/ WorkspaceDeleted never emit a per-block event of their own — see reducer/tab.rs::handle_delete_tab’s doc comment — so block_ids is the only signal for a block that cascaded out via its tab/workspace) and server/mux_obj_bridge.rs::run_mux_obj_bridge’s subscribe-loop plumbing (lag/close handling).