/** * Carrying out what a key asked for (operator-console/AC-29..AC-38, * operator-console/AC-42, operator-console/AC-43, operator-console/AC-47..AC-53, * operator-console/AC-58). * * Every action runs the `aidlc` command it names, in-process through commander, with * any value a person typed or picked placed after `--` (design D-2): one path per * action, the same output and exit code as typing it, and no typed text ever reaching * a shell string. Commands run inside `withPrompter(formPrompter(…))`, so their * questions are forms drawn over the dashboard. * * Two lanes, so a long agent reply never blocks a key: one command at a time, and one * agent turn at a time. A second command while one runs is refused with a message, * not queued behind it. * * @module */ import { type PromptResult } from '../../core/prompt.js'; import { Conversation, type TurnProcess } from '../conversation.js'; import { type Harness } from '../harness.js'; import type { Effect, FormState, OperatorData, UiState } from './model.js'; /** Lines of a log shown by `l` or `enter` (operator-console/AC-30, AC-31). */ export declare const LOG_LINES = 200; export interface EffectHost { data(): OperatorData; ui(): UiState; /** Change the UI state and redraw. */ update(f: (ui: UiState) => UiState): void; /** Read the panels again and redraw. */ refresh(): void; /** Clear and redraw everything: a command's child may have drawn over the screen. */ repaint(): void; suspend(run: () => Promise): Promise; quit(): void; } export interface EffectDeps { /** The roadmap item's file, from its name under `backlog/`; null when it cannot be found. */ roadmapFile(file: string): string | null; logs: string | null; read(path: string): string | null; missingArgs(argv: string[]): string[] | null; runCommand(argv: string[]): Promise; capture(run: () => Promise): Promise<{ value: T; output: string; }>; /** Aborting `signal` stops it, as Ctrl-C does a turn. */ runShell(cmd: string, signal: AbortSignal): Promise<{ code: number | null; output: string; }>; openShell(cwd: string): Promise; spawnTurn(argv: string[], stdin: string, onLine: (line: string) => void, onErr: (line: string) => void): TurnProcess; } /** What `/watch` says in the dashboard's drawer. */ export declare const WATCH_IS_BUILDING = "BUILDING, at the top, is the watch view \u2014 press esc, then v to switch its layout (cards, table, lanes)"; /** * Text as the screen can draw it, one screen line per line: no escape codes, no tabs * (which would push a line past its width), and a reply's own newlines split out. */ export declare const printable: (text: string) => string[]; export declare class Effects { private readonly deps; private readonly host; readonly chat: Conversation; private commandBusy; private turn; private shell; private denial; private form; constructor(deps: EffectDeps, host: EffectHost, harness: Harness); /** Carry out one effect. Never throws: a failure is the red line above the key bar (operator-console/AC-38). */ run(e: Effect): Promise; /** The command running in this process, if any, as the message line names it. */ commandRunning(): string | null; /** Stop an agent turn or a drawer shell line still running, when the console closes. */ stopTurn(): void; /** Ask in a form drawn over the dashboard; the answer comes back as a `formDone` effect. */ showForm(f: FormState): Promise>; private dispatch; /** A shell or the watch view would share the terminal with a command still writing to it. */ private refuseWhileCommand; /** Changing session or agent mid-reply would store one agent's session id under the other. */ private refuseWhileReplying; private say; private drawer; private overlay; private item; /** * `aidlc `: asks for any required positional left out, as a text form, and puts * it after `--` (operator-console/AC-42, AC-58); output to an overlay, the message * line or the drawer, and kept for the next agent message (operator-console/AC-43). */ private aidlc; /** `enter` on a row (operator-console/AC-30, AC-36). */ private details; private log; /** A drawer line, routed exactly as the Stream routes it (operator-console/AC-47). */ private send; private consoleCommand; private switchAgent; /** One message to the agent, its reply in the drawer (operator-console/AC-47..AC-53). */ private agent; } //# sourceMappingURL=effects.d.ts.map