import type { AgentHandle } from '../../core/types/agent-types.js'; import type { AgentAdapter, AgentSpawnConfig, AgentProcess, Backend } from '../types.js'; import { Capability } from '../capabilities.js'; declare class CancelledError extends Error { cancelled: boolean; constructor(); } /** Cortex agent execution context — surfaces both in route-context.json (for the * slack/context MCP tools to read at request time) and as CORTEX_* env vars in * the MCP server child. Mirrors CortexAgentContext in claude/spawn-args.ts. */ interface CortexAgentContext { threadId?: string | null; profile?: string | null; project?: string | null; sessionName?: string | null; /** Cortex execution record id, surfaced as CORTEX_EXECUTION_ID to subprocess env. */ executionId?: string | null; } declare function buildMcpBlock(channel: string, sessionId: string | null, callbackSource: string | null, routeContextPath: string, context?: CortexAgentContext): string; declare function shutdownCodex(): void; interface SlackFile { mimetype: string; localPath: string; name: string; } declare function runCodex(userMessage: string, { channel, sessionId, files, callbackSource, context }: { channel: string; sessionId: string | null; files?: SlackFile[]; callbackSource?: string | null; context?: CortexAgentContext; }): AgentHandle; export declare class CodexAdapter implements AgentAdapter { readonly backend: Backend; readonly capabilities: Set; private openSessions; spawn(config: AgentSpawnConfig): AgentProcess; close(sessionKey: string): Promise; kill(sessionKey: string): boolean; listSessions(): string[]; } export { runCodex, CancelledError, shutdownCodex, buildMcpBlock };