/** * AgentMuxClient and createClient factory for @a5c-ai/agent-mux. */ import type { AgentName, RetryPolicy } from './types.js'; import type { StoragePaths } from './storage.js'; import type { RunOptions, RunHandle } from './run-options.js'; import type { ProfileManager } from './profiles.js'; import type { AdapterRegistry } from './adapter-registry.js'; import type { ModelRegistry } from './model-registry.js'; import type { SessionManager } from './session-manager.js'; import type { ConfigManager } from './config-manager.js'; import type { AuthManager } from './auth-manager.js'; import type { PluginManager } from './plugin-manager.js'; import { type HostHarnessInfo, type DetectHostHarnessOptions } from './host-detection.js'; /** Options for creating an AgentMuxClient. */ export interface ClientOptions { /** Default agent for runs when `RunOptions.agent` is not specified. */ defaultAgent?: AgentName; /** Default model for runs when `RunOptions.model` is not specified. */ defaultModel?: string; /** * Default approval mode for tool calls and file operations. * @default 'prompt' */ approvalMode?: 'yolo' | 'prompt' | 'deny'; /** * Default run timeout in milliseconds. 0 means no timeout. * Must be a non-negative integer. * @default 0 */ timeout?: number; /** * Default inactivity timeout in milliseconds. 0 means no timeout. * Must be a non-negative integer. * @default 0 */ inactivityTimeout?: number; /** Default retry policy for transient failures. */ retryPolicy?: RetryPolicy; /** * Default streaming mode. * @default 'auto' */ stream?: boolean | 'auto'; /** * Override the global config directory path. * Must be an absolute path. */ configDir?: string; /** * Override the project config directory path. * Must be an absolute path. */ projectConfigDir?: string; /** * Enable debug mode. * @default false */ debug?: boolean; } export type { SessionManager } from './session-manager.js'; export type { ConfigManager } from './config-manager.js'; export type { AuthManager } from './auth-manager.js'; export type { PluginManager } from './plugin-manager.js'; /** The main entry point for interacting with agent-mux. */ export declare class AgentMuxClient { /** Resolved storage paths. */ readonly storagePaths: StoragePaths; /** The options this client was created with (after defaults). */ readonly options: Readonly; /** Adapter registry — discovery, capabilities, installation info. */ readonly adapters: AdapterRegistry; /** Model registry — per-agent model lists and metadata. */ readonly models: ModelRegistry; /** Session manager — read native session files. */ readonly sessions: SessionManager; /** Config manager — read/write agent config files. */ readonly config: ConfigManager; /** Auth manager — detect and surface authentication state. */ readonly auth: AuthManager; /** Profile manager — named RunOptions presets. */ readonly profiles: ProfileManager; /** Plugin manager — install, list, remove plugins per agent. */ readonly plugins: PluginManager; /** Logger instance for this client. */ private readonly logger; /** @internal — use `createClient()` instead. */ constructor(options: ClientOptions, storagePaths: StoragePaths); /** * Start an agent run and return a handle for streaming events, * interaction, and control. * * @param options - Run configuration. `agent` and `prompt` are required. * @returns RunHandle (not yet implemented — throws) * @throws AgentMuxError with code INTERNAL until fully implemented. * * @see 01-core-types-and-client.md §5.2 */ run(options: RunOptions): RunHandle; /** * Detect whether the current process is running under a supported harness. * * Aggregates env signals contributed by each registered adapter's * `hostEnvSignals` array with the built-in defaults. * * @returns HostHarnessInfo if a harness is detected, else null. */ detectHost(opts?: DetectHostHarnessOptions): HostHarnessInfo | null; } /** * Create an AgentMuxClient instance. * * Synchronous. Validates options and returns the client immediately. * No I/O is performed during construction. * * @throws ValidationError if any option value is invalid. */ export declare function createClient(options?: ClientOptions): AgentMuxClient;