import { type Filter } from "./filter.js"; import type { JobRow } from "./protocol.js"; export type GroupKey = "pinned" | "ready" | "needs-input" | "working" | "completed"; export declare const GROUPS: { key: GroupKey; title: string; hint: string; }[]; /** Semantic colour names, mapped to theme tokens by the renderer. */ export type Tone = "accent" | "warning" | "dim" | "success" | "error" | "muted"; export interface Section { /** A state group, or `dir:` when grouping by directory (AV-K6). */ key: string; /** The directory of a directory section. */ dir?: string; title: string; hint: string; rows: JobRow[]; /** Rows folded into "… N more" (completed only). */ hidden: number; collapsed: boolean; } export type Item = { kind: "header"; section: Section; } | { kind: "row"; row: JobRow; section: Section; }; /** * M13: whether the agent view lists a row. As in Claude Code, subagents a session spawns * are not rows of their own: its subagent panel shows them. A child whose parent nobody * holds any more and that still works or waits is listed, so live work never goes unseen. */ export declare function listed(row: JobRow, subagents?: "hide" | "inline"): boolean; export declare function groupOf(row: JobRow, pinned?: ReadonlySet): GroupKey; export interface LayoutOptions { pinned?: ReadonlySet; collapsed?: ReadonlySet; groupBy?: "state" | "directory"; /** DI-7: only matching rows; groups open and nothing folds while it applies. */ filter?: Filter; /** Completed rows shown before folding the rest (AV-5). */ maxCompleted?: number; } /** * AV-K13: rows the user reordered in this section keep that order, below the ones * never moved here (an order made in another group or grouping does not apply). */ export declare function ordered(list: JobRow[], cmp: (a: JobRow, b: JobRow) => number, key?: string): JobRow[]; /** `~/…` for paths under the home directory. */ export declare function shortPath(dir: string, home?: string): string; /** Sections in display order; empty ones are dropped unless nothing exists at all (AV-2). */ export declare function layout(all: JobRow[], opts?: LayoutOptions): Section[]; /** Selectable lines in order: each header, then its rows unless collapsed. */ export declare function items(sections: Section[]): Item[]; export interface Icon { glyph: string; tone: Tone; } /** AV-4: glyph by process state, colour by job state. `frame` animates busy rows. */ export declare function iconOf(row: JobRow, frame?: number, animate?: boolean): Icon; export declare function toneOf(row: JobRow): Tone; /** Compact age; freezes at the run length once the job's work finished (AV-3). */ export declare function ageOf(row: JobRow, now: number): string; export declare function formatDuration(ms: number): string; export interface Counts { needsInput: number; working: number; completed: number; } export declare function counts(rows: JobRow[]): Counts; /** AV-6 header line. */ export declare function headerText(c: Counts): string; /** Context use from this share on is shown as a warning, and as an error from the next. */ export declare const CONTEXT_WARN_PERCENT = 80; export declare const CONTEXT_ERROR_PERCENT = 95; /** * "anthropic/claude-haiku-4-5-20251001" → "claude-haiku-4-5": the id, without the provider, * a gateway's vendor prefix ("anthropic::", Bedrock's "us.anthropic."), a version or a date * suffix, so the part that tells models apart is what the column shows (M22). */ export declare function shortModel(model: string): string; /** M22: a name too long for its column keeps its end ("…aude-opus-5-5"): that is what differs. */ export declare function fitTail(text: string, width: number): string; /** 950 → "950", 86_400 → "86k", 1_000_000 → "1M", 1_250_000 → "1.3M". */ export declare function formatTokens(n: number): string; /** The tone of the share as shown: 79.6 shows as 80% and is a warning. */ export declare function contextToneOf(percent: number | null): Tone; export interface RowDetails { model: string | null; /** "43%", "?%" after a compaction, or null when the window is unknown. */ context: string | null; tone: Tone; } /** M30: a level 0 agent run from a profile (a shell-kind job that is an agent). */ export declare const isProfileRow: (row: Pick) => boolean; /** Whether a reply can reach it: pi, or a profile's agent (typed in); not a plain command. */ export declare const takesReplies: (row: Pick) => boolean; /** The short right-hand column of a row; null when there is nothing to show (shell jobs). */ export declare function rowDetailsOf(row: JobRow): RowDetails | null; /** The peek's full line: "anthropic/claude-opus-5-5 · thinking high · ctx 86k / 200k (43%)". */ export declare function modelFacts(row: JobRow): string[]; /** AV-6 terminal title. */ export declare function titleText(c: Counts): string; /** What the peek panel and the row say for a job (PK-1). */ export declare function sentenceOf(row: JobRow): string; declare const NAME_TONES: readonly ["syntaxKeyword", "syntaxFunction", "syntaxString", "syntaxType", "syntaxNumber", "mdLink"]; export type NameTone = (typeof NAME_TONES)[number]; /** A stable per-session colour for its name (AV-3). */ export declare function nameToneOf(id: string): NameTone; export {};