@assistant-wi/core 0.0.3 → 0.0.4
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.
- package/dist/tool/tool.d.ts +10 -10
- package/package.json +2 -2
package/dist/tool/tool.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { default as z } from 'zod/v4';
|
|
2
2
|
import { UI } from '../ui';
|
|
3
|
-
export interface Tool<
|
|
3
|
+
export interface Tool<I extends z.ZodTypeAny = z.ZodTypeAny, O extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
4
4
|
description: string;
|
|
5
|
-
inputSchema:
|
|
6
|
-
outputSchema:
|
|
5
|
+
inputSchema: I;
|
|
6
|
+
outputSchema: O;
|
|
7
7
|
workflow: {
|
|
8
|
-
call: (props: ToolCallProps<
|
|
9
|
-
done: (props: ToolDoneProps<
|
|
8
|
+
call: (props: ToolCallProps<I, O>) => Promise<void>;
|
|
9
|
+
done: (props: ToolDoneProps<I, O>) => void;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
export interface ToolCallProps<Input extends z.
|
|
12
|
+
export interface ToolCallProps<Input extends z.ZodTypeAny, Output extends z.ZodTypeAny> {
|
|
13
13
|
toolCallId: string;
|
|
14
14
|
input: z.infer<Input>;
|
|
15
15
|
render: (ui: UI) => void;
|
|
16
16
|
commit: (result: z.infer<Output>) => void;
|
|
17
17
|
}
|
|
18
|
-
export interface ToolDoneProps<
|
|
18
|
+
export interface ToolDoneProps<I extends z.ZodTypeAny, O extends z.ZodTypeAny> {
|
|
19
19
|
toolCallId: string;
|
|
20
|
-
input: z.infer<
|
|
21
|
-
output: z.infer<
|
|
20
|
+
input: z.infer<I>;
|
|
21
|
+
output: z.infer<O>;
|
|
22
22
|
render: (ui: UI) => void;
|
|
23
23
|
}
|
|
24
|
-
export declare function createTool<
|
|
24
|
+
export declare function createTool<I extends z.ZodTypeAny, O extends z.ZodTypeAny>(tool: Tool<I, O>): Tool<I, O>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-wi/core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs.js",
|
|
7
7
|
"module": "./dist/index.es.js",
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
"zod": "^4.1.5"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"zod": "^
|
|
50
|
+
"zod": "^4"
|
|
51
51
|
}
|
|
52
52
|
}
|