Skip to main content

Module tool_helpers

Module tool_helpers 

Source
Expand description

Helpers the tool handlers share: cron, durations, quit-self and bulk-stop outcomes, delivery text. Split out of main.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.2).

Functions§

await_shutdown 🔒
Polls srv for a shutdown waiting on the user’s override (SPEC_AGENT_SELF_QUIT_2026_09_24.md §6.5) until it leaves pending — and proceeding too when to_the_end — and returns the last status seen. One long request instead would outlast the client’s own timeout.
close_pane_outcome 🔒
What ClosePane block_id= tells the agent once the target’s user has answered (§6.5).
cron_set_enabled 🔒
deferred_delivery_text 🔒
SendMessage’s answer when srv accepted the message but queued it because the target’s process is starting up, restarting or stopping (SPEC_JEKT_IMMEDIATE_DELIVERY_2026_09_28.md §2.1). A target that is up gets it at once, mid-turn included, and is reported as delivered.
format_duration 🔒
Human-readable representation of a clamped Duration — used in the Loop success message so the reported cadence matches the actual run cadence.
merge_bulk_stop_outcomes 🔒
Folds each waited-on target into FleetBulkStop’s usual shape: stopped (or already gone) → succeeded; kept by the user or failed → failed, with the kept ones also listed in kept_by_user.
parse_interval 🔒
Parse a loop interval string into a Duration. Accepts a number with an optional unit suffix: s (seconds), m (minutes), h (hours); a bare number is treated as minutes. Clamped to [10s, 24h].
quit_self_outcome 🔒
What QuitSelf tells the agent once the user’s override window has settled (§6.5).
quit_self_result 🔒
What QuitSelf tells the agent, from srv’s answer (§4.2, §6.3).
send_message_outcome 🔒
What SendMessage tells the sender, from srv’s /agentmux/reactive/inject body. Each answer keeps its first word (Delivered, QUEUED, HELD) so existing prompts keep working, and adds the message id and the receiver’s condition where srv’s answer already implies it (SPEC_JEKT_DELIVERY_STATES_AND_MAILBOX_2026_10_01.md §5.2, Phase 0 item 3).