|
25 | 25 | * φ² + 1/φ² = 3 = TRINITY | KOSCHEI IS IMMORTAL |
26 | 26 | */ |
27 | 27 |
|
| 28 | +// Web Speech API type declarations |
| 29 | +declare global { |
| 30 | + interface Window { |
| 31 | + SpeechRecognition: typeof SpeechRecognition; |
| 32 | + webkitSpeechRecognition: typeof SpeechRecognition; |
| 33 | + } |
| 34 | +} |
| 35 | + |
28 | 36 | import { useState, useRef, useEffect, useCallback, useMemo } from 'react'; |
29 | 37 | import { AnimatePresence, motion } from 'framer-motion'; |
30 | 38 | import QuantumCanvas from '../components/QuantumCanvas'; |
31 | 39 | import type { VizMode } from '../components/QuantumCanvas'; |
32 | 40 | import ChatMessage from '../components/chat/ChatMessage'; |
33 | | -import { sendMessage, clearContext, checkHealth, fetchMirrorStatus, fetchStorageMetrics, fetchFileList, compileCode, type ChatResponse, type MirrorStatus, type MirrorLogEntry, type FileEntry, type StorageMetrics } from '../services/chatApi'; |
| 41 | +import { sendMessage, clearContext, checkHealth, fetchMirrorStatus, fetchStorageMetrics, fetchFileList, compileCode, type ChatResponse, type MirrorStatus, type MirrorLogEntry, type StorageMetrics } from '../services/chatApi'; |
34 | 42 | import TrinityCanvasWasm from '../components/TrinityCanvasWasm'; |
35 | 43 |
|
36 | 44 | // ─── Types ─────────────────────────────────────────────────────────────────── |
@@ -469,7 +477,7 @@ export default function TrinityCanvas() { |
469 | 477 |
|
470 | 478 | // Mirror RAZUM: inline chat with history (v2.6) |
471 | 479 | const [mChatInput, setMChatInput] = useState(''); |
472 | | - const [mChatReply, setMChatReply] = useState<{ text: string; source: string; conf: number; lat: number } | null>(null); |
| 480 | + const [, setMChatReply] = useState<{ text: string; source: string; conf: number; lat: number } | null>(null); |
473 | 481 | const [mChatSending, setMChatSending] = useState(false); |
474 | 482 | const [mChatHistory, setMChatHistory] = useState<{ role: 'user' | 'assistant'; text: string; source?: string; conf?: number; lat?: number; reflection?: string }[]>([]); |
475 | 483 |
|
@@ -850,7 +858,7 @@ export default function TrinityCanvas() { |
850 | 858 | if (SpeechRecognition) { |
851 | 859 | const recognition = new SpeechRecognition(); |
852 | 860 | recognition.continuous = true; recognition.interimResults = true; recognition.lang = 'ru-RU'; |
853 | | - recognition.onresult = (event: SpeechRecognitionEvent) => { |
| 861 | + recognition.onresult = (event: Event & { resultIndex: number; results: SpeechRecognitionResultList }) => { |
854 | 862 | let transcript = ''; |
855 | 863 | for (let i = event.resultIndex; i < event.results.length; i++) transcript += event.results[i][0].transcript; |
856 | 864 | setVoiceTranscript(transcript); |
@@ -1010,7 +1018,7 @@ export default function TrinityCanvas() { |
1010 | 1018 | if (!SR) { setMVoiceText('Speech API not supported'); return; } |
1011 | 1019 | const rec = new SR(); |
1012 | 1020 | rec.continuous = false; rec.interimResults = false; rec.lang = 'en-US'; |
1013 | | - rec.onresult = (ev: SpeechRecognitionEvent) => { |
| 1021 | + rec.onresult = (ev: Event & { results: SpeechRecognitionResultList }) => { |
1014 | 1022 | const text = ev.results[0][0].transcript; |
1015 | 1023 | setMVoiceText(text); |
1016 | 1024 | // Auto-send voice transcript as chat |
@@ -1217,8 +1225,8 @@ export default function TrinityCanvas() { |
1217 | 1225 | > |
1218 | 1226 | {PETALS.map((petal, i) => { |
1219 | 1227 | const pts = blockToPoints(i, logoScale, cx, cy); |
1220 | | - const [lx, ly] = blockCenter(i, logoScale, cx, cy); |
1221 | | - const realmColor = REALM_COLORS[petal.realm].primary; |
| 1228 | + blockCenter(i, logoScale, cx, cy); |
| 1229 | + REALM_COLORS[petal.realm].primary; |
1222 | 1230 | const isHovered = hoveredBlock === i; |
1223 | 1231 | // Fly-in: each block flies from its own direction |
1224 | 1232 | const verts = BLOCK_VERTS[i]; |
|
0 commit comments