/** * Input Validation * * Provides Zod-based input validation for MCP tool parameters. */ import { z } from 'zod'; /** * Common validation schemas */ export declare const schemas: { sessionId: z.ZodString; filePath: z.ZodString; base64Content: z.ZodString; filename: z.ZodString; jsonPointer: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; semanticId: z.ZodUnion<[z.ZodString, z.ZodString]>; patchOp: z.ZodEnum<["add", "remove", "replace", "move", "copy"]>; approvalTier: z.ZodEnum<["low", "medium", "high", "critical"]>; format: z.ZodEnum<["aasx", "json", "xml"]>; positiveInt: z.ZodNumber; nonNegativeInt: z.ZodNumber; }; /** * Tool-specific input schemas */ export declare const toolSchemas: { document_load: z.ZodObject<{ path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; }, { path: string; }>; document_load_content: z.ZodObject<{ content: z.ZodString; filename: z.ZodString; }, "strip", z.ZodTypeAny, { content: string; filename: string; }, { content: string; filename: string; }>; document_save: z.ZodObject<{ path: z.ZodOptional; }, "strip", z.ZodTypeAny, { path?: string | undefined; }, { path?: string | undefined; }>; document_export: z.ZodObject<{ format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { format?: "json" | "aasx" | "xml" | undefined; }, { format?: "json" | "aasx" | "xml" | undefined; }>; query_list_submodels: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>; query_find_by_semantic_id: z.ZodObject<{ semanticId: z.ZodString; }, "strip", z.ZodTypeAny, { semanticId: string; }, { semanticId: string; }>; query_get_by_path: z.ZodObject<{ submodelId: z.ZodString; path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; submodelId: string; }, { path: string; submodelId: string; }>; query_list_elements: z.ZodObject<{ submodelId: z.ZodString; collectionPath: z.ZodOptional; }, "strip", z.ZodTypeAny, { submodelId: string; collectionPath?: string | undefined; }, { submodelId: string; collectionPath?: string | undefined; }>; query_get_pointer: z.ZodObject<{ submodelId: z.ZodString; elementPath: z.ZodString; }, "strip", z.ZodTypeAny, { submodelId: string; elementPath: string; }, { submodelId: string; elementPath: string; }>; query_diff: z.ZodObject<{ compareWith: z.ZodEnum<["undo", "file"]>; fileContent: z.ZodOptional; undoSteps: z.ZodOptional; }, "strip", z.ZodTypeAny, { compareWith: "undo" | "file"; fileContent?: string | undefined; undoSteps?: number | undefined; }, { compareWith: "undo" | "file"; fileContent?: string | undefined; undoSteps?: number | undefined; }>; edit_add: z.ZodObject<{ path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; value: z.ZodUnknown; }, "strip", z.ZodTypeAny, { path: string; value?: unknown; }, { path: string; value?: unknown; }>; edit_update: z.ZodObject<{ path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; value: z.ZodUnknown; }, "strip", z.ZodTypeAny, { path: string; value?: unknown; }, { path: string; value?: unknown; }>; edit_delete: z.ZodObject<{ path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; }, "strip", z.ZodTypeAny, { path: string; }, { path: string; }>; edit_move: z.ZodObject<{ from: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; to: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; }, "strip", z.ZodTypeAny, { from: string; to: string; }, { from: string; to: string; }>; edit_copy: z.ZodObject<{ from: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; to: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; }, "strip", z.ZodTypeAny, { from: string; to: string; }, { from: string; to: string; }>; edit_batch: z.ZodObject<{ operations: z.ZodArray; path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; value: z.ZodOptional; from: z.ZodOptional]>>; }, "strip", z.ZodTypeAny, { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }, { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { operations: { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }[]; }, { operations: { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }[]; }>; validate_fast: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>; validate_deep: z.ZodObject<{ serviceUrl: z.ZodOptional; }, "strip", z.ZodTypeAny, { serviceUrl?: string | undefined; }, { serviceUrl?: string | undefined; }>; validate_summary: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>; validate_template: z.ZodObject<{ submodelPath: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; templateId: z.ZodOptional; }, "strip", z.ZodTypeAny, { submodelPath: string; templateId?: string | undefined; }, { submodelPath: string; templateId?: string | undefined; }>; validate_auto_fix: z.ZodObject<{ errors: z.ZodArray; severity: z.ZodOptional; }, "strip", z.ZodTypeAny, { path: string; message: string; code?: string | undefined; severity?: string | undefined; }, { path: string; message: string; code?: string | undefined; severity?: string | undefined; }>, "many">; maxAttempts: z.ZodOptional; }, "strip", z.ZodTypeAny, { errors: { path: string; message: string; code?: string | undefined; severity?: string | undefined; }[]; maxAttempts?: number | undefined; }, { errors: { path: string; message: string; code?: string | undefined; severity?: string | undefined; }[]; maxAttempts?: number | undefined; }>; import_suggest_template: z.ZodObject<{ templateId: z.ZodString; prefillData: z.ZodOptional>; includeOptional: z.ZodOptional; }, "strip", z.ZodTypeAny, { templateId: string; prefillData?: Record | undefined; includeOptional?: boolean | undefined; }, { templateId: string; prefillData?: Record | undefined; includeOptional?: boolean | undefined; }>; import_spreadsheet: z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; fileType: z.ZodOptional>; mapping: z.ZodOptional>; headerRow: z.ZodOptional; templateId: z.ZodOptional; }, "strip", z.ZodTypeAny, { templateId?: string | undefined; filePath?: string | undefined; base64Content?: string | undefined; fileType?: "csv" | "xlsx" | "xls" | undefined; mapping?: Record | undefined; headerRow?: number | undefined; }, { templateId?: string | undefined; filePath?: string | undefined; base64Content?: string | undefined; fileType?: "csv" | "xlsx" | "xls" | undefined; mapping?: Record | undefined; headerRow?: number | undefined; }>; import_aas: z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; submodelIds: z.ZodOptional>; mergeStrategy: z.ZodOptional>; }, "strip", z.ZodTypeAny, { filePath?: string | undefined; base64Content?: string | undefined; submodelIds?: string[] | undefined; mergeStrategy?: "replace" | "merge" | "skip" | undefined; }, { filePath?: string | undefined; base64Content?: string | undefined; submodelIds?: string[] | undefined; mergeStrategy?: "replace" | "merge" | "skip" | undefined; }>; import_pdf: z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; targetSubmodel: z.ZodOptional; pages: z.ZodOptional>; targetFields: z.ZodOptional>; }, "strip", z.ZodTypeAny, { filePath?: string | undefined; base64Content?: string | undefined; targetSubmodel?: string | undefined; pages?: number[] | undefined; targetFields?: string[] | undefined; }, { filePath?: string | undefined; base64Content?: string | undefined; targetSubmodel?: string | undefined; pages?: number[] | undefined; targetFields?: string[] | undefined; }>; import_image: z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; mimeType: z.ZodOptional; targetFields: z.ZodOptional>; }, "strip", z.ZodTypeAny, { filePath?: string | undefined; base64Content?: string | undefined; targetFields?: string[] | undefined; mimeType?: string | undefined; }, { filePath?: string | undefined; base64Content?: string | undefined; targetFields?: string[] | undefined; mimeType?: string | undefined; }>; ai_chat: z.ZodObject<{ message: z.ZodString; conversationHistory: z.ZodOptional; content: z.ZodString; toolCalls: z.ZodOptional; result: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; input: Record; result?: unknown; }, { name: string; input: Record; result?: unknown; }>, "many">>; }, "strip", z.ZodTypeAny, { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }, { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }>, "many">>; context: z.ZodOptional]>>; }, "strip", z.ZodTypeAny, { focusPath?: string | undefined; }, { focusPath?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { message: string; conversationHistory?: { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }[] | undefined; context?: { focusPath?: string | undefined; } | undefined; }, { message: string; conversationHistory?: { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }[] | undefined; context?: { focusPath?: string | undefined; } | undefined; }>; }; /** * Validation result */ export interface ValidationResult { valid: boolean; data?: unknown; errors?: string[]; } /** * Create an input validator for a tool */ export declare function createInputValidator(toolName: string): { validate: (input: unknown) => ValidationResult; schema: undefined; } | { validate: (input: unknown) => ValidationResult; schema: z.ZodObject<{ path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; }, { path: string; }> | z.ZodObject<{ content: z.ZodString; filename: z.ZodString; }, "strip", z.ZodTypeAny, { content: string; filename: string; }, { content: string; filename: string; }> | z.ZodObject<{ path: z.ZodOptional; }, "strip", z.ZodTypeAny, { path?: string | undefined; }, { path?: string | undefined; }> | z.ZodObject<{ format: z.ZodOptional>; }, "strip", z.ZodTypeAny, { format?: "json" | "aasx" | "xml" | undefined; }, { format?: "json" | "aasx" | "xml" | undefined; }> | z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}> | z.ZodObject<{ semanticId: z.ZodString; }, "strip", z.ZodTypeAny, { semanticId: string; }, { semanticId: string; }> | z.ZodObject<{ submodelId: z.ZodString; path: z.ZodString; }, "strip", z.ZodTypeAny, { path: string; submodelId: string; }, { path: string; submodelId: string; }> | z.ZodObject<{ submodelId: z.ZodString; collectionPath: z.ZodOptional; }, "strip", z.ZodTypeAny, { submodelId: string; collectionPath?: string | undefined; }, { submodelId: string; collectionPath?: string | undefined; }> | z.ZodObject<{ submodelId: z.ZodString; elementPath: z.ZodString; }, "strip", z.ZodTypeAny, { submodelId: string; elementPath: string; }, { submodelId: string; elementPath: string; }> | z.ZodObject<{ compareWith: z.ZodEnum<["undo", "file"]>; fileContent: z.ZodOptional; undoSteps: z.ZodOptional; }, "strip", z.ZodTypeAny, { compareWith: "undo" | "file"; fileContent?: string | undefined; undoSteps?: number | undefined; }, { compareWith: "undo" | "file"; fileContent?: string | undefined; undoSteps?: number | undefined; }> | z.ZodObject<{ path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; value: z.ZodUnknown; }, "strip", z.ZodTypeAny, { path: string; value?: unknown; }, { path: string; value?: unknown; }> | z.ZodObject<{ path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; value: z.ZodUnknown; }, "strip", z.ZodTypeAny, { path: string; value?: unknown; }, { path: string; value?: unknown; }> | z.ZodObject<{ path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; }, "strip", z.ZodTypeAny, { path: string; }, { path: string; }> | z.ZodObject<{ from: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; to: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; }, "strip", z.ZodTypeAny, { from: string; to: string; }, { from: string; to: string; }> | z.ZodObject<{ from: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; to: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; }, "strip", z.ZodTypeAny, { from: string; to: string; }, { from: string; to: string; }> | z.ZodObject<{ operations: z.ZodArray; path: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; value: z.ZodOptional; from: z.ZodOptional]>>; }, "strip", z.ZodTypeAny, { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }, { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { operations: { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }[]; }, { operations: { path: string; op: "add" | "remove" | "replace" | "move" | "copy"; value?: unknown; from?: string | undefined; }[]; }> | z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}> | z.ZodObject<{ serviceUrl: z.ZodOptional; }, "strip", z.ZodTypeAny, { serviceUrl?: string | undefined; }, { serviceUrl?: string | undefined; }> | z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}> | z.ZodObject<{ submodelPath: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>; templateId: z.ZodOptional; }, "strip", z.ZodTypeAny, { submodelPath: string; templateId?: string | undefined; }, { submodelPath: string; templateId?: string | undefined; }> | z.ZodObject<{ errors: z.ZodArray; severity: z.ZodOptional; }, "strip", z.ZodTypeAny, { path: string; message: string; code?: string | undefined; severity?: string | undefined; }, { path: string; message: string; code?: string | undefined; severity?: string | undefined; }>, "many">; maxAttempts: z.ZodOptional; }, "strip", z.ZodTypeAny, { errors: { path: string; message: string; code?: string | undefined; severity?: string | undefined; }[]; maxAttempts?: number | undefined; }, { errors: { path: string; message: string; code?: string | undefined; severity?: string | undefined; }[]; maxAttempts?: number | undefined; }> | z.ZodObject<{ templateId: z.ZodString; prefillData: z.ZodOptional>; includeOptional: z.ZodOptional; }, "strip", z.ZodTypeAny, { templateId: string; prefillData?: Record | undefined; includeOptional?: boolean | undefined; }, { templateId: string; prefillData?: Record | undefined; includeOptional?: boolean | undefined; }> | z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; fileType: z.ZodOptional>; mapping: z.ZodOptional>; headerRow: z.ZodOptional; templateId: z.ZodOptional; }, "strip", z.ZodTypeAny, { templateId?: string | undefined; filePath?: string | undefined; base64Content?: string | undefined; fileType?: "csv" | "xlsx" | "xls" | undefined; mapping?: Record | undefined; headerRow?: number | undefined; }, { templateId?: string | undefined; filePath?: string | undefined; base64Content?: string | undefined; fileType?: "csv" | "xlsx" | "xls" | undefined; mapping?: Record | undefined; headerRow?: number | undefined; }> | z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; submodelIds: z.ZodOptional>; mergeStrategy: z.ZodOptional>; }, "strip", z.ZodTypeAny, { filePath?: string | undefined; base64Content?: string | undefined; submodelIds?: string[] | undefined; mergeStrategy?: "replace" | "merge" | "skip" | undefined; }, { filePath?: string | undefined; base64Content?: string | undefined; submodelIds?: string[] | undefined; mergeStrategy?: "replace" | "merge" | "skip" | undefined; }> | z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; targetSubmodel: z.ZodOptional; pages: z.ZodOptional>; targetFields: z.ZodOptional>; }, "strip", z.ZodTypeAny, { filePath?: string | undefined; base64Content?: string | undefined; targetSubmodel?: string | undefined; pages?: number[] | undefined; targetFields?: string[] | undefined; }, { filePath?: string | undefined; base64Content?: string | undefined; targetSubmodel?: string | undefined; pages?: number[] | undefined; targetFields?: string[] | undefined; }> | z.ZodObject<{ filePath: z.ZodOptional; base64Content: z.ZodOptional; mimeType: z.ZodOptional; targetFields: z.ZodOptional>; }, "strip", z.ZodTypeAny, { filePath?: string | undefined; base64Content?: string | undefined; targetFields?: string[] | undefined; mimeType?: string | undefined; }, { filePath?: string | undefined; base64Content?: string | undefined; targetFields?: string[] | undefined; mimeType?: string | undefined; }> | z.ZodObject<{ message: z.ZodString; conversationHistory: z.ZodOptional; content: z.ZodString; toolCalls: z.ZodOptional; result: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; input: Record; result?: unknown; }, { name: string; input: Record; result?: unknown; }>, "many">>; }, "strip", z.ZodTypeAny, { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }, { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }>, "many">>; context: z.ZodOptional]>>; }, "strip", z.ZodTypeAny, { focusPath?: string | undefined; }, { focusPath?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { message: string; conversationHistory?: { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }[] | undefined; context?: { focusPath?: string | undefined; } | undefined; }, { message: string; conversationHistory?: { content: string; role: "user" | "assistant"; toolCalls?: { name: string; input: Record; result?: unknown; }[] | undefined; }[] | undefined; context?: { focusPath?: string | undefined; } | undefined; }>; }; /** * Validate tool input with detailed error reporting */ export declare function validateToolInput(toolName: string, input: unknown): ValidationResult; //# sourceMappingURL=validation.d.ts.map