/**
 * `workflow` — the AgentTool the parent model calls to spawn a fan-out run.
 *
 * Shape mirrors `delegate-tool`: factory builds a closure over deps; `execute`
 * parses the script, instantiates the {@link DelegateSubagentRunner}, drives the
 * {@link runWorkflow} runtime, and pushes a live text snapshot through
 * `onUpdate` for streaming UIs (TUI, gateway console).
 *
 * Why this lives in `src/agent/tools/` (not under `src/agent/workflow/`):
 * the runtime is reusable infrastructure; the AgentTool wrapping is a
 * presentation concern that depends on the AgentToolsFactory wiring. Keeping
 * the wrapper here matches how `delegate-tool` and `execute-code-tool` are
 * organised today.
 */
import type { AgentTool } from '@earendil-works/pi-agent-core';
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 { BuildChildToolsOptions } from '../child-agent-factory.js';
import { type WorkflowCatalog } from '../workflow/index.js';
import type { ToolExecutorConfig } from './executor.js';
export type WorkflowToolInput = {
    name?: string;
    script?: string;
    args?: unknown;
};
export interface WorkflowToolDeps {
    workspace: string;
    bus: MessageBus;
    /** Returns the parent agent's primary model — subagents default to this. */
    getSubagentModel: () => Model<Api>;
    getConfig: () => Config | undefined;
    /** Same injection point delegate-tool uses; supplied by AgentToolsFactory. */
    buildChildTools: (opts: BuildChildToolsOptions) => AgentTool<any, any>[];
    toolExecutorConfig?: Partial<ToolExecutorConfig>;
    /** Catalog for `name` lookups (built-in + ~/.xopc/workflows/). */
    catalog: WorkflowCatalog;
    /** Per-call sessionKey lookup — used to record "last successful workflow" for /workflow save. */
    getCurrentSessionKey?: () => string | undefined;
}
export declare function createWorkflowTool(deps: WorkflowToolDeps): AgentTool;
