/** * One agent conversation, shared by the Stream and the operator dashboard's drawer * (operator-console/AC-47..AC-50, operator-console/AC-52, operator-console/AC-53, * operator-console/AC-55). * * Moved out of `session.ts` so both consoles run one copy of the turn loop (design * D-4). What a console shows and how it asks are its own: the loop reaches the * screen only through `ConversationIO`. * * @module */ import { type Denial, type Harness, type PendingOutput } from './harness.js'; export interface TurnProcess { /** `missing`: the program could not start. `interrupted`: Ctrl-C stopped it. */ done: Promise<{ code: number | null; missing: boolean; interrupted: boolean; }>; /** * Stop the turn as Ctrl-C would. The dashboard needs it: in raw mode Ctrl-C is a * key, and no SIGINT reaches the turn's own listener (operator-console/AC-52). */ stop(): void; } export interface ConversationIO { say(line: string): void; /** Whether the user allows a refused tool for the session (operator-console/AC-48). */ ask(d: Denial): Promise; spawn(argv: string[], stdin: string, onLine: (line: string) => void, onErr: (line: string) => void): TurnProcess; } export type SendResult = 'done' | 'missing' | 'stopped'; export declare class Conversation { harness: Harness; session: string | null; allowed: string[]; /** Output of commands and shell lines run since the last message (operator-console/AC-49). */ pending: PendingOutput[]; costUsd: number; tokens: number; constructor(harness: Harness); /** * One message, and the turns that follow it while the user keeps allowing refused * tools. `missing` when the harness's program could not start, `stopped` when the * turn was interrupted. */ send(text: string, io: ConversationIO): Promise; /** Forget the session and what was allowed in it; queued output is dropped too. */ newSession(): void; /** A different harness always starts a new session (operator-console/AC-50). */ switchTo(h: Harness): void; } //# sourceMappingURL=conversation.d.ts.map