zames_pro 2.88.2 → 2.90.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +32 -585
  3. package/dist/agent-loop.js +47 -4
  4. package/dist/ask-retry.js +49 -0
  5. package/dist/ask-state.js +80 -0
  6. package/dist/browser-base.js +69 -0
  7. package/dist/browser.js +170 -41
  8. package/dist/command-registry.js +58 -0
  9. package/dist/commands.js +25 -2
  10. package/dist/completion-check.js +77 -0
  11. package/dist/config-commands.js +12 -4
  12. package/dist/config-menu.js +179 -81
  13. package/dist/config-schema.js +562 -0
  14. package/dist/config.js +19 -405
  15. package/dist/dev-commands.js +27 -0
  16. package/dist/dev-watch.js +96 -0
  17. package/dist/first-run.js +80 -0
  18. package/dist/glm-browser.js +133 -32
  19. package/dist/i18n/common.js +6 -3
  20. package/dist/i18n/config.js +78 -3
  21. package/dist/i18n/deepseek.js +1 -0
  22. package/dist/i18n/wizard.js +25 -0
  23. package/dist/i18n.js +6 -1
  24. package/dist/index.js +1299 -924
  25. package/dist/info-commands.js +61 -0
  26. package/dist/input/layout.js +38 -1
  27. package/dist/input.js +2 -2
  28. package/dist/password-store.js +48 -0
  29. package/dist/prompt-budget.js +23 -0
  30. package/dist/provider-errors.js +53 -0
  31. package/dist/provider-fallback.js +46 -0
  32. package/dist/qwen-browser.js +155 -39
  33. package/dist/run-task.js +2 -1
  34. package/dist/scheduler-commands.js +41 -0
  35. package/dist/send-slot.js +36 -0
  36. package/dist/session-commands.js +42 -0
  37. package/dist/spinner.js +3 -3
  38. package/dist/swallow.js +45 -0
  39. package/dist/system-prompt.js +2 -2
  40. package/dist/tree-commands.js +36 -0
  41. package/dist/tui/ConfigMenu.js +149 -64
  42. package/dist/tui/FullScreenApp.js +13 -4
  43. package/dist/tui/InputLine.js +20 -3
  44. package/dist/tui/LogView.js +11 -5
  45. package/dist/tui/StatusBar.js +4 -1
  46. package/dist/tui/TuiApp.js +11 -2
  47. package/dist/tui/layout.js +14 -1
  48. package/dist/tui/store.js +2 -1
  49. package/dist/tui/ui-colors.js +2 -0
  50. package/dist/width.js +10 -5
  51. package/llms-full.txt +16 -292
  52. package/package.json +2 -2
@@ -0,0 +1,562 @@
1
+ // The /config SCHEMA: the settings an operator may change from the menu and
2
+ // from the /config text subcommands. It is DATA ONLY (no disk, no terminal), so
3
+ // the menu, the list renderer and the set/get validation all share it.
4
+ //
5
+ // TWO LEVELS of grouping. `topKey` is the first menu level (Agent, Browser &
6
+ // chat, Providers, Interface, ...) and `groupKey` is the section INSIDE it. The
7
+ // flat 40-entry list this replaced was unusable: every timing knob of every
8
+ // backend sat in one scroll.
9
+ //
10
+ // To add a setting — add it here and to DEFAULTS/types.ts.
11
+ import { themeNames } from './theme.js';
12
+ import { PROVIDER_IDS } from './providers.js';
13
+ /** Top-level menu groups, in menu order. */
14
+ export const CONFIG_TOP_GROUPS = [
15
+ 'cfg.top.agent',
16
+ 'cfg.top.browser',
17
+ 'cfg.top.providers',
18
+ 'cfg.top.ui',
19
+ 'cfg.top.files',
20
+ 'cfg.top.diagnostics',
21
+ ];
22
+ export const CONFIG_SCHEMA = [
23
+ // ---------- Agent ----------
24
+ {
25
+ path: 'provider',
26
+ type: 'enum',
27
+ values: [...PROVIDER_IDS],
28
+ labelKey: 'cfg.f.provider',
29
+ topKey: 'cfg.top.agent',
30
+ groupKey: 'cfg.group.agent',
31
+ },
32
+ {
33
+ path: 'maxIterations',
34
+ type: 'number',
35
+ min: 0,
36
+ max: 100000,
37
+ labelKey: 'cfg.f.maxIterations',
38
+ topKey: 'cfg.top.agent',
39
+ groupKey: 'cfg.group.agent',
40
+ },
41
+ {
42
+ path: 'headless',
43
+ type: 'boolean',
44
+ labelKey: 'cfg.f.headless',
45
+ topKey: 'cfg.top.agent',
46
+ groupKey: 'cfg.group.agent',
47
+ },
48
+ {
49
+ path: 'debug',
50
+ type: 'boolean',
51
+ labelKey: 'cfg.f.debug',
52
+ topKey: 'cfg.top.agent',
53
+ groupKey: 'cfg.group.agent',
54
+ },
55
+ {
56
+ path: 'hotReload',
57
+ type: 'boolean',
58
+ labelKey: 'cfg.f.hotReload',
59
+ topKey: 'cfg.top.agent',
60
+ groupKey: 'cfg.group.agent',
61
+ },
62
+ {
63
+ path: 'browser.subagents',
64
+ type: 'boolean',
65
+ labelKey: 'cfg.f.browser_subagents',
66
+ topKey: 'cfg.top.agent',
67
+ groupKey: 'cfg.group.agent',
68
+ },
69
+ {
70
+ path: 'browser.maxSubagents',
71
+ type: 'number',
72
+ min: 0,
73
+ max: 20,
74
+ labelKey: 'cfg.f.browser_maxSubagents',
75
+ topKey: 'cfg.top.agent',
76
+ groupKey: 'cfg.group.agent',
77
+ },
78
+ // ---------- Browser & chat: session ----------
79
+ {
80
+ path: 'browser.answerTimeoutMs',
81
+ type: 'number',
82
+ min: 1000,
83
+ max: 3600000,
84
+ labelKey: 'cfg.f.browser_answerTimeoutMs',
85
+ topKey: 'cfg.top.browser',
86
+ groupKey: 'cfg.group.chat',
87
+ },
88
+ {
89
+ path: 'browser.askRetries',
90
+ type: 'number',
91
+ min: 1,
92
+ max: 100,
93
+ labelKey: 'cfg.f.browser_askRetries',
94
+ topKey: 'cfg.top.browser',
95
+ groupKey: 'cfg.group.chat',
96
+ },
97
+ {
98
+ path: 'browser.stabilityChecks',
99
+ type: 'number',
100
+ min: 1,
101
+ max: 100,
102
+ labelKey: 'cfg.f.browser_stabilityChecks',
103
+ topKey: 'cfg.top.browser',
104
+ groupKey: 'cfg.group.chat',
105
+ },
106
+ {
107
+ path: 'browser.stabilityDelayMs',
108
+ type: 'number',
109
+ min: 0,
110
+ max: 60000,
111
+ labelKey: 'cfg.f.browser_stabilityDelayMs',
112
+ topKey: 'cfg.top.browser',
113
+ groupKey: 'cfg.group.chat',
114
+ },
115
+ {
116
+ path: 'browser.askDeadlineMs',
117
+ type: 'number',
118
+ min: 30000,
119
+ max: 1800000,
120
+ labelKey: 'cfg.f.browser_askDeadlineMs',
121
+ topKey: 'cfg.top.browser',
122
+ groupKey: 'cfg.group.chat',
123
+ },
124
+ {
125
+ path: 'browser.maxAfterToolRetries',
126
+ type: 'number',
127
+ min: 0,
128
+ max: 50,
129
+ labelKey: 'cfg.f.browser_maxAfterToolRetries',
130
+ topKey: 'cfg.top.browser',
131
+ groupKey: 'cfg.group.chat',
132
+ },
133
+ {
134
+ path: 'browser.deepThinking',
135
+ type: 'boolean',
136
+ labelKey: 'cfg.f.browser_deepThinking',
137
+ topKey: 'cfg.top.browser',
138
+ groupKey: 'cfg.group.chat',
139
+ },
140
+ {
141
+ path: 'browser.webSearch',
142
+ type: 'boolean',
143
+ labelKey: 'cfg.f.browser_webSearch',
144
+ topKey: 'cfg.top.browser',
145
+ groupKey: 'cfg.group.chat',
146
+ },
147
+ {
148
+ path: 'browser.resendPromptOnResume',
149
+ type: 'boolean',
150
+ labelKey: 'cfg.f.browser_resendPromptOnResume',
151
+ topKey: 'cfg.top.browser',
152
+ groupKey: 'cfg.group.chat',
153
+ },
154
+ {
155
+ path: 'ui.contextLimit',
156
+ type: 'number',
157
+ min: 10_000,
158
+ max: 10_000_000,
159
+ labelKey: 'cfg.f.ui_contextLimit',
160
+ topKey: 'cfg.top.browser',
161
+ groupKey: 'cfg.group.chat',
162
+ },
163
+ // ---------- Browser & chat: throttling ----------
164
+ {
165
+ path: 'browser.minSendIntervalMs',
166
+ type: 'number',
167
+ min: 0,
168
+ max: 600000,
169
+ labelKey: 'cfg.f.browser_minSendIntervalMs',
170
+ topKey: 'cfg.top.browser',
171
+ groupKey: 'cfg.group.throttle',
172
+ },
173
+ {
174
+ path: 'browser.thinkingExtraMs',
175
+ type: 'number',
176
+ min: 0,
177
+ max: 600000,
178
+ labelKey: 'cfg.f.browser_thinkingExtraMs',
179
+ topKey: 'cfg.top.browser',
180
+ groupKey: 'cfg.group.throttle',
181
+ },
182
+ {
183
+ path: 'browser.rateLimitWaitMs',
184
+ type: 'number',
185
+ min: 0,
186
+ max: 3600000,
187
+ labelKey: 'cfg.f.browser_rateLimitWaitMs',
188
+ topKey: 'cfg.top.browser',
189
+ groupKey: 'cfg.group.throttle',
190
+ },
191
+ {
192
+ path: 'browser.maxRateLimitRetries',
193
+ type: 'number',
194
+ min: 0,
195
+ max: 100,
196
+ labelKey: 'cfg.f.browser_maxRateLimitRetries',
197
+ topKey: 'cfg.top.browser',
198
+ groupKey: 'cfg.group.throttle',
199
+ },
200
+ // ---------- Browser & chat: truncated turns ----------
201
+ {
202
+ path: 'browser.maxIncompleteRetries',
203
+ type: 'number',
204
+ min: 0,
205
+ max: 100,
206
+ labelKey: 'cfg.f.browser_maxIncompleteRetries',
207
+ topKey: 'cfg.top.browser',
208
+ groupKey: 'cfg.group.recovery',
209
+ },
210
+ {
211
+ path: 'browser.incompleteWaitMs',
212
+ type: 'number',
213
+ min: 0,
214
+ max: 600000,
215
+ labelKey: 'cfg.f.browser_incompleteWaitMs',
216
+ topKey: 'cfg.top.browser',
217
+ groupKey: 'cfg.group.recovery',
218
+ },
219
+ {
220
+ path: 'browser.autoContinue',
221
+ type: 'boolean',
222
+ labelKey: 'cfg.f.browser_autoContinue',
223
+ topKey: 'cfg.top.browser',
224
+ groupKey: 'cfg.group.recovery',
225
+ },
226
+ {
227
+ path: 'browser.continueMinGapMs',
228
+ type: 'number',
229
+ min: 0,
230
+ max: 600000,
231
+ labelKey: 'cfg.f.browser_continueMinGapMs',
232
+ topKey: 'cfg.top.browser',
233
+ groupKey: 'cfg.group.recovery',
234
+ },
235
+ {
236
+ path: 'browser.autoCompact',
237
+ type: 'boolean',
238
+ labelKey: 'cfg.f.browser_autoCompact',
239
+ topKey: 'cfg.top.browser',
240
+ groupKey: 'cfg.group.recovery',
241
+ },
242
+ {
243
+ path: 'browser.autoCompactPct',
244
+ type: 'number',
245
+ min: 50,
246
+ max: 100,
247
+ labelKey: 'cfg.f.browser_autoCompactPct',
248
+ topKey: 'cfg.top.browser',
249
+ groupKey: 'cfg.group.recovery',
250
+ },
251
+ // ---------- Browser & chat: sign-in ----------
252
+ {
253
+ path: 'browser.auth.username',
254
+ type: 'string',
255
+ labelKey: 'cfg.f.browser_authUsername',
256
+ topKey: 'cfg.top.browser',
257
+ groupKey: 'cfg.group.login',
258
+ },
259
+ {
260
+ path: 'browser.auth.password',
261
+ type: 'string',
262
+ labelKey: 'cfg.f.browser_authPassword',
263
+ topKey: 'cfg.top.browser',
264
+ groupKey: 'cfg.group.login',
265
+ },
266
+ {
267
+ path: 'browser.passwordStore',
268
+ type: 'enum',
269
+ values: ['none', 'keychain', 'config'],
270
+ labelKey: 'cfg.f.browser_passwordStore',
271
+ topKey: 'cfg.top.browser',
272
+ groupKey: 'cfg.group.login',
273
+ },
274
+ {
275
+ path: 'browser.auth.saveSession',
276
+ type: 'boolean',
277
+ labelKey: 'cfg.f.browser_authSaveSession',
278
+ topKey: 'cfg.top.browser',
279
+ groupKey: 'cfg.group.login',
280
+ },
281
+ {
282
+ path: 'browser.loginTimeoutMs',
283
+ type: 'number',
284
+ min: 30_000,
285
+ max: 3_600_000,
286
+ labelKey: 'cfg.f.browser_loginTimeoutMs',
287
+ topKey: 'cfg.top.browser',
288
+ groupKey: 'cfg.group.login',
289
+ },
290
+ // ---------- Browser & chat: telemetry ----------
291
+ {
292
+ path: 'browser.sendTelemetry',
293
+ type: 'boolean',
294
+ labelKey: 'cfg.f.browser_sendTelemetry',
295
+ topKey: 'cfg.top.browser',
296
+ groupKey: 'cfg.group.telemetry',
297
+ },
298
+ // ---------- Providers: Qwen ----------
299
+ {
300
+ path: 'qwen.model',
301
+ type: 'string',
302
+ labelKey: 'cfg.f.qwen_model',
303
+ topKey: 'cfg.top.providers',
304
+ groupKey: 'cfg.group.qwen',
305
+ },
306
+ {
307
+ path: 'qwen.contextLimit',
308
+ type: 'number',
309
+ min: 10_000,
310
+ max: 10_000_000,
311
+ labelKey: 'cfg.f.qwen_contextLimit',
312
+ topKey: 'cfg.top.providers',
313
+ groupKey: 'cfg.group.qwen',
314
+ },
315
+ {
316
+ path: 'qwen.minSendIntervalMs',
317
+ type: 'number',
318
+ min: 0,
319
+ max: 600000,
320
+ labelKey: 'cfg.f.qwen_minSendIntervalMs',
321
+ topKey: 'cfg.top.providers',
322
+ groupKey: 'cfg.group.qwen',
323
+ },
324
+ {
325
+ path: 'qwen.answerTimeoutMs',
326
+ type: 'number',
327
+ min: 1000,
328
+ max: 3600000,
329
+ labelKey: 'cfg.f.qwen_answerTimeoutMs',
330
+ topKey: 'cfg.top.providers',
331
+ groupKey: 'cfg.group.qwen',
332
+ },
333
+ {
334
+ path: 'qwen.auth.username',
335
+ type: 'string',
336
+ labelKey: 'cfg.f.qwen_authUsername',
337
+ topKey: 'cfg.top.providers',
338
+ groupKey: 'cfg.group.qwen',
339
+ },
340
+ {
341
+ path: 'qwen.auth.password',
342
+ type: 'string',
343
+ labelKey: 'cfg.f.qwen_authPassword',
344
+ topKey: 'cfg.top.providers',
345
+ groupKey: 'cfg.group.qwen',
346
+ },
347
+ // ---------- Providers: GLM ----------
348
+ {
349
+ path: 'glm.model',
350
+ type: 'string',
351
+ labelKey: 'cfg.f.glm_model',
352
+ topKey: 'cfg.top.providers',
353
+ groupKey: 'cfg.group.glm',
354
+ },
355
+ {
356
+ path: 'glm.contextLimit',
357
+ type: 'number',
358
+ min: 10_000,
359
+ max: 10_000_000,
360
+ labelKey: 'cfg.f.glm_contextLimit',
361
+ topKey: 'cfg.top.providers',
362
+ groupKey: 'cfg.group.glm',
363
+ },
364
+ {
365
+ path: 'glm.minSendIntervalMs',
366
+ type: 'number',
367
+ min: 0,
368
+ max: 600000,
369
+ labelKey: 'cfg.f.glm_minSendIntervalMs',
370
+ topKey: 'cfg.top.providers',
371
+ groupKey: 'cfg.group.glm',
372
+ },
373
+ {
374
+ path: 'glm.answerTimeoutMs',
375
+ type: 'number',
376
+ min: 1000,
377
+ max: 3600000,
378
+ labelKey: 'cfg.f.glm_answerTimeoutMs',
379
+ topKey: 'cfg.top.providers',
380
+ groupKey: 'cfg.group.glm',
381
+ },
382
+ {
383
+ path: 'glm.auth.username',
384
+ type: 'string',
385
+ labelKey: 'cfg.f.glm_authUsername',
386
+ topKey: 'cfg.top.providers',
387
+ groupKey: 'cfg.group.glm',
388
+ },
389
+ {
390
+ path: 'glm.auth.password',
391
+ type: 'string',
392
+ labelKey: 'cfg.f.glm_authPassword',
393
+ topKey: 'cfg.top.providers',
394
+ groupKey: 'cfg.group.glm',
395
+ },
396
+ // ---------- Interface: language & look ----------
397
+ {
398
+ path: 'ui.locale',
399
+ type: 'enum',
400
+ values: ['ru', 'en'],
401
+ labelKey: 'cfg.f.ui_locale',
402
+ topKey: 'cfg.top.ui',
403
+ groupKey: 'cfg.group.look',
404
+ },
405
+ {
406
+ path: 'ui.theme',
407
+ type: 'enum',
408
+ values: themeNames(),
409
+ labelKey: 'cfg.f.ui_theme',
410
+ topKey: 'cfg.top.ui',
411
+ groupKey: 'cfg.group.look',
412
+ },
413
+ {
414
+ path: 'ui.inputBorder',
415
+ type: 'enum',
416
+ values: ['round', 'single', 'double', 'bold', 'none'],
417
+ labelKey: 'cfg.f.ui_inputBorder',
418
+ topKey: 'cfg.top.ui',
419
+ groupKey: 'cfg.group.look',
420
+ },
421
+ {
422
+ path: 'ui.answerWidth',
423
+ type: 'number',
424
+ min: 0,
425
+ max: 1000,
426
+ labelKey: 'cfg.f.ui_answerWidth',
427
+ topKey: 'cfg.top.ui',
428
+ groupKey: 'cfg.group.look',
429
+ },
430
+ // ---------- Interface: terminal TUI ----------
431
+ {
432
+ path: 'ui.tui',
433
+ type: 'boolean',
434
+ labelKey: 'cfg.f.ui_tui',
435
+ topKey: 'cfg.top.ui',
436
+ groupKey: 'cfg.group.tui',
437
+ },
438
+ {
439
+ path: 'ui.alternateScreen',
440
+ type: 'boolean',
441
+ labelKey: 'cfg.f.ui_alternateScreen',
442
+ topKey: 'cfg.top.ui',
443
+ groupKey: 'cfg.group.tui',
444
+ },
445
+ {
446
+ path: 'ui.mouseScroll',
447
+ type: 'boolean',
448
+ labelKey: 'cfg.f.ui_mouseScroll',
449
+ topKey: 'cfg.top.ui',
450
+ groupKey: 'cfg.group.tui',
451
+ },
452
+ // ---------- Files & history ----------
453
+ {
454
+ path: 'undo.enabled',
455
+ type: 'boolean',
456
+ labelKey: 'cfg.f.undo_enabled',
457
+ topKey: 'cfg.top.files',
458
+ groupKey: 'cfg.group.undo',
459
+ },
460
+ {
461
+ path: 'undo.maxBackups',
462
+ type: 'number',
463
+ min: 1,
464
+ max: 100000,
465
+ labelKey: 'cfg.f.undo_maxBackups',
466
+ topKey: 'cfg.top.files',
467
+ groupKey: 'cfg.group.undo',
468
+ },
469
+ {
470
+ path: 'checkpoint.enabled',
471
+ type: 'boolean',
472
+ labelKey: 'cfg.f.checkpoint_enabled',
473
+ topKey: 'cfg.top.files',
474
+ groupKey: 'cfg.group.checkpoint',
475
+ },
476
+ {
477
+ path: 'checkpoint.maxBackups',
478
+ type: 'number',
479
+ min: 1,
480
+ max: 1000,
481
+ labelKey: 'cfg.f.checkpoint_maxBackups',
482
+ topKey: 'cfg.top.files',
483
+ groupKey: 'cfg.group.checkpoint',
484
+ },
485
+ {
486
+ path: 'transcript.enabled',
487
+ type: 'boolean',
488
+ labelKey: 'cfg.f.transcript_enabled',
489
+ topKey: 'cfg.top.files',
490
+ groupKey: 'cfg.group.transcript',
491
+ },
492
+ // ---------- Diagnostics (post-edit check) ----------
493
+ {
494
+ path: 'diagnostics.enabled',
495
+ type: 'boolean',
496
+ labelKey: 'cfg.f.diagnostics_enabled',
497
+ topKey: 'cfg.top.diagnostics',
498
+ groupKey: 'cfg.group.diagnostics',
499
+ },
500
+ {
501
+ path: 'diagnostics.command',
502
+ type: 'string',
503
+ labelKey: 'cfg.f.diagnostics_command',
504
+ topKey: 'cfg.top.diagnostics',
505
+ groupKey: 'cfg.group.diagnostics',
506
+ },
507
+ {
508
+ path: 'diagnostics.timeoutMs',
509
+ type: 'number',
510
+ min: 1000,
511
+ max: 1800000,
512
+ labelKey: 'cfg.f.diagnostics_timeoutMs',
513
+ topKey: 'cfg.top.diagnostics',
514
+ groupKey: 'cfg.group.diagnostics',
515
+ },
516
+ {
517
+ path: 'diagnostics.maxChars',
518
+ type: 'number',
519
+ min: 200,
520
+ max: 100000,
521
+ labelKey: 'cfg.f.diagnostics_maxChars',
522
+ topKey: 'cfg.top.diagnostics',
523
+ groupKey: 'cfg.group.diagnostics',
524
+ },
525
+ ];
526
+ export function getConfigField(path) {
527
+ return CONFIG_SCHEMA.find((f) => f.path === path);
528
+ }
529
+ /** Fields of one top-level menu group, in schema order. */
530
+ export function fieldsOfTopGroup(topKey) {
531
+ return CONFIG_SCHEMA.filter((f) => f.topKey === topKey && !f.advanced);
532
+ }
533
+ /** Subgroups of one top-level group, in schema order (deduplicated). */
534
+ export function subgroupsOf(topKey) {
535
+ const out = [];
536
+ for (const f of CONFIG_SCHEMA) {
537
+ if (f.topKey !== topKey || f.advanced)
538
+ continue;
539
+ if (!out.includes(f.groupKey))
540
+ out.push(f.groupKey);
541
+ }
542
+ return out;
543
+ }
544
+ /**
545
+ * True when at least one field of `topKey` differs from its default — the
546
+ * menu marks such a group so the operator sees where a change lives without
547
+ * opening every group.
548
+ */
549
+ export function topGroupModified(topKey, get, getDefault) {
550
+ return fieldsOfTopGroup(topKey).some((f) => {
551
+ const cur = get(f.path);
552
+ const def = getDefault(f.path);
553
+ if (cur === undefined)
554
+ return false;
555
+ try {
556
+ return JSON.stringify(cur) !== JSON.stringify(def);
557
+ }
558
+ catch {
559
+ return String(cur) !== String(def);
560
+ }
561
+ });
562
+ }