#!/usr/bin/env node import { type CliResult } from '../cli-support.js'; export declare const visualUsage: string; /** * Where a repository keeps its live sessions, one directory per session. It sits * under the ignored build directory because a session is runtime state: never * canonical, never committed, and pruned by the next start. */ export declare const VISUAL_SESSION_DIRECTORY: string; /** * Every command an agent can run to completion. `start` is not one of them: it * blocks for the life of the session and is dispatched by `runVisualCli`. * * `request` is the one verb that takes no descriptor - it runs before any * session exists - so it is dispatched ahead of the descriptor requirement. */ export declare function runVisualClientCli(args: readonly string[], cwd?: string): Promise; /** Where a foreground session publishes, and where it observes its signals. */ export interface VisualSignalSource { on(signal: 'SIGINT' | 'SIGTERM', listener: () => void): unknown; off(signal: 'SIGINT' | 'SIGTERM', listener: () => void): unknown; } export interface VisualStartIo { readonly stdout: (chunk: string) => void; readonly stderr: (chunk: string) => void; /** Defaults to the process itself. */ readonly signals?: VisualSignalSource; } /** * Serves one visual session in the foreground. * * The request is validated before any filesystem or network effect, so a bad * document costs nothing. Exactly one public `visual-session-started/v2` line is * published before the command blocks — it names the private descriptor but * never carries the agent capability, which lives only in that mode 0600 file. * The command then holds the session open until the runtime closes it, whether * that is a signal, an agent stop, or a runtime failure; the runtime recovers * the handoff before it removes the session in every one of those cases. */ export declare const runVisualStart: (requestPath: string, cwd?: string, io?: VisualStartIo) => Promise; /** * The whole binary: `start` blocks and streams its one document through `io`, * every other command runs to completion and returns its document. */ export declare const runVisualCli: (args: readonly string[], cwd?: string, io?: VisualStartIo) => Promise;