/** * Adapter mode selector. `print` (default) uses `-p` + stream-json; `tui` uses interactive TUI * under tmux with jsonl tail (DR-0012). Both modes share the rest of the CLI surface. */ export type ClaudeSpawnMode = 'print' | 'tui'; export interface ClaudeSpawnOptions { tools: string | null; systemPrompt?: string | null; appendSystemPrompt?: string | null; model?: string | null; claudeAgent?: string | null; pluginDirs?: string[] | null; outputStyle?: string | null; needsResume: boolean; sessionId: string; /** Override MCP config path. Thread sessions pass CORE_MCP_CONFIG (remote_* only). */ mcpConfigPath?: string; /** Layer the cortex-slack MCP server on top of the base config. Set by the adapter for sessions * that originate from Slack (channel carries the `slack:` prefix). Ignored for thread/core * sessions (CORE_MCP_CONFIG), which must stay on the core server set only. */ loadSlackMcp?: boolean; /** Layer the cortex-feishu MCP server on top of the base config. Set by the adapter for sessions * that originate from Feishu (channel carries the `feishu:` prefix). Ignored for thread/core * sessions (CORE_MCP_CONFIG), which must stay on the core server set only. */ loadFeishuMcp?: boolean; /** Extra CLI options from profile (e.g. {"--thinking": "xhigh"}). */ extraOption?: Record | null; /** DR-0012: select adapter mode. Default 'print' preserves -p stream-json behavior. */ mode?: ClaudeSpawnMode; } export declare function buildSpawnArgs(options: ClaudeSpawnOptions): string[]; /** Cortex agent execution context — surfaces as CORTEX_* env vars so MCP tools * (cortex_context, cortex_schedule_*) can self-discover the current thread/profile/etc. * Optional fields are omitted from env when undefined, so child processes see no key * rather than an empty string. */ export 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; /** When true, load only core MCP server (remote_* tools). */ useCoreMcp?: boolean; /** Recursion depth of the owning thread, surfaced as CORTEX_THREAD_DEPTH so the thread_start * MCP tool can forward it and the daemon-side depth guard can cap nested thread spawning. */ threadDepth?: number | null; /** Owning dispatch task id/project (when the agent runs inside a task-dispatched thread), * surfaced as CORTEX_TASK_ID / CORTEX_TASK_PROJECT so `cortex-task spawn` can infer the * current task as the parent of a child task without the agent re-declaring it. */ taskId?: string | null; taskProject?: string | null; } export declare function buildClaudeEnv(channel: string, sessionId: string, callbackSource?: string | null, scheduleTaskId?: string | null, anthropicBaseUrl?: string, extraEnv?: Record, context?: CortexAgentContext): NodeJS.ProcessEnv;