/** * The documented contract: one path segment. `isUnsafePathInput` is a * traversal guard only and ADMITS `a/b`, so the separator axes are * checked here as well. The session dir is ONE directory name under * `_runtime/`. * * EXPORTED because the session id is the last caller-supplied segment of * more than one session-scoped path: the runtime dir here, and the dispatch * ledger's dir under `.peaks/_sub_agents/` (read by * `src/services/dispatch/dispatch-ledger-reader.ts`). One predicate, two * users, so the two cannot drift apart. */ export declare function isSinglePathSegment(sessionId: string): boolean; export declare function getSessionDir(projectRoot: string, sessionId: string): string; /** * The TOTAL entry to the same axis. Same predicate, same path; the only * difference is that this one is total — it never throws. * * WHY TWO ENTRIES RATHER THAN ONE. The partial entry above is correct * for a caller that cannot proceed without a session dir: a throw is * the one failure a caller cannot forget to handle. It is the WRONG * shape for a frame whose own doc promises never to throw — the * statusline, the fire-and-forget telemetry writer, the best-effort * probe. Each of those frames had to wrap the partial entry in a * `try { } catch { return null }`, and that swallow cannot be told * apart from a real "there is nothing here" answer. Measured on the * compact backoff (`auto-compact-lifecycle.ts`), the conflation turned * an unresolvable id into the ADMIT branch and re-opened a dispatch * that the open run should have suppressed. * * The split does NOT make a swallow unwriteable — TypeScript has no * checked exceptions, so nothing here can. It makes the swallow * UNNECESSARY at a named place, and it gives every checker a stable * name to key on: a frame that degrades must say so by calling this * function, and the degrading branch (`ok: false`) is then a value the * caller has to handle rather than a `catch` nobody reads. * * `reason` is a single-line English sentence fit for an envelope — no * stack traces, no CLI verbs (see `human-nl-choice-only-tenet`). */ export declare function tryGetSessionDir(projectRoot: string, sessionId: string): { readonly ok: true; readonly dir: string; } | { readonly ok: false; readonly reason: string; };