modality-kit 0.12.15 → 0.12.17

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.
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Copy of StandardSchemaV1 interface for compatibility
3
3
  */
4
+ import { z } from "zod";
4
5
  export interface ToolParameters<Input = unknown, Output = Input> {
5
6
  readonly "~standard": ToolParameters.Props<Input, Output>;
6
7
  }
@@ -36,7 +37,7 @@ export declare namespace ToolParameters {
36
37
  /**
37
38
  * Tool interface for AI SDK compatibility
38
39
  */
39
- export interface AITool<T extends Record<string, unknown> | undefined = any, TParams extends ToolParameters = ToolParameters> {
40
+ export interface AITool<T extends Record<string, unknown> | undefined = any, TParams extends ToolParameters = z.ZodSchema> {
40
41
  annotations?: {
41
42
  streamingHint?: boolean;
42
43
  } & {
@@ -49,18 +50,19 @@ export interface AITool<T extends Record<string, unknown> | undefined = any, TPa
49
50
  canAccess?: (auth: T) => boolean;
50
51
  description?: string;
51
52
  execute: (args: ToolParameters.InferOutput<TParams>, context?: any) => Promise<any>;
52
- name: string;
53
+ name?: string;
53
54
  inputSchema?: TParams;
54
55
  timeoutMs?: number;
55
56
  }
56
57
  export interface FastMCPTool<T extends Record<string, unknown> | undefined = any, TParams extends ToolParameters = ToolParameters> extends AITool<T, TParams> {
57
58
  parameters?: TParams;
59
+ name: string;
58
60
  }
59
61
  /**
60
62
  * Type for a collection of AI tools with preserved schema types
61
63
  * @template T - Record mapping tool names to their inputSchema types
62
64
  * @example AITools<{getUserById: z.object({id: z.string()}), createUser: z.object({name: z.string()})}>
63
65
  */
64
- export type AITools<T extends Record<string, ToolParameters> = Record<string, ToolParameters>> = {
66
+ export type AITools<T extends Record<string, ToolParameters> = Record<string, z.ZodSchema>> = {
65
67
  [K in keyof T]: AITool<any, T[K]>;
66
68
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.12.15",
2
+ "version": "0.12.17",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",
@@ -11,7 +11,7 @@
11
11
  "author": "Hill <hill@kimo.com>",
12
12
  "license": "ISC",
13
13
  "devDependencies": {
14
- "@types/bun": "^1.2.22",
14
+ "@types/bun": "^1.2.23",
15
15
  "typescript": "^5.9.2",
16
16
  "zod": "^3.25.76"
17
17
  },