import { type PlanDigestRow } from '../utils/chat-markers.js'; /** * Extract the launch branch name from the portion of the command AFTER the * launch marker. Reproduces the bash positional parser: * - `--handoff ` consumes two tokens (never shifts the branch position) * - `--kill` marks a pure-kill (no new task ⇒ no record) * - `--test` / `--kill-and-relaunch` / any other `--flag` (including the `--` * passthrough separator) are skipped * - remaining tokens are positional; positional[1] is the branch * * Returns null when this is a pure-kill or there is no branch positional. */ export declare function extractBranch(afterMarker: string): string | null; /** * Extract the backlog key from the portion of the command AFTER the backlog * marker (e.g. `backlog-init`). Simpler than extractBranch — `backlog-init` * has no `--handoff`/`--kill` flag semantics: skip the leading `--` passthrough * separator and any other `--flag`, then return the first positional token. * * Returns null when there is no positional token (malformed invocation). */ export declare function extractBacklogKey(afterMarker: string): string | null; /** * Extract the provenance key for a `hula plan` invocation from the portion of * the command AFTER the plan marker. * - `start`: the sanitized value of the `--name ` flag (the branch). * - `draft-and-launch`: the first positional token (the plan id). * Returns null when the expected key is absent. */ export declare function extractPlanName(afterMarker: string, kind: 'start' | 'draft'): string | null; /** * Parse a hook-JSON payload and, when it is a launch invocation with a branch, * write the session provenance file. Pure of stdin/exit handling so it can be * unit-tested. Never throws for expected "ignore" cases — returns silently. */ export declare function processHookInput(input: string): Promise; /** * Handle a Claude Code `SessionStart` hook payload. On a resume/compact/fork * with resolvable tracking names and a configured project, make ONE short * server read and print a per-plan status digest to stdout. Prints nothing and * never throws on any "nothing to do" / failure path so the session start is * never blocked or polluted. */ export declare function processSessionStart(payload: { session_id?: unknown; cwd?: unknown; transcript_path?: unknown; source?: unknown; }): Promise; /** * Single-shot plan-status fetch for the SessionStart digest. Deliberately NOT * `HulaApiClient.listPlans` (which retries up to 3× on a dropped connection and * would blow the hook's sub-second budget): one `fetch` with a hard * `AbortController` timeout. Returns `[]` on any non-200, abort, or exception. */ export declare function fetchPlanStatuses(config: { apiKey: string; baseUrl: string; }, names: string[], timeoutMs: number): Promise; /** * `hula session-hook` entrypoint. Always resolves to exit code 0 — a capture * failure must never block the tool call. * * @param _argv unused; the hook reads its input from stdin. */ export declare function runSessionHook(_argv: string[]): Promise; //# sourceMappingURL=session-hook.d.ts.map