Cross-cutting runtime utilities used by orchestration, hooks, and plugin I/O.
spawnPane, closePane)
used by tmux and zellij adapters.task output and injected background completion text.BackgroundJobBoard tracks
active/unreconciled jobs separately from completed/reconciled reusable
sessions; reusable entries are LRU-capped per parent+agent.SubagentDepthTracker maps session IDs to
depth and is cleaned on session deletion.getEnv falls back from Bun.env to
process.env and normalizes blank values.extractSessionResult/parseModelReference
helpers are centralized under session.ts.collapseSystemInPlace mutates system to
preserve references held by OpenCode internals.pollUntilStable requires consecutive confirmations
before success.background-job-board.tsderiveTaskSessionLabel computes a deterministic prompt hint from
description, the first non-empty prompt line, or a fallback agent label.registerLaunch creates/reopens running jobs and assigns monotonic aliases
within each parent+agent (exp-1, lib-2, etc.).updateStatus marks terminal jobs unreconciled; markReconciled makes only
completed terminal jobs reusable.resolveReusable, markUsed, drop, and clearParent
keep job aliases consistent on polling, reuse, and teardown.formatForPrompt returns the unified ### Background Job Board prompt section
with Active / Unreconciled and Reusable Sessions subsections.tmux.tsspawnPane flow: validate enabled state → check multiplexer availability →
resolve binary → execute attach command with layout handling.closePane flow: send SIGINT-equivalent key sequence → delay → terminate pane
→ rebalance layout if needed.isServerRunning flow: bounded /health checks with retries and caching.polling.tspollUntilStable(fn, options) repeatedly calls async predicate and tracks
consecutive true states.session.tstask.tstask_id, state, timeout, and
result summary fields.system-collapse.tscollapseSystemInPlace(system: string[]) joins system entries with \n\n,
clears and repopulates the same array reference, and preserves empty-array
behavior.src/multiplexer/*: SubagentDepthTracker and tmux.ts integration.src/council/council-manager.ts: depth control and session extraction
helpers.src/hooks/*: marker detection, polling, and session-aware state helpers.src/hooks/task-session-manager: BackgroundJobBoard, task-output parsing,
and deriveTaskSessionLabel provide V2 background job polling/reuse workflow
through message-transform prompt injection.../config (DEFAULT_MAX_SUBAGENT_DEPTH, polling
intervals/timeouts).index.ts re-exports utility API.