@maintainer-pro/ai-ui 0.1.0
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/ai-ui.css +2 -0
- package/dist/ai-ui.iife.js +63 -0
- package/dist/ai-ui.iife.js.map +1 -0
- package/dist/index.cjs +2097 -0
- package/dist/index.d.cts +181 -0
- package/dist/index.d.ts +181 -0
- package/dist/index.js +2071 -0
- package/embed.d.ts +75 -0
- package/package.json +59 -0
package/embed.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ChatUser,
|
|
3
|
+
ClientContext,
|
|
4
|
+
ToolCall,
|
|
5
|
+
} from "@maintainer-pro/ai-cli";
|
|
6
|
+
|
|
7
|
+
export type AiUiToolHandlers = Record<
|
|
8
|
+
string,
|
|
9
|
+
(args: Record<string, unknown>) => void | Promise<void>
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
export type AiUiMountOptions = {
|
|
13
|
+
apiUrl?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
conversationId?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
height?: string;
|
|
18
|
+
users?: ChatUser[];
|
|
19
|
+
getData?: () => Record<string, unknown>;
|
|
20
|
+
data?: Record<string, unknown>;
|
|
21
|
+
relevantFiles?: string[];
|
|
22
|
+
visiblePanels?: string[];
|
|
23
|
+
buildContext?: () => ClientContext;
|
|
24
|
+
tools?: AiUiToolHandlers;
|
|
25
|
+
onToolCalls?: (toolCalls: ToolCall[]) => void | Promise<void>;
|
|
26
|
+
captureState?: () => unknown;
|
|
27
|
+
restoreState?: (snapshot: unknown) => void;
|
|
28
|
+
shadow?: boolean;
|
|
29
|
+
maintainerProUrl?: string;
|
|
30
|
+
maintainerProApiKey?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type AiUiInitOptions = AiUiMountOptions & {
|
|
34
|
+
apiUrl: string;
|
|
35
|
+
pushSelector?: string;
|
|
36
|
+
storageKey?: string;
|
|
37
|
+
startOpen?: boolean;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export function mount(
|
|
41
|
+
target: string | Element,
|
|
42
|
+
options?: AiUiMountOptions
|
|
43
|
+
): { unmount: () => void };
|
|
44
|
+
|
|
45
|
+
export function unmount(target: string | Element): void;
|
|
46
|
+
|
|
47
|
+
export function init(options: AiUiInitOptions): {
|
|
48
|
+
open: () => void;
|
|
49
|
+
close: () => void;
|
|
50
|
+
destroy: () => void;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export function destroy(): void;
|
|
54
|
+
|
|
55
|
+
export function buildBrowserClientContext(input?: {
|
|
56
|
+
route?: string;
|
|
57
|
+
pageTitle?: string;
|
|
58
|
+
visiblePanels?: string[];
|
|
59
|
+
relevantFiles?: string[];
|
|
60
|
+
data?: Record<string, unknown>;
|
|
61
|
+
}): ClientContext;
|
|
62
|
+
|
|
63
|
+
export type { ClientContext, ToolCall, ChatUser };
|
|
64
|
+
|
|
65
|
+
declare global {
|
|
66
|
+
const AiUi: {
|
|
67
|
+
mount: typeof mount;
|
|
68
|
+
unmount: typeof unmount;
|
|
69
|
+
init: typeof init;
|
|
70
|
+
destroy: typeof destroy;
|
|
71
|
+
buildBrowserClientContext: typeof buildBrowserClientContext;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maintainer-pro/ai-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React chat UI for Maintainer Pro",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./embed": {
|
|
17
|
+
"types": "./embed.d.ts",
|
|
18
|
+
"default": "./dist/ai-ui.iife.js"
|
|
19
|
+
},
|
|
20
|
+
"./ai-ui.css": "./dist/ai-ui.css"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"embed.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"unpkg": "./dist/ai-ui.iife.js",
|
|
27
|
+
"jsdelivr": "./dist/ai-ui.iife.js",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build:lib": "tsup src/index.ts --format esm,cjs --dts --external react --external react-dom --external @assistant-ui/react --external @assistant-ui/react-markdown --external remark-gfm --clean",
|
|
33
|
+
"build:css": "tailwindcss -i ./src/embed.css -o ./dist/ai-ui.css --minify",
|
|
34
|
+
"build:embed": "tsup --config tsup.embed.config.ts",
|
|
35
|
+
"build": "npm run build:lib && npm run build:css && npm run build:embed",
|
|
36
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --external react-dom --external @assistant-ui/react --external @assistant-ui/react-markdown --external remark-gfm --watch"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@assistant-ui/react": "^0.14.0",
|
|
40
|
+
"react": "^19.0.0",
|
|
41
|
+
"react-dom": "^19.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@assistant-ui/react-markdown": "0.14.7",
|
|
45
|
+
"@maintainer-pro/ai-cli": "^0.1.0",
|
|
46
|
+
"remark-gfm": "^4.0.1"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@assistant-ui/react": "^0.14.18",
|
|
50
|
+
"@tailwindcss/cli": "^4.1.11",
|
|
51
|
+
"@types/react": "^19",
|
|
52
|
+
"@types/react-dom": "^19",
|
|
53
|
+
"react": "19.2.4",
|
|
54
|
+
"react-dom": "19.2.4",
|
|
55
|
+
"tailwindcss": "^4.1.11",
|
|
56
|
+
"tsup": "^8.5.0",
|
|
57
|
+
"typescript": "^5"
|
|
58
|
+
}
|
|
59
|
+
}
|