@assistant-wi/core 0.0.2 → 0.0.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.
@@ -0,0 +1,11 @@
1
+ function o(e) {
2
+ return e;
3
+ }
4
+ const t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5
+ __proto__: null,
6
+ createTool: o
7
+ }, Symbol.toStringTag, { value: "Module" }));
8
+ export {
9
+ o as c,
10
+ t as i
11
+ };
@@ -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=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),t=Object.freeze(Object.defineProperty({__proto__:null,ui:e},Symbol.toStringTag,{value:"Module"}));exports.tool=t;exports.ui=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
- const e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2
- __proto__: null
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
- o as tool,
9
- e as ui
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;
@@ -1,2 +1 @@
1
1
  export * from './tool';
2
- export * as ui from '../ui';
@@ -0,0 +1,4 @@
1
+ import { c as r } from "../index-BXj6EgSG.js";
2
+ export {
3
+ r as createTool
4
+ };
@@ -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<Input extends z.ZodType = z.ZodType, Output extends z.ZodType = z.ZodType> {
4
4
  description: string;
5
- inputSchema: z.ZodSchema;
6
- outputSchema: z.ZodSchema;
5
+ inputSchema: Input;
6
+ outputSchema: Output;
7
7
  workflow: {
8
- call: (props: ToolCallProps) => Promise<void>;
9
- done: (props: ToolDoneProps) => void;
8
+ call: (props: ToolCallProps<Input, Output>) => Promise<void>;
9
+ done: (props: ToolDoneProps<Input, Output>) => void;
10
10
  };
11
11
  }
12
- export interface ToolCallProps {
12
+ export interface ToolCallProps<Input extends z.ZodType, Output extends z.ZodType> {
13
13
  toolCallId: string;
14
- input: unknown;
14
+ input: z.infer<Input>;
15
15
  render: (ui: UI) => void;
16
- commit: (result: unknown) => void;
16
+ commit: (result: z.infer<Output>) => void;
17
17
  }
18
- export interface ToolDoneProps {
18
+ export interface ToolDoneProps<Input extends z.ZodType, Output extends z.ZodType> {
19
19
  toolCallId: string;
20
- input: unknown;
21
- output: unknown;
20
+ input: z.infer<Input>;
21
+ output: z.infer<Output>;
22
22
  render: (ui: UI) => void;
23
23
  }
24
+ export declare function createTool<Input extends z.ZodType, Output extends z.ZodType>(tool: Tool<Input, Output>): Tool<Input, Output>;
@@ -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;
@@ -0,0 +1,7 @@
1
+ import { b as o, a as s, f as b, t as f } from "../index-Dwsbu01L.js";
2
+ export {
3
+ o as block,
4
+ s as button,
5
+ b as form,
6
+ f as text
7
+ };
@@ -5,3 +5,4 @@ export interface UIBlock {
5
5
  direction?: 'row' | 'column';
6
6
  gap?: number;
7
7
  }
8
+ export declare function block(props: Omit<UIBlock, 'type'>): UIBlock;
@@ -4,3 +4,4 @@ export interface UIButton {
4
4
  variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
5
5
  onClick?: () => void;
6
6
  }
7
+ export declare function button(props: Omit<UIButton, 'type'>): UIButton;
@@ -15,3 +15,4 @@ export interface UIFormNode {
15
15
  value?: string;
16
16
  onChange?: (value: string) => void;
17
17
  }
18
+ export declare function form(props: Omit<UIForm, 'type'>): UIForm;
@@ -2,3 +2,4 @@ export interface UIText {
2
2
  type: 'text';
3
3
  text: string;
4
4
  }
5
+ export declare function text(props: Omit<UIText, 'type'>): UIText;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@assistant-wi/core",
3
3
  "private": false,
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
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": "^3.25.76 || ^4"
50
51
  }
51
52
  }