import { type JobRootOpts } from './job-command-shared.js'; /** * D6: every job subcommand resolves a job root, so every one of them must be * able to name the session that holds the job. Same precedence as the rest of * the CLI (`peaks sub-agent dispatch`, `peaks web *`, `peaks share *`), except * that job state has no "unknown-sid" location to land in — an unresolvable * session is an error, not a silent fallback. */ export declare const SESSION_ID_HELP = "session id (default: resolve from .peaks/_runtime/session.json; falls back to PEAKS_SESSION_ID env var; final fallback: NO_ACTIVE_SESSION error)"; /** * Resolves the on-disk root for Job state files. * * Per spec §3.3 + §4.5 (2.7.1 single-scope-axis layout), Job state lives at: * `/.peaks/_runtime//job//state.json` * * The `JobStateStore` itself only knows its `rootDir` + `jobId` and joins them. We * compute the canonical root here (per-call) so the store can stay layout-agnostic. * * Resolution order (D6 — a job must stay addressable while the single per-project * `.peaks/_runtime/session.json` binding points at another session): * 1. `--session-id` flag (explicit override) * 2. `PEAKS_SESSION_ID` env var * 3. `getCurrentSessionId(project)` — this caller's session binding, falling back * to `.peaks/_runtime/session.json` when no caller binding is resolvable * 4. Error (NO_ACTIVE_SESSION) — must never silently fall back to a random uuid * * When `jobId` is passed and it is absent from the resolved session, the thrown * error names the session that does hold it (if any), instead of leaving the * caller with a bare "no state for at " path. */ export declare function resolveJobStateRoot(opts: JobRootOpts, jobId?: string): { rootDir: string; sessionId: string; projectRoot: string; };