@clagentic/console 1.0.0-beta.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/CREDITS.md +3 -0
- package/LICENSE +21 -0
- package/README.md +250 -0
- package/bin/cli.js +2812 -0
- package/lib/agents-favorites.js +164 -0
- package/lib/agents.js +282 -0
- package/lib/ask-user-mcp-server.js +120 -0
- package/lib/browser-mcp-server.js +484 -0
- package/lib/build-user-env.js +63 -0
- package/lib/certs/fullchain.pem +47 -0
- package/lib/certs/privkey.pem +5 -0
- package/lib/cli-sessions.js +265 -0
- package/lib/codex-defaults.js +18 -0
- package/lib/config.js +332 -0
- package/lib/crisis-safety.js +60 -0
- package/lib/daemon-projects.js +164 -0
- package/lib/daemon.js +1602 -0
- package/lib/dm.js +128 -0
- package/lib/ipc.js +125 -0
- package/lib/ipv4-only.js +39 -0
- package/lib/mcp-local.js +385 -0
- package/lib/notes.js +141 -0
- package/lib/os-users.js +529 -0
- package/lib/pages.js +1325 -0
- package/lib/project-connection.js +302 -0
- package/lib/project-external-trigger.js +236 -0
- package/lib/project-file-watch.js +120 -0
- package/lib/project-filesystem.js +528 -0
- package/lib/project-http.js +753 -0
- package/lib/project-image.js +95 -0
- package/lib/project-knowledge.js +88 -0
- package/lib/project-loop.js +1304 -0
- package/lib/project-mcp.js +374 -0
- package/lib/project-memory.js +39 -0
- package/lib/project-notifications.js +262 -0
- package/lib/project-sessions.js +1581 -0
- package/lib/project-user-mention.js +193 -0
- package/lib/project-user-message.js +628 -0
- package/lib/project.js +1303 -0
- package/lib/public/app.js +1031 -0
- package/lib/public/apple-touch-icon.png +0 -0
- package/lib/public/claude-code-avatar.png +0 -0
- package/lib/public/codex-avatar.png +0 -0
- package/lib/public/console-icon.png +0 -0
- package/lib/public/css/admin.css +736 -0
- package/lib/public/css/agent-picker.css +119 -0
- package/lib/public/css/base.css +235 -0
- package/lib/public/css/channel-layout.css +441 -0
- package/lib/public/css/command-palette.css +559 -0
- package/lib/public/css/debate.css +1609 -0
- package/lib/public/css/diff.css +139 -0
- package/lib/public/css/filebrowser.css +1976 -0
- package/lib/public/css/highlight.css +144 -0
- package/lib/public/css/home-hub.css +545 -0
- package/lib/public/css/icon-strip.css +1856 -0
- package/lib/public/css/input.css +1349 -0
- package/lib/public/css/loop.css +1248 -0
- package/lib/public/css/mention.css +317 -0
- package/lib/public/css/menus.css +857 -0
- package/lib/public/css/messages.css +1833 -0
- package/lib/public/css/mobile-nav.css +1332 -0
- package/lib/public/css/notifications-center.css +296 -0
- package/lib/public/css/overlays.css +1273 -0
- package/lib/public/css/playbook.css +264 -0
- package/lib/public/css/profile.css +397 -0
- package/lib/public/css/rewind.css +671 -0
- package/lib/public/css/scheduler-modal.css +1495 -0
- package/lib/public/css/scheduler.css +1420 -0
- package/lib/public/css/server-settings.css +909 -0
- package/lib/public/css/session-search.css +159 -0
- package/lib/public/css/sidebar.css +2012 -0
- package/lib/public/css/skills.css +789 -0
- package/lib/public/css/sticky-notes.css +854 -0
- package/lib/public/css/stt.css +155 -0
- package/lib/public/css/title-bar.css +674 -0
- package/lib/public/css/tooltip.css +67 -0
- package/lib/public/css/user-settings.css +702 -0
- package/lib/public/emoji-data.json +1 -0
- package/lib/public/favicon-banded-32.png +0 -0
- package/lib/public/favicon-banded.png +0 -0
- package/lib/public/favicon-dark.svg +32 -0
- package/lib/public/favicon.svg +32 -0
- package/lib/public/icon-192.png +0 -0
- package/lib/public/icon-512.png +0 -0
- package/lib/public/icon-banded-76.png +0 -0
- package/lib/public/icon-banded-96.png +0 -0
- package/lib/public/icon-mono.svg +25 -0
- package/lib/public/icons/email/gmail.svg +7 -0
- package/lib/public/icons/email/outlook.svg +35 -0
- package/lib/public/icons/email/yahoo.svg +1 -0
- package/lib/public/index.html +1946 -0
- package/lib/public/manifest.json +27 -0
- package/lib/public/markdown-worker.js +43 -0
- package/lib/public/marked.min.js +6 -0
- package/lib/public/modules/admin.js +954 -0
- package/lib/public/modules/agent-picker.js +429 -0
- package/lib/public/modules/app-connection.js +216 -0
- package/lib/public/modules/app-cursors.js +492 -0
- package/lib/public/modules/app-dm.js +265 -0
- package/lib/public/modules/app-favicon.js +231 -0
- package/lib/public/modules/app-header.js +242 -0
- package/lib/public/modules/app-home-hub.js +432 -0
- package/lib/public/modules/app-loop-ui.js +691 -0
- package/lib/public/modules/app-loop-wizard.js +439 -0
- package/lib/public/modules/app-messages.js +1415 -0
- package/lib/public/modules/app-misc.js +463 -0
- package/lib/public/modules/app-notifications.js +651 -0
- package/lib/public/modules/app-panels.js +1061 -0
- package/lib/public/modules/app-projects.js +875 -0
- package/lib/public/modules/app-rate-limit.js +529 -0
- package/lib/public/modules/app-rendering.js +739 -0
- package/lib/public/modules/app-skills-install.js +285 -0
- package/lib/public/modules/avatar.js +36 -0
- package/lib/public/modules/command-palette.js +491 -0
- package/lib/public/modules/console-logo.js +162 -0
- package/lib/public/modules/context-sources.js +365 -0
- package/lib/public/modules/diff.js +412 -0
- package/lib/public/modules/dom-refs.js +21 -0
- package/lib/public/modules/emoji-picker.js +222 -0
- package/lib/public/modules/events.js +21 -0
- package/lib/public/modules/filebrowser.js +1966 -0
- package/lib/public/modules/fileicons.js +172 -0
- package/lib/public/modules/icons.js +80 -0
- package/lib/public/modules/input.js +1102 -0
- package/lib/public/modules/longpress.js +74 -0
- package/lib/public/modules/markdown.js +486 -0
- package/lib/public/modules/mcp-ui.js +295 -0
- package/lib/public/modules/mention.js +1093 -0
- package/lib/public/modules/notifications.js +613 -0
- package/lib/public/modules/playbook.js +578 -0
- package/lib/public/modules/profile.js +594 -0
- package/lib/public/modules/project-settings.js +849 -0
- package/lib/public/modules/project-switcher.js +375 -0
- package/lib/public/modules/qrcode.js +87 -0
- package/lib/public/modules/rewind.js +381 -0
- package/lib/public/modules/scheduler-config.js +1611 -0
- package/lib/public/modules/scheduler-history.js +131 -0
- package/lib/public/modules/scheduler.js +1689 -0
- package/lib/public/modules/server-settings.js +842 -0
- package/lib/public/modules/session-search.js +456 -0
- package/lib/public/modules/settings-defaults.js +253 -0
- package/lib/public/modules/sidebar-mobile.js +1425 -0
- package/lib/public/modules/sidebar-projects.js +2022 -0
- package/lib/public/modules/sidebar-sessions.js +1548 -0
- package/lib/public/modules/sidebar-users.js +449 -0
- package/lib/public/modules/sidebar.js +348 -0
- package/lib/public/modules/skills.js +793 -0
- package/lib/public/modules/state.js +3 -0
- package/lib/public/modules/sticky-notes.js +1221 -0
- package/lib/public/modules/store.js +34 -0
- package/lib/public/modules/stt.js +266 -0
- package/lib/public/modules/terminal.js +987 -0
- package/lib/public/modules/theme.js +812 -0
- package/lib/public/modules/tool-palette.js +562 -0
- package/lib/public/modules/tools.js +2285 -0
- package/lib/public/modules/tooltip.js +150 -0
- package/lib/public/modules/user-settings.js +544 -0
- package/lib/public/modules/utils.js +56 -0
- package/lib/public/modules/ws-ref.js +26 -0
- package/lib/public/style.css +34 -0
- package/lib/public/sw.js +159 -0
- package/lib/push.js +149 -0
- package/lib/scheduler.js +471 -0
- package/lib/sdk-bridge.js +1792 -0
- package/lib/sdk-message-processor.js +740 -0
- package/lib/sdk-message-queue.js +42 -0
- package/lib/sdk-skill-discovery.js +131 -0
- package/lib/sdk-worker.js +677 -0
- package/lib/server-admin.js +712 -0
- package/lib/server-auth.js +737 -0
- package/lib/server-dm.js +170 -0
- package/lib/server-palette.js +104 -0
- package/lib/server-settings.js +553 -0
- package/lib/server-skills.js +280 -0
- package/lib/server.js +1390 -0
- package/lib/session-search.js +693 -0
- package/lib/sessions.js +946 -0
- package/lib/smtp.js +221 -0
- package/lib/terminal-manager.js +219 -0
- package/lib/terminal.js +39 -0
- package/lib/themes/ayu-light.json +9 -0
- package/lib/themes/catppuccin-latte.json +9 -0
- package/lib/themes/catppuccin-mocha.json +9 -0
- package/lib/themes/clagentic-dark.json +10 -0
- package/lib/themes/clagentic-light.json +10 -0
- package/lib/themes/dracula.json +9 -0
- package/lib/themes/everforest-light.json +9 -0
- package/lib/themes/everforest.json +9 -0
- package/lib/themes/github-light.json +9 -0
- package/lib/themes/gruvbox-dark.json +9 -0
- package/lib/themes/gruvbox-light.json +9 -0
- package/lib/themes/monokai.json +9 -0
- package/lib/themes/nord-light.json +9 -0
- package/lib/themes/nord.json +9 -0
- package/lib/themes/one-dark.json +9 -0
- package/lib/themes/one-light.json +9 -0
- package/lib/themes/rose-pine-dawn.json +9 -0
- package/lib/themes/rose-pine.json +9 -0
- package/lib/themes/solarized-dark.json +9 -0
- package/lib/themes/solarized-light.json +9 -0
- package/lib/themes/tokyo-night-light.json +9 -0
- package/lib/themes/tokyo-night.json +9 -0
- package/lib/updater.js +124 -0
- package/lib/user-presence.js +92 -0
- package/lib/users-auth.js +146 -0
- package/lib/users-permissions.js +118 -0
- package/lib/users-preferences.js +254 -0
- package/lib/users.js +465 -0
- package/lib/utils.js +64 -0
- package/lib/worktree.js +134 -0
- package/lib/ws-schema.js +464 -0
- package/lib/yoke/adapters/claude-worker.js +759 -0
- package/lib/yoke/adapters/claude.js +1599 -0
- package/lib/yoke/adapters/codex.js +1559 -0
- package/lib/yoke/codex-app-server.js +352 -0
- package/lib/yoke/index.js +319 -0
- package/lib/yoke/instructions.js +61 -0
- package/lib/yoke/interface.js +98 -0
- package/lib/yoke/mcp-bridge-server.js +302 -0
- package/lib/yoke/package.json +7 -0
- package/package.json +72 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// store.js - Zustand-like vanilla store for client state
|
|
2
|
+
// Single source of truth for all mutable UI state.
|
|
3
|
+
// Functions stay in their modules; only data lives here.
|
|
4
|
+
|
|
5
|
+
var _state = {};
|
|
6
|
+
var _listeners = [];
|
|
7
|
+
|
|
8
|
+
function createStore(initial) {
|
|
9
|
+
_state = Object.assign({}, initial);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var store = {
|
|
13
|
+
// Read a single field: store.get('dmMode')
|
|
14
|
+
get: function (key) { return _state[key]; },
|
|
15
|
+
// Grab full snapshot for multi-field reads: var s = store.snap();
|
|
16
|
+
snap: function () { return _state; },
|
|
17
|
+
// Shallow-merge update: store.set({ dmMode: true, dmKey: 'abc' })
|
|
18
|
+
set: function (partial) {
|
|
19
|
+
var prev = _state;
|
|
20
|
+
_state = Object.assign({}, _state, partial);
|
|
21
|
+
for (var i = 0; i < _listeners.length; i++) _listeners[i](_state, prev);
|
|
22
|
+
},
|
|
23
|
+
// Keep legacy aliases for gradual migration
|
|
24
|
+
getState: function () { return _state; },
|
|
25
|
+
setState: function (partial) { store.set(partial); },
|
|
26
|
+
subscribe: function (listener) {
|
|
27
|
+
_listeners.push(listener);
|
|
28
|
+
return function () {
|
|
29
|
+
_listeners = _listeners.filter(function (l) { return l !== listener; });
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { createStore, store };
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
// Speech-to-Text module using Web Speech API
|
|
2
|
+
// Uses browser's built-in speech recognition (Chrome/Edge/Safari → Google servers)
|
|
3
|
+
|
|
4
|
+
import { iconHtml, refreshIcons } from './icons.js';
|
|
5
|
+
import { autoResize } from './input.js';
|
|
6
|
+
import { store } from './store.js';
|
|
7
|
+
import { VENDOR_NAMES } from './app-rendering.js';
|
|
8
|
+
|
|
9
|
+
var ctx;
|
|
10
|
+
|
|
11
|
+
// --- State ---
|
|
12
|
+
var recording = false;
|
|
13
|
+
var recognition = null;
|
|
14
|
+
var selectedLang = null;
|
|
15
|
+
var textBeforeSTT = '';
|
|
16
|
+
var interimText = '';
|
|
17
|
+
|
|
18
|
+
// DOM refs
|
|
19
|
+
var sttBtn = null;
|
|
20
|
+
var langPopover = null;
|
|
21
|
+
|
|
22
|
+
// --- Language options ---
|
|
23
|
+
// Web Speech API uses BCP-47 language tags
|
|
24
|
+
var LANGUAGES = [
|
|
25
|
+
{ code: 'en-US', name: 'English' },
|
|
26
|
+
{ code: 'ko-KR', name: 'Korean' },
|
|
27
|
+
{ code: 'ja-JP', name: 'Japanese' },
|
|
28
|
+
{ code: 'zh-CN', name: 'Chinese' },
|
|
29
|
+
{ code: 'es-ES', name: 'Spanish' },
|
|
30
|
+
{ code: 'fr-FR', name: 'French' },
|
|
31
|
+
{ code: 'de-DE', name: 'German' },
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
// --- Check browser support ---
|
|
35
|
+
function getSpeechRecognition() {
|
|
36
|
+
return window.SpeechRecognition || window.webkitSpeechRecognition || null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// --- Init ---
|
|
40
|
+
export function initSTT(_ctx) {
|
|
41
|
+
ctx = _ctx;
|
|
42
|
+
|
|
43
|
+
sttBtn = document.getElementById('stt-btn');
|
|
44
|
+
if (!sttBtn) return;
|
|
45
|
+
|
|
46
|
+
if (!getSpeechRecognition()) {
|
|
47
|
+
sttBtn.style.display = 'none';
|
|
48
|
+
console.warn('[STT] Web Speech API not supported in this browser');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
sttBtn.addEventListener('click', function(e) {
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
|
|
55
|
+
if (recording) {
|
|
56
|
+
stopRecording();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!selectedLang) {
|
|
61
|
+
showLangPopover();
|
|
62
|
+
} else {
|
|
63
|
+
startRecording();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Right-click to change language
|
|
68
|
+
sttBtn.addEventListener('contextmenu', function(e) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
if (recording) stopRecording();
|
|
72
|
+
showLangPopover();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// --- Language popover ---
|
|
77
|
+
function showLangPopover() {
|
|
78
|
+
if (langPopover) {
|
|
79
|
+
hideLangPopover();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
langPopover = document.createElement('div');
|
|
84
|
+
langPopover.className = 'stt-lang-popover';
|
|
85
|
+
|
|
86
|
+
var html = '<div class="stt-lang-title">Voice Input Language</div>';
|
|
87
|
+
for (var i = 0; i < LANGUAGES.length; i++) {
|
|
88
|
+
var l = LANGUAGES[i];
|
|
89
|
+
var activeClass = (selectedLang === l.code) ? ' stt-lang-active' : '';
|
|
90
|
+
html += '<button class="stt-lang-option' + activeClass + '" data-lang="' + l.code + '">' +
|
|
91
|
+
'<span class="stt-lang-name">' + l.name + '</span>' +
|
|
92
|
+
'</button>';
|
|
93
|
+
}
|
|
94
|
+
langPopover.innerHTML = html;
|
|
95
|
+
|
|
96
|
+
langPopover.querySelectorAll('.stt-lang-option').forEach(function(btn) {
|
|
97
|
+
btn.addEventListener('click', function() {
|
|
98
|
+
onLangSelected(btn.dataset.lang);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
var wrapper = document.getElementById('input-wrapper');
|
|
103
|
+
wrapper.appendChild(langPopover);
|
|
104
|
+
|
|
105
|
+
setTimeout(function() {
|
|
106
|
+
document.addEventListener('click', closeLangOnOutside);
|
|
107
|
+
}, 0);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function closeLangOnOutside(e) {
|
|
111
|
+
if (langPopover && !langPopover.contains(e.target) && e.target !== sttBtn && !sttBtn.contains(e.target)) {
|
|
112
|
+
hideLangPopover();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function hideLangPopover() {
|
|
117
|
+
if (langPopover) {
|
|
118
|
+
langPopover.remove();
|
|
119
|
+
langPopover = null;
|
|
120
|
+
}
|
|
121
|
+
document.removeEventListener('click', closeLangOnOutside);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function onLangSelected(code) {
|
|
125
|
+
selectedLang = code;
|
|
126
|
+
hideLangPopover();
|
|
127
|
+
startRecording();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// --- Recording ---
|
|
131
|
+
function startRecording() {
|
|
132
|
+
if (recording) return;
|
|
133
|
+
|
|
134
|
+
var SpeechRecognition = getSpeechRecognition();
|
|
135
|
+
if (!SpeechRecognition) return;
|
|
136
|
+
|
|
137
|
+
recognition = new SpeechRecognition();
|
|
138
|
+
recognition.lang = selectedLang || 'en-US';
|
|
139
|
+
recognition.continuous = true;
|
|
140
|
+
recognition.interimResults = true;
|
|
141
|
+
|
|
142
|
+
textBeforeSTT = ctx.inputEl.value;
|
|
143
|
+
interimText = '';
|
|
144
|
+
|
|
145
|
+
recognition.onresult = function(e) {
|
|
146
|
+
var final = '';
|
|
147
|
+
var interim = '';
|
|
148
|
+
|
|
149
|
+
for (var i = 0; i < e.results.length; i++) {
|
|
150
|
+
var result = e.results[i];
|
|
151
|
+
if (result.isFinal) {
|
|
152
|
+
final += result[0].transcript;
|
|
153
|
+
} else {
|
|
154
|
+
interim += result[0].transcript;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var text = textBeforeSTT;
|
|
159
|
+
if (final) {
|
|
160
|
+
if (text && text.length > 0 && text[text.length - 1] !== ' ' && text[text.length - 1] !== '\n') {
|
|
161
|
+
text += ' ';
|
|
162
|
+
}
|
|
163
|
+
text += final;
|
|
164
|
+
}
|
|
165
|
+
if (interim) {
|
|
166
|
+
if (text && text.length > 0 && text[text.length - 1] !== ' ' && text[text.length - 1] !== '\n') {
|
|
167
|
+
text += ' ';
|
|
168
|
+
}
|
|
169
|
+
text += interim;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
ctx.inputEl.value = text;
|
|
173
|
+
autoResize();
|
|
174
|
+
if (ctx.scrollToBottom) ctx.scrollToBottom();
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
recognition.onerror = function(e) {
|
|
178
|
+
console.error('[STT] Recognition error:', e.error);
|
|
179
|
+
if (e.error === 'not-allowed') {
|
|
180
|
+
if (ctx.addSystemMessage) {
|
|
181
|
+
ctx.addSystemMessage('Microphone access denied.\n\nTo fix: click the lock icon in the address bar → Site settings → Microphone → Allow, then reload.', true);
|
|
182
|
+
}
|
|
183
|
+
stopRecording();
|
|
184
|
+
} else if (e.error === 'no-speech') {
|
|
185
|
+
// Silence — just keep listening
|
|
186
|
+
} else if (e.error === 'network') {
|
|
187
|
+
if (ctx.addSystemMessage) {
|
|
188
|
+
ctx.addSystemMessage('Speech recognition unavailable.\n\nWeb Speech API sends audio to Google servers for recognition. Some Chromium forks (Arc, Brave) block this connection.\n\nSupported: Chrome, Edge, Safari 14.1+, Samsung Internet\nNot supported: Arc, Brave, Firefox', true);
|
|
189
|
+
}
|
|
190
|
+
stopRecording();
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
recognition.onend = function() {
|
|
195
|
+
// Auto-restart if still recording (browser may stop after silence)
|
|
196
|
+
if (recording) {
|
|
197
|
+
// Save confirmed text so far
|
|
198
|
+
textBeforeSTT = ctx.inputEl.value;
|
|
199
|
+
try {
|
|
200
|
+
recognition.start();
|
|
201
|
+
} catch (e) {
|
|
202
|
+
// Already started or other error
|
|
203
|
+
stopRecording();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
try {
|
|
209
|
+
recognition.start();
|
|
210
|
+
recording = true;
|
|
211
|
+
sttBtn.classList.add('stt-active');
|
|
212
|
+
sttBtn.innerHTML =
|
|
213
|
+
'<span class="stt-wave">' +
|
|
214
|
+
'<span class="stt-wave-bar"></span>' +
|
|
215
|
+
'<span class="stt-wave-bar"></span>' +
|
|
216
|
+
'<span class="stt-wave-bar"></span>' +
|
|
217
|
+
'<span class="stt-wave-bar"></span>' +
|
|
218
|
+
'<span class="stt-wave-bar"></span>' +
|
|
219
|
+
'</span>' +
|
|
220
|
+
'<span class="stt-stop-label">Stop</span>';
|
|
221
|
+
ctx.inputEl.setAttribute('placeholder', 'Listening...');
|
|
222
|
+
} catch (err) {
|
|
223
|
+
console.error('[STT] Failed to start:', err);
|
|
224
|
+
if (ctx.addSystemMessage) {
|
|
225
|
+
ctx.addSystemMessage('Failed to start voice input: ' + err.message, true);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function stopRecording() {
|
|
231
|
+
if (!recording) return;
|
|
232
|
+
recording = false;
|
|
233
|
+
|
|
234
|
+
if (recognition) {
|
|
235
|
+
try { recognition.stop(); } catch (e) { /* ignore */ }
|
|
236
|
+
recognition = null;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
sttBtn.classList.remove('stt-active');
|
|
240
|
+
sttBtn.innerHTML = iconHtml('mic');
|
|
241
|
+
refreshIcons();
|
|
242
|
+
if (document.body.classList.contains("mate-dm-active") && document.body.dataset.mateName) {
|
|
243
|
+
ctx.inputEl.setAttribute('placeholder', 'Message ' + document.body.dataset.mateName + '...');
|
|
244
|
+
} else {
|
|
245
|
+
var _v = store.get('currentVendor') || "claude";
|
|
246
|
+
ctx.inputEl.setAttribute('placeholder', 'Message ' + (VENDOR_NAMES[_v] || VENDOR_NAMES.claude) + '...');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// --- External lang setter (used by profile module) ---
|
|
251
|
+
export function setSTTLang(code) {
|
|
252
|
+
selectedLang = code;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function getSTTLang() {
|
|
256
|
+
return selectedLang;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// --- Exports ---
|
|
260
|
+
export function isSTTRecording() {
|
|
261
|
+
return recording;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function isSTTInitializing() {
|
|
265
|
+
return false;
|
|
266
|
+
}
|