@assistant-wi/core 0.0.2 → 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/index-BXj6EgSG.js +11 -0
- package/dist/index-CHYnucAA.cjs +1 -0
- package/dist/index-DMcbwFzr.cjs +1 -0
- package/dist/index-Dwsbu01L.js +38 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +4 -8
- package/dist/tool/index.cjs.js +1 -0
- package/dist/tool/index.d.ts +0 -1
- package/dist/tool/index.es.js +4 -0
- package/dist/tool/tool.d.ts +13 -12
- package/dist/ui/index.cjs.js +1 -0
- package/dist/ui/index.es.js +7 -0
- package/dist/ui/ui-block.d.ts +1 -0
- package/dist/ui/ui-button.d.ts +1 -0
- package/dist/ui/ui-form.d.ts +1 -0
- package/dist/ui/ui-text.d.ts +1 -0
- package/package.json +6 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(t){return{type:"block",...t}}function n(t){return{type:"button",...t}}function o(t){return{type:"form",...t}}function r(t){return{type:"text",...t}}const u=Object.freeze(Object.defineProperty({__proto__:null,block:e,button:n,form:o,text:r},Symbol.toStringTag,{value:"Module"}));exports.block=e;exports.button=n;exports.form=o;exports.index=u;exports.text=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(t){return t}const o=Object.freeze(Object.defineProperty({__proto__:null,createTool:e},Symbol.toStringTag,{value:"Module"}));exports.createTool=e;exports.index=o;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function e(t) {
|
|
2
|
+
return {
|
|
3
|
+
type: "block",
|
|
4
|
+
...t
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function n(t) {
|
|
8
|
+
return {
|
|
9
|
+
type: "button",
|
|
10
|
+
...t
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function o(t) {
|
|
14
|
+
return {
|
|
15
|
+
type: "form",
|
|
16
|
+
...t
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function r(t) {
|
|
20
|
+
return {
|
|
21
|
+
type: "text",
|
|
22
|
+
...t
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
26
|
+
__proto__: null,
|
|
27
|
+
block: e,
|
|
28
|
+
button: n,
|
|
29
|
+
form: o,
|
|
30
|
+
text: r
|
|
31
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
32
|
+
export {
|
|
33
|
+
n as a,
|
|
34
|
+
e as b,
|
|
35
|
+
o as f,
|
|
36
|
+
u as i,
|
|
37
|
+
r as t
|
|
38
|
+
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DMcbwFzr.cjs"),i=require("./index-CHYnucAA.cjs");exports.tool=e.index;exports.ui=i.index;
|
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}, Symbol.toStringTag, { value: "Module" })), o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4
|
-
__proto__: null,
|
|
5
|
-
ui: e
|
|
6
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1
|
+
import { i } from "./index-BXj6EgSG.js";
|
|
2
|
+
import { i as a } from "./index-Dwsbu01L.js";
|
|
7
3
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
i as tool,
|
|
5
|
+
a as ui
|
|
10
6
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DMcbwFzr.cjs");exports.createTool=e.createTool;
|
package/dist/tool/index.d.ts
CHANGED
package/dist/tool/tool.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { default as z } from 'zod';
|
|
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) => Promise<void>;
|
|
9
|
-
done: (props: ToolDoneProps) => void;
|
|
8
|
+
call: (props: ToolCallProps<I, O>) => Promise<void>;
|
|
9
|
+
done: (props: ToolDoneProps<I, O>) => void;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
export interface ToolCallProps {
|
|
12
|
+
export interface ToolCallProps<Input extends z.ZodTypeAny, Output extends z.ZodTypeAny> {
|
|
13
13
|
toolCallId: string;
|
|
14
|
-
input:
|
|
14
|
+
input: z.infer<Input>;
|
|
15
15
|
render: (ui: UI) => void;
|
|
16
|
-
commit: (result:
|
|
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:
|
|
21
|
-
output:
|
|
20
|
+
input: z.infer<I>;
|
|
21
|
+
output: z.infer<O>;
|
|
22
22
|
render: (ui: UI) => void;
|
|
23
23
|
}
|
|
24
|
+
export declare function createTool<I extends z.ZodTypeAny, O extends z.ZodTypeAny>(tool: Tool<I, O>): Tool<I, O>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../index-CHYnucAA.cjs");exports.block=t.block;exports.button=t.button;exports.form=t.form;exports.text=t.text;
|
package/dist/ui/ui-block.d.ts
CHANGED
package/dist/ui/ui-button.d.ts
CHANGED
package/dist/ui/ui-form.d.ts
CHANGED
package/dist/ui/ui-text.d.ts
CHANGED
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",
|
|
@@ -39,13 +39,14 @@
|
|
|
39
39
|
"lint": "eslint .",
|
|
40
40
|
"fmt": "prettier --write ."
|
|
41
41
|
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"zod": "^4.1.5"
|
|
44
|
-
},
|
|
45
42
|
"devDependencies": {
|
|
46
43
|
"@tsconfig/strictest": "^2.0.5",
|
|
47
44
|
"@types/node": "^24.3.0",
|
|
48
45
|
"vite": "^7.1.3",
|
|
49
|
-
"vite-plugin-dts": "^4.5.4"
|
|
46
|
+
"vite-plugin-dts": "^4.5.4",
|
|
47
|
+
"zod": "^4.1.5"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"zod": "^4"
|
|
50
51
|
}
|
|
51
52
|
}
|