/** * orchestrator-can-do-probes.js — the Q2/Q4 subprocess probes behind * `peaks code orchestrator-can-do`. * * Hoisted verbatim out of `./orchestrator-can-do.ts` (slice c2w1 of * `strict-remediation-abc`) so that module keeps only the pure decision side. * The names leave this file ONLY through that module's re-export: the CLI shim * (`src/cli/commands/code-orchestrator-can-do.ts`) reaches them via * `await import('../../services/code/orchestrator-can-do.js')`, and the unit * tests import them from the same path, so the surface below must stay * reachable from there. */ /** * Budget for the Q2 sub-agent probe. macOS CI runs this whole suite in parallel; * there the old 5 s budget killed the probe at 5035 ms while the 10 s Q4 probe * passed in the same run, so "slow" was reported as "unavailable". A healthy CLI * answers in well under a second — this ceiling only bounds a hung one, so it is * the worst case, not the expected cost. */ export declare const SUB_AGENT_PROBE_TIMEOUT_MS = 15000; /** Budget for the Q4 context probe. Unchanged; Q2 must stay at least this large. */ export declare const CONTEXT_RATIO_PROBE_TIMEOUT_MS = 10000; export interface ContextProbe { /** 0.0–1.0; ≥0.85 = pre-compact; ≥0.95 = red-line. */ readonly ratio: number; /** Source tag from `peaks code context-now`. */ readonly source: string; } /** * Q2: probe `peaks sub-agent dispatch --role rd --help`. Returns * true when the subprocess exits 0. Resolves to false on spawn * failure or non-zero exit. */ export declare function probeSubAgentAvailable(projectRoot: string, peaksBin?: string): Promise; /** * Q4: probe `peaks code context-now --json`. Parses the data.ratio * field. Falls back to {ratio: 0, source: 'unavailable'} when the * subprocess fails or returns malformed JSON. */ export declare function probeContextRatio(projectRoot: string, peaksBin?: string): Promise;