guideai-app 0.5.4-1 → 0.5.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/README.md +111 -1
- package/dist/GuideAI.d.ts +2 -2
- package/dist/GuideAI.js +1 -1
- package/dist/GuideAI.js.LICENSE.txt +2 -17
- package/dist/components/AgentTestRunnerPanel.d.ts +22 -0
- package/dist/components/AudioConfigDialog.d.ts +3 -1
- package/dist/components/DeveloperTools.d.ts +19 -10
- package/dist/components/Microphone.d.ts +10 -1
- package/dist/components/PlaybackInterruptLockDebugOverlay.d.ts +3 -1
- package/dist/components/PlaybackLockDebugOverlayRoot.d.ts +3 -2
- package/dist/components/SessionRatingPopup.d.ts +16 -0
- package/dist/components/SubtitleInputBar.d.ts +23 -0
- package/dist/components/SubtitleSettingsMenu.d.ts +9 -0
- package/dist/components/TranscriptBox.d.ts +11 -18
- package/dist/components/TranscriptSessionMicLevels.d.ts +8 -0
- package/dist/components/TranscriptStudioChrome.d.ts +32 -0
- package/dist/components/TranscriptTextInput.d.ts +4 -12
- package/dist/components/TranscriptToolbar.d.ts +3 -1
- package/dist/components/TranscriptWorkflowDrawer.d.ts +5 -7
- package/dist/contexts/GuideAIThemeContext.d.ts +13 -0
- package/dist/devtools/DeveloperToolsShell.d.ts +20 -0
- package/dist/devtools/TranscriptDeveloperToolsMenuItems.d.ts +45 -0
- package/dist/devtools/TranscriptUiDevtoolsPanel.d.ts +10 -0
- package/dist/devtools/adminToolDiagnostics/AdminToolDiagnosticsPanel.d.ts +8 -1
- package/dist/devtools/adminToolDiagnostics/adminToolDiagnosticsPanelUtils.d.ts +1 -4
- package/dist/devtools/audioConfigDefaultLockUi.d.ts +12 -0
- package/dist/devtools/developerToolPanelId.d.ts +8 -0
- package/dist/devtools/developerToolsShellStyles.d.ts +5 -0
- package/dist/devtools/developerToolsTabIcons.d.ts +4 -0
- package/dist/devtools/devtoolsAdminPortalLinks.d.ts +11 -0
- package/dist/devtools/devtoolsAuth/DevtoolsAuthContext.d.ts +14 -0
- package/dist/devtools/devtoolsAuth/DevtoolsLoginModal.d.ts +13 -0
- package/dist/devtools/devtoolsAuth/devtoolsAccessTrigger.d.ts +9 -0
- package/dist/devtools/devtoolsAuth/devtoolsAdminApi.d.ts +13 -0
- package/dist/devtools/devtoolsAuth/devtoolsLoginModalStyles.d.ts +1 -0
- package/dist/devtools/devtoolsAuth/devtoolsPortalLogin.d.ts +15 -0
- package/dist/devtools/devtoolsAuth/devtoolsSessionStorage.d.ts +4 -0
- package/dist/devtools/devtoolsAuth/index.d.ts +9 -0
- package/dist/devtools/devtoolsAuth/types.d.ts +21 -0
- package/dist/devtools/devtoolsAuth/useDevtoolsAccess.d.ts +33 -0
- package/dist/devtools/devtoolsThemePreference.d.ts +3 -0
- package/dist/devtools/excavator/ExcavatorPanel.d.ts +17 -0
- package/dist/devtools/excavator/excavatorPanelStyles.d.ts +5 -0
- package/dist/devtools/excavator/excavatorSse.d.ts +6 -0
- package/dist/devtools/learn/LearnCaptureChrome.stub.d.ts +3 -0
- package/dist/devtools/learn/LearnModePanel.d.ts +18 -0
- package/dist/devtools/learn/LearnModePanel.stub.d.ts +3 -0
- package/dist/devtools/learn/LearnOrchestrationHost.d.ts +52 -0
- package/dist/devtools/learn/injectLearnModeStyles.d.ts +2 -0
- package/dist/devtools/learn/learnCaptureChrome.d.ts +33 -0
- package/dist/devtools/learn/learnCaptureLayout.d.ts +26 -0
- package/dist/devtools/learn/learnCaptureToolbar.d.ts +27 -0
- package/dist/devtools/learn/learnClarifyKickoff.d.ts +6 -0
- package/dist/devtools/learn/learnLiteTranscript.d.ts +22 -0
- package/dist/devtools/learn/learnModeStyles.d.ts +5 -0
- package/dist/devtools/learn/learnModeTypes.d.ts +5 -0
- package/dist/devtools/learn/learnOrchestrationStub.d.ts +5 -0
- package/dist/devtools/learn/learnPanelSyncFieldsEqual.d.ts +3 -0
- package/dist/devtools/learn/learnRealtimeSession.d.ts +10 -0
- package/dist/devtools/learn/learnRefBag.d.ts +41 -0
- package/dist/devtools/learn/learnSessionStorage.d.ts +23 -0
- package/dist/devtools/learn/learnWorkspaceContext.d.ts +5 -0
- package/dist/devtools/learn/loadLearnOrchestration.d.ts +10 -0
- package/dist/devtools/learn/useLearnCaptureDuration.d.ts +4 -0
- package/dist/devtools/learn/useLearnClickCapture.d.ts +9 -0
- package/dist/devtools/learn/useLearnMode.d.ts +47 -0
- package/dist/devtools/learn/useLearnMode.stub.d.ts +3 -0
- package/dist/devtools/panelLayout.d.ts +13 -0
- package/dist/devtools/transcriptDevtoolsMenuProps.d.ts +28 -0
- package/dist/devtools/transcriptMoreMenu/DeveloperToolsAdminPortalFlyout.d.ts +20 -0
- package/dist/devtools/transcriptMoreMenu/DeveloperToolsLoggerFlyout.d.ts +16 -0
- package/dist/devtools/transcriptMoreMenu/DeveloperToolsMicPresetFlyout.d.ts +22 -0
- package/dist/devtools/transcriptMoreMenu/TranscriptDeveloperToolsMenuItems.d.ts +21 -0
- package/dist/devtools/transcriptMoreMenu/TranscriptDeveloperToolsThemeFlyout.d.ts +13 -0
- package/dist/devtools/transcriptMoreMenu/TranscriptMoreMenuDevtools.d.ts +27 -0
- package/dist/devtools/transcriptMoreMenu/devtoolsFlyoutTypes.d.ts +1 -0
- package/dist/devtools/transcriptMoreMenu/index.d.ts +2 -0
- package/dist/devtools/transcriptMoreMenu/readWindowGuideAILogger.d.ts +12 -0
- package/dist/devtools/transcriptMoreMenu/useTranscriptMoreMenuDebugFlyouts.d.ts +24 -0
- package/dist/devtools/useDraggableDialog.d.ts +13 -1
- package/dist/devtools/useGuideDeveloperTools.d.ts +64 -0
- package/dist/devtools/useGuideDevtoolsIntegration.d.ts +51 -0
- package/dist/devtools/visualContextInspector/VisualContextInspector.d.ts +2 -0
- package/dist/devtools/workflowTester/WorkflowTesterPanel.d.ts +12 -0
- package/dist/devtools/workflowTester/WorkflowTesterPanel.stub.d.ts +3 -0
- package/dist/devtools/workflowTester/generateWorkflowTestScriptWithGemini.d.ts +18 -0
- package/dist/devtools/workflowTester/index.d.ts +6 -0
- package/dist/devtools/workflowTester/useWorkflowSimulationController.d.ts +12 -0
- package/dist/devtools/workflowTester/useWorkflowSimulationRun.d.ts +47 -0
- package/dist/devtools/workflowTester/workflowSimulationController.d.ts +31 -0
- package/dist/devtools/workflowTester/workflowSimulationDevtoolsApi.d.ts +51 -0
- package/dist/devtools/workflowTester/workflowSimulationRunner.d.ts +46 -0
- package/dist/devtools/workflowTester/workflowSimulationRunnerAi.d.ts +20 -0
- package/dist/devtools/workflowTester/workflowSimulationSessionRestore.d.ts +21 -0
- package/dist/devtools/workflowTester/workflowSimulationTurnState.d.ts +20 -0
- package/dist/devtools/workflowTester/workflowSimulationTypes.d.ts +26 -0
- package/dist/devtools/workflowTester/workflowSimulationWaits.d.ts +55 -0
- package/dist/devtools/workflowTester/workflowTesterPanel.types.d.ts +25 -0
- package/dist/devtools/workflowTester/workflowTesterPanelStyles.d.ts +5 -0
- package/dist/devtools/workflowTester/workflowTesterRunSessionStorage.d.ts +43 -0
- package/dist/devtools/workflowTester/workflowTesterSteerBridge.d.ts +7 -0
- package/dist/devtools/workflowTester/workflowTesterWorkspaceBridge.d.ts +16 -0
- package/dist/hooks/useAgentTestRunnerOverlay.d.ts +12 -0
- package/dist/hooks/useAssistantPlaybackMute.d.ts +3 -1
- package/dist/hooks/useAudioConfigSurface.d.ts +2 -6
- package/dist/hooks/useConversationSession.d.ts +14 -2
- package/dist/hooks/useGuideAIMutePipeline.d.ts +29 -0
- package/dist/hooks/useGuideAIThemeState.d.ts +6 -0
- package/dist/hooks/useHostUserInfoSync.d.ts +7 -0
- package/dist/hooks/useMicMute.d.ts +4 -1
- package/dist/hooks/useSessionRating.d.ts +25 -0
- package/dist/hooks/useSilentRealtimeSessionNotes.d.ts +20 -0
- package/dist/hooks/useSubtitleAppearancePrefs.d.ts +5 -0
- package/dist/hooks/useThemePortalProps.d.ts +4 -0
- package/dist/hooks/useTranscriptChrome.d.ts +7 -2
- package/dist/hooks/useTranscriptDisplayMode.d.ts +6 -0
- package/dist/hooks/useTranscriptPanelDragResize.d.ts +47 -0
- package/dist/hooks/useWebRTC.d.ts +3 -0
- package/dist/hooks/useWidgetWorkflowSession.d.ts +2 -0
- package/dist/hooks/useWorkflowTesterOverlay.d.ts +22 -0
- package/dist/hooks/useWorkspaceCatalog.d.ts +1 -0
- package/dist/index.d.ts +7 -3
- package/dist/playwrightSimulationHarness.d.ts +16 -0
- package/dist/playwrightSimulationHarness.js +1 -0
- package/dist/playwrightToolHarness.js +1 -2
- package/dist/sessionRating.defaults.d.ts +4 -0
- package/dist/sessionRatingPrompts.d.ts +3 -0
- package/dist/staticContext/useStaticContext.d.ts +0 -1
- package/dist/stubs/workspaces.d.ts +2 -2
- package/dist/styles/guideAIThemeTokens.d.ts +5 -0
- package/dist/styles/guideaiTestsiteWidgetTheme.d.ts +6 -0
- package/dist/themes/buildThemeCss.d.ts +8 -0
- package/dist/themes/guideAIThemeIds.d.ts +5 -0
- package/dist/themes/presetThemes.d.ts +10 -0
- package/dist/themes/syncGuideAITheme.d.ts +2 -0
- package/dist/themes/themeTokens.types.d.ts +37 -0
- package/dist/types/GuideAI.types.d.ts +37 -4
- package/dist/utils/api.d.ts +25 -9
- package/dist/utils/api.learn.d.ts +18 -0
- package/dist/utils/constants.d.ts +2 -3
- package/dist/utils/conversationContextSwitch.d.ts +41 -0
- package/dist/utils/conversationManager.d.ts +66 -0
- package/dist/utils/dataChannel.d.ts +8 -0
- package/dist/utils/dataChannelHelpers.d.ts +28 -0
- package/dist/utils/guideAIEvents.d.ts +1 -0
- package/dist/utils/guideaiMirroredStorageKeys.d.ts +33 -0
- package/dist/utils/hostUserIdentity.d.ts +21 -0
- package/dist/utils/lastSystemToolCall.d.ts +2 -1
- package/dist/utils/localStorageHelper.d.ts +62 -17
- package/dist/utils/messageStorage.d.ts +0 -7
- package/dist/utils/parseWorkspaceSlugList.d.ts +12 -0
- package/dist/utils/pathIncludesAnyRef.d.ts +12 -0
- package/dist/utils/sessionRatingThrottle.d.ts +3 -0
- package/dist/utils/sessionRealtimeNotes.d.ts +11 -0
- package/dist/utils/themeRegistry.d.ts +14 -0
- package/dist/utils/tools/clickElement.d.ts +1 -1
- package/dist/utils/tools/descriptionToHighlightSelector.d.ts +1 -1
- package/dist/utils/tools/docToForm.d.ts +2 -2
- package/dist/utils/tools/elementInteractions.d.ts +27 -5
- package/dist/utils/tools/elementToBestInteractionSelector.d.ts +10 -0
- package/dist/utils/tools/isGuideAiDomChrome.d.ts +6 -0
- package/dist/utils/tools/markWorkflowComplete.d.ts +18 -0
- package/dist/utils/tools/selectWorkflow.d.ts +42 -0
- package/dist/utils/tools/setAssistantPlaybackMuted.d.ts +33 -0
- package/dist/utils/tools/setMicrophoneMuted.d.ts +35 -0
- package/dist/utils/tools/workflowToolBridge.d.ts +18 -1
- package/dist/utils/transcriptDisplayModePref.d.ts +4 -0
- package/dist/utils/transcriptFloatGeometry.d.ts +78 -0
- package/dist/utils/transcriptSubtitleUiPref.d.ts +5 -0
- package/dist/utils/transcriptToolFocusRestore.d.ts +13 -0
- package/dist/utils/ui.d.ts +0 -2
- package/dist/utils/webrtcConnection.d.ts +5 -0
- package/dist/utils/widgetBearerStorage.d.ts +2 -1
- package/dist/utils/workspaceCatalog.d.ts +13 -2
- package/dist/utils/workspaceCatalogFatal.d.ts +4 -0
- package/dist/visualContext/defaultProvider.d.ts +4 -10
- package/dist/visualContext/visualContextCaptureLock.d.ts +17 -0
- package/package.json +4 -7
- package/dist/GuideAI.js.map +0 -1
- package/dist/playwrightToolHarness.js.map +0 -1
package/README.md
CHANGED
|
@@ -37,7 +37,10 @@ function App() {
|
|
|
37
37
|
| Prop | Type | Required | Description |
|
|
38
38
|
| --------------------------------- | ---------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
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 |
|
|
40
|
+
| `workspace` | `string` | No | Default workspace **slug** for the first realtime session (single value). Forwarded on `/initialize`. Omit to use the customer default. When used with `workspaces`, pick a slug from that allowlist. |
|
|
41
|
+
| `workspaces` | `string` or `string[]` | No | Catalog allowlist: limits which workspaces (and their workflows) end users can access. Omit for all customer workspaces. Comma-separated string (`"sales,support"`) or array. Invalid/empty allowlist removes the widget and logs `console.error`. |
|
|
42
|
+
| `getUserInfo` | `function` | No | Lets Guide AI know who is signed in on your app (see **Signed-in users** below). |
|
|
43
|
+
| `initializeUserId` | `string` | No | Advanced: optional fixed user id when you manage identity yourself. |
|
|
41
44
|
| `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
45
|
| `React` | `React` | Yes | React instance from your application |
|
|
43
46
|
| `ReactDOM` | `ReactDOM` | Yes | ReactDOM instance from your application |
|
|
@@ -45,9 +48,71 @@ function App() {
|
|
|
45
48
|
| `environment` | `string` | No | API environment: `'production'` (default), `'development'`, or `'local'` |
|
|
46
49
|
| `transcript` | `object` | No | Transcript panel configuration (see below) |
|
|
47
50
|
| `input` | `object` | No | Text/voice input configuration (see below) |
|
|
51
|
+
| `theme` | `string` | No | Built-in color theme preset id (see **Themes** below). Omit for the package default palette. |
|
|
48
52
|
|
|
49
53
|
You must pass **`authKey`** (customer integration). For authentication details, see **`AUTHENTICATION.md`** in this package.
|
|
50
54
|
|
|
55
|
+
## Themes
|
|
56
|
+
|
|
57
|
+
Set the widget color palette with the `theme` prop. All presets are bundled in `guideai-app`; no extra scripts or CDN files are required.
|
|
58
|
+
|
|
59
|
+
```jsx
|
|
60
|
+
<GuideAI
|
|
61
|
+
authKey="your-access-key"
|
|
62
|
+
workspace="your-workspace"
|
|
63
|
+
React={React}
|
|
64
|
+
ReactDOM={ReactDOM}
|
|
65
|
+
theme="dark"
|
|
66
|
+
/>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Role-based catalog example:
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
<GuideAI
|
|
73
|
+
authKey={accessKey}
|
|
74
|
+
workspace="support"
|
|
75
|
+
workspaces={user.role === 'admin' ? 'admin,support' : 'support'}
|
|
76
|
+
React={React}
|
|
77
|
+
ReactDOM={ReactDOM}
|
|
78
|
+
/>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Omit `theme` (or pass `null`) to use the default package palette (**Studio blue**).
|
|
82
|
+
|
|
83
|
+
### Light themes
|
|
84
|
+
|
|
85
|
+
| `theme` id | Name |
|
|
86
|
+
| -------------- | ----- |
|
|
87
|
+
| `light-ivory` | Ivory |
|
|
88
|
+
| `light-snow` | Snow |
|
|
89
|
+
| `light-sand` | Sand |
|
|
90
|
+
| `light-mist` | Mist |
|
|
91
|
+
| `light-mint` | Mint |
|
|
92
|
+
| `light-sky` | Sky |
|
|
93
|
+
| `light-coral` | Coral |
|
|
94
|
+
| `light-rose` | Rose |
|
|
95
|
+
| `light-plum` | Plum |
|
|
96
|
+
| `light-slate` | Slate |
|
|
97
|
+
|
|
98
|
+
### Dark themes
|
|
99
|
+
|
|
100
|
+
| `theme` id | Name |
|
|
101
|
+
| ----------------- | ------------ |
|
|
102
|
+
| `dark` | Studio blue |
|
|
103
|
+
| `dark-muted-gray` | Muted gray |
|
|
104
|
+
| `dark-midnight` | Midnight |
|
|
105
|
+
| `dark-ocean` | Ocean |
|
|
106
|
+
| `dark-forest` | Forest |
|
|
107
|
+
| `dark-teal` | Teal |
|
|
108
|
+
| `dark-violet` | Violet |
|
|
109
|
+
| `dark-ember` | Ember |
|
|
110
|
+
| `dark-carbon` | Carbon |
|
|
111
|
+
| `dark-ruby` | Ruby |
|
|
112
|
+
| `dark-graphite` | Graphite |
|
|
113
|
+
|
|
114
|
+
TypeScript hosts can import `GuideAIThemeId` or `GUIDEAI_THEME_IDS` from `guideai-app`. Labels are also available on `GUIDEAI_PRESET_THEMES`.
|
|
115
|
+
|
|
51
116
|
## Position Object
|
|
52
117
|
|
|
53
118
|
The `position` prop accepts an object with CSS positioning properties to control where the Guide AI button appears on your page, as well as z-index configuration for all Guide AI components:
|
|
@@ -317,6 +382,51 @@ function App() {
|
|
|
317
382
|
export default App;
|
|
318
383
|
```
|
|
319
384
|
|
|
385
|
+
## Signed-in users (`getUserInfo`)
|
|
386
|
+
|
|
387
|
+
If people can sign in on your site, pass **`getUserInfo`** so Guide AI can treat them as the same person across visits and tie voice sessions to their account.
|
|
388
|
+
|
|
389
|
+
- Your function should return something like **`{ username: user.email }`** when someone is logged in. Use whatever stable string identifies them (often an email).
|
|
390
|
+
- When **no one is logged in yet**, you can **`return null`** (or omit **`username`**) so Guide AI keeps a normal anonymous experience without rotating identities on every check.
|
|
391
|
+
- After login or logout, you can notify Guide AI right away by dispatching **`GUIDEAI_HOST_USERINFO_REFRESH_EVENT`** on `window` (import it from `guideai-app` alongside the component).
|
|
392
|
+
|
|
393
|
+
Wrap **`getUserInfo`** in **`useCallback`** so it doesn’t change every render.
|
|
394
|
+
|
|
395
|
+
More detail for integrations lives in **`docs/WIDGET_USER_IDENTITY.md`** and **`AUTHENTICATION.md`**.
|
|
396
|
+
|
|
397
|
+
### Example
|
|
398
|
+
|
|
399
|
+
```jsx
|
|
400
|
+
import React, { useCallback } from 'react';
|
|
401
|
+
import ReactDOM from 'react-dom';
|
|
402
|
+
import GuideAI, { GUIDEAI_HOST_USERINFO_REFRESH_EVENT } from 'guideai-app';
|
|
403
|
+
|
|
404
|
+
function App({ currentUser }) {
|
|
405
|
+
const getUserInfo = useCallback(() => {
|
|
406
|
+
if (!currentUser) return null;
|
|
407
|
+
|
|
408
|
+
return {
|
|
409
|
+
username: currentUser.email,
|
|
410
|
+
displayName: currentUser.name,
|
|
411
|
+
};
|
|
412
|
+
}, [currentUser]);
|
|
413
|
+
|
|
414
|
+
// Optional: after your auth state changes, run:
|
|
415
|
+
// window.dispatchEvent(new CustomEvent(GUIDEAI_HOST_USERINFO_REFRESH_EVENT));
|
|
416
|
+
|
|
417
|
+
return (
|
|
418
|
+
<GuideAI
|
|
419
|
+
authKey="your-access-key"
|
|
420
|
+
workspace="your-workspace"
|
|
421
|
+
React={React}
|
|
422
|
+
ReactDOM={ReactDOM}
|
|
423
|
+
getUserInfo={getUserInfo}
|
|
424
|
+
position={{ bottom: '20px', right: '20px' }}
|
|
425
|
+
/>
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
```
|
|
429
|
+
|
|
320
430
|
## Getting Your Access Key
|
|
321
431
|
|
|
322
432
|
To use Guide AI, you'll need an access key and workspace slug. Contact the Guide AI team to get set up.
|
package/dist/GuideAI.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GuideAIProps } from './types/GuideAI.types';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const GuideAIComponent: (props: GuideAIProps) => import("react").JSX.Element | null;
|
|
3
|
+
export default GuideAIComponent;
|