import { listTraceSources } from "@mono-agent/observability"; import type { TraceSourceListItem } from "@mono-agent/observability"; export interface RunTuiOptions { readonly configPath: string; readonly cwd: string; readonly env: Record; /** --agent: connect to this label or sourceId directly. */ readonly agent?: string; /** --conversation: conversation id to chat under (default tui-). */ readonly conversationId?: string; /** Build the current folder's responder in this process instead of discovering a service. */ readonly local?: boolean; } /** Test seams: discovery + TUI boot are injectable. */ export interface RunTuiDeps { readonly listSources?: typeof listTraceSources; readonly startTui?: (options: Record) => Promise<{ waitUntilExit(): Promise; }>; readonly isTty?: boolean; readonly stdout?: { write(text: string): void; }; readonly stderr?: { write(text: string): void; }; readonly createLocalSession?: (options: { readonly cwd: string; readonly configPath: string; readonly env: Record; }) => Promise<{ readonly responder: unknown; readonly title: string; dispose(): Promise; }>; } export type TuiLaunchPlan = { readonly kind: "none"; readonly message: string; } | { readonly kind: "error"; readonly message: string; } | { readonly kind: "connect"; readonly source: TraceSourceListItem; } | { readonly kind: "picker"; readonly sources: readonly TraceSourceListItem[]; }; /** * Pure selection logic for `mono-agent tui`: which running agent to connect * to, or whether to open the picker. `registryDirs` names every registry that * was consulted (one entry, or two when the configured registry and the * machine-wide global one differ) purely for the "nothing found" messaging. * Exported for unit tests. */ export declare function resolveTuiLaunch(sources: readonly TraceSourceListItem[], registryDirs: readonly string[], agentFilter: string | undefined): TuiLaunchPlan; /** Extract the tui channel's baseUrl from a manifest's channel summaries. */ export declare function tuiEndpointOf(source: TraceSourceListItem): string | undefined; /** * `mono-agent tui`: discover running agents (machine-wide registry), resolve * the target's stream endpoint + key, and launch the operator console. Works * from any directory — with no local config the registry falls back to * ~/.mono-agent/trace-sources. */ export declare function runTui(options: RunTuiOptions, deps?: RunTuiDeps): Promise; //# sourceMappingURL=tui-command.d.ts.map