aov-agent 1.0.1 → 1.0.6
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/README.md +313 -250
- package/dist/agent-ui/components/Assistant/AgentButton/AgentButton.js +5 -5
- package/dist/agent-ui/components/Assistant/AgentButton/AgentButton.scss +40 -40
- package/dist/agent-ui/components/Assistant/Assistant.js +29 -34
- package/dist/agent-ui/components/Assistant/Assistant.scss +3 -3
- package/dist/agent-ui/components/Assistant/AssistantWidget/AssistantWidget.js +42 -36
- package/dist/agent-ui/components/Assistant/AssistantWidget/AssistantWidget.scss +205 -211
- package/dist/agent-ui/components/Assistant/AssistantWidget/components/ListChat.js +8 -8
- package/dist/agent-ui/components/Assistant/Markdown/MarkdownText.js +21 -21
- package/dist/agent-ui/components/Assistant/Markdown/MarkdownText.scss +222 -222
- package/dist/agent-ui/components/Assistant/Markdown/MathRenderer.js +29 -23
- package/dist/agent-ui/components/Assistant/Suggestions/Suggestions.scss +22 -22
- package/dist/agent-ui/components/Assistant/ThreadProvider.js +20 -21
- package/dist/agent-ui/components/Assistant/ToolResult/CardTool.js +58 -1
- package/dist/agent-ui/components/Assistant/ToolResult/CardTool.scss +12 -0
- package/dist/agent-ui/components/Assistant/ToolResult/ToolResult.js +31 -7
- package/dist/agent-ui/components/CopyToClipboard/CopyToClipboard.js +43 -0
- package/dist/agent-ui/components/CopyToClipboard/index.js +2 -0
- package/dist/agent-ui/components/ResizableModal/ResizableModal.js +20 -20
- package/dist/agent-ui/components/ResizableModal/ResizableModal.scss +117 -117
- package/dist/agent-ui/const/appName.js +6 -0
- package/dist/agent-ui/const/option.js +9 -0
- package/dist/agent-ui/const/toolName.js +6 -0
- package/dist/agent-ui/contexts/AgentContext.js +26 -11
- package/dist/agent-ui/contexts/SuggestionsContext.js +11 -11
- package/dist/agent-ui/contexts/ThreadContext.js +3 -3
- package/dist/agent-ui/helpers/copyToClipboard.js +33 -0
- package/dist/agent-ui/helpers/formatQuery.js +15 -0
- package/dist/agent-ui/hooks/useFetchApi.js +14 -14
- package/dist/agent-ui/hooks/useStreamApi.js +5 -5
- package/dist/agent-ui/resources/assistant-avatar.svg +51 -0
- package/dist/agent-ui/services/errorService.js +11 -11
- package/dist/agent-ui/utils/api.js +14 -14
- package/package.json +24 -6
package/README.md
CHANGED
|
@@ -1,250 +1,313 @@
|
|
|
1
|
-
# AOV AI Agent
|
|
2
|
-
|
|
3
|
-
A React-based AI chat assistant library for Shopify applications, providing a seamless AI-powered support experience.
|
|
4
|
-
|
|
5
|
-
## 🏗️ Project Structure
|
|
6
|
-
|
|
7
|
-
This project follows Avada's monorepo structure as defined in [CLAUDE.md](./CLAUDE.md):
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
aov-ai-agent/
|
|
11
|
-
├── packages/
|
|
12
|
-
│ └── ui/ # Frontend React UI package
|
|
13
|
-
│ ├── src/
|
|
14
|
-
│ │ ├── components/ # Reusable React components
|
|
15
|
-
│ │ ├── contexts/ # React contexts
|
|
16
|
-
│ │ ├── hooks/ # Custom React hooks
|
|
17
|
-
│ │ ├── services/ # API services
|
|
18
|
-
│ │ ├── utils/ # Utility functions
|
|
19
|
-
│ │ └── index.js # Main export
|
|
20
|
-
│ ├── .babelrc # Babel config for UI
|
|
21
|
-
│ ├── .gitignore # UI specific ignores
|
|
22
|
-
│ ├── package.json # UI package metadata
|
|
23
|
-
│ └── README.md # UI package documentation
|
|
24
|
-
├── dist/
|
|
25
|
-
│ └── agent-ui/ # Compiled UI output
|
|
26
|
-
├── types/ # TypeScript type definitions
|
|
27
|
-
├── .babelrc # Root Babel configuration
|
|
28
|
-
├── package.json # Root package configuration (monorepo)
|
|
29
|
-
└── CLAUDE.md # Coding standards and guidelines
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## 📦 Installation
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npm install aov-agent
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Install peer dependencies:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm install react react-dom react-redux @shopify/polaris @shopify/polaris-icons
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## 🚀 Usage
|
|
45
|
-
|
|
46
|
-
### Import UI Components
|
|
47
|
-
|
|
48
|
-
```javascript
|
|
49
|
-
// ✅ Import from agent-ui subpath
|
|
50
|
-
import { Assistant } from "aov-agent/agent-ui";
|
|
51
|
-
|
|
52
|
-
function App() {
|
|
53
|
-
return (
|
|
54
|
-
<Assistant
|
|
55
|
-
shop={{
|
|
56
|
-
id: "shop-123",
|
|
57
|
-
showAgentChat: true,
|
|
58
|
-
}}
|
|
59
|
-
apiUrl="/api/chat/message"
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Required Peer Dependencies
|
|
66
|
-
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"react": "^18.2.0",
|
|
70
|
-
"react-dom": "^18.2.0",
|
|
71
|
-
"react-redux": "^9.2.0",
|
|
72
|
-
"@shopify/polaris": "^13.9.5",
|
|
73
|
-
"@shopify/polaris-icons": "^9.3.1"
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## ✨ Features
|
|
78
|
-
|
|
79
|
-
- **AI-Powered Chat Interface**: Streaming chat with AI assistant
|
|
80
|
-
- **Thread Management**: Create, edit, delete, and switch between chat threads
|
|
81
|
-
- **AI Suggestions**: Contextual suggestions for quick actions
|
|
82
|
-
- **Tool Execution**: Support for AI tool calls and results
|
|
83
|
-
- **Markdown Support**: Rich text formatting with math equations (KaTeX)
|
|
84
|
-
- **Resizable Modal**: Draggable and resizable chat window
|
|
85
|
-
- **Shopify Polaris UI**: Built with Shopify's design system
|
|
86
|
-
- **PropTypes Validation**: Runtime type checking for components
|
|
87
|
-
- **SSE Streaming**: Real-time streaming responses
|
|
88
|
-
|
|
89
|
-
## 🛠️ Development
|
|
90
|
-
|
|
91
|
-
### Build
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
npm run build
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Compiles source code from `packages/ui/src/` to `dist/agent-ui/` using Babel.
|
|
98
|
-
|
|
99
|
-
### Watch Mode
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
npm run build:watch
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Automatically rebuilds on file changes.
|
|
106
|
-
|
|
107
|
-
## 📚 Documentation
|
|
108
|
-
|
|
109
|
-
See [CLAUDE.md](./CLAUDE.md) for:
|
|
110
|
-
|
|
111
|
-
- Coding standards and conventions
|
|
112
|
-
- Project structure guidelines
|
|
113
|
-
- React component patterns
|
|
114
|
-
- API integration guidelines
|
|
115
|
-
- Error handling best practices
|
|
116
|
-
|
|
117
|
-
See [packages/ui/README.md](./packages/ui/README.md) for:
|
|
118
|
-
|
|
119
|
-
- Detailed component documentation
|
|
120
|
-
- Hook usage examples
|
|
121
|
-
- Context API reference
|
|
122
|
-
|
|
123
|
-
## 🏛️ Architecture
|
|
124
|
-
|
|
125
|
-
### Components
|
|
126
|
-
|
|
127
|
-
- **Assistant**: Main container with provider wrappers
|
|
128
|
-
- **AssistantWidget**: Chat UI with thread list and composer
|
|
129
|
-
- **ThreadProvider**: Manages thread state and streaming runtime
|
|
130
|
-
- **ResizableModal**: Draggable modal container
|
|
131
|
-
|
|
132
|
-
### Contexts
|
|
133
|
-
|
|
134
|
-
- **AgentContext**: Agent visibility state
|
|
135
|
-
- **SuggestionsContext**: AI suggestions management
|
|
136
|
-
- **ThreadContext**: Thread list and CRUD operations
|
|
137
|
-
|
|
138
|
-
### Hooks
|
|
139
|
-
|
|
140
|
-
- **useFetchApi**: Data fetching with pagination
|
|
141
|
-
- **useStreamApi**: SSE streaming API calls
|
|
142
|
-
- **useThreadAutoScrollFix**: Auto-scroll behavior
|
|
143
|
-
|
|
144
|
-
## 🎨 Tech Stack
|
|
145
|
-
|
|
146
|
-
- React 18.2
|
|
147
|
-
- Shopify Polaris 13.9
|
|
148
|
-
- @assistant-ui/react
|
|
149
|
-
- Redux for state management
|
|
150
|
-
- KaTeX for math rendering
|
|
151
|
-
- PropTypes for validation
|
|
152
|
-
|
|
153
|
-
## 📝 Code Standards
|
|
154
|
-
|
|
155
|
-
This project follows Avada's coding standards:
|
|
156
|
-
|
|
157
|
-
- ✅ ES6+ features (import/export, async/await, arrow functions)
|
|
158
|
-
- ✅ camelCase for functions/variables
|
|
159
|
-
- ✅ PascalCase for components/classes
|
|
160
|
-
- ✅ JSDoc documentation
|
|
161
|
-
- ✅ PropTypes validation
|
|
162
|
-
- ✅ Early returns (no nested conditions)
|
|
163
|
-
- ✅ Structured error handling
|
|
164
|
-
|
|
165
|
-
## 🤝 Contributing
|
|
166
|
-
|
|
167
|
-
Follow the guidelines in [CLAUDE.md](./CLAUDE.md) for:
|
|
168
|
-
|
|
169
|
-
- Naming conventions
|
|
170
|
-
- Function design patterns
|
|
171
|
-
- React component structure
|
|
172
|
-
- Documentation requirements
|
|
173
|
-
- Error handling patterns
|
|
174
|
-
|
|
175
|
-
## 📦 Publishing to NPM
|
|
176
|
-
|
|
177
|
-
This package is designed to be published to NPM for use in other projects.
|
|
178
|
-
|
|
179
|
-
### Build and Publish
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
# 1. Install dependencies
|
|
183
|
-
npm install
|
|
184
|
-
|
|
185
|
-
# 2. Clean and build (works on Windows & Linux)
|
|
186
|
-
npm run clean
|
|
187
|
-
npm run build
|
|
188
|
-
|
|
189
|
-
# 3. Verify build output
|
|
190
|
-
# On Linux/Mac:
|
|
191
|
-
ls -la dist/agent-ui/
|
|
192
|
-
# On Windows:
|
|
193
|
-
dir dist\agent-ui\
|
|
194
|
-
|
|
195
|
-
# 4. Test locally (optional)
|
|
196
|
-
npm link
|
|
197
|
-
|
|
198
|
-
# 5. Publish to NPM
|
|
199
|
-
npm publish
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
**Note:** The `clean` script uses `rimraf` which works cross-platform (Windows, Linux, Mac).
|
|
203
|
-
|
|
204
|
-
### Package Structure
|
|
205
|
-
|
|
206
|
-
When published, the package structure will be:
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
aov-agent/
|
|
210
|
-
├── dist/
|
|
211
|
-
│ └── agent-ui/ # UI components
|
|
212
|
-
│ ├── components/
|
|
213
|
-
│ ├── contexts/
|
|
214
|
-
│ ├── hooks/
|
|
215
|
-
│ ├── services/
|
|
216
|
-
│ ├── utils/
|
|
217
|
-
│ └── index.js
|
|
218
|
-
└── package.json
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### Import Paths
|
|
222
|
-
|
|
223
|
-
```javascript
|
|
224
|
-
// UI Components
|
|
225
|
-
import { Assistant } from "aov-agent/agent-ui";
|
|
226
|
-
|
|
227
|
-
// Future packages (coming soon)
|
|
228
|
-
// import { ... } from 'aov-agent/assets';
|
|
229
|
-
// import { ... } from 'aov-agent/functions';
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## 📦 Monorepo Structure
|
|
233
|
-
|
|
234
|
-
This is a monorepo containing multiple packages:
|
|
235
|
-
|
|
236
|
-
- **`packages/
|
|
237
|
-
- **`packages/
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
1
|
+
# AOV AI Agent
|
|
2
|
+
|
|
3
|
+
A React-based AI chat assistant library for Shopify applications, providing a seamless AI-powered support experience.
|
|
4
|
+
|
|
5
|
+
## 🏗️ Project Structure
|
|
6
|
+
|
|
7
|
+
This project follows Avada's monorepo structure as defined in [CLAUDE.md](./CLAUDE.md):
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
aov-ai-agent/
|
|
11
|
+
├── packages/
|
|
12
|
+
│ └── ui/ # Frontend React UI package
|
|
13
|
+
│ ├── src/
|
|
14
|
+
│ │ ├── components/ # Reusable React components
|
|
15
|
+
│ │ ├── contexts/ # React contexts
|
|
16
|
+
│ │ ├── hooks/ # Custom React hooks
|
|
17
|
+
│ │ ├── services/ # API services
|
|
18
|
+
│ │ ├── utils/ # Utility functions
|
|
19
|
+
│ │ └── index.js # Main export
|
|
20
|
+
│ ├── .babelrc # Babel config for UI
|
|
21
|
+
│ ├── .gitignore # UI specific ignores
|
|
22
|
+
│ ├── package.json # UI package metadata
|
|
23
|
+
│ └── README.md # UI package documentation
|
|
24
|
+
├── dist/
|
|
25
|
+
│ └── agent-ui/ # Compiled UI output
|
|
26
|
+
├── types/ # TypeScript type definitions
|
|
27
|
+
├── .babelrc # Root Babel configuration
|
|
28
|
+
├── package.json # Root package configuration (monorepo)
|
|
29
|
+
└── CLAUDE.md # Coding standards and guidelines
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 📦 Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install aov-agent
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Install peer dependencies:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install react react-dom react-redux @shopify/polaris @shopify/polaris-icons
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 🚀 Usage
|
|
45
|
+
|
|
46
|
+
### Import UI Components
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
// ✅ Import from agent-ui subpath
|
|
50
|
+
import { Assistant } from "aov-agent/agent-ui";
|
|
51
|
+
|
|
52
|
+
function App() {
|
|
53
|
+
return (
|
|
54
|
+
<Assistant
|
|
55
|
+
shop={{
|
|
56
|
+
id: "shop-123",
|
|
57
|
+
showAgentChat: true,
|
|
58
|
+
}}
|
|
59
|
+
apiUrl="/api/chat/message"
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Required Peer Dependencies
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"react": "^18.2.0",
|
|
70
|
+
"react-dom": "^18.2.0",
|
|
71
|
+
"react-redux": "^9.2.0",
|
|
72
|
+
"@shopify/polaris": "^13.9.5",
|
|
73
|
+
"@shopify/polaris-icons": "^9.3.1"
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## ✨ Features
|
|
78
|
+
|
|
79
|
+
- **AI-Powered Chat Interface**: Streaming chat with AI assistant
|
|
80
|
+
- **Thread Management**: Create, edit, delete, and switch between chat threads
|
|
81
|
+
- **AI Suggestions**: Contextual suggestions for quick actions
|
|
82
|
+
- **Tool Execution**: Support for AI tool calls and results
|
|
83
|
+
- **Markdown Support**: Rich text formatting with math equations (KaTeX)
|
|
84
|
+
- **Resizable Modal**: Draggable and resizable chat window
|
|
85
|
+
- **Shopify Polaris UI**: Built with Shopify's design system
|
|
86
|
+
- **PropTypes Validation**: Runtime type checking for components
|
|
87
|
+
- **SSE Streaming**: Real-time streaming responses
|
|
88
|
+
|
|
89
|
+
## 🛠️ Development
|
|
90
|
+
|
|
91
|
+
### Build
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run build
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Compiles source code from `packages/ui/src/` to `dist/agent-ui/` using Babel.
|
|
98
|
+
|
|
99
|
+
### Watch Mode
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run build:watch
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Automatically rebuilds on file changes.
|
|
106
|
+
|
|
107
|
+
## 📚 Documentation
|
|
108
|
+
|
|
109
|
+
See [CLAUDE.md](./CLAUDE.md) for:
|
|
110
|
+
|
|
111
|
+
- Coding standards and conventions
|
|
112
|
+
- Project structure guidelines
|
|
113
|
+
- React component patterns
|
|
114
|
+
- API integration guidelines
|
|
115
|
+
- Error handling best practices
|
|
116
|
+
|
|
117
|
+
See [packages/ui/README.md](./packages/ui/README.md) for:
|
|
118
|
+
|
|
119
|
+
- Detailed component documentation
|
|
120
|
+
- Hook usage examples
|
|
121
|
+
- Context API reference
|
|
122
|
+
|
|
123
|
+
## 🏛️ Architecture
|
|
124
|
+
|
|
125
|
+
### Components
|
|
126
|
+
|
|
127
|
+
- **Assistant**: Main container with provider wrappers
|
|
128
|
+
- **AssistantWidget**: Chat UI with thread list and composer
|
|
129
|
+
- **ThreadProvider**: Manages thread state and streaming runtime
|
|
130
|
+
- **ResizableModal**: Draggable modal container
|
|
131
|
+
|
|
132
|
+
### Contexts
|
|
133
|
+
|
|
134
|
+
- **AgentContext**: Agent visibility state
|
|
135
|
+
- **SuggestionsContext**: AI suggestions management
|
|
136
|
+
- **ThreadContext**: Thread list and CRUD operations
|
|
137
|
+
|
|
138
|
+
### Hooks
|
|
139
|
+
|
|
140
|
+
- **useFetchApi**: Data fetching with pagination
|
|
141
|
+
- **useStreamApi**: SSE streaming API calls
|
|
142
|
+
- **useThreadAutoScrollFix**: Auto-scroll behavior
|
|
143
|
+
|
|
144
|
+
## 🎨 Tech Stack
|
|
145
|
+
|
|
146
|
+
- React 18.2
|
|
147
|
+
- Shopify Polaris 13.9
|
|
148
|
+
- @assistant-ui/react
|
|
149
|
+
- Redux for state management
|
|
150
|
+
- KaTeX for math rendering
|
|
151
|
+
- PropTypes for validation
|
|
152
|
+
|
|
153
|
+
## 📝 Code Standards
|
|
154
|
+
|
|
155
|
+
This project follows Avada's coding standards:
|
|
156
|
+
|
|
157
|
+
- ✅ ES6+ features (import/export, async/await, arrow functions)
|
|
158
|
+
- ✅ camelCase for functions/variables
|
|
159
|
+
- ✅ PascalCase for components/classes
|
|
160
|
+
- ✅ JSDoc documentation
|
|
161
|
+
- ✅ PropTypes validation
|
|
162
|
+
- ✅ Early returns (no nested conditions)
|
|
163
|
+
- ✅ Structured error handling
|
|
164
|
+
|
|
165
|
+
## 🤝 Contributing
|
|
166
|
+
|
|
167
|
+
Follow the guidelines in [CLAUDE.md](./CLAUDE.md) for:
|
|
168
|
+
|
|
169
|
+
- Naming conventions
|
|
170
|
+
- Function design patterns
|
|
171
|
+
- React component structure
|
|
172
|
+
- Documentation requirements
|
|
173
|
+
- Error handling patterns
|
|
174
|
+
|
|
175
|
+
## 📦 Publishing to NPM
|
|
176
|
+
|
|
177
|
+
This package is designed to be published to NPM for use in other projects.
|
|
178
|
+
|
|
179
|
+
### Build and Publish
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# 1. Install dependencies
|
|
183
|
+
npm install
|
|
184
|
+
|
|
185
|
+
# 2. Clean and build (works on Windows & Linux)
|
|
186
|
+
npm run clean
|
|
187
|
+
npm run build
|
|
188
|
+
|
|
189
|
+
# 3. Verify build output
|
|
190
|
+
# On Linux/Mac:
|
|
191
|
+
ls -la dist/agent-ui/
|
|
192
|
+
# On Windows:
|
|
193
|
+
dir dist\agent-ui\
|
|
194
|
+
|
|
195
|
+
# 4. Test locally (optional)
|
|
196
|
+
npm link
|
|
197
|
+
|
|
198
|
+
# 5. Publish to NPM
|
|
199
|
+
npm publish
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Note:** The `clean` script uses `rimraf` which works cross-platform (Windows, Linux, Mac).
|
|
203
|
+
|
|
204
|
+
### Package Structure
|
|
205
|
+
|
|
206
|
+
When published, the package structure will be:
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
aov-agent/
|
|
210
|
+
├── dist/
|
|
211
|
+
│ └── agent-ui/ # UI components
|
|
212
|
+
│ ├── components/
|
|
213
|
+
│ ├── contexts/
|
|
214
|
+
│ ├── hooks/
|
|
215
|
+
│ ├── services/
|
|
216
|
+
│ ├── utils/
|
|
217
|
+
│ └── index.js
|
|
218
|
+
└── package.json
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Import Paths
|
|
222
|
+
|
|
223
|
+
```javascript
|
|
224
|
+
// UI Components
|
|
225
|
+
import { Assistant } from "aov-agent/agent-ui";
|
|
226
|
+
|
|
227
|
+
// Future packages (coming soon)
|
|
228
|
+
// import { ... } from 'aov-agent/assets';
|
|
229
|
+
// import { ... } from 'aov-agent/functions';
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## 📦 Monorepo Structure
|
|
233
|
+
|
|
234
|
+
This is a monorepo containing multiple packages:
|
|
235
|
+
|
|
236
|
+
- **`packages/app/`** - Next.js 15 application (Frontend + Backend API Routes + Firestore)
|
|
237
|
+
- **`packages/ui/`** - AI Assistant UI components (published as `aov-agent/agent-ui`)
|
|
238
|
+
|
|
239
|
+
Each package can be developed, built, and tested independently.
|
|
240
|
+
|
|
241
|
+
### 🚀 Quick Start for Development
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Install all dependencies
|
|
245
|
+
npm install
|
|
246
|
+
|
|
247
|
+
# Run Next.js development server
|
|
248
|
+
npm run dev
|
|
249
|
+
|
|
250
|
+
# App: http://localhost:3000
|
|
251
|
+
# API: http://localhost:3000/api
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Project Structure
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
/aov-ai-agent/
|
|
258
|
+
├── packages/
|
|
259
|
+
│ ├── app/ # Next.js 15 App (Frontend + Backend API)
|
|
260
|
+
│ │ ├── app/ # App Router
|
|
261
|
+
│ │ │ ├── api/ # API Routes (Firestore backend)
|
|
262
|
+
│ │ │ ├── layout.tsx
|
|
263
|
+
│ │ │ ├── page.tsx
|
|
264
|
+
│ │ │ └── globals.css
|
|
265
|
+
│ │ ├── components/ui/ # shadcn/ui components
|
|
266
|
+
│ │ ├── lib/ # Utilities & Firestore client
|
|
267
|
+
│ │ ├── repositories/ # Firestore repositories
|
|
268
|
+
│ │ ├── services/ # Business logic
|
|
269
|
+
│ │ └── package.json
|
|
270
|
+
│ └── ui/ # AI Assistant UI Components (publishable)
|
|
271
|
+
│ └── src/
|
|
272
|
+
│ └── components/
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Stack
|
|
276
|
+
|
|
277
|
+
- **Frontend**: Next.js 15 + React 19 + TypeScript
|
|
278
|
+
- **Styling**: Tailwind CSS + shadcn/ui
|
|
279
|
+
- **Backend**: Next.js API Routes
|
|
280
|
+
- **Database**: Google Cloud Firestore
|
|
281
|
+
- **Validation**: Zod
|
|
282
|
+
- **Icons**: Lucide React
|
|
283
|
+
|
|
284
|
+
### Setup Firebase
|
|
285
|
+
|
|
286
|
+
Create `packages/app/.env.local`:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/serviceAccount.json
|
|
290
|
+
FIREBASE_PROJECT_ID=your-project-id
|
|
291
|
+
NODE_ENV=development
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Download your Firebase service account key from [Firebase Console](https://console.firebase.google.com/) → Project Settings → Service Accounts.
|
|
295
|
+
|
|
296
|
+
### API Endpoints
|
|
297
|
+
|
|
298
|
+
- `GET /api/health` - Health check
|
|
299
|
+
- `GET /api/todos` - Get all todos
|
|
300
|
+
- `POST /api/todos` - Create todo
|
|
301
|
+
- `GET /api/todos/:id` - Get single todo
|
|
302
|
+
- `PATCH /api/todos/:id` - Update todo
|
|
303
|
+
- `DELETE /api/todos/:id` - Delete todo
|
|
304
|
+
|
|
305
|
+
## 📄 License
|
|
306
|
+
|
|
307
|
+
ISC
|
|
308
|
+
|
|
309
|
+
## 🔗 Links
|
|
310
|
+
|
|
311
|
+
- Repository: https://gitlab.com/avada/aov-ai-agent
|
|
312
|
+
- Issues: https://gitlab.com/avada/aov-ai-agent/issues
|
|
313
|
+
- NPM: https://www.npmjs.com/package/aov-agent
|
|
@@ -4,11 +4,11 @@ import { Icon } from "@shopify/polaris";
|
|
|
4
4
|
import { MagicIcon } from "@shopify/polaris-icons";
|
|
5
5
|
import "./AgentButton.scss";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* AgentButton - Floating button to trigger AI assistant
|
|
9
|
-
*
|
|
10
|
-
* @param {Function} onClick - Click handler to open assistant
|
|
11
|
-
* @returns {React.ReactElement} Agent button component
|
|
7
|
+
/**
|
|
8
|
+
* AgentButton - Floating button to trigger AI assistant
|
|
9
|
+
*
|
|
10
|
+
* @param {Function} onClick - Click handler to open assistant
|
|
11
|
+
* @returns {React.ReactElement} Agent button component
|
|
12
12
|
*/
|
|
13
13
|
var AgentButton = function AgentButton(_ref) {
|
|
14
14
|
var onClick = _ref.onClick;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
.aov-agent-button {
|
|
2
|
-
position: fixed;
|
|
3
|
-
bottom: 20px;
|
|
4
|
-
left: 20px;
|
|
5
|
-
z-index: 380;
|
|
6
|
-
min-width: 40px;
|
|
7
|
-
min-height: 40px;
|
|
8
|
-
padding: 2px;
|
|
9
|
-
border: none;
|
|
10
|
-
border-radius: 50%;
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
background: #fff;
|
|
16
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
|
|
17
|
-
0 4px 12px rgba(0, 0, 0, 0.08);
|
|
18
|
-
transition: all 0.2s ease;
|
|
19
|
-
|
|
20
|
-
&:hover {
|
|
21
|
-
transform: translateY(-1px);
|
|
22
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12),
|
|
23
|
-
0 8px 16px rgba(0, 0, 0, 0.12);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&:active {
|
|
27
|
-
transform: translateY(0);
|
|
28
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&:focus {
|
|
32
|
-
outline: 2px solid #007bff;
|
|
33
|
-
outline-offset: 2px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:focus:not(:focus-visible) {
|
|
37
|
-
outline: none;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
1
|
+
.aov-agent-button {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 20px;
|
|
4
|
+
left: 20px;
|
|
5
|
+
z-index: 380;
|
|
6
|
+
min-width: 40px;
|
|
7
|
+
min-height: 40px;
|
|
8
|
+
padding: 2px;
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
background: #fff;
|
|
16
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
|
|
17
|
+
0 4px 12px rgba(0, 0, 0, 0.08);
|
|
18
|
+
transition: all 0.2s ease;
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
transform: translateY(-1px);
|
|
22
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12),
|
|
23
|
+
0 8px 16px rgba(0, 0, 0, 0.12);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:active {
|
|
27
|
+
transform: translateY(0);
|
|
28
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:focus {
|
|
32
|
+
outline: 2px solid #007bff;
|
|
33
|
+
outline-offset: 2px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:focus:not(:focus-visible) {
|
|
37
|
+
outline: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|