guideai-app 0.4.2 → 0.4.3

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/.workflow-test ADDED
@@ -0,0 +1 @@
1
+ # Workflow Test
@@ -0,0 +1,126 @@
1
+ # Production Release Guide - guideai-app npm Package
2
+
3
+ This guide covers how to publish production releases of `guideai-app` to the public npm registry.
4
+
5
+ ## Prerequisites
6
+
7
+ - [ ] Changes merged and tested on `development` branch
8
+ - [ ] Ready to create a production release
9
+ - [ ] npm account with publish access to `guideai-app`
10
+
11
+ ## Release Process
12
+
13
+ ### 1. Merge Development to Production
14
+
15
+ ```bash
16
+ git checkout production
17
+ git pull origin production
18
+ git merge development
19
+ ```
20
+
21
+ Resolve any conflicts if needed.
22
+
23
+ ### 2. Update Version Number
24
+
25
+ **Option A: Use npm version command (Recommended)**
26
+
27
+ ```bash
28
+ cd guide-ai-package
29
+ npm version patch # 0.4.2 → 0.4.3
30
+ # or
31
+ npm version minor # 0.4.2 → 0.5.0
32
+ # or
33
+ npm version major # 0.4.2 → 1.0.0
34
+ ```
35
+
36
+ This automatically:
37
+ - Updates package.json
38
+ - Creates a git commit
39
+ - Creates a git tag
40
+
41
+ Then push:
42
+ ```bash
43
+ git push origin production --follow-tags
44
+ ```
45
+
46
+ **Option B: Manual update**
47
+
48
+ If you prefer manual control:
49
+
50
+ 1. Edit `guide-ai-package/package.json`:
51
+ ```json
52
+ {
53
+ "name": "guideai-app",
54
+ "version": "0.4.3", // ← Increment this
55
+ ...
56
+ }
57
+ ```
58
+
59
+ 2. Commit:
60
+ ```bash
61
+ git add guide-ai-package/package.json
62
+ git commit -m "chore: bump version to 0.4.3"
63
+ git push origin production
64
+ ```
65
+
66
+ ### 4. Build the Package
67
+
68
+ ```bash
69
+ cd guide-ai-package
70
+ npm run build
71
+ ```
72
+
73
+ Verify build completes successfully.
74
+
75
+ ### 5. Publish to npm Registry
76
+
77
+ ```bash
78
+ npm publish --registry https://registry.npmjs.org/
79
+ ```
80
+
81
+ **Important:** The `--registry` flag ensures publication to npm, not GitHub Packages.
82
+
83
+ ### 6. Verify Publication
84
+
85
+ ```bash
86
+ npm view guideai-app
87
+
88
+ # Should show your new version as 'latest'
89
+ ```
90
+
91
+ ### 7. Tag the Release (Optional but Recommended)
92
+
93
+ ```bash
94
+ git tag -a v0.4.3 -m "Release v0.4.3"
95
+ git push origin v0.4.3
96
+ ```
97
+
98
+ ## After Release
99
+
100
+ - [ ] New version available at https://www.npmjs.com/package/guideai-app
101
+ - [ ] Customers can install with `npm install guideai-app@0.4.3`
102
+ - [ ] Update guideaisite production environment to use new version
103
+
104
+ ## Notes
105
+
106
+ - **Dev releases** (beta tags) are automated via GitHub Actions → GitHub Packages
107
+ - **Production releases** are manual via this process → npm registry
108
+ - This ensures production releases are intentional and controlled
109
+ - The scoped package `@guideai/guideai-app` on GitHub Packages is separate and unaffected
110
+
111
+ ## Troubleshooting
112
+
113
+ **Error: "You must be logged in to publish packages"**
114
+ ```bash
115
+ npm login
116
+ # Follow prompts to authenticate
117
+ ```
118
+
119
+ **Error: "You do not have permission to publish"**
120
+ - Verify your npm account has publish access to `guideai-app`
121
+ - Contact package maintainer to add you
122
+
123
+ **Wrong package published:**
124
+ - You can unpublish within 72 hours: `npm unpublish guideai-app@VERSION`
125
+ - After 72 hours, must deprecate: `npm deprecate guideai-app@VERSION "reason"`
126
+
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Guide AI
2
2
 
3
- A React component that provides AI-powered guidance with voice interaction, text input, and element highlighting capabilities.
3
+ An AI-powered voice assistant component for React applications. Guide AI provides intelligent voice interactions, helping users navigate and complete tasks within your application.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,29 +10,11 @@ npm install guideai-app
10
10
  yarn add guideai-app
11
11
  ```
12
12
 
13
- ## Usage
14
-
15
- ### Basic Usage
16
-
17
- ```jsx
18
- import GuideAI from 'guideai-app';
19
-
20
- function App() {
21
- return (
22
- <div>
23
- <GuideAI
24
- organizationKey="your-organization-key"
25
- position={{ bottom: '2rem', right: '2rem' }}
26
- onError={(error) => console.error(error)}
27
- />
28
- </div>
29
- );
30
- }
31
- ```
32
-
33
- ### With Workflow Triggers
13
+ ## Basic Usage
34
14
 
35
15
  ```jsx
16
+ import React from 'react';
17
+ import ReactDOM from 'react-dom';
36
18
  import GuideAI from 'guideai-app';
37
19
 
38
20
  function App() {
@@ -40,8 +22,9 @@ function App() {
40
22
  <div>
41
23
  <GuideAI
42
24
  organizationKey="your-organization-key"
43
- workflowKey="customer-support"
44
- position={{ bottom: '2rem', right: '2rem' }}
25
+ React={React}
26
+ ReactDOM={ReactDOM}
27
+ position={{ bottom: '20px', right: '20px' }}
45
28
  onError={(error) => console.error(error)}
46
29
  />
47
30
  </div>
@@ -53,16 +36,15 @@ function App() {
53
36
 
54
37
  | Prop | Type | Required | Description |
55
38
  |------|------|----------|-------------|
56
- | `organizationKey` | `string` | Yes | Your organization key for workflows |
57
- | `workflowKey` | `string` | No | Workflow key for trigger-based workflows |
58
- | `position` | `object` | No | Positioning configuration for the component |
59
- | `onError` | `function` | No | Error handler callback |
60
- | `transcript` | `object` | No | Transcript feature configuration |
61
- | `input` | `object` | No | Input mode configuration (voice/text) |
39
+ | `organizationKey` | `string` | Yes | Your unique organization key |
40
+ | `React` | `React` | Yes | React instance from your application |
41
+ | `ReactDOM` | `ReactDOM` | Yes | ReactDOM instance from your application |
42
+ | `position` | `object` | No | CSS positioning for the component (see below) |
43
+ | `onError` | `function` | No | Error handler callback: `(error: string \| Error) => void` |
62
44
 
63
- ### Position Object
45
+ ## Position Object
64
46
 
65
- The `position` prop accepts an object with CSS positioning properties:
47
+ The `position` prop accepts an object with CSS positioning properties to control where the Guide AI button appears on your page:
66
48
 
67
49
  ```typescript
68
50
  position?: {
@@ -78,254 +60,87 @@ position?: {
78
60
  }
79
61
  ```
80
62
 
81
- ### Transcript Configuration Object
82
-
83
- ```typescript
84
- transcript?: {
85
- enabled?: boolean; // Show transcript (default: true)
86
- showToggleButton?: boolean; // Show transcript toggle (default: true)
87
- position?: 'right' | 'left' | 'top' | 'bottom'; // Transcript position
88
- }
89
- ```
90
-
91
- ### Input Configuration Object
63
+ ### Position Examples
92
64
 
93
- ```typescript
94
- input?: {
95
- enableTextInput?: boolean; // Enable text input (default: true)
96
- showInputToggle?: boolean; // Show mode toggle button (default: true)
97
- defaultMode?: 'voice' | 'text'; // Default input mode (default: 'voice')
98
- placeholder?: string; // Text input placeholder
99
- }
65
+ **Bottom-right corner:**
66
+ ```jsx
67
+ <GuideAI
68
+ organizationKey="your-org-key"
69
+ React={React}
70
+ ReactDOM={ReactDOM}
71
+ position={{ bottom: '20px', right: '20px' }}
72
+ />
100
73
  ```
101
74
 
102
- ### Examples
103
-
104
- **Basic usage:**
75
+ **Bottom-left corner:**
105
76
  ```jsx
106
77
  <GuideAI
107
78
  organizationKey="your-org-key"
108
- position={{ bottom: '4rem', left: '50%', marginLeft: '-30px' }}
79
+ React={React}
80
+ ReactDOM={ReactDOM}
81
+ position={{ bottom: '20px', left: '20px' }}
109
82
  />
110
83
  ```
111
84
 
112
- **With text input enabled by default:**
85
+ **Centered at bottom:**
113
86
  ```jsx
114
87
  <GuideAI
115
88
  organizationKey="your-org-key"
116
- position={{ top: '20px', right: '20px' }}
117
- input={{
118
- defaultMode: 'text',
119
- placeholder: "Ask me anything..."
89
+ React={React}
90
+ ReactDOM={ReactDOM}
91
+ position={{
92
+ bottom: '20px',
93
+ left: '50%',
94
+ transform: 'translateX(-50%)'
120
95
  }}
121
96
  />
122
97
  ```
123
98
 
124
- **Full configuration:**
99
+ **Top-right corner:**
125
100
  ```jsx
126
101
  <GuideAI
127
- organizationKey="your-organization-key"
128
- position={{ bottom: '2rem', right: '2rem' }}
129
- transcript={{
130
- enabled: true,
131
- showToggleButton: true
132
- }}
133
- input={{
134
- enableTextInput: true,
135
- defaultMode: 'voice',
136
- placeholder: "Type your message..."
137
- }}
138
- onError={(error) => console.error(error)}
102
+ organizationKey="your-org-key"
103
+ React={React}
104
+ ReactDOM={ReactDOM}
105
+ position={{ top: '20px', right: '20px' }}
139
106
  />
140
107
  ```
141
108
 
142
- ## Text Input Feature
143
-
144
- GuideAI now supports both voice and text input modes, giving users flexible ways to interact with the AI assistant.
145
-
146
- ### Features
147
-
148
- - **Dual Input Modes**: Switch seamlessly between voice and text input
149
- - **Text Input Interface**: Clean text area integrated into the transcript box
150
- - **Input Mode Toggle**: Dedicated button to switch between voice and text modes
151
- - **Real-time Text Chat**: Type messages and receive AI responses instantly
152
- - **Keyboard Shortcuts**: Press Enter to send messages quickly
153
- - **Auto-enabled**: Text input is enabled by default for better accessibility
154
-
155
- ### Input Props
156
-
157
- | Prop | Type | Default | Description |
158
- |------|------|---------|-------------|
159
- | `enableTextInput` | boolean | `true` | Enable text input functionality |
160
- | `showInputToggle` | boolean | `true` | Show the voice/text mode toggle button |
161
- | `defaultMode` | `'voice' \| 'text'` | `'voice'` | Default input mode when conversation starts |
162
- | `placeholder` | string | `"Type your message..."` | Placeholder text for the text input field |
163
-
164
- ### How to Use Text Input
165
-
166
- 1. **Start a Conversation**: Click the GuideAI button to begin
167
- 2. **Switch to Text Mode**: Click the toggle button next to the main GuideAI button
168
- 3. **Type Your Message**: Use the text area at the bottom of the transcript box
169
- 4. **Send Message**: Press Enter or click the send button
170
- 5. **Switch Back**: Click the toggle button again to return to voice mode
171
-
172
- ### Accessibility Features
173
-
174
- - **Keyboard Navigation**: Full keyboard support for text input
175
- - **Default Enabled**: Text input works out of the box without configuration
176
- - **Fallback Support**: Automatically enables text mode if microphone access is denied
177
- - **Visual Indicators**: Clear visual feedback for active input mode
178
-
179
- ## Transcript Feature
109
+ ## Complete Example
180
110
 
181
- GuideAI includes a beautiful transcript interface that displays conversations between users and the AI in a transparent Apple-style box.
182
-
183
- ### Features
184
-
185
- - **Glassmorphism Design**: Transparent background with backdrop blur effects
186
- - **Apple-style Interface**: Clean, modern design inspired by Apple's UI principles
187
- - **Real-time Updates**: Messages appear as they're exchanged
188
- - **Timestamps**: Each message shows when it was sent
189
- - **Auto-scroll**: Automatically scrolls to the latest messages
190
- - **Responsive**: Works perfectly on all device sizes
191
-
192
- ### How to Use
193
-
194
- 1. Start a conversation with GuideAI by clicking the microphone button
195
- 2. The transcript automatically appears as an overlay when the conversation begins
196
- 3. The transcript shows all messages with clear visual distinction between user and AI messages
197
- 4. Messages appear in real-time as the conversation progresses
198
- 5. Click the "×" button or click outside the transcript to close it
199
- 6. The transcript automatically closes when the conversation ends
200
-
201
- ### Transcript Interface
202
-
203
- The transcript interface includes:
204
- - **Header**: Shows "Conversation Transcript" with a close button
205
- - **Messages**: Chat-like interface with different styles for user and AI messages
206
- - **Timestamps**: Each message displays the time it was sent
207
- - **Footer**: Shows the total number of messages in the conversation
208
-
209
- ### Styling
210
-
211
- The transcript uses modern CSS features including:
212
- - `backdrop-filter: blur()` for the glassmorphism effect
213
- - CSS animations for smooth transitions
214
- - Responsive design that adapts to different screen sizes
215
- - Custom scrollbar styling for a polished look
216
-
217
- ## Element Interaction Features
218
-
219
- GuideAI includes powerful element interaction capabilities that allow the AI to guide users by highlighting, hovering over, and clicking elements on the page.
220
-
221
- ### Features
222
-
223
- - **Element Highlighting**: AI can highlight and click on specific page elements
224
- - **Hover Interactions**: AI can hover over elements with visual feedback
225
- - **Position Tracking**: Cursor follows elements that move or expand during interactions
226
- - **Multiple Selector Support**: Supports CSS selectors, XPath, and text-based selectors
227
- - **Extended Visual Feedback**: 3-second highlighting with enhanced animations
228
-
229
- ### Supported Selector Types
230
-
231
- | Selector Type | Format | Example |
232
- |---------------|--------|---------|
233
- | **ID** | `#elementId` | `#sidebarMenu-button-goals` |
234
- | **Class** | `.className` | `.submit-button` |
235
- | **Attribute** | `[attribute="value"]` | `[data-testid="submit"]` |
236
- | **Complex CSS** | Any valid CSS | `button.primary[aria-label="Save"]` |
237
- | **Text-based** | `text:cssSelector:textContent` | `text:.MuiListItemText-root:Goal Sets` |
238
- | **XPath** | `//xpath` | `//button[contains(text(), 'Submit')]` |
239
-
240
- ### Available Tools
241
-
242
- #### `highlight` Tool
243
- - **Purpose**: Moves cursor to elements and clicks them
244
- - **Use Case**: Guiding users through workflows by clicking interactive elements
245
- - **Visual Effect**: Blue cursor with click animations and visual feedback
246
-
247
- #### `hoverThenHighlight` Tool
248
- - **Purpose**: Moves cursor to elements and hovers over them
249
- - **Use Case**: Demonstrating or highlighting elements without triggering clicks
250
- - **Visual Effect**: Orange hover effects with position tracking for dynamic elements
251
-
252
- ### How It Works
253
-
254
- 1. **AI Detection**: The AI analyzes user requests and determines which elements to interact with
255
- 2. **Element Finding**: Uses advanced selector logic to locate elements on the page
256
- 3. **Visual Animation**: Animated cursor moves from viewport center to target elements
257
- 4. **Interaction**: Performs click or hover action with appropriate visual feedback
258
- 5. **Position Tracking**: For hover actions, tracks element position changes for 3 seconds
259
-
260
- ### Example Usage
261
-
262
- The AI can respond to user requests like:
263
- - "Click the save button" → Uses `highlight` tool to click elements
264
- - "Show me the navigation menu" → Uses `hoverThenHighlight` tool to highlight elements
265
- - "Test hover on the goals section" → Triggers predefined test sequence
266
-
267
- ### Technical Implementation
268
-
269
- - **Files**: `selectElementAndClick.ts` (clicking) and `hoverAndHighlight.ts` (hovering)
270
- - **State Management**: Separate state tracking for click and hover operations
271
- - **Error Handling**: Graceful fallback when elements are not found
272
- - **Performance**: Optimized with 50ms position tracking intervals
273
-
274
- ## Migration from Voice-Only Versions
275
-
276
- If you're upgrading from a voice-only version:
277
-
278
- - **No Breaking Changes**: Existing implementations continue to work unchanged
279
- - **Text Input Enabled**: Text input is now available by default
280
- - **Disable if Needed**: Set `input={{ enableTextInput: false }}` to disable text input
281
- - **Voice Still Default**: Voice mode remains the default interaction method
282
-
283
- ## Workflow Trigger Feature
284
-
285
- GuideAI now supports workflow triggers based on trigger words detected in user messages. This feature allows you to create dynamic workflows that are activated when specific keywords or phrases are mentioned by users.
286
-
287
- ### Features
288
-
289
- - **Trigger Word Detection**: Automatically detect trigger words in user messages
290
- - **Workflow Integration**: Seamlessly integrate with your backend workflow system
291
- - **Dynamic Prompts**: Workflow-specific prompts from the initialize-session API
292
- - **Tool-based Triggers**: AI can call workflow triggers through function calls
293
- - **Configurable**: Support for multiple workflow keys and trigger patterns
294
-
295
- ### How It Works
111
+ ```jsx
112
+ import React from 'react';
113
+ import ReactDOM from 'react-dom';
114
+ import GuideAI from 'guideai-app';
296
115
 
297
- 1. **Session Initialization**: When a conversation starts, the system calls `/initialize-session` with the `workflowKey` and receives a workflow-specific prompt
298
- 2. **Trigger Word Detection**: The AI automatically analyzes user messages for trigger words and calls the `trigger_workflow` function when triggers are found
299
- 3. **Workflow Execution**: Your backend receives the trigger request and executes workflow-specific actions
116
+ function App() {
117
+ const handleError = (error) => {
118
+ console.error('GuideAI Error:', error);
119
+ // Add your custom error handling here
120
+ };
300
121
 
301
- ### Example Workflows
122
+ return (
123
+ <div className="app">
124
+ <h1>My Application</h1>
125
+
126
+ <GuideAI
127
+ organizationKey="your-organization-key"
128
+ React={React}
129
+ ReactDOM={ReactDOM}
130
+ position={{ bottom: '40px', right: '40px' }}
131
+ onError={handleError}
132
+ />
133
+ </div>
134
+ );
135
+ }
302
136
 
303
- **Customer Support**: Trigger words like "help", "support", "issue", "problem"
304
- **Sales Inquiry**: Trigger words like "pricing", "cost", "buy", "purchase"
305
- **Technical Support**: Trigger words like "error", "bug", "crash", "not working"
137
+ export default App;
138
+ ```
306
139
 
307
- ### Backend Requirements
140
+ ## Getting Your Organization Key
308
141
 
309
- You only need to implement the `initialize-session` endpoint, which returns workflows along with the prompt:
142
+ To use Guide AI, you'll need an organization key. Contact the Guide AI team to get your key and set up your organization.
310
143
 
311
- ```json
312
- {
313
- "id": "conversation-uuid",
314
- "ephemeralToken": "openai-realtime-token",
315
- "prompt": "organization-prompt",
316
- "workflows": [
317
- {
318
- "id": "workflow-uuid",
319
- "name": "Customer Support Workflow",
320
- "triggers": ["help", "support", "customer service"],
321
- "organizationKey": "org-key-123",
322
- "prompt": "You are a helpful customer support agent...",
323
- "archived": false,
324
- "createdAt": "2024-01-01T00:00:00.000Z",
325
- "updatedAt": "2024-01-01T00:00:00.000Z"
326
- }
327
- ]
328
- }
329
- ```
144
+ ## Support
330
145
 
331
- For detailed implementation guide, see [workflow-trigger-usage.md](./workflow-trigger-usage.md).
146
+ For questions, issues, or feature requests, please contact the Guide AI team or visit our documentation.