/** * Maximum prompt length before we switch to temp-file delivery. * Windows argv limit is 32,767 chars; we leave headroom for binary path, * MCP config, and other flags. */ export declare const PROMPT_FILE_THRESHOLD = 28000; /** * Ceiling for the WHOLE command line (binary + every argument). * * The prompt threshold alone is not enough: flags, the session id, a model * spec and the resolved binary path are all part of the same buffer. Windows * refuses anything above ~32k, so we act at 30k; POSIX systems are far more * generous, but a prompt that big is better read from a file anyway. */ export declare const ARGV_SAFE_LIMIT: number; /** The adapter fields this module needs (structural - no import cycle). */ export interface PromptFileAdapter { name: string; supportsPromptFile?: boolean; promptFileFlag?: string; } /** * Where prompt files live. `~/.teamshare/workspace/prompts` is created on * demand; when it cannot be created (read-only install, locked state dir) the * OS temp dir is the fallback - an unreadable-by-policy file is better than no * file at all, and the caller is told which path it got. */ export declare function promptFileDir(): string; /** * Write a prompt to a temp file and return the path. * Also sweeps stale files from previous crashed sessions. */ export declare function writePromptFile(prompt: string): string; /** Delete a prompt temp file (best-effort). */ export declare function cleanupPromptFile(path: string): void; /** * Total characters the OS will see for this command line. * * Deliberately approximate: each part is escaped/quoted when Windows builds the * command line, so a few characters are added per argument. Being a little over * is correct here - the limit is a hard failure, and the fix (a prompt file) is * cheap. */ export declare function argvChars(parts: Array): number; /** * Should this prompt travel as a FILE instead of on argv? * * TRUE when the prompt alone is past the threshold OR the assembled command * line would be past the OS ceiling. A harness without prompt-file support is * never redirected - it gets the old behaviour (and a clear failure, rather * than a silently mangled prompt). */ export declare function shouldUsePromptFile(adapter: PromptFileAdapter, promptChars: number, commandLineChars: number): boolean; /** The user message that points the harness at its instructions file. */ export declare function promptFileInstruction(file: string): string; /** * Build the argv for a harness that must read its instructions from `file`. * * `argsWithoutPrompt` is the adapter's argv built with `excludePrompt: true`, * so the full prompt NEVER reaches the command line by accident - that is the * whole point of this path. */ export declare function promptFileArgs(adapter: PromptFileAdapter, argsWithoutPrompt: string[], file: string): string[];