import { BuilderBase } from "../core/builder-base.js"; import { UIAutoSpec, UISchemaSpec, UISurface, UIComponent } from "../namespaces/ui.js"; /** * Base class for all agents in Agent Development Kit. */ export declare class BaseAgent extends BuilderBase { constructor(name: string); /** * Set agent description (metadata for transfer routing and topology display — NOT sent to the LLM as instruction). Always set this on sub-agents so the coordinator LLM can pick the right specialist. */ describe(value: string): this; /** * Append callback(s) to `after_agent_callback`. Multiple calls accumulate. */ afterAgent(...fns: unknown[]): this; /** * Append callback to `after_agent_callback` only if condition is True. */ afterAgentIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `before_agent_callback`. Multiple calls accumulate. */ beforeAgent(...fns: unknown[]): this; /** * Append callback to `before_agent_callback` only if condition is True. */ beforeAgentIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Set the ``sub_agents`` field. */ subAgents(value: unknown[]): this; /** * Append to ``sub_agents`` (lazy — built at .build() time). */ subAgent(value: unknown): this; /** * Base class for all agents in Agent Development Kit. Resolve into a native ADK _ADK_BaseAgent. */ build(): Record; } /** * LLM-based Agent. */ export declare class Agent extends BuilderBase { constructor(name: string, model?: string | undefined); /** * Set agent description (metadata for transfer routing and topology display — NOT sent to the LLM as instruction). Always set this on sub-agents so the coordinator LLM can pick the right specialist. */ describe(value: string): this; /** * Set instruction shared by ALL agents in a workflow. Only meaningful on the root agent. Prepended to every agent's system prompt. */ globalInstruct(value: unknown): this; /** * Set cached instruction. When set, ``.instruct()`` text moves from system to user content, enabling context caching. Use for large, stable prompt sections that rarely change. */ static_(value: unknown): this; /** * Append callback(s) to `after_agent_callback`. Multiple calls accumulate. */ afterAgent(...fns: unknown[]): this; /** * Append callback to `after_agent_callback` only if condition is True. */ afterAgentIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `after_model_callback`. Multiple calls accumulate. */ afterModel(...fns: unknown[]): this; /** * Append callback to `after_model_callback` only if condition is True. */ afterModelIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `after_tool_callback`. Multiple calls accumulate. */ afterTool(...fns: unknown[]): this; /** * Append callback to `after_tool_callback` only if condition is True. */ afterToolIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `before_agent_callback`. Multiple calls accumulate. */ beforeAgent(...fns: unknown[]): this; /** * Append callback to `before_agent_callback` only if condition is True. */ beforeAgentIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `before_model_callback`. Multiple calls accumulate. */ beforeModel(...fns: unknown[]): this; /** * Append callback to `before_model_callback` only if condition is True. */ beforeModelIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `before_tool_callback`. Multiple calls accumulate. */ beforeTool(...fns: unknown[]): this; /** * Append callback to `before_tool_callback` only if condition is True. */ beforeToolIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `on_model_error_callback`. Multiple calls accumulate. */ onModelError(...fns: unknown[]): this; /** * Append callback to `on_model_error_callback` only if condition is True. */ onModelErrorIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `on_tool_error_callback`. Multiple calls accumulate. */ onToolError(...fns: unknown[]): this; /** * Append callback to `on_tool_error_callback` only if condition is True. */ onToolErrorIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Set the ``sub_agents`` field. */ subAgents(value: unknown[]): this; /** * Set the ``model`` field. */ model(value: string | unknown): this; /** * Set the ``generate_content_config`` field. */ generateContentConfig(value: unknown | undefined): this; /** * Prevent this agent from transferring control back to its parent. Also forces an auto-handoff back to parent on the next turn. Equivalent to ``.stay()``. See also ``.isolate()``. */ disallowTransferToParent(value: boolean): this; /** * Prevent this agent from transferring control to sibling agents. Equivalent to ``.no_peers()``. See also ``.isolate()``. */ disallowTransferToPeers(value: boolean): this; /** * Set the ``planner`` field. */ planner(value: unknown | undefined): this; /** * Set the ``code_executor`` field. */ codeExecutor(value: unknown | undefined): this; /** * Append to ``sub_agents`` (lazy — built at .build() time). */ subAgent(value: unknown): this; /** * Add a single tool (appends). Wraps plain callables in FunctionTool when require_confirmation=True. */ tool(fn_or_tool: unknown, _require_confirmation?: boolean): this; /** * Set tools. Accepts a list, a TComposite chain (T.fn(x) | T.fn(y)), or a single tool/toolset. */ tools(value: unknown): this; /** * Attach an A2UI surface (or LLM-guided mode) to this agent. * * Behavior matrix: * * | spec | llmGuided | result | * | -------------------------- | --------- | ----------------------------------------------------------------------------------- | * | `null` / `undefined` | `false` | throws A2UIError("requires a spec or llmGuided: true") | * | `null` / `undefined` | `true` | promote to `new UIAutoSpec("basic", { fromFlag: true })`; autoTool + autoGuard wired | * | `UIAutoSpec` | `false` | keep; only prompt-side schema is wired | * | `UIAutoSpec` | `true` | keep; autoTool + autoGuard wired | * | `UISurface` | `false` | keep; auto-validated at build() | * | `UISurface` | `true` | throws A2UIError (incompatible) | * | `UIComponent` | `false` | wrap in `new UISurface("default", spec)` | * | `UIComponent` | `true` | throws A2UIError (incompatible) | * | `UISchemaSpec` | `false` | keep | * | `UISchemaSpec` | `true` | throws A2UIError (incompatible) | * * Stamps the following private config keys when wiring auto-modes: * - `_a2uiAutoTool` (boolean): when true, build() should append `T.a2ui()`. * - `_a2uiAutoGuard` (boolean): when true, build() should append `G.a2ui()`. * - `_a2uiAutoLog` (boolean): when true and `opts.log === true`, append `M.a2uiLog`. * - `_a2uiValidate` (boolean): when true and spec is a UISurface, call `spec.validate()`. * * Idempotency: setting `.ui()` twice emits a `console.warn` and overwrites. */ ui(spec?: UISurface | UIComponent | UIAutoSpec | UISchemaSpec | null, opts?: { llmGuided?: boolean; validate?: boolean; log?: boolean; }): this; /** * Add an output validation guard. Accepts a G composite (G.pii() | G.length(max=500)) or a plain callable. Guards run as after_model callbacks and validate/transform the LLM response before it is returned. */ guard(value: unknown): this; /** * Set the main instruction / system prompt — what the LLM is told to do. Accepts plain text, a callable, or a P module composition (P.role() + P.task()). Raises TypeError if passed a CTransform (use .context() instead). */ instruct(value: unknown): this; /** * Declare what conversation context this agent should see. Accepts a C module transform (C.none(), C.user_only(), C.from_state(), etc.). */ context(spec: unknown): this; /** * Force this agent's events to be user-facing (override topology inference). */ show(): this; /** * Force this agent's events to be internal (override topology inference). */ hide(): this; /** * Add memory tools to this agent. Modes: 'preload', 'on_demand', 'both'. */ memory(mode?: string): this; /** * Auto-save session to memory after each agent run. */ memoryAutoSave(): this; /** * Wrap another agent as a callable AgentTool and add it to this agent's tools. The parent LLM invokes the child like any other tool, stays in control, and receives the response. Compare with .sub_agent() which fully transfers control to the child. */ agentTool(agent: unknown): this; /** * Prevent this agent from transferring to parent or peers. Sets both disallow_transfer_to_parent and disallow_transfer_to_peers to True. Use for specialist agents that should complete their task and return. */ isolate(): this; /** * Prevent transfer to parent only (can still transfer to sibling peers). Equivalent to .disallow_transfer_to_parent(True). Use for agents in peer-to-peer handoff chains where the coordinator should not regain control mid-sequence. */ stay(): this; /** * Prevent this agent from transferring to sibling agents. The agent can still return to its parent. */ noPeers(): this; /** * Attach artifact operations (A.publish, A.snapshot, etc.) that fire after this agent completes. */ artifacts(...transforms: unknown[]): this; /** * Attach a ToolSchema declaring tool state dependencies. */ toolSchema(schema: unknown): this; /** * Attach a CallbackSchema declaring callback state dependencies. */ callbackSchema(schema: unknown): this; /** * Attach a PromptSchema declaring prompt state dependencies. */ promptSchema(schema: unknown): this; /** * Attach an ArtifactSchema declaring artifact dependencies. */ artifactSchema(schema: unknown): this; /** * Declare an A2A skill for this agent's AgentCard. Skills are metadata consumed by ``A2AServer`` during card generation. They have no effect on local agent execution. If no skills are declared, ``A2AServer`` auto-infers them from the agent's tools and sub-agents. */ skill(skill_id: string, _name: string, _description?: string, _tags?: unknown, _examples?: unknown, _input_modes?: unknown, _output_modes?: unknown): this; /** * LLM-based Agent. Resolve into a native ADK LlmAgent. * * Performs A2UI auto-wiring driven by `.ui()` flags: * - `_a2uiAutoTool` → append a deduped `T.a2ui()` tool composite * - `_a2uiAutoGuard` → append a deduped `G.a2ui()` guard * - `_a2uiAutoLog` → append `M.a2uiLog({ level: "info" })` middleware * - `_a2uiValidate` → call `surface.validate()` on declarative surfaces * * `T.a2ui()` throws `A2UINotInstalled`; this method catches and rethrows * as a more descriptive Error during build (since the user opted in via * `.ui()`, the missing dependency is now a build-time failure). */ build(): Record; } /** * Agent that communicates with a remote A2A agent via A2A client. */ export declare class RemoteA2aAgent extends BuilderBase { constructor(name: string); /** * Set agent description (metadata for transfer routing and topology display — NOT sent to the LLM as instruction). Always set this on sub-agents so the coordinator LLM can pick the right specialist. */ describe(value: string): this; /** * Append callback(s) to `after_agent_callback`. Multiple calls accumulate. */ afterAgent(...fns: unknown[]): this; /** * Append callback to `after_agent_callback` only if condition is True. */ afterAgentIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Append callback(s) to `before_agent_callback`. Multiple calls accumulate. */ beforeAgent(...fns: unknown[]): this; /** * Append callback to `before_agent_callback` only if condition is True. */ beforeAgentIf(condition: boolean, fn: (...args: unknown[]) => unknown): this; /** * Set the ``sub_agents`` field. */ subAgents(value: unknown[]): this; /** * Append to ``sub_agents`` (lazy — built at .build() time). */ subAgent(value: unknown): this; /** * Agent that communicates with a remote A2A agent via A2A client. Resolve into a native ADK _ADK_RemoteA2aAgent. */ build(): Record; } //# sourceMappingURL=agent.d.ts.map