/** * Resolvers for AgentTeam's consolidated feature parameters. * * Python's AgentTeam funnels `execution`, `hooks`, `planning`, `memory` and * `context` through one canonical resolver (`praisonaiagents/config/param_resolver.py`) * with a per-parameter preset table. These helpers reproduce the shapes that * resolver accepts for the team surface -- preset string, `[preset, overrides]` * pair, plain object, instance -- so a team option means the same thing in both * SDKs. Everything here is pure: no I/O, no model calls. */ import { ContextManager, type ContextManagerConfig } from '../context/manager'; import type { Task } from './types'; /** Lifecycle status of a task inside a team run (Python parity: Task.status). */ export type TeamTaskStatus = 'not started' | 'in progress' | 'completed' | 'failed'; /** * What a team hook is handed. When the team was given a {@link Task} object the * `task` field carries it; a plain-string task still gets a name, a description * and a live status. */ export interface TeamTaskRef { /** The Task's name, else `task_`. */ name: string; /** The prompt this task runs (a Task's description). */ description: string; /** Where the task is in its lifecycle when the hook fires. */ status: TeamTaskStatus; /** Name of the agent that ran it, once one has been chosen. */ agent?: string; /** The originating Task, when the team was given one. */ task?: Task; } /** Python parity: MultiAgentExecutionConfig. */ export interface TeamExecutionSettings { /** Maximum manager iterations in a hierarchical run. */ maxIter: number; /** Maximum attempts per task before it is left failed. */ maxRetries: number; } /** Python parity: MULTI_AGENT_EXECUTION_PRESETS. */ export declare const MULTI_AGENT_EXECUTION_PRESETS: Readonly>; /** The value `AgentTeam({ execution })` accepts. */ export type TeamExecutionInput = string | Partial | [string, Partial]; /** * Resolve `execution` into iteration and retry limits. * * Python parity: the `MULTI_AGENT_EXECUTION_PRESETS` table, `[preset, overrides]` * merging, and the floor that lifts `max_retries` to 3. */ export declare function resolveTeamExecution(value: unknown): TeamExecutionSettings; /** Fired before a task runs. Python parity: MultiAgentHooksConfig.on_task_start. */ export type TeamTaskStartHook = (task: TeamTaskRef, taskId: number) => unknown | Promise; /** Fired after a task completes. Python parity: MultiAgentHooksConfig.on_task_complete. */ export type TeamTaskCompleteHook = (task: TeamTaskRef, output: unknown) => unknown | Promise; /** * Decides whether an agent's answer finishes the task. Returning false drives * the retry loop. Python parity: MultiAgentHooksConfig.completion_checker. */ export type TeamCompletionChecker = (task: TeamTaskRef, agentOutput: string) => boolean; /** Python parity: MultiAgentHooksConfig. */ export interface TeamHooksSettings { onTaskStart?: TeamTaskStartHook; onTaskComplete?: TeamTaskCompleteHook; completionChecker?: TeamCompletionChecker; } /** The value `AgentTeam({ hooks })` accepts (snake_case keys are accepted too). */ export type TeamHooksInput = TeamHooksSettings & Record; /** Resolve `hooks` into the three team lifecycle callbacks Python extracts. */ export declare function resolveTeamHooks(value: unknown): TeamHooksSettings; /** The value `AgentTeam({ context })` accepts. */ export type TeamContextInput = boolean | string | ContextManagerConfig | ContextManager; /** * Resolve `context` into the team's shared ContextManager. * * Python parity: `AgentTeam.context_manager` -- `False`/`None` means zero * overhead and no manager, `True` builds one with defaults, a config builds one * from that config, and a manager instance is used as given. */ export declare function resolveTeamContext(value: unknown): ContextManager | undefined; /** * Refuse `runOn` on a team, the way Python's `resolve_placement(..., * supports_run_on=False)` does. * * `run_on=` hands ONE agent's whole loop to a managed runtime; a team * orchestrates several agents locally, so there is no single loop to hand over. * Python raises TypeError at construction rather than letting the option sit * there doing nothing, and so does this. */ export declare function assertTeamPlacement(runOn: unknown, toolsRunOn: unknown, owner?: string): void;