/** * Gathers the two status tiers that the `crew status` inventory renders and * that `crew status --json` publishes. Owns every subprocess and network call * on that path, so the join and the wire format do no I/O. * * The per-task view in status.ts is deliberately not on this path: it reads * its own state, because it reads the whole log where this reads a tail. */ import { type Board } from "../lib/board.ts"; import type { ResolvedConfig } from "../lib/config.ts"; import { type LocalStatusDocument, type RemoteFetchResult, type StatusLifecycle } from "../lib/statusSnapshot.ts"; import { type Issue as SourceIssue } from "../lib/taskSource.ts"; import { type WorkspaceProbe } from "../lib/workspaces.ts"; export interface CollectLocalStatusInput { config: ResolvedConfig; } /** * Every call in the local tier is a local subprocess or file read, which is * what makes it safe for a monitor to poll every few seconds. */ export declare function collectLocalStatus(input: CollectLocalStatusInput): Promise; /** The subset of a collected worktree a pull request lookup needs. */ export interface PullRequestTarget { dir: string; branch: string; } export interface CollectRemoteStatusInput { /** The board fetch, started by the caller so it can overlap the local pass. */ board: BoardFetch; /** * Worktrees from the local tier. Passing the already-resolved branch keeps * this collector from re-reading run state and re-resolving branches that * the local pass just computed. */ pullRequestTargets: readonly PullRequestTarget[]; } /** One board fetch attempt. A failure is a value here, never a throw. */ export type BoardFetch = { kind: "ok"; capturedAt: string; issues: readonly SourceIssue[]; } | { kind: "error"; message: string; }; /** * The board fetch on its own. Exposed separately because it depends on nothing * local, so callers can start it before the local pass finishes. */ export declare function fetchBoardIssues(config: ResolvedConfig): Promise; /** * Remote tier: the board fetch and the pull request lookups. Board-side * classification is applied here, but the local worktree subtraction * deliberately is not — `joinStatus` does that against the freshest local * document, because this tier refreshes far more slowly. * * A failed fetch is a result, not a throw: the caller merges it into the * previous document so last-known-good data survives an outage. */ export declare function collectRemoteStatus(input: CollectRemoteStatusInput): Promise; export declare function buildBoard(config: ResolvedConfig): Promise; export declare function isWorkspaceExited(input: { probe: WorkspaceProbe; task: string; }): boolean; /** * The ways a recorded run lifecycle can disagree with the live session probe. */ export type ProbeDisagreement = "stray-session" | "stray-exited-session" | "session-exited" | "session-dead"; /** * Classifies the disagreement between the recorded lifecycle and the live * probe. An unavailable probe means "we don't know", which is not a * disagreement. * * The row label and the recovery hint both derive from this one * classification, so they cannot drift into describing different conditions. */ export declare function probeDisagreement(input: { lifecycle: StatusLifecycle; probe: WorkspaceProbe; task: string; }): ProbeDisagreement | undefined; export declare function disagreementLabel(disagreement: ProbeDisagreement): string; export declare function workspaceProbeUnavailableText(probe: Extract): string; /** * The most recent log lines mentioning `task`. Callers supply the lines so the * pollable collector can pass a bounded tail while the one-shot per-task view * passes the whole file. */ export declare function recentTaskLogLines(input: { lines: readonly string[]; task: string; }): string[]; //# sourceMappingURL=statusCollect.d.ts.map