/** * Worker Configuration * * Load and manage Worker configuration from ~/.paean/worker.json */ import type { WorkerConfig, ExecutorType } from './types.js'; /** * Worker config file structure */ export interface WorkerConfigFile { /** Enable Worker mode */ enabled?: boolean; /** Worker capabilities */ capabilities?: string[]; /** Poll interval in milliseconds */ pollInterval?: number; /** Task execution timeout in milliseconds */ taskTimeout?: number; /** Enable autonomous mode (no confirmations) */ autonomousMode?: boolean; /** Enable task verification */ verificationEnabled?: boolean; /** Maximum retry attempts */ maxRetries?: number; /** Working directory override */ workingDirectory?: string; /** Sandbox paths (allowed directories) */ sandboxPaths?: string[]; /** Debug logging */ debug?: boolean; /** Per-executor user preferences */ executorPreferences?: Partial>; } /** * User preference for a specific executor */ export interface ExecutorPreference { /** User has disabled this executor */ disabled?: boolean; /** Custom binary path override */ path?: string; /** Session timeout override (ms) */ sessionTimeout?: number; /** Additional CLI arguments */ extraArgs?: string[]; } /** * Get the Worker config file path * Uses JSON format for consistency with MCP config pattern */ export declare function getWorkerConfigPath(): string; /** * Load Worker config from file (JSON format) */ export declare function loadWorkerConfig(): WorkerConfigFile | undefined; /** * Save Worker config to file (JSON format) */ export declare function saveWorkerConfig(config: WorkerConfigFile): void; /** * Create default Worker config file if it doesn't exist */ export declare function initWorkerConfigIfNeeded(): WorkerConfigFile; /** * Merge file config with provided overrides */ export declare function mergeWorkerConfig(overrides?: Partial): WorkerConfig; /** * Check if a path is within allowed sandbox paths */ export declare function isPathInSandbox(targetPath: string, sandboxPaths?: string[]): boolean; /** * Get sandbox paths from config */ export declare function getSandboxPaths(): string[]; /** * Validate and sanitize a path against sandbox restrictions * Returns the path if valid, throws if outside sandbox */ export declare function validateSandboxPath(targetPath: string): string; /** * Get preference for a specific executor */ export declare function getExecutorPreference(type: ExecutorType): ExecutorPreference | undefined; /** * Set preference for a specific executor */ export declare function setExecutorPreference(type: ExecutorType, pref: ExecutorPreference): void; /** * Check if user has disabled a specific executor */ export declare function isExecutorUserDisabled(type: ExecutorType): boolean; /** * Enable or disable an executor for the current user */ export declare function setExecutorEnabled(type: ExecutorType, enabled: boolean): void; /** * Get all executor preferences */ export declare function getAllExecutorPreferences(): Partial>; //# sourceMappingURL=config.d.ts.map