zames_pro 2.72.3 → 2.72.4

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/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.72.4] - 2026-10-09
11
+
12
+ ### Changed
13
+
14
+ - **index:** extract the pure /config rendering into config-commands.ts (C3)
15
+
16
+ ### Changed
17
+
18
+ - **index:** extract the pure /config rendering into config-commands.ts (C3)
19
+
10
20
  ## [2.72.3] - 2026-10-09
11
21
 
12
22
  ### Changed
@@ -0,0 +1,75 @@
1
+ // PURE rendering for the /config command's TEXT output (BACKLOG C3). These
2
+ // helpers format the schema into lines; they touch no browser/terminal state,
3
+ // so they are unit-tested without a live agent (the /config dispatch in
4
+ // index.ts only prints what these return). The interactive menu lives in
5
+ // config-menu.ts; the value read/write policy lives in config.ts.
6
+ import { theme } from './theme.js';
7
+ /**
8
+ * The value shown for a field in the LIST: the default marker, on/off for a
9
+ * boolean, a fixed mask for a password, otherwise the JSON form. Mirrors the
10
+ * long-used inline logic so the output is byte-for-byte identical.
11
+ */
12
+ export function configListValue(field, value, t) {
13
+ if (value === undefined)
14
+ return t('cfg.menu.default');
15
+ if (typeof value === 'boolean')
16
+ return value ? t('common.on') : t('common.off');
17
+ if (/password/i.test(field.path) && String(value).length > 0)
18
+ return '********';
19
+ return JSON.stringify(value);
20
+ }
21
+ /**
22
+ * The value shown for `/config get <path>`: the default marker, a fixed mask
23
+ * for a password, otherwise the JSON form. Note this deliberately does NOT
24
+ * special-case booleans (the get subcommand has always printed true/false).
25
+ */
26
+ export function configGetValue(path, value, t) {
27
+ if (value === undefined)
28
+ return t('cfg.menu.default');
29
+ if (/password/i.test(path) && String(value).length > 0)
30
+ return '********';
31
+ return JSON.stringify(value);
32
+ }
33
+ /**
34
+ * Human-readable hint of the accepted values for a field, used in the error
35
+ * message when /config set gets a bad value. Enum -> the allowed list,
36
+ * number -> a range, boolean -> "true|false".
37
+ */
38
+ export function configValueHint(field, t) {
39
+ if (field.values && field.values.length)
40
+ return field.values.join('|');
41
+ if (field.type === 'boolean')
42
+ return 'true|false';
43
+ if (field.type === 'number') {
44
+ const lo = field.min !== undefined ? String(field.min) : '-';
45
+ const hi = field.max !== undefined ? String(field.max) : '-';
46
+ return t('cfg.range_hint', { min: lo, max: hi });
47
+ }
48
+ return field.type;
49
+ }
50
+ /**
51
+ * Render the full settings LIST as an array of lines (grouped by section).
52
+ * `get` reads the current value of a path (undefined = default). Returned as
53
+ * lines so index.ts only has to print them and the formatting is testable.
54
+ */
55
+ export function formatConfigList(fields, get, t) {
56
+ const out = [theme.system(t('cfg.title'))];
57
+ let lastGroup = '';
58
+ for (const f of fields) {
59
+ const g = t(f.groupKey);
60
+ if (g !== lastGroup) {
61
+ out.push(theme.system('\n ' + g));
62
+ lastGroup = g;
63
+ }
64
+ const shown = configListValue(f, get(f.path), t);
65
+ const extra = f.values ? ' [' + f.values.join('|') + ']' : '';
66
+ out.push(' ' +
67
+ theme.user(f.path) +
68
+ theme.dim(' = ') +
69
+ theme.assistant(shown) +
70
+ theme.dim(extra) +
71
+ theme.dim(' # ' + t(f.labelKey)));
72
+ }
73
+ out.push(theme.dim('\n' + t('cfg.usage')));
74
+ return out;
75
+ }
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ import { promptOnce } from './prompt.js';
16
16
  import { parseImagePaste, extForMime, saveToTemp, guessMime, formatSize, readClipboardImageDetailed, sniffMime, readWindowsClipboardFiles, hasClipboardTool, writeClipboardText, contentHash, } from './attachments.js';
17
17
  import { loadConfig, DEFAULTS, CONFIG_PATHS, ZAMES_HOME, CONFIG_SCHEMA, getByPath, validateConfigValue, writeConfigValue, resetConfigValue, } from './config.js';
18
18
  import { runConfigMenu } from './config-menu.js';
19
+ import { configGetValue, configValueHint, formatConfigList, } from './config-commands.js';
19
20
  import { translate, normalizeLocale, localeDisplayName, isLocale, } from './i18n.js';
20
21
  import { Transcript } from './transcript.js';
21
22
  import { UndoStore } from './undo.js';
@@ -1528,55 +1529,16 @@ async function main() {
1528
1529
  // Human-readable hint of the accepted values for a field, used in the error
1529
1530
  // message when /config set gets a bad value. Enum -> the allowed list,
1530
1531
  // number -> a range, boolean -> "true|false".
1531
- function configValueHint(field) {
1532
- if (field.values && field.values.length)
1533
- return field.values.join('|');
1534
- if (field.type === 'boolean')
1535
- return 'true|false';
1536
- if (field.type === 'number') {
1537
- const lo = field.min !== undefined ? String(field.min) : '-';
1538
- const hi = field.max !== undefined ? String(field.max) : '-';
1539
- return t('cfg.range_hint', { min: lo, max: hi });
1540
- }
1541
- return field.type;
1542
- }
1543
1532
  function configResetField(field) {
1544
1533
  resetConfigValue('home', field.path);
1545
1534
  // Reset the runtime value to the default.
1546
1535
  const def = getByPath(DEFAULTS, field.path);
1547
1536
  setConfigRuntime(field.path, def);
1548
1537
  }
1549
- function configLabel(field) {
1550
- return t(field.labelKey);
1551
- }
1552
1538
  function configShowList() {
1553
- console.log(theme.system(t('cfg.title')));
1554
- let lastGroup = '';
1555
- for (const f of CONFIG_SCHEMA) {
1556
- const g = t(f.groupKey);
1557
- if (g !== lastGroup) {
1558
- console.log(theme.system('\n ' + g));
1559
- lastGroup = g;
1560
- }
1561
- const cur = getByPath(config, f.path);
1562
- const shown = cur === undefined
1563
- ? t('cfg.menu.default')
1564
- : typeof cur === 'boolean'
1565
- ? cur
1566
- ? t('common.on')
1567
- : t('common.off')
1568
- : /password/i.test(f.path) && String(cur).length > 0
1569
- ? '********'
1570
- : JSON.stringify(cur);
1571
- const extra = f.values ? ' [' + f.values.join('|') + ']' : '';
1572
- console.log(' ' +
1573
- theme.user(f.path) +
1574
- theme.dim(' = ') +
1575
- theme.assistant(shown) +
1576
- theme.dim(extra) +
1577
- theme.dim(' # ' + configLabel(f)));
1578
- }
1579
- console.log(theme.dim('\n' + t('cfg.usage')));
1539
+ for (const line of formatConfigList(CONFIG_SCHEMA, (p) => getByPath(config, p), t)) {
1540
+ console.log(line);
1541
+ }
1580
1542
  }
1581
1543
  async function configOpenMenu() {
1582
1544
  if (!(process.stdin.isTTY && process.stdout.isTTY)) {
@@ -1657,14 +1619,7 @@ async function main() {
1657
1619
  return;
1658
1620
  }
1659
1621
  const cur = getByPath(config, key);
1660
- console.log(theme.system(t('cfg.value', {
1661
- v: key,
1662
- value: cur === undefined
1663
- ? t('cfg.menu.default')
1664
- : /password/i.test(key) && String(cur).length > 0
1665
- ? '********'
1666
- : JSON.stringify(cur),
1667
- })));
1622
+ console.log(theme.system(t('cfg.value', { v: key, value: configGetValue(key, cur, t) })));
1668
1623
  return;
1669
1624
  }
1670
1625
  if (sub === 'set') {
@@ -1685,7 +1640,7 @@ async function main() {
1685
1640
  catch {
1686
1641
  console.error(theme.error(t('cfg.bad_value', {
1687
1642
  v: key,
1688
- type: configValueHint(field),
1643
+ type: configValueHint(field, t),
1689
1644
  })));
1690
1645
  return;
1691
1646
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.72.3",
3
+ "version": "2.72.4",
4
4
  "description": "Terminal coding agent that drives chat.deepseek.com through Playwright — no API key required. Reads and edits files, runs commands, commits to git, like Claude Code / Codex CLI.",
5
5
  "type": "module",
6
6
  "bin": {