import { type ChildProcess, type SpawnOptions } from 'node:child_process'; import { type SessionContext } from '../utils/session-context.js'; export interface LaunchResult { process: ChildProcess; /** Where the process actually ran. Useful for audit logging. */ routedTo: 'daemon-user' | 'console-user'; sessionContext: SessionContext; } /** * Launch a child process with awareness of the macOS GUI session. * * Default behavior (no flags, no config): if the command is GUI-class * (`open`, `osascript`, `/Applications/...`) AND the daemon user differs * from the console user, transparently re-route the launch into the * console user's launchd domain via `launchctl asuser`. This makes the * difference between "URL opens in the visible browser" and "URL opens * invisibly in a Chrome instance owned by the daemon's user". * * Routing succeeds without any sudo when the daemon runs as root (the * recommended system-install path). When the daemon runs as a regular * user that is not the console user, routing is attempted with `sudo -n`; * if sudoers isn't configured for passwordless hop, the spawn surfaces a * clear error rather than silently misrouting. * * Non-GUI commands are spawned exactly as before. Non-darwin platforms * always take the direct-spawn path. */ export declare function launchManagedProcess(command: string, args: readonly string[], options: SpawnOptions): LaunchResult; //# sourceMappingURL=process-launcher.d.ts.map