guideai-app 0.5.4-2 → 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.
Files changed (148) hide show
  1. package/README.md +64 -1
  2. package/dist/GuideAI.d.ts +2 -5
  3. package/dist/GuideAI.js +1 -1
  4. package/dist/GuideAI.js.LICENSE.txt +2 -17
  5. package/dist/components/DeveloperTools.d.ts +5 -3
  6. package/dist/components/Microphone.d.ts +10 -1
  7. package/dist/components/PlaybackLockDebugOverlayRoot.d.ts +1 -1
  8. package/dist/components/SessionRatingPopup.d.ts +16 -0
  9. package/dist/components/SubtitleInputBar.d.ts +23 -0
  10. package/dist/components/SubtitleSettingsMenu.d.ts +9 -0
  11. package/dist/components/TranscriptBox.d.ts +11 -12
  12. package/dist/components/TranscriptSessionMicLevels.d.ts +8 -0
  13. package/dist/components/TranscriptStudioChrome.d.ts +8 -7
  14. package/dist/components/TranscriptTextInput.d.ts +4 -12
  15. package/dist/components/TranscriptToolbar.d.ts +3 -1
  16. package/dist/components/TranscriptWorkflowDrawer.d.ts +5 -7
  17. package/dist/contexts/GuideAIThemeContext.d.ts +13 -0
  18. package/dist/devtools/DeveloperToolsShell.d.ts +1 -1
  19. package/dist/devtools/TranscriptDeveloperToolsMenuItems.d.ts +45 -0
  20. package/dist/devtools/TranscriptUiDevtoolsPanel.d.ts +10 -0
  21. package/dist/devtools/adminToolDiagnostics/AdminToolDiagnosticsPanel.d.ts +1 -1
  22. package/dist/devtools/developerToolPanelId.d.ts +1 -1
  23. package/dist/devtools/devtoolsAdminPortalLinks.d.ts +11 -0
  24. package/dist/devtools/devtoolsAuth/DevtoolsAuthContext.d.ts +14 -0
  25. package/dist/devtools/devtoolsAuth/DevtoolsLoginModal.d.ts +13 -0
  26. package/dist/devtools/devtoolsAuth/devtoolsAccessTrigger.d.ts +9 -0
  27. package/dist/devtools/devtoolsAuth/devtoolsAdminApi.d.ts +13 -0
  28. package/dist/devtools/devtoolsAuth/devtoolsLoginModalStyles.d.ts +1 -0
  29. package/dist/devtools/devtoolsAuth/devtoolsPortalLogin.d.ts +15 -0
  30. package/dist/devtools/devtoolsAuth/devtoolsSessionStorage.d.ts +4 -0
  31. package/dist/devtools/devtoolsAuth/index.d.ts +9 -0
  32. package/dist/devtools/devtoolsAuth/types.d.ts +21 -0
  33. package/dist/devtools/devtoolsAuth/useDevtoolsAccess.d.ts +33 -0
  34. package/dist/devtools/devtoolsThemePreference.d.ts +3 -0
  35. package/dist/devtools/excavator/ExcavatorPanel.d.ts +17 -0
  36. package/dist/devtools/excavator/excavatorPanelStyles.d.ts +5 -0
  37. package/dist/devtools/excavator/excavatorSse.d.ts +6 -0
  38. package/dist/devtools/learn/LearnCaptureChrome.stub.d.ts +3 -0
  39. package/dist/devtools/learn/LearnModePanel.d.ts +18 -0
  40. package/dist/devtools/learn/LearnModePanel.stub.d.ts +3 -0
  41. package/dist/devtools/learn/LearnOrchestrationHost.d.ts +52 -0
  42. package/dist/devtools/learn/injectLearnModeStyles.d.ts +2 -0
  43. package/dist/devtools/learn/learnCaptureChrome.d.ts +33 -0
  44. package/dist/devtools/learn/learnCaptureLayout.d.ts +26 -0
  45. package/dist/devtools/learn/learnCaptureToolbar.d.ts +27 -0
  46. package/dist/devtools/learn/learnClarifyKickoff.d.ts +6 -0
  47. package/dist/devtools/learn/learnLiteTranscript.d.ts +22 -0
  48. package/dist/devtools/learn/learnModeStyles.d.ts +5 -0
  49. package/dist/devtools/learn/learnModeTypes.d.ts +5 -0
  50. package/dist/devtools/learn/learnOrchestrationStub.d.ts +5 -0
  51. package/dist/devtools/learn/learnPanelSyncFieldsEqual.d.ts +3 -0
  52. package/dist/devtools/learn/learnRealtimeSession.d.ts +10 -0
  53. package/dist/devtools/learn/learnRefBag.d.ts +41 -0
  54. package/dist/devtools/learn/learnSessionStorage.d.ts +23 -0
  55. package/dist/devtools/learn/learnWorkspaceContext.d.ts +5 -0
  56. package/dist/devtools/learn/loadLearnOrchestration.d.ts +10 -0
  57. package/dist/devtools/learn/useLearnCaptureDuration.d.ts +4 -0
  58. package/dist/devtools/learn/useLearnClickCapture.d.ts +9 -0
  59. package/dist/devtools/learn/useLearnMode.d.ts +47 -0
  60. package/dist/devtools/learn/useLearnMode.stub.d.ts +3 -0
  61. package/dist/devtools/panelLayout.d.ts +6 -0
  62. package/dist/devtools/transcriptDevtoolsMenuProps.d.ts +28 -0
  63. package/dist/devtools/transcriptMoreMenu/DeveloperToolsAdminPortalFlyout.d.ts +20 -0
  64. package/dist/devtools/transcriptMoreMenu/DeveloperToolsLoggerFlyout.d.ts +16 -0
  65. package/dist/devtools/transcriptMoreMenu/DeveloperToolsMicPresetFlyout.d.ts +22 -0
  66. package/dist/devtools/transcriptMoreMenu/TranscriptDeveloperToolsMenuItems.d.ts +21 -0
  67. package/dist/devtools/transcriptMoreMenu/TranscriptDeveloperToolsThemeFlyout.d.ts +13 -0
  68. package/dist/devtools/transcriptMoreMenu/TranscriptMoreMenuDevtools.d.ts +27 -0
  69. package/dist/devtools/transcriptMoreMenu/devtoolsFlyoutTypes.d.ts +1 -0
  70. package/dist/devtools/transcriptMoreMenu/index.d.ts +2 -0
  71. package/dist/devtools/transcriptMoreMenu/readWindowGuideAILogger.d.ts +12 -0
  72. package/dist/devtools/transcriptMoreMenu/useTranscriptMoreMenuDebugFlyouts.d.ts +24 -0
  73. package/dist/devtools/useDraggableDialog.d.ts +8 -1
  74. package/dist/devtools/useGuideDeveloperTools.d.ts +16 -7
  75. package/dist/devtools/useGuideDevtoolsIntegration.d.ts +51 -0
  76. package/dist/devtools/workflowTester/WorkflowTesterPanel.d.ts +4 -28
  77. package/dist/devtools/workflowTester/WorkflowTesterPanel.stub.d.ts +3 -0
  78. package/dist/devtools/workflowTester/index.d.ts +1 -2
  79. package/dist/devtools/workflowTester/useWorkflowSimulationController.d.ts +12 -0
  80. package/dist/devtools/workflowTester/useWorkflowSimulationRun.d.ts +47 -0
  81. package/dist/devtools/workflowTester/workflowSimulationController.d.ts +31 -0
  82. package/dist/devtools/workflowTester/workflowSimulationDevtoolsApi.d.ts +51 -0
  83. package/dist/devtools/workflowTester/workflowSimulationRunner.d.ts +46 -0
  84. package/dist/devtools/workflowTester/workflowSimulationRunnerAi.d.ts +20 -0
  85. package/dist/devtools/workflowTester/workflowSimulationSessionRestore.d.ts +21 -0
  86. package/dist/devtools/workflowTester/workflowSimulationTurnState.d.ts +20 -0
  87. package/dist/devtools/workflowTester/workflowSimulationTypes.d.ts +26 -0
  88. package/dist/devtools/workflowTester/workflowSimulationWaits.d.ts +55 -0
  89. package/dist/devtools/workflowTester/workflowTesterPanel.types.d.ts +25 -0
  90. package/dist/devtools/workflowTester/workflowTesterRunSessionStorage.d.ts +43 -0
  91. package/dist/devtools/workflowTester/workflowTesterWorkspaceBridge.d.ts +4 -2
  92. package/dist/hooks/useConversationSession.d.ts +14 -2
  93. package/dist/hooks/useGuideAIMutePipeline.d.ts +1 -0
  94. package/dist/hooks/useGuideAIThemeState.d.ts +6 -0
  95. package/dist/hooks/useMicMute.d.ts +1 -0
  96. package/dist/hooks/useSessionRating.d.ts +25 -0
  97. package/dist/hooks/useSubtitleAppearancePrefs.d.ts +5 -0
  98. package/dist/hooks/useThemePortalProps.d.ts +4 -0
  99. package/dist/hooks/useTranscriptChrome.d.ts +7 -2
  100. package/dist/hooks/useTranscriptDisplayMode.d.ts +6 -0
  101. package/dist/hooks/useTranscriptPanelDragResize.d.ts +47 -0
  102. package/dist/hooks/useWebRTC.d.ts +3 -0
  103. package/dist/hooks/useWidgetWorkflowSession.d.ts +2 -0
  104. package/dist/hooks/useWorkflowTesterOverlay.d.ts +7 -0
  105. package/dist/hooks/useWorkspaceCatalog.d.ts +1 -0
  106. package/dist/index.d.ts +4 -1
  107. package/dist/playwrightSimulationHarness.d.ts +16 -0
  108. package/dist/playwrightSimulationHarness.js +1 -0
  109. package/dist/playwrightToolHarness.js +1 -1
  110. package/dist/sessionRating.defaults.d.ts +4 -0
  111. package/dist/sessionRatingPrompts.d.ts +3 -0
  112. package/dist/staticContext/useStaticContext.d.ts +0 -1
  113. package/dist/stubs/workspaces.d.ts +2 -2
  114. package/dist/styles/guideAIThemeTokens.d.ts +5 -0
  115. package/dist/styles/guideaiTestsiteWidgetTheme.d.ts +6 -0
  116. package/dist/themes/buildThemeCss.d.ts +8 -0
  117. package/dist/themes/guideAIThemeIds.d.ts +5 -0
  118. package/dist/themes/presetThemes.d.ts +10 -0
  119. package/dist/themes/syncGuideAITheme.d.ts +2 -0
  120. package/dist/themes/themeTokens.types.d.ts +37 -0
  121. package/dist/types/GuideAI.types.d.ts +22 -3
  122. package/dist/utils/api.d.ts +3 -0
  123. package/dist/utils/api.learn.d.ts +18 -0
  124. package/dist/utils/conversationContextSwitch.d.ts +41 -0
  125. package/dist/utils/conversationManager.d.ts +41 -0
  126. package/dist/utils/dataChannel.d.ts +8 -0
  127. package/dist/utils/dataChannelHelpers.d.ts +10 -0
  128. package/dist/utils/guideaiMirroredStorageKeys.d.ts +33 -0
  129. package/dist/utils/lastSystemToolCall.d.ts +2 -1
  130. package/dist/utils/localStorageHelper.d.ts +46 -21
  131. package/dist/utils/messageStorage.d.ts +0 -7
  132. package/dist/utils/parseWorkspaceSlugList.d.ts +12 -0
  133. package/dist/utils/pathIncludesAnyRef.d.ts +12 -0
  134. package/dist/utils/sessionRatingThrottle.d.ts +3 -0
  135. package/dist/utils/themeRegistry.d.ts +14 -0
  136. package/dist/utils/tools/descriptionToHighlightSelector.d.ts +1 -1
  137. package/dist/utils/tools/docToForm.d.ts +2 -2
  138. package/dist/utils/tools/elementToBestInteractionSelector.d.ts +10 -0
  139. package/dist/utils/transcriptDisplayModePref.d.ts +4 -0
  140. package/dist/utils/transcriptFloatGeometry.d.ts +78 -0
  141. package/dist/utils/transcriptSubtitleUiPref.d.ts +5 -0
  142. package/dist/utils/webrtcConnection.d.ts +5 -0
  143. package/dist/utils/widgetBearerStorage.d.ts +2 -2
  144. package/dist/utils/workspaceCatalog.d.ts +13 -2
  145. package/dist/utils/workspaceCatalogFatal.d.ts +4 -0
  146. package/dist/visualContext/defaultProvider.d.ts +4 -10
  147. package/dist/visualContext/visualContextCaptureLock.d.ts +17 -0
  148. package/package.json +2 -2
@@ -0,0 +1,6 @@
1
+ /** One `data:` JSON payload from the companion SSE stream. */
2
+ export type ExcavatorSseEvent = Record<string, unknown>;
3
+ /**
4
+ * Consume crawler companion `text/event-stream` chat responses (same wire format as `crawler/public/app.js`).
5
+ */
6
+ export declare function consumeExcavatorSseChat(response: Response, onEvent: (ev: ExcavatorSseEvent) => void): Promise<ExcavatorSseEvent | null>;
@@ -0,0 +1,3 @@
1
+ import type { LearnCaptureChromeProps } from './learnCaptureChrome';
2
+ /** No-op when GUIDEAI_STRIP_DEVTOOLS=1 */
3
+ export default function LearnCaptureChromeStub(_props: LearnCaptureChromeProps): null;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { LearnPhase } from './learnModeTypes';
3
+ export interface LearnModePanelProps {
4
+ embedded?: boolean;
5
+ phase: LearnPhase;
6
+ workspaceLabel: string;
7
+ proposedTitle: string;
8
+ onProposedTitleChange: (t: string) => void;
9
+ clarifyDone: boolean;
10
+ onClarifyDone: () => void;
11
+ onStartCapture: () => void | Promise<void>;
12
+ onGenerate: () => void | Promise<void>;
13
+ onCancel: () => void;
14
+ generatedWorkflowId: string | null;
15
+ adminWorkflowUrl: string | null;
16
+ }
17
+ declare const LearnModePanel: ({ embedded, phase, workspaceLabel, proposedTitle, onProposedTitleChange, clarifyDone, onClarifyDone, onStartCapture, onGenerate, onCancel, generatedWorkflowId, adminWorkflowUrl, }: LearnModePanelProps) => React.JSX.Element;
18
+ export default LearnModePanel;
@@ -0,0 +1,3 @@
1
+ import type { LearnModePanelProps } from './LearnModePanel';
2
+ /** No-op when GUIDEAI_STRIP_DEVTOOLS=1 */
3
+ export default function LearnModePanelStub(_props: LearnModePanelProps): null;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import type { MutableRefObject } from 'react';
3
+ import type { ReactHooks } from '../../utils/reactHooks';
4
+ import type { GuideAIEnvironment } from '../../types/GuideAI.types';
5
+ import type { RecordingStatus } from '../../types/GuideAI.types';
6
+ import type { StoredMessage } from '../../utils/messageStorage';
7
+ import type { ConversationManager } from '../../utils/conversationManager';
8
+ import type { DataChannelManager } from '../../utils/dataChannel';
9
+ import type { LearnModePanelProps } from './LearnModePanel';
10
+ import { type UseLearnModeResult } from './useLearnMode';
11
+ import type { LearnRealtimeSessionDeps } from './learnRealtimeSession';
12
+ export type LearnOrchestrationHostProps = {
13
+ hooks: ReactHooks;
14
+ React: typeof import('react');
15
+ ReactDOM?: {
16
+ createPortal: (children: React.ReactNode, container: Element) => React.ReactNode;
17
+ };
18
+ adminAvailable: boolean;
19
+ environment?: GuideAIEnvironment;
20
+ portalToken: string | null;
21
+ workspaceSlug: string;
22
+ workspaceName: string;
23
+ zIndexDevTools: number;
24
+ recordingStatus: RecordingStatus;
25
+ isConnecting: boolean;
26
+ connectionMessage?: string | null;
27
+ hasMic: boolean;
28
+ conversationIdRef: MutableRefObject<string | null>;
29
+ getConversationManager: () => ConversationManager | null;
30
+ getDataChannelManager: () => DataChannelManager | null;
31
+ cleanupWebRTC: () => void;
32
+ realtimeSessionDeps: LearnRealtimeSessionDeps;
33
+ performResetChat: () => void | Promise<void>;
34
+ handleToggleMute: () => void;
35
+ applyMicMuted: (muted: boolean) => void;
36
+ isMuted: boolean;
37
+ isAssistantPlaybackMuted: boolean;
38
+ handleToggleAssistantPlaybackMute: () => void;
39
+ syncTranscriptFromStorage: () => void;
40
+ allMessages: StoredMessage[];
41
+ onLearnFocusEnter?: () => void;
42
+ onLearnFocusExit?: () => void;
43
+ onLearnPanelChange: (learn: LearnModePanelProps) => void;
44
+ onLearnRuntimeChange: (runtime: {
45
+ learnFocusMode: boolean;
46
+ finishClarifying: UseLearnModeResult['finishClarifying'];
47
+ }) => void;
48
+ onDoneClarifyingRef: MutableRefObject<(() => void) | null>;
49
+ openShellOnTabRef: MutableRefObject<((tab: 'learn') => void) | null>;
50
+ closeShell: () => void;
51
+ };
52
+ export declare function LearnOrchestrationHost({ hooks, React, ReactDOM, adminAvailable, environment, portalToken, workspaceSlug, workspaceName, zIndexDevTools, recordingStatus, isConnecting, connectionMessage, hasMic, conversationIdRef, getConversationManager, getDataChannelManager, cleanupWebRTC, realtimeSessionDeps, performResetChat, handleToggleMute, applyMicMuted, isMuted, isAssistantPlaybackMuted, handleToggleAssistantPlaybackMute, syncTranscriptFromStorage, allMessages, onLearnFocusEnter, onLearnFocusExit, onLearnPanelChange, onLearnRuntimeChange, onDoneClarifyingRef, openShellOnTabRef, closeShell, }: LearnOrchestrationHostProps): React.JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ /** Inject learn capture + devtools panel CSS once (first Learn activation). */
2
+ export declare function injectLearnModeStyles(): void;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import type { StoredMessage } from '../../utils/messageStorage';
3
+ import type { LearnPhase } from './learnModeTypes';
4
+ import type { RecordingStatus } from '../../types/GuideAI.types';
5
+ import type { ConversationManager } from '../../utils/conversationManager';
6
+ import type { DataChannelManager } from '../../utils/dataChannel';
7
+ import type { ReactHooks } from '../../utils/reactHooks';
8
+ export type LearnCaptureChromeProps = {
9
+ React: typeof import('react');
10
+ ReactDOM?: {
11
+ createPortal: (children: React.ReactNode, container: Element) => React.ReactNode;
12
+ };
13
+ hooks: ReactHooks;
14
+ phase: LearnPhase;
15
+ capturePausedAt: number | null;
16
+ workspaceLabel: string;
17
+ allMessages: StoredMessage[];
18
+ syncTranscriptFromStorage: () => void;
19
+ onPause: () => void;
20
+ onResume: () => void;
21
+ onStop: () => void | Promise<void>;
22
+ onDoneClarifying: () => void;
23
+ clarifyDone: boolean;
24
+ getConversationManager: () => ConversationManager | null;
25
+ getDataChannelManager: () => DataChannelManager | null;
26
+ recordingStatus: RecordingStatus;
27
+ isConnecting: boolean;
28
+ connectionMessage?: string | null;
29
+ hasMic: boolean;
30
+ zIndex: number;
31
+ };
32
+ declare function LearnCaptureChrome({ React: R, ReactDOM, hooks, phase, capturePausedAt, workspaceLabel, allMessages, syncTranscriptFromStorage, onPause, onResume, onStop, onDoneClarifying, clarifyDone, getConversationManager, getDataChannelManager, recordingStatus, isConnecting, connectionMessage, hasMic, zIndex, }: LearnCaptureChromeProps): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
33
+ export default LearnCaptureChrome;
@@ -0,0 +1,26 @@
1
+ import type { DraggableDialogPosition } from '../useDraggableDialog';
2
+ /** Default width for learn capture chrome; keep in sync with `.guideai-learn-capture-root` in `learnModeStyles.ts`. */
3
+ export declare const LEARN_CAPTURE_PANEL_WIDTH_PX = 420;
4
+ /** Default max height for learn capture chrome; keep in sync with `.guideai-learn-capture-root`. */
5
+ export declare const LEARN_CAPTURE_PANEL_MAX_HEIGHT_PX = 360;
6
+ export declare const LEARN_CAPTURE_MARGIN_PX = 16;
7
+ /** Panel size used for drag clamp (measured when possible). */
8
+ export declare function getLearnCaptureClampExtents(element?: HTMLElement | null): {
9
+ width: number;
10
+ height: number;
11
+ };
12
+ /** Bottom-right default (matches pre-drag fixed placement). */
13
+ export declare function getDefaultLearnCapturePosition(): DraggableDialogPosition;
14
+ /** Clamp a stored / dragged position so the full panel (incl. toolbar) stays on-screen. */
15
+ export declare function clampLearnCapturePosition(position: DraggableDialogPosition, element?: HTMLElement | null): DraggableDialogPosition;
16
+ /** Bottom offset from viewport bottom for a top-anchored panel box. */
17
+ export declare function learnCaptureBottomFromTop(top: number, panelHeight: number): number;
18
+ /**
19
+ * Clamp while preserving the panel bottom edge (transcript growth expands upward).
20
+ * Returns settled `top` for drag state/localStorage and `bottom` for fixed positioning.
21
+ */
22
+ export declare function clampLearnCapturePositionWithBottomAnchor(position: DraggableDialogPosition, bottomAnchor: number, element?: HTMLElement | null): DraggableDialogPosition & {
23
+ bottom: number;
24
+ };
25
+ /** Restored position from localStorage, or the default bottom-right placement. */
26
+ export declare function getLearnCaptureInitialPosition(): DraggableDialogPosition;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import type { PointerEvent as ReactPointerEvent } from 'react';
3
+ import type { RecordingStatus } from '../../types/GuideAI.types';
4
+ export type LearnCaptureToolbarDragHandlers = {
5
+ onPointerDown: (e: ReactPointerEvent<HTMLDivElement>) => void;
6
+ onPointerMove: (e: ReactPointerEvent<HTMLDivElement>) => void;
7
+ onPointerUp: (e: ReactPointerEvent<HTMLDivElement>) => void;
8
+ onPointerCancel: (e: ReactPointerEvent<HTMLDivElement>) => void;
9
+ };
10
+ export type LearnCaptureToolbarProps = {
11
+ dragHandlers?: LearnCaptureToolbarDragHandlers;
12
+ recordingStatus: RecordingStatus;
13
+ isConnecting: boolean;
14
+ connectionMessage?: string | null;
15
+ hasMic: boolean;
16
+ /** When true (capture pause), VAD is greyed out; mic/playback are muted elsewhere. */
17
+ vadPaused: boolean;
18
+ capturing: boolean;
19
+ clarifying?: boolean;
20
+ clarifyDone?: boolean;
21
+ paused: boolean;
22
+ onPause: () => void;
23
+ onResume: () => void;
24
+ onStop: () => void | Promise<void>;
25
+ onDoneClarifying?: () => void;
26
+ };
27
+ export declare function LearnCaptureToolbar({ dragHandlers, recordingStatus, isConnecting, connectionMessage, hasMic, vadPaused, capturing, clarifying, clarifyDone, paused, onPause, onResume, onStop, onDoneClarifying, }: LearnCaptureToolbarProps): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { ConversationManager } from '../../utils/conversationManager';
2
+ import type { DataChannelManager } from '../../utils/dataChannel';
3
+ /**
4
+ * After clarify re-init, wait for the data channel then request the first assistant turn.
5
+ */
6
+ export declare function triggerLearnClarifyKickoff(getDataChannelManager: () => DataChannelManager | null, getConversationManager: () => ConversationManager | null): Promise<void>;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import type { StoredMessage } from '../../utils/messageStorage';
3
+ export type LearnLiteLine = {
4
+ kind: 'narration';
5
+ text: string;
6
+ key: string;
7
+ } | {
8
+ kind: 'assistant';
9
+ text: string;
10
+ key: string;
11
+ } | {
12
+ kind: 'click';
13
+ selector: string;
14
+ key: string;
15
+ };
16
+ export declare function buildLearnLiteLines(messages: StoredMessage[]): LearnLiteLine[];
17
+ export type LearnLiteTranscriptProps = {
18
+ lines: LearnLiteLine[];
19
+ /** Clarifying phase — Q&A copy instead of capture listening hint. */
20
+ clarifying?: boolean;
21
+ };
22
+ export declare function LearnLiteTranscript({ lines, clarifying }: LearnLiteTranscriptProps): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Learn mode — capture chrome (`guideai-learn-*`) + devtools panel scoped under
3
+ * `[data-guideai-devtool="learn-panel"]` (uses shared `guideai-atd-*` chrome).
4
+ */
5
+ export declare const learnModeStyles: () => string;
@@ -0,0 +1,5 @@
1
+ export type LearnPhase = 'off' | 'capturing' | 'capturing_paused' | 'clarifying' | 'generating';
2
+ export declare function learnModeActiveForInit(phase: LearnPhase): boolean;
3
+ export declare function learnCaptureOkClampPhase(phase: LearnPhase): string | null;
4
+ /** Lite capture chrome (banner + lite transcript + toolbar); hides full transcript shell. */
5
+ export declare function learnFocusModeActive(phase: LearnPhase, clarifyDone: boolean): boolean;
@@ -0,0 +1,5 @@
1
+ import type { LearnModePanelProps } from './LearnModePanel';
2
+ import type { LearnPhase } from './learnModeTypes';
3
+ export declare const LEARN_PHASE_OFF: LearnPhase;
4
+ /** Learn panel props before lazy orchestration loads (phase stays off). */
5
+ export declare function createLearnOrchestrationStub(onRequestOrchestration: () => void): LearnModePanelProps;
@@ -0,0 +1,3 @@
1
+ import type { LearnModePanelProps } from './LearnModePanel';
2
+ /** Serializable Learn panel fields — ignore callback identity when syncing shell state. */
3
+ export declare function areLearnPanelSyncFieldsEqual(prev: LearnModePanelProps, next: LearnModePanelProps): boolean;
@@ -0,0 +1,10 @@
1
+ import type { MutableRefObject } from 'react';
2
+ import type { RecordingStatus } from '../../types/GuideAI.types';
3
+ export type LearnRealtimeSessionDeps = {
4
+ hasInitializedRef: MutableRefObject<boolean>;
5
+ startConversationSession: () => Promise<boolean>;
6
+ setStatus: (status: RecordingStatus) => void;
7
+ setIsConversationActive: (active: boolean) => void;
8
+ };
9
+ /** Ensure a realtime voice session for Learn capture / clarify (moved out of GuideAI). */
10
+ export declare function createEnsureLearnRealtimeSession(deps: LearnRealtimeSessionDeps): () => Promise<boolean>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Module-level learn refs for WebRTC / data-channel hot paths (no GuideAI re-renders).
3
+ * `useLearnMode` syncs these when phase changes.
4
+ */
5
+ export declare const learnModeRef: {
6
+ current: boolean;
7
+ };
8
+ export declare const learnInitPhaseRef: {
9
+ current: "capture" | "clarify";
10
+ };
11
+ export declare const learnClarifyConversationIdRef: {
12
+ current: string | null;
13
+ };
14
+ export declare const learnCapturePhaseRef: {
15
+ current: string | null;
16
+ };
17
+ /**
18
+ * Capture-phase conversation id to reuse on connect. Normally `null` (each Start capture creates a
19
+ * fresh learn conversation); set only when restoring a capture session after a page reload so the
20
+ * reconnect re-attaches to the original conversation instead of forking a new one.
21
+ */
22
+ export declare const learnCaptureConversationIdRef: {
23
+ current: string | null;
24
+ };
25
+ export declare const learnRefBag: {
26
+ learnModeRef: {
27
+ current: boolean;
28
+ };
29
+ learnInitPhaseRef: {
30
+ current: "capture" | "clarify";
31
+ };
32
+ learnClarifyConversationIdRef: {
33
+ current: string | null;
34
+ };
35
+ learnCapturePhaseRef: {
36
+ current: string | null;
37
+ };
38
+ learnCaptureConversationIdRef: {
39
+ current: string | null;
40
+ };
41
+ };
@@ -0,0 +1,23 @@
1
+ import type { LearnPhase } from './learnModeTypes';
2
+ /** Phases worth restoring after a reload — `off` / `generating` are never persisted directly. */
3
+ export type RestorableLearnPhase = Extract<LearnPhase, 'capturing' | 'capturing_paused' | 'clarifying'>;
4
+ export type PendingLearnSession = {
5
+ phase: RestorableLearnPhase;
6
+ /** Server learn conversation id (capture conversation; reused for clarify re-init + generate). */
7
+ conversationId: string;
8
+ /** Locked workspace slug for generate. */
9
+ workspaceSlug: string;
10
+ proposedTitle: string;
11
+ /** True once the admin clicked "Done clarifying" (focus exited; Generate available). */
12
+ clarifyDone: boolean;
13
+ /** Ms since epoch — when the session was last persisted. */
14
+ startedAt: number;
15
+ };
16
+ export declare function getPendingLearnSession(): PendingLearnSession | null;
17
+ export declare function refreshLearnSessionActiveFlag(): void;
18
+ /** Cheap, allocation-free check for hot paths (e.g. GuideAI auto-restore gate). */
19
+ export declare function isLearnSessionActive(): boolean;
20
+ /** True when sessionStorage holds a resumable learn session (no side effects). */
21
+ export declare function hasPendingLearnSession(): boolean;
22
+ export declare function setPendingLearnSession(session: PendingLearnSession): void;
23
+ export declare function clearPendingLearnSession(): void;
@@ -0,0 +1,5 @@
1
+ import type { StubWorkspaceOption } from '../../stubs/workspaces';
2
+ export declare function resolveLearnWorkspaceContext(transcriptSessionMode: string, workspaceOptions: StubWorkspaceOption[], widgetAuthWorkspace?: string): {
3
+ workspaceSlug: string;
4
+ workspaceName: string;
5
+ };
@@ -0,0 +1,10 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { LearnOrchestrationHostProps } from './LearnOrchestrationHost';
3
+ export type LearnOrchestrationLoadResult = {
4
+ LearnOrchestrationHost: ComponentType<LearnOrchestrationHostProps>;
5
+ };
6
+ /**
7
+ * Dynamic entry for Learn orchestration (`useLearnMode`, capture chrome, focus callbacks).
8
+ * Loaded on first Learn tab open or Start capture — not on widget mount.
9
+ */
10
+ export declare function loadLearnOrchestration(): Promise<LearnOrchestrationLoadResult>;
@@ -0,0 +1,4 @@
1
+ import type { ReactHooks } from '../../utils/reactHooks';
2
+ import type { LearnPhase } from './learnModeTypes';
3
+ /** Elapsed capture time in MM:SS, excluding paused intervals. */
4
+ export declare function useLearnCaptureDuration(hooks: ReactHooks, phase: LearnPhase, capturePausedAt: number | null): string;
@@ -0,0 +1,9 @@
1
+ import type { ReactHooks } from '../../utils/reactHooks';
2
+ import type { ConversationManager } from '../../utils/conversationManager';
3
+ import type { DataChannelManager } from '../../utils/dataChannel';
4
+ import type { LearnPhase } from './learnModeTypes';
5
+ export declare function useLearnClickCapture(hooks: ReactHooks, params: {
6
+ phase: LearnPhase;
7
+ getConversationManager: () => ConversationManager | null;
8
+ getDataChannelManager: () => DataChannelManager | null;
9
+ }): void;
@@ -0,0 +1,47 @@
1
+ import type { ReactHooks } from '../../utils/reactHooks';
2
+ import type { GuideAIEnvironment } from '../../types/GuideAI.types';
3
+ import type { ConversationManager } from '../../utils/conversationManager';
4
+ import type { DataChannelManager } from '../../utils/dataChannel';
5
+ import { type LearnPhase } from './learnModeTypes';
6
+ export type UseLearnModeParams = {
7
+ hooks: ReactHooks;
8
+ adminAvailable: boolean;
9
+ conversationIdRef: {
10
+ current: string | null;
11
+ };
12
+ getConversationManager: () => ConversationManager | null;
13
+ getDataChannelManager: () => DataChannelManager | null;
14
+ cleanupWebRTC: () => void;
15
+ ensureRealtimeSession: () => Promise<boolean>;
16
+ /** Whether the host widget has finished its initial setup (gates reload-restore reconnect). */
17
+ isWidgetInitialized: () => boolean;
18
+ /** Same as transcript Reset chat (`handleResetChat`), without confirm. */
19
+ performResetChat: () => void | Promise<void>;
20
+ handleToggleMute: () => void;
21
+ applyMicMuted: (muted: boolean) => void;
22
+ isMuted: boolean;
23
+ isAssistantPlaybackMuted: boolean;
24
+ handleToggleAssistantPlaybackMute: () => void;
25
+ workspaceSlug: string;
26
+ environment?: GuideAIEnvironment;
27
+ portalToken: string | null;
28
+ syncTranscriptFromStorage: () => void;
29
+ };
30
+ export type UseLearnModeResult = {
31
+ phase: LearnPhase;
32
+ learnFocusMode: boolean;
33
+ capturePausedAt: number | null;
34
+ proposedTitle: string;
35
+ setProposedTitle: (t: string) => void;
36
+ generatedWorkflowId: string | null;
37
+ adminWorkflowUrl: string | null;
38
+ clarifyDone: boolean;
39
+ startCapture: () => Promise<void>;
40
+ pauseCapture: () => void;
41
+ resumeCapture: () => void;
42
+ stopCapture: () => Promise<void>;
43
+ finishClarifying: () => Promise<void>;
44
+ generateWorkflow: () => Promise<void>;
45
+ cancelLearn: () => void;
46
+ };
47
+ export declare function useLearnMode(params: UseLearnModeParams): UseLearnModeResult;
@@ -0,0 +1,3 @@
1
+ import type { UseLearnModeParams, UseLearnModeResult } from './useLearnMode';
2
+ /** No-op Learn hook when GUIDEAI_STRIP_DEVTOOLS=1 */
3
+ export declare function useLearnMode(_params: UseLearnModeParams): UseLearnModeResult;
@@ -5,3 +5,9 @@ export declare const DEVTOOLS_PANEL_WIDTH_PX = 520;
5
5
  * Initial top-left for a right-aligned devtools dialog (avoids overlapping the widget).
6
6
  */
7
7
  export declare function getInitialRightAlignedPanelPosition(panelWidth: number, top?: number, margin?: number): DraggableDialogPosition;
8
+ /** Clamp a stored / dragged position so the shell stays on-screen. */
9
+ export declare function clampDevtoolsShellPosition(position: DraggableDialogPosition): DraggableDialogPosition;
10
+ /**
11
+ * Restored shell position from localStorage, or the default right-aligned placement.
12
+ */
13
+ export declare function getDevtoolsShellInitialPosition(): DraggableDialogPosition;
@@ -0,0 +1,28 @@
1
+ /** Shell toggle control inside transcript ⋯ → Developer tools. */
2
+ export type DeveloperToolsShellControl = {
3
+ shellOpen: boolean;
4
+ onToggleShell: () => void;
5
+ } | null;
6
+ import type { GuideAIEnvironment } from '../types/GuideAI.types';
7
+ /** Grouped devtools props for TranscriptBox / TranscriptTextInput / TranscriptToolbar. */
8
+ export type TranscriptDevtoolsMenuProps = {
9
+ /** Full Developer tools section in ⋯ (extension admin or embed after admin login). */
10
+ sectionVisible: boolean;
11
+ shellControl: DeveloperToolsShellControl;
12
+ /** Open in admin flyout (conversation / workflow). */
13
+ adminPortal?: {
14
+ getServerConversationId: () => string | null;
15
+ environment?: GuideAIEnvironment;
16
+ };
17
+ login: {
18
+ /** Embed: Developer login row after hidden unlock, before admin sign-in. */
19
+ visible: boolean;
20
+ onOpen: () => void;
21
+ showLogout: boolean;
22
+ onLogout: () => void;
23
+ };
24
+ unlock: {
25
+ /** Embed: triple-click transcript workflow title. No-op in extension. */
26
+ onToolbarTitleClick: () => void;
27
+ };
28
+ };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { GuideAIEnvironment } from '../../types/GuideAI.types';
3
+ type DeveloperToolsAdminPortalFlyoutProps = {
4
+ open: boolean;
5
+ flyoutStyle: React.CSSProperties | null;
6
+ usePortal: boolean;
7
+ ReactDOM?: {
8
+ createPortal: (children: React.ReactNode, container: Element) => React.ReactNode;
9
+ };
10
+ listRef: React.RefObject<HTMLUListElement>;
11
+ themePortalProps: {
12
+ 'data-guideai-theme'?: string;
13
+ };
14
+ getServerConversationId: () => string | null;
15
+ widgetEnvironment?: GuideAIEnvironment;
16
+ onCloseMenu: () => void;
17
+ };
18
+ /** Portaled Open in admin submenu (⋯ → Developer tools). */
19
+ export declare function DeveloperToolsAdminPortalFlyout({ open, flyoutStyle, usePortal, ReactDOM, listRef, themePortalProps, getServerConversationId, widgetEnvironment, onCloseMenu, }: DeveloperToolsAdminPortalFlyoutProps): React.ReactNode;
20
+ export {};
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ type DeveloperToolsLoggerFlyoutProps = {
3
+ open: boolean;
4
+ flyoutStyle: React.CSSProperties | null;
5
+ usePortal: boolean;
6
+ ReactDOM?: {
7
+ createPortal: (children: React.ReactNode, container: Element) => React.ReactNode;
8
+ };
9
+ listRef: React.RefObject<HTMLUListElement>;
10
+ themePortalProps: {
11
+ 'data-guideai-theme'?: string;
12
+ };
13
+ };
14
+ /** Portaled Console debugger submenu (⋯ → Developer tools). */
15
+ export declare function DeveloperToolsLoggerFlyout({ open, flyoutStyle, usePortal, ReactDOM, listRef, themePortalProps, }: DeveloperToolsLoggerFlyoutProps): React.ReactNode;
16
+ export {};
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import type { MicPresetId } from '../../types/audioConfig.types';
3
+ import type { DevtoolsDebugFlyoutId } from './devtoolsFlyoutTypes';
4
+ type DeveloperToolsMicPresetFlyoutProps = {
5
+ moreMenuOpen: boolean;
6
+ debugFlyout: null | DevtoolsDebugFlyoutId;
7
+ flyoutStyle: React.CSSProperties | null;
8
+ usePortal: boolean;
9
+ ReactDOM?: {
10
+ createPortal: (children: React.ReactNode, container: Element) => React.ReactNode;
11
+ };
12
+ listRef: React.RefObject<HTMLUListElement>;
13
+ themePortalProps: {
14
+ 'data-guideai-theme'?: string;
15
+ };
16
+ micPreset: MicPresetId;
17
+ onApplyMicPreset?: (preset: MicPresetId) => void;
18
+ onCloseFlyout: () => void;
19
+ onCloseMenu: () => void;
20
+ };
21
+ export declare function DeveloperToolsMicPresetFlyout({ moreMenuOpen, debugFlyout, flyoutStyle, usePortal, ReactDOM, listRef, themePortalProps, micPreset, onApplyMicPreset, onCloseFlyout, onCloseMenu, }: DeveloperToolsMicPresetFlyoutProps): React.ReactNode;
22
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { DeveloperToolsShellControl } from '../transcriptDevtoolsMenuProps';
3
+ import type { DevtoolsDebugFlyoutId } from './devtoolsFlyoutTypes';
4
+ type TranscriptDeveloperToolsMoreMenuItemsProps = {
5
+ sectionVisible: boolean;
6
+ shellControl: DeveloperToolsShellControl;
7
+ loginVisible: boolean;
8
+ onOpenLogin: () => void;
9
+ showLogout: boolean;
10
+ onLogout: () => void;
11
+ onCloseMenu: () => void;
12
+ debugFlyout: null | DevtoolsDebugFlyoutId;
13
+ setDebugFlyout: React.Dispatch<React.SetStateAction<null | DevtoolsDebugFlyoutId>>;
14
+ loggerFlyoutTriggerRef: React.RefObject<HTMLButtonElement>;
15
+ adminPortalFlyoutTriggerRef: React.RefObject<HTMLButtonElement>;
16
+ themeFlyoutTriggerRef: React.RefObject<HTMLButtonElement>;
17
+ getServerConversationId?: () => string | null;
18
+ };
19
+ /** Developer login + Developer tools rows in transcript ⋯. */
20
+ export declare function TranscriptDeveloperToolsMoreMenuItems({ sectionVisible, shellControl, loginVisible, onOpenLogin, showLogout, onLogout, onCloseMenu, debugFlyout, setDebugFlyout, loggerFlyoutTriggerRef, adminPortalFlyoutTriggerRef, themeFlyoutTriggerRef, getServerConversationId, }: TranscriptDeveloperToolsMoreMenuItemsProps): React.JSX.Element;
21
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ type DeveloperToolsThemeFlyoutProps = {
3
+ open: boolean;
4
+ flyoutStyle: React.CSSProperties | null;
5
+ usePortal: boolean;
6
+ ReactDOM?: {
7
+ createPortal: (children: React.ReactNode, container: Element) => React.ReactNode;
8
+ };
9
+ listRef: React.RefObject<HTMLUListElement>;
10
+ onCloseMenu: () => void;
11
+ };
12
+ export declare function DeveloperToolsThemeFlyout({ open, flyoutStyle, usePortal, ReactDOM, listRef, onCloseMenu, }: DeveloperToolsThemeFlyoutProps): React.ReactNode;
13
+ export {};
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import type { MicPresetId } from '../../types/audioConfig.types';
3
+ import type { TranscriptDevtoolsMenuProps } from '../transcriptDevtoolsMenuProps';
4
+ import type { TranscriptMoreMenuDebugFlyoutRefs } from './useTranscriptMoreMenuDebugFlyouts';
5
+ import type { DevtoolsDebugFlyoutId } from './devtoolsFlyoutTypes';
6
+ export type TranscriptMoreMenuDevtoolsMenuProps = {
7
+ transcriptDevtools?: TranscriptDevtoolsMenuProps;
8
+ micPreset: MicPresetId;
9
+ onApplyMicPreset?: (preset: MicPresetId) => void;
10
+ debugFlyout: null | DevtoolsDebugFlyoutId;
11
+ setDebugFlyout: React.Dispatch<React.SetStateAction<null | DevtoolsDebugFlyoutId>>;
12
+ refs: TranscriptMoreMenuDebugFlyoutRefs;
13
+ onCloseMenu: () => void;
14
+ };
15
+ export type TranscriptMoreMenuDevtoolsPortalsProps = Omit<TranscriptMoreMenuDevtoolsMenuProps, 'setDebugFlyout'> & {
16
+ moreMenuOpen: boolean;
17
+ flyoutStyle: React.CSSProperties | null;
18
+ closeFlyout: () => void;
19
+ usePortal: boolean;
20
+ ReactDOM?: {
21
+ createPortal: (children: React.ReactNode, container: Element) => React.ReactNode;
22
+ };
23
+ };
24
+ /** Transcript ⋯ menu rows for mic preset + developer tools (inside the more-menu `<ul>`). */
25
+ export declare function TranscriptMoreMenuDevtools({ transcriptDevtools, micPreset, onApplyMicPreset, debugFlyout, setDebugFlyout, refs, onCloseMenu, }: TranscriptMoreMenuDevtoolsMenuProps): React.JSX.Element | null;
26
+ /** Portaled debug flyouts — mount next to the transcript more menu portal. */
27
+ export declare function TranscriptMoreMenuDevtoolsPortals({ transcriptDevtools, micPreset, onApplyMicPreset, moreMenuOpen, debugFlyout, flyoutStyle, refs, onCloseMenu, closeFlyout, usePortal, ReactDOM, }: TranscriptMoreMenuDevtoolsPortalsProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export type DevtoolsDebugFlyoutId = 'logger' | 'micPreset' | 'adminPortal' | 'theme';
@@ -0,0 +1,2 @@
1
+ export { TranscriptMoreMenuDevtools, TranscriptMoreMenuDevtoolsPortals, } from './TranscriptMoreMenuDevtools';
2
+ export { useTranscriptMoreMenuDebugFlyouts } from './useTranscriptMoreMenuDebugFlyouts';
@@ -0,0 +1,12 @@
1
+ import type { LoggerComponentKey } from '../../utils/logger';
2
+ type WindowGuideAILogger = {
3
+ enable?: () => void;
4
+ disable?: () => void;
5
+ getStatus?: () => {
6
+ manualEnabled: boolean;
7
+ components: Record<LoggerComponentKey, boolean>;
8
+ };
9
+ setComponentEnabled?: (c: LoggerComponentKey, enabled: boolean) => void;
10
+ };
11
+ export declare function readWindowGuideAILogger(): WindowGuideAILogger | undefined;
12
+ export {};
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import type { DevtoolsDebugFlyoutId } from './devtoolsFlyoutTypes';
3
+ export type TranscriptMoreMenuDebugFlyoutRefs = {
4
+ loggerFlyoutTriggerRef: React.RefObject<HTMLButtonElement>;
5
+ adminPortalFlyoutTriggerRef: React.RefObject<HTMLButtonElement>;
6
+ themeFlyoutTriggerRef: React.RefObject<HTMLButtonElement>;
7
+ micPresetFlyoutTriggerRef: React.RefObject<HTMLButtonElement>;
8
+ loggerDebugFlyoutListRef: React.RefObject<HTMLUListElement>;
9
+ adminPortalFlyoutListRef: React.RefObject<HTMLUListElement>;
10
+ themeFlyoutListRef: React.RefObject<HTMLUListElement>;
11
+ micPresetFlyoutListRef: React.RefObject<HTMLUListElement>;
12
+ };
13
+ export declare function useTranscriptMoreMenuDebugFlyouts(moreMenuOpen: boolean, moreMenuPlacement: {
14
+ left: number;
15
+ bottom: number;
16
+ minWidth: number;
17
+ } | null): {
18
+ debugFlyout: DevtoolsDebugFlyoutId | null;
19
+ setDebugFlyout: React.Dispatch<React.SetStateAction<DevtoolsDebugFlyoutId | null>>;
20
+ flyoutStyle: React.CSSProperties | null;
21
+ refs: TranscriptMoreMenuDebugFlyoutRefs;
22
+ outsideClickRefs: React.RefObject<HTMLUListElement>[];
23
+ closeFlyout: () => void;
24
+ };