/** * File-driven agent-mode (R147 HB-HERDR-DELEGATES). * * The IPC child (SubAgentProcessManager -> fork) receives its start payload over * process.send; a herdr-pane delegate has no IPC channel, so the same agent-mode * entry reads the payload from `--task-file ` and writes its SubAgentResult * to `--result-file ` (env fallbacks: CORTEX_AGENT_TASK_FILE / CORTEX_AGENT_RESULT_FILE). * The task file is the IPCStartMessage payload plus `permissionMode` (auto|interactive). */ import type { IPCStartMessage, SubAgentResult } from '@nexus-cortex/core'; export type DelegateTaskPayload = IPCStartMessage['payload'] & { permissionMode?: 'auto' | 'interactive'; /** Parent env snapshot + overrides (the pane shell's env is the herdr server's, not the parent's). */ env?: Record; }; export interface DelegateArgs { taskFile?: string; resultFile?: string; } export declare function parseDelegateArgs(argv: string[], env?: NodeJS.ProcessEnv): DelegateArgs; /** * `consume` unlinks the file after a successful parse: it carries the parent's env snapshot * (API keys), and the child is its only reader. */ export declare function readDelegateTaskFile(path: string, opts?: { consume?: boolean; }): DelegateTaskPayload; /** Apply the task file's env to the process: overrides win, HERDR_* (own pane identity) is never touched. */ export declare function applyDelegateEnv(env: Record | undefined, target?: NodeJS.ProcessEnv): void; /** Atomic write (tmp + rename) so a reader never sees a half-written result. */ export declare function writeDelegateResult(path: string, result: SubAgentResult): void; //# sourceMappingURL=delegateTaskFile.d.ts.map