/** * Handoff index: `specweave handoff --all` and `specweave pickup --all`. * * One read for switching accounts or tools with many increments in flight. * `handoff --all` writes `.specweave/handoffs/-INDEX.md` plus * `.specweave/handoffs/index.json` with one row per active increment (tasks, * open ACs, last activity, what it waits on, a paste-ready resume prompt) and, * in an umbrella workspace, every nested checkout holding work that exists only * on this machine. `pickup --all` prints the newest index, actionable rows * first. * * Read-only toward everything but the index files: no ledger events, no claims * released, nothing committed or pushed, in the umbrella or in nested repos. * * @module core/session/handoff-all */ import { type PrLookup } from './nested-repos.js'; export declare const HANDOFFS_DIR = ".specweave/handoffs"; export declare const INDEX_JSON_FILE = "index.json"; /** Generator marker: an INDEX file without it was written by a person and is left alone. */ export declare const INDEX_MARKER = ""; export interface IndexRepo { path: string; branch: string; sha: string; dirty: number; ahead: number; noRemote: boolean; upstream?: string; lastCommitAt?: string; pr?: { number: number; url: string; state: string; isDraft: boolean; }; increments: string[]; } export interface IndexRow { id: string; title: string; status: string; tasksDone: number; tasksTotal: number; openAcs: string[]; /** ACs closed only by accepted skips: neither open nor verified (absent in indexes written before 1098). */ acceptedSkipAcs?: string[]; totalAcs: number; lastActivityAt?: string; /** What the increment waits on (a person, a decision), from `wait` events and handoff.md. */ waits: string[]; /** Repo-relative handoff docs that exist for it (`handoff.md`, `handoff.auto.md`). */ handoffDocs: string[]; /** Nested checkouts with local-only work whose path or branch carries this increment's id. */ repos: string[]; resumePrompt: string; } export interface HandoffIndex { version: 1; generatedAt: string; /** Local date, YYYY-MM-DD. */ date: string; root: string; agent: string; reason?: string; rows: IndexRow[]; /** Absent when the workspace has no registered repos or conventional repository directory or the scan was skipped. */ repos?: { scanned: number; flagged: IndexRepo[]; }; } export interface HandoffIndexOptions { reason?: string; agent?: string; /** Scan repositories (default: when inventory or a conventional repository directory exists). */ scanRepos?: boolean; /** PR lookup for the nested scan (default: gh when installed); `false` skips it. */ prLookup?: PrLookup | false; now?: Date; } export interface WriteIndexOptions extends HandoffIndexOptions { /** Directory to write into (default `.specweave/handoffs`). */ outDir?: string; /** Build and render only; write nothing. */ dryRun?: boolean; } export interface WriteIndexResult { index: HandoffIndex; markdown: string; mdPath: string; jsonPath: string; written: boolean; } /** * Open waits of an increment: `wait` ledger events after the last clearing one, * then "Waits on" / "Waiting on" lines (or a section with that heading) in its * handoff docs. */ export declare function readWaits(incDir: string): string[]; /** "Waits on: X", "**Waiting on Anton:** X", or bullets under a "## Waiting on …" heading. */ export declare function parseWaitLines(text: string): string[]; export declare function buildResumePrompt(root: string, row: Omit, repos: IndexRepo[]): string; /** Build the index. Never writes. */ export declare function buildHandoffIndex(root: string, opts?: HandoffIndexOptions): Promise; /** Rows without waits first, then waiting rows; newest activity first inside each group. */ export declare function sortRows(rows: IndexRow[]): { actionable: IndexRow[]; waiting: IndexRow[]; }; /** Render INDEX.md. `keep` blocks from the previous version go under the header. */ export declare function renderHandoffIndex(index: HandoffIndex, keep?: string[]): string; /** Build, render and (unless `dryRun`) write INDEX.md and index.json. */ export declare function writeHandoffIndex(root: string, opts?: WriteIndexOptions): Promise; export interface LatestIndex { index?: HandoffIndex & { markdown?: string; }; /** The newest INDEX markdown file, when there is one. */ mdPath?: string; } /** The newest index: `index.json` when present, else the newest `*-INDEX*.md` file. */ export declare function readLatestIndex(root: string): LatestIndex; /** What `pickup --all` prints: actionable rows first, then waiting rows, then local-only repos. */ export declare function renderPickupAll(root: string, latest: LatestIndex, now?: Date): string; //# sourceMappingURL=handoff-all.d.ts.map