import type { Api, Model } from '@earendil-works/pi-ai';
import type { Config } from '../config/schema.js';
import type { MessageBus } from '../infra/bus/index.js';
import type { AgentTool } from '@earendil-works/pi-agent-core';
import type { ToolExecutorConfig } from './tools/executor.js';
export declare function buildChildSystemPrompt(goal: string, context?: string, workspace?: string): string;
export interface BuildChildToolsOptions {
    workspace: string;
    bus: MessageBus;
    model: Model<Api>;
    getConfig: () => Config | undefined;
    toolExecutorConfig?: Partial<ToolExecutorConfig>;
}
export interface DelegateChildProgressHooks {
    mode: 'steps' | 'full';
    onProgress: (event: {
        type: 'tool_start' | 'tool_end' | 'iteration' | 'text_delta' | 'thinking_delta';
        toolCallId?: string;
        toolName?: string;
        args?: Record<string, unknown>;
        isError?: boolean;
        count?: number;
        max?: number;
        delta?: string;
    }) => void;
}
export interface DelegateChildHandleOptions {
    workspace: string;
    goal: string;
    context?: string;
    allowedToolNames: string[];
    maxIterations: number;
    model: Model<Api>;
    bus: MessageBus;
    getConfig: () => Config | undefined;
    toolExecutorConfig?: Partial<ToolExecutorConfig>;
    /**
     * Construct the child agent's tool set. Injected by the caller (delegate-tool)
     * so this module does not import `tools/factory.js` (which would form a
     * factory ↔ delegate-tool ↔ child-agent-factory cycle).
     */
    buildChildTools: (opts: BuildChildToolsOptions) => AgentTool<any, any>[];
    /** Optional live progress for workflow subagents. */
    progressHooks?: DelegateChildProgressHooks;
}
export interface DelegateChildRunResult {
    summary: string;
    toolIterations: number;
}
export interface DelegateChildHandle {
    run(): Promise<DelegateChildRunResult>;
    abort(): void;
}
/**
 * Build an isolated tool factory (no extensions, no session memory hooks) and a child {@link Agent}.
 */
export declare function createDelegateChildHandle(options: DelegateChildHandleOptions): DelegateChildHandle;
