import { type AgentToolDef } from "./defineAgentTool.js"; /** Metadata for IoC-style `@agent({ name })` registration (invoke comes from the decorated function). */ export type AgentCapabilityMeta = Record> = Omit, "invoke"> & { /** * Optional guard run before the handler (scene/tab navigation, etc.). * Replaces a separate `*Controller.ts` when the only extra work is prepare. */ before?: () => void | Promise; }; declare const AGENT_CAPABILITY: unique symbol; export type AgentCapabilityHandler = Record> = (input: TInput) => Promise; export type AgentCapabilityDecorator = Record> = AgentCapabilityHandler & { [AGENT_CAPABILITY]?: AgentCapabilityMeta; }; export declare function getAgentCapabilityMeta>(handler: AgentCapabilityHandler): AgentCapabilityMeta | undefined; /** Register a handler against tool metadata (shared by decorator + manual wiring). */ export declare function registerAgentCapability>(meta: AgentCapabilityMeta, handler: AgentCapabilityHandler): AgentCapabilityDecorator; /** * IoC-style agent capability registration. * * ```ts * @agent({ name: "demo.ping", description: "…" }) * export async function demoPing() { * return { ok: true }; * } * * // or HOF (no decorator flag): * export const demoPing = agent({ name: "demo.ping", description: "…" })(async () => ({ ok: true })); * ``` * * Requires `experimentalDecorators: true` in tsconfig for `@agent` syntax. */ export declare function agent = Record>(meta: AgentCapabilityMeta): AgentCapabilityDecorator & ((handler: AgentCapabilityHandler) => AgentCapabilityDecorator); /** Alias for teams preferring `@Agent({ … })` naming. */ export declare const Agent: typeof agent; /** Eager-load capability modules (Vite `import.meta.glob` side effects). */ export declare function loadAgentCapabilities(modules: Record, options?: { exclude?: RegExp; }): void; /** Optional: register exported handlers tagged via HOF `agent(meta)(fn)` without decorators. */ export declare function registerExportedAgentCapabilities(moduleExports: Record): void; export {}; //# sourceMappingURL=agentCapability.d.ts.map