/** * The `/tasks` command: it opens the panel and, once the panel is gone, leaves * exactly one status-line summary in its place (#10, ADR 0003). * * This module is the seam between pi's command API and the panel: it builds the * session scope, binds the panel to the store, and never registers a widget. * * @author mystery4f <40482524+mystery4f@users.noreply.github.com> */ import type { ExtensionAPI, ExtensionUIContext } from "@earendil-works/pi-coding-agent"; import { type TaskScope } from "../tasks/base/runtime-state.js"; import type { Task } from "../tasks/base/task.js"; import type { ChainTasks } from "../tasks/chain/chain-tasks.js"; import type { LoopTasks } from "../tasks/loop/loop-tasks.js"; import type { ProcessTasks } from "../tasks/process/process-tasks.js"; import { type PanelSource } from "./panel/tasks-panel.js"; /** Command name the user types, without the leading slash. */ export declare const TASKS_COMMAND = "tasks"; /** The one shortcut that opens the panel without typing, shown in the status line. */ export declare const TASKS_SHORTCUT = "shift+down"; /** * How the status line names the way back in. A terminal that never delivers the * shortcut still prints the command, so the hint is never the only door. */ export declare const TASKS_HINT = "/tasks or Shift\u2193"; /** Widget slot this package owns; one line above the editor, replaced in place. */ export declare const SUMMARY_KEY = "pi-pretty-task"; /** Kept for the footer readers of the earlier build; the summary moved above the editor. */ export declare const STATUS_LINE_KEY = "pi-pretty-task"; /** * The one line that stands in for the panel while it is closed: how many tasks * are running, how many have ended, and how to get the panel back. It lives just * above the editor — the footer row is shared with every other extension and the * count gets lost there. */ export declare function statusLineText(tasks: readonly Task[]): string; /** * Bind the panel to one session's stores. The panel asks for every record once and * decides for itself which ones get a row; it still only ever sees these four calls, * so it cannot signal a process, fire a loop or bypass the stores' rules. */ export declare function panelSourceFor(processes: ProcessTasks, loops: LoopTasks, chains: ChainTasks, scope: TaskScope, now?: () => number, foreground?: () => number): PanelSource; /** * Register `/tasks`. The panel is an overlay component, and the only lasting * trace of it is one status line — never a widget, never a footer. */ export declare function registerTasksCommand(pi: ExtensionAPI, processes: ProcessTasks, loops: LoopTasks, chains: ChainTasks, foreground?: () => number): void; /** * Replace the one-line summary of both kinds. With no task there is nothing to * count, so the line is removed rather than left saying zero. */ export declare function publishStatus(ui: ExtensionUIContext, processes: ProcessTasks, loops: LoopTasks, chains: ChainTasks, scope: TaskScope): Promise;