jinzd-ai-cli 0.4.270 → 0.4.272

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 (42) hide show
  1. package/dist/{batch-IMLMUXJL.js → batch-3KHEEICT.js} +2 -2
  2. package/dist/{chat-index-7MMTGQNA.js → chat-index-2D5GK2DB.js} +2 -2
  3. package/dist/{chat-index-Q6BKWWAM.js → chat-index-TDU3S2MG.js} +2 -2
  4. package/dist/{chunk-BOMB6XCF.js → chunk-257ZLWOP.js} +2 -2
  5. package/dist/{chunk-B5TYJO7V.js → chunk-3FEZSLGI.js} +51 -6
  6. package/dist/{chunk-F26YTEMB.js → chunk-5NZVRFLP.js} +4 -4
  7. package/dist/{chunk-UDUE4DAE.js → chunk-A5ICBOQ6.js} +1 -1
  8. package/dist/{chunk-JJVVCWO4.js → chunk-AHNTBH7G.js} +1 -1
  9. package/dist/{chunk-OBULDJSU.js → chunk-CGDYO52A.js} +1 -1
  10. package/dist/{chunk-TG4PF7FZ.js → chunk-EZ6VXKJV.js} +1 -1
  11. package/dist/{chunk-FXCDD7JS.js → chunk-FBYFNBUD.js} +3 -3
  12. package/dist/{chunk-YVTASHS5.js → chunk-FSC6KEWU.js} +51 -6
  13. package/dist/{chunk-6RPGQ5CG.js → chunk-GHWZVPUV.js} +1 -1
  14. package/dist/{chunk-DIJIYWQE.js → chunk-JMU5DELU.js} +11 -11
  15. package/dist/{chunk-X3JPBJ6C.js → chunk-MFUAK7OM.js} +6 -6
  16. package/dist/{chunk-JQXXPTWL.js → chunk-MX75TNE5.js} +1 -1
  17. package/dist/{chunk-YHLTSZVH.js → chunk-PXWOJEFG.js} +8 -8
  18. package/dist/{chunk-75SPJKDY.js → chunk-WMVG5E56.js} +1 -1
  19. package/dist/{chunk-M3GDYEUH.js → chunk-XBOP6NLW.js} +4 -4
  20. package/dist/chunk-XNFIYS7G.js +82 -0
  21. package/dist/{chunk-PLFXDRNX.js → chunk-XUNQSAUM.js} +1 -1
  22. package/dist/{chunk-ZWEZNKDW.js → chunk-YOVHMQEJ.js} +1 -1
  23. package/dist/{chunk-HOT76ATM.js → chunk-Z75H56SJ.js} +8 -8
  24. package/dist/{ci-HQVXWJ53.js → ci-6CTWCDH3.js} +4 -4
  25. package/dist/{ci-format-762IL4OM.js → ci-format-MC5HZBCE.js} +2 -2
  26. package/dist/config-command-E5DHADEV.js +11 -0
  27. package/dist/{constants-4TPE3JSV.js → constants-SGKY75QU.js} +1 -1
  28. package/dist/{doctor-cli-3ES6NFVL.js → doctor-cli-7CW4BIGM.js} +4 -4
  29. package/dist/electron-server.js +96 -28
  30. package/dist/{hub-QXRWPBJP.js → hub-ORAAJOPT.js} +2 -2
  31. package/dist/index.js +83 -99
  32. package/dist/{persist-A2QSXYFY.js → persist-PQM4BRI4.js} +3 -3
  33. package/dist/{persistent-memory-F4JPWYZJ.js → persistent-memory-6NQQ2H2B.js} +3 -3
  34. package/dist/{persistent-memory-URIJJJ3N.js → persistent-memory-6SB5ZUOI.js} +3 -3
  35. package/dist/{pr-HVVHZOJ2.js → pr-FNKV6IWI.js} +5 -5
  36. package/dist/{run-tests-WM7TMO2N.js → run-tests-34HXDZXM.js} +2 -2
  37. package/dist/{run-tests-UZG6SVJ5.js → run-tests-PS37BVOI.js} +2 -2
  38. package/dist/{server-HPRLFLOI.js → server-IEOQIQPC.js} +53 -56
  39. package/dist/{server-E5OBXT33.js → server-OZTSIFXL.js} +10 -10
  40. package/dist/{task-orchestrator-HJUUL55Y.js → task-orchestrator-77MEVKT6.js} +12 -12
  41. package/dist/{usage-L3DUPHD6.js → usage-RI6YOAOP.js} +2 -2
  42. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-F26YTEMB.js";
4
+ } from "./chunk-5NZVRFLP.js";
5
5
  import "./chunk-TU3L3PW7.js";
6
- import "./chunk-75SPJKDY.js";
7
6
  import {
8
7
  atomicWriteFileSync
9
8
  } from "./chunk-IW3Q7AE5.js";
9
+ import "./chunk-WMVG5E56.js";
10
10
 
11
11
  // src/cli/batch.ts
12
12
  import Anthropic from "@anthropic-ai/sdk";
@@ -6,10 +6,10 @@ import {
6
6
  getChatIndexStatus,
7
7
  loadChatIndex,
8
8
  searchChatMemory
9
- } from "./chunk-6RPGQ5CG.js";
9
+ } from "./chunk-GHWZVPUV.js";
10
10
  import "./chunk-KHYD3WXE.js";
11
11
  import "./chunk-NYNSYLFY.js";
12
- import "./chunk-B5TYJO7V.js";
12
+ import "./chunk-3FEZSLGI.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
14
  export {
15
15
  buildChatIndex,
@@ -5,8 +5,8 @@ import {
5
5
  getChatIndexStatus,
6
6
  loadChatIndex,
7
7
  searchChatMemory
8
- } from "./chunk-ZWEZNKDW.js";
9
- import "./chunk-YVTASHS5.js";
8
+ } from "./chunk-YOVHMQEJ.js";
9
+ import "./chunk-FSC6KEWU.js";
10
10
  import "./chunk-JV5N65KN.js";
11
11
  import "./chunk-6BUTA5VW.js";
12
12
  export {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DEFAULT_PATTERNS,
3
3
  redactString
4
- } from "./chunk-YVTASHS5.js";
4
+ } from "./chunk-FSC6KEWU.js";
5
5
  import {
6
6
  MEMORY_FILE_NAME,
7
7
  MEMORY_MAX_CHARS,
8
8
  MEMORY_STORE_FILE_NAME
9
- } from "./chunk-JJVVCWO4.js";
9
+ } from "./chunk-AHNTBH7G.js";
10
10
  import {
11
11
  atomicWriteFileSync
12
12
  } from "./chunk-6BUTA5VW.js";
@@ -12,11 +12,16 @@ var DEFAULT_PATTERNS = [
12
12
  { kind: "db-uri-password", regex: /(\b(?:postgres(?:ql)?|mysql|mongodb(?:\+srv)?|redis|amqp|mssql):\/\/[^:\s]+:)([^@\s]+)(@)/gi },
13
13
  // Anthropic API keys
14
14
  { kind: "anthropic-key", regex: /(sk-ant-[a-zA-Z0-9_-]{90,})/g },
15
- // L6 (v0.4.108): Zhipu / GLM API keys — `<24+ hex/base64-ish>.<32+>`
16
- // Two segments separated by a dot, each safely identifiable by length
17
- // and char class. Conservative on the lower bound so we don't eat
18
- // version strings like `1.0.0` or filenames.
19
- { kind: "zhipu-key", regex: /\b([a-zA-Z0-9]{24,}\.[a-zA-Z0-9]{32,})\b/g },
15
+ // Zhipu / GLM API keys — 真实格式是 `<32 hex>.<16 alnum>`。
16
+ //
17
+ // v0.4.108 的原始规则写的是 `<24+>.<32+>`,第二段下界取成了 32——**它从来没有
18
+ // 匹配上过任何一个真实的智谱密钥**。2026-08-16 在东叔的 session 历史里实测到明文
19
+ // 泄漏(同一份 config dump 里 deepseek / gemini / openai 都被正确打码,唯独智谱漏网),
20
+ // 逐字量过密钥形状后才发现下界错了。
21
+ //
22
+ // 现在按真实形状收紧:第一段恰好 32 位十六进制,第二段 16–64 位字母数字。
23
+ // 这比原来更严格,因此不会新增误伤——`<md5>.jpeg` 这类文件名第二段太短,不匹配。
24
+ { kind: "zhipu-key", regex: /\b([a-fA-F0-9]{32}\.[a-zA-Z0-9]{16,64})\b/g },
20
25
  // OpenAI / generic sk- keys — requires length ≥32 to avoid eating short identifiers
21
26
  { kind: "openai-key", regex: /(sk-(?:proj-)?[a-zA-Z0-9_-]{32,})/g },
22
27
  // GitHub personal access tokens
@@ -48,6 +53,46 @@ var MAX_REDACT_INPUT = 512e3;
48
53
  function render(placeholder, kind) {
49
54
  return placeholder.replace("{kind}", kind);
50
55
  }
56
+ function redactApiKeyMaps(input, placeholder, hits) {
57
+ const blockStart = /"api[_-]?keys"\s*:\s*\{/gi;
58
+ let out = "";
59
+ let cursor = 0;
60
+ let m;
61
+ while ((m = blockStart.exec(input)) !== null) {
62
+ const openIdx = m.index + m[0].length - 1;
63
+ let depth = 0;
64
+ let close = -1;
65
+ for (let i = openIdx; i < input.length; i++) {
66
+ const ch = input[i];
67
+ if (ch === "{") depth++;
68
+ else if (ch === "}") {
69
+ depth--;
70
+ if (depth === 0) {
71
+ close = i;
72
+ break;
73
+ }
74
+ }
75
+ }
76
+ if (close < 0) break;
77
+ const block = input.slice(openIdx, close + 1);
78
+ const redactedBlock = block.replace(
79
+ /("[^"\n]{1,64}"\s*:\s*")([^"\n]{8,})(?=")/g,
80
+ (_full, prefix, secret, offset) => {
81
+ hits.push({
82
+ kind: "api-key-map",
83
+ start: openIdx + offset + prefix.length,
84
+ length: secret.length,
85
+ secret
86
+ });
87
+ return `${prefix}${render(placeholder, "api-key-map")}`;
88
+ }
89
+ );
90
+ out += input.slice(cursor, openIdx) + redactedBlock;
91
+ cursor = close + 1;
92
+ blockStart.lastIndex = close + 1;
93
+ }
94
+ return cursor === 0 ? input : out + input.slice(cursor);
95
+ }
51
96
  function redactString(input, options) {
52
97
  if (!options.enabled || !input) return { redacted: input, hits: [] };
53
98
  if (input.length > MAX_REDACT_INPUT) return { redacted: input, hits: [] };
@@ -68,8 +113,8 @@ function redactString(input, options) {
68
113
  }
69
114
  })
70
115
  ];
71
- let redacted = input;
72
116
  const hits = [];
117
+ let redacted = redactApiKeyMaps(input, placeholder, hits);
73
118
  for (const { kind, regex } of patterns) {
74
119
  const rx = new RegExp(regex.source, regex.flags);
75
120
  const captureCount = new RegExp(rx.source + "|").exec("").length - 1;
@@ -3,15 +3,15 @@ import {
3
3
  ConfigError,
4
4
  EnvLoader
5
5
  } from "./chunk-TU3L3PW7.js";
6
+ import {
7
+ atomicWriteFileSync
8
+ } from "./chunk-IW3Q7AE5.js";
6
9
  import {
7
10
  CONFIG_DIR_NAME,
8
11
  CONFIG_FILE_NAME,
9
12
  HISTORY_DIR_NAME,
10
13
  PLUGINS_DIR_NAME
11
- } from "./chunk-75SPJKDY.js";
12
- import {
13
- atomicWriteFileSync
14
- } from "./chunk-IW3Q7AE5.js";
14
+ } from "./chunk-WMVG5E56.js";
15
15
 
16
16
  // src/config/config-manager.ts
17
17
  import { readFileSync, existsSync, mkdirSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TEST_TIMEOUT
3
- } from "./chunk-JJVVCWO4.js";
3
+ } from "./chunk-AHNTBH7G.js";
4
4
 
5
5
  // src/tools/builtin/run-tests.ts
6
6
  import { execSync, spawnSync } from "child_process";
@@ -1,5 +1,5 @@
1
1
  // src/core/constants.ts
2
- var VERSION = "0.4.270";
2
+ var VERSION = "0.4.272";
3
3
  var APP_NAME = "ai-cli";
4
4
  var CONFIG_DIR_NAME = ".aicli";
5
5
  var CONFIG_FILE_NAME = "config.json";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-NYNSYLFY.js";
10
10
  import {
11
11
  redactJson
12
- } from "./chunk-B5TYJO7V.js";
12
+ } from "./chunk-3FEZSLGI.js";
13
13
  import {
14
14
  atomicWriteFileSync
15
15
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-75SPJKDY.js";
4
+ } from "./chunk-WMVG5E56.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  evaluateCiGate,
4
4
  normalizeCiThresholds
5
- } from "./chunk-PLFXDRNX.js";
5
+ } from "./chunk-XUNQSAUM.js";
6
6
  import {
7
7
  buildReviewPrompt,
8
8
  buildSecurityReviewPrompt,
@@ -16,10 +16,10 @@ import {
16
16
  } from "./chunk-AUEX6RNY.js";
17
17
  import {
18
18
  ConfigManager
19
- } from "./chunk-F26YTEMB.js";
19
+ } from "./chunk-5NZVRFLP.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-75SPJKDY.js";
22
+ } from "./chunk-WMVG5E56.js";
23
23
 
24
24
  // src/cli/ci.ts
25
25
  import { execFileSync } from "child_process";
@@ -10,11 +10,16 @@ var DEFAULT_PATTERNS = [
10
10
  { kind: "db-uri-password", regex: /(\b(?:postgres(?:ql)?|mysql|mongodb(?:\+srv)?|redis|amqp|mssql):\/\/[^:\s]+:)([^@\s]+)(@)/gi },
11
11
  // Anthropic API keys
12
12
  { kind: "anthropic-key", regex: /(sk-ant-[a-zA-Z0-9_-]{90,})/g },
13
- // L6 (v0.4.108): Zhipu / GLM API keys — `<24+ hex/base64-ish>.<32+>`
14
- // Two segments separated by a dot, each safely identifiable by length
15
- // and char class. Conservative on the lower bound so we don't eat
16
- // version strings like `1.0.0` or filenames.
17
- { kind: "zhipu-key", regex: /\b([a-zA-Z0-9]{24,}\.[a-zA-Z0-9]{32,})\b/g },
13
+ // Zhipu / GLM API keys — 真实格式是 `<32 hex>.<16 alnum>`。
14
+ //
15
+ // v0.4.108 的原始规则写的是 `<24+>.<32+>`,第二段下界取成了 32——**它从来没有
16
+ // 匹配上过任何一个真实的智谱密钥**。2026-08-16 在东叔的 session 历史里实测到明文
17
+ // 泄漏(同一份 config dump 里 deepseek / gemini / openai 都被正确打码,唯独智谱漏网),
18
+ // 逐字量过密钥形状后才发现下界错了。
19
+ //
20
+ // 现在按真实形状收紧:第一段恰好 32 位十六进制,第二段 16–64 位字母数字。
21
+ // 这比原来更严格,因此不会新增误伤——`<md5>.jpeg` 这类文件名第二段太短,不匹配。
22
+ { kind: "zhipu-key", regex: /\b([a-fA-F0-9]{32}\.[a-zA-Z0-9]{16,64})\b/g },
18
23
  // OpenAI / generic sk- keys — requires length ≥32 to avoid eating short identifiers
19
24
  { kind: "openai-key", regex: /(sk-(?:proj-)?[a-zA-Z0-9_-]{32,})/g },
20
25
  // GitHub personal access tokens
@@ -46,6 +51,46 @@ var MAX_REDACT_INPUT = 512e3;
46
51
  function render(placeholder, kind) {
47
52
  return placeholder.replace("{kind}", kind);
48
53
  }
54
+ function redactApiKeyMaps(input, placeholder, hits) {
55
+ const blockStart = /"api[_-]?keys"\s*:\s*\{/gi;
56
+ let out = "";
57
+ let cursor = 0;
58
+ let m;
59
+ while ((m = blockStart.exec(input)) !== null) {
60
+ const openIdx = m.index + m[0].length - 1;
61
+ let depth = 0;
62
+ let close = -1;
63
+ for (let i = openIdx; i < input.length; i++) {
64
+ const ch = input[i];
65
+ if (ch === "{") depth++;
66
+ else if (ch === "}") {
67
+ depth--;
68
+ if (depth === 0) {
69
+ close = i;
70
+ break;
71
+ }
72
+ }
73
+ }
74
+ if (close < 0) break;
75
+ const block = input.slice(openIdx, close + 1);
76
+ const redactedBlock = block.replace(
77
+ /("[^"\n]{1,64}"\s*:\s*")([^"\n]{8,})(?=")/g,
78
+ (_full, prefix, secret, offset) => {
79
+ hits.push({
80
+ kind: "api-key-map",
81
+ start: openIdx + offset + prefix.length,
82
+ length: secret.length,
83
+ secret
84
+ });
85
+ return `${prefix}${render(placeholder, "api-key-map")}`;
86
+ }
87
+ );
88
+ out += input.slice(cursor, openIdx) + redactedBlock;
89
+ cursor = close + 1;
90
+ blockStart.lastIndex = close + 1;
91
+ }
92
+ return cursor === 0 ? input : out + input.slice(cursor);
93
+ }
49
94
  function redactString(input, options) {
50
95
  if (!options.enabled || !input) return { redacted: input, hits: [] };
51
96
  if (input.length > MAX_REDACT_INPUT) return { redacted: input, hits: [] };
@@ -66,8 +111,8 @@ function redactString(input, options) {
66
111
  }
67
112
  })
68
113
  ];
69
- let redacted = input;
70
114
  const hits = [];
115
+ let redacted = redactApiKeyMaps(input, placeholder, hits);
71
116
  for (const { kind, regex } of patterns) {
72
117
  const rx = new RegExp(regex.source, regex.flags);
73
118
  const captureCount = new RegExp(rx.source + "|").exec("").length - 1;
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-NYNSYLFY.js";
10
10
  import {
11
11
  redactString
12
- } from "./chunk-B5TYJO7V.js";
12
+ } from "./chunk-3FEZSLGI.js";
13
13
  import {
14
14
  atomicWriteFileSync
15
15
  } from "./chunk-IW3Q7AE5.js";
@@ -1,4 +1,8 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ loadChatIndex,
4
+ searchChatMemory
5
+ } from "./chunk-GHWZVPUV.js";
2
6
  import {
3
7
  addMemoryEntry,
4
8
  findSimilarMemory,
@@ -7,7 +11,7 @@ import {
7
11
  searchPersistentMemories,
8
12
  touchMemoryReferences,
9
13
  updateMemoryEntry
10
- } from "./chunk-YHLTSZVH.js";
14
+ } from "./chunk-PXWOJEFG.js";
11
15
  import {
12
16
  indexProject
13
17
  } from "./chunk-GLSR2NR3.js";
@@ -26,7 +30,7 @@ import {
26
30
  runHook,
27
31
  runLifecycleHooks,
28
32
  runTool
29
- } from "./chunk-M3GDYEUH.js";
33
+ } from "./chunk-XBOP6NLW.js";
30
34
  import {
31
35
  buildTruncatedArgumentsError,
32
36
  getDangerLevel,
@@ -38,26 +42,22 @@ import {
38
42
  NetworkError,
39
43
  ToolError
40
44
  } from "./chunk-TU3L3PW7.js";
45
+ import {
46
+ atomicWriteFileSync
47
+ } from "./chunk-IW3Q7AE5.js";
41
48
  import {
42
49
  fileCheckpoints
43
50
  } from "./chunk-4BKXL7SM.js";
44
51
  import {
45
52
  runTestsTool
46
- } from "./chunk-TG4PF7FZ.js";
53
+ } from "./chunk-EZ6VXKJV.js";
47
54
  import {
48
55
  CONFIG_DIR_NAME,
49
56
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
50
57
  SUBAGENT_ALLOWED_TOOLS,
51
58
  SUBAGENT_DEFAULT_MAX_ROUNDS,
52
59
  SUBAGENT_MAX_ROUNDS_LIMIT
53
- } from "./chunk-75SPJKDY.js";
54
- import {
55
- loadChatIndex,
56
- searchChatMemory
57
- } from "./chunk-6RPGQ5CG.js";
58
- import {
59
- atomicWriteFileSync
60
- } from "./chunk-IW3Q7AE5.js";
60
+ } from "./chunk-WMVG5E56.js";
61
61
 
62
62
  // src/tools/shell-pool.ts
63
63
  import { spawn as spawn2 } from "child_process";
@@ -5,11 +5,14 @@ import {
5
5
  import {
6
6
  estimateTokens,
7
7
  truncateForPersist
8
- } from "./chunk-DIJIYWQE.js";
8
+ } from "./chunk-JMU5DELU.js";
9
9
  import {
10
10
  isMemoryExpired,
11
11
  isMemoryStale
12
- } from "./chunk-YHLTSZVH.js";
12
+ } from "./chunk-PXWOJEFG.js";
13
+ import {
14
+ atomicWriteFileSync
15
+ } from "./chunk-IW3Q7AE5.js";
13
16
  import {
14
17
  APP_NAME,
15
18
  CONFIG_DIR_NAME,
@@ -20,10 +23,7 @@ import {
20
23
  MCP_PROTOCOL_VERSION,
21
24
  MCP_TOOL_PREFIX,
22
25
  VERSION
23
- } from "./chunk-75SPJKDY.js";
24
- import {
25
- atomicWriteFileSync
26
- } from "./chunk-IW3Q7AE5.js";
26
+ } from "./chunk-WMVG5E56.js";
27
27
 
28
28
  // src/mcp/client.ts
29
29
  import { spawn } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SessionManager
4
- } from "./chunk-OBULDJSU.js";
4
+ } from "./chunk-CGDYO52A.js";
5
5
 
6
6
  // src/hub/persist.ts
7
7
  import { join } from "path";
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ DEFAULT_PATTERNS,
4
+ redactString
5
+ } from "./chunk-3FEZSLGI.js";
2
6
  import {
3
7
  getGitRoot
4
8
  } from "./chunk-HOSJZMQS.js";
9
+ import {
10
+ atomicWriteFileSync
11
+ } from "./chunk-IW3Q7AE5.js";
5
12
  import {
6
13
  MEMORY_FILE_NAME,
7
14
  MEMORY_MAX_CHARS,
8
15
  MEMORY_STORE_FILE_NAME
9
- } from "./chunk-75SPJKDY.js";
10
- import {
11
- DEFAULT_PATTERNS,
12
- redactString
13
- } from "./chunk-B5TYJO7V.js";
14
- import {
15
- atomicWriteFileSync
16
- } from "./chunk-IW3Q7AE5.js";
16
+ } from "./chunk-WMVG5E56.js";
17
17
 
18
18
  // src/memory/persistent-memory.ts
19
19
  import { copyFileSync, existsSync, mkdirSync, readFileSync, statSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.270";
4
+ var VERSION = "0.4.272";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- CONFIG_DIR_NAME,
4
- PLUGINS_DIR_NAME
5
- } from "./chunk-75SPJKDY.js";
6
2
  import {
7
3
  atomicWriteFileSync
8
4
  } from "./chunk-IW3Q7AE5.js";
5
+ import {
6
+ CONFIG_DIR_NAME,
7
+ PLUGINS_DIR_NAME
8
+ } from "./chunk-WMVG5E56.js";
9
9
 
10
10
  // src/diagnostics/tool-stats.ts
11
11
  import { existsSync, readFileSync, mkdirSync } from "fs";
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/core/config-command.ts
4
+ var CONFIG_USAGE = "Usage: config [show | get <path> | set <path> <value>]";
5
+ var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
6
+ function maskSecret(value) {
7
+ if (value.length <= 8) return "****";
8
+ return `${value.slice(0, 4)}****${value.slice(-4)}`;
9
+ }
10
+ function maskConfigSecrets(config) {
11
+ const apiKeys = config["apiKeys"];
12
+ if (apiKeys && typeof apiKeys === "object") {
13
+ const keys = apiKeys;
14
+ for (const k of Object.keys(keys)) {
15
+ if (typeof keys[k] === "string") keys[k] = maskSecret(keys[k]);
16
+ }
17
+ }
18
+ const custom = config["customProviders"];
19
+ if (custom && typeof custom === "object") {
20
+ for (const entry of Object.values(custom)) {
21
+ if (entry && typeof entry === "object" && typeof entry["apiKey"] === "string") {
22
+ const e = entry;
23
+ e["apiKey"] = maskSecret(e["apiKey"]);
24
+ }
25
+ }
26
+ }
27
+ return config;
28
+ }
29
+ function applyConfigCommand(args, target) {
30
+ const sub = args[0]?.toLowerCase();
31
+ if (!sub) return { action: "wizard", changed: false, isError: false };
32
+ if (sub === "show") {
33
+ return {
34
+ action: "show",
35
+ json: JSON.stringify(maskConfigSecrets(target.toJSON()), null, 2),
36
+ changed: false,
37
+ isError: false
38
+ };
39
+ }
40
+ if (sub === "get") {
41
+ const path = args[1]?.trim();
42
+ if (!path) {
43
+ return { action: "usage", summary: "Usage: config get <path> (e.g. ui.theme)", changed: false, isError: true };
44
+ }
45
+ const value = target.getByPath(path);
46
+ const shown = value === void 0 ? "(undefined)" : typeof value === "object" ? JSON.stringify(value) : String(value);
47
+ return { action: "get", summary: `${path} = ${shown}`, changed: false, isError: false };
48
+ }
49
+ if (sub === "set") {
50
+ const path = args[1]?.trim();
51
+ const value = args.slice(2).join(" ").trim();
52
+ if (!path || value === "") {
53
+ return {
54
+ action: "usage",
55
+ summary: "Usage: config set <path> <value> (e.g. ui.theme light)",
56
+ changed: false,
57
+ isError: true
58
+ };
59
+ }
60
+ if (path.split(".").some((k) => FORBIDDEN_KEYS.has(k))) {
61
+ return { action: "set", summary: `Forbidden path segment in "${path}"`, changed: false, isError: true };
62
+ }
63
+ try {
64
+ target.setByPath(path, value);
65
+ } catch (err) {
66
+ return {
67
+ action: "set",
68
+ summary: `Config error: ${err instanceof Error ? err.message : String(err)}`,
69
+ changed: false,
70
+ isError: true
71
+ };
72
+ }
73
+ return { action: "set", summary: `Set ${path} = ${value}`, changed: true, isError: false };
74
+ }
75
+ return { action: "usage", summary: CONFIG_USAGE, changed: false, isError: true };
76
+ }
77
+
78
+ export {
79
+ CONFIG_USAGE,
80
+ maskConfigSecrets,
81
+ applyConfigCommand
82
+ };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-75SPJKDY.js";
4
+ } from "./chunk-WMVG5E56.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactString
3
- } from "./chunk-YVTASHS5.js";
3
+ } from "./chunk-FSC6KEWU.js";
4
4
  import {
5
5
  EMBEDDING_DIM,
6
6
  embed,
@@ -1,10 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- ProviderRegistry
4
- } from "./chunk-AUEX6RNY.js";
5
- import {
6
- ConfigManager
7
- } from "./chunk-F26YTEMB.js";
8
2
  import {
9
3
  getActivePluginAssets,
10
4
  getPendingHookTrust,
@@ -14,7 +8,13 @@ import {
14
8
  listHooks,
15
9
  listInstalledPlugins,
16
10
  resetStats
17
- } from "./chunk-M3GDYEUH.js";
11
+ } from "./chunk-XBOP6NLW.js";
12
+ import {
13
+ ProviderRegistry
14
+ } from "./chunk-AUEX6RNY.js";
15
+ import {
16
+ ConfigManager
17
+ } from "./chunk-5NZVRFLP.js";
18
18
  import {
19
19
  getGitRoot
20
20
  } from "./chunk-HOSJZMQS.js";
@@ -26,7 +26,7 @@ import {
26
26
  MCP_PROJECT_CONFIG_NAME,
27
27
  MEMORY_FILE_NAME,
28
28
  VERSION
29
- } from "./chunk-75SPJKDY.js";
29
+ } from "./chunk-WMVG5E56.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -3,16 +3,16 @@ import {
3
3
  CI_COMMENT_MARKER,
4
4
  countSeverity,
5
5
  runCi
6
- } from "./chunk-FXCDD7JS.js";
7
- import "./chunk-PLFXDRNX.js";
6
+ } from "./chunk-FBYFNBUD.js";
7
+ import "./chunk-XUNQSAUM.js";
8
8
  import "./chunk-HLWUDRBO.js";
9
9
  import "./chunk-6YZEZFX5.js";
10
10
  import "./chunk-AUEX6RNY.js";
11
- import "./chunk-F26YTEMB.js";
11
+ import "./chunk-5NZVRFLP.js";
12
12
  import "./chunk-3OBY7WSS.js";
13
13
  import "./chunk-TU3L3PW7.js";
14
- import "./chunk-75SPJKDY.js";
15
14
  import "./chunk-IW3Q7AE5.js";
15
+ import "./chunk-WMVG5E56.js";
16
16
  export {
17
17
  CI_COMMENT_MARKER,
18
18
  countSeverity,
@@ -6,8 +6,8 @@ import {
6
6
  formatCiResult,
7
7
  formatCiSarif,
8
8
  normalizeCiThresholds
9
- } from "./chunk-PLFXDRNX.js";
10
- import "./chunk-75SPJKDY.js";
9
+ } from "./chunk-XUNQSAUM.js";
10
+ import "./chunk-WMVG5E56.js";
11
11
  export {
12
12
  DEFAULT_CI_THRESHOLDS,
13
13
  detectCiGateSignals,
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ CONFIG_USAGE,
4
+ applyConfigCommand,
5
+ maskConfigSecrets
6
+ } from "./chunk-XNFIYS7G.js";
7
+ export {
8
+ CONFIG_USAGE,
9
+ applyConfigCommand,
10
+ maskConfigSecrets
11
+ };
@@ -38,7 +38,7 @@ import {
38
38
  TEST_TIMEOUT,
39
39
  VERSION,
40
40
  buildUserIdentityPrompt
41
- } from "./chunk-75SPJKDY.js";
41
+ } from "./chunk-WMVG5E56.js";
42
42
  export {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  APP_NAME,