modality-kit 0.11.3 → 0.12.0
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.
|
@@ -14,7 +14,8 @@ export interface AITool<T extends z.ZodSchema = z.ZodSchema> {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Type for a collection of AI tools with preserved schema types
|
|
17
|
-
*
|
|
17
|
+
* @template T - Record mapping tool names to their inputSchema types
|
|
18
|
+
* @example AITools<{getUserById: z.object({id: z.string()}), createUser: z.object({name: z.string()})}>
|
|
18
19
|
*/
|
|
19
20
|
export type AITools<T extends Record<string, z.ZodSchema> = Record<string, z.ZodSchema>> = {
|
|
20
21
|
[K in keyof T]: AITool<T[K]>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { FastMCP } from "fastmcp";
|
|
2
2
|
import type { AITools } from "./schemas/schemas_tool_config.ts";
|
|
3
|
+
import type { z } from "zod";
|
|
3
4
|
/**
|
|
4
5
|
* Setup function that optionally registers AITools with MCP server
|
|
5
|
-
*
|
|
6
|
+
* Automatically infers and preserves schema types from the input
|
|
7
|
+
* @param aiTools - The AITools object with schema mapping
|
|
6
8
|
* @param mcpServer - Optional MCP server to register tools with
|
|
7
|
-
* @returns The AITools object
|
|
9
|
+
* @returns The same AITools object with preserved types
|
|
8
10
|
*/
|
|
9
|
-
export declare const setupAITools: (aiTools: AITools
|
|
11
|
+
export declare const setupAITools: <T extends Record<string, z.ZodSchema>>(aiTools: AITools<T>, mcpServer?: FastMCP) => AITools<T>;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.12.0",
|
|
3
3
|
"name": "modality-kit",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"update-compile-sh": "yo reshow:compile-sh",
|
|
26
26
|
"build:clean": "find ./dist -name '*.*' | xargs rm -rf",
|
|
27
|
-
"build:types": "
|
|
27
|
+
"build:types": "bun tsc -p ./",
|
|
28
28
|
"build:src": "bun build src/index.ts --outdir dist",
|
|
29
29
|
"build": "bun run build:clean && bun run build:src && bun run build:types",
|
|
30
30
|
"dev": "bunx concurrently 'bunx --watch tsc -p ./' 'bun build:src -- --watch --sourcemap=inline'",
|