@navai/voice-frontend 0.1.2 → 0.1.5
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.en.md +65 -24
- package/README.es.md +65 -24
- package/README.md +82 -28
- package/bin/generate-web-module-loaders.mjs +31 -3
- package/dist/Orb-B4OSC3XR.js +6 -0
- package/dist/chunk-KBBRQQLK.js +531 -0
- package/dist/index.cjs +1340 -68
- package/dist/index.d.cts +145 -22
- package/dist/index.d.ts +145 -22
- package/dist/index.js +791 -68
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { RealtimeAgent } from '@openai/agents/realtime';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type NavaiFunctionPayload = Record<string, unknown>;
|
|
4
6
|
type NavaiFunctionContext = {
|
|
@@ -27,6 +29,45 @@ type NavaiRoute = {
|
|
|
27
29
|
declare function resolveNavaiRoute(input: string, routes?: NavaiRoute[]): string | null;
|
|
28
30
|
declare function getNavaiRoutePromptLines(routes?: NavaiRoute[]): string[];
|
|
29
31
|
|
|
32
|
+
type NavaiFrontendEnv$2 = Record<string, unknown>;
|
|
33
|
+
type NavaiAgentModuleConfig = {
|
|
34
|
+
key?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
handoffDescription?: string;
|
|
38
|
+
instructions?: string;
|
|
39
|
+
isPrimary?: boolean;
|
|
40
|
+
};
|
|
41
|
+
type NavaiRuntimeAgentConfig = {
|
|
42
|
+
key: string;
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
handoffDescription?: string;
|
|
46
|
+
instructions?: string;
|
|
47
|
+
isPrimary: boolean;
|
|
48
|
+
functionModuleLoaders: NavaiFunctionModuleLoaders;
|
|
49
|
+
};
|
|
50
|
+
type ResolveNavaiFrontendRuntimeConfigOptions = {
|
|
51
|
+
moduleLoaders: NavaiFunctionModuleLoaders;
|
|
52
|
+
defaultRoutes: NavaiRoute[];
|
|
53
|
+
env?: NavaiFrontendEnv$2;
|
|
54
|
+
routesFile?: string;
|
|
55
|
+
functionsFolders?: string;
|
|
56
|
+
agentsFolders?: string;
|
|
57
|
+
modelOverride?: string;
|
|
58
|
+
defaultRoutesFile?: string;
|
|
59
|
+
defaultFunctionsFolder?: string;
|
|
60
|
+
};
|
|
61
|
+
type ResolveNavaiFrontendRuntimeConfigResult = {
|
|
62
|
+
routes: NavaiRoute[];
|
|
63
|
+
functionModuleLoaders: NavaiFunctionModuleLoaders;
|
|
64
|
+
agents: NavaiRuntimeAgentConfig[];
|
|
65
|
+
primaryAgentKey?: string;
|
|
66
|
+
modelOverride?: string;
|
|
67
|
+
warnings: string[];
|
|
68
|
+
};
|
|
69
|
+
declare function resolveNavaiFrontendRuntimeConfig(options: ResolveNavaiFrontendRuntimeConfigOptions): Promise<ResolveNavaiFrontendRuntimeConfigResult>;
|
|
70
|
+
|
|
30
71
|
type NavaiBackendFunctionDefinition = {
|
|
31
72
|
name: string;
|
|
32
73
|
description?: string;
|
|
@@ -40,6 +81,8 @@ type ExecuteNavaiBackendFunction = (input: ExecuteNavaiBackendFunctionInput) =>
|
|
|
40
81
|
type BuildNavaiAgentOptions = NavaiFunctionContext & {
|
|
41
82
|
routes: NavaiRoute[];
|
|
42
83
|
functionModuleLoaders?: NavaiFunctionModuleLoaders;
|
|
84
|
+
agents?: NavaiRuntimeAgentConfig[];
|
|
85
|
+
primaryAgentKey?: string;
|
|
43
86
|
backendFunctions?: NavaiBackendFunctionDefinition[];
|
|
44
87
|
executeBackendFunction?: ExecuteNavaiBackendFunction;
|
|
45
88
|
agentName?: string;
|
|
@@ -51,7 +94,7 @@ type BuildNavaiAgentResult = {
|
|
|
51
94
|
};
|
|
52
95
|
declare function buildNavaiAgent(options: BuildNavaiAgentOptions): Promise<BuildNavaiAgentResult>;
|
|
53
96
|
|
|
54
|
-
type NavaiFrontendEnv$
|
|
97
|
+
type NavaiFrontendEnv$1 = Record<string, string | undefined>;
|
|
55
98
|
type CreateClientSecretInput = {
|
|
56
99
|
model?: string;
|
|
57
100
|
voice?: string;
|
|
@@ -71,7 +114,7 @@ type BackendFunctionsResult = {
|
|
|
71
114
|
};
|
|
72
115
|
type CreateNavaiBackendClientOptions = {
|
|
73
116
|
apiBaseUrl?: string;
|
|
74
|
-
env?: NavaiFrontendEnv$
|
|
117
|
+
env?: NavaiFrontendEnv$1;
|
|
75
118
|
fetchImpl?: typeof fetch;
|
|
76
119
|
clientSecretPath?: string;
|
|
77
120
|
functionsListPath?: string;
|
|
@@ -84,25 +127,6 @@ type NavaiBackendClient = {
|
|
|
84
127
|
};
|
|
85
128
|
declare function createNavaiBackendClient(options?: CreateNavaiBackendClientOptions): NavaiBackendClient;
|
|
86
129
|
|
|
87
|
-
type NavaiFrontendEnv$1 = Record<string, unknown>;
|
|
88
|
-
type ResolveNavaiFrontendRuntimeConfigOptions = {
|
|
89
|
-
moduleLoaders: NavaiFunctionModuleLoaders;
|
|
90
|
-
defaultRoutes: NavaiRoute[];
|
|
91
|
-
env?: NavaiFrontendEnv$1;
|
|
92
|
-
routesFile?: string;
|
|
93
|
-
functionsFolders?: string;
|
|
94
|
-
modelOverride?: string;
|
|
95
|
-
defaultRoutesFile?: string;
|
|
96
|
-
defaultFunctionsFolder?: string;
|
|
97
|
-
};
|
|
98
|
-
type ResolveNavaiFrontendRuntimeConfigResult = {
|
|
99
|
-
routes: NavaiRoute[];
|
|
100
|
-
functionModuleLoaders: NavaiFunctionModuleLoaders;
|
|
101
|
-
modelOverride?: string;
|
|
102
|
-
warnings: string[];
|
|
103
|
-
};
|
|
104
|
-
declare function resolveNavaiFrontendRuntimeConfig(options: ResolveNavaiFrontendRuntimeConfigOptions): Promise<ResolveNavaiFrontendRuntimeConfigResult>;
|
|
105
|
-
|
|
106
130
|
type VoiceStatus = "idle" | "connecting" | "connected" | "error";
|
|
107
131
|
type AgentVoiceState = "idle" | "speaking";
|
|
108
132
|
type NavaiFrontendEnv = Record<string, string | undefined>;
|
|
@@ -114,6 +138,7 @@ type UseWebVoiceAgentOptions = {
|
|
|
114
138
|
apiBaseUrl?: string;
|
|
115
139
|
routesFile?: string;
|
|
116
140
|
functionsFolders?: string;
|
|
141
|
+
agentsFolders?: string;
|
|
117
142
|
modelOverride?: string;
|
|
118
143
|
defaultRoutesFile?: string;
|
|
119
144
|
defaultFunctionsFolder?: string;
|
|
@@ -130,4 +155,102 @@ type UseWebVoiceAgentResult = {
|
|
|
130
155
|
};
|
|
131
156
|
declare function useWebVoiceAgent(options: UseWebVoiceAgentOptions): UseWebVoiceAgentResult;
|
|
132
157
|
|
|
133
|
-
|
|
158
|
+
type OrbProps = {
|
|
159
|
+
hue?: number;
|
|
160
|
+
autoHueShift?: boolean;
|
|
161
|
+
hueShiftMin?: number;
|
|
162
|
+
hueShiftMax?: number;
|
|
163
|
+
hueShiftHalfCycleSeconds?: number;
|
|
164
|
+
hoverIntensity?: number;
|
|
165
|
+
rotateOnHover?: boolean;
|
|
166
|
+
forceHoverState?: boolean;
|
|
167
|
+
enablePointerHover?: boolean;
|
|
168
|
+
backgroundColor?: string;
|
|
169
|
+
animate?: boolean;
|
|
170
|
+
};
|
|
171
|
+
declare function Orb({ hue, autoHueShift, hueShiftMin, hueShiftMax, hueShiftHalfCycleSeconds, hoverIntensity, rotateOnHover, forceHoverState, enablePointerHover, backgroundColor, animate }: OrbProps): react_jsx_runtime.JSX.Element;
|
|
172
|
+
|
|
173
|
+
type NavaiHeroOrbProps = {
|
|
174
|
+
className?: string;
|
|
175
|
+
backgroundColor?: string;
|
|
176
|
+
isAgentSpeaking?: boolean;
|
|
177
|
+
hoverIntensitySpeaking?: number;
|
|
178
|
+
hoverIntensityIdle?: number;
|
|
179
|
+
revealDelayMs?: number;
|
|
180
|
+
autoplayDelayMs?: number;
|
|
181
|
+
};
|
|
182
|
+
declare function clampNavaiOrbDelayMs(value: number, fallback: number): number;
|
|
183
|
+
declare function NavaiHeroOrb({ className, backgroundColor, isAgentSpeaking, hoverIntensitySpeaking, hoverIntensityIdle, revealDelayMs, autoplayDelayMs }: NavaiHeroOrbProps): react_jsx_runtime.JSX.Element | null;
|
|
184
|
+
|
|
185
|
+
type NavaiVoiceOrbThemeMode = "light" | "dark";
|
|
186
|
+
type NavaiVoiceOrbPlacement = "inline" | "bottom-right" | "bottom-left";
|
|
187
|
+
type NavaiWebVoiceAgentLike = Pick<UseWebVoiceAgentResult, "status" | "agentVoiceState" | "error" | "isConnecting" | "isConnected" | "isAgentSpeaking" | "start" | "stop">;
|
|
188
|
+
type NavaiVoiceOrbMessages = {
|
|
189
|
+
ariaStart: string;
|
|
190
|
+
ariaStop: string;
|
|
191
|
+
idle: string;
|
|
192
|
+
connecting: string;
|
|
193
|
+
listening: string;
|
|
194
|
+
speaking: string;
|
|
195
|
+
errorPrefix: string;
|
|
196
|
+
};
|
|
197
|
+
type NavaiVoiceOrbRuntimeSnapshot = {
|
|
198
|
+
status: UseWebVoiceAgentResult["status"];
|
|
199
|
+
agentVoiceState: UseWebVoiceAgentResult["agentVoiceState"];
|
|
200
|
+
isAgentSpeaking: boolean;
|
|
201
|
+
error: string | null;
|
|
202
|
+
};
|
|
203
|
+
type NavaiVoiceOrbBaseProps = {
|
|
204
|
+
className?: string;
|
|
205
|
+
style?: CSSProperties;
|
|
206
|
+
themeMode?: NavaiVoiceOrbThemeMode;
|
|
207
|
+
placement?: NavaiVoiceOrbPlacement;
|
|
208
|
+
backgroundColorLight?: string;
|
|
209
|
+
backgroundColorDark?: string;
|
|
210
|
+
showStatus?: boolean;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
type NavaiMiniOrbDockProps = {
|
|
214
|
+
className?: string;
|
|
215
|
+
style?: CSSProperties;
|
|
216
|
+
themeMode?: NavaiVoiceOrbThemeMode;
|
|
217
|
+
placement?: NavaiVoiceOrbPlacement;
|
|
218
|
+
isActive?: boolean;
|
|
219
|
+
isConnected?: boolean;
|
|
220
|
+
isDisabled?: boolean;
|
|
221
|
+
isAgentSpeaking?: boolean;
|
|
222
|
+
animateOrb?: boolean;
|
|
223
|
+
backgroundColor?: string;
|
|
224
|
+
buttonAriaLabel: string;
|
|
225
|
+
buttonIcon?: ReactNode;
|
|
226
|
+
buttonType?: "button" | "submit" | "reset";
|
|
227
|
+
onButtonClick?: () => void;
|
|
228
|
+
statusMessage?: string;
|
|
229
|
+
isError?: boolean;
|
|
230
|
+
ariaMessage?: string;
|
|
231
|
+
};
|
|
232
|
+
declare function NavaiMiniOrbDock({ className, style, themeMode, placement, isActive, isConnected, isDisabled, isAgentSpeaking, animateOrb, backgroundColor, buttonAriaLabel, buttonIcon, buttonType, onButtonClick, statusMessage, isError, ariaMessage }: NavaiMiniOrbDockProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
|
|
234
|
+
type NavaiVoiceHeroOrbProps = Omit<NavaiHeroOrbProps, "backgroundColor" | "isAgentSpeaking"> & {
|
|
235
|
+
agent: NavaiWebVoiceAgentLike;
|
|
236
|
+
themeMode?: NavaiVoiceOrbThemeMode;
|
|
237
|
+
backgroundColorLight?: string;
|
|
238
|
+
backgroundColorDark?: string;
|
|
239
|
+
onRuntimeSnapshotChange?: (snapshot: NavaiVoiceOrbRuntimeSnapshot) => void;
|
|
240
|
+
};
|
|
241
|
+
declare function NavaiVoiceHeroOrb({ agent, themeMode, backgroundColorLight, backgroundColorDark, onRuntimeSnapshotChange, ...orbProps }: NavaiVoiceHeroOrbProps): react_jsx_runtime.JSX.Element;
|
|
242
|
+
|
|
243
|
+
declare function resolveNavaiVoiceOrbRuntimeSnapshot(agent: Pick<UseWebVoiceAgentResult, "status" | "agentVoiceState" | "isAgentSpeaking" | "error">): NavaiVoiceOrbRuntimeSnapshot;
|
|
244
|
+
type NavaiVoiceOrbDockProps = NavaiVoiceOrbBaseProps & {
|
|
245
|
+
agent: NavaiWebVoiceAgentLike;
|
|
246
|
+
messages?: Partial<NavaiVoiceOrbMessages>;
|
|
247
|
+
};
|
|
248
|
+
declare function NavaiVoiceOrbDock({ agent, className, style, themeMode, placement, backgroundColorLight, backgroundColorDark, showStatus, messages }: NavaiVoiceOrbDockProps): react_jsx_runtime.JSX.Element;
|
|
249
|
+
|
|
250
|
+
type NavaiVoiceOrbDockMicIconProps = {
|
|
251
|
+
isActive?: boolean;
|
|
252
|
+
size?: number;
|
|
253
|
+
};
|
|
254
|
+
declare function NavaiVoiceOrbDockMicIcon({ isActive, size }: NavaiVoiceOrbDockMicIconProps): react_jsx_runtime.JSX.Element;
|
|
255
|
+
|
|
256
|
+
export { type BuildNavaiAgentOptions, type BuildNavaiAgentResult, type CreateNavaiBackendClientOptions, type ExecuteNavaiBackendFunction, type ExecuteNavaiBackendFunctionInput, type NavaiAgentModuleConfig, type NavaiBackendClient, type NavaiBackendFunctionDefinition, type NavaiFunctionContext, type NavaiFunctionDefinition, type NavaiFunctionModuleLoaders, type NavaiFunctionPayload, type NavaiFunctionsRegistry, NavaiHeroOrb, type NavaiHeroOrbProps, NavaiMiniOrbDock, type NavaiMiniOrbDockProps, type NavaiRoute, type NavaiRuntimeAgentConfig, NavaiVoiceHeroOrb, type NavaiVoiceHeroOrbProps, type NavaiVoiceOrbBaseProps, NavaiVoiceOrbDock, NavaiVoiceOrbDockMicIcon, type NavaiVoiceOrbDockProps, type NavaiVoiceOrbMessages, type NavaiVoiceOrbPlacement, type NavaiVoiceOrbRuntimeSnapshot, type NavaiVoiceOrbThemeMode, type NavaiWebVoiceAgentLike, Orb, type OrbProps, type ResolveNavaiFrontendRuntimeConfigOptions, type ResolveNavaiFrontendRuntimeConfigResult, type UseWebVoiceAgentOptions, type UseWebVoiceAgentResult, buildNavaiAgent, clampNavaiOrbDelayMs, createNavaiBackendClient, getNavaiRoutePromptLines, loadNavaiFunctions, resolveNavaiFrontendRuntimeConfig, resolveNavaiRoute, resolveNavaiVoiceOrbRuntimeSnapshot, useWebVoiceAgent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { RealtimeAgent } from '@openai/agents/realtime';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type NavaiFunctionPayload = Record<string, unknown>;
|
|
4
6
|
type NavaiFunctionContext = {
|
|
@@ -27,6 +29,45 @@ type NavaiRoute = {
|
|
|
27
29
|
declare function resolveNavaiRoute(input: string, routes?: NavaiRoute[]): string | null;
|
|
28
30
|
declare function getNavaiRoutePromptLines(routes?: NavaiRoute[]): string[];
|
|
29
31
|
|
|
32
|
+
type NavaiFrontendEnv$2 = Record<string, unknown>;
|
|
33
|
+
type NavaiAgentModuleConfig = {
|
|
34
|
+
key?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
handoffDescription?: string;
|
|
38
|
+
instructions?: string;
|
|
39
|
+
isPrimary?: boolean;
|
|
40
|
+
};
|
|
41
|
+
type NavaiRuntimeAgentConfig = {
|
|
42
|
+
key: string;
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
handoffDescription?: string;
|
|
46
|
+
instructions?: string;
|
|
47
|
+
isPrimary: boolean;
|
|
48
|
+
functionModuleLoaders: NavaiFunctionModuleLoaders;
|
|
49
|
+
};
|
|
50
|
+
type ResolveNavaiFrontendRuntimeConfigOptions = {
|
|
51
|
+
moduleLoaders: NavaiFunctionModuleLoaders;
|
|
52
|
+
defaultRoutes: NavaiRoute[];
|
|
53
|
+
env?: NavaiFrontendEnv$2;
|
|
54
|
+
routesFile?: string;
|
|
55
|
+
functionsFolders?: string;
|
|
56
|
+
agentsFolders?: string;
|
|
57
|
+
modelOverride?: string;
|
|
58
|
+
defaultRoutesFile?: string;
|
|
59
|
+
defaultFunctionsFolder?: string;
|
|
60
|
+
};
|
|
61
|
+
type ResolveNavaiFrontendRuntimeConfigResult = {
|
|
62
|
+
routes: NavaiRoute[];
|
|
63
|
+
functionModuleLoaders: NavaiFunctionModuleLoaders;
|
|
64
|
+
agents: NavaiRuntimeAgentConfig[];
|
|
65
|
+
primaryAgentKey?: string;
|
|
66
|
+
modelOverride?: string;
|
|
67
|
+
warnings: string[];
|
|
68
|
+
};
|
|
69
|
+
declare function resolveNavaiFrontendRuntimeConfig(options: ResolveNavaiFrontendRuntimeConfigOptions): Promise<ResolveNavaiFrontendRuntimeConfigResult>;
|
|
70
|
+
|
|
30
71
|
type NavaiBackendFunctionDefinition = {
|
|
31
72
|
name: string;
|
|
32
73
|
description?: string;
|
|
@@ -40,6 +81,8 @@ type ExecuteNavaiBackendFunction = (input: ExecuteNavaiBackendFunctionInput) =>
|
|
|
40
81
|
type BuildNavaiAgentOptions = NavaiFunctionContext & {
|
|
41
82
|
routes: NavaiRoute[];
|
|
42
83
|
functionModuleLoaders?: NavaiFunctionModuleLoaders;
|
|
84
|
+
agents?: NavaiRuntimeAgentConfig[];
|
|
85
|
+
primaryAgentKey?: string;
|
|
43
86
|
backendFunctions?: NavaiBackendFunctionDefinition[];
|
|
44
87
|
executeBackendFunction?: ExecuteNavaiBackendFunction;
|
|
45
88
|
agentName?: string;
|
|
@@ -51,7 +94,7 @@ type BuildNavaiAgentResult = {
|
|
|
51
94
|
};
|
|
52
95
|
declare function buildNavaiAgent(options: BuildNavaiAgentOptions): Promise<BuildNavaiAgentResult>;
|
|
53
96
|
|
|
54
|
-
type NavaiFrontendEnv$
|
|
97
|
+
type NavaiFrontendEnv$1 = Record<string, string | undefined>;
|
|
55
98
|
type CreateClientSecretInput = {
|
|
56
99
|
model?: string;
|
|
57
100
|
voice?: string;
|
|
@@ -71,7 +114,7 @@ type BackendFunctionsResult = {
|
|
|
71
114
|
};
|
|
72
115
|
type CreateNavaiBackendClientOptions = {
|
|
73
116
|
apiBaseUrl?: string;
|
|
74
|
-
env?: NavaiFrontendEnv$
|
|
117
|
+
env?: NavaiFrontendEnv$1;
|
|
75
118
|
fetchImpl?: typeof fetch;
|
|
76
119
|
clientSecretPath?: string;
|
|
77
120
|
functionsListPath?: string;
|
|
@@ -84,25 +127,6 @@ type NavaiBackendClient = {
|
|
|
84
127
|
};
|
|
85
128
|
declare function createNavaiBackendClient(options?: CreateNavaiBackendClientOptions): NavaiBackendClient;
|
|
86
129
|
|
|
87
|
-
type NavaiFrontendEnv$1 = Record<string, unknown>;
|
|
88
|
-
type ResolveNavaiFrontendRuntimeConfigOptions = {
|
|
89
|
-
moduleLoaders: NavaiFunctionModuleLoaders;
|
|
90
|
-
defaultRoutes: NavaiRoute[];
|
|
91
|
-
env?: NavaiFrontendEnv$1;
|
|
92
|
-
routesFile?: string;
|
|
93
|
-
functionsFolders?: string;
|
|
94
|
-
modelOverride?: string;
|
|
95
|
-
defaultRoutesFile?: string;
|
|
96
|
-
defaultFunctionsFolder?: string;
|
|
97
|
-
};
|
|
98
|
-
type ResolveNavaiFrontendRuntimeConfigResult = {
|
|
99
|
-
routes: NavaiRoute[];
|
|
100
|
-
functionModuleLoaders: NavaiFunctionModuleLoaders;
|
|
101
|
-
modelOverride?: string;
|
|
102
|
-
warnings: string[];
|
|
103
|
-
};
|
|
104
|
-
declare function resolveNavaiFrontendRuntimeConfig(options: ResolveNavaiFrontendRuntimeConfigOptions): Promise<ResolveNavaiFrontendRuntimeConfigResult>;
|
|
105
|
-
|
|
106
130
|
type VoiceStatus = "idle" | "connecting" | "connected" | "error";
|
|
107
131
|
type AgentVoiceState = "idle" | "speaking";
|
|
108
132
|
type NavaiFrontendEnv = Record<string, string | undefined>;
|
|
@@ -114,6 +138,7 @@ type UseWebVoiceAgentOptions = {
|
|
|
114
138
|
apiBaseUrl?: string;
|
|
115
139
|
routesFile?: string;
|
|
116
140
|
functionsFolders?: string;
|
|
141
|
+
agentsFolders?: string;
|
|
117
142
|
modelOverride?: string;
|
|
118
143
|
defaultRoutesFile?: string;
|
|
119
144
|
defaultFunctionsFolder?: string;
|
|
@@ -130,4 +155,102 @@ type UseWebVoiceAgentResult = {
|
|
|
130
155
|
};
|
|
131
156
|
declare function useWebVoiceAgent(options: UseWebVoiceAgentOptions): UseWebVoiceAgentResult;
|
|
132
157
|
|
|
133
|
-
|
|
158
|
+
type OrbProps = {
|
|
159
|
+
hue?: number;
|
|
160
|
+
autoHueShift?: boolean;
|
|
161
|
+
hueShiftMin?: number;
|
|
162
|
+
hueShiftMax?: number;
|
|
163
|
+
hueShiftHalfCycleSeconds?: number;
|
|
164
|
+
hoverIntensity?: number;
|
|
165
|
+
rotateOnHover?: boolean;
|
|
166
|
+
forceHoverState?: boolean;
|
|
167
|
+
enablePointerHover?: boolean;
|
|
168
|
+
backgroundColor?: string;
|
|
169
|
+
animate?: boolean;
|
|
170
|
+
};
|
|
171
|
+
declare function Orb({ hue, autoHueShift, hueShiftMin, hueShiftMax, hueShiftHalfCycleSeconds, hoverIntensity, rotateOnHover, forceHoverState, enablePointerHover, backgroundColor, animate }: OrbProps): react_jsx_runtime.JSX.Element;
|
|
172
|
+
|
|
173
|
+
type NavaiHeroOrbProps = {
|
|
174
|
+
className?: string;
|
|
175
|
+
backgroundColor?: string;
|
|
176
|
+
isAgentSpeaking?: boolean;
|
|
177
|
+
hoverIntensitySpeaking?: number;
|
|
178
|
+
hoverIntensityIdle?: number;
|
|
179
|
+
revealDelayMs?: number;
|
|
180
|
+
autoplayDelayMs?: number;
|
|
181
|
+
};
|
|
182
|
+
declare function clampNavaiOrbDelayMs(value: number, fallback: number): number;
|
|
183
|
+
declare function NavaiHeroOrb({ className, backgroundColor, isAgentSpeaking, hoverIntensitySpeaking, hoverIntensityIdle, revealDelayMs, autoplayDelayMs }: NavaiHeroOrbProps): react_jsx_runtime.JSX.Element | null;
|
|
184
|
+
|
|
185
|
+
type NavaiVoiceOrbThemeMode = "light" | "dark";
|
|
186
|
+
type NavaiVoiceOrbPlacement = "inline" | "bottom-right" | "bottom-left";
|
|
187
|
+
type NavaiWebVoiceAgentLike = Pick<UseWebVoiceAgentResult, "status" | "agentVoiceState" | "error" | "isConnecting" | "isConnected" | "isAgentSpeaking" | "start" | "stop">;
|
|
188
|
+
type NavaiVoiceOrbMessages = {
|
|
189
|
+
ariaStart: string;
|
|
190
|
+
ariaStop: string;
|
|
191
|
+
idle: string;
|
|
192
|
+
connecting: string;
|
|
193
|
+
listening: string;
|
|
194
|
+
speaking: string;
|
|
195
|
+
errorPrefix: string;
|
|
196
|
+
};
|
|
197
|
+
type NavaiVoiceOrbRuntimeSnapshot = {
|
|
198
|
+
status: UseWebVoiceAgentResult["status"];
|
|
199
|
+
agentVoiceState: UseWebVoiceAgentResult["agentVoiceState"];
|
|
200
|
+
isAgentSpeaking: boolean;
|
|
201
|
+
error: string | null;
|
|
202
|
+
};
|
|
203
|
+
type NavaiVoiceOrbBaseProps = {
|
|
204
|
+
className?: string;
|
|
205
|
+
style?: CSSProperties;
|
|
206
|
+
themeMode?: NavaiVoiceOrbThemeMode;
|
|
207
|
+
placement?: NavaiVoiceOrbPlacement;
|
|
208
|
+
backgroundColorLight?: string;
|
|
209
|
+
backgroundColorDark?: string;
|
|
210
|
+
showStatus?: boolean;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
type NavaiMiniOrbDockProps = {
|
|
214
|
+
className?: string;
|
|
215
|
+
style?: CSSProperties;
|
|
216
|
+
themeMode?: NavaiVoiceOrbThemeMode;
|
|
217
|
+
placement?: NavaiVoiceOrbPlacement;
|
|
218
|
+
isActive?: boolean;
|
|
219
|
+
isConnected?: boolean;
|
|
220
|
+
isDisabled?: boolean;
|
|
221
|
+
isAgentSpeaking?: boolean;
|
|
222
|
+
animateOrb?: boolean;
|
|
223
|
+
backgroundColor?: string;
|
|
224
|
+
buttonAriaLabel: string;
|
|
225
|
+
buttonIcon?: ReactNode;
|
|
226
|
+
buttonType?: "button" | "submit" | "reset";
|
|
227
|
+
onButtonClick?: () => void;
|
|
228
|
+
statusMessage?: string;
|
|
229
|
+
isError?: boolean;
|
|
230
|
+
ariaMessage?: string;
|
|
231
|
+
};
|
|
232
|
+
declare function NavaiMiniOrbDock({ className, style, themeMode, placement, isActive, isConnected, isDisabled, isAgentSpeaking, animateOrb, backgroundColor, buttonAriaLabel, buttonIcon, buttonType, onButtonClick, statusMessage, isError, ariaMessage }: NavaiMiniOrbDockProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
|
|
234
|
+
type NavaiVoiceHeroOrbProps = Omit<NavaiHeroOrbProps, "backgroundColor" | "isAgentSpeaking"> & {
|
|
235
|
+
agent: NavaiWebVoiceAgentLike;
|
|
236
|
+
themeMode?: NavaiVoiceOrbThemeMode;
|
|
237
|
+
backgroundColorLight?: string;
|
|
238
|
+
backgroundColorDark?: string;
|
|
239
|
+
onRuntimeSnapshotChange?: (snapshot: NavaiVoiceOrbRuntimeSnapshot) => void;
|
|
240
|
+
};
|
|
241
|
+
declare function NavaiVoiceHeroOrb({ agent, themeMode, backgroundColorLight, backgroundColorDark, onRuntimeSnapshotChange, ...orbProps }: NavaiVoiceHeroOrbProps): react_jsx_runtime.JSX.Element;
|
|
242
|
+
|
|
243
|
+
declare function resolveNavaiVoiceOrbRuntimeSnapshot(agent: Pick<UseWebVoiceAgentResult, "status" | "agentVoiceState" | "isAgentSpeaking" | "error">): NavaiVoiceOrbRuntimeSnapshot;
|
|
244
|
+
type NavaiVoiceOrbDockProps = NavaiVoiceOrbBaseProps & {
|
|
245
|
+
agent: NavaiWebVoiceAgentLike;
|
|
246
|
+
messages?: Partial<NavaiVoiceOrbMessages>;
|
|
247
|
+
};
|
|
248
|
+
declare function NavaiVoiceOrbDock({ agent, className, style, themeMode, placement, backgroundColorLight, backgroundColorDark, showStatus, messages }: NavaiVoiceOrbDockProps): react_jsx_runtime.JSX.Element;
|
|
249
|
+
|
|
250
|
+
type NavaiVoiceOrbDockMicIconProps = {
|
|
251
|
+
isActive?: boolean;
|
|
252
|
+
size?: number;
|
|
253
|
+
};
|
|
254
|
+
declare function NavaiVoiceOrbDockMicIcon({ isActive, size }: NavaiVoiceOrbDockMicIconProps): react_jsx_runtime.JSX.Element;
|
|
255
|
+
|
|
256
|
+
export { type BuildNavaiAgentOptions, type BuildNavaiAgentResult, type CreateNavaiBackendClientOptions, type ExecuteNavaiBackendFunction, type ExecuteNavaiBackendFunctionInput, type NavaiAgentModuleConfig, type NavaiBackendClient, type NavaiBackendFunctionDefinition, type NavaiFunctionContext, type NavaiFunctionDefinition, type NavaiFunctionModuleLoaders, type NavaiFunctionPayload, type NavaiFunctionsRegistry, NavaiHeroOrb, type NavaiHeroOrbProps, NavaiMiniOrbDock, type NavaiMiniOrbDockProps, type NavaiRoute, type NavaiRuntimeAgentConfig, NavaiVoiceHeroOrb, type NavaiVoiceHeroOrbProps, type NavaiVoiceOrbBaseProps, NavaiVoiceOrbDock, NavaiVoiceOrbDockMicIcon, type NavaiVoiceOrbDockProps, type NavaiVoiceOrbMessages, type NavaiVoiceOrbPlacement, type NavaiVoiceOrbRuntimeSnapshot, type NavaiVoiceOrbThemeMode, type NavaiWebVoiceAgentLike, Orb, type OrbProps, type ResolveNavaiFrontendRuntimeConfigOptions, type ResolveNavaiFrontendRuntimeConfigResult, type UseWebVoiceAgentOptions, type UseWebVoiceAgentResult, buildNavaiAgent, clampNavaiOrbDelayMs, createNavaiBackendClient, getNavaiRoutePromptLines, loadNavaiFunctions, resolveNavaiFrontendRuntimeConfig, resolveNavaiRoute, resolveNavaiVoiceOrbRuntimeSnapshot, useWebVoiceAgent };
|