@assistant-wi/core 0.0.1

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
+ import { Tool } from './tool';
2
+ export type Assistant = AssistantV0;
3
+ export interface AssistantV0 {
4
+ version: 'v0';
5
+ id: string;
6
+ userId: string;
7
+ rateLimit?: number;
8
+ systemPrompt?: string;
9
+ contextPrompt?: () => string;
10
+ tools?: Record<string, Tool>;
11
+ }
@@ -0,0 +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;
@@ -0,0 +1,3 @@
1
+ export * from './assistant';
2
+ export * as tool from './tool';
3
+ export * as ui from './ui';
@@ -0,0 +1,10 @@
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" }));
7
+ export {
8
+ o as tool,
9
+ e as ui
10
+ };
@@ -0,0 +1,2 @@
1
+ export * from './tool';
2
+ export * as ui from '../ui';
@@ -0,0 +1,23 @@
1
+ import { default as z } from 'zod';
2
+ import { UI } from '../ui';
3
+ export interface Tool {
4
+ description: string;
5
+ inputSchema: z.ZodSchema;
6
+ outputSchema: z.ZodSchema;
7
+ workflow: {
8
+ call: (props: ToolCallProps) => Promise<void>;
9
+ done: (props: ToolDoneProps) => void;
10
+ };
11
+ }
12
+ export interface ToolCallProps {
13
+ toolCallId: string;
14
+ input: unknown;
15
+ render: (ui: UI) => void;
16
+ commit: (result: unknown) => void;
17
+ }
18
+ export interface ToolDoneProps {
19
+ toolCallId: string;
20
+ input: unknown;
21
+ output: unknown;
22
+ render: (ui: UI) => void;
23
+ }
@@ -0,0 +1,5 @@
1
+ export * from './ui';
2
+ export * from './ui-block';
3
+ export * from './ui-button';
4
+ export * from './ui-form';
5
+ export * from './ui-text';
@@ -0,0 +1,7 @@
1
+ import { UI } from './ui';
2
+ export interface UIBlock {
3
+ type: 'block';
4
+ nodes: UI[];
5
+ direction?: 'row' | 'column';
6
+ gap?: number;
7
+ }
@@ -0,0 +1,6 @@
1
+ export interface UIButton {
2
+ type: 'button';
3
+ text?: string;
4
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
5
+ onClick?: () => void;
6
+ }
@@ -0,0 +1,17 @@
1
+ export interface UIForm {
2
+ type: 'form';
3
+ title?: string;
4
+ description?: string;
5
+ nodes: UIFormNode[];
6
+ submitTitle: string;
7
+ onSubmit?: (values: Record<string, string>) => Promise<void>;
8
+ }
9
+ export interface UIFormNode {
10
+ type: 'text' | 'number' | 'email' | 'tel' | 'url' | 'password';
11
+ name: string;
12
+ label: string;
13
+ placeholder?: string;
14
+ required?: boolean;
15
+ value?: string;
16
+ onChange?: (value: string) => void;
17
+ }
@@ -0,0 +1,4 @@
1
+ export interface UIText {
2
+ type: 'text';
3
+ text: string;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { UIBlock } from './ui-block';
2
+ import { UIButton } from './ui-button';
3
+ import { UIForm } from './ui-form';
4
+ import { UIText } from './ui-text';
5
+ export type UI = UIBlock | UIText | UIButton | UIForm;
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@assistant-wi/core",
3
+ "private": false,
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs.js",
7
+ "module": "./dist/index.es.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "sideEffects": false,
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "author": "bulatsan",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.es.js",
21
+ "require": "./dist/index.cjs.js",
22
+ "default": "./dist/index.es.js"
23
+ },
24
+ "./tool": {
25
+ "types": "./dist/tool/index.d.ts",
26
+ "import": "./dist/tool/index.es.js",
27
+ "require": "./dist/tool/index.cjs.js",
28
+ "default": "./dist/tool/index.es.js"
29
+ },
30
+ "./ui": {
31
+ "types": "./dist/ui/index.d.ts",
32
+ "import": "./dist/ui/index.es.js",
33
+ "require": "./dist/ui/index.cjs.js",
34
+ "default": "./dist/ui/index.es.js"
35
+ }
36
+ },
37
+ "scripts": {
38
+ "build": "tsc -b && vite build -c vite.config.ts",
39
+ "lint": "eslint .",
40
+ "fmt": "prettier --write ."
41
+ },
42
+ "dependencies": {
43
+ "zod": "^4.1.5"
44
+ },
45
+ "devDependencies": {
46
+ "@tsconfig/strictest": "^2.0.5",
47
+ "@types/node": "^24.3.0",
48
+ "vite": "^7.1.3",
49
+ "vite-plugin-dts": "^4.5.4"
50
+ }
51
+ }