/**
 * Terminal Controller
 *
 * Handles terminal session management endpoints for the API.
 * Uses ISessionBackend for PTY-based session operations.
 *
 * @module terminal-controller
 */
import { Request, Response } from 'express';
import type { ApiContext } from '../types.js';
/**
 * List all active terminal sessions.
 *
 * @param req - Express request object
 * @param res - Express response object
 * @returns Promise that resolves when response is sent
 *
 * @example
 * GET /api/terminal/sessions
 * Response: { success: true, data: { sessions: ["session1", "session2"] } }
 */
export declare function listTerminalSessions(req: Request, res: Response): Promise<void>;
/**
 * Check if a terminal session exists.
 *
 * @param req - Express request object with sessionName param
 * @param res - Express response object
 * @returns Promise that resolves when response is sent
 *
 * @example
 * GET /api/terminal/my-session/exists
 * Response: { success: true, data: { exists: true, sessionName: "my-session" } }
 */
export declare function sessionExists(req: Request, res: Response): Promise<void>;
/**
 * Capture terminal output from a session.
 *
 * @param req - Express request object with sessionName param and lines query
 * @param res - Express response object
 * @returns Promise that resolves when response is sent
 *
 * @example
 * GET /api/terminal/my-session/output?lines=50
 * Response: { success: true, data: { output: "...", sessionName: "my-session", lines: 50, truncated: false } }
 */
export declare function captureTerminal(req: Request, res: Response): Promise<void>;
/**
 * Write data to a terminal session.
 *
 * @param req - Express request object with sessionName param and data in body
 * @param res - Express response object
 * @returns Promise that resolves when response is sent
 *
 * @example
 * POST /api/terminal/my-session/write
 * Body: { data: "hello\r" }
 * Response: { success: true, message: "Data written successfully" }
 */
export declare function writeToSession(req: Request, res: Response): Promise<void>;
/**
 * Send terminal input to a session (legacy endpoint).
 *
 * @param req - Express request object with sessionName param and input in body
 * @param res - Express response object
 * @returns Promise that resolves when response is sent
 *
 * @example
 * POST /api/terminal/my-session/input
 * Body: { input: "echo hello" }
 * Response: { success: true, message: "Input sent successfully" }
 */
export declare function sendTerminalInput(req: Request, res: Response): Promise<void>;
/**
 * Send a special key to a terminal session.
 *
 * @param req - Express request object with sessionName param and key in body
 * @param res - Express response object
 * @returns Promise that resolves when response is sent
 *
 * @example
 * POST /api/terminal/my-session/key
 * Body: { key: "Enter" }
 * Response: { success: true, message: "Key sent successfully" }
 */
export declare function sendTerminalKey(req: Request, res: Response): Promise<void>;
/**
 * Kill a terminal session.
 *
 * @param req - Express request object with sessionName param
 * @param res - Express response object
 * @returns Promise that resolves when response is sent
 *
 * @example
 * DELETE /api/terminal/my-session
 * Response: { success: true, message: "Session killed successfully" }
 */
export declare function killSession(req: Request, res: Response): Promise<void>;
/**
 * Deliver a message to an agent session with reliable retry and verification.
 *
 * Uses AgentRegistrationService.sendMessageToAgent() — the same battle-tested
 * delivery path that chat-to-orchestrator uses (prompt check + 3-attempt retry
 * + stuck detection). This replaces the fire-and-forget `/write` endpoint for
 * sub-agent message delivery from skill scripts.
 *
 * Must be called with `.call(apiController, req, res)` so `this` is an ApiContext.
 *
 * @param req - Express request with sessionName param and message in body
 * @param res - Express response object
 *
 * @example
 * POST /api/terminal/my-agent/deliver
 * Body: { message: "Hello agent", waitForReady: true }
 * Response: { success: true, verified: true }
 */
export declare function deliverMessage(this: ApiContext, req: Request, res: Response): Promise<void>;
/**
 * Get persistent session log file content.
 *
 * Reads the ANSI-stripped session log file (distinct from live PTY buffer).
 * Includes output from before session restarts.
 *
 * @param req - Express request with sessionName param and optional lines query
 * @param res - Express response object
 *
 * @example
 * GET /api/sessions/crewly-orc/logs?lines=200
 * Response: { success: true, data: { lines: [...], sessionName: "crewly-orc", count: 200 } }
 */
export declare function getSessionLogs(req: Request, res: Response): Promise<void>;
/**
 * Get pending work for an agent session (#172 Adaptive Heartbeat).
 *
 * Returns pending tasks, undelivered messages, and a recommended
 * heartbeat state so agents can self-schedule their next check-in.
 *
 * @param req - Express request with sessionName param
 * @param res - Express response with PendingWorkSummary
 *
 * @example
 * GET /api/agents/crewly-product-sam/pending-work
 * Response: { success: true, data: { hasPendingWork: true, pendingTasks: [...], ... } }
 */
export declare function getPendingWork(this: ApiContext, req: Request, res: Response): Promise<void>;
//# sourceMappingURL=terminal.controller.d.ts.map