/** * Layer 2: Agent lifecycle manager. * * In-memory singleton managing a single Claude Code subprocess. * Only one agent task runs at a time (single-developer workflow). * The server tracks the active process in module-level state. * * This module does not import from Layer 1. */ import type { Client } from '@libsql/client'; import type { ResolvedConfig } from '../../config.js'; import type { AgentState } from './types.js'; /** * Return the current agent state snapshot. */ export declare function getActiveAgent(): AgentState; /** * Resolve the absolute path to the Claude CLI binary. * Returns the path if found, or null if not installed. * * Uses the first `claude` on PATH whose `--version` output * indicates a modern version (1.x+) that supports `--output-format`. */ export declare function resolveClaudePath(): Promise; /** * Check whether the Claude CLI is available on the system PATH. */ export declare function isClaudeAvailable(): Promise; /** * Start the AI agent on a task. * * Validates preconditions, fetches the task, generates fresh project * context, builds the prompt, spawns Claude Code as a child process, * and sets up stdout parsing for structured markers. * * @throws Error if an agent is already active, the task is not found, * or the Claude CLI is not installed. */ export declare function startAgent(taskId: string, db: Client, config: ResolvedConfig): Promise; /** * Stop the currently running agent. * * Sends SIGTERM to the child process, resets state to idle, * and reverts the task status to backlog. * * @throws Error if no agent is currently active. */ export declare function stopAgent(db: Client): Promise; /** * Unblock the agent by providing an answer to its question. * * Kills the current process, clears the blocked reason, and restarts * the agent with a new prompt that includes the developer's answer. * * @throws Error if the agent is not in the blocked state. */ export declare function unblockAgent(answer: string, db: Client, config: ResolvedConfig): Promise; /** * Reset the agent state to idle. Exposed only for testing. * @internal */ export declare function _resetForTesting(): void; //# sourceMappingURL=agent.d.ts.map