/** * Model-scoped runtime selection (Python parity: `Agent(runtime=...)`, * `runtime/config.py` `AgentRuntimeConfig`, `agent/agent.py` * `_resolve_runtime_config` / `_validate_runtime_capabilities`, and the * delegation in `agent/unified_execution_mixin.py`). * * `runtime` hands the whole turn to a registered {@link AgentRuntimeProtocol} * rather than running the local chat loop — the successor to the deprecated * `cli_backend`. Two things happen, both at construction: * * - The runtime id is resolved through the registry, so a typo fails at the * call site instead of on the first model turn. * - `requiredCapabilities` are checked against what the runtime reports, so a * run that needs streaming does not start on a runtime that cannot stream * and then discover it halfway through. * * `runtime` and `backend`/`runOn` answer the same question — where the loop * runs — so naming both is a contradiction, and is rejected as one. */ import { type AgentRuntimeProtocol } from '../../runtime'; /** Python `AgentRuntimeConfig`, plus the capability fields `RuntimeConfig` carries. */ export interface AgentRuntimeConfig { /** Runtime identifier, e.g. `"praisonai"` (Python `runtime` / `preferred_runtime`). */ runtime: string; /** Capabilities the runtime must report before the agent is built. */ requiredCapabilities: string[]; /** Runtime-specific options, forwarded on every turn (Python `config_overrides`). */ configOverrides: Record; metadata: Record; } /** The default runtime when `runtime: true` names none (Python's builtin). */ export declare const DEFAULT_RUNTIME_ID = "praisonai"; /** A resolved runtime plus the config that selected it. */ export interface ResolvedAgentRuntime { runtime: AgentRuntimeProtocol; config: AgentRuntimeConfig; } /** * Check the runtime reports every required capability * (Python `_validate_runtime_capabilities`). A capability counts as present * when the matrix carries it with a truthy value. */ export declare function validateRuntimeCapabilities(runtime: AgentRuntimeProtocol, required: readonly string[]): void; /** * Resolve the constructor option. `true` selects the builtin runtime, a * string names one, an object supplies `runtime`/`requiredCapabilities`/ * `configOverrides` (snake_case accepted), and an object that already * satisfies {@link AgentRuntimeProtocol} is used as-is. */ export declare function resolveAgentRuntime(input: boolean | string | Record | undefined | null): ResolvedAgentRuntime | undefined; /** Options a delegated turn carries to the runtime (Python's `**kwargs`). */ export interface RuntimeTurnOptions { systemPrompt?: string | null; modelRef?: string | null; tools?: unknown; temperature?: number; [key: string]: unknown; } /** * Run one turn on the resolved runtime (Python `_chat_via_runtime`). A * runtime reports failure in the result rather than by throwing, so the * error is re-raised here — silently returning its empty `content` would * read as "the model said nothing". */ export declare function runTurnOnRuntime(resolved: ResolvedAgentRuntime, prompt: string, options: RuntimeTurnOptions): Promise;