import { type AwbConfig } from './rest.js'; import type { ManagedAgentRegistry } from './managed-agents.js'; import type { ManagedAgentContextRegistry } from './managed-agent-context.js'; import type { BaseSessionManager } from './base-session-manager.js'; import type { ChatSessionManager } from './chat-session-manager.js'; import type { SubagentManager } from './subagent-manager.js'; import type { CircuitBreaker } from './circuit-breaker.js'; import type { RuntimeSupervisor } from './runtime/runtime-supervisor.js'; import type { CliLoginManager } from './cli-login.js'; type CommandKind = 'spawn_agent' | 'stop_agent' | 'restart_agent' | 'restart_all_agents' | 'set_working_dir' | 'reload_config' | 'update_plugins' | 'refresh_mcp_config' | 'update_manager' | 'restart_manager' | 'extend_chat_keepalive' | 'release_chat_keepalive' | 'cli_login_start' | 'cli_login_cancel' | 'refresh_available_models' | 'update_cli' | 'run_privileged_command'; export interface AgentManagerCommandPayload { command_id: string; instance_id: string; agent_id?: string; command: CommandKind | string; args?: Record; issued_by?: string; issued_at?: string; timestamp?: string; } export interface CommandHandlerDeps { getInstanceId(): string | null; registry: ManagedAgentRegistry; contextRegistry?: ManagedAgentContextRegistry | null; chatSessionManager?: Pick | null; ticketSessionManager?: Pick | null; subagentManager?: Pick | null; circuitBreaker?: CircuitBreaker | null; runtimeSupervisor?: Pick | null; reloadConfig?: () => Promise | string; countInFlightSessions?: () => number; requestStreamReconnect?: () => Promise | void; cliLoginManager?: Pick | null; refreshAvailableModels?: (() => Promise) | null; updateCli?: ((cli: string, bin?: string | null, sudoTicket?: string | null) => Promise) | null; runPrivilegedCommand?: ((requestId: string, sudoTicket: string) => Promise) | null; } export interface RunPrivilegedCommandResult { ran: boolean; ok: boolean; detail: string; } export interface UpdateCliResult { supported: boolean; ok: boolean; before: string | null; after: string | null; detail: string; hostLabel: string; resolvedPath?: string | null; installMethod?: string | null; needsSudo?: boolean; sudoFailure?: string | null; otherInstalls?: Array<{ path: string; version: string | null; }>; heartbeatPosted: boolean; } export interface RefreshAvailableModelsResult { models: Record; heartbeatPosted: boolean; } export declare class AgentManagerCommandHandler { #private; constructor(config: AwbConfig, deps: CommandHandlerDeps); handle(raw: string): Promise; } export {};