/** * Projection of pi-subagents' public `status` RPC reply into sidebar rows. * * Reads only the documented, versioned shapes from pi-subagents' docs/extension-api.md: * `data.asyncSnapshot` (kind "pi-subagents.async-status-snapshot", version 1) for background * runs, and `data.fleet` (version 1) for active foreground children, which the snapshot doesn't * cover. Unknown fields are ignored, as that doc asks. No pi imports, so tests stay light. */ export type RowState = "running" | "queued" | "done" | "failed" | "paused" | "stopped"; export interface Row { label: string; state: RowState; currentTool?: string; startedAt?: number; endedAt?: number; /** A foreground child (from the fleet DTO). */ foreground?: boolean; /** Model as the fleet DTO reports it, e.g. "anthropic/claude-opus-5-5". Active children only. */ model?: string; /** Tokens so far (input + output). Active children only. */ tokens?: number; } /** What the sidebar shows about the limits, from the status reply and the config file. */ export interface Limits { /** Children launched this session, and the cap (null: no cap). */ spawned?: { used: number; limit: number | null; }; /** Background runs active in this session, and the cap (only when a cap is configured). */ asyncActive?: { used: number; limit: number; }; /** `globalConcurrencyLimit`: children running at once inside one run. */ parallel?: number; } /** Rows from a `status` reply's `data`: background leaves, then active foreground children. */ export declare function rowsFromStatus(data: unknown): Row[]; /** "anthropic/claude-opus-5-5" becomes "opus-5-5". */ export declare function shortModel(model: string): string; /** 16147 becomes "16k", 1_200_000 becomes "1.2M". */ export declare function fmtCount(n: number): string; /** Spawn budget from a `status` reply made with `view: "fleet"` (`data.details.spawnBudget`). */ export declare function spawnedFrom(data: unknown): Limits["spawned"]; /** Active async runs and their cap from the fleet DTO; undefined when no cap is configured. */ export declare function asyncActiveFrom(data: unknown): Limits["asyncActive"]; /** `globalConcurrencyLimit` from pi-subagents' config.json text (default 20 when absent). */ export declare function parallelFrom(configText: string | undefined): number; /** The limits line under the rows, or undefined when there is nothing to say. */ export declare function limitsLine(l: Limits): string | undefined; /** Active first (oldest first), then finished (newest first). */ export declare function orderRows(rows: Row[]): Row[]; export declare function summary(rows: Row[]): { text: string; running: number; failed: number; }; export declare function elapsed(r: Row, now?: number): string; /** Plain glyphs that exist in common monospace fonts. */ export declare const GLYPH: Record;