/** * Read-only views of the async jobs one agent owns, computed from the * process-root `AsyncJobManager`. Shared by `AgentSession` (its own jobs) and * the main thread's mirror of a worker-homed session, which scopes the same * root manager to the child's agent id. */ import type { AsyncJob, AsyncJobManagerApi } from "../async/index.js"; import type { JobWidgetEntry } from "@oh-my-pi/pi-tui/tools/job-widget"; import type { AsyncJobInspection, AsyncJobSnapshot, AsyncJobTree } from "./agent-session-types.js"; /** Running and recent jobs `agentId` owns (every job when it is undefined), with their delivery state. */ export declare function asyncJobSnapshot(manager: AsyncJobManagerApi, agentId: string | undefined, options?: { recentLimit?: number; }): AsyncJobSnapshot; /** * Live widgets of the running jobs `agentId` owns (the owner scope of * {@link asyncJobSnapshot}), in job order. Reading a widget marks it shown, * which is what lets its spec be written. */ export declare function runningJobWidgets(manager: AsyncJobManagerApi, agentId: string | undefined): JobWidgetEntry[]; /** * Async jobs of `rootId` and every subagent below it: the running ones and * the `recentLimit` (default 10) newest settled ones across the tree, with the subagents * that own them and the ancestors linking those to the root. Lineage comes * from the agent registry, falling back to the task job that runs a subagent * once its registry entry is gone. */ export declare function asyncJobTree(manager: AsyncJobManagerApi, rootId: string | undefined, options?: { recentLimit?: number; }): AsyncJobTree; /** Ask for the captions of the running commands in `rootId`'s job tree (see {@link asyncJobTree}). */ export declare function requestJobTreeCaptions(manager: AsyncJobManagerApi, rootId: string | undefined): void; /** * One async job in `rootId`'s tree (see {@link asyncJobTree}): its command, * live pids, exit status and output. Undefined when the job is unknown, owned * outside the tree, or evicted. */ export declare function inspectAsyncJob(manager: AsyncJobManagerApi, rootId: string | undefined, id: string): AsyncJobInspection | undefined; /** A listed job by id, under the owner scope of {@link asyncJobSnapshot}. */ export declare function ownedAsyncJob(manager: AsyncJobManagerApi, agentId: string | undefined, id: string): AsyncJob | undefined; /** Cancel a running job `agentId` owns; false when there is none by that id. */ export declare function cancelOwnedAsyncJob(manager: AsyncJobManagerApi, agentId: string | undefined, id: string): boolean;