@modelnex/sdk 0.5.3 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -17
- package/dist/index.d.mts +4 -48
- package/dist/index.d.ts +4 -48
- package/dist/index.js +398 -466
- package/dist/index.mjs +227 -294
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @modelnex/sdk
|
|
2
2
|
|
|
3
|
-
React SDK for ModelNex agent chat, tours, and
|
|
3
|
+
React SDK for ModelNex agent chat, tours, and workflows.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -33,9 +33,6 @@ export default function AppShell() {
|
|
|
33
33
|
isNewUser: currentUser.isNewUser,
|
|
34
34
|
userId: currentUser.id,
|
|
35
35
|
}}
|
|
36
|
-
tourFacts={{
|
|
37
|
-
features: currentUser.enabledFeatures,
|
|
38
|
-
}}
|
|
39
36
|
>
|
|
40
37
|
<App />
|
|
41
38
|
<ModelNexChatBubble appName="My Product" />
|
|
@@ -44,7 +41,7 @@ export default function AppShell() {
|
|
|
44
41
|
}
|
|
45
42
|
```
|
|
46
43
|
|
|
47
|
-
`websiteId` identifies the integration. `userProfile` is used for tour/
|
|
44
|
+
`websiteId` identifies the integration. `userProfile` is used for tour/workflow targeting and completion tracking.
|
|
48
45
|
|
|
49
46
|
## Tour Start Model
|
|
50
47
|
|
|
@@ -54,7 +51,7 @@ ModelNex currently supports these automatic trigger types:
|
|
|
54
51
|
- `feature_unlocked`
|
|
55
52
|
- `manual`
|
|
56
53
|
|
|
57
|
-
Each tour or
|
|
54
|
+
Each tour or workflow can also configure:
|
|
58
55
|
|
|
59
56
|
- `startPolicy`: `immediate_start` | `prompt_only` | `manual_only`
|
|
60
57
|
- `notificationType`: `bubble_card` | `modal`
|
|
@@ -70,12 +67,11 @@ Current behavior:
|
|
|
70
67
|
|
|
71
68
|
| Export | Purpose |
|
|
72
69
|
|--------|---------|
|
|
73
|
-
| `ModelNexProvider` | Root provider for server connection, chat state, dev tools, tours, and
|
|
74
|
-
| `ModelNexChatBubble` | Unified assistant UI for chat, voice tours, and
|
|
70
|
+
| `ModelNexProvider` | Root provider for server connection, chat state, dev tools, tours, and workflows |
|
|
71
|
+
| `ModelNexChatBubble` | Unified assistant UI for chat, voice tours, and workflows |
|
|
75
72
|
| `useRunCommand` | Run agent commands from custom UI |
|
|
76
|
-
| `useRegisterAction` | Register app actions the agent can execute |
|
|
77
73
|
| `useTourPlayback` | Low-level playback hook for tours and shared experience runtime |
|
|
78
|
-
| `useOnboardingPlayback` | Playback hook preconfigured for
|
|
74
|
+
| `useOnboardingPlayback` | Playback hook preconfigured for workflow playback |
|
|
79
75
|
| `useExperiencePlayback` | Alias over the shared playback hook |
|
|
80
76
|
| `useRecordingMode` | Low-level recorder hook for custom authoring UI |
|
|
81
77
|
| `useActionHighlight` | Highlight actions currently being executed |
|
|
@@ -86,12 +82,8 @@ Current behavior:
|
|
|
86
82
|
|
|
87
83
|
| Prop | Purpose |
|
|
88
84
|
|------|---------|
|
|
89
|
-
| `serverUrl` | ModelNex server base URL. Defaults to `https://api.modelnex.io` |
|
|
90
|
-
| `commandUrl` | Optional same-origin command proxy base |
|
|
91
85
|
| `websiteId` | Tenant/integration identifier |
|
|
92
|
-
| `userProfile` | End-user targeting data for tours/
|
|
93
|
-
| `tourFacts` | Additional facts, currently used for feature-based eligibility |
|
|
94
|
-
| `toursApiBase` | Same-origin API base for tour/onboarding fetches and test URLs |
|
|
86
|
+
| `userProfile` | End-user targeting data for tours/workflows |
|
|
95
87
|
| `devMode` | Enables recording/studio tooling for your internal users |
|
|
96
88
|
|
|
97
89
|
## Chat Bubble Props
|
|
@@ -102,15 +94,79 @@ Current behavior:
|
|
|
102
94
|
| `defaultCommand` | Fallback command when the input is empty |
|
|
103
95
|
| `welcomeMessage` | Empty-state greeting |
|
|
104
96
|
| `appName` | Product name used in narration and UI copy |
|
|
97
|
+
| `agentName` | Name of the AI agent displayed in the header |
|
|
105
98
|
| `onCommand` | Custom backend override for agent command handling |
|
|
106
99
|
| `recordingExperienceType` | Save recordings as `'tour'` or `'onboarding'` |
|
|
107
100
|
| `className` | Additional class name for the container |
|
|
101
|
+
| `theme` | Custom theme overrides for the chat bubble and panel (`accentColor`, `panelWidth`, etc.) |
|
|
102
|
+
|
|
103
|
+
## Configuration Examples
|
|
104
|
+
|
|
105
|
+
Here are some real-world examples of how to configure the SDK.
|
|
106
|
+
|
|
107
|
+
### Fully Customized Provider
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
import { ModelNexProvider } from '@modelnex/sdk';
|
|
111
|
+
|
|
112
|
+
export function AppShell({ children, currentUser }) {
|
|
113
|
+
return (
|
|
114
|
+
<ModelNexProvider
|
|
115
|
+
websiteId="prod_site_123"
|
|
116
|
+
|
|
117
|
+
// Development setup
|
|
118
|
+
devMode={process.env.NODE_ENV === 'development'}
|
|
119
|
+
|
|
120
|
+
// User Targeting for Tours & Workflows
|
|
121
|
+
userProfile={{
|
|
122
|
+
userId: currentUser.id,
|
|
123
|
+
isNewUser: currentUser.createdAt > Date.now() - 86400000 * 7, // 7 days
|
|
124
|
+
type: currentUser.role, // e.g. "admin", "viewer"
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
{children}
|
|
128
|
+
</ModelNexProvider>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Themed Chat Bubble
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { ModelNexChatBubble } from '@modelnex/sdk';
|
|
137
|
+
|
|
138
|
+
export function ChatIntegration() {
|
|
139
|
+
return (
|
|
140
|
+
<ModelNexChatBubble
|
|
141
|
+
// Branding & Copy
|
|
142
|
+
appName="Acme Corp Dashboard"
|
|
143
|
+
agentName="Acme Assistant"
|
|
144
|
+
welcomeMessage="Hi there! Ask me to navigate to a page or help you with your account."
|
|
145
|
+
placeholder="Type a command or ask a question..."
|
|
146
|
+
defaultCommand="Show me my recent activity"
|
|
147
|
+
|
|
148
|
+
// Recording defaults
|
|
149
|
+
recordingExperienceType="onboarding" // Default is 'tour'
|
|
150
|
+
|
|
151
|
+
// Visual Theme Customization
|
|
152
|
+
theme={{
|
|
153
|
+
accentColor: "#f59e0b", // Amber accent
|
|
154
|
+
accentForeground: "#ffffff",
|
|
155
|
+
panelWidth: "400px", // Wider panel
|
|
156
|
+
panelMaxHeight: "700px",
|
|
157
|
+
bubbleSize: "64px", // Larger bubble
|
|
158
|
+
borderRadius: "24px",
|
|
159
|
+
zIndex: 9999
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
```
|
|
108
165
|
|
|
109
166
|
## Testing Flows
|
|
110
167
|
|
|
111
168
|
- Force a tour with `?modelnex_test_tour=TOUR_ID`
|
|
112
|
-
- Force
|
|
113
|
-
- If you use a same-origin proxy, set `toursApiBase` so test fetches avoid CORS issues
|
|
169
|
+
- Force a workflow with `?modelnex_test_workflow=FLOW_ID`
|
|
114
170
|
|
|
115
171
|
## Custom UI
|
|
116
172
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React$1 from 'react';
|
|
2
|
-
import { z } from 'zod';
|
|
3
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
3
|
|
|
5
4
|
type ExperienceType = 'tour' | 'onboarding';
|
|
@@ -204,10 +203,6 @@ interface UserProfile {
|
|
|
204
203
|
/** User ID for per-user completion state */
|
|
205
204
|
userId?: string;
|
|
206
205
|
}
|
|
207
|
-
interface TourFacts {
|
|
208
|
-
/** Feature keys currently available to the user, used for feature_unlocked tours */
|
|
209
|
-
features?: string[];
|
|
210
|
-
}
|
|
211
206
|
/** Playback state machine states */
|
|
212
207
|
type TourPlaybackState = 'idle' | 'intro' | 'executing' | 'thinking' | 'waiting_voice' | 'waiting_input' | 'paused' | 'complete';
|
|
213
208
|
/** Internal recording step being built */
|
|
@@ -402,22 +397,6 @@ interface ChatMessage {
|
|
|
402
397
|
debug?: AgentDebug;
|
|
403
398
|
}
|
|
404
399
|
|
|
405
|
-
interface UseRegisterActionOptions<T extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
406
|
-
id: string;
|
|
407
|
-
description: string;
|
|
408
|
-
schema: T;
|
|
409
|
-
execute: (params: z.infer<T>) => unknown | Promise<unknown>;
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Register a custom action with the ModelNex agent.
|
|
413
|
-
* Use this to add app-specific actions (e.g. navigation, domain operations).
|
|
414
|
-
* The action is synced to the server with built-in actions and can be invoked by the agent.
|
|
415
|
-
*
|
|
416
|
-
* Must be used within ModelNexProvider.
|
|
417
|
-
* Memoize schema (define outside component) and execute (useCallback) to avoid unnecessary re-registration.
|
|
418
|
-
*/
|
|
419
|
-
declare function useRegisterAction<T extends z.ZodTypeAny = z.ZodTypeAny>(action: UseRegisterActionOptions<T>): void;
|
|
420
|
-
|
|
421
400
|
interface UIStateProviderProps {
|
|
422
401
|
children: React$1.ReactNode;
|
|
423
402
|
/** Agent context id (default: "agent-ui-state") */
|
|
@@ -471,22 +450,12 @@ interface ModelNexChatBubbleProps {
|
|
|
471
450
|
defaultCommand?: string;
|
|
472
451
|
/** Additional class names for the container */
|
|
473
452
|
className?: string;
|
|
474
|
-
/** Custom fetch - use your own inference/backend. Omit to use agent server from Provider. */
|
|
475
|
-
onCommand?: (command: string) => Promise<{
|
|
476
|
-
actionsExecuted?: number;
|
|
477
|
-
summary?: string;
|
|
478
|
-
nextSteps?: string[];
|
|
479
|
-
debug?: AgentDebug;
|
|
480
|
-
[key: string]: unknown;
|
|
481
|
-
}>;
|
|
482
453
|
/** Welcome message when chat is empty */
|
|
483
454
|
welcomeMessage?: string;
|
|
484
455
|
/** Name of the AI agent displayed in the header */
|
|
485
456
|
agentName?: string;
|
|
486
457
|
/** Display name of the app — used in tour intro narration */
|
|
487
458
|
appName?: string;
|
|
488
|
-
/** Save recorded flows as tours or onboarding without changing the recorder UX */
|
|
489
|
-
recordingExperienceType?: ExperienceType;
|
|
490
459
|
/** Custom theme overrides */
|
|
491
460
|
theme?: {
|
|
492
461
|
accentColor?: string;
|
|
@@ -504,7 +473,7 @@ interface ModelNexChatBubbleProps {
|
|
|
504
473
|
* Shows conversation history; on exit, the agent summarizes what it did and suggests next steps.
|
|
505
474
|
* Use within ModelNexProvider. Omit to use your own UI with useRunCommand.
|
|
506
475
|
*/
|
|
507
|
-
declare function ModelNexChatBubble({ placeholder, defaultCommand, className,
|
|
476
|
+
declare function ModelNexChatBubble({ placeholder, defaultCommand, className, welcomeMessage, agentName, appName, theme, }: ModelNexChatBubbleProps): React$1.ReactPortal | null;
|
|
508
477
|
|
|
509
478
|
interface ModelNexOnboardingPanelProps {
|
|
510
479
|
appName?: string;
|
|
@@ -678,7 +647,6 @@ interface UseTourPlaybackOptions {
|
|
|
678
647
|
socketId?: string | null;
|
|
679
648
|
websiteId?: string;
|
|
680
649
|
userProfile?: UserProfile;
|
|
681
|
-
tourFacts?: TourFacts;
|
|
682
650
|
voice: VoiceHook;
|
|
683
651
|
appName?: string;
|
|
684
652
|
/** Pass the page's current state to the LLM agent */
|
|
@@ -698,7 +666,7 @@ interface UseTourPlaybackOptions {
|
|
|
698
666
|
/** Disable internal pending prompt/query discovery when a higher-level controller owns it */
|
|
699
667
|
enableAutoDiscovery?: boolean;
|
|
700
668
|
}
|
|
701
|
-
declare function useTourPlayback({ serverUrl, commandUrl, toursApiBase, socketId, websiteId, userProfile,
|
|
669
|
+
declare function useTourPlayback({ serverUrl, commandUrl, toursApiBase, socketId, websiteId, userProfile, voice, appName, extractedElements, tagStore, onStepChange, onTourEnd, disabled, experienceType, showCaptions, enableAutoDiscovery, }: UseTourPlaybackOptions): TourPlaybackHook;
|
|
702
670
|
|
|
703
671
|
type ExperiencePlaybackHook = TourPlaybackHook;
|
|
704
672
|
declare function useExperiencePlayback(...args: Parameters<typeof useTourPlayback>): TourPlaybackHook;
|
|
@@ -840,7 +808,7 @@ interface SavedDraftPreview {
|
|
|
840
808
|
experienceType: ExperienceType;
|
|
841
809
|
}
|
|
842
810
|
type PreviewLaunchSource = 'standard' | 'query_param';
|
|
843
|
-
declare function getPreviewQueryParamName(experienceType: ExperienceType): 'modelnex_test_tour' | '
|
|
811
|
+
declare function getPreviewQueryParamName(experienceType: ExperienceType): 'modelnex_test_tour' | 'modelnex_test_workflow';
|
|
844
812
|
declare function buildDraftPreviewUrl(currentUrl: string, draft: SavedDraftPreview): string;
|
|
845
813
|
declare function shouldPromptForPreviewStart(notificationType: TourNotificationType | undefined, _source: PreviewLaunchSource): boolean;
|
|
846
814
|
declare function persistActiveDraftPreview(draft: SavedDraftPreview): void;
|
|
@@ -849,11 +817,6 @@ declare function clearActiveDraftPreview(experienceType?: ExperienceType): void;
|
|
|
849
817
|
|
|
850
818
|
interface ModelNexProviderProps {
|
|
851
819
|
children?: unknown;
|
|
852
|
-
serverUrl?: string;
|
|
853
|
-
/** Base URL for agent commands. Use same-origin path (e.g. /api/modelnex) to avoid CORS. Default: serverUrl */
|
|
854
|
-
commandUrl?: string;
|
|
855
|
-
/** Disable the realtime socket connection while still rendering the SDK UI */
|
|
856
|
-
disableSocket?: boolean;
|
|
857
820
|
/** Identifier for the integrated website, for multi-tenancy */
|
|
858
821
|
websiteId?: string;
|
|
859
822
|
/**
|
|
@@ -863,13 +826,6 @@ interface ModelNexProviderProps {
|
|
|
863
826
|
* userId — used for per-user tour completion state
|
|
864
827
|
*/
|
|
865
828
|
userProfile?: UserProfile;
|
|
866
|
-
/** Optional product facts used for feature-triggered tours */
|
|
867
|
-
tourFacts?: TourFacts;
|
|
868
|
-
/**
|
|
869
|
-
* Same-origin base for tour API (e.g. /api/modelnex/api).
|
|
870
|
-
* When set, ?modelnex_test_tour= fetches via this path to avoid CORS.
|
|
871
|
-
*/
|
|
872
|
-
toursApiBase?: string;
|
|
873
829
|
/**
|
|
874
830
|
* Enable SDK dev tools unconditionally (tour recording, studio mode)
|
|
875
831
|
*/
|
|
@@ -877,4 +833,4 @@ interface ModelNexProviderProps {
|
|
|
877
833
|
}
|
|
878
834
|
declare const ModelNexProvider: React$1.FC<ModelNexProviderProps>;
|
|
879
835
|
|
|
880
|
-
export { type AgentDebug, type AgentTraceLlmInput, type AgentTraceStep, type ChatMessage, type ExperienceGoal, type ExperiencePlaybackHook, type ExperiencePresentation, type ExperienceType, type ExtractedElement, ModelNexChatBubble, type ModelNexChatBubbleProps, ModelNexOnboardingPanel, type ModelNexOnboardingPanelProps, ModelNexProvider, type ModelNexProviderProps, type OnboardingPlaybackHook, type OnboardingStepMetadata, type PreviewLaunchSource, type RecordingModeHook, RecordingOverlay, type RunCommandResult, type SavedDraftPreview, StudioOverlay, type TagData, type TagStore, type Tour, type
|
|
836
|
+
export { type AgentDebug, type AgentTraceLlmInput, type AgentTraceStep, type ChatMessage, type ExperienceGoal, type ExperiencePlaybackHook, type ExperiencePresentation, type ExperienceType, type ExtractedElement, ModelNexChatBubble, type ModelNexChatBubbleProps, ModelNexOnboardingPanel, type ModelNexOnboardingPanelProps, ModelNexProvider, type ModelNexProviderProps, type OnboardingPlaybackHook, type OnboardingStepMetadata, type PreviewLaunchSource, type RecordingModeHook, RecordingOverlay, type RunCommandResult, type SavedDraftPreview, StudioOverlay, type TagData, type TagStore, type Tour, type TourNotificationType, type TourPlaybackHook, type TourPlaybackState, TourProgressPanel, type TourStartPolicy, type TourStep, type TourStepType, type TourTrigger, UIStateProvider, type UserProfile, type VoiceHook, buildDraftPreviewUrl, buildRecordingCapturePayload, buildRecordingStepGoal, clearActiveDraftPreview, extractInteractiveElements, generateFingerprint, getPreviewQueryParamName, getRecordingDraftActionLabel, getRecordingDraftStatusMessage, inferOnboardingMetadataForStep, isAskDrivenInputStepType, isInteractiveInputStepType, isManualOnboardingStep, isRecordingDraftGenerating, persistActiveDraftPreview, readActiveDraftPreview, shouldPromptForPreviewStart, shouldShowRecordingOverlay, useActionHighlight, useAgentViewport, useAutoExtract, useExperiencePlayback, useOnboardingPlayback, useRecordingMode, useRunCommand, useTagStore, useTourPlayback, useUIState, useViewportTrack, useVisibleIds, useVoice };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React$1 from 'react';
|
|
2
|
-
import { z } from 'zod';
|
|
3
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
3
|
|
|
5
4
|
type ExperienceType = 'tour' | 'onboarding';
|
|
@@ -204,10 +203,6 @@ interface UserProfile {
|
|
|
204
203
|
/** User ID for per-user completion state */
|
|
205
204
|
userId?: string;
|
|
206
205
|
}
|
|
207
|
-
interface TourFacts {
|
|
208
|
-
/** Feature keys currently available to the user, used for feature_unlocked tours */
|
|
209
|
-
features?: string[];
|
|
210
|
-
}
|
|
211
206
|
/** Playback state machine states */
|
|
212
207
|
type TourPlaybackState = 'idle' | 'intro' | 'executing' | 'thinking' | 'waiting_voice' | 'waiting_input' | 'paused' | 'complete';
|
|
213
208
|
/** Internal recording step being built */
|
|
@@ -402,22 +397,6 @@ interface ChatMessage {
|
|
|
402
397
|
debug?: AgentDebug;
|
|
403
398
|
}
|
|
404
399
|
|
|
405
|
-
interface UseRegisterActionOptions<T extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
406
|
-
id: string;
|
|
407
|
-
description: string;
|
|
408
|
-
schema: T;
|
|
409
|
-
execute: (params: z.infer<T>) => unknown | Promise<unknown>;
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Register a custom action with the ModelNex agent.
|
|
413
|
-
* Use this to add app-specific actions (e.g. navigation, domain operations).
|
|
414
|
-
* The action is synced to the server with built-in actions and can be invoked by the agent.
|
|
415
|
-
*
|
|
416
|
-
* Must be used within ModelNexProvider.
|
|
417
|
-
* Memoize schema (define outside component) and execute (useCallback) to avoid unnecessary re-registration.
|
|
418
|
-
*/
|
|
419
|
-
declare function useRegisterAction<T extends z.ZodTypeAny = z.ZodTypeAny>(action: UseRegisterActionOptions<T>): void;
|
|
420
|
-
|
|
421
400
|
interface UIStateProviderProps {
|
|
422
401
|
children: React$1.ReactNode;
|
|
423
402
|
/** Agent context id (default: "agent-ui-state") */
|
|
@@ -471,22 +450,12 @@ interface ModelNexChatBubbleProps {
|
|
|
471
450
|
defaultCommand?: string;
|
|
472
451
|
/** Additional class names for the container */
|
|
473
452
|
className?: string;
|
|
474
|
-
/** Custom fetch - use your own inference/backend. Omit to use agent server from Provider. */
|
|
475
|
-
onCommand?: (command: string) => Promise<{
|
|
476
|
-
actionsExecuted?: number;
|
|
477
|
-
summary?: string;
|
|
478
|
-
nextSteps?: string[];
|
|
479
|
-
debug?: AgentDebug;
|
|
480
|
-
[key: string]: unknown;
|
|
481
|
-
}>;
|
|
482
453
|
/** Welcome message when chat is empty */
|
|
483
454
|
welcomeMessage?: string;
|
|
484
455
|
/** Name of the AI agent displayed in the header */
|
|
485
456
|
agentName?: string;
|
|
486
457
|
/** Display name of the app — used in tour intro narration */
|
|
487
458
|
appName?: string;
|
|
488
|
-
/** Save recorded flows as tours or onboarding without changing the recorder UX */
|
|
489
|
-
recordingExperienceType?: ExperienceType;
|
|
490
459
|
/** Custom theme overrides */
|
|
491
460
|
theme?: {
|
|
492
461
|
accentColor?: string;
|
|
@@ -504,7 +473,7 @@ interface ModelNexChatBubbleProps {
|
|
|
504
473
|
* Shows conversation history; on exit, the agent summarizes what it did and suggests next steps.
|
|
505
474
|
* Use within ModelNexProvider. Omit to use your own UI with useRunCommand.
|
|
506
475
|
*/
|
|
507
|
-
declare function ModelNexChatBubble({ placeholder, defaultCommand, className,
|
|
476
|
+
declare function ModelNexChatBubble({ placeholder, defaultCommand, className, welcomeMessage, agentName, appName, theme, }: ModelNexChatBubbleProps): React$1.ReactPortal | null;
|
|
508
477
|
|
|
509
478
|
interface ModelNexOnboardingPanelProps {
|
|
510
479
|
appName?: string;
|
|
@@ -678,7 +647,6 @@ interface UseTourPlaybackOptions {
|
|
|
678
647
|
socketId?: string | null;
|
|
679
648
|
websiteId?: string;
|
|
680
649
|
userProfile?: UserProfile;
|
|
681
|
-
tourFacts?: TourFacts;
|
|
682
650
|
voice: VoiceHook;
|
|
683
651
|
appName?: string;
|
|
684
652
|
/** Pass the page's current state to the LLM agent */
|
|
@@ -698,7 +666,7 @@ interface UseTourPlaybackOptions {
|
|
|
698
666
|
/** Disable internal pending prompt/query discovery when a higher-level controller owns it */
|
|
699
667
|
enableAutoDiscovery?: boolean;
|
|
700
668
|
}
|
|
701
|
-
declare function useTourPlayback({ serverUrl, commandUrl, toursApiBase, socketId, websiteId, userProfile,
|
|
669
|
+
declare function useTourPlayback({ serverUrl, commandUrl, toursApiBase, socketId, websiteId, userProfile, voice, appName, extractedElements, tagStore, onStepChange, onTourEnd, disabled, experienceType, showCaptions, enableAutoDiscovery, }: UseTourPlaybackOptions): TourPlaybackHook;
|
|
702
670
|
|
|
703
671
|
type ExperiencePlaybackHook = TourPlaybackHook;
|
|
704
672
|
declare function useExperiencePlayback(...args: Parameters<typeof useTourPlayback>): TourPlaybackHook;
|
|
@@ -840,7 +808,7 @@ interface SavedDraftPreview {
|
|
|
840
808
|
experienceType: ExperienceType;
|
|
841
809
|
}
|
|
842
810
|
type PreviewLaunchSource = 'standard' | 'query_param';
|
|
843
|
-
declare function getPreviewQueryParamName(experienceType: ExperienceType): 'modelnex_test_tour' | '
|
|
811
|
+
declare function getPreviewQueryParamName(experienceType: ExperienceType): 'modelnex_test_tour' | 'modelnex_test_workflow';
|
|
844
812
|
declare function buildDraftPreviewUrl(currentUrl: string, draft: SavedDraftPreview): string;
|
|
845
813
|
declare function shouldPromptForPreviewStart(notificationType: TourNotificationType | undefined, _source: PreviewLaunchSource): boolean;
|
|
846
814
|
declare function persistActiveDraftPreview(draft: SavedDraftPreview): void;
|
|
@@ -849,11 +817,6 @@ declare function clearActiveDraftPreview(experienceType?: ExperienceType): void;
|
|
|
849
817
|
|
|
850
818
|
interface ModelNexProviderProps {
|
|
851
819
|
children?: unknown;
|
|
852
|
-
serverUrl?: string;
|
|
853
|
-
/** Base URL for agent commands. Use same-origin path (e.g. /api/modelnex) to avoid CORS. Default: serverUrl */
|
|
854
|
-
commandUrl?: string;
|
|
855
|
-
/** Disable the realtime socket connection while still rendering the SDK UI */
|
|
856
|
-
disableSocket?: boolean;
|
|
857
820
|
/** Identifier for the integrated website, for multi-tenancy */
|
|
858
821
|
websiteId?: string;
|
|
859
822
|
/**
|
|
@@ -863,13 +826,6 @@ interface ModelNexProviderProps {
|
|
|
863
826
|
* userId — used for per-user tour completion state
|
|
864
827
|
*/
|
|
865
828
|
userProfile?: UserProfile;
|
|
866
|
-
/** Optional product facts used for feature-triggered tours */
|
|
867
|
-
tourFacts?: TourFacts;
|
|
868
|
-
/**
|
|
869
|
-
* Same-origin base for tour API (e.g. /api/modelnex/api).
|
|
870
|
-
* When set, ?modelnex_test_tour= fetches via this path to avoid CORS.
|
|
871
|
-
*/
|
|
872
|
-
toursApiBase?: string;
|
|
873
829
|
/**
|
|
874
830
|
* Enable SDK dev tools unconditionally (tour recording, studio mode)
|
|
875
831
|
*/
|
|
@@ -877,4 +833,4 @@ interface ModelNexProviderProps {
|
|
|
877
833
|
}
|
|
878
834
|
declare const ModelNexProvider: React$1.FC<ModelNexProviderProps>;
|
|
879
835
|
|
|
880
|
-
export { type AgentDebug, type AgentTraceLlmInput, type AgentTraceStep, type ChatMessage, type ExperienceGoal, type ExperiencePlaybackHook, type ExperiencePresentation, type ExperienceType, type ExtractedElement, ModelNexChatBubble, type ModelNexChatBubbleProps, ModelNexOnboardingPanel, type ModelNexOnboardingPanelProps, ModelNexProvider, type ModelNexProviderProps, type OnboardingPlaybackHook, type OnboardingStepMetadata, type PreviewLaunchSource, type RecordingModeHook, RecordingOverlay, type RunCommandResult, type SavedDraftPreview, StudioOverlay, type TagData, type TagStore, type Tour, type
|
|
836
|
+
export { type AgentDebug, type AgentTraceLlmInput, type AgentTraceStep, type ChatMessage, type ExperienceGoal, type ExperiencePlaybackHook, type ExperiencePresentation, type ExperienceType, type ExtractedElement, ModelNexChatBubble, type ModelNexChatBubbleProps, ModelNexOnboardingPanel, type ModelNexOnboardingPanelProps, ModelNexProvider, type ModelNexProviderProps, type OnboardingPlaybackHook, type OnboardingStepMetadata, type PreviewLaunchSource, type RecordingModeHook, RecordingOverlay, type RunCommandResult, type SavedDraftPreview, StudioOverlay, type TagData, type TagStore, type Tour, type TourNotificationType, type TourPlaybackHook, type TourPlaybackState, TourProgressPanel, type TourStartPolicy, type TourStep, type TourStepType, type TourTrigger, UIStateProvider, type UserProfile, type VoiceHook, buildDraftPreviewUrl, buildRecordingCapturePayload, buildRecordingStepGoal, clearActiveDraftPreview, extractInteractiveElements, generateFingerprint, getPreviewQueryParamName, getRecordingDraftActionLabel, getRecordingDraftStatusMessage, inferOnboardingMetadataForStep, isAskDrivenInputStepType, isInteractiveInputStepType, isManualOnboardingStep, isRecordingDraftGenerating, persistActiveDraftPreview, readActiveDraftPreview, shouldPromptForPreviewStart, shouldShowRecordingOverlay, useActionHighlight, useAgentViewport, useAutoExtract, useExperiencePlayback, useOnboardingPlayback, useRecordingMode, useRunCommand, useTagStore, useTourPlayback, useUIState, useViewportTrack, useVisibleIds, useVoice };
|