@lethevimlet/sshift 1.5.1 → 1.6.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lethevimlet/sshift",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "Web-based SSH + SFTP terminal client with tabs and bookmarks",
5
5
  "main": "src/server/index.js",
6
6
  "bin": {
@@ -10,6 +10,7 @@ const { registerPluginEndpoints } = require('./plugins');
10
10
  const { registerSessionsEndpoints } = require('./sessions');
11
11
  const { registerSystemEndpoints } = require('./system');
12
12
  const { registerUtilsEndpoints } = require('./utils');
13
+ const { registerSpeechAiEndpoints } = require('./speech-ai');
13
14
  const { registerAuthEndpoints, isValidAuthToken } = require('./auth');
14
15
 
15
16
  function registerAllRestEndpoints(app, io) {
@@ -21,6 +22,7 @@ function registerAllRestEndpoints(app, io) {
21
22
  registerSessionsEndpoints(app, io);
22
23
  registerSystemEndpoints(app, io);
23
24
  registerUtilsEndpoints(app, io);
25
+ registerSpeechAiEndpoints(app, io);
24
26
  }
25
27
 
26
28
  module.exports = {
@@ -31,6 +33,7 @@ module.exports = {
31
33
  registerSessionsEndpoints,
32
34
  registerSystemEndpoints,
33
35
  registerUtilsEndpoints,
36
+ registerSpeechAiEndpoints,
34
37
  registerAuthEndpoints,
35
38
  isValidAuthToken,
36
39
  registerAllRestEndpoints
@@ -0,0 +1,249 @@
1
+ /**
2
+ * Speech & AI REST endpoints
3
+ *
4
+ * - GET /api/speech-ai/config — public config (auth keys redacted)
5
+ * - POST /api/speech-ai/config — save speech-ai settings
6
+ * - POST /api/speech-ai/stt — proxy audio blob to the configured
7
+ * STT endpoint (DeepInfra-compatible
8
+ * OpenAI transcription API)
9
+ * - POST /api/speech-ai/wand — proxy transcript text to the
10
+ * configured OpenAI-compatible LLM
11
+ * chat completions endpoint, using
12
+ * the saved wand system prompt.
13
+ *
14
+ * The browser never sees the raw STT/LLM auth keys — they live in the
15
+ * gitignored config.json and are only read server-side here.
16
+ */
17
+
18
+ const os = require('os');
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+ const { loadConfig, saveConfig, getSpeechAiConfig, getDefaultWandSystemPrompt } = require('../../utils/config');
22
+
23
+ // Use the global fetch (Node 18+) for proxying. Fall back to undici/https for
24
+ // ancient environments — but Node >=20 is the project floor, so global fetch
25
+ // is always available.
26
+ const fetch = global.fetch;
27
+
28
+ // Whisper transcription accepts these mimetypes. Browsers usually send
29
+ // audio/webm;general;codecs=opus from MediaRecorder. We trust the client
30
+ // filename extension when present, otherwise fall back to webm.
31
+ function audioMimeFromRequest(req) {
32
+ const ct = req.headers['content-type'] || '';
33
+ if (ct.startsWith('multipart/')) {
34
+ // multer/formidable not installed; we receive the audio file as a raw
35
+ // body in this proxy, see POST /api/speech-ai/stt below.
36
+ return 'audio/webm';
37
+ }
38
+ return ct || 'audio/webm';
39
+ }
40
+
41
+ function registerSpeechAiEndpoints(app, io) {
42
+ // ---- Public config (redacted) -------------------------------------------
43
+ app.get('/api/speech-ai/config', (req, res) => {
44
+ const pub = getPublicSpeechAiConfigSafe();
45
+ res.json(pub);
46
+ });
47
+
48
+ // ---- Save settings -------------------------------------------------------
49
+ app.post('/api/speech-ai/config', (req, res) => {
50
+ const config = loadConfig();
51
+ const b = req.body || {};
52
+
53
+ // Non-secret fields overwrite directly.
54
+ if (b.hasOwnProperty('sttEndpoint')) config.sttEndpoint = typeof b.sttEndpoint === 'string' ? b.sttEndpoint.trim() : '';
55
+ if (b.hasOwnProperty('sttLanguage')) config.sttLanguage = typeof b.sttLanguage === 'string' ? b.sttLanguage.trim() : '';
56
+ if (b.hasOwnProperty('llmEndpoint')) config.llmEndpoint = typeof b.llmEndpoint === 'string' ? b.llmEndpoint.trim() : '';
57
+ if (b.hasOwnProperty('llmModel')) config.llmModel = typeof b.llmModel === 'string' ? b.llmModel.trim() : '';
58
+ if (b.hasOwnProperty('wandSystemPrompt')) {
59
+ config.wandSystemPrompt = typeof b.wandSystemPrompt === 'string' ? b.wandSystemPrompt : '';
60
+ }
61
+
62
+ // Auth keys: blank/no-change sentinel => keep existing. Any non-empty
63
+ // string (including the literal word "clear") overwrites. Use the
64
+ // sentinel "__UNCHANGED__" for "leave as is".
65
+ if (b.hasOwnProperty('sttAuthKey')) {
66
+ const v = b.sttAuthKey;
67
+ if (v !== '__UNCHANGED__' && v !== null && v !== undefined) {
68
+ config.sttAuthKey = typeof v === 'string' ? v.trim() : '';
69
+ }
70
+ }
71
+ if (b.hasOwnProperty('llmAuthKey')) {
72
+ const v = b.llmAuthKey;
73
+ if (v !== '__UNCHANGED__' && v !== null && v !== undefined) {
74
+ config.llmAuthKey = typeof v === 'string' ? v.trim() : '';
75
+ }
76
+ }
77
+
78
+ const saved = saveConfig(config);
79
+ if (!saved) return res.status(500).json({ error: 'Failed to save config' });
80
+
81
+ res.json(getPublicSpeechAiConfigSafe());
82
+ });
83
+
84
+ // ---- Default wand system prompt -----------------------------------------
85
+ // Returned to the "Reset" button so the user can restore the default
86
+ // without us baking it into the client bundle.
87
+ app.get('/api/speech-ai/wand-default', (req, res) => {
88
+ res.json({ prompt: getDefaultWandSystemPrompt() });
89
+ });
90
+
91
+ // ---- STT proxy -----------------------------------------------------------
92
+ // Body: raw audio bytes (any mimetype MediaRecorder produces). We forward
93
+ // to <sttEndpoint> as multipart/form-data with model=openai/whisper-large-v3
94
+ // (whisper-large-v3 is the full multilingual model with strong EN+ES support;
95
+ // the -turbo variant is optimised for English-only and weaker on Spanish).
96
+ // Returns { text } on success.
97
+ app.post('/api/speech-ai/stt', (req, res) => {
98
+ handleSttProxy(req, res).catch(err => {
99
+ console.error('[SPEECH-AI] STT proxy error:', err);
100
+ res.status(502).json({ error: 'Speech-to-text proxy failed', detail: String(err.message || err) });
101
+ });
102
+ });
103
+
104
+ // ---- LLM wand proxy -----------------------------------------------------
105
+ // Body: { text: "<transcript>" }
106
+ // Returns { text: "<cleaned>" } on success.
107
+ app.post('/api/speech-ai/wand', (req, res) => {
108
+ handleWandProxy(req, res).catch(err => {
109
+ console.error('[SPEECH-AI] Wand proxy error:', err);
110
+ res.status(502).json({ error: 'LLM wand proxy failed', detail: String(err.message || err) });
111
+ });
112
+ });
113
+ }
114
+
115
+ // Local helper so a save failure (or any error) never crashes the route —
116
+ // returns empty defaults instead. Auth keys are still never exposed.
117
+ function getPublicSpeechAiConfigSafe() {
118
+ try {
119
+ const cfg = getSpeechAiConfig();
120
+ return {
121
+ sttEndpoint: cfg.sttEndpoint || '',
122
+ sttLanguage: cfg.sttLanguage || '',
123
+ llmEndpoint: cfg.llmEndpoint,
124
+ llmModel: cfg.llmModel,
125
+ // If user never set a custom wand prompt, expose the default so the
126
+ // textarea populates with it on first load.
127
+ wandSystemPrompt: cfg.wandSystemPrompt || getDefaultWandSystemPrompt(),
128
+ sttAuthKeySet: !!cfg.sttAuthKey,
129
+ llmAuthKeySet: !!cfg.llmAuthKey
130
+ };
131
+ } catch (err) {
132
+ console.error('[SPEECH-AI] Failed to read public config:', err);
133
+ return {
134
+ sttEndpoint: '',
135
+ sttLanguage: '',
136
+ llmEndpoint: 'https://api.deepinfra.com/v1/openai/chat/completions',
137
+ llmModel: 'meta-llama/Llama-3.3-70B-Instruct',
138
+ wandSystemPrompt: getDefaultWandSystemPrompt(),
139
+ sttAuthKeySet: false,
140
+ llmAuthKeySet: false
141
+ };
142
+ }
143
+ }
144
+
145
+ async function handleSttProxy(req, res) {
146
+ const cfg = getSpeechAiConfig();
147
+ if (!cfg.sttEndpoint) return res.status(400).json({ error: 'STT endpoint not configured' });
148
+ if (!cfg.sttAuthKey) return res.status(400).json({ error: 'STT auth key not configured' });
149
+
150
+ // Collect raw body bytes.
151
+ const chunks = [];
152
+ await new Promise((resolve, reject) => {
153
+ req.on('data', c => chunks.push(c));
154
+ req.on('end', resolve);
155
+ req.on('error', reject);
156
+ });
157
+ const audioBuffer = Buffer.concat(chunks);
158
+ if (!audioBuffer.length) return res.status(400).json({ error: 'No audio received' });
159
+
160
+ // Build multipart/form-data manually — we deliberately avoid adding
161
+ // multer/formidable as dependencies just for one endpoint.
162
+ const boundary = 'sshift-' + Math.random().toString(16).slice(2) + '-' + Date.now().toString(16);
163
+ const filename = req.headers['x-audio-filename'] || `recording-${Date.now()}.webm`;
164
+ const mime = (req.headers['content-type'] && !req.headers['content-type'].includes('application/json'))
165
+ ? req.headers['content-type']
166
+ : 'audio/webm';
167
+
168
+ const parts = [
169
+ `--${boundary}\r\n`,
170
+ `Content-Disposition: form-data; name="model"\r\n\r\n`,
171
+ `openai/whisper-large-v3\r\n`,
172
+ `--${boundary}\r\n`,
173
+ `Content-Disposition: form-data; name="file"; filename="${filename}"\r\n`,
174
+ `Content-Type: ${mime}\r\n\r\n`
175
+ ];
176
+ const headerBuf = Buffer.from(parts.join(''), 'utf8');
177
+ const tailBuf = Buffer.from(`\r\n--${boundary}--\r\n`, 'utf8');
178
+ const body = Buffer.concat([headerBuf, audioBuffer, tailBuf]);
179
+
180
+ // Optional language hint.
181
+ let url = cfg.sttEndpoint;
182
+ if (cfg.sttLanguage) {
183
+ const sep = url.includes('?') ? '&' : '?';
184
+ url = url + sep + 'language=' + encodeURIComponent(cfg.sttLanguage);
185
+ }
186
+
187
+ const upstream = await fetch(url, {
188
+ method: 'POST',
189
+ headers: {
190
+ 'Authorization': `Bearer ${cfg.sttAuthKey}`,
191
+ 'Content-Type': `multipart/form-data; boundary=${boundary}`
192
+ },
193
+ body
194
+ });
195
+
196
+ const text = await upstream.text();
197
+ if (!upstream.ok) {
198
+ console.error('[SPEECH-AI] STT upstream error', upstream.status, text);
199
+ return res.status(upstream.status).json({ error: 'STT upstream error', detail: text });
200
+ }
201
+
202
+ // OpenAI-compatible transcription returns { text: "..." }
203
+ let parsed;
204
+ try { parsed = JSON.parse(text); }
205
+ catch { parsed = { text }; }
206
+ res.json({ text: parsed.text || '' });
207
+ }
208
+
209
+ async function handleWandProxy(req, res) {
210
+ const cfg = getSpeechAiConfig();
211
+ if (!cfg.llmEndpoint) return res.status(400).json({ error: 'LLM endpoint not configured' });
212
+ if (!cfg.llmAuthKey) return res.status(400).json({ error: 'LLM auth key not configured' });
213
+
214
+ const userText = (req.body && typeof req.body.text === 'string') ? req.body.text : '';
215
+ if (!userText.trim()) return res.status(400).json({ error: 'No transcript text provided' });
216
+
217
+ const systemPrompt = cfg.wandSystemPrompt || getDefaultWandSystemPrompt();
218
+
219
+ const upstream = await fetch(cfg.llmEndpoint, {
220
+ method: 'POST',
221
+ headers: {
222
+ 'Authorization': `Bearer ${cfg.llmAuthKey}`,
223
+ 'Content-Type': 'application/json'
224
+ },
225
+ body: JSON.stringify({
226
+ model: cfg.llmModel,
227
+ messages: [
228
+ { role: 'system', content: systemPrompt },
229
+ { role: 'user', content: userText }
230
+ ],
231
+ temperature: 0.2,
232
+ max_tokens: Math.min(2048, Math.max(64, Math.ceil(userText.length / 2)))
233
+ })
234
+ });
235
+
236
+ const text = await upstream.text();
237
+ if (!upstream.ok) {
238
+ console.error('[SPEECH-AI] LLM upstream error', upstream.status, text);
239
+ return res.status(upstream.status).json({ error: 'LLM upstream error', detail: text });
240
+ }
241
+ let parsed;
242
+ try { parsed = JSON.parse(text); }
243
+ catch { parsed = { choices: [] }; }
244
+
245
+ const cleaned = parsed.choices?.[0]?.message?.content ?? '';
246
+ res.json({ text: cleaned.trim() });
247
+ }
248
+
249
+ module.exports = { registerSpeechAiEndpoints };
@@ -41,7 +41,16 @@ const defaultConfig = {
41
41
  passwordHash: null,
42
42
  scrollback: 10000,
43
43
  webglRenderer: true,
44
- imageAddonEnabled: true
44
+ imageAddonEnabled: true,
45
+ // Speech & AI settings. Auth keys live in config.json (gitignored) and are
46
+ // never sent back to the browser on GET — only a "set" flag is exposed.
47
+ sttEndpoint: '',
48
+ sttAuthKey: '',
49
+ sttLanguage: '',
50
+ llmEndpoint: 'https://api.deepinfra.com/v1/openai/chat/completions',
51
+ llmAuthKey: '',
52
+ llmModel: 'meta-llama/Llama-3.3-70B-Instruct',
53
+ wandSystemPrompt: ''
45
54
  };
46
55
 
47
56
  /**
@@ -335,6 +344,52 @@ function removePassword() {
335
344
  return saveConfig(config);
336
345
  }
337
346
 
347
+ // Speech & AI default system prompt for the Wand button.
348
+ const DEFAULT_WAND_SYSTEM_PROMPT =
349
+ "You are an assistant that cleans up transcribed speech for terminal input. " +
350
+ "Rewrite the user's speech as a clear, well-punctuated, ready-to-send command or text. " +
351
+ "Fix typos, remove filler words, hesitations, stutters and false starts, and preserve " +
352
+ "the user's intent exactly. Do not add quotes, explanations, or markdown. " +
353
+ "Output only the corrected text.";
354
+
355
+ /**
356
+ * Public speech-ai config — auth keys redacted to boolean flags.
357
+ * Used by GET /api/speech-ai/config so the browser can populate the
358
+ * settings modal without ever seeing the raw secrets.
359
+ */
360
+ function getSpeechAiPublicConfig() {
361
+ const config = loadConfig();
362
+ return {
363
+ sttEndpoint: config.sttEndpoint || '',
364
+ sttLanguage: config.sttLanguage || '',
365
+ llmEndpoint: config.llmEndpoint || defaultConfig.llmEndpoint,
366
+ llmModel: config.llmModel || defaultConfig.llmModel,
367
+ wandSystemPrompt: config.wandSystemPrompt || '',
368
+ sttAuthKeySet: !!config.sttAuthKey,
369
+ llmAuthKeySet: !!config.llmAuthKey
370
+ };
371
+ }
372
+
373
+ /**
374
+ * Internal speech-ai config — includes raw auth keys. Server-side only.
375
+ */
376
+ function getSpeechAiConfig() {
377
+ const config = loadConfig();
378
+ return {
379
+ sttEndpoint: config.sttEndpoint || '',
380
+ sttAuthKey: config.sttAuthKey || '',
381
+ sttLanguage: config.sttLanguage || '',
382
+ llmEndpoint: config.llmEndpoint || defaultConfig.llmEndpoint,
383
+ llmAuthKey: config.llmAuthKey || '',
384
+ llmModel: config.llmModel || defaultConfig.llmModel,
385
+ wandSystemPrompt: config.wandSystemPrompt || ''
386
+ };
387
+ }
388
+
389
+ function getDefaultWandSystemPrompt() {
390
+ return DEFAULT_WAND_SYSTEM_PROMPT;
391
+ }
392
+
338
393
  module.exports = {
339
394
  defaultConfig,
340
395
  ensureConfig,
@@ -362,5 +417,8 @@ module.exports = {
362
417
  verifyPassword,
363
418
  setPassword,
364
419
  removePassword,
420
+ getSpeechAiPublicConfig,
421
+ getSpeechAiConfig,
422
+ getDefaultWandSystemPrompt,
365
423
  USER_INSTALL_DIR
366
424
  };
@@ -2163,6 +2163,14 @@ body.dragging-tabs .tabs-container {
2163
2163
  min-height: 32px;
2164
2164
  }
2165
2165
 
2166
+ /* Disabled state for terminal-only actions (e.g. on SFTP tabs) */
2167
+ .tabs-actions .btn-sm[disabled],
2168
+ .tabs-actions .btn-sm.disabled {
2169
+ opacity: 0.4;
2170
+ cursor: not-allowed;
2171
+ pointer-events: none;
2172
+ }
2173
+
2166
2174
  /* Tabs scroll arrows - desktop only */
2167
2175
  .tabs-scroll-arrows {
2168
2176
  display: none;
@@ -2360,6 +2368,7 @@ body.dragging-tabs .tabs-container {
2360
2368
  pointer-events: auto !important;
2361
2369
  transition: none !important;
2362
2370
  background-color: var(--terminal-scrollbar-track, #151b23) !important;
2371
+ width: 8px !important;
2363
2372
  }
2364
2373
 
2365
2374
  .terminal-container .xterm-scrollable-element > .scrollbar.invisible {
@@ -2378,12 +2387,22 @@ body.dragging-tabs .tabs-container {
2378
2387
  .terminal-container .xterm-scrollable-element > .scrollbar > .slider {
2379
2388
  border-radius: 3px;
2380
2389
  background-color: var(--terminal-scrollbar-thumb, #3d444d) !important;
2390
+ width: 8px !important;
2391
+ min-width: 8px !important;
2392
+ max-width: 8px !important;
2381
2393
  }
2382
2394
 
2383
2395
  .terminal-container .xterm-scrollable-element > .shadow {
2384
2396
  display: none !important;
2385
2397
  }
2386
2398
 
2399
+ /* Hide the overview ruler canvas — it creates a visible white strip
2400
+ when the terminal has no scrollback or on blur. The custom scrollbar
2401
+ already shows scroll position. */
2402
+ .terminal-container .xterm-decoration-overview-ruler {
2403
+ display: none !important;
2404
+ }
2405
+
2387
2406
  /* Hide native viewport scrollbar (xterm v6 uses custom scrollbar) */
2388
2407
  .terminal-container .xterm-viewport::-webkit-scrollbar {
2389
2408
  width: 0;
@@ -2606,6 +2625,10 @@ body.dragging-tabs .tabs-container {
2606
2625
  max-height: 85svh;
2607
2626
  }
2608
2627
 
2628
+ .modal-content.modal-md {
2629
+ max-width: 560px;
2630
+ }
2631
+
2609
2632
  .modal-header {
2610
2633
  display: flex;
2611
2634
  align-items: center;
@@ -2978,6 +3001,99 @@ body.dragging-tabs .tabs-container {
2978
3001
  margin-top: 2px;
2979
3002
  }
2980
3003
 
3004
+ /* Speech-to-Text Modal */
3005
+ .speech-to-text-body {
3006
+ display: flex;
3007
+ flex-direction: column;
3008
+ gap: 14px;
3009
+ }
3010
+
3011
+ .speech-to-text-controls {
3012
+ display: flex;
3013
+ flex-wrap: wrap;
3014
+ gap: 8px;
3015
+ align-items: center;
3016
+ }
3017
+
3018
+ .speech-to-text-controls .btn-sm {
3019
+ display: inline-flex;
3020
+ align-items: center;
3021
+ gap: 6px;
3022
+ min-height: 36px;
3023
+ padding: 0 12px;
3024
+ }
3025
+
3026
+ .stt-btn-label {
3027
+ font-size: 13px;
3028
+ font-weight: 500;
3029
+ }
3030
+
3031
+ /* Inline status indicator (spinner + label) shown in the controls row
3032
+ instead of a toast while the audio is being transcribed. */
3033
+ .stt-status {
3034
+ display: inline-flex;
3035
+ align-items: center;
3036
+ gap: 6px;
3037
+ color: var(--text-secondary);
3038
+ font-size: 13px;
3039
+ font-weight: 500;
3040
+ margin-left: 4px;
3041
+ }
3042
+
3043
+ .stt-status[hidden] {
3044
+ display: none;
3045
+ }
3046
+
3047
+ .stt-status i {
3048
+ color: var(--accent-primary);
3049
+ }
3050
+
3051
+ .stt-record-btn.recording {
3052
+ background: var(--accent-danger, #da3633);
3053
+ color: #fff;
3054
+ border-color: var(--accent-danger, #da3633);
3055
+ }
3056
+
3057
+ .stt-record-btn.recording i {
3058
+ animation: stt-pulse 1.1s ease-in-out infinite;
3059
+ }
3060
+
3061
+ .stt-record-btn.paused {
3062
+ background: var(--accent-warning, #d18616);
3063
+ color: #fff;
3064
+ border-color: var(--accent-warning, #d18616);
3065
+ }
3066
+
3067
+ .stt-record-btn.paused i {
3068
+ animation: none;
3069
+ }
3070
+
3071
+ @keyframes stt-pulse {
3072
+ 0%, 100% { opacity: 1; }
3073
+ 50% { opacity: 0.35; }
3074
+ }
3075
+
3076
+ .speech-to-text-transcript {
3077
+ width: 100%;
3078
+ min-height: 140px;
3079
+ resize: vertical;
3080
+ padding: 10px 12px;
3081
+ background: var(--bg-tertiary);
3082
+ border: 1px solid var(--border-color);
3083
+ border-radius: var(--radius-md);
3084
+ color: var(--text-primary);
3085
+ font-size: 14px;
3086
+ font-family: inherit;
3087
+ line-height: 1.4;
3088
+ box-sizing: border-box;
3089
+ transition: var(--transition-fast);
3090
+ }
3091
+
3092
+ .speech-to-text-transcript:focus {
3093
+ outline: none;
3094
+ border-color: var(--accent-primary);
3095
+ }
3096
+
2981
3097
  /* SFTP Browser */
2982
3098
  .sftp-container {
2983
3099
  height: 100%;
@@ -3298,6 +3414,37 @@ body.dragging-tabs .tabs-container {
3298
3414
  --header-height: 43px;
3299
3415
  }
3300
3416
 
3417
+ /* Thinner xterm scrollbar on mobile */
3418
+ .terminal-container .xterm-scrollable-element > .scrollbar {
3419
+ width: 4px !important;
3420
+ min-width: 4px !important;
3421
+ max-width: 4px !important;
3422
+ }
3423
+ .terminal-container .xterm-scrollable-element > .scrollbar.vertical {
3424
+ width: 4px !important;
3425
+ min-width: 4px !important;
3426
+ max-width: 4px !important;
3427
+ }
3428
+ .terminal-container .xterm-scrollable-element > .scrollbar > .slider {
3429
+ width: 4px !important;
3430
+ min-width: 4px !important;
3431
+ max-width: 4px !important;
3432
+ border-radius: 2px !important;
3433
+ /* Match the track background so the scrollbar blend in and doesn't
3434
+ look like a white line against the dark terminal background. */
3435
+ background-color: var(--terminal-scrollbar-track, #151b23) !important;
3436
+ }
3437
+ /* Also hide the viewport scrollbar more aggressively on mobile */
3438
+ .terminal-container .xterm-viewport {
3439
+ scrollbar-width: none !important;
3440
+ -ms-overflow-style: none !important;
3441
+ }
3442
+ .terminal-container .xterm-viewport::-webkit-scrollbar {
3443
+ width: 0 !important;
3444
+ height: 0 !important;
3445
+ display: none !important;
3446
+ }
3447
+
3301
3448
  .header {
3302
3449
  padding: 0 6px;
3303
3450
  }
@@ -3789,6 +3936,69 @@ body.dragging-tabs .tabs-container {
3789
3936
  opacity: 1;
3790
3937
  }
3791
3938
 
3939
+ /* Settings subgroups (used by Speech & AI category) */
3940
+ .setting-subgroup {
3941
+ display: flex;
3942
+ flex-direction: column;
3943
+ gap: 8px;
3944
+ padding: 14px 16px;
3945
+ margin-bottom: 18px;
3946
+ background: var(--bg-tertiary);
3947
+ border: 1px solid var(--border-color);
3948
+ border-radius: var(--radius-md);
3949
+ }
3950
+
3951
+ .setting-subgroup-title {
3952
+ display: flex;
3953
+ align-items: center;
3954
+ gap: 8px;
3955
+ margin: 0 0 4px 0;
3956
+ font-size: 14px;
3957
+ font-weight: 600;
3958
+ color: var(--text-primary);
3959
+ }
3960
+
3961
+ .setting-subgroup-title i {
3962
+ color: var(--accent-primary);
3963
+ }
3964
+
3965
+ /* Speech & AI category: URL / textarea inputs need full width */
3966
+ #settings-category-speech-ai .setting-control {
3967
+ display: block;
3968
+ }
3969
+
3970
+ #settings-category-speech-ai .setting-input,
3971
+ #settings-category-speech-ai .password-input {
3972
+ width: 100%;
3973
+ box-sizing: border-box;
3974
+ }
3975
+
3976
+ #settings-category-speech-ai .password-input {
3977
+ display: flex;
3978
+ align-items: center;
3979
+ }
3980
+
3981
+ #settings-category-speech-ai .stt-prompt-control {
3982
+ display: flex;
3983
+ flex-direction: column;
3984
+ gap: 8px;
3985
+ align-items: flex-end;
3986
+ }
3987
+
3988
+ .stt-prompt-textarea {
3989
+ width: 100%;
3990
+ min-height: 120px;
3991
+ resize: vertical;
3992
+ font-family: var(--font-mono, monospace);
3993
+ line-height: 1.4;
3994
+ padding: 10px 12px;
3995
+ box-sizing: border-box;
3996
+ }
3997
+
3998
+ .stt-prompt-reset {
3999
+ align-self: flex-end;
4000
+ }
4001
+
3792
4002
  .debug-info-list {
3793
4003
  display: flex;
3794
4004
  flex-direction: column;