@maintainer-pro/ai-ui 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +50 -0
  2. package/package.json +11 -2
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @maintainer-pro/ai-ui
2
+
3
+ Chat UI for Maintainer Pro. Use the React `<AiChat />` component in a Next/Vite app, or drop the embed script on any HTML page.
4
+
5
+ The widget talks to your Node chat route (`/api/chat`). Coding agents are invoked by [`@maintainer-pro/ai-cli`](https://www.npmjs.com/package/@maintainer-pro/ai-cli) on the server — not in the browser.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @maintainer-pro/ai-ui
11
+ ```
12
+
13
+ Peer dependencies: `react` 19, `react-dom` 19, `@assistant-ui/react`. Tailwind CSS v4 is expected if you use the React package utility classes.
14
+
15
+ ## React
16
+
17
+ ```tsx
18
+ import { AiChat } from "@maintainer-pro/ai-ui";
19
+
20
+ <AiChat apiUrl="/api/chat" title="AI Assistant" />
21
+ ```
22
+
23
+ Load client keys at runtime (`/api/embed-config` or `/embed-config.js`). Do not bake `MAINTAINER_PRO_CLIENT_API_KEY` into the frontend bundle.
24
+
25
+ ## Embed (any HTML page)
26
+
27
+ Copy `node_modules/@maintainer-pro/ai-ui/dist/ai-ui.iife.js` next to your page (or serve it from the chat server). Then:
28
+
29
+ ```html
30
+ <script src="/embed-config.js"></script>
31
+ <script src="/ai-ui.iife.js"></script>
32
+ <script>
33
+ AiUi.init({
34
+ apiUrl: "/api/chat",
35
+ title: "AI Assistant",
36
+ maintainerProUrl: window.__MAINTAINER_PRO__?.maintainerProUrl,
37
+ maintainerProApiKey: window.__MAINTAINER_PRO__?.maintainerProApiKey,
38
+ });
39
+ </script>
40
+ ```
41
+
42
+ `/embed-config.js` is served by [`@maintainer-pro/ai-server`](https://www.npmjs.com/package/@maintainer-pro/ai-server) (or your own backend) from **server** env.
43
+
44
+ ## Related packages
45
+
46
+ | Package | Role |
47
+ |---------|------|
48
+ | [`@maintainer-pro/ai-cli`](https://www.npmjs.com/package/@maintainer-pro/ai-cli) | Talks to coding agents |
49
+ | [`@maintainer-pro/ai-server`](https://www.npmjs.com/package/@maintainer-pro/ai-server) | Node port for `/api/chat` |
50
+ | [`@maintainer-pro/setup`](https://www.npmjs.com/package/@maintainer-pro/setup) | Download the sandbox setup guide |
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@maintainer-pro/ai-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "React chat UI for Maintainer Pro",
5
+ "keywords": [
6
+ "maintainer-pro",
7
+ "ai",
8
+ "chat",
9
+ "react",
10
+ "embed",
11
+ "widget"
12
+ ],
5
13
  "license": "MIT",
6
14
  "type": "module",
7
15
  "main": "./dist/index.cjs",
@@ -21,7 +29,8 @@
21
29
  },
22
30
  "files": [
23
31
  "dist",
24
- "embed.d.ts"
32
+ "embed.d.ts",
33
+ "README.md"
25
34
  ],
26
35
  "unpkg": "./dist/ai-ui.iife.js",
27
36
  "jsdelivr": "./dist/ai-ui.iife.js",