modality-kit 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,12 +91,12 @@ declare const fileEntrySchema: z.ZodObject<{
91
91
  type: z.ZodEnum<["file", "directory"]>;
92
92
  lastModified: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
93
93
  }, "strip", z.ZodTypeAny, {
94
- type: "file" | "directory";
95
94
  path: string;
95
+ type: "file" | "directory";
96
96
  lastModified?: number | null | undefined;
97
97
  }, {
98
- type: "file" | "directory";
99
98
  path: string;
99
+ type: "file" | "directory";
100
100
  lastModified?: number | null | undefined;
101
101
  }>;
102
102
  export type FileEntryType = z.infer<typeof fileEntrySchema>;
@@ -1,19 +1,21 @@
1
1
  /**
2
2
  * TypeScript interfaces for tool configuration objects
3
3
  */
4
- export type AIToolExecutor = (...args: any[]) => Promise<string>;
4
+ import { z } from "zod";
5
5
  /**
6
6
  * Tool interface for AI SDK compatibility
7
7
  */
8
- export interface AITool {
8
+ export interface AITool<T extends z.ZodSchema = z.ZodSchema> {
9
9
  name?: string;
10
10
  annotations?: any;
11
11
  description: string;
12
- inputSchema: any;
13
- execute: AIToolExecutor;
12
+ inputSchema: T;
13
+ execute: (args: z.infer<T>) => Promise<string>;
14
14
  }
15
15
  /**
16
- * Type for a collection of AI tools
17
- * @template T - The key type for the tools record, defaults to string
16
+ * Type for a collection of AI tools with preserved schema types
17
+ * Each tool maintains its specific inputSchema type relationship
18
18
  */
19
- export type AITools<T extends string | number | symbol = string> = Record<T, AITool>;
19
+ export type AITools<T extends Record<string, z.ZodSchema> = Record<string, z.ZodSchema>> = {
20
+ [K in keyof T]: AITool<T[K]>;
21
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.11.2",
2
+ "version": "0.11.3",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",