/** * Pi binary invocation capture and utilities. * Spec: §3.0 — Round-2 finding C9: Captured pi binary used in RPC/tmux wrapper scripts * * When spawning RPC or tmux child processes, we need to invoke the same Pi binary * that invoked the parent extension. This module captures process.argv[0..1] at * session_start and provides helpers for constructing child argv. */ /** * Captured Pi invocation info. * argv[0] is the node executable, argv[1] is the pi script/entry point. */ interface PiInvocation { node: string; pi: string; } /** * Capture the Pi binary invocation from process.argv. * Must be called early in session_start before any child process spawning. * * @returns Captured invocation (node, pi paths) */ export declare function capturePiInvocation(): PiInvocation; /** * Get the cached Pi invocation. * Returns undefined if never captured or if invocation is invalid. * * @returns Cached invocation or undefined */ export declare function getPiInvocation(): PiInvocation | undefined; /** * Reset the cached Pi invocation. * Called on session_before_switch/session_before_fork to clear stale state. */ export declare function resetPiInvocation(): void; /** * Build a child process argv for an RPC or tmux spawn. * Adds the Pi invocation at the start, then appends additional args. * * @param additionalArgs - Arguments to append after the pi binary * @returns Complete argv array, or undefined if Pi invocation was not captured */ export declare function buildChildArgv(additionalArgs: string[]): string[] | undefined; /** * Scan process.argv for extension-related flags that must propagate to children. * Spec: §4.1.1a — captureInheritedCliFlags * * Recognizes: * - `--extension ` (two-token form, repeatable) * - `-e ` (short form, repeatable) * - `--no-extensions` (single boolean token) * - `-ne` (short form boolean) * * @returns The captured flags (also cached module-scoped) */ export declare function captureInheritedCliFlags(): string[]; /** * Get the captured inherited CLI flags. * * @returns Cached inherited flags (empty array if not captured) */ export declare function getInheritedCliFlags(): string[]; /** * Reset the captured inherited CLI flags. * Called on session_before_switch / session_before_fork. */ export declare function resetInheritedCliFlags(): void; export {}; //# sourceMappingURL=pi-binary.d.ts.map