import { OperationExecutor, OperationPublicResult, OperationTool, OperationToolConverter, OperationToolDefinition, OperationToolJsonSchema, OperationToolOutcome, SelectedOperation, bindOperationExecutor, createOperationTools, operationToolDialect, selectOperation } from "./modules/contracts/exposure.mjs"; import { z } from "zod"; //#region src/agent-tools.d.ts /** * A framework-agnostic tool record: directly spreadable into * @convex-dev/agent's createTool ({ description, args, handler }) and * adaptable to ai-sdk tool(). The kit imports neither framework — checked * against registry snapshots on 2026-08-14; re-verify at install time. */ export type AgentToolRecord = { name: string; description: string; args: z.ZodType; handler: (ctx: Context, input: Input) => Promise; }; type ToolTable = { tableName: string; tools: { insert: z.ZodType; update: z.ZodType; id: z.ZodType; }; }; type ToolHandler = (ctx: never, input: never) => Promise; export type AgentToolHandlers = { /** Mutations: route through command executors — agents get audited commands. */ create?: ToolHandler; update?: ToolHandler; archive?: ToolHandler; /** Reads: caller-supplied query handlers (reads do not route through commands). */ get?: ToolHandler; list?: ToolHandler; }; declare const listArgs: z.ZodObject<{ paginationOpts: z.ZodObject<{ numItems: z.ZodNumber; cursor: z.ZodUnion; endCursor: z.ZodOptional>; id: z.ZodOptional; maximumRowsRead: z.ZodOptional; maximumBytesRead: z.ZodOptional; }, z.core.$strict>; }, z.core.$strict>; /** * Emits agent tool definitions from the existing table tool masks: args are * the masks (jsonSafeZid keeps ids primitive in generated JSON schemas), * names are `_`, and only the kinds you supply handlers for * are emitted. Wire mutation handlers to createCrudCommands executors (or * your own) so every agent action is an audited command. */ export declare function createAgentTools(table: Table, handlers: Handlers, options?: { descriptions?: Partial>; }): AgentTools; export type AgentTools
= Partial<{ [Verb in keyof Handlers & keyof AgentToolHandlers as `${Table['tableName']}_${Verb}`]: { name: string; description: string; args: Verb extends 'create' ? Table['tools']['insert'] : Verb extends 'update' ? Table['tools']['update'] : Verb extends 'list' ? typeof listArgs : Table['tools']['id']; handler: NonNullable; }; }>; //#endregion export { type OperationExecutor, type OperationPublicResult, type OperationTool, type OperationToolConverter, type OperationToolDefinition, type OperationToolJsonSchema, type OperationToolOutcome, type SelectedOperation, bindOperationExecutor, createOperationTools, operationToolDialect, selectOperation }; //# sourceMappingURL=agent-tools.d.mts.map