UNPKG

@odel/module-sdk

Version:

SDK for building Odel modules - MCP protocol over HTTP for Cloudflare Workers

32 lines 833 B
/** * Type definitions for Odel modules */ import { z } from 'zod'; /** * Tool definition with Zod schema */ export interface ModuleTool<TInput extends z.ZodType, TOutput extends z.ZodType> { name: string; description: string; inputSchema: TInput; outputSchema: TOutput; handler: (input: z.infer<TInput>, context: ToolContext) => Promise<z.infer<TOutput>>; } /** * Context provided to tool handlers - basic user/request info */ export interface ModuleContext { userId: string; conversationId?: string; displayName: string; timestamp: number; requestId: string; secrets: Record<string, string>; } /** * Extended context with Cloudflare Worker environment bindings */ export interface ToolContext<Env = any> extends ModuleContext { env: Env; } //# sourceMappingURL=types.d.ts.map