import { type DetachReason } from "../../lib/attach.js"; import type { JobRow } from "../../lib/protocol.js"; export type { JobRow } from "../../lib/protocol.js"; export interface SpawnOptions { /** The first prompt (≥ 1 character). */ task: string; cwd: string; name?: string; /** "provider/id" */ model?: string; thinking?: string; /** Names always carried into the worker (M20: it inherits this process's environment anyway; these pass envDenyList). */ env?: string[]; /** The pi to run: defaults to the one running this code (process.argv[1]). */ piCli?: string; /** * Load pi-roost into the worker with -e. Workers normally get it from your installed * pi packages; set this when pi-roost is not installed (a checkout, tests). */ loadExtension?: boolean; /** M10: run in its own git worktree and branch (fails outside a git repository). */ worktree?: boolean; } /** Start a background pi session; resolves once the daemon has started it. */ export declare function spawn(opts: SpawnOptions): Promise<{ id: string; name: string; worktree?: { path: string; branch: string; }; }>; /** Background sessions, newest first; `all` includes long-finished ones. */ export declare function list(opts?: { cwd?: string; all?: boolean; }): Promise; /** * Hand this process's terminal to a session until it detaches (Ctrl+Z, or ← on its * empty prompt). An ended session is started again first. Needs a TTY. */ export declare function attach(id: string): Promise;