@aivin-labs/cli 1.0.13 → 1.0.24
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/README.md +325 -304
- package/bin/cli.mjs +97 -18
- package/bin/lib/localPreview.mjs +437 -0
- package/bin/lib/openFile.mjs +235 -0
- package/bin/lib/previewCache.mjs +71 -0
- package/bin/lib/remote/atomicFile.mjs +32 -0
- package/bin/lib/remote/autoStart.mjs +2 -1
- package/bin/lib/remote/autoUpdate.mjs +153 -129
- package/bin/lib/remote/callLedger.mjs +21 -0
- package/bin/lib/remote/cdpPolicy.mjs +14 -2
- package/bin/lib/remote/client.mjs +1025 -889
- package/bin/lib/remote/codingAgents.mjs +2 -2
- package/bin/lib/remote/constants.mjs +263 -251
- package/bin/lib/remote/credentials.mjs +81 -4
- package/bin/lib/remote/daemonLock.mjs +57 -17
- package/bin/lib/remote/desktop/castInput.mjs +98 -0
- package/bin/lib/remote/desktop/desktopCast.mjs +337 -198
- package/bin/lib/remote/desktop/desktopCastCaptureSource.mjs +598 -0
- package/bin/lib/remote/desktop/desktopCastSource.mjs +880 -514
- package/bin/lib/remote/desktop/desktopWebRtc.mjs +251 -95
- package/bin/lib/remote/desktop/fileAssociation.mjs +108 -0
- package/bin/lib/remote/desktop/index.mjs +21 -7
- package/bin/lib/remote/desktop/linuxTraySource.mjs +1 -8
- package/bin/lib/remote/desktop/macTraySource.mjs +0 -2
- package/bin/lib/remote/desktop/strings.mjs +28 -2
- package/bin/lib/remote/desktop/traySource.mjs +380 -16
- package/bin/lib/remote/desktop/webrtcRuntime.mjs +137 -0
- package/bin/lib/remote/desktop/webrtcWorker.mjs +183 -0
- package/bin/lib/remote/deviceProfile.mjs +2 -4
- package/bin/lib/remote/fileIndexer.mjs +30 -14
- package/bin/lib/remote/folderRules.mjs +3 -0
- package/bin/lib/remote/gitSafe.mjs +31 -0
- package/bin/lib/remote/gui/index.mjs +66 -24
- package/bin/lib/remote/gui/officeHostSource.mjs +635 -393
- package/bin/lib/remote/gui/windowsHost.mjs +3 -1
- package/bin/lib/remote/gui/windowsHostSource.mjs +291 -60
- package/bin/lib/remote/httpTransfer.mjs +64 -3
- package/bin/lib/remote/localPolicy.mjs +73 -7
- package/bin/lib/remote/mascot/ask.mjs +956 -768
- package/bin/lib/remote/mascot/askBlocksSource.mjs +286 -0
- package/bin/lib/remote/mascot/askHostSource.mjs +658 -530
- package/bin/lib/remote/mascot/blocks.mjs +201 -0
- package/bin/lib/remote/mascot/bot.mjs +26 -2
- package/bin/lib/remote/mascot/chartLayout.mjs +382 -0
- package/bin/lib/remote/mascot/diagramRender.mjs +154 -0
- package/bin/lib/remote/mascot/emojiSource.mjs +273 -0
- package/bin/lib/remote/mascot/fileChips.mjs +62 -0
- package/bin/lib/remote/mascot/hostSource.mjs +328 -49
- package/bin/lib/remote/mascot/hotkey.mjs +31 -7
- package/bin/lib/remote/mascot/images.mjs +111 -0
- package/bin/lib/remote/mascot/index.mjs +663 -493
- package/bin/lib/remote/mascot/lucideIcons.mjs +32 -0
- package/bin/lib/remote/mascot/mermaidBundle.mjs +28 -0
- package/bin/lib/remote/mascot/mood.mjs +57 -0
- package/bin/lib/remote/mascot/rigSource.mjs +643 -609
- package/bin/lib/remote/mascot/safeUrl.mjs +29 -0
- package/bin/lib/remote/mascot/strings.mjs +459 -375
- package/bin/lib/remote/mascot/ui.mjs +27 -7
- package/bin/lib/remote/multiUser.mjs +7 -2
- package/bin/lib/remote/notify.mjs +4 -1
- package/bin/lib/remote/office/index.mjs +12 -6
- package/bin/lib/remote/processes.mjs +5 -2
- package/bin/lib/remote/sandbox.mjs +26 -0
- package/bin/lib/remote/secretPaths.mjs +21 -0
- package/bin/lib/remote/tokenRotation.mjs +28 -0
- package/bin/lib/remote/toolHandlers.mjs +79 -15
- package/bin/lib/remote/watchBatcher.mjs +56 -0
- package/bin/lib/selfUpdate.mjs +12 -2
- package/bin/lib/update/binarySwap.mjs +15 -1
- package/bin/lib/update/state.mjs +10 -0
- package/docs/CLI.md +1545 -1504
- package/docs/media/aivin-ecosystem.jpg +0 -0
- package/package.json +75 -71
|
@@ -1,375 +1,459 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chữ của linh vật theo ngôn ngữ (29/10/2026). Linh vật hiện trên máy người dùng, không qua máy chủ → chọn ngôn ngữ theo máy: AIVIN_LANG,
|
|
3
|
-
* rồi ngôn ngữ của hệ điều hành (Intl), không có bản dịch → tiếng Anh. Mục đích bước do BE gửi (`call.purpose`) vốn đã theo ngôn ngữ của
|
|
4
|
-
* người dùng nên hiện nguyên văn. Thêm ngôn ngữ: thêm một bảng cùng khoá vào STRINGS.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const MascotText = Object.freeze({
|
|
8
|
-
WINDOW_TITLE: 'window_title',
|
|
9
|
-
TOOLTIP: 'tooltip',
|
|
10
|
-
PANEL_TITLE: 'panel_title',
|
|
11
|
-
NOW_LABEL: 'now_label',
|
|
12
|
-
LOG_LABEL: 'log_label',
|
|
13
|
-
NOTHING_YET: 'nothing_yet',
|
|
14
|
-
PAUSE: 'pause',
|
|
15
|
-
RESUME: 'resume',
|
|
16
|
-
HIDE: 'hide',
|
|
17
|
-
TURN_OFF: 'turn_off',
|
|
18
|
-
CLOSE: 'close',
|
|
19
|
-
STATE_IDLE: 'state_idle',
|
|
20
|
-
STATE_WORKING: 'state_working',
|
|
21
|
-
STATE_THINKING: 'state_thinking',
|
|
22
|
-
STATE_WAITING: 'state_waiting',
|
|
23
|
-
STATE_PAUSED: 'state_paused',
|
|
24
|
-
STATE_OFFLINE: 'state_offline',
|
|
25
|
-
STATE_DONE: 'state_done',
|
|
26
|
-
STATE_ERROR: 'state_error',
|
|
27
|
-
READY: 'ready',
|
|
28
|
-
CONNECTED: 'connected',
|
|
29
|
-
DISCONNECTED: 'disconnected',
|
|
30
|
-
PAUSED: 'paused',
|
|
31
|
-
RESUMED: 'resumed',
|
|
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
|
-
[MascotText.
|
|
149
|
-
[MascotText.
|
|
150
|
-
[MascotText.
|
|
151
|
-
[MascotText.
|
|
152
|
-
[MascotText.
|
|
153
|
-
[MascotText.
|
|
154
|
-
[MascotText.
|
|
155
|
-
[MascotText.
|
|
156
|
-
[MascotText.
|
|
157
|
-
[MascotText.
|
|
158
|
-
[MascotText.
|
|
159
|
-
[MascotText.
|
|
160
|
-
[MascotText.
|
|
161
|
-
[MascotText.
|
|
162
|
-
[MascotText.
|
|
163
|
-
[MascotText.
|
|
164
|
-
[MascotText.
|
|
165
|
-
[MascotText.
|
|
166
|
-
[MascotText.
|
|
167
|
-
[MascotText.
|
|
168
|
-
[MascotText.
|
|
169
|
-
[MascotText.
|
|
170
|
-
[MascotText.
|
|
171
|
-
[MascotText.
|
|
172
|
-
[MascotText.
|
|
173
|
-
[MascotText.
|
|
174
|
-
[MascotText.
|
|
175
|
-
[MascotText.
|
|
176
|
-
[MascotText.
|
|
177
|
-
[MascotText.
|
|
178
|
-
[MascotText.
|
|
179
|
-
[MascotText.
|
|
180
|
-
[MascotText.
|
|
181
|
-
[MascotText.
|
|
182
|
-
[MascotText.
|
|
183
|
-
[MascotText.
|
|
184
|
-
[MascotText.
|
|
185
|
-
[MascotText.
|
|
186
|
-
[MascotText.
|
|
187
|
-
[MascotText.
|
|
188
|
-
[MascotText.
|
|
189
|
-
[MascotText.
|
|
190
|
-
[MascotText.
|
|
191
|
-
[MascotText.
|
|
192
|
-
[MascotText.
|
|
193
|
-
[MascotText.
|
|
194
|
-
[MascotText.
|
|
195
|
-
[MascotText.
|
|
196
|
-
[MascotText.
|
|
197
|
-
[MascotText.
|
|
198
|
-
[MascotText.
|
|
199
|
-
[MascotText.
|
|
200
|
-
[MascotText.
|
|
201
|
-
[MascotText.
|
|
202
|
-
[MascotText.
|
|
203
|
-
[MascotText.
|
|
204
|
-
[MascotText.
|
|
205
|
-
[MascotText.
|
|
206
|
-
[MascotText.
|
|
207
|
-
[MascotText.
|
|
208
|
-
[MascotText.
|
|
209
|
-
[MascotText.
|
|
210
|
-
[MascotText.
|
|
211
|
-
[MascotText.
|
|
212
|
-
[MascotText.
|
|
213
|
-
[MascotText.
|
|
214
|
-
[MascotText.
|
|
215
|
-
[MascotText.
|
|
216
|
-
[MascotText.
|
|
217
|
-
[MascotText.
|
|
218
|
-
[MascotText.
|
|
219
|
-
[MascotText.
|
|
220
|
-
[MascotText.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
[MascotText.
|
|
224
|
-
[MascotText.
|
|
225
|
-
[MascotText.
|
|
226
|
-
[MascotText.
|
|
227
|
-
[MascotText.
|
|
228
|
-
[MascotText.
|
|
229
|
-
[MascotText.
|
|
230
|
-
[MascotText.
|
|
231
|
-
[MascotText.
|
|
232
|
-
[MascotText.
|
|
233
|
-
[MascotText.
|
|
234
|
-
[MascotText.
|
|
235
|
-
[MascotText.
|
|
236
|
-
[MascotText.
|
|
237
|
-
[MascotText.
|
|
238
|
-
[MascotText.
|
|
239
|
-
[MascotText.
|
|
240
|
-
[MascotText.
|
|
241
|
-
[MascotText.
|
|
242
|
-
[MascotText.
|
|
243
|
-
[MascotText.
|
|
244
|
-
[MascotText.
|
|
245
|
-
[MascotText.
|
|
246
|
-
[MascotText.
|
|
247
|
-
[MascotText.
|
|
248
|
-
[MascotText.
|
|
249
|
-
[MascotText.
|
|
250
|
-
[MascotText.
|
|
251
|
-
[MascotText.
|
|
252
|
-
[MascotText.
|
|
253
|
-
[MascotText.
|
|
254
|
-
[MascotText.
|
|
255
|
-
[MascotText.
|
|
256
|
-
[MascotText.
|
|
257
|
-
[MascotText.
|
|
258
|
-
[MascotText.
|
|
259
|
-
[MascotText.
|
|
260
|
-
[MascotText.
|
|
261
|
-
[MascotText.
|
|
262
|
-
[MascotText.
|
|
263
|
-
[MascotText.
|
|
264
|
-
[MascotText.
|
|
265
|
-
[MascotText.
|
|
266
|
-
[MascotText.
|
|
267
|
-
[MascotText.
|
|
268
|
-
[MascotText.
|
|
269
|
-
[MascotText.
|
|
270
|
-
[MascotText.
|
|
271
|
-
[MascotText.
|
|
272
|
-
[MascotText.
|
|
273
|
-
[MascotText.
|
|
274
|
-
[MascotText.
|
|
275
|
-
[MascotText.
|
|
276
|
-
[MascotText.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
[MascotText.
|
|
280
|
-
[MascotText.
|
|
281
|
-
[MascotText.
|
|
282
|
-
[MascotText.
|
|
283
|
-
[MascotText.
|
|
284
|
-
[MascotText.
|
|
285
|
-
[MascotText.
|
|
286
|
-
[MascotText.
|
|
287
|
-
[MascotText.
|
|
288
|
-
[MascotText.
|
|
289
|
-
[MascotText.
|
|
290
|
-
[MascotText.
|
|
291
|
-
[MascotText.
|
|
292
|
-
[MascotText.
|
|
293
|
-
[MascotText.
|
|
294
|
-
[MascotText.
|
|
295
|
-
[MascotText.
|
|
296
|
-
[MascotText.
|
|
297
|
-
[MascotText.
|
|
298
|
-
[MascotText.
|
|
299
|
-
[MascotText.
|
|
300
|
-
[MascotText.
|
|
301
|
-
[MascotText.
|
|
302
|
-
[MascotText.
|
|
303
|
-
[MascotText.
|
|
304
|
-
[MascotText.
|
|
305
|
-
[MascotText.
|
|
306
|
-
[MascotText.
|
|
307
|
-
[MascotText.
|
|
308
|
-
[MascotText.
|
|
309
|
-
[MascotText.
|
|
310
|
-
[MascotText.
|
|
311
|
-
[MascotText.
|
|
312
|
-
[MascotText.
|
|
313
|
-
[MascotText.
|
|
314
|
-
[MascotText.
|
|
315
|
-
[MascotText.
|
|
316
|
-
[MascotText.
|
|
317
|
-
[MascotText.
|
|
318
|
-
[MascotText.
|
|
319
|
-
[MascotText.
|
|
320
|
-
[MascotText.
|
|
321
|
-
[MascotText.
|
|
322
|
-
[MascotText.
|
|
323
|
-
[MascotText.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
[
|
|
330
|
-
[
|
|
331
|
-
[
|
|
332
|
-
[
|
|
333
|
-
[
|
|
334
|
-
[
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
[
|
|
338
|
-
[
|
|
339
|
-
[
|
|
340
|
-
[
|
|
341
|
-
[
|
|
342
|
-
[
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Chữ của linh vật theo ngôn ngữ (29/10/2026). Linh vật hiện trên máy người dùng, không qua máy chủ → chọn ngôn ngữ theo máy: AIVIN_LANG,
|
|
3
|
+
* rồi ngôn ngữ của hệ điều hành (Intl), không có bản dịch → tiếng Anh. Mục đích bước do BE gửi (`call.purpose`) vốn đã theo ngôn ngữ của
|
|
4
|
+
* người dùng nên hiện nguyên văn. Thêm ngôn ngữ: thêm một bảng cùng khoá vào STRINGS.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const MascotText = Object.freeze({
|
|
8
|
+
WINDOW_TITLE: 'window_title',
|
|
9
|
+
TOOLTIP: 'tooltip',
|
|
10
|
+
PANEL_TITLE: 'panel_title',
|
|
11
|
+
NOW_LABEL: 'now_label',
|
|
12
|
+
LOG_LABEL: 'log_label',
|
|
13
|
+
NOTHING_YET: 'nothing_yet',
|
|
14
|
+
PAUSE: 'pause',
|
|
15
|
+
RESUME: 'resume',
|
|
16
|
+
HIDE: 'hide',
|
|
17
|
+
TURN_OFF: 'turn_off',
|
|
18
|
+
CLOSE: 'close',
|
|
19
|
+
STATE_IDLE: 'state_idle',
|
|
20
|
+
STATE_WORKING: 'state_working',
|
|
21
|
+
STATE_THINKING: 'state_thinking',
|
|
22
|
+
STATE_WAITING: 'state_waiting',
|
|
23
|
+
STATE_PAUSED: 'state_paused',
|
|
24
|
+
STATE_OFFLINE: 'state_offline',
|
|
25
|
+
STATE_DONE: 'state_done',
|
|
26
|
+
STATE_ERROR: 'state_error',
|
|
27
|
+
READY: 'ready',
|
|
28
|
+
CONNECTED: 'connected',
|
|
29
|
+
DISCONNECTED: 'disconnected',
|
|
30
|
+
PAUSED: 'paused',
|
|
31
|
+
RESUMED: 'resumed',
|
|
32
|
+
CAST_VIEWING: 'cast_viewing',
|
|
33
|
+
CAST_ENDED: 'cast_ended',
|
|
34
|
+
THINKING: 'thinking',
|
|
35
|
+
DONE_ONE: 'done_one',
|
|
36
|
+
DONE_MANY: 'done_many',
|
|
37
|
+
FAILED: 'failed',
|
|
38
|
+
WAITING_CONFIRM: 'waiting_confirm',
|
|
39
|
+
CONFIRM_ALLOWED: 'confirm_allowed',
|
|
40
|
+
CONFIRM_REJECTED: 'confirm_rejected',
|
|
41
|
+
TURNED_OFF: 'turned_off',
|
|
42
|
+
MS: 'ms',
|
|
43
|
+
SECONDS: 'seconds',
|
|
44
|
+
CMD_ON: 'cmd_on',
|
|
45
|
+
CMD_OFF: 'cmd_off',
|
|
46
|
+
CMD_STATUS_ON: 'cmd_status_on',
|
|
47
|
+
CMD_STATUS_OFF: 'cmd_status_off',
|
|
48
|
+
CMD_UNSUPPORTED: 'cmd_unsupported',
|
|
49
|
+
CMD_USAGE: 'cmd_usage',
|
|
50
|
+
ASK_HINT: 'ask_hint',
|
|
51
|
+
ASK_LOG: 'ask_log',
|
|
52
|
+
ASK_SEND: 'ask_send',
|
|
53
|
+
ASK_MIC: 'ask_mic',
|
|
54
|
+
ASK_THINKING: 'ask_thinking',
|
|
55
|
+
ASK_NO_MIC: 'ask_no_mic',
|
|
56
|
+
VOICE_CONNECTING: 'voice_connecting',
|
|
57
|
+
VOICE_LISTENING: 'voice_listening',
|
|
58
|
+
VOICE_THINKING: 'voice_thinking',
|
|
59
|
+
VOICE_SPEAKING: 'voice_speaking',
|
|
60
|
+
VOICE_ENDED: 'voice_ended',
|
|
61
|
+
VOICE_TIMED_OUT: 'voice_timed_out',
|
|
62
|
+
VOICE_RECORDING: 'voice_recording',
|
|
63
|
+
VOICE_IDLE_ENDED: 'voice_idle_ended',
|
|
64
|
+
VOICE_MIC_BUSY: 'voice_mic_busy',
|
|
65
|
+
VOICE_HINT_END: 'voice_hint_end',
|
|
66
|
+
VOICE_HINT_INTERRUPT: 'voice_hint_interrupt',
|
|
67
|
+
VOICE_HINT_SEND: 'voice_hint_send',
|
|
68
|
+
ASK_TRANSCRIBING: 'ask_transcribing',
|
|
69
|
+
ASK_TOO_SHORT: 'ask_too_short',
|
|
70
|
+
ASK_OFFLINE: 'ask_offline',
|
|
71
|
+
ASK_ERR_BUSY: 'ask_err_busy',
|
|
72
|
+
ASK_PARALLEL_SENT: 'ask_parallel_sent',
|
|
73
|
+
ASK_BUSY_VOICE: 'ask_busy_voice',
|
|
74
|
+
ASK_QUEUED: 'ask_queued',
|
|
75
|
+
ASK_ERR_TOO_LONG: 'ask_err_too_long',
|
|
76
|
+
ASK_ERR_NOT_UNDERSTOOD: 'ask_err_not_understood',
|
|
77
|
+
ASK_ERR_DISABLED: 'ask_err_disabled',
|
|
78
|
+
ASK_ERR_FAILED: 'ask_err_failed',
|
|
79
|
+
ASK_ERR_UNSUPPORTED: 'ask_err_unsupported',
|
|
80
|
+
ASK_ERR_NO_QUESTION: 'ask_err_no_question',
|
|
81
|
+
ASK_ERR_INVALID_ANSWER: 'ask_err_invalid_answer',
|
|
82
|
+
ASK_ATTACHED: 'ask_attached',
|
|
83
|
+
ASK_DETACH: 'ask_detach',
|
|
84
|
+
ASK_FILES_LABEL: 'ask_files_label',
|
|
85
|
+
ASK_FILES_DEFAULT: 'ask_files_default',
|
|
86
|
+
DROP_ONE: 'drop_one',
|
|
87
|
+
DROP_MANY: 'drop_many',
|
|
88
|
+
DROP_FULL: 'drop_full',
|
|
89
|
+
AWAY_SUMMARY: 'away_summary',
|
|
90
|
+
AWAY_DONE: 'away_done',
|
|
91
|
+
AWAY_FAILED: 'away_failed',
|
|
92
|
+
AWAY_NEEDS: 'away_needs',
|
|
93
|
+
ASK_MORE: 'ask_more',
|
|
94
|
+
ASK_OPEN_WEB: 'ask_open_web',
|
|
95
|
+
ASK_OPEN_IMAGE: 'ask_open_image',
|
|
96
|
+
ASK_OPEN_DIAGRAM: 'ask_open_diagram',
|
|
97
|
+
ASK_WEBVIEW_TITLE: 'ask_webview_title',
|
|
98
|
+
ASK_WEBVIEW_OPEN: 'ask_webview_open',
|
|
99
|
+
ASK_WEBVIEW_FAILED: 'ask_webview_failed',
|
|
100
|
+
ASK_SCREENCAST_TITLE: 'ask_screencast_title',
|
|
101
|
+
ASK_SCREENCAST_HINT: 'ask_screencast_hint',
|
|
102
|
+
ASK_SOURCES: 'ask_sources',
|
|
103
|
+
ASK_MORE_POINTS: 'ask_more_points',
|
|
104
|
+
FORM_YES: 'form_yes',
|
|
105
|
+
FORM_NO: 'form_no',
|
|
106
|
+
FORM_KEEP: 'form_keep',
|
|
107
|
+
ASK_RESULT: 'ask_result',
|
|
108
|
+
ASK_MORE_ROWS: 'ask_more_rows',
|
|
109
|
+
ASK_MORE_COLS: 'ask_more_cols',
|
|
110
|
+
ASK_MORE_CARDS: 'ask_more_cards',
|
|
111
|
+
ASK_NO_REPLY: 'ask_no_reply',
|
|
112
|
+
ASK_STOP: 'ask_stop',
|
|
113
|
+
NEW_CHAT: 'new_chat',
|
|
114
|
+
NEW_CHAT_TIP: 'new_chat_tip',
|
|
115
|
+
ASK_NEW_CHAT_DONE: 'ask_new_chat_done',
|
|
116
|
+
ASK_CANCELLED: 'ask_cancelled',
|
|
117
|
+
ASK_ANSWERED_ELSEWHERE: 'ask_answered_elsewhere',
|
|
118
|
+
FORM_FIELD: 'form_field',
|
|
119
|
+
FORM_OPTIONAL: 'form_optional',
|
|
120
|
+
FORM_SKIP: 'form_skip',
|
|
121
|
+
ASK_CONFIRM: 'ask_confirm',
|
|
122
|
+
NOTIFY_DONE: 'notify_done',
|
|
123
|
+
NOTIFY_FAILED: 'notify_failed',
|
|
124
|
+
NOTIFY_NEEDS_YOU: 'notify_needs_you',
|
|
125
|
+
NOTIFY_FREQ_LABEL: 'notify_freq_label',
|
|
126
|
+
NOTIFY_FREQ_MIN: 'notify_freq_min',
|
|
127
|
+
NOTIFY_FREQ_MID: 'notify_freq_mid',
|
|
128
|
+
NOTIFY_FREQ_MAX: 'notify_freq_max',
|
|
129
|
+
NOTIFY_STEP_MIN: 'notify_step_min',
|
|
130
|
+
NOTIFY_STEP_MID: 'notify_step_mid',
|
|
131
|
+
NOTIFY_STEP_MAX: 'notify_step_max',
|
|
132
|
+
UI_SHOWN: 'ui_shown',
|
|
133
|
+
UI_STARTING: 'ui_starting',
|
|
134
|
+
UI_STARTED: 'ui_started',
|
|
135
|
+
UI_NOT_PAIRED: 'ui_not_paired',
|
|
136
|
+
UI_START_FAILED: 'ui_start_failed',
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
/** Động từ cho bước không có mục đích (bước chỉ đọc — Planner không ghi `purpose`). Khoá = tên công cụ hoặc tiền tố kết thúc bằng '.'. */
|
|
140
|
+
export const MascotVerb = Object.freeze({
|
|
141
|
+
READ: 'read', LIST: 'list', FIND: 'find', WRITE: 'write', MOVE: 'move', COPY: 'copy', DELETE: 'delete', UNDO: 'undo', MEASURE: 'measure',
|
|
142
|
+
TRANSFER: 'transfer', EXEC: 'exec', PROC: 'proc', GIT: 'git', SYSTEM: 'system', SCHEDULE: 'schedule', GUI: 'gui', EXCEL: 'excel',
|
|
143
|
+
WORD: 'word', OUTLOOK: 'outlook', BROWSER: 'browser', MEMORY: 'memory', WATCH: 'watch', OTHER: 'other',
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const STRINGS = {
|
|
147
|
+
vi: {
|
|
148
|
+
[MascotText.WINDOW_TITLE]: 'Aivin trên máy này',
|
|
149
|
+
[MascotText.TOOLTIP]: 'Aivin — bấm để hỏi, kéo để di chuyển, thả tệp vào để hỏi về tệp',
|
|
150
|
+
[MascotText.PANEL_TITLE]: 'Aivin trên máy này',
|
|
151
|
+
[MascotText.NOW_LABEL]: 'ĐANG LÀM',
|
|
152
|
+
[MascotText.LOG_LABEL]: 'NHẬT KÝ',
|
|
153
|
+
[MascotText.NOTHING_YET]: 'Chưa có việc nào.',
|
|
154
|
+
[MascotText.PAUSE]: 'Tạm dừng AI',
|
|
155
|
+
[MascotText.RESUME]: 'Cho AI làm tiếp',
|
|
156
|
+
[MascotText.HIDE]: 'Ẩn tới khi có việc',
|
|
157
|
+
[MascotText.TURN_OFF]: 'Tắt linh vật',
|
|
158
|
+
[MascotText.CLOSE]: 'Thu gọn',
|
|
159
|
+
[MascotText.STATE_IDLE]: 'Đang chờ việc',
|
|
160
|
+
[MascotText.STATE_WORKING]: 'Đang làm',
|
|
161
|
+
[MascotText.STATE_THINKING]: 'Đang nghĩ',
|
|
162
|
+
[MascotText.STATE_WAITING]: 'Chờ bạn',
|
|
163
|
+
[MascotText.STATE_PAUSED]: 'Tạm dừng',
|
|
164
|
+
[MascotText.STATE_OFFLINE]: 'Mất kết nối',
|
|
165
|
+
[MascotText.STATE_DONE]: 'Xong',
|
|
166
|
+
[MascotText.STATE_ERROR]: 'Có lỗi',
|
|
167
|
+
[MascotText.READY]: 'Sẵn sàng nhận việc',
|
|
168
|
+
[MascotText.CONNECTED]: 'Đã kết nối máy chủ Aivin',
|
|
169
|
+
[MascotText.DISCONNECTED]: 'Mất kết nối, đang nối lại…',
|
|
170
|
+
[MascotText.PAUSED]: 'Đã tạm dừng AI',
|
|
171
|
+
[MascotText.RESUMED]: 'AI làm tiếp',
|
|
172
|
+
[MascotText.CAST_VIEWING]: 'Bạn đang xem và điều khiển máy này từ web',
|
|
173
|
+
[MascotText.CAST_ENDED]: 'Đã ngừng xem màn hình từ web',
|
|
174
|
+
[MascotText.THINKING]: 'Đang nghĩ…',
|
|
175
|
+
[MascotText.DONE_ONE]: 'Xong',
|
|
176
|
+
[MascotText.DONE_MANY]: 'Xong {count} bước',
|
|
177
|
+
[MascotText.FAILED]: 'Lỗi: {title}',
|
|
178
|
+
[MascotText.WAITING_CONFIRM]: 'Cần bạn duyệt: {title}',
|
|
179
|
+
[MascotText.CONFIRM_ALLOWED]: 'Bạn đã cho phép',
|
|
180
|
+
[MascotText.CONFIRM_REJECTED]: 'Không được cho phép',
|
|
181
|
+
[MascotText.TURNED_OFF]: 'Đã tắt linh vật — bật lại: aivin remote mascot on',
|
|
182
|
+
[MascotText.MS]: '{n} ms',
|
|
183
|
+
[MascotText.SECONDS]: '{n} s',
|
|
184
|
+
[MascotText.CMD_ON]: 'Đã bật linh vật — hiện khi chạy `aivin remote start` (cửa sổ đang chạy: chạy lại).',
|
|
185
|
+
[MascotText.CMD_OFF]: 'Đã tắt linh vật — áp dụng từ lần chạy `aivin remote start` kế tiếp.',
|
|
186
|
+
[MascotText.CMD_STATUS_ON]: 'Linh vật: bật',
|
|
187
|
+
[MascotText.CMD_STATUS_OFF]: 'Linh vật: tắt (bật: aivin remote mascot on)',
|
|
188
|
+
[MascotText.CMD_UNSUPPORTED]: 'Linh vật hiện mới có trên Windows.',
|
|
189
|
+
[MascotText.CMD_USAGE]: 'Dùng: aivin remote mascot [on | off]',
|
|
190
|
+
[MascotText.ASK_HINT]: "Hỏi hoặc nhờ Aivin…",
|
|
191
|
+
[MascotText.ASK_LOG]: "Nhật ký",
|
|
192
|
+
[MascotText.ASK_SEND]: "Gửi (Enter)",
|
|
193
|
+
[MascotText.ASK_MIC]: "Nói chuyện với Aivin — bấm để bắt đầu, bấm lần nữa để kết thúc",
|
|
194
|
+
[MascotText.ASK_THINKING]: "Đang xử lý…",
|
|
195
|
+
[MascotText.ASK_NO_MIC]: "Không mở được micro",
|
|
196
|
+
[MascotText.VOICE_CONNECTING]: "Đang kết nối…",
|
|
197
|
+
[MascotText.VOICE_LISTENING]: "Đang nghe…",
|
|
198
|
+
[MascotText.VOICE_THINKING]: "Đang nghĩ…",
|
|
199
|
+
[MascotText.VOICE_SPEAKING]: "Aivin đang nói…",
|
|
200
|
+
[MascotText.VOICE_ENDED]: "Đã kết thúc cuộc nói chuyện",
|
|
201
|
+
[MascotText.VOICE_TIMED_OUT]: "Đã tự kết thúc vì im lặng lâu",
|
|
202
|
+
[MascotText.VOICE_RECORDING]: "Đang ghi âm…",
|
|
203
|
+
[MascotText.VOICE_IDLE_ENDED]: "Đã kết thúc vì im lặng 1 phút",
|
|
204
|
+
[MascotText.VOICE_MIC_BUSY]: "Đang ghi biên bản họp — dừng ghi rồi hãy nói chuyện",
|
|
205
|
+
[MascotText.VOICE_HINT_END]: "Bấm mic để kết thúc",
|
|
206
|
+
[MascotText.VOICE_HINT_INTERRUPT]: "Bấm mic để ngắt lời",
|
|
207
|
+
[MascotText.VOICE_HINT_SEND]: "Nói xong bấm mic để gửi",
|
|
208
|
+
[MascotText.ASK_TRANSCRIBING]: "Đang chuyển giọng nói thành chữ…",
|
|
209
|
+
[MascotText.ASK_TOO_SHORT]: "Đoạn nói quá ngắn — nói lâu hơn một chút",
|
|
210
|
+
[MascotText.ASK_OFFLINE]: "Chưa nối được Aivin, thử lại sau",
|
|
211
|
+
[MascotText.ASK_ERR_BUSY]: "Đang làm việc trước, chờ chút",
|
|
212
|
+
[MascotText.ASK_PARALLEL_SENT]: "Đã giao chạy song song — xong mình báo ngay",
|
|
213
|
+
[MascotText.ASK_BUSY_VOICE]: "Đang nói chuyện — kết thúc rồi hãy trả lời",
|
|
214
|
+
[MascotText.ASK_QUEUED]: "(còn {n} câu hỏi nữa)",
|
|
215
|
+
[MascotText.ASK_ERR_TOO_LONG]: "Dài quá, rút gọn nhé",
|
|
216
|
+
[MascotText.ASK_ERR_NOT_UNDERSTOOD]: "Không nghe rõ, nói lại nhé",
|
|
217
|
+
[MascotText.ASK_ERR_DISABLED]: "Chat từ máy đang tạm tắt trên Aivin",
|
|
218
|
+
[MascotText.ASK_ERR_FAILED]: "Chưa gửi được, thử lại sau",
|
|
219
|
+
[MascotText.ASK_ERR_UNSUPPORTED]: "Cần bản Aivin mới hơn",
|
|
220
|
+
[MascotText.ASK_ERR_NO_QUESTION]: "Câu hỏi đã hết hạn hoặc đã được trả lời",
|
|
221
|
+
[MascotText.ASK_ERR_INVALID_ANSWER]: "Chọn một nút hoặc trả lời đúng câu hỏi",
|
|
222
|
+
[MascotText.ASK_ATTACHED]: "Gõ việc cần làm với tệp…",
|
|
223
|
+
[MascotText.ASK_DETACH]: "Bỏ tệp này",
|
|
224
|
+
[MascotText.ASK_FILES_LABEL]: "Tệp trên máy này:",
|
|
225
|
+
[MascotText.ASK_FILES_DEFAULT]: "Xem giúp tôi các tệp này",
|
|
226
|
+
[MascotText.DROP_ONE]: "Thả vào để hỏi về {name}",
|
|
227
|
+
[MascotText.DROP_MANY]: "Thả {n} mục vào để hỏi",
|
|
228
|
+
[MascotText.DROP_FULL]: "Thùng đầy rồi — gửi {n} tệp này trước nhé",
|
|
229
|
+
[MascotText.AWAY_SUMMARY]: "Lúc bạn vắng: {parts}",
|
|
230
|
+
[MascotText.AWAY_DONE]: "{n} việc xong",
|
|
231
|
+
[MascotText.AWAY_FAILED]: "{n} lỗi",
|
|
232
|
+
[MascotText.AWAY_NEEDS]: "{n} cần bạn",
|
|
233
|
+
[MascotText.ASK_MORE]: "(chi tiết trên Aivin)",
|
|
234
|
+
[MascotText.ASK_OPEN_WEB]: "Xem đầy đủ trên Aivin",
|
|
235
|
+
[MascotText.ASK_OPEN_IMAGE]: "Mở ảnh",
|
|
236
|
+
[MascotText.ASK_OPEN_DIAGRAM]: "Xem sơ đồ trên Aivin",
|
|
237
|
+
[MascotText.ASK_WEBVIEW_TITLE]: "Công cụ tương tác",
|
|
238
|
+
[MascotText.ASK_WEBVIEW_OPEN]: "Mở công cụ",
|
|
239
|
+
[MascotText.ASK_WEBVIEW_FAILED]: "Không mở được công cụ, thử mở phiên trên Aivin.",
|
|
240
|
+
[MascotText.ASK_SCREENCAST_TITLE]: "Phiên trình duyệt AI",
|
|
241
|
+
[MascotText.ASK_SCREENCAST_HINT]: "Xem trực tiếp trên Aivin",
|
|
242
|
+
[MascotText.ASK_SOURCES]: "Nguồn:",
|
|
243
|
+
[MascotText.ASK_MORE_POINTS]: "còn {n} điểm dữ liệu",
|
|
244
|
+
[MascotText.FORM_YES]: "Có",
|
|
245
|
+
[MascotText.FORM_NO]: "Không",
|
|
246
|
+
[MascotText.FORM_KEEP]: "Giữ: {value}",
|
|
247
|
+
[MascotText.ASK_RESULT]: "Kết quả đây:",
|
|
248
|
+
[MascotText.ASK_MORE_ROWS]: "còn {n} hàng",
|
|
249
|
+
[MascotText.ASK_MORE_COLS]: "còn {n} cột",
|
|
250
|
+
[MascotText.ASK_MORE_CARDS]: "còn {n} thẻ",
|
|
251
|
+
[MascotText.ASK_NO_REPLY]: "Chưa nghe Aivin trả lời — có kết quả sẽ hiện ở đây, hoặc xem trên Aivin",
|
|
252
|
+
[MascotText.ASK_STOP]: "Dừng việc này",
|
|
253
|
+
[MascotText.NEW_CHAT]: "Phiên mới",
|
|
254
|
+
[MascotText.NEW_CHAT_TIP]: "Bắt đầu phiên chat mới với Aivin (phiên cũ vẫn xem được trên Aivin)",
|
|
255
|
+
[MascotText.ASK_NEW_CHAT_DONE]: "Đã mở phiên chat mới",
|
|
256
|
+
[MascotText.ASK_CANCELLED]: "Đã dừng",
|
|
257
|
+
[MascotText.ASK_ANSWERED_ELSEWHERE]: "Câu hỏi này đã được trả lời ở nơi khác",
|
|
258
|
+
[MascotText.FORM_FIELD]: "{label} ({n}/{total})",
|
|
259
|
+
[MascotText.FORM_OPTIONAL]: "(không bắt buộc)",
|
|
260
|
+
[MascotText.FORM_SKIP]: "Bỏ qua",
|
|
261
|
+
[MascotText.ASK_CONFIRM]: "Xác nhận ({n})",
|
|
262
|
+
[MascotText.NOTIFY_DONE]: "Xong",
|
|
263
|
+
[MascotText.NOTIFY_FAILED]: "Lỗi",
|
|
264
|
+
[MascotText.NOTIFY_NEEDS_YOU]: "Cần bạn",
|
|
265
|
+
[MascotText.NOTIFY_FREQ_LABEL]: "TẦN SUẤT THÔNG BÁO",
|
|
266
|
+
[MascotText.NOTIFY_FREQ_MIN]: "Phiên này & cần xử lý",
|
|
267
|
+
[MascotText.NOTIFY_FREQ_MID]: "Việc trên máy & cần xử lý",
|
|
268
|
+
[MascotText.NOTIFY_FREQ_MAX]: "Tất cả thông báo hệ thống",
|
|
269
|
+
[MascotText.NOTIFY_STEP_MIN]: "Ít",
|
|
270
|
+
[MascotText.NOTIFY_STEP_MID]: "Vừa",
|
|
271
|
+
[MascotText.NOTIFY_STEP_MAX]: "Tất cả",
|
|
272
|
+
[MascotText.UI_SHOWN]: "Linh vật Aivin đã hiện trên màn hình — gõ hoặc bấm mic để hỏi.",
|
|
273
|
+
[MascotText.UI_STARTING]: "Đang bật Aivin trên máy này…",
|
|
274
|
+
[MascotText.UI_STARTED]: "Đã bật Aivin chạy nền — linh vật hiện trong giây lát.",
|
|
275
|
+
[MascotText.UI_NOT_PAIRED]: "Máy này chưa kết nối Aivin. Lấy mã trong Aivin (ô chat → Trình duyệt → Thêm máy tính này) rồi chạy: aivin remote start --code <mã>",
|
|
276
|
+
[MascotText.UI_START_FAILED]: "Chưa bật được Aivin chạy nền — chạy: aivin remote start",
|
|
277
|
+
},
|
|
278
|
+
en: {
|
|
279
|
+
[MascotText.WINDOW_TITLE]: 'Aivin on this computer',
|
|
280
|
+
[MascotText.TOOLTIP]: 'Aivin — click to ask, drag to move, drop files to ask about them',
|
|
281
|
+
[MascotText.PANEL_TITLE]: 'Aivin on this computer',
|
|
282
|
+
[MascotText.NOW_LABEL]: 'NOW',
|
|
283
|
+
[MascotText.LOG_LABEL]: 'ACTIVITY',
|
|
284
|
+
[MascotText.NOTHING_YET]: 'Nothing yet.',
|
|
285
|
+
[MascotText.PAUSE]: 'Pause AI',
|
|
286
|
+
[MascotText.RESUME]: 'Let AI continue',
|
|
287
|
+
[MascotText.HIDE]: 'Hide until work',
|
|
288
|
+
[MascotText.TURN_OFF]: 'Turn mascot off',
|
|
289
|
+
[MascotText.CLOSE]: 'Collapse',
|
|
290
|
+
[MascotText.STATE_IDLE]: 'Waiting for work',
|
|
291
|
+
[MascotText.STATE_WORKING]: 'Working',
|
|
292
|
+
[MascotText.STATE_THINKING]: 'Thinking',
|
|
293
|
+
[MascotText.STATE_WAITING]: 'Needs you',
|
|
294
|
+
[MascotText.STATE_PAUSED]: 'Paused',
|
|
295
|
+
[MascotText.STATE_OFFLINE]: 'Offline',
|
|
296
|
+
[MascotText.STATE_DONE]: 'Done',
|
|
297
|
+
[MascotText.STATE_ERROR]: 'Problem',
|
|
298
|
+
[MascotText.READY]: 'Ready for work',
|
|
299
|
+
[MascotText.CONNECTED]: 'Connected to Aivin',
|
|
300
|
+
[MascotText.DISCONNECTED]: 'Connection lost — reconnecting…',
|
|
301
|
+
[MascotText.PAUSED]: 'AI paused',
|
|
302
|
+
[MascotText.RESUMED]: 'AI resumed',
|
|
303
|
+
[MascotText.CAST_VIEWING]: 'You are viewing and controlling this computer from the web',
|
|
304
|
+
[MascotText.CAST_ENDED]: 'Stopped viewing this screen from the web',
|
|
305
|
+
[MascotText.THINKING]: 'Thinking…',
|
|
306
|
+
[MascotText.DONE_ONE]: 'Done',
|
|
307
|
+
[MascotText.DONE_MANY]: 'Done — {count} steps',
|
|
308
|
+
[MascotText.FAILED]: 'Failed: {title}',
|
|
309
|
+
[MascotText.WAITING_CONFIRM]: 'Needs your OK: {title}',
|
|
310
|
+
[MascotText.CONFIRM_ALLOWED]: 'You allowed it',
|
|
311
|
+
[MascotText.CONFIRM_REJECTED]: 'Not allowed',
|
|
312
|
+
[MascotText.TURNED_OFF]: 'Mascot turned off — turn it back on: aivin remote mascot on',
|
|
313
|
+
[MascotText.MS]: '{n} ms',
|
|
314
|
+
[MascotText.SECONDS]: '{n} s',
|
|
315
|
+
[MascotText.CMD_ON]: 'Mascot on — it shows while `aivin remote start` runs (a window already running: restart it).',
|
|
316
|
+
[MascotText.CMD_OFF]: 'Mascot off — from the next `aivin remote start`.',
|
|
317
|
+
[MascotText.CMD_STATUS_ON]: 'Mascot: on',
|
|
318
|
+
[MascotText.CMD_STATUS_OFF]: 'Mascot: off (turn on: aivin remote mascot on)',
|
|
319
|
+
[MascotText.CMD_UNSUPPORTED]: 'The mascot is only available on Windows for now.',
|
|
320
|
+
[MascotText.CMD_USAGE]: 'Usage: aivin remote mascot [on | off]',
|
|
321
|
+
[MascotText.ASK_HINT]: "Ask Aivin anything…",
|
|
322
|
+
[MascotText.ASK_LOG]: "Activity",
|
|
323
|
+
[MascotText.ASK_SEND]: "Send (Enter)",
|
|
324
|
+
[MascotText.ASK_MIC]: "Talk with Aivin — click to start, click again to end",
|
|
325
|
+
[MascotText.ASK_THINKING]: "Working on it…",
|
|
326
|
+
[MascotText.ASK_NO_MIC]: "Could not open the microphone",
|
|
327
|
+
[MascotText.VOICE_CONNECTING]: "Connecting…",
|
|
328
|
+
[MascotText.VOICE_LISTENING]: "Listening…",
|
|
329
|
+
[MascotText.VOICE_THINKING]: "Thinking…",
|
|
330
|
+
[MascotText.VOICE_SPEAKING]: "Aivin is talking…",
|
|
331
|
+
[MascotText.VOICE_ENDED]: "Conversation ended",
|
|
332
|
+
[MascotText.VOICE_TIMED_OUT]: "Ended after a long silence",
|
|
333
|
+
[MascotText.VOICE_RECORDING]: "Recording…",
|
|
334
|
+
[MascotText.VOICE_IDLE_ENDED]: "Ended after a minute of silence",
|
|
335
|
+
[MascotText.VOICE_MIC_BUSY]: "Recording a meeting — stop it first to talk",
|
|
336
|
+
[MascotText.VOICE_HINT_END]: "Click the mic to end",
|
|
337
|
+
[MascotText.VOICE_HINT_INTERRUPT]: "Click the mic to interrupt",
|
|
338
|
+
[MascotText.VOICE_HINT_SEND]: "Click the mic to send when done",
|
|
339
|
+
[MascotText.ASK_TRANSCRIBING]: "Turning your voice into text…",
|
|
340
|
+
[MascotText.ASK_TOO_SHORT]: "That was too short — talk a bit longer",
|
|
341
|
+
[MascotText.ASK_OFFLINE]: "Not connected to Aivin, try again soon",
|
|
342
|
+
[MascotText.ASK_ERR_BUSY]: "Still on the last one, hold on",
|
|
343
|
+
[MascotText.ASK_PARALLEL_SENT]: "Started alongside the current one — I'll tell you when it's done",
|
|
344
|
+
[MascotText.ASK_BUSY_VOICE]: "In a call — end it to answer",
|
|
345
|
+
[MascotText.ASK_QUEUED]: "({n} more waiting)",
|
|
346
|
+
[MascotText.ASK_ERR_TOO_LONG]: "Too long, please shorten it",
|
|
347
|
+
[MascotText.ASK_ERR_NOT_UNDERSTOOD]: "Could not make that out, try again",
|
|
348
|
+
[MascotText.ASK_ERR_DISABLED]: "Chatting from the computer is turned off on Aivin",
|
|
349
|
+
[MascotText.ASK_ERR_FAILED]: "Could not send, try again",
|
|
350
|
+
[MascotText.ASK_ERR_UNSUPPORTED]: "Needs a newer Aivin server",
|
|
351
|
+
[MascotText.ASK_ERR_NO_QUESTION]: "That question expired or was already answered",
|
|
352
|
+
[MascotText.ASK_ERR_INVALID_ANSWER]: "Pick a button or answer the question",
|
|
353
|
+
[MascotText.ASK_ATTACHED]: "Type what to do with the files…",
|
|
354
|
+
[MascotText.ASK_DETACH]: "Remove this file",
|
|
355
|
+
[MascotText.ASK_FILES_LABEL]: "Files on this computer:",
|
|
356
|
+
[MascotText.ASK_FILES_DEFAULT]: "Take a look at these files",
|
|
357
|
+
[MascotText.DROP_ONE]: "Drop to ask about {name}",
|
|
358
|
+
[MascotText.DROP_MANY]: "Drop {n} items to ask about them",
|
|
359
|
+
[MascotText.DROP_FULL]: "The box is full — send these {n} files first",
|
|
360
|
+
[MascotText.AWAY_SUMMARY]: "While you were away: {parts}",
|
|
361
|
+
[MascotText.AWAY_DONE]: "{n} done",
|
|
362
|
+
[MascotText.AWAY_FAILED]: "{n} failed",
|
|
363
|
+
[MascotText.AWAY_NEEDS]: "{n} need you",
|
|
364
|
+
[MascotText.ASK_MORE]: "(details in Aivin)",
|
|
365
|
+
[MascotText.ASK_OPEN_WEB]: "View in Aivin",
|
|
366
|
+
[MascotText.ASK_OPEN_IMAGE]: "Open image",
|
|
367
|
+
[MascotText.ASK_OPEN_DIAGRAM]: "View diagram in Aivin",
|
|
368
|
+
[MascotText.ASK_WEBVIEW_TITLE]: "Interactive tool",
|
|
369
|
+
[MascotText.ASK_WEBVIEW_OPEN]: "Open tool",
|
|
370
|
+
[MascotText.ASK_WEBVIEW_FAILED]: "Could not open the tool, try the session in Aivin.",
|
|
371
|
+
[MascotText.ASK_SCREENCAST_TITLE]: "AI browser session",
|
|
372
|
+
[MascotText.ASK_SCREENCAST_HINT]: "Watch live in Aivin",
|
|
373
|
+
[MascotText.ASK_SOURCES]: "Sources:",
|
|
374
|
+
[MascotText.ASK_MORE_POINTS]: "{n} more data points",
|
|
375
|
+
[MascotText.FORM_YES]: "Yes",
|
|
376
|
+
[MascotText.FORM_NO]: "No",
|
|
377
|
+
[MascotText.FORM_KEEP]: "Keep: {value}",
|
|
378
|
+
[MascotText.ASK_RESULT]: "Here you go:",
|
|
379
|
+
[MascotText.ASK_MORE_ROWS]: "{n} more rows",
|
|
380
|
+
[MascotText.ASK_MORE_COLS]: "{n} more columns",
|
|
381
|
+
[MascotText.ASK_MORE_CARDS]: "{n} more cards",
|
|
382
|
+
[MascotText.ASK_NO_REPLY]: "No reply from Aivin yet — the result will show up here, or check Aivin",
|
|
383
|
+
[MascotText.ASK_STOP]: "Stop this",
|
|
384
|
+
[MascotText.NEW_CHAT]: "New Session",
|
|
385
|
+
[MascotText.NEW_CHAT_TIP]: "Start a new chat with Aivin (the old one stays in Aivin)",
|
|
386
|
+
[MascotText.ASK_NEW_CHAT_DONE]: "Started a new chat",
|
|
387
|
+
[MascotText.ASK_CANCELLED]: "Stopped",
|
|
388
|
+
[MascotText.ASK_ANSWERED_ELSEWHERE]: "This question was already answered elsewhere",
|
|
389
|
+
[MascotText.FORM_FIELD]: "{label} ({n}/{total})",
|
|
390
|
+
[MascotText.FORM_OPTIONAL]: "(optional)",
|
|
391
|
+
[MascotText.FORM_SKIP]: "Skip",
|
|
392
|
+
[MascotText.ASK_CONFIRM]: "Confirm ({n})",
|
|
393
|
+
[MascotText.NOTIFY_DONE]: "Done",
|
|
394
|
+
[MascotText.NOTIFY_FAILED]: "Failed",
|
|
395
|
+
[MascotText.NOTIFY_NEEDS_YOU]: "Needs you",
|
|
396
|
+
[MascotText.NOTIFY_FREQ_LABEL]: "NOTIFICATION FREQUENCY",
|
|
397
|
+
[MascotText.NOTIFY_FREQ_MIN]: "This session & required actions",
|
|
398
|
+
[MascotText.NOTIFY_FREQ_MID]: "Device tasks & required actions",
|
|
399
|
+
[MascotText.NOTIFY_FREQ_MAX]: "All system notifications",
|
|
400
|
+
[MascotText.NOTIFY_STEP_MIN]: "Few",
|
|
401
|
+
[MascotText.NOTIFY_STEP_MID]: "Some",
|
|
402
|
+
[MascotText.NOTIFY_STEP_MAX]: "All",
|
|
403
|
+
[MascotText.UI_SHOWN]: "The Aivin mascot is on screen — type or click the mic to ask.",
|
|
404
|
+
[MascotText.UI_STARTING]: "Starting Aivin on this computer…",
|
|
405
|
+
[MascotText.UI_STARTED]: "Aivin is running in the background — the mascot shows up in a moment.",
|
|
406
|
+
[MascotText.UI_NOT_PAIRED]: "This computer is not connected to Aivin yet. Get a code in Aivin (chat box → Browser → Add this computer), then run: aivin remote start --code <code>",
|
|
407
|
+
[MascotText.UI_START_FAILED]: "Could not start Aivin in the background — run: aivin remote start",
|
|
408
|
+
},
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
const VERBS = {
|
|
412
|
+
vi: {
|
|
413
|
+
[MascotVerb.READ]: 'Đọc', [MascotVerb.LIST]: 'Xem thư mục', [MascotVerb.FIND]: 'Tìm', [MascotVerb.WRITE]: 'Ghi', [MascotVerb.MOVE]: 'Chuyển',
|
|
414
|
+
[MascotVerb.COPY]: 'Chép', [MascotVerb.DELETE]: 'Xoá', [MascotVerb.UNDO]: 'Hoàn tác', [MascotVerb.MEASURE]: 'Đo dung lượng',
|
|
415
|
+
[MascotVerb.TRANSFER]: 'Chuyển tệp với Aivin', [MascotVerb.EXEC]: 'Chạy lệnh', [MascotVerb.PROC]: 'Theo dõi chương trình chạy nền',
|
|
416
|
+
[MascotVerb.GIT]: 'Git', [MascotVerb.SYSTEM]: 'Xem thông tin máy', [MascotVerb.SCHEDULE]: 'Đặt lịch chạy', [MascotVerb.GUI]: 'Thao tác cửa sổ',
|
|
417
|
+
[MascotVerb.EXCEL]: 'Làm trên Excel', [MascotVerb.WORD]: 'Làm trên Word', [MascotVerb.OUTLOOK]: 'Làm trên Outlook',
|
|
418
|
+
[MascotVerb.BROWSER]: 'Dùng trình duyệt', [MascotVerb.MEMORY]: 'Ghi nhớ', [MascotVerb.WATCH]: 'Theo dõi', [MascotVerb.OTHER]: 'Làm',
|
|
419
|
+
},
|
|
420
|
+
en: {
|
|
421
|
+
[MascotVerb.READ]: 'Read', [MascotVerb.LIST]: 'Look in folder', [MascotVerb.FIND]: 'Find', [MascotVerb.WRITE]: 'Write', [MascotVerb.MOVE]: 'Move',
|
|
422
|
+
[MascotVerb.COPY]: 'Copy', [MascotVerb.DELETE]: 'Delete', [MascotVerb.UNDO]: 'Undo', [MascotVerb.MEASURE]: 'Measure',
|
|
423
|
+
[MascotVerb.TRANSFER]: 'Transfer file with Aivin', [MascotVerb.EXEC]: 'Run command', [MascotVerb.PROC]: 'Watch background program',
|
|
424
|
+
[MascotVerb.GIT]: 'Git', [MascotVerb.SYSTEM]: 'Check this computer', [MascotVerb.SCHEDULE]: 'Schedule a job', [MascotVerb.GUI]: 'Use an app window',
|
|
425
|
+
[MascotVerb.EXCEL]: 'Work in Excel', [MascotVerb.WORD]: 'Work in Word', [MascotVerb.OUTLOOK]: 'Work in Outlook',
|
|
426
|
+
[MascotVerb.BROWSER]: 'Use the browser', [MascotVerb.MEMORY]: 'Remember', [MascotVerb.WATCH]: 'Watch', [MascotVerb.OTHER]: 'Work',
|
|
427
|
+
},
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export const SUPPORTED_LANGS = Object.keys(STRINGS);
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Ngôn ngữ của máy: AIVIN_LANG → LANG / LC_ALL (trừ Windows: ở đó chỉ shell kiểu Unix như Git Bash đặt, không phải người dùng chọn) →
|
|
434
|
+
* ngôn ngữ hệ điều hành (Intl); không có bản dịch → en.
|
|
435
|
+
*/
|
|
436
|
+
export function mascotLang(env = process.env, platform = process.platform, preferredLang = null) {
|
|
437
|
+
const candidates = [env.AIVIN_LANG, preferredLang, ...(platform === 'win32' ? [] : [env.LC_ALL, env.LANG])];
|
|
438
|
+
try { candidates.push(Intl.DateTimeFormat().resolvedOptions().locale); } catch { /* không có Intl */ }
|
|
439
|
+
for (const c of candidates) {
|
|
440
|
+
const code = String(c || '').toLowerCase().split(/[-_.]/)[0];
|
|
441
|
+
if (STRINGS[code]) return code;
|
|
442
|
+
}
|
|
443
|
+
return 'en';
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
const fill = (text, vars = {}) => String(text).replace(/\{(\w+)\}/g, (_, k) => (vars[k] ?? `{${k}}`));
|
|
447
|
+
|
|
448
|
+
export function mascotText(lang, key, vars) {
|
|
449
|
+
return fill((STRINGS[lang] || STRINGS.en)[key] ?? STRINGS.en[key] ?? key, vars);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export function mascotVerb(lang, verb) {
|
|
453
|
+
return (VERBS[lang] || VERBS.en)[verb] ?? VERBS.en[MascotVerb.OTHER];
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/** Toàn bộ chữ tĩnh của cửa sổ (gửi cho tiến trình hiển thị một lần lúc mở). */
|
|
457
|
+
export function windowStrings(lang) {
|
|
458
|
+
return Object.fromEntries(Object.values(MascotText).map((k) => [k, mascotText(lang, k)]));
|
|
459
|
+
}
|