/** * T — Tool composition namespace. * * Factory methods returning composable tool collections. * Compose with .pipe() to combine tool sets. * * Usage: * agent.tools(T.fn(search).pipe(T.fn(email))) * agent.tools(T.googleSearch().pipe(T.fn(calculator))) */ import type { ToolFn } from "../core/types.js"; import { type CatalogName } from "./ui.js"; /** Descriptor for a single tool in the composite. */ export interface ToolSpec { type: string; [key: string]: unknown; } /** A composable tool collection. */ export declare class TComposite { readonly items: ToolSpec[]; constructor(items: ToolSpec[]); /** Chain: combine with another tool collection. */ pipe(other: TComposite): TComposite; /** Convert to a flat tool array for passing to builder. */ toArray(): ToolSpec[]; } /** * T namespace — tool composition factories. * * All 16 methods from the Python T namespace. */ export declare class T { /** Wrap a callable as a FunctionTool. Optionally require confirmation. */ static fn(callable: ToolFn, opts?: { name?: string; description?: string; confirm?: boolean; }): TComposite; /** Wrap an agent/builder as an AgentTool. */ static agent(agent: unknown, opts?: { name?: string; description?: string; }): TComposite; /** Wrap an ADK toolset (MCP, OpenAPI, etc.). */ static toolset(ts: unknown): TComposite; /** Google Search built-in tool. */ static googleSearch(): TComposite; /** BM25-indexed dynamic tool loading from a registry. */ static search(registry: unknown, opts?: { alwaysLoaded?: string[]; maxTools?: number; }): TComposite; /** Attach a ToolSchema for contract checking. */ static schema(schemaCls: unknown): TComposite; /** MCP toolset factory. */ static mcp(urlOrParams: string | Record, opts?: { toolFilter?: string[]; prefix?: string; }): TComposite; /** OpenAPI spec tool. */ static openapi(spec: string | Record, opts?: { toolFilter?: string[]; auth?: Record; }): TComposite; /** Wrap remote A2A agent as AgentTool. */ static a2a(agentCardUrl: string, opts?: { name?: string; description?: string; timeout?: number; }): TComposite; /** * A2UI toolset — exposes UI generation/binding tools to the LLM. * * Catalog dispatch: * - **basic** (default): requires the ``a2ui-agent`` JS package, which * is not yet published — throws ``A2UINotInstalled`` today. * - **flux**: returns an in-tree toolset that advertises the flux * component surface (FluxButton, FluxBadge, FluxCard, …) with * per-component ``llm`` metadata loaded from * ``catalog/flux/catalog.json``. Does *not* require ``a2ui-agent``. * * Unknown catalog names throw ``A2UIError``. */ static a2ui(opts?: { catalog?: CatalogName | string; }): TComposite; /** * Wrap one or more SKILL.md directories as a SkillToolset for progressive * disclosure. Pass a single path, a list of paths, or a list of pre-parsed * skill objects. Skill metadata is loaded into the system prompt; full * instructions are loaded on demand by the LLM. * * Mirrors the Python `T.skill(path)` factory. */ static skill(path: string | string[] | unknown[]): TComposite; /** Create a mock tool for testing. */ static mock(name: string, opts?: { returns?: unknown; sideEffect?: ToolFn; }): TComposite; /** Wrap tool with human confirmation requirement. */ static confirm(toolOrComposite: TComposite | ToolFn, message?: string): TComposite; /** Wrap tool with timeout. */ static timeout(toolOrComposite: TComposite | ToolFn, seconds?: number): TComposite; /** Wrap tool with TTL-based result cache. */ static cache(toolOrComposite: TComposite | ToolFn, opts?: { ttl?: number; }): TComposite; /** Wrap tool with pre/post argument/result transforms. */ static transform(toolOrComposite: TComposite | ToolFn, opts: { pre?: ToolFn; post?: ToolFn; }): TComposite; } /** * Toolset descriptor emitted by ``T.a2ui({ catalog: "flux" })``. * * Advertises the flux component surface via a stable shape tests can * inspect: ``components`` (sorted flux component names), ``description`` * (human-readable enumeration), ``llmMetadata`` (per-component * ``description`` / ``tags`` / ``examples`` / ``antiPatterns``). * * This is a data-bearing marker — the ADK-facing runtime integration * ships alongside the public ``a2ui-agent[flux]`` package later. Today * the marker is enough for ``T.a2ui({ catalog: "flux" })`` to be * discoverable and testable. */ export interface FluxA2UIToolsetSpec { type: "a2ui_flux"; catalog: "flux"; components: readonly string[]; description: string; llmMetadata: Record>; [key: string]: unknown; } //# sourceMappingURL=tools.d.ts.map