guideai-app 0.5.1 → 0.5.3-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 (127) hide show
  1. package/README.md +179 -80
  2. package/dist/GuideAI.d.ts +1 -1
  3. package/dist/GuideAI.js +1 -1
  4. package/dist/GuideAI.js.LICENSE.txt +7 -0
  5. package/dist/GuideAI.js.map +1 -1
  6. package/dist/__mocks__/fileMock.d.ts +2 -0
  7. package/dist/components/AudioConfigDialog.d.ts +22 -0
  8. package/dist/components/MicGlyphs.d.ts +9 -0
  9. package/dist/components/Microphone.d.ts +4 -2
  10. package/dist/components/MuteButton.d.ts +3 -1
  11. package/dist/components/NoisyPresetSuggestBanner.d.ts +12 -0
  12. package/dist/components/PlaybackInterruptLockDebugOverlay.d.ts +19 -0
  13. package/dist/components/PlaybackLockDebugOverlayRoot.d.ts +14 -0
  14. package/dist/components/ResetGlyph.d.ts +5 -0
  15. package/dist/components/TranscriptBox.d.ts +62 -8
  16. package/dist/components/TranscriptMessages.d.ts +8 -1
  17. package/dist/components/TranscriptTextInput.d.ts +39 -2
  18. package/dist/components/TranscriptToolbar.d.ts +23 -0
  19. package/dist/components/TranscriptWorkflowDrawer.d.ts +39 -0
  20. package/dist/components/WelcomeBubble.d.ts +6 -1
  21. package/dist/components/WorkspaceStubIcon.d.ts +6 -0
  22. package/dist/devtools/visualContextInspector/BufferIndicator.d.ts +15 -0
  23. package/dist/devtools/visualContextInspector/ConfigSection.d.ts +18 -0
  24. package/dist/devtools/visualContextInspector/ScreenshotList.d.ts +13 -0
  25. package/dist/devtools/visualContextInspector/VisualContextInspector.d.ts +35 -0
  26. package/dist/devtools/visualContextInspector/fieldInfo.d.ts +7 -0
  27. package/dist/devtools/visualContextInspector/index.d.ts +13 -0
  28. package/dist/devtools/visualContextInspector/inspectorStore.d.ts +35 -0
  29. package/dist/devtools/visualContextInspector/inspectorStyles.d.ts +13 -0
  30. package/dist/devtools/visualContextInspector/types.d.ts +27 -0
  31. package/dist/hooks/index.d.ts +6 -0
  32. package/dist/hooks/useAudioConfigSurface.d.ts +20 -0
  33. package/dist/hooks/useConversationSession.d.ts +67 -0
  34. package/dist/hooks/useDocToFormDropFlow.d.ts +31 -0
  35. package/dist/hooks/useGuideAIAPI.d.ts +3 -6
  36. package/dist/hooks/useGuideAILayout.d.ts +38 -0
  37. package/dist/hooks/useGuideAILocalStorageSync.d.ts +17 -0
  38. package/dist/hooks/useHiddenRealtimeSteers.d.ts +22 -0
  39. package/dist/hooks/useMicMute.d.ts +20 -0
  40. package/dist/hooks/useMicPreset.d.ts +19 -0
  41. package/dist/hooks/useMicPromptHook.d.ts +28 -0
  42. package/dist/hooks/useNoisyPresetSuggest.d.ts +19 -0
  43. package/dist/hooks/usePlaybackLockDebugOverlay.d.ts +12 -0
  44. package/dist/hooks/useProtectedPlayback.d.ts +36 -0
  45. package/dist/hooks/useTranscriptChrome.d.ts +39 -0
  46. package/dist/hooks/useTranscriptState.d.ts +1 -1
  47. package/dist/hooks/useWebRTC.d.ts +41 -6
  48. package/dist/hooks/useWidgetWorkflowSession.d.ts +35 -0
  49. package/dist/hooks/useWorkspaceCatalog.d.ts +30 -0
  50. package/dist/index.d.ts +5 -1
  51. package/dist/lib/workspaceEmbedIcons.d.ts +57 -0
  52. package/dist/micPrompt.defaults.d.ts +25 -0
  53. package/dist/playwrightToolHarness.d.ts +8 -0
  54. package/dist/playwrightToolHarness.js +3 -0
  55. package/dist/playwrightToolHarness.js.LICENSE.txt +16 -0
  56. package/dist/playwrightToolHarness.js.map +1 -0
  57. package/dist/stubs/workspaces.d.ts +36 -0
  58. package/dist/styles/GuideAI.styles.d.ts +2 -6
  59. package/dist/styles/GuideAI.styles.types.d.ts +6 -0
  60. package/dist/styles/guideAIStylesCore.d.ts +2 -0
  61. package/dist/styles/guideAIStylesDialogs.d.ts +2 -0
  62. package/dist/styles/guideAIStylesMicPrompt.d.ts +2 -0
  63. package/dist/styles/guideAIStylesTranscript.d.ts +2 -0
  64. package/dist/types/GuideAI.types.d.ts +55 -2
  65. package/dist/types/audioConfig.types.d.ts +78 -0
  66. package/dist/utils/api.d.ts +61 -15
  67. package/dist/utils/confettiBurst.d.ts +6 -0
  68. package/dist/utils/constants.d.ts +7 -1
  69. package/dist/utils/conversationManager.d.ts +12 -2
  70. package/dist/utils/dataChannel.d.ts +45 -6
  71. package/dist/utils/dataChannelHelpers.d.ts +28 -0
  72. package/dist/utils/dataTransferHasFiles.d.ts +2 -0
  73. package/dist/utils/date.d.ts +11 -0
  74. package/dist/utils/embedConversationNamespace.d.ts +10 -0
  75. package/dist/utils/isMobileBrowser.d.ts +5 -0
  76. package/dist/utils/localStorageHelper.d.ts +78 -0
  77. package/dist/utils/logger.d.ts +17 -20
  78. package/dist/utils/messageStorage.d.ts +12 -11
  79. package/dist/utils/micPromptThrottle.d.ts +13 -0
  80. package/dist/utils/positionUtils.d.ts +8 -7
  81. package/dist/utils/reactHooks.d.ts +14 -0
  82. package/dist/utils/reducedMotion.d.ts +17 -0
  83. package/dist/utils/tools/back.d.ts +19 -0
  84. package/dist/utils/tools/clickElement.d.ts +32 -0
  85. package/dist/utils/tools/docToForm.d.ts +54 -0
  86. package/dist/utils/tools/docUploadPrompt.d.ts +11 -0
  87. package/dist/utils/tools/elementInteractions.d.ts +40 -0
  88. package/dist/utils/tools/fillField.d.ts +41 -0
  89. package/dist/utils/tools/fillForm.d.ts +49 -0
  90. package/dist/utils/tools/goToAElmLink.d.ts +27 -0
  91. package/dist/utils/tools/highlight.d.ts +23 -0
  92. package/dist/utils/tools/highlightThenClick.d.ts +31 -0
  93. package/dist/utils/tools/hover.d.ts +23 -0
  94. package/dist/utils/tools/hoverThenClick.d.ts +37 -0
  95. package/dist/utils/tools/markWorkflowComplete.d.ts +18 -0
  96. package/dist/utils/tools/navigateTo.d.ts +23 -0
  97. package/dist/utils/tools/refresh.d.ts +19 -0
  98. package/dist/utils/tools/scroll.d.ts +32 -0
  99. package/dist/utils/tools/toolRegistry.d.ts +53 -0
  100. package/dist/utils/tools/workflowToolBridge.d.ts +15 -0
  101. package/dist/utils/webrtcConnection.d.ts +9 -2
  102. package/dist/utils/widgetAuthStore.d.ts +9 -0
  103. package/dist/utils/widgetBearerStorage.d.ts +16 -0
  104. package/dist/utils/widgetSession.d.ts +20 -0
  105. package/dist/utils/widgetWorkspaces.d.ts +10 -0
  106. package/dist/utils/workflowSteer.d.ts +6 -0
  107. package/dist/utils/workspaceCatalog.d.ts +24 -0
  108. package/dist/visualContext/VisualContextScheduler.d.ts +48 -2
  109. package/dist/visualContext/domChangeTracker.d.ts +29 -0
  110. package/dist/visualContext/imageHash.d.ts +19 -0
  111. package/dist/visualContext/index.d.ts +3 -3
  112. package/dist/visualContext/types.d.ts +32 -2
  113. package/dist/visualContext/useVisualContext.d.ts +23 -8
  114. package/package.json +73 -69
  115. package/dist/components/AnimatedSettingsItem.d.ts +0 -9
  116. package/dist/components/ResetButton.d.ts +0 -9
  117. package/dist/components/SettingsMenu.d.ts +0 -16
  118. package/dist/components/SettingsToggle.d.ts +0 -7
  119. package/dist/components/TranscriptToggle.d.ts +0 -7
  120. package/dist/utils/elementInteractions.d.ts +0 -127
  121. package/dist/utils/goToAElmLink.d.ts +0 -1
  122. package/dist/utils/highlightThenClick.d.ts +0 -2
  123. package/dist/utils/hover.d.ts +0 -2
  124. package/dist/utils/hoverThenClick.d.ts +0 -2
  125. package/dist/utils/toolRegistry.d.ts +0 -33
  126. package/dist/utils/workflow.d.ts +0 -62
  127. package/dist/visualContext/debug-overlay.d.ts +0 -10
package/README.md CHANGED
@@ -18,27 +18,35 @@ import ReactDOM from 'react-dom';
18
18
  import GuideAI from 'guideai-app';
19
19
 
20
20
  function App() {
21
- return (
22
- <div>
23
- <GuideAI
24
- organizationKey="your-organization-key"
25
- React={React}
26
- ReactDOM={ReactDOM}
27
- position={{ bottom: '20px', right: '20px' }}
28
- />
29
- </div>
30
- );
21
+ return (
22
+ <div>
23
+ <GuideAI
24
+ authKey="your-access-key"
25
+ workspace="your-workspace"
26
+ React={React}
27
+ ReactDOM={ReactDOM}
28
+ position={{ bottom: '20px', right: '20px' }}
29
+ />
30
+ </div>
31
+ );
31
32
  }
32
33
  ```
33
34
 
34
35
  ## Props
35
36
 
36
- | Prop | Type | Required | Description |
37
- |------|------|----------|-------------|
38
- | `organizationKey` | `string` | Yes | Your unique organization key |
39
- | `React` | `React` | Yes | React instance from your application |
40
- | `ReactDOM` | `ReactDOM` | Yes | ReactDOM instance from your application |
41
- | `position` | `object` | No | CSS positioning for the component (see below) |
37
+ | Prop | Type | Required | Description |
38
+ | --------------------------------- | ---------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
+ | `authKey` | `string` | Yes (customer embed) | Widget access key; **not** persisted by the package. Exchanged once for a JWT via `POST /widget/session`. **Do not use React’s reserved `key` attribute** — use this prop name. |
40
+ | `workspace` | `string` | No | Workspace slug when using `authKey` |
41
+ | `adminConversationPersistenceKey` | `string` | No | Optional stable key for transcript `localStorage` isolation. Omit to use a non-secret default from the page **origin** (same across SPA routes). Never use the raw access key here. |
42
+ | `React` | `React` | Yes | React instance from your application |
43
+ | `ReactDOM` | `ReactDOM` | Yes | ReactDOM instance from your application |
44
+ | `position` | `object` | No | CSS positioning for the component (see below) |
45
+ | `environment` | `string` | No | API environment: `'production'` (default), `'development'`, or `'local'` |
46
+ | `transcript` | `object` | No | Transcript panel configuration (see below) |
47
+ | `input` | `object` | No | Text/voice input configuration (see below) |
48
+
49
+ You must pass **`authKey`** (customer integration). For authentication details, see **`AUTHENTICATION.md`** in this package.
42
50
 
43
51
  ## Position Object
44
52
 
@@ -67,46 +75,133 @@ position?: {
67
75
  ### Position Examples
68
76
 
69
77
  **Bottom-right corner:**
78
+
70
79
  ```jsx
71
- <GuideAI
72
- organizationKey="your-org-key"
73
- React={React}
74
- ReactDOM={ReactDOM}
75
- position={{ bottom: '20px', right: '20px' }}
80
+ <GuideAI
81
+ authKey="your-access-key"
82
+ React={React}
83
+ ReactDOM={ReactDOM}
84
+ position={{ bottom: '20px', right: '20px' }}
76
85
  />
77
86
  ```
78
87
 
79
88
  **Bottom-left corner:**
89
+
80
90
  ```jsx
81
- <GuideAI
82
- organizationKey="your-org-key"
83
- React={React}
84
- ReactDOM={ReactDOM}
85
- position={{ bottom: '20px', left: '20px' }}
91
+ <GuideAI
92
+ authKey="your-access-key"
93
+ React={React}
94
+ ReactDOM={ReactDOM}
95
+ position={{ bottom: '20px', left: '20px' }}
86
96
  />
87
97
  ```
88
98
 
89
99
  **Centered at bottom:**
100
+
90
101
  ```jsx
91
- <GuideAI
92
- organizationKey="your-org-key"
93
- React={React}
94
- ReactDOM={ReactDOM}
95
- position={{
96
- bottom: '20px',
97
- left: '50%',
98
- transform: 'translateX(-50%)'
99
- }}
102
+ <GuideAI
103
+ authKey="your-access-key"
104
+ React={React}
105
+ ReactDOM={ReactDOM}
106
+ position={{
107
+ bottom: '20px',
108
+ left: '50%',
109
+ transform: 'translateX(-50%)',
110
+ }}
100
111
  />
101
112
  ```
102
113
 
103
114
  **Top-right corner:**
115
+
104
116
  ```jsx
105
117
  <GuideAI
106
- organizationKey="your-org-key"
107
- React={React}
108
- ReactDOM={ReactDOM}
109
- position={{ top: '20px', right: '20px' }}
118
+ authKey="your-access-key"
119
+ React={React}
120
+ ReactDOM={ReactDOM}
121
+ position={{ top: '20px', right: '20px' }}
122
+ />
123
+ ```
124
+
125
+ ## Transcript Object
126
+
127
+ The `transcript` prop controls the conversation transcript panel:
128
+
129
+ ```typescript
130
+ transcript?: {
131
+ enabled?: boolean; // Whether to show transcript (default: true)
132
+ position?: 'right' | 'left'; // Which side of the button (default: 'right')
133
+ }
134
+ ```
135
+
136
+ ### Transcript Examples
137
+
138
+ **Disable transcript panel:**
139
+
140
+ ```jsx
141
+ <GuideAI
142
+ authKey="your-access-key"
143
+ React={React}
144
+ ReactDOM={ReactDOM}
145
+ transcript={{ enabled: false }}
146
+ />
147
+ ```
148
+
149
+ **Show transcript on the left:**
150
+
151
+ ```jsx
152
+ <GuideAI
153
+ authKey="your-access-key"
154
+ React={React}
155
+ ReactDOM={ReactDOM}
156
+ transcript={{ position: 'left' }}
157
+ />
158
+ ```
159
+
160
+ ## Input Object
161
+
162
+ The `input` prop configures text and voice input options:
163
+
164
+ ```typescript
165
+ input?: {
166
+ enableTextInput?: boolean; // Show text input option (default: true)
167
+ showInputToggle?: boolean; // Show voice/text toggle button (default: true)
168
+ defaultMode?: 'voice' | 'text'; // Default input mode (default: 'voice')
169
+ placeholder?: string; // Placeholder text for text input (default: 'Type your message...')
170
+ }
171
+ ```
172
+
173
+ ### Input Examples
174
+
175
+ **Text-only mode:**
176
+
177
+ ```jsx
178
+ <GuideAI
179
+ authKey="your-access-key"
180
+ React={React}
181
+ ReactDOM={ReactDOM}
182
+ input={{ defaultMode: 'text', showInputToggle: false }}
183
+ />
184
+ ```
185
+
186
+ **Disable text input (voice only):**
187
+
188
+ ```jsx
189
+ <GuideAI
190
+ authKey="your-access-key"
191
+ React={React}
192
+ ReactDOM={ReactDOM}
193
+ input={{ enableTextInput: false }}
194
+ />
195
+ ```
196
+
197
+ **Custom placeholder text:**
198
+
199
+ ```jsx
200
+ <GuideAI
201
+ authKey="your-access-key"
202
+ React={React}
203
+ ReactDOM={ReactDOM}
204
+ input={{ placeholder: 'Ask me anything...' }}
110
205
  />
111
206
  ```
112
207
 
@@ -116,8 +211,8 @@ Guide AI allows you to customize the microphone button color to match your appli
116
211
 
117
212
  ### Available CSS Variable
118
213
 
119
- | Variable | Default | Description |
120
- |----------|---------|-------------|
214
+ | Variable | Default | Description |
215
+ | --------------------- | --------- | --------------------- |
121
216
  | `--guideai-mic-color` | `#0000FF` | Microphone icon color |
122
217
 
123
218
  ### Customization Example
@@ -127,30 +222,33 @@ Add this style to your application's CSS file to override the default color:
127
222
  ```css
128
223
  /* Match your brand color */
129
224
  .guideai-icon-wrapper {
130
- --guideai-mic-color: #6366f1; /* Your primary brand color */
225
+ --guideai-mic-color: #6366f1; /* Your primary brand color */
131
226
  }
132
227
  ```
133
228
 
134
229
  ### Brand Matching Examples
135
230
 
136
231
  **Purple/Indigo Theme:**
232
+
137
233
  ```css
138
234
  .guideai-icon-wrapper {
139
- --guideai-mic-color: #8b5cf6;
235
+ --guideai-mic-color: #8b5cf6;
140
236
  }
141
237
  ```
142
238
 
143
239
  **Green/Eco Theme:**
240
+
144
241
  ```css
145
242
  .guideai-icon-wrapper {
146
- --guideai-mic-color: #059669;
243
+ --guideai-mic-color: #059669;
147
244
  }
148
245
  ```
149
246
 
150
247
  **Dark/Monochrome Theme:**
248
+
151
249
  ```css
152
250
  .guideai-icon-wrapper {
153
- --guideai-mic-color: #ffffff;
251
+ --guideai-mic-color: #ffffff;
154
252
  }
155
253
  ```
156
254
 
@@ -159,30 +257,32 @@ Add this style to your application's CSS file to override the default color:
159
257
  If Guide AI components conflict with modals or other overlays on your site, you can customize the z-index value for all components using a single `zIndex` parameter. All GuideAI components will use this base value, with the onboarding modal appearing one level above (zIndex + 1).
160
258
 
161
259
  **Custom z-index value:**
260
+
162
261
  ```jsx
163
262
  <GuideAI
164
- organizationKey="your-org-key"
165
- React={React}
166
- ReactDOM={ReactDOM}
167
- position={{
168
- bottom: '20px',
169
- right: '20px',
170
- zIndex: 5000 // All components use 5000, onboarding modal uses 5001
171
- }}
263
+ authKey="your-access-key"
264
+ React={React}
265
+ ReactDOM={ReactDOM}
266
+ position={{
267
+ bottom: '20px',
268
+ right: '20px',
269
+ zIndex: 5000, // All components use 5000, onboarding modal uses 5001
270
+ }}
172
271
  />
173
272
  ```
174
273
 
175
274
  **Positioning with z-index configuration:**
275
+
176
276
  ```jsx
177
277
  <GuideAI
178
- organizationKey="your-org-key"
179
- React={React}
180
- ReactDOM={ReactDOM}
181
- position={{
182
- bottom: '40px',
183
- right: '40px',
184
- zIndex: 2000 // Set base z-index to 2000
185
- }}
278
+ authKey="your-access-key"
279
+ React={React}
280
+ ReactDOM={ReactDOM}
281
+ position={{
282
+ bottom: '40px',
283
+ right: '40px',
284
+ zIndex: 2000, // Set base z-index to 2000
285
+ }}
186
286
  />
187
287
  ```
188
288
 
@@ -196,31 +296,30 @@ import ReactDOM from 'react-dom';
196
296
  import GuideAI from 'guideai-app';
197
297
 
198
298
  function App() {
199
- const handleError = (error) => {
200
- console.error('GuideAI Error:', error);
201
- // Add your custom error handling here
202
- };
203
-
204
- return (
205
- <div className="app">
206
- <h1>My Application</h1>
207
-
208
- <GuideAI
209
- organizationKey="your-organization-key"
210
- React={React}
211
- ReactDOM={ReactDOM}
212
- position={{ bottom: '40px', right: '40px' }}
213
- />
214
- </div>
215
- );
299
+ return (
300
+ <div className="app">
301
+ <h1>My Application</h1>
302
+
303
+ <GuideAI
304
+ authKey="your-access-key"
305
+ workspace="your-workspace"
306
+ environment="production"
307
+ React={React}
308
+ ReactDOM={ReactDOM}
309
+ position={{ bottom: '40px', right: '40px' }}
310
+ transcript={{ position: 'right' }}
311
+ input={{ defaultMode: 'voice' }}
312
+ />
313
+ </div>
314
+ );
216
315
  }
217
316
 
218
317
  export default App;
219
318
  ```
220
319
 
221
- ## Getting Your Organization Key
320
+ ## Getting Your Access Key
222
321
 
223
- To use Guide AI, you'll need an organization key. Contact the Guide AI team to get your key and set up your organization.
322
+ To use Guide AI, you'll need an access key and workspace slug. Contact the Guide AI team to get set up.
224
323
 
225
324
  ## Support
226
325
 
package/dist/GuideAI.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { GuideAIProps } from './types/GuideAI.types';
2
- declare const GuideAI: (props: GuideAIProps) => import("react").JSX.Element;
2
+ declare const GuideAI: (props: GuideAIProps) => import("react").JSX.Element | null;
3
3
  export default GuideAI;