import type { IdentityJsonValue } from '../../domain/agent-run/identity.js'; import type { AgentSpawnConfig, McpComposition } from '../types.js'; export interface PISpawnOptions { sessionDir: string; /** Session UUID for legacy callers that intentionally delegate lookup to PI. */ sessionId?: string | null; /** Exact session JSONL path; preferred so PI opens one transcript without scanning. */ sessionPath?: string | null; /** Model identifier (e.g. "deepseek-v4-flash[1m]"); context-window suffix is stripped. */ model?: string | null; /** PI provider name (e.g. "anthropic", "deepseek", "openai-codex"). When set together with model, * emits `--provider `. When omitted, PI infers provider from model name prefix or its default. * Sourced from the cortex profile's `mode` field at adapter-spawn time. */ provider?: string | null; systemPrompt?: string | null; /** Single string or multi-value array; pi args.js:49-51 accepts repeated --append-system-prompt flags. */ appendSystemPrompt?: string | string[] | null; pluginDirs?: string[] | null; /** PI extension file paths; each emits a repeated --extension flag (pi args.js:95-98). */ extensionPaths?: string[] | null; /** Thinking level from the profile's `thinking` field → `--thinking ` * (off/minimal/low/medium/high/xhigh). Absent → no flag. */ thinking?: string | null; /** Extra CLI options from profile (e.g. {"--thinking": "xhigh"}). */ extraOption?: Record | null; } export interface PIEnvOptions { sessionId?: string | null; channel?: string | null; callbackSource?: string | null; scheduleTaskId?: string | null; extraEnv?: Record | null; context?: AgentSpawnConfig['cortexContext']; piAgentDir: string; allowedTools?: string | null; /** Compiled benchmark policy guard. Present puts the child in guarded mode (§13 GT6). */ policyGuard?: IdentityJsonValue; /** Which key of that guard this spawn selects. Absent keeps the one-shot parent's default * (design section 16 (16.1) LS7). */ leaseState?: string; /** Resolved MCP composition; the bridge derives its server set from it (§5.6 P1). */ mcpComposition?: McpComposition; /** Absolute trial deadline the MCP bridge bounds its calls against (§5.6 P2/P5). */ deadlineEpochMs?: number; } export declare function buildPiEnv(options: PIEnvOptions, inheritedEnv?: NodeJS.ProcessEnv): NodeJS.ProcessEnv; export declare function buildSpawnArgs(opts: PISpawnOptions): string[];