/** * `agentConfig`: building the executing agent for a task that has none. * * Port of `praisonaiagents/agents/agents.py::_create_agent_from_config` and * `workflows.py::_create_step_agent`. The task's own `agent` always wins; with * no agent but an `agentConfig`, an agent is constructed from it (defaulting * `name` to `Agent` and `llm` to the run's default model, and taking * the task's `tools` when it has any); with neither, the caller's default agent * is used. Python assigns the constructed agent back onto the task, and so does * this. */ import type { Task } from '../types'; /** Builds an agent from constructor options; injectable so tests need no LLM. */ export type AgentFactory = (options: Record) => unknown; export interface ResolveAgentOptions { /** Used when the task names no agent and carries no `agentConfig`. */ defaultAgent?: unknown; /** Applied as `llm` when `agentConfig` does not name one. */ defaultLlm?: string; /** Shared memory handed to a constructed agent. */ memory?: unknown; /** Overrides the real `Agent` constructor (tests, or an alternate class). */ createAgent?: AgentFactory; } /** The constructor options `agentConfig` resolves to, before the agent is built. */ export declare function agentOptionsFor(task: Task, options?: ResolveAgentOptions): Record | undefined; /** * The agent that should execute `task`. * * A constructed agent is assigned to `task.agent`, matching Python. Construction * failures fall back to `defaultAgent` rather than aborting the run. */ export declare function resolveTaskAgent(task: Task, options?: ResolveAgentOptions): unknown | undefined;