/**
 * Task tool — spawn a subagent to handle complex tasks autonomously.
 *
 * The LLM calls `task(subagent_type, name, query)` to delegate work
 * to a lightweight in-process child agent. The child inherits the relevant
 * tools, provider registry, and auth from the parent runtime.
 *
 * Multiple task() calls execute in parallel (our forked agent loop does
 * Promise.all on tool calls).
 */
import type { ToolDefinition } from '../../../core/core-types.js';
import { type RuntimePermissionPolicy } from '../../../core/permission-policy.js';
import { type TaskManager } from './manager.js';
import { type TaskSubagentResult } from './types.js';
/** Derive the subagent's permission policy from the parent policy and approval flags. */
export declare function buildInheritedSubagentPermissionPolicy(input: {
    parentPolicy: RuntimePermissionPolicy;
    childToolNames: readonly string[];
    taskCwd: string;
    persistentApprovals: RuntimePermissionPolicy['filesystem']['persistentApprovals'];
    fullWorker?: boolean;
}): RuntimePermissionPolicy;
/** Pick the most informative error string from a subagent result for display. */
export declare function getSubagentDisplayError(result: Pick<TaskSubagentResult, 'errorMessage' | 'text'>): string;
interface CreateTaskToolOptions {
    /** Working directory used when deriving child permission boundaries. */
    cwd?: string;
    /** Subagent types to exclude from the schema (e.g. ['clone'] to prevent recursive cloning) */
    excludeSubagents?: string[];
    /** Full unwrapped runtime tool catalog. Child subagents select from this by declared tool name. */
    getRuntimeTools?: () => readonly ToolDefinition[];
    /** Queue a terminal background task notification into the launching parent loop. */
    notifyParent?: (notification: string, scopeId: string, displayText?: string) => void;
    /** Process-local task registry. Defaults to the shared CLI registry. */
    taskManager?: TaskManager;
}
/** Build the child runtime tool catalog by replacing the task tool with a scoped clone. */
export declare function buildChildRuntimeTools(tools: readonly ToolDefinition[], options: {
    cwd: string;
    excludeSubagents?: readonly string[];
    getRuntimeTools?: () => readonly ToolDefinition[];
    notifyParent?: (notification: string, scopeId: string, displayText?: string) => void;
    taskManager?: TaskManager;
}): ToolDefinition[];
/** Build the `task` tool that spawns subagents in the foreground or background. */
export declare function createTaskTool(options?: CreateTaskToolOptions): ToolDefinition;
export {};
//# sourceMappingURL=task.d.ts.map