/** * * Lightweight SessionStart primer that fires rotation + presence * cleanup BEFORE the first statusline render of a fresh session. * Independent subcommand (NOT a flag on `peaks workspace init` per * task regulation: "don't add a flag to workspace init"). Cleaner * permission boundary — primer cannot be mistaken for init by users. * * Performs only 3 things: * 1. ensureSessionWithRotation(projectRoot) — the real rotation * entry point (verified at * src/services/session/session-binding-bridge.ts:461-527). * 2. If outer-mismatch rotation occurred: call * clearStalePresenceOnRotation with the verified single-options- * object signature (mirrors init-command.ts:324-329 pattern with * all 3 fields populated). Note: on 4.0.11-A sid-scoped leases * this is a legacy-compat no-op; the real cleanup mechanism is * rotation itself (rebinding changes the bound sid so the * reader looks in the new sid's empty lease dir). * 3. gcStalePresenceLeases({ projectRoot, trigger: 'manual' }) — * sync; documented as legacy-compat no-op on 4.0.11-A sid-scoped * data. * * SKIPS (per RD §4.2.1): * - bootstrapProjectScan * - materializeClaudeSettingsLocal * - resolveFirstTimeHooksInstall * - applyHookInstall (prevents accidental first-launch hook install) * * Mounted as a CHILD of the existing `session` commander group at * `src/cli/commands/core/session-command.ts:32` (verified pattern: * `session.command('list')...`). NOT `program.command('session primer')`. * * The action handler is exported as `runPrimerAction` so the * integration test suite can drive it directly without going through * Commander's argv-parsing wrapper (which would mangle empty / * whitespace / NUL-byte inputs before reaching the action body). */ import type { Command } from 'commander'; import type { ProgramIO } from '../cli-helpers.js'; export type PrimerOptions = { project: string; json?: boolean; }; /** * Pure action body for `peaks session primer`. Exported so * integration tests can drive it directly with crafted inputs (empty * string, whitespace, NUL byte) that would otherwise be rejected by * Commander's argv parser. * * Returns `{ exitCode: 0 | 1 }` so callers (CLI path or test path) * can apply the exit code uniformly. NEVER calls `process.exit` — * exits are the responsibility of the CLI wrapper. */ export declare function runPrimerAction(opts: PrimerOptions, io: ProgramIO): Promise<{ exitCode: 0 | 1; }>; export declare function registerPrimerCommand(program: Command, io: ProgramIO): void;