forked from shubhamshnd/Open-Cluely
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.js
More file actions
304 lines (268 loc) · 7.98 KB
/
config.js
File metadata and controls
304 lines (268 loc) · 7.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
// AI provider configuration.
// Supported providers: 'gemini' and 'ollama'.
const AI_PROVIDERS = ['gemini', 'ollama'];
const DEFAULT_AI_PROVIDER = 'gemini';
const DEFAULT_OLLAMA_BASE_URL = 'http://localhost:11434';
const DEFAULT_OLLAMA_MODEL = 'llama3.2';
// Gemini model configuration.
// The first model in this list is treated as the default model everywhere.
const GEMINI_MODELS = [
'gemini-2.5-flash-lite',
'gemini-3-flash-preview',
'gemini-3.1-flash-lite-preview',
'gemini-3.1-pro-preview'
];
// AssemblyAI speech model configuration.
// The first model in this list is treated as the default model everywhere.
const ASSEMBLY_AI_SPEECH_MODELS = [
'universal-streaming-english',
'universal-streaming-multilingual'
];
// Programming language configuration.
// The first language in this list is treated as the default language everywhere.
const PROGRAMMING_LANGUAGES = [
'Python',
'Java',
'JavaScript',
'TypeScript',
'C++',
'Go',
'Rust',
'C#',
'Kotlin'
];
// Keyboard shortcuts configuration.
// Edit accelerators here to customize app shortcuts in one place.
const KEYBOARD_SHORTCUTS = [
{
id: 'toggleTranscription',
buttonLabel: 'Transcription',
description: 'Toggle transcription master control',
accelerator: 'Alt+Shift+T'
},
{
id: 'takeScreenshot',
buttonLabel: 'Screenshot',
description: 'Capture screenshot',
accelerator: 'Alt+Shift+S'
},
{
id: 'askAi',
buttonLabel: 'Ask AI',
description: 'Uses only enabled transcript, enabled screenshots, and enabled chat context',
accelerator: 'Alt+Shift+A'
},
{
id: 'screenAi',
buttonLabel: 'Screen AI',
description: 'Analyzes only enabled screenshots selected in chat',
accelerator: 'Alt+Shift+E'
},
{
id: 'suggest',
buttonLabel: 'Suggest',
description: 'Uses only enabled transcript context to suggest what to say next',
accelerator: 'Alt+Shift+G'
},
{
id: 'notes',
buttonLabel: 'Notes',
description: 'Generates notes from only enabled context',
accelerator: 'Alt+Shift+N'
},
{
id: 'insights',
buttonLabel: 'Insights',
description: 'Finds key insights from only enabled context',
accelerator: 'Alt+Shift+I'
},
{
id: 'clearChat',
buttonLabel: 'Clear Chat',
description: 'Clears chat, screenshots, and AI history',
accelerator: 'Alt+Shift+C'
},
{
id: 'emergencyHide',
buttonLabel: 'Hide',
description: 'Emergency hide',
accelerator: 'Alt+Shift+X'
},
{
id: 'toggleStealth',
buttonLabel: 'Toggle Stealth',
description: 'Toggle stealth mode',
accelerator: 'Alt+Shift+H'
},
{
id: 'moveWindowLeft',
buttonLabel: 'Move Window Left',
description: 'Move window to left side',
accelerator: 'Alt+Shift+Left'
},
{
id: 'moveWindowRight',
buttonLabel: 'Move Window Right',
description: 'Move window to right side',
accelerator: 'Alt+Shift+Right'
},
{
id: 'moveWindowUp',
buttonLabel: 'Move Window Up',
description: 'Move window to top',
accelerator: 'Alt+Shift+Up'
},
{
id: 'moveWindowDown',
buttonLabel: 'Move Window Down',
description: 'Move window to bottom',
accelerator: 'Alt+Shift+Down'
},
{
id: 'windowSizePreset1',
buttonLabel: 'Size Preset 1',
description: 'Resize window to minimum size',
accelerator: 'Alt+Shift+1'
},
{
id: 'windowSizePreset2',
buttonLabel: 'Size Preset 2',
description: 'Resize window to +25% from minimum size',
accelerator: 'Alt+Shift+2'
},
{
id: 'windowSizePreset3',
buttonLabel: 'Size Preset 3',
description: 'Resize window to +50% from minimum size',
accelerator: 'Alt+Shift+3'
},
{
id: 'windowSizePreset4',
buttonLabel: 'Size Preset 4',
description: 'Resize window to +75% from minimum size',
accelerator: 'Alt+Shift+4'
}
];
// AI provider configuration functions
function getAiProviders() {
return [...AI_PROVIDERS];
}
function getDefaultAiProvider() {
return DEFAULT_AI_PROVIDER;
}
function isConfiguredAiProvider(providerName) {
return AI_PROVIDERS.includes(providerName);
}
function resolveAiProvider(providerName) {
return isConfiguredAiProvider(providerName) ? providerName : DEFAULT_AI_PROVIDER;
}
function getDefaultOllamaBaseUrl() {
return DEFAULT_OLLAMA_BASE_URL;
}
function getDefaultOllamaModel() {
return DEFAULT_OLLAMA_MODEL;
}
// Gemini model configuration functions
function getGeminiModels() {
if (!Array.isArray(GEMINI_MODELS) || GEMINI_MODELS.length === 0) {
throw new Error('Gemini models are not configured. Add at least one model to src/config.js.');
}
return [...GEMINI_MODELS];
}
function getDefaultGeminiModel() {
return getGeminiModels()[0];
}
function isConfiguredGeminiModel(modelName) {
return getGeminiModels().includes(modelName);
}
function resolveGeminiModel(modelName) {
return isConfiguredGeminiModel(modelName) ? modelName : getDefaultGeminiModel();
}
// Programming language configuration functions
function getProgrammingLanguages() {
if (!Array.isArray(PROGRAMMING_LANGUAGES) || PROGRAMMING_LANGUAGES.length === 0) {
throw new Error('Programming languages are not configured. Add at least one language to src/config.js.');
}
return [...PROGRAMMING_LANGUAGES];
}
function getDefaultProgrammingLanguage() {
return getProgrammingLanguages()[0];
}
function isConfiguredProgrammingLanguage(languageName) {
return getProgrammingLanguages().includes(languageName);
}
function resolveProgrammingLanguage(languageName) {
return isConfiguredProgrammingLanguage(languageName)
? languageName
: getDefaultProgrammingLanguage();
}
// AssemblyAI speech model configuration functions
function getAssemblyAiSpeechModels() {
if (!Array.isArray(ASSEMBLY_AI_SPEECH_MODELS) || ASSEMBLY_AI_SPEECH_MODELS.length === 0) {
throw new Error('AssemblyAI speech models are not configured. Add at least one model to src/config.js.');
}
return [...ASSEMBLY_AI_SPEECH_MODELS];
}
function getDefaultAssemblyAiSpeechModel() {
return getAssemblyAiSpeechModels()[0];
}
function isConfiguredAssemblyAiSpeechModel(modelName) {
return getAssemblyAiSpeechModels().includes(modelName);
}
function resolveAssemblyAiSpeechModel(modelName, fallbackModel = getDefaultAssemblyAiSpeechModel()) {
if (isConfiguredAssemblyAiSpeechModel(modelName)) {
return modelName;
}
if (isConfiguredAssemblyAiSpeechModel(fallbackModel)) {
return fallbackModel;
}
return getDefaultAssemblyAiSpeechModel();
}
function getKeyboardShortcuts() {
if (!Array.isArray(KEYBOARD_SHORTCUTS) || KEYBOARD_SHORTCUTS.length === 0) {
throw new Error('Keyboard shortcuts are not configured. Add at least one shortcut to src/config.js.');
}
return KEYBOARD_SHORTCUTS.map((shortcut) => ({ ...shortcut }));
}
function getKeyboardShortcutById(shortcutId) {
const normalizedId = String(shortcutId || '').trim();
if (!normalizedId) {
throw new Error('Shortcut id is required.');
}
const shortcut = getKeyboardShortcuts().find((entry) => entry.id === normalizedId);
if (!shortcut) {
throw new Error(`Shortcut "${normalizedId}" is not configured in src/config.js.`);
}
return shortcut;
}
function getKeyboardShortcutAccelerator(shortcutId) {
const shortcut = getKeyboardShortcutById(shortcutId);
const accelerator = String(shortcut.accelerator || '').trim();
if (!accelerator) {
throw new Error(`Shortcut "${shortcutId}" is missing an accelerator in src/config.js.`);
}
return accelerator;
}
module.exports = {
getAiProviders,
getDefaultAiProvider,
getDefaultOllamaBaseUrl,
getDefaultOllamaModel,
isConfiguredAiProvider,
resolveAiProvider,
getAssemblyAiSpeechModels,
getDefaultAssemblyAiSpeechModel,
getGeminiModels,
getDefaultGeminiModel,
getKeyboardShortcutAccelerator,
getKeyboardShortcutById,
getKeyboardShortcuts,
getDefaultProgrammingLanguage,
getProgrammingLanguages,
isConfiguredAssemblyAiSpeechModel,
isConfiguredGeminiModel,
isConfiguredProgrammingLanguage,
resolveAssemblyAiSpeechModel,
resolveGeminiModel,
resolveProgrammingLanguage
};