@admin-layout/tailwind-ui 12.2.4-alpha.61 → 12.2.4-alpha.62
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/lib/components/AIToolbar/components/speech/MicrophoneDiagnostics.d.ts +2 -0
- package/lib/components/AIToolbar/components/speech/MicrophoneDiagnostics.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/MicrophoneDiagnostics.js +396 -0
- package/lib/components/AIToolbar/components/speech/MicrophoneDiagnostics.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/SettingsPanel.d.ts.map +1 -1
- package/lib/components/AIToolbar/components/speech/SettingsPanel.js +2 -2
- package/lib/components/AIToolbar/components/speech/SettingsPanel.js.map +1 -1
- package/lib/components/AIToolbar/hooks/useActiveCharacter.d.ts +2 -0
- package/lib/components/AIToolbar/hooks/useActiveCharacter.d.ts.map +1 -1
- package/lib/components/AIToolbar/hooks/useActiveCharacter.js +1 -2
- package/lib/components/AIToolbar/hooks/useActiveCharacter.js.map +1 -1
- package/lib/components/AIToolbar/index.d.ts +1 -1
- package/lib/components/AIToolbar/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MicrophoneDiagnostics.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/speech/MicrophoneDiagnostics.tsx"],"names":[],"mappings":"AA+LA,wBAAgB,qBAAqB,4CAmPpC"}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect}from'react';import'../../../../shardui/accordion.js';import'../../../../shardui/alert.js';import'../../../../shardui/alert-dialog.js';import'@radix-ui/react-aspect-ratio';import'../../../../shardui/avatar.js';import'../../../../shardui/badge.js';import'../../../../shardui/breadcrumb.js';import {Button}from'../../../../shardui/button.js';import'../../../../shardui/calendar.js';import'../../../../shardui/card.js';import'../../../../shardui/carousel.js';import'../../../../shardui/chart.js';import'../../../../shardui/checkbox.js';import'@radix-ui/react-collapsible';import'../../../../shardui/command.js';import'../../../../shardui/context-menu.js';import'../../../../shardui/dialog.js';import'../../../../shardui/drawer.js';import'../../../../shardui/dropdown-menu.js';import'../../../../shardui/form.js';import'../../../../shardui/hover-card.js';import'../../../../shardui/input.js';import'../../../../shardui/input-otp.js';import {Label}from'../../../../shardui/label.js';import'../../../../shardui/menubar.js';import'../../../../shardui/navigation-menu.js';import'../../../../shardui/pagination.js';import'../../../../shardui/popover.js';import'../../../../shardui/progress.js';import'../../../../shardui/radio-group.js';import {MicIcon,RefreshCwIcon,LoaderIcon,SettingsIcon,RotateCcwIcon,CheckCircle2Icon,CircleAlertIcon,HelpCircleIcon}from'lucide-react';import'react-resizable-panels';import'../../../../utils/isBrowser/index.js';import {cn}from'../../../../utils/util.js';import'fast-deep-equal/react.js';import'../../../../shardui/scroll-area.js';import'../../../../shardui/select.js';import'../../../../shardui/separator.js';import'../../../../shardui/sheet.js';import'../../../../shardui/sidebar.js';import'../../../../shardui/slider.js';import'../../../ThemeProvider/ThemeProvider.js';import'sonner';import'../../../../shardui/switch.js';import'../../../../shardui/table.js';import'../../../../shardui/tabs.js';import'../../../../shardui/textarea.js';import'../../../../shardui/toast.js';import'../../../../shardui/toggle.js';import'../../../../shardui/toggle-group.js';import'../../../../shardui/tooltip.js';// constants
|
|
2
|
+
const TEST_DURATION_MS = 3000;
|
|
3
|
+
const STATUS_POLL_MS = 2000;
|
|
4
|
+
const TCC_RESET_HINT = 'tccutil reset Microphone com.cdebase.yantra';
|
|
5
|
+
const STATUS_COPY = {
|
|
6
|
+
authorized: {
|
|
7
|
+
label: 'Authorized',
|
|
8
|
+
tone: 'ok'
|
|
9
|
+
},
|
|
10
|
+
not_determined: {
|
|
11
|
+
label: 'Not requested yet',
|
|
12
|
+
tone: 'warn'
|
|
13
|
+
},
|
|
14
|
+
denied: {
|
|
15
|
+
label: 'Denied',
|
|
16
|
+
tone: 'err'
|
|
17
|
+
},
|
|
18
|
+
restricted: {
|
|
19
|
+
label: 'Restricted (MDM)',
|
|
20
|
+
tone: 'err'
|
|
21
|
+
},
|
|
22
|
+
unsupported: {
|
|
23
|
+
label: 'Not gated on this OS',
|
|
24
|
+
tone: 'muted'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
// helper functions
|
|
28
|
+
function isTauriInvokeAvailable() {
|
|
29
|
+
return typeof window !== 'undefined' && Boolean(window.__TAURI_INTERNALS__?.invoke);
|
|
30
|
+
}
|
|
31
|
+
async function invokeTauri(command, args) {
|
|
32
|
+
const {
|
|
33
|
+
invoke
|
|
34
|
+
} = await import('@tauri-apps/api/core');
|
|
35
|
+
return invoke(command, args);
|
|
36
|
+
}
|
|
37
|
+
function computeLevels(samples) {
|
|
38
|
+
if (samples.length === 0) return {
|
|
39
|
+
peak: 0,
|
|
40
|
+
rms: 0
|
|
41
|
+
};
|
|
42
|
+
let peak = 0;
|
|
43
|
+
let sumSquares = 0;
|
|
44
|
+
for (let i = 0; i < samples.length; i += 1) {
|
|
45
|
+
const value = Math.abs(samples[i]);
|
|
46
|
+
if (value > peak) peak = value;
|
|
47
|
+
sumSquares += samples[i] * samples[i];
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
peak,
|
|
51
|
+
rms: Math.sqrt(sumSquares / samples.length)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function delay(ms) {
|
|
55
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
56
|
+
}
|
|
57
|
+
async function copyToClipboard(text) {
|
|
58
|
+
try {
|
|
59
|
+
if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {
|
|
60
|
+
await navigator.clipboard.writeText(text);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
} catch {
|
|
64
|
+
/* fall through */
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
// sub components
|
|
69
|
+
function StatusBadge({
|
|
70
|
+
status
|
|
71
|
+
}) {
|
|
72
|
+
if (!status) {
|
|
73
|
+
return jsxs("span", {
|
|
74
|
+
className: "inline-flex items-center gap-1.5 text-[11px] text-muted-foreground",
|
|
75
|
+
children: [jsx(LoaderIcon, {
|
|
76
|
+
className: "w-3 h-3 animate-spin"
|
|
77
|
+
}), "Checking\u2026"]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const copy = STATUS_COPY[status];
|
|
81
|
+
const toneClass = copy.tone === 'ok' ? 'text-emerald-600 bg-emerald-500/10 border-emerald-500/30' : copy.tone === 'warn' ? 'text-amber-600 bg-amber-500/10 border-amber-500/30' : copy.tone === 'err' ? 'text-red-600 bg-red-500/10 border-red-500/30' : 'text-muted-foreground bg-muted border-border';
|
|
82
|
+
return jsxs("span", {
|
|
83
|
+
className: cn('inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[11px] font-medium', toneClass),
|
|
84
|
+
children: [copy.tone === 'ok' ? jsx(CheckCircle2Icon, {
|
|
85
|
+
className: "w-3 h-3"
|
|
86
|
+
}) : copy.tone === 'err' ? jsx(CircleAlertIcon, {
|
|
87
|
+
className: "w-3 h-3"
|
|
88
|
+
}) : jsx(HelpCircleIcon, {
|
|
89
|
+
className: "w-3 h-3"
|
|
90
|
+
}), copy.label]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function LevelBar({
|
|
94
|
+
value
|
|
95
|
+
}) {
|
|
96
|
+
const pct = Math.min(100, Math.max(0, Math.round(value * 100)));
|
|
97
|
+
return jsx("div", {
|
|
98
|
+
className: "h-1.5 w-full rounded-full bg-muted overflow-hidden",
|
|
99
|
+
children: jsx("div", {
|
|
100
|
+
className: cn('h-full transition-all', pct < 5 ? 'bg-muted-foreground/40' : pct < 25 ? 'bg-emerald-500' : 'bg-emerald-400'),
|
|
101
|
+
style: {
|
|
102
|
+
width: `${pct}%`
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function TestResultView({
|
|
108
|
+
result
|
|
109
|
+
}) {
|
|
110
|
+
if (result.kind === 'idle') return null;
|
|
111
|
+
if (result.kind === 'running') {
|
|
112
|
+
return jsxs("div", {
|
|
113
|
+
className: "flex items-center gap-2 rounded-md border border-border/60 bg-muted/40 p-2 text-[11px]",
|
|
114
|
+
children: [jsx(LoaderIcon, {
|
|
115
|
+
className: "w-3.5 h-3.5 animate-spin text-muted-foreground"
|
|
116
|
+
}), jsxs("span", {
|
|
117
|
+
children: ["Recording ", Math.round(TEST_DURATION_MS / 1000), "s\u2026"]
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (result.kind === 'error') {
|
|
122
|
+
return jsxs("div", {
|
|
123
|
+
className: "rounded-md border border-red-500/30 bg-red-500/10 p-2 text-[11px] text-red-600",
|
|
124
|
+
children: [jsx("strong", {
|
|
125
|
+
children: "Test failed."
|
|
126
|
+
}), " ", result.message]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (result.kind === 'silent') {
|
|
130
|
+
return jsxs("div", {
|
|
131
|
+
className: "rounded-md border border-amber-500/30 bg-amber-500/10 p-2 text-[11px] text-amber-700",
|
|
132
|
+
children: [jsx("strong", {
|
|
133
|
+
children: "No audio detected."
|
|
134
|
+
}), " Captured ", result.samples, " samples but the signal was silent. The OS may have authorized us at the TCC layer but cpal/CoreAudio is still serving an empty stream \u2014 try Restart App, or reset TCC and re-grant."]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return jsxs("div", {
|
|
138
|
+
className: "space-y-1.5 rounded-md border border-emerald-500/30 bg-emerald-500/10 p-2 text-[11px] text-emerald-700",
|
|
139
|
+
children: [jsxs("div", {
|
|
140
|
+
className: "flex items-center justify-between font-medium",
|
|
141
|
+
children: [jsxs("span", {
|
|
142
|
+
className: "inline-flex items-center gap-1.5",
|
|
143
|
+
children: [jsx(CheckCircle2Icon, {
|
|
144
|
+
className: "w-3.5 h-3.5"
|
|
145
|
+
}), "Signal detected"]
|
|
146
|
+
}), jsxs("span", {
|
|
147
|
+
className: "font-mono text-[10px] text-emerald-700/80",
|
|
148
|
+
children: ["peak ", result.peak.toFixed(3), " \u00B7 rms ", result.rms.toFixed(3)]
|
|
149
|
+
})]
|
|
150
|
+
}), jsx(LevelBar, {
|
|
151
|
+
value: result.peak
|
|
152
|
+
}), jsxs("div", {
|
|
153
|
+
className: "text-[10px] text-emerald-700/80",
|
|
154
|
+
children: ["Captured ", result.samples, " samples over ", result.durationMs, "ms"]
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
// main component
|
|
159
|
+
function MicrophoneDiagnostics() {
|
|
160
|
+
const [permission, setPermission] = useState(null);
|
|
161
|
+
const [devices, setDevices] = useState([]);
|
|
162
|
+
const [devicesLoading, setDevicesLoading] = useState(false);
|
|
163
|
+
const [testResult, setTestResult] = useState({
|
|
164
|
+
kind: 'idle'
|
|
165
|
+
});
|
|
166
|
+
const [tccCopied, setTccCopied] = useState(false);
|
|
167
|
+
const tauriAvailable = isTauriInvokeAvailable();
|
|
168
|
+
const inFlightRef = useRef(false);
|
|
169
|
+
const refreshPermission = useCallback(async () => {
|
|
170
|
+
if (!tauriAvailable) {
|
|
171
|
+
setPermission('unsupported');
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
const status = await invokeTauri('check_microphone_permission');
|
|
176
|
+
setPermission(status);
|
|
177
|
+
} catch {
|
|
178
|
+
setPermission('unsupported');
|
|
179
|
+
}
|
|
180
|
+
}, [tauriAvailable]);
|
|
181
|
+
const refreshDevices = useCallback(async () => {
|
|
182
|
+
if (!tauriAvailable) return;
|
|
183
|
+
setDevicesLoading(true);
|
|
184
|
+
try {
|
|
185
|
+
const list = await invokeTauri('list_audio_input_devices');
|
|
186
|
+
setDevices(list ?? []);
|
|
187
|
+
} catch {
|
|
188
|
+
setDevices([]);
|
|
189
|
+
} finally {
|
|
190
|
+
setDevicesLoading(false);
|
|
191
|
+
}
|
|
192
|
+
}, [tauriAvailable]);
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
void refreshPermission();
|
|
195
|
+
void refreshDevices();
|
|
196
|
+
if (!tauriAvailable) return;
|
|
197
|
+
const interval = setInterval(() => {
|
|
198
|
+
void refreshPermission();
|
|
199
|
+
}, STATUS_POLL_MS);
|
|
200
|
+
return () => clearInterval(interval);
|
|
201
|
+
}, [refreshPermission, refreshDevices, tauriAvailable]);
|
|
202
|
+
const handleRunTest = useCallback(async () => {
|
|
203
|
+
if (inFlightRef.current || !tauriAvailable) return;
|
|
204
|
+
inFlightRef.current = true;
|
|
205
|
+
setTestResult({
|
|
206
|
+
kind: 'running'
|
|
207
|
+
});
|
|
208
|
+
try {
|
|
209
|
+
try {
|
|
210
|
+
await invokeTauri('clear_audio_buffer_cmd');
|
|
211
|
+
} catch {
|
|
212
|
+
/* non-fatal */
|
|
213
|
+
}
|
|
214
|
+
await invokeTauri('start_system_audio_capture');
|
|
215
|
+
await delay(TEST_DURATION_MS);
|
|
216
|
+
const captured = await invokeTauri('get_captured_audio');
|
|
217
|
+
try {
|
|
218
|
+
await invokeTauri('stop_system_audio_capture');
|
|
219
|
+
} catch {
|
|
220
|
+
/* non-fatal */
|
|
221
|
+
}
|
|
222
|
+
const {
|
|
223
|
+
peak,
|
|
224
|
+
rms
|
|
225
|
+
} = computeLevels(captured.samples ?? []);
|
|
226
|
+
const sampleCount = captured.samples?.length ?? 0;
|
|
227
|
+
if (sampleCount === 0 || peak < 1e-4) {
|
|
228
|
+
setTestResult({
|
|
229
|
+
kind: 'silent',
|
|
230
|
+
samples: sampleCount,
|
|
231
|
+
durationMs: captured.duration_ms
|
|
232
|
+
});
|
|
233
|
+
} else {
|
|
234
|
+
setTestResult({
|
|
235
|
+
kind: 'ok',
|
|
236
|
+
peak,
|
|
237
|
+
rms,
|
|
238
|
+
samples: sampleCount,
|
|
239
|
+
durationMs: captured.duration_ms
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
} catch (e) {
|
|
243
|
+
setTestResult({
|
|
244
|
+
kind: 'error',
|
|
245
|
+
message: e instanceof Error ? e.message : String(e)
|
|
246
|
+
});
|
|
247
|
+
try {
|
|
248
|
+
await invokeTauri('stop_system_audio_capture');
|
|
249
|
+
} catch {
|
|
250
|
+
/* swallow */
|
|
251
|
+
}
|
|
252
|
+
} finally {
|
|
253
|
+
inFlightRef.current = false;
|
|
254
|
+
void refreshPermission();
|
|
255
|
+
}
|
|
256
|
+
}, [refreshPermission, tauriAvailable]);
|
|
257
|
+
const handleOpenSettings = useCallback(async () => {
|
|
258
|
+
if (!tauriAvailable) return;
|
|
259
|
+
try {
|
|
260
|
+
await invokeTauri('open_microphone_settings');
|
|
261
|
+
} catch {
|
|
262
|
+
/* noop */
|
|
263
|
+
}
|
|
264
|
+
}, [tauriAvailable]);
|
|
265
|
+
const handleRestart = useCallback(async () => {
|
|
266
|
+
if (!tauriAvailable) return;
|
|
267
|
+
try {
|
|
268
|
+
await invokeTauri('restart_app');
|
|
269
|
+
} catch {
|
|
270
|
+
/* process is exec'ing — nothing to do */
|
|
271
|
+
}
|
|
272
|
+
}, [tauriAvailable]);
|
|
273
|
+
const handleCopyTcc = useCallback(async () => {
|
|
274
|
+
const ok = await copyToClipboard(TCC_RESET_HINT);
|
|
275
|
+
if (ok) {
|
|
276
|
+
setTccCopied(true);
|
|
277
|
+
setTimeout(() => setTccCopied(false), 2000);
|
|
278
|
+
}
|
|
279
|
+
}, []);
|
|
280
|
+
const defaultDevice = devices.find(device => device.is_default) ?? devices[0];
|
|
281
|
+
const isAuthorized = permission === 'authorized' || permission === 'unsupported';
|
|
282
|
+
const testDisabled = !tauriAvailable || !isAuthorized || testResult.kind === 'running';
|
|
283
|
+
return jsxs("div", {
|
|
284
|
+
className: "space-y-3 pt-3 border-t border-border/50",
|
|
285
|
+
children: [jsxs("div", {
|
|
286
|
+
className: "flex items-center justify-between gap-2",
|
|
287
|
+
children: [jsx("h4", {
|
|
288
|
+
className: "text-xs font-semibold text-muted-foreground uppercase tracking-wide",
|
|
289
|
+
children: "Microphone Diagnostics"
|
|
290
|
+
}), jsx(StatusBadge, {
|
|
291
|
+
status: permission
|
|
292
|
+
})]
|
|
293
|
+
}), jsx("div", {
|
|
294
|
+
className: "rounded-md border border-border/60 bg-muted/30 p-2",
|
|
295
|
+
children: jsxs("div", {
|
|
296
|
+
className: "flex items-center justify-between gap-2",
|
|
297
|
+
children: [jsxs("div", {
|
|
298
|
+
className: "flex min-w-0 items-center gap-2",
|
|
299
|
+
children: [jsx(MicIcon, {
|
|
300
|
+
className: "w-3.5 h-3.5 shrink-0 text-muted-foreground"
|
|
301
|
+
}), jsxs("div", {
|
|
302
|
+
className: "min-w-0",
|
|
303
|
+
children: [jsx("div", {
|
|
304
|
+
className: "truncate text-xs font-medium",
|
|
305
|
+
children: devicesLoading ? 'Loading devices…' : defaultDevice ? defaultDevice.name : 'No input device found'
|
|
306
|
+
}), jsx("div", {
|
|
307
|
+
className: "text-[10px] text-muted-foreground",
|
|
308
|
+
children: devices.length > 1 ? `${devices.length} input devices · system default highlighted` : 'System default input'
|
|
309
|
+
})]
|
|
310
|
+
})]
|
|
311
|
+
}), jsx(Button, {
|
|
312
|
+
size: "icon",
|
|
313
|
+
variant: "ghost",
|
|
314
|
+
className: "h-7 w-7 shrink-0",
|
|
315
|
+
onClick: () => {
|
|
316
|
+
void refreshDevices();
|
|
317
|
+
void refreshPermission();
|
|
318
|
+
},
|
|
319
|
+
title: "Refresh",
|
|
320
|
+
disabled: !tauriAvailable,
|
|
321
|
+
children: jsx(RefreshCwIcon, {
|
|
322
|
+
className: cn('w-3.5 h-3.5', devicesLoading && 'animate-spin')
|
|
323
|
+
})
|
|
324
|
+
})]
|
|
325
|
+
})
|
|
326
|
+
}), jsxs("div", {
|
|
327
|
+
className: "space-y-2",
|
|
328
|
+
children: [jsx(Label, {
|
|
329
|
+
className: "text-xs font-medium",
|
|
330
|
+
children: "Live Mic Test"
|
|
331
|
+
}), jsx(Button, {
|
|
332
|
+
size: "sm",
|
|
333
|
+
variant: testResult.kind === 'ok' ? 'outline' : 'default',
|
|
334
|
+
onClick: () => void handleRunTest(),
|
|
335
|
+
disabled: testDisabled,
|
|
336
|
+
className: "w-full text-xs",
|
|
337
|
+
children: testResult.kind === 'running' ? jsxs(Fragment, {
|
|
338
|
+
children: [jsx(LoaderIcon, {
|
|
339
|
+
className: "w-3 h-3 mr-1.5 animate-spin"
|
|
340
|
+
}), "Listening\u2026"]
|
|
341
|
+
}) : jsxs(Fragment, {
|
|
342
|
+
children: [jsx(MicIcon, {
|
|
343
|
+
className: "w-3 h-3 mr-1.5"
|
|
344
|
+
}), testResult.kind === 'ok' || testResult.kind === 'silent' || testResult.kind === 'error' ? 'Run mic test again' : `Run mic test (${Math.round(TEST_DURATION_MS / 1000)}s)`]
|
|
345
|
+
})
|
|
346
|
+
}), jsx(TestResultView, {
|
|
347
|
+
result: testResult
|
|
348
|
+
}), !isAuthorized && permission && jsx("p", {
|
|
349
|
+
className: "text-[10px] text-muted-foreground",
|
|
350
|
+
children: "Grant microphone access below before running the test."
|
|
351
|
+
})]
|
|
352
|
+
}), jsxs("div", {
|
|
353
|
+
className: "grid grid-cols-2 gap-2",
|
|
354
|
+
children: [jsxs(Button, {
|
|
355
|
+
size: "sm",
|
|
356
|
+
variant: "outline",
|
|
357
|
+
onClick: () => void handleOpenSettings(),
|
|
358
|
+
disabled: !tauriAvailable,
|
|
359
|
+
className: "text-xs",
|
|
360
|
+
children: [jsx(SettingsIcon, {
|
|
361
|
+
className: "w-3 h-3 mr-1.5"
|
|
362
|
+
}), "Open System Settings"]
|
|
363
|
+
}), jsxs(Button, {
|
|
364
|
+
size: "sm",
|
|
365
|
+
variant: "outline",
|
|
366
|
+
onClick: () => void handleRestart(),
|
|
367
|
+
disabled: !tauriAvailable,
|
|
368
|
+
className: "text-xs",
|
|
369
|
+
children: [jsx(RotateCcwIcon, {
|
|
370
|
+
className: "w-3 h-3 mr-1.5"
|
|
371
|
+
}), "Restart App"]
|
|
372
|
+
})]
|
|
373
|
+
}), jsxs("div", {
|
|
374
|
+
className: "rounded-md border border-border/60 bg-muted/30 p-2 space-y-1.5",
|
|
375
|
+
children: [jsx("div", {
|
|
376
|
+
className: "text-[11px] font-medium",
|
|
377
|
+
children: "Still no signal after granting?"
|
|
378
|
+
}), jsx("p", {
|
|
379
|
+
className: "text-[10px] text-muted-foreground leading-relaxed",
|
|
380
|
+
children: "Dev builds and signed installs have separate TCC entries. Reset the entry for this bundle in a terminal, then restart the app to re-prompt:"
|
|
381
|
+
}), jsxs("div", {
|
|
382
|
+
className: "flex items-center gap-1.5",
|
|
383
|
+
children: [jsx("code", {
|
|
384
|
+
className: "flex-1 truncate rounded bg-background border border-border px-1.5 py-1 text-[10px] font-mono",
|
|
385
|
+
children: TCC_RESET_HINT
|
|
386
|
+
}), jsx(Button, {
|
|
387
|
+
size: "sm",
|
|
388
|
+
variant: "ghost",
|
|
389
|
+
className: "h-7 px-2 text-[10px]",
|
|
390
|
+
onClick: () => void handleCopyTcc(),
|
|
391
|
+
children: tccCopied ? 'Copied' : 'Copy'
|
|
392
|
+
})]
|
|
393
|
+
})]
|
|
394
|
+
})]
|
|
395
|
+
});
|
|
396
|
+
}export{MicrophoneDiagnostics};//# sourceMappingURL=MicrophoneDiagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MicrophoneDiagnostics.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/speech/SettingsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/speech/SettingsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AA6B1C,UAAU,kBAAkB;IAExB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAE/C,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,uBAAuB,CAAC,EAAE,SAAS,CAAC;CACvC;AAED,eAAO,MAAM,aAAa,GAAI,oIAQ3B,kBAAkB,4CAyTpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState}from'react';import'../../../../shardui/accordion.js';import'../../../../shardui/alert.js';import'../../../../shardui/alert-dialog.js';import'@radix-ui/react-aspect-ratio';import'../../../../shardui/avatar.js';import'../../../../shardui/badge.js';import'../../../../shardui/breadcrumb.js';import {Button}from'../../../../shardui/button.js';import'../../../../shardui/calendar.js';import'../../../../shardui/card.js';import'../../../../shardui/carousel.js';import'../../../../shardui/chart.js';import'../../../../shardui/checkbox.js';import'@radix-ui/react-collapsible';import'../../../../shardui/command.js';import'../../../../shardui/context-menu.js';import'../../../../shardui/dialog.js';import'../../../../shardui/drawer.js';import'../../../../shardui/dropdown-menu.js';import'../../../../shardui/form.js';import'../../../../shardui/hover-card.js';import'../../../../shardui/input.js';import'../../../../shardui/input-otp.js';import {Label}from'../../../../shardui/label.js';import'../../../../shardui/menubar.js';import'../../../../shardui/navigation-menu.js';import'../../../../shardui/pagination.js';import'../../../../shardui/popover.js';import'../../../../shardui/progress.js';import'../../../../shardui/radio-group.js';import {SettingsIcon,ChevronDownIcon,WandIcon,ChevronUpIcon,RotateCcwIcon}from'lucide-react';import'react-resizable-panels';import'../../../../utils/isBrowser/index.js';import {cn}from'../../../../utils/util.js';import'fast-deep-equal/react.js';import'../../../../shardui/scroll-area.js';import {Select,SelectTrigger,SelectValue,SelectContent,SelectGroup,SelectLabel,SelectItem}from'../../../../shardui/select.js';import'../../../../shardui/separator.js';import'../../../../shardui/sheet.js';import'../../../../shardui/sidebar.js';import {Slider}from'../../../../shardui/slider.js';import'../../../ThemeProvider/ThemeProvider.js';import'sonner';import {Switch}from'../../../../shardui/switch.js';import'../../../../shardui/table.js';import'../../../../shardui/tabs.js';import {Textarea}from'../../../../shardui/textarea.js';import'../../../../shardui/toast.js';import'../../../../shardui/toggle.js';import'../../../../shardui/toggle-group.js';import'../../../../shardui/tooltip.js';import {PROMPT_TEMPLATES,getPromptTemplateById}from'./promptTemplates.js';// Sensitivity presets for simpler UX
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState}from'react';import'../../../../shardui/accordion.js';import'../../../../shardui/alert.js';import'../../../../shardui/alert-dialog.js';import'@radix-ui/react-aspect-ratio';import'../../../../shardui/avatar.js';import'../../../../shardui/badge.js';import'../../../../shardui/breadcrumb.js';import {Button}from'../../../../shardui/button.js';import'../../../../shardui/calendar.js';import'../../../../shardui/card.js';import'../../../../shardui/carousel.js';import'../../../../shardui/chart.js';import'../../../../shardui/checkbox.js';import'@radix-ui/react-collapsible';import'../../../../shardui/command.js';import'../../../../shardui/context-menu.js';import'../../../../shardui/dialog.js';import'../../../../shardui/drawer.js';import'../../../../shardui/dropdown-menu.js';import'../../../../shardui/form.js';import'../../../../shardui/hover-card.js';import'../../../../shardui/input.js';import'../../../../shardui/input-otp.js';import {Label}from'../../../../shardui/label.js';import'../../../../shardui/menubar.js';import'../../../../shardui/navigation-menu.js';import'../../../../shardui/pagination.js';import'../../../../shardui/popover.js';import'../../../../shardui/progress.js';import'../../../../shardui/radio-group.js';import {SettingsIcon,ChevronDownIcon,WandIcon,ChevronUpIcon,RotateCcwIcon}from'lucide-react';import'react-resizable-panels';import'../../../../utils/isBrowser/index.js';import {cn}from'../../../../utils/util.js';import'fast-deep-equal/react.js';import'../../../../shardui/scroll-area.js';import {Select,SelectTrigger,SelectValue,SelectContent,SelectGroup,SelectLabel,SelectItem}from'../../../../shardui/select.js';import'../../../../shardui/separator.js';import'../../../../shardui/sheet.js';import'../../../../shardui/sidebar.js';import {Slider}from'../../../../shardui/slider.js';import'../../../ThemeProvider/ThemeProvider.js';import'sonner';import {Switch}from'../../../../shardui/switch.js';import'../../../../shardui/table.js';import'../../../../shardui/tabs.js';import {Textarea}from'../../../../shardui/textarea.js';import'../../../../shardui/toast.js';import'../../../../shardui/toggle.js';import'../../../../shardui/toggle-group.js';import'../../../../shardui/tooltip.js';import {PROMPT_TEMPLATES,getPromptTemplateById}from'./promptTemplates.js';import {MicrophoneDiagnostics}from'./MicrophoneDiagnostics.js';// Sensitivity presets for simpler UX
|
|
2
2
|
const SENSITIVITY_PRESETS = {
|
|
3
3
|
low: {
|
|
4
4
|
sensitivity_rms: 0.015,
|
|
@@ -284,7 +284,7 @@ const SettingsPanel = ({
|
|
|
284
284
|
}), "Reset to Defaults"]
|
|
285
285
|
})]
|
|
286
286
|
})]
|
|
287
|
-
}), settingsDropdownContent ? jsx("div", {
|
|
287
|
+
}), jsx(MicrophoneDiagnostics, {}), settingsDropdownContent ? jsx("div", {
|
|
288
288
|
className: "border-t border-border/50 pt-2",
|
|
289
289
|
children: settingsDropdownContent
|
|
290
290
|
}) : null]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPanel.js","sources":["../../../../../src/components/AIToolbar/components/speech/SettingsPanel.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SettingsPanel.js","sources":["../../../../../src/components/AIToolbar/components/speech/SettingsPanel.tsx"],"sourcesContent":[null],"names":[],"mappings":";AAqDI,MAAA,mBAAoB,GAAA;KACpB,EAAA;AACH,IAAA,eAAA,EAAA,KAAA;AAED,IAAA,oBAAa,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readPreferredActiveCharacterFileName } from '../../../hooks/activeCharacterPreference';
|
|
1
2
|
export interface ActiveCharacter {
|
|
2
3
|
/** Manifest `name` (or filesystem stem) — e.g. "Seraphina". */
|
|
3
4
|
name: string;
|
|
@@ -38,6 +39,7 @@ export interface MarketplaceCharacterEntry {
|
|
|
38
39
|
* resolves. Triggers a re-render of any active character hook.
|
|
39
40
|
*/
|
|
40
41
|
export declare function setMarketplaceCharacters(entries: MarketplaceCharacterEntry[]): void;
|
|
42
|
+
export { readPreferredActiveCharacterFileName };
|
|
41
43
|
/**
|
|
42
44
|
* Return the active character (name + avatar) or null when none is installed
|
|
43
45
|
* / we're not running under Tauri. Selection follows `pickActiveMerged` (file_name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveCharacter.d.ts","sourceRoot":"","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useActiveCharacter.d.ts","sourceRoot":"","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"names":[],"mappings":"AA2BA,OAAO,EAGH,oCAAoC,EAEvC,MAAM,0CAA0C,CAAC;AASlD,MAAM,WAAW,eAAe;IAC5B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC5B,sDAAsD;IACtD,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,gFAAgF;IAChF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iFAAiF;IACjF,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5C;AASD;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAiCD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,EAAE,GAAG,IAAI,CASnF;AAkMD,OAAO,EAAE,oCAAoC,EAAE,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAqC3D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAmFpD"}
|
|
@@ -230,7 +230,6 @@ function useCharacterPreferenceListeners(reload, bump) {
|
|
|
230
230
|
};
|
|
231
231
|
}, [reload, bump]);
|
|
232
232
|
}
|
|
233
|
-
// main API
|
|
234
233
|
/**
|
|
235
234
|
* Return the active character (name + avatar) or null when none is installed
|
|
236
235
|
* / we're not running under Tauri. Selection follows `pickActiveMerged` (file_name
|
|
@@ -357,4 +356,4 @@ function useCharacterPicker() {
|
|
|
357
356
|
activeName,
|
|
358
357
|
setActive
|
|
359
358
|
};
|
|
360
|
-
}export{setMarketplaceCharacters,useActiveCharacter,useCharacterPicker};//# sourceMappingURL=useActiveCharacter.js.map
|
|
359
|
+
}export{readPreferredActiveCharacterFileName,setMarketplaceCharacters,useActiveCharacter,useCharacterPicker};//# sourceMappingURL=useActiveCharacter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveCharacter.js","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useActiveCharacter.js","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"sourcesContent":[null],"names":[],"mappings":"2ZA2BA;AAcA;;;;;;AAMI;AACH;AAED;;;AAGI;AACH;AAED;;;;AAII;;;AAGH;AASD;;;;MAQI,uBAAqB,GAAA,0BAAA;;;AAGrB;AACH;AAiCD;;;;AAIG,MAAA,4BAAA,GAAA,8BAAA;AACH;AA2MA,MAAA,uBAAS,GAAA,CAAA,YAAoC,EAAE,UAAC,CAAA;AAEhD;;;;AAIG,EAAA,sBAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AACH,EAAA,OAAA,MAAA,sBAAgB,CAAA,MAAkB,CAAA,EAAI,CAAA;AAuCtC;;;AAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,6 +2,6 @@ export { AIToolbar, AIToolbarLeading, AIToolbarMain, AIToolbarTrailing, AIToolba
|
|
|
2
2
|
export type { AIToolbarProps, AIToolbarSectionProps, AIToolbarInputSurfaceProps, AIToolbarStatusDotProps, } from './components/AIToolbarPrimitives';
|
|
3
3
|
export * from './components';
|
|
4
4
|
export type { CompletionSubmitOptions, UseCompletionReturn, SystemAudioProps, AIToolbarAppProps, AIToolbarHostPlatform, ChatMessage, ChatConversation, VadConfig, ToolbarAiProvider, ToolbarSelectedProvider, ToolbarAudioDevices, ToolbarAttachedFile, ToolbarScreenshotConfiguration, } from './components/types';
|
|
5
|
-
export { setMarketplaceCharacters, useActiveCharacter, useCharacterPicker } from './hooks/useActiveCharacter';
|
|
5
|
+
export { setMarketplaceCharacters, useActiveCharacter, useCharacterPicker, readPreferredActiveCharacterFileName, } from './hooks/useActiveCharacter';
|
|
6
6
|
export type { MarketplaceCharacterEntry, ActiveCharacter, CharacterListEntry, CharacterPicker, } from './hooks/useActiveCharacter';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AIToolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACR,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,GAC1B,MAAM,kCAAkC,CAAC;AAE1C,cAAc,cAAc,CAAC;AAE7B,YAAY,EACR,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,8BAA8B,GACjC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AIToolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACR,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,GAC1B,MAAM,kCAAkC,CAAC;AAE1C,cAAc,cAAc,CAAC;AAE7B,YAAY,EACR,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,8BAA8B,GACjC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,oCAAoC,GACvC,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACR,yBAAyB,EACzB,eAAe,EACf,kBAAkB,EAClB,eAAe,GAClB,MAAM,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/tailwind-ui",
|
|
3
|
-
"version": "12.2.4-alpha.
|
|
3
|
+
"version": "12.2.4-alpha.62",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"typescript": {
|
|
97
97
|
"definition": "lib/index.d.ts"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "4dec1930c6d2da179bd1279602305a49d3a3b75b"
|
|
100
100
|
}
|