@unctad-ai/voice-agent-core 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/defaults.d.ts +128 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +169 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/contexts/SiteConfigContext.d.ts +7 -0
- package/dist/contexts/SiteConfigContext.d.ts.map +1 -0
- package/dist/contexts/SiteConfigContext.js +14 -0
- package/dist/contexts/SiteConfigContext.js.map +1 -0
- package/dist/hooks/useAudioPlayback.d.ts +18 -0
- package/dist/hooks/useAudioPlayback.d.ts.map +1 -0
- package/dist/hooks/useAudioPlayback.js +482 -0
- package/dist/hooks/useAudioPlayback.js.map +1 -0
- package/dist/hooks/useTenVAD.d.ts +42 -0
- package/dist/hooks/useTenVAD.d.ts.map +1 -0
- package/dist/hooks/useTenVAD.js +318 -0
- package/dist/hooks/useTenVAD.js.map +1 -0
- package/dist/hooks/useVoiceAgent.d.ts +50 -0
- package/dist/hooks/useVoiceAgent.d.ts.map +1 -0
- package/dist/hooks/useVoiceAgent.js +1005 -0
- package/dist/hooks/useVoiceAgent.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/services/voiceApi.d.ts +22 -0
- package/dist/services/voiceApi.d.ts.map +1 -0
- package/dist/services/voiceApi.js +93 -0
- package/dist/services/voiceApi.js.map +1 -0
- package/dist/types/config.d.ts +53 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/errors.d.ts +2 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +2 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/settings.d.ts +26 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +2 -0
- package/dist/types/settings.js.map +1 -0
- package/dist/types/voice.d.ts +20 -0
- package/dist/types/voice.d.ts.map +1 -0
- package/dist/types/voice.js +11 -0
- package/dist/types/voice.js.map +1 -0
- package/dist/utils/audioUtils.d.ts +2 -0
- package/dist/utils/audioUtils.d.ts.map +1 -0
- package/dist/utils/audioUtils.js +30 -0
- package/dist/utils/audioUtils.js.map +1 -0
- package/dist/utils/wavParser.d.ts +27 -0
- package/dist/utils/wavParser.d.ts.map +1 -0
- package/dist/utils/wavParser.js +75 -0
- package/dist/utils/wavParser.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { ActionCategory, OrbState } from '../types/voice';
|
|
2
|
+
import type { VoiceThresholds } from '../types/config';
|
|
3
|
+
export declare const VAD: {
|
|
4
|
+
readonly hopSize: 256;
|
|
5
|
+
readonly threshold: 0.5;
|
|
6
|
+
readonly positiveSpeechThreshold: 0.6;
|
|
7
|
+
readonly negativeSpeechThreshold: 0.35;
|
|
8
|
+
readonly redemptionMs: 600;
|
|
9
|
+
readonly minSpeechMs: 500;
|
|
10
|
+
readonly preSpeechPadMs: 400;
|
|
11
|
+
};
|
|
12
|
+
export declare const MIN_AUDIO_RMS = 0.02;
|
|
13
|
+
export declare const MAX_NO_SPEECH_PROB = 0.6;
|
|
14
|
+
export declare const MIN_AVG_LOGPROB = -0.7;
|
|
15
|
+
export declare const BARGE_IN: {
|
|
16
|
+
readonly threshold: 0.7;
|
|
17
|
+
readonly framesRequired: 5;
|
|
18
|
+
};
|
|
19
|
+
export declare const SILENT_MARKER = "[SILENT]";
|
|
20
|
+
export declare const END_SESSION_MARKER = "[END_SESSION]";
|
|
21
|
+
export declare const MIC_TOGGLE_DEBOUNCE_MS = 300;
|
|
22
|
+
export declare const GUARD_DELAY_MS = 200;
|
|
23
|
+
export declare const MAX_STT_RETRIES = 2;
|
|
24
|
+
export declare const RETRY_BASE_DELAY_MS = 500;
|
|
25
|
+
export declare const MISFIRE_DISMISS_MS = 2500;
|
|
26
|
+
export declare const LLM_ERROR_DISMISS_MS = 4000;
|
|
27
|
+
export declare const LLM_RESPONSE_TIMEOUT_MS = 20000;
|
|
28
|
+
export declare const PIPELINE_TIMEOUT_MS = 90000;
|
|
29
|
+
export declare const HEALTH_CHECK_TIMEOUT_MS = 6000;
|
|
30
|
+
export declare const STT_TIMEOUT_MS = 15000;
|
|
31
|
+
export declare const TTS_TIMEOUT_MS = 55000;
|
|
32
|
+
export declare const RECOVERY_POLL_MS = 30000;
|
|
33
|
+
export declare const IDLE_TIMEOUT_MS = 60000;
|
|
34
|
+
export declare const WIND_DOWN_MS = 10000;
|
|
35
|
+
export declare const EXIT_ANIMATION_MS = 550;
|
|
36
|
+
export declare const MAX_VISIBLE_MESSAGES = 2;
|
|
37
|
+
export declare const MAX_TEXT_LENGTH = 180;
|
|
38
|
+
export declare const TYPEWRITER_DELAY_MS = 30;
|
|
39
|
+
export declare const MIN_DISPLAY_LENGTH = 10;
|
|
40
|
+
export declare const WAVEFORM_NUM_BARS = 64;
|
|
41
|
+
export declare const WAVEFORM_MIN_BAR_HEIGHT = 5;
|
|
42
|
+
export declare const WAVEFORM_MAX_BAR_HEIGHT = 40;
|
|
43
|
+
export declare const WAVEFORM_GAP = 12;
|
|
44
|
+
export declare const WAVEFORM_SMOOTHING = 0.15;
|
|
45
|
+
export declare const ORB_NUM_POINTS = 10;
|
|
46
|
+
export declare const ORB_LERP_SPEED = 0.06;
|
|
47
|
+
export declare const MIC_IDLE_TIMEOUT_MS = 60000;
|
|
48
|
+
export declare const PANEL_COLLAPSE_TIMEOUT_MS = 300000;
|
|
49
|
+
export declare const SHOW_PIPELINE_METRICS = false;
|
|
50
|
+
export declare const PIPELINE_METRICS_AUTO_HIDE_MS = 8000;
|
|
51
|
+
export declare const PANEL_WIDTH = 392;
|
|
52
|
+
export declare const PANEL_COLLAPSED_HEIGHT = 64;
|
|
53
|
+
export declare const PANEL_EXPANDED_HEIGHT = 480;
|
|
54
|
+
export declare const PANEL_BORDER_RADIUS = 26;
|
|
55
|
+
export declare const PANEL_BOTTOM = 24;
|
|
56
|
+
export declare const PANEL_RIGHT = 24;
|
|
57
|
+
export declare const PANEL_Z_INDEX = 2147483646;
|
|
58
|
+
export declare const SPRING_PANEL: {
|
|
59
|
+
type: "spring";
|
|
60
|
+
stiffness: number;
|
|
61
|
+
damping: number;
|
|
62
|
+
mass: number;
|
|
63
|
+
};
|
|
64
|
+
export declare const SPRING_CONTENT: {
|
|
65
|
+
type: "spring";
|
|
66
|
+
stiffness: number;
|
|
67
|
+
damping: number;
|
|
68
|
+
mass: number;
|
|
69
|
+
};
|
|
70
|
+
export declare const SPRING_MICRO: {
|
|
71
|
+
type: "spring";
|
|
72
|
+
stiffness: number;
|
|
73
|
+
damping: number;
|
|
74
|
+
mass: number;
|
|
75
|
+
};
|
|
76
|
+
export declare const SPRING_PANEL_EXIT: {
|
|
77
|
+
type: "spring";
|
|
78
|
+
stiffness: number;
|
|
79
|
+
damping: number;
|
|
80
|
+
mass: number;
|
|
81
|
+
};
|
|
82
|
+
export declare const PANEL_MAX_VISIBLE_MESSAGES = 50;
|
|
83
|
+
export declare const PANEL_MAX_TEXT_LENGTH = 5000;
|
|
84
|
+
export declare const TTS_STREAM_CHUNK_MS = 250;
|
|
85
|
+
export declare const WAV_HEADER_SIZE = 44;
|
|
86
|
+
export declare const ACTION_BADGE_CONFIG: Record<string, {
|
|
87
|
+
category: ActionCategory;
|
|
88
|
+
label: string;
|
|
89
|
+
}>;
|
|
90
|
+
export declare const DEFAULT_VOLUME = 1;
|
|
91
|
+
export declare const DEFAULT_PLAYBACK_SPEED = 1;
|
|
92
|
+
export declare const DEFAULT_TTS_ENABLED = true;
|
|
93
|
+
export declare const DEFAULT_AUTO_LISTEN = true;
|
|
94
|
+
export declare const DEFAULT_IDLE_TIMEOUT_MS = 60000;
|
|
95
|
+
export declare const DEFAULT_EXPRESSIVENESS = 0.3;
|
|
96
|
+
export declare const DEFAULT_RESPONSE_LENGTH = 60;
|
|
97
|
+
export declare const DEFAULT_SHOW_PIPELINE_METRICS = false;
|
|
98
|
+
export declare const DEFAULT_PIPELINE_METRICS_AUTO_HIDE_MS = 8000;
|
|
99
|
+
export declare const DEFAULT_SPEECH_THRESHOLD = 0.6;
|
|
100
|
+
export declare const DEFAULT_PAUSE_TOLERANCE_MS = 600;
|
|
101
|
+
export declare const DEFAULT_BARGE_IN_THRESHOLD = 0.7;
|
|
102
|
+
export declare const DEFAULT_PANEL_COLLAPSE_TIMEOUT_MS = 300000;
|
|
103
|
+
export declare const DEFAULT_STT_TIMEOUT_MS = 15000;
|
|
104
|
+
export declare const DEFAULT_TTS_TIMEOUT_MS = 55000;
|
|
105
|
+
export declare const DEFAULT_LLM_TIMEOUT_MS = 20000;
|
|
106
|
+
export declare const DEFAULT_MIN_AUDIO_RMS = 0.02;
|
|
107
|
+
export declare const DOT_RING_COUNT = 24;
|
|
108
|
+
export declare const DOT_RING_GAP = 6;
|
|
109
|
+
export declare const DOT_RING_BASE_RADIUS = 2;
|
|
110
|
+
export declare const DOT_RING_PEAK_RADIUS = 4;
|
|
111
|
+
export declare const DOT_RING_SMOOTHING = 0.12;
|
|
112
|
+
export declare const AVATAR_PORTRAIT_RATIO = 0.88;
|
|
113
|
+
export declare const AVATAR_STATE_FILTERS: Record<OrbState, {
|
|
114
|
+
brightness: number;
|
|
115
|
+
saturate: number;
|
|
116
|
+
opacity: number;
|
|
117
|
+
scale: number;
|
|
118
|
+
glowIntensity: number;
|
|
119
|
+
}>;
|
|
120
|
+
export declare const DEFAULT_THRESHOLDS: VoiceThresholds;
|
|
121
|
+
/** Build glow colors from SiteConfig.colors at runtime */
|
|
122
|
+
export declare function buildGlowColors(colors: {
|
|
123
|
+
primary: string;
|
|
124
|
+
processing: string;
|
|
125
|
+
speaking: string;
|
|
126
|
+
error?: string;
|
|
127
|
+
}): Record<OrbState, string>;
|
|
128
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD,eAAO,MAAM,GAAG;;;;;;;;CAQN,CAAC;AAEX,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAMX,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAM1C,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAC7C,eAAO,MAAM,cAAc,QAAS,CAAC;AACrC,eAAO,MAAM,cAAc,QAAS,CAAC;AACrC,eAAO,MAAM,gBAAgB,QAAS,CAAC;AAMvC,eAAO,MAAM,eAAe,QAAS,CAAC;AACtC,eAAO,MAAM,YAAY,QAAS,CAAC;AACnC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAMrC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM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CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAQ3I"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Audio & Speech Detection
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export const VAD = {
|
|
5
|
+
hopSize: 256,
|
|
6
|
+
threshold: 0.5,
|
|
7
|
+
positiveSpeechThreshold: 0.6,
|
|
8
|
+
negativeSpeechThreshold: 0.35,
|
|
9
|
+
redemptionMs: 600,
|
|
10
|
+
minSpeechMs: 500,
|
|
11
|
+
preSpeechPadMs: 400,
|
|
12
|
+
};
|
|
13
|
+
export const MIN_AUDIO_RMS = 0.02;
|
|
14
|
+
export const MAX_NO_SPEECH_PROB = 0.6;
|
|
15
|
+
export const MIN_AVG_LOGPROB = -0.7;
|
|
16
|
+
export const BARGE_IN = {
|
|
17
|
+
threshold: 0.7,
|
|
18
|
+
framesRequired: 5,
|
|
19
|
+
};
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Pipeline Behavior
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
export const SILENT_MARKER = '[SILENT]';
|
|
24
|
+
export const END_SESSION_MARKER = '[END_SESSION]';
|
|
25
|
+
export const MIC_TOGGLE_DEBOUNCE_MS = 300;
|
|
26
|
+
export const GUARD_DELAY_MS = 200;
|
|
27
|
+
export const MAX_STT_RETRIES = 2;
|
|
28
|
+
export const RETRY_BASE_DELAY_MS = 500;
|
|
29
|
+
export const MISFIRE_DISMISS_MS = 2500;
|
|
30
|
+
export const LLM_ERROR_DISMISS_MS = 4000;
|
|
31
|
+
export const LLM_RESPONSE_TIMEOUT_MS = 20_000;
|
|
32
|
+
export const PIPELINE_TIMEOUT_MS = 90_000;
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Network Timeouts
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
export const HEALTH_CHECK_TIMEOUT_MS = 6_000;
|
|
37
|
+
export const STT_TIMEOUT_MS = 15_000;
|
|
38
|
+
export const TTS_TIMEOUT_MS = 55_000;
|
|
39
|
+
export const RECOVERY_POLL_MS = 30_000;
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Overlay & Idle
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
export const IDLE_TIMEOUT_MS = 60_000;
|
|
44
|
+
export const WIND_DOWN_MS = 10_000;
|
|
45
|
+
export const EXIT_ANIMATION_MS = 550;
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// Transcript
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
export const MAX_VISIBLE_MESSAGES = 2;
|
|
50
|
+
export const MAX_TEXT_LENGTH = 180;
|
|
51
|
+
export const TYPEWRITER_DELAY_MS = 30;
|
|
52
|
+
export const MIN_DISPLAY_LENGTH = 10;
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Waveform Canvas
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
export const WAVEFORM_NUM_BARS = 64;
|
|
57
|
+
export const WAVEFORM_MIN_BAR_HEIGHT = 5;
|
|
58
|
+
export const WAVEFORM_MAX_BAR_HEIGHT = 40;
|
|
59
|
+
export const WAVEFORM_GAP = 12;
|
|
60
|
+
export const WAVEFORM_SMOOTHING = 0.15;
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Orb Animation
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
export const ORB_NUM_POINTS = 10;
|
|
65
|
+
export const ORB_LERP_SPEED = 0.06;
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
// Glass Copilot Panel
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
export const MIC_IDLE_TIMEOUT_MS = 60_000;
|
|
70
|
+
export const PANEL_COLLAPSE_TIMEOUT_MS = 300_000;
|
|
71
|
+
export const SHOW_PIPELINE_METRICS = false;
|
|
72
|
+
export const PIPELINE_METRICS_AUTO_HIDE_MS = 8_000;
|
|
73
|
+
export const PANEL_WIDTH = 392;
|
|
74
|
+
export const PANEL_COLLAPSED_HEIGHT = 64;
|
|
75
|
+
export const PANEL_EXPANDED_HEIGHT = 480;
|
|
76
|
+
export const PANEL_BORDER_RADIUS = 26;
|
|
77
|
+
export const PANEL_BOTTOM = 24;
|
|
78
|
+
export const PANEL_RIGHT = 24;
|
|
79
|
+
export const PANEL_Z_INDEX = 2147483646;
|
|
80
|
+
export const SPRING_PANEL = { type: 'spring', stiffness: 320, damping: 34, mass: 1.0 };
|
|
81
|
+
export const SPRING_CONTENT = { type: 'spring', stiffness: 340, damping: 32, mass: 0.7 };
|
|
82
|
+
export const SPRING_MICRO = { type: 'spring', stiffness: 500, damping: 30, mass: 0.5 };
|
|
83
|
+
export const SPRING_PANEL_EXIT = { type: 'spring', stiffness: 380, damping: 38, mass: 0.8 };
|
|
84
|
+
export const PANEL_MAX_VISIBLE_MESSAGES = 50;
|
|
85
|
+
export const PANEL_MAX_TEXT_LENGTH = 5000;
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// Streaming TTS Playback
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
export const TTS_STREAM_CHUNK_MS = 250;
|
|
90
|
+
export const WAV_HEADER_SIZE = 44;
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// Action Badge Config
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
export const ACTION_BADGE_CONFIG = {
|
|
95
|
+
navigateTo: { category: 'navigation', label: 'Navigated' },
|
|
96
|
+
viewService: { category: 'navigation', label: 'Opened service' },
|
|
97
|
+
startApplication: { category: 'navigation', label: 'Started application' },
|
|
98
|
+
searchServices: { category: 'search', label: 'Searched services' },
|
|
99
|
+
getServiceDetails: { category: 'info', label: 'Fetched details' },
|
|
100
|
+
listServicesByCategory: { category: 'info', label: 'Listed services' },
|
|
101
|
+
compareServices: { category: 'info', label: 'Compared services' },
|
|
102
|
+
recommendServices: { category: 'info', label: 'Recommendations' },
|
|
103
|
+
getFormSchema: { category: 'form', label: 'Reading form' },
|
|
104
|
+
fillFormFields: { category: 'form', label: 'Form fill' },
|
|
105
|
+
performUIAction: { category: 'ui', label: 'Action' },
|
|
106
|
+
};
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
// Voice Settings Defaults
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
export const DEFAULT_VOLUME = 1.0;
|
|
111
|
+
export const DEFAULT_PLAYBACK_SPEED = 1.0;
|
|
112
|
+
export const DEFAULT_TTS_ENABLED = true;
|
|
113
|
+
export const DEFAULT_AUTO_LISTEN = true;
|
|
114
|
+
export const DEFAULT_IDLE_TIMEOUT_MS = 60_000;
|
|
115
|
+
export const DEFAULT_EXPRESSIVENESS = 0.3;
|
|
116
|
+
export const DEFAULT_RESPONSE_LENGTH = 60;
|
|
117
|
+
export const DEFAULT_SHOW_PIPELINE_METRICS = false;
|
|
118
|
+
export const DEFAULT_PIPELINE_METRICS_AUTO_HIDE_MS = 8_000;
|
|
119
|
+
export const DEFAULT_SPEECH_THRESHOLD = 0.6;
|
|
120
|
+
export const DEFAULT_PAUSE_TOLERANCE_MS = 600;
|
|
121
|
+
export const DEFAULT_BARGE_IN_THRESHOLD = 0.7;
|
|
122
|
+
export const DEFAULT_PANEL_COLLAPSE_TIMEOUT_MS = 300_000;
|
|
123
|
+
export const DEFAULT_STT_TIMEOUT_MS = 15_000;
|
|
124
|
+
export const DEFAULT_TTS_TIMEOUT_MS = 55_000;
|
|
125
|
+
export const DEFAULT_LLM_TIMEOUT_MS = 20_000;
|
|
126
|
+
export const DEFAULT_MIN_AUDIO_RMS = 0.02;
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
// Dot Ring
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
export const DOT_RING_COUNT = 24;
|
|
131
|
+
export const DOT_RING_GAP = 6;
|
|
132
|
+
export const DOT_RING_BASE_RADIUS = 2;
|
|
133
|
+
export const DOT_RING_PEAK_RADIUS = 4;
|
|
134
|
+
export const DOT_RING_SMOOTHING = 0.12;
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
// Agent Avatar
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
export const AVATAR_PORTRAIT_RATIO = 0.88;
|
|
139
|
+
export const AVATAR_STATE_FILTERS = {
|
|
140
|
+
idle: { brightness: 0.92, saturate: 0.85, opacity: 0.95, scale: 1.0, glowIntensity: 0 },
|
|
141
|
+
listening: { brightness: 1.1, saturate: 1.15, opacity: 1.0, scale: 1.02, glowIntensity: 0.12 },
|
|
142
|
+
processing: { brightness: 1.0, saturate: 1.0, opacity: 0.92, scale: 1.0, glowIntensity: 0.08 },
|
|
143
|
+
speaking: { brightness: 1.08, saturate: 1.1, opacity: 1.0, scale: 1.0, glowIntensity: 0.1 },
|
|
144
|
+
error: { brightness: 0.75, saturate: 0.6, opacity: 0.88, scale: 0.98, glowIntensity: 0.18 },
|
|
145
|
+
};
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
// Default Thresholds (overridable via SiteConfig.thresholdOverrides)
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
export const DEFAULT_THRESHOLDS = {
|
|
150
|
+
positiveSpeechThreshold: 0.6,
|
|
151
|
+
negativeSpeechThreshold: 0.35,
|
|
152
|
+
minSpeechFrames: 5,
|
|
153
|
+
preSpeechPadFrames: 3,
|
|
154
|
+
redemptionFrames: 5,
|
|
155
|
+
minAudioRms: 0.02,
|
|
156
|
+
maxNoSpeechProb: 0.6,
|
|
157
|
+
minAvgLogprob: -0.7,
|
|
158
|
+
};
|
|
159
|
+
/** Build glow colors from SiteConfig.colors at runtime */
|
|
160
|
+
export function buildGlowColors(colors) {
|
|
161
|
+
return {
|
|
162
|
+
idle: 'transparent',
|
|
163
|
+
listening: colors.primary,
|
|
164
|
+
processing: colors.processing,
|
|
165
|
+
speaking: colors.speaking,
|
|
166
|
+
error: colors.error ?? '#DC2626',
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,OAAO,EAAE,GAAG;IACZ,SAAS,EAAE,GAAG;IACd,uBAAuB,EAAE,GAAG;IAC5B,uBAAuB,EAAE,IAAI;IAC7B,YAAY,EAAE,GAAG;IACjB,WAAW,EAAE,GAAG;IAChB,cAAc,EAAE,GAAG;CACX,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,CAAC;AAEpC,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,SAAS,EAAE,GAAG;IACd,cAAc,EAAE,CAAC;CACT,CAAC;AAEX,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;AACxC,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAElD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC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aAAa;QACnB,SAAS,EAAE,MAAM,CAAC,OAAO;QACzB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,SAAS;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SiteConfig } from '../types/config';
|
|
2
|
+
export declare function SiteConfigProvider({ config, children, }: {
|
|
3
|
+
config: SiteConfig;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function useSiteConfig(): SiteConfig;
|
|
7
|
+
//# sourceMappingURL=SiteConfigContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteConfigContext.d.ts","sourceRoot":"","sources":["../../src/contexts/SiteConfigContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAMA;AAED,wBAAgB,aAAa,IAAI,UAAU,CAM1C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
const SiteConfigContext = createContext(null);
|
|
4
|
+
export function SiteConfigProvider({ config, children, }) {
|
|
5
|
+
return (_jsx(SiteConfigContext.Provider, { value: config, children: children }));
|
|
6
|
+
}
|
|
7
|
+
export function useSiteConfig() {
|
|
8
|
+
const config = useContext(SiteConfigContext);
|
|
9
|
+
if (!config) {
|
|
10
|
+
throw new Error('useSiteConfig must be used within a SiteConfigProvider');
|
|
11
|
+
}
|
|
12
|
+
return config;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SiteConfigContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteConfigContext.js","sourceRoot":"","sources":["../../src/contexts/SiteConfigContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,iBAAiB,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAEjE,MAAM,UAAU,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,GAIT;IACC,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACtC,QAAQ,GACkB,CAC9B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,MAAM,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface UseAudioPlaybackOptions {
|
|
2
|
+
onPlaybackEnd?: () => void;
|
|
3
|
+
volumeRef?: React.RefObject<number>;
|
|
4
|
+
speedRef?: React.RefObject<number>;
|
|
5
|
+
}
|
|
6
|
+
export declare function useAudioPlayback({ onPlaybackEnd, volumeRef, speedRef, }?: UseAudioPlaybackOptions): {
|
|
7
|
+
playAudio: (audioBuffer: ArrayBuffer) => Promise<void>;
|
|
8
|
+
playAudioSequence: (audioPromises: Promise<ArrayBuffer>[], signal?: AbortSignal) => Promise<void>;
|
|
9
|
+
playStreamingAudio: (chunks: AsyncGenerator<Uint8Array>, signal?: AbortSignal) => Promise<void>;
|
|
10
|
+
stopAudio: () => void;
|
|
11
|
+
suspendPlayback: () => void;
|
|
12
|
+
resumePlayback: () => void;
|
|
13
|
+
getAmplitude: () => number;
|
|
14
|
+
initContext: () => void;
|
|
15
|
+
applyVolume: (v: number) => void;
|
|
16
|
+
analyser: AnalyserNode | null;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=useAudioPlayback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAudioPlayback.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudioPlayback.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,SAAS,EACT,QAAQ,GACT,GAAE,uBAA4B;6BAuDP,WAAW,KAAG,OAAO,CAAC,IAAI,CAAC;uCAmVzB,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW,WAAW,KAAG,OAAO,CAAC,IAAI,CAAC;iCApOnE,cAAc,CAAC,UAAU,CAAC,WAAW,WAAW,KAAG,OAAO,CAAC,IAAI,CAAC;;;;wBA4S5C,MAAM;;qBApaP,MAAM;;EAmd3C"}
|