import type { SupervisedCommandOwner } from "../tools/bash-pty-native.js"; import type { AgentTaskHost } from "./agent-adapter.js"; import type { TaskId, YieldReason } from "./contracts.js"; import type { TaskSupervisor, WaitLease } from "./supervisor.js"; export type TaskCompletionMessage = { customType: string; content: string; details: object; display: true; }; /** Live delivery into the child that launched a shell task, while that child still runs. */ export interface ChildTaskCompletionRoute { isOpen(): boolean; deliver(message: TaskCompletionMessage): Promise; } /** * Parent-issued capability that lets an in-process subagent child run shell tasks * in the parent's task owner, so they appear in the parent's `/tasks` and outlive * the child. It never authorizes agent launches. */ export interface ChildCommandTaskOwner { bind(childId: string, route: ChildTaskCompletionRoute, waits: ChildTaskWaits): SupervisedCommandOwner; } /** Completion route for a task a child launched in this owner, only while that child accepts messages. */ export declare function childTaskCompletionRoute(host: AgentTaskHost, taskId: TaskId): ChildTaskCompletionRoute | undefined; /** Resolve the parent's live owner per call so session replacement is followed like the parent's own shells. */ export declare function createChildCommandTaskOwner(resolveHost: () => AgentTaskHost): ChildCommandTaskOwner; /** Child-side waits on parent-owned tasks; inbound child messages release observation, never execution. */ export declare class ChildTaskWaits { private readonly waits; track(supervisor: TaskSupervisor, wait: WaitLease): void; yieldAll(reason: YieldReason): void; } //# sourceMappingURL=child-command-owner.d.ts.map