@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.
- package/dist/assistant.d.ts +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +10 -0
- package/dist/tool/index.d.ts +2 -0
- package/dist/tool/tool.d.ts +23 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/ui-block.d.ts +7 -0
- package/dist/ui/ui-button.d.ts +6 -0
- package/dist/ui/ui-form.d.ts +17 -0
- package/dist/ui/ui-text.d.ts +4 -0
- package/dist/ui/ui.d.ts +5 -0
- package/package.json +51 -0
|
@@ -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;
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -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,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,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
|
+
}
|
package/dist/ui/ui.d.ts
ADDED
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
|
+
}
|