import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
import type { ToolSession } from "../index.js";
import type { Theme } from "../modes/theme/theme.js";
import { type AgentDefinition, type SingleResult, type TaskItem, type TaskToolDetails, type TaskToolSchemaInstance } from "./types.js";
import "../tools/review.js";
import { renderResult, renderCall as renderTaskCall } from "./render.js";
export { loadBundledAgents as BUNDLED_AGENTS } from "./agents.js";
export { discoverCommands, expandCommand, getCommand } from "./commands.js";
export { discoverAgents, getAgent } from "./discovery.js";
export { AgentOutputManager } from "./output-manager.js";
export type { AgentDefinition, AgentProgress, SingleResult, SubagentEventPayload, SubagentLifecyclePayload, SubagentProgressPayload, TaskParams, TaskToolDetails, } from "./types.js";
export { TASK_SUBAGENT_EVENT_CHANNEL, TASK_SUBAGENT_LIFECYCLE_CHANNEL, TASK_SUBAGENT_PROGRESS_CHANNEL, taskSchema, } from "./types.js";
export declare const READ_ONLY_TOOL_NAMES: ReadonlySet<string>;
export declare function isReadOnlyAgent(agent: AgentDefinition): boolean;
/**
 * Preview text for a child result. Falls back to "(no output)" — annotated
 * with the request count when the child actually did work, so the parent can
 * tell a no-op child from one that burned requests before being cancelled.
 */
export declare function formatResultOutputFallback(result: Pick<SingleResult, "output" | "stderr" | "requests">): string;
/**
 * Advisory — never a rejection — nudging the spawner toward tailored
 * specialists when it spawns generic role-less workers and still holds spawn
 * capacity (DepthCapacity: it currently has the `task` tool). Fires when a
 * generic `task`/`sonic` spawn carries no `role`, or when one call clones
 * the same agent ≥2× all without roles. Returns undefined when no nudge applies.
 */
export declare function buildSpecializationAdvisory(agentName: string | undefined, items: TaskItem[], depthCapacity: boolean): string | undefined;
/**
 * Suggestion — never a rejection — nudging the spawner to coordinate via `irc`
 * when one call creates ≥2 live siblings and it still holds spawn capacity.
 * Returns undefined when there is nothing to coordinate or IRC is unavailable.
 */
export declare function buildCoordinationAdvisory(items: TaskItem[], depthCapacity: boolean, ircEnabled: boolean): string | undefined;
/**
 * Compose the non-blocking advisory appended to a `task` result: the
 * specialization nudge, plus — only when the siblings keep running after this
 * call (`willRunAsync`) — the coordination suggestion. Coordination is gated on
 * async because a sync fanout's siblings have already finished, so a
 * "coordinate while they run" hint would misfire. Returns undefined when
 * neither applies.
 */
export declare function composeSpawnAdvisory(args: {
    agentName: string | undefined;
    items: TaskItem[];
    depthCapacity: boolean;
    ircEnabled: boolean;
    willRunAsync: boolean;
}): string | undefined;
/**
 * Task tool - Delegate tasks to specialized agents.
 *
 * Each call spawns one subagent — or, with `task.batch`, one per `tasks[]`
 * item. When `async.enabled` is on, spawns run as AsyncJobManager jobs; when
 * disabled, the tool blocks until every spawn finishes.
 */
export declare class TaskTool implements AgentTool<TaskToolSchemaInstance, TaskToolDetails, Theme> {
    #private;
    private readonly session;
    readonly name = "task";
    readonly approval: "exec";
    readonly formatApprovalDetails: (args: unknown) => string[];
    readonly label = "Task";
    readonly summary = "Spawn subagents to complete delegated tasks";
    readonly strict = true;
    readonly loadMode = "discoverable";
    readonly renderResult: typeof renderResult;
    readonly mergeCallAndResult = true;
    get parameters(): TaskToolSchemaInstance;
    renderCall(args: unknown, options: Parameters<typeof renderTaskCall>[1], theme: Theme): import("@oh-my-pi/pi-tui").Component;
    /** Dynamic description that reflects current disabled-agent settings */
    get description(): string;
    private constructor();
    /**
     * Create a TaskTool instance with async agent discovery.
     */
    static create(session: ToolSession): Promise<TaskTool>;
    execute(toolCallId: string, rawParams: unknown, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<TaskToolDetails>): Promise<AgentToolResult<TaskToolDetails>>;
}
