/** * AI Module * * Ready-to-use tool definitions for AI frameworks (OpenAI, Anthropic, Vercel AI SDK). * * @module ai * * @example * ```typescript * // With Vercel AI SDK * import { createManifestBuilder, aiTools } from 'archetype-engine/ai' * import { generateText } from 'ai' * import { openai } from '@ai-sdk/openai' * * const builder = createManifestBuilder() * * const result = await generateText({ * model: openai('gpt-4o'), * tools: aiTools.vercel(builder), * system: 'You are an app builder. Use the tools to build the app.', * prompt: 'Create a blog with users and posts', * maxSteps: 10 * }) * * // After AI finishes calling tools, generate the app * const { files, success } = await builder.generate() * ``` */ export type { ToolDefinition, ToolParameter, ToolResult, ManifestBuilder, AddEntityParams, UpdateEntityParams, RemoveEntityParams, SetDatabaseParams, SetAuthParams, OpenAITool, AnthropicTool, VercelAITool, } from './types'; export { createManifestBuilder } from './state'; export { toolDefinitions } from './tools'; export { getOpenAITools, executeOpenAITool, createOpenAIHandler } from './adapters/openai'; export { getAnthropicTools, executeAnthropicTool, createAnthropicHandler } from './adapters/anthropic'; export { getVercelAITools } from './adapters/vercel'; export type { VercelAITools } from './adapters/vercel'; import type { ManifestBuilder } from './types'; /** * Convenience object for getting tools in different formats */ export declare const aiTools: { /** * Get tools for OpenAI function calling */ openai: () => import("./types").OpenAITool[]; /** * Get tools for Anthropic tool use */ anthropic: () => import("./types").AnthropicTool[]; /** * Get tools for Vercel AI SDK (requires builder instance) */ vercel: (builder: ManifestBuilder) => { add_entity: { description: string; parameters: import("zod").ZodObject<{ name: import("zod").ZodString; fields: import("zod").ZodRecord; required: import("zod").ZodOptional; unique: import("zod").ZodOptional; email: import("zod").ZodOptional; url: import("zod").ZodOptional; min: import("zod").ZodOptional; max: import("zod").ZodOptional; oneOf: import("zod").ZodOptional>; integer: import("zod").ZodOptional; positive: import("zod").ZodOptional; default: import("zod").ZodOptional; label: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { type: "number" | "boolean" | "text" | "date"; email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }, { type: "number" | "boolean" | "text" | "date"; email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }>>; relations: import("zod").ZodOptional; entity: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }>>>; behaviors: import("zod").ZodOptional; softDelete: import("zod").ZodOptional; audit: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; }, { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; }>>; protected: import("zod").ZodOptional]>>; }, "strip", import("zod").ZodTypeAny, { fields: Record; name: string; protected?: boolean | "write" | "all" | undefined; relations?: Record | undefined; behaviors?: { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; } | undefined; }, { fields: Record; name: string; protected?: boolean | "write" | "all" | undefined; relations?: Record | undefined; behaviors?: { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; } | undefined; }>; execute: (params: { name: string; fields: Record; required: import("zod").ZodOptional; unique: import("zod").ZodOptional; email: import("zod").ZodOptional; url: import("zod").ZodOptional; min: import("zod").ZodOptional; max: import("zod").ZodOptional; oneOf: import("zod").ZodOptional>; integer: import("zod").ZodOptional; positive: import("zod").ZodOptional; default: import("zod").ZodOptional; label: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { type: "number" | "boolean" | "text" | "date"; email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }, { type: "number" | "boolean" | "text" | "date"; email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }>>>; relations?: Record; entity: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }>>>; behaviors?: { timestamps?: boolean; softDelete?: boolean; audit?: boolean; }; protected?: boolean | "write" | "all"; }) => Promise; }; update_entity: { description: string; parameters: import("zod").ZodObject<{ name: import("zod").ZodString; fields: import("zod").ZodOptional>; required: import("zod").ZodOptional>; unique: import("zod").ZodOptional>; email: import("zod").ZodOptional>; url: import("zod").ZodOptional>; min: import("zod").ZodOptional>; max: import("zod").ZodOptional>; oneOf: import("zod").ZodOptional>>; integer: import("zod").ZodOptional>; positive: import("zod").ZodOptional>; default: import("zod").ZodOptional>; label: import("zod").ZodOptional>; }, "strip", import("zod").ZodTypeAny, { email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; type?: "number" | "boolean" | "text" | "date" | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }, { email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; type?: "number" | "boolean" | "text" | "date" | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }>>>; relations: import("zod").ZodOptional; entity: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }>>>; behaviors: import("zod").ZodOptional; softDelete: import("zod").ZodOptional; audit: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; }, { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; }>>; protected: import("zod").ZodOptional]>>; }, "strip", import("zod").ZodTypeAny, { name: string; fields?: Record | undefined; protected?: boolean | "write" | "all" | undefined; relations?: Record | undefined; behaviors?: { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; } | undefined; }, { name: string; fields?: Record | undefined; protected?: boolean | "write" | "all" | undefined; relations?: Record | undefined; behaviors?: { timestamps?: boolean | undefined; softDelete?: boolean | undefined; audit?: boolean | undefined; } | undefined; }>; execute: (params: { name: string; fields?: Record; required: import("zod").ZodOptional; unique: import("zod").ZodOptional; email: import("zod").ZodOptional; url: import("zod").ZodOptional; min: import("zod").ZodOptional; max: import("zod").ZodOptional; oneOf: import("zod").ZodOptional>; integer: import("zod").ZodOptional; positive: import("zod").ZodOptional; default: import("zod").ZodOptional; label: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { type: "number" | "boolean" | "text" | "date"; email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }, { type: "number" | "boolean" | "text" | "date"; email?: boolean | undefined; url?: boolean | undefined; oneOf?: string[] | undefined; min?: number | undefined; max?: number | undefined; integer?: boolean | undefined; positive?: boolean | undefined; required?: boolean | undefined; unique?: boolean | undefined; default?: unknown; label?: string | undefined; }>>>>; relations?: Record; entity: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }, { type: "hasOne" | "hasMany" | "belongsToMany"; entity: string; }>>>; behaviors?: { timestamps?: boolean; softDelete?: boolean; audit?: boolean; }; protected?: boolean | "write" | "all"; }) => Promise; }; remove_entity: { description: string; parameters: import("zod").ZodObject<{ name: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { name: string; }, { name: string; }>; execute: (params: { name: string; }) => Promise; }; set_database: { description: string; parameters: import("zod").ZodObject<{ type: import("zod").ZodEnum<["sqlite", "postgres", "mysql"]>; file: import("zod").ZodOptional; url: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { type: "sqlite" | "postgres" | "mysql"; url?: string | undefined; file?: string | undefined; }, { type: "sqlite" | "postgres" | "mysql"; url?: string | undefined; file?: string | undefined; }>; execute: (params: { type: "sqlite" | "postgres" | "mysql"; file?: string; url?: string; }) => Promise; }; set_auth: { description: string; parameters: import("zod").ZodObject<{ enabled: import("zod").ZodBoolean; providers: import("zod").ZodOptional, "many">>; sessionStrategy: import("zod").ZodOptional>; }, "strip", import("zod").ZodTypeAny, { enabled: boolean; providers?: ("credentials" | "google" | "github" | "discord")[] | undefined; sessionStrategy?: "database" | "jwt" | undefined; }, { enabled: boolean; providers?: ("credentials" | "google" | "github" | "discord")[] | undefined; sessionStrategy?: "database" | "jwt" | undefined; }>; execute: (params: { enabled: boolean; providers?: ("credentials" | "google" | "github" | "discord")[]; sessionStrategy?: "jwt" | "database"; }) => Promise; }; validate: { description: string; parameters: import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>; execute: () => Promise<{ success: boolean; message: string; errors: import("..").ValidationError[]; warnings: import("..").ValidationError[]; }>; }; generate: { description: string; parameters: import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>; execute: () => Promise<{ success: boolean; message: string; files: string[]; errors: string[] | undefined; }>; }; }; }; //# sourceMappingURL=index.d.ts.map