jinzd-ai-cli 0.4.244 → 0.4.246

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 (31) hide show
  1. package/dist/{batch-GLB7ES6K.js → batch-AHW7WALD.js} +2 -2
  2. package/dist/{chunk-P6AUULT2.js → chunk-6Y42RN5H.js} +3 -3
  3. package/dist/{chunk-M7XY5AK5.js → chunk-CJ3BPLHZ.js} +1 -1
  4. package/dist/{chunk-HN4FU37T.js → chunk-DJDEXHOT.js} +3 -3
  5. package/dist/{chunk-WF7FD7WS.js → chunk-GQYRPBIQ.js} +75 -51
  6. package/dist/{chunk-OYFDGRYD.js → chunk-LEKOBVOQ.js} +2 -2
  7. package/dist/{chunk-ZQGCX4QD.js → chunk-LZGPGPA6.js} +1 -1
  8. package/dist/{chunk-ACU6T7B3.js → chunk-OMSOAFXY.js} +1 -1
  9. package/dist/{chunk-XZI4ULXF.js → chunk-P2LB6S4I.js} +1 -1
  10. package/dist/{chunk-MCC5BEZG.js → chunk-USJF35NB.js} +1 -1
  11. package/dist/{chunk-BO5UU3TY.js → chunk-WYNPWHXB.js} +1 -1
  12. package/dist/{chunk-6IAVHU3I.js → chunk-XK22CVID.js} +1 -1
  13. package/dist/{chunk-B7KTFHK2.js → chunk-YQUBYTDR.js} +1 -1
  14. package/dist/{chunk-BKTCOL5D.js → chunk-Z7JROM3J.js} +1 -1
  15. package/dist/{ci-V7RGDIER.js → ci-VOGIC6S4.js} +4 -4
  16. package/dist/{ci-format-HSUEHAM2.js → ci-format-BHCSMT5U.js} +2 -2
  17. package/dist/{constants-OQ6FVQ23.js → constants-J4OLBH72.js} +1 -1
  18. package/dist/{doctor-cli-LABZF3XG.js → doctor-cli-IR3E3XHB.js} +4 -4
  19. package/dist/electron-server.js +83 -59
  20. package/dist/{hub-RTFICY6M.js → hub-SFFFYMGO.js} +1 -1
  21. package/dist/index.js +19 -19
  22. package/dist/{persistent-memory-P6LU5KDG.js → persistent-memory-3KH2EVHA.js} +2 -2
  23. package/dist/{persistent-memory-OWXDBSZY.js → persistent-memory-EKZ2JF7M.js} +2 -2
  24. package/dist/{pr-HXJ6ML6M.js → pr-BNS3OHDM.js} +4 -4
  25. package/dist/{run-tests-XJ44FWIK.js → run-tests-PW4WC4OG.js} +2 -2
  26. package/dist/{run-tests-EFWAH43I.js → run-tests-ZKHXKCQB.js} +2 -2
  27. package/dist/{server-B6WJWV3T.js → server-3HLBEWNZ.js} +5 -5
  28. package/dist/{server-6OPGWJ7S.js → server-D2ID3GYA.js} +11 -11
  29. package/dist/{task-orchestrator-KHJYQXWU.js → task-orchestrator-FMCI4RPX.js} +5 -5
  30. package/dist/{usage-NW2ZXN6N.js → usage-DPLNMDSJ.js} +2 -2
  31. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-ACU6T7B3.js";
4
+ } from "./chunk-OMSOAFXY.js";
5
5
  import "./chunk-5ULLIOVC.js";
6
- import "./chunk-B7KTFHK2.js";
6
+ import "./chunk-YQUBYTDR.js";
7
7
  import {
8
8
  atomicWriteFileSync
9
9
  } from "./chunk-IW3Q7AE5.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  evaluateCiGate,
4
4
  normalizeCiThresholds
5
- } from "./chunk-XZI4ULXF.js";
5
+ } from "./chunk-P2LB6S4I.js";
6
6
  import {
7
7
  buildReviewPrompt,
8
8
  buildSecurityReviewPrompt,
@@ -13,10 +13,10 @@ import {
13
13
  } from "./chunk-QYQI7ZWK.js";
14
14
  import {
15
15
  ConfigManager
16
- } from "./chunk-ACU6T7B3.js";
16
+ } from "./chunk-OMSOAFXY.js";
17
17
  import {
18
18
  VERSION
19
- } from "./chunk-B7KTFHK2.js";
19
+ } from "./chunk-YQUBYTDR.js";
20
20
 
21
21
  // src/cli/ci.ts
22
22
  import { execFileSync } from "child_process";
@@ -6,7 +6,7 @@ import {
6
6
  MEMORY_FILE_NAME,
7
7
  MEMORY_MAX_CHARS,
8
8
  MEMORY_STORE_FILE_NAME
9
- } from "./chunk-ZQGCX4QD.js";
9
+ } from "./chunk-LZGPGPA6.js";
10
10
  import {
11
11
  atomicWriteFileSync
12
12
  } from "./chunk-6BUTA5VW.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-QYQI7ZWK.js";
5
5
  import {
6
6
  ConfigManager
7
- } from "./chunk-ACU6T7B3.js";
7
+ } from "./chunk-OMSOAFXY.js";
8
8
  import {
9
9
  getActivePluginAssets,
10
10
  getPendingHookTrust,
@@ -14,7 +14,7 @@ import {
14
14
  listHooks,
15
15
  listInstalledPlugins,
16
16
  resetStats
17
- } from "./chunk-BO5UU3TY.js";
17
+ } from "./chunk-WYNPWHXB.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-B7KTFHK2.js";
29
+ } from "./chunk-YQUBYTDR.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -7,7 +7,7 @@ import {
7
7
  searchPersistentMemories,
8
8
  touchMemoryReferences,
9
9
  updateMemoryEntry
10
- } from "./chunk-BKTCOL5D.js";
10
+ } from "./chunk-Z7JROM3J.js";
11
11
  import {
12
12
  indexProject
13
13
  } from "./chunk-K3CF65QH.js";
@@ -23,7 +23,7 @@ import {
23
23
  runHook,
24
24
  runLifecycleHooks,
25
25
  runTool
26
- } from "./chunk-BO5UU3TY.js";
26
+ } from "./chunk-WYNPWHXB.js";
27
27
  import {
28
28
  getDangerLevel,
29
29
  isFileWriteTool,
@@ -39,14 +39,14 @@ import {
39
39
  } from "./chunk-4BKXL7SM.js";
40
40
  import {
41
41
  runTestsTool
42
- } from "./chunk-6IAVHU3I.js";
42
+ } from "./chunk-XK22CVID.js";
43
43
  import {
44
44
  CONFIG_DIR_NAME,
45
45
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
46
46
  SUBAGENT_ALLOWED_TOOLS,
47
47
  SUBAGENT_DEFAULT_MAX_ROUNDS,
48
48
  SUBAGENT_MAX_ROUNDS_LIMIT
49
- } from "./chunk-B7KTFHK2.js";
49
+ } from "./chunk-YQUBYTDR.js";
50
50
  import {
51
51
  loadChatIndex,
52
52
  searchChatMemory
@@ -56,11 +56,12 @@ import {
56
56
  } from "./chunk-IW3Q7AE5.js";
57
57
 
58
58
  // src/tools/shell-pool.ts
59
- import { spawn } from "child_process";
59
+ import { spawn as spawn2 } from "child_process";
60
60
  import { platform as platform2 } from "os";
61
61
 
62
62
  // src/tools/win-shell.ts
63
63
  import { platform } from "os";
64
+ import { spawn } from "child_process";
64
65
  var IS_WINDOWS = platform() === "win32";
65
66
  var WIN_UTF8_PREAMBLE = "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = [System.Text.Encoding]::UTF8; ";
66
67
  function shellInvocation(command) {
@@ -81,6 +82,47 @@ function decodeWindowsBuffer(buf) {
81
82
  return utf8;
82
83
  }
83
84
  }
85
+ function killProcessTree(proc) {
86
+ if (proc.killed || proc.exitCode !== null) return;
87
+ if (IS_WINDOWS && proc.pid) {
88
+ try {
89
+ const tk = spawn("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
90
+ windowsHide: true,
91
+ stdio: "ignore"
92
+ });
93
+ tk.on("exit", () => {
94
+ try {
95
+ proc.kill();
96
+ } catch {
97
+ }
98
+ });
99
+ tk.on("error", () => {
100
+ try {
101
+ proc.kill();
102
+ } catch {
103
+ }
104
+ });
105
+ } catch {
106
+ try {
107
+ proc.kill();
108
+ } catch {
109
+ }
110
+ }
111
+ return;
112
+ }
113
+ try {
114
+ proc.kill("SIGTERM");
115
+ } catch {
116
+ }
117
+ setTimeout(() => {
118
+ if (!proc.killed && proc.exitCode === null) {
119
+ try {
120
+ proc.kill("SIGKILL");
121
+ } catch {
122
+ }
123
+ }
124
+ }, 500).unref();
125
+ }
84
126
 
85
127
  // src/tools/shell-pool.ts
86
128
  var IS_WINDOWS2 = platform2() === "win32";
@@ -90,7 +132,7 @@ var IDLE_EVICT_MS = 5 * 6e4;
90
132
  var evictionTimer = null;
91
133
  function spawnShell(cwd) {
92
134
  const shellArgs = IS_WINDOWS2 ? ["-NoProfile", "-NonInteractive", "-Command", "-"] : ["-s"];
93
- const proc = spawn(SHELL, shellArgs, {
135
+ const proc = spawn2(SHELL, shellArgs, {
94
136
  cwd,
95
137
  windowsHide: true,
96
138
  stdio: ["pipe", "pipe", "pipe"]
@@ -171,10 +213,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
171
213
  stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
172
214
  cleanup();
173
215
  resolve7({ stdout, stderr, exitCode: null, timedOut, aborted });
174
- try {
175
- proc.kill();
176
- } catch {
177
- }
216
+ killProcessTree(proc);
178
217
  pool.delete(sessionKey);
179
218
  }, timeout);
180
219
  const onAbort = () => {
@@ -184,10 +223,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
184
223
  cleanup();
185
224
  stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
186
225
  resolve7({ stdout, stderr, exitCode: null, timedOut, aborted });
187
- try {
188
- proc.kill();
189
- } catch {
190
- }
226
+ killProcessTree(proc);
191
227
  pool.delete(sessionKey);
192
228
  };
193
229
  if (abortSignal?.aborted) {
@@ -277,7 +313,7 @@ function cleanupAllSessions() {
277
313
  }
278
314
 
279
315
  // src/tools/builtin/bash.ts
280
- import { spawn as spawn2 } from "child_process";
316
+ import { spawn as spawn3 } from "child_process";
281
317
  import { existsSync as existsSync2, readdirSync, statSync } from "fs";
282
318
  import { platform as platform3 } from "os";
283
319
  import { resolve } from "path";
@@ -560,7 +596,7 @@ Important rules:
560
596
  }
561
597
  if (timedOut) {
562
598
  pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
563
- throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT));
599
+ throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT, command));
564
600
  }
565
601
  if (status !== 0 || timedOut) {
566
602
  const poolStdout = (stdout ?? "").trim();
@@ -623,7 +659,7 @@ ${combined || formatFailureFallback(status)}
623
659
  const execErr = err;
624
660
  const isTimeout = execErr.code === "ETIMEDOUT" || execErr.status == null && execErr.signal === "SIGTERM" || /ETIMEDOUT/i.test(execErr.message ?? "");
625
661
  if (isTimeout) {
626
- throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT));
662
+ throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT, command));
627
663
  }
628
664
  if ("status" in execErr && execErr.status !== void 0) {
629
665
  const stderr = IS_WINDOWS3 && Buffer.isBuffer(execErr.stderr) ? decodeWindowsBuffer(execErr.stderr).trim() : execErr.stderr?.toString().trim() ?? "";
@@ -648,11 +684,24 @@ ${combined || execErr.message || formatFailureFallback(execErr.status)}
648
684
  function formatFailureHeader(status) {
649
685
  return typeof status === "number" ? `Exit code ${status}:` : "Command failed before exit code could be determined:";
650
686
  }
651
- function formatTimeoutMessage(timeout, maxTimeout) {
687
+ function looksLikeTestCommand(command) {
688
+ return (
689
+ // jest / vitest / mocha / pytest(可带 npx/yarn/pnpm 前缀,或跟在 cd xxx; 之后)
690
+ /(?:^|[;&|(\s])(?:npx\s+|yarn\s+(?:run\s+)?|pnpm\s+(?:run\s+|exec\s+)?)?(?:jest|vitest|mocha|pytest)\b/.test(command) || // npm test / npm run test:xxx / yarn test / pnpm test
691
+ /(?:^|[;&|(\s])(?:npm|yarn|pnpm)\s+(?:run\s+)?test\b/.test(command) || // go test / cargo test
692
+ /(?:^|[;&|(\s])(?:go|cargo)\s+test\b/.test(command)
693
+ );
694
+ }
695
+ function formatTimeoutMessage(timeout, maxTimeout, command) {
652
696
  const seconds = Math.round(timeout / 1e3);
697
+ const testRunnerHint = command !== void 0 && looksLikeTestCommand(command) ? [
698
+ "This looks like a TEST run. Prefer the 'run_tests' tool instead of running the test runner through bash: it has a 5-minute timeout, auto-detects the framework, and returns a structured summary (no findstr/grep filtering needed).",
699
+ ""
700
+ ] : [];
653
701
  return [
654
702
  `Command timed out after ${seconds}s.`,
655
703
  "",
704
+ ...testRunnerHint,
656
705
  "The previous command ran for longer than the timeout limit and was killed. This usually means it is scanning a large filesystem tree (recursive Get-ChildItem / find), compressing a big archive, or waiting on a network request.",
657
706
  "",
658
707
  "How to recover (pick ONE \u2014 do NOT retry the same command):",
@@ -660,6 +709,7 @@ function formatTimeoutMessage(timeout, maxTimeout) {
660
709
  " 2. Use a non-recursive / narrower alternative (e.g. 'Get-ChildItem -File' without -Recurse, or limit depth with -Depth 1)",
661
710
  " 3. Split the work into smaller batches (process subdirectories one at a time)",
662
711
  " 4. For size/count queries, use '(Get-ChildItem X).Count' per directory instead of one giant pipeline",
712
+ " 5. If this was 'git add'/'git commit' in a fresh project: a huge directory (node_modules, build output) is likely being staged \u2014 write a .gitignore excluding it FIRST, then retry. Also check for a stale '.git/index.lock' left behind by the killed git process and delete it if present.",
663
713
  "",
664
714
  "[Do NOT retry the identical command \u2014 it will time out again.]"
665
715
  ].join(String.fromCharCode(10));
@@ -831,7 +881,7 @@ function pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, cwd) {
831
881
  function runShell(command, opts) {
832
882
  return new Promise((resolvePromise) => {
833
883
  const shellArgs = IS_WINDOWS3 ? ["-NoProfile", "-NonInteractive", "-Command", WIN_UTF8_PREAMBLE + command] : ["-c", command];
834
- const child = spawn2(SHELL2, shellArgs, {
884
+ const child = spawn3(SHELL2, shellArgs, {
835
885
  cwd: opts.cwd,
836
886
  env: opts.env,
837
887
  windowsHide: true,
@@ -892,33 +942,7 @@ function runShell(command, opts) {
892
942
  });
893
943
  }
894
944
  function killChild(child) {
895
- if (child.killed || child.exitCode !== null) return;
896
- if (IS_WINDOWS3 && child.pid) {
897
- try {
898
- spawn2("taskkill", ["/PID", String(child.pid), "/T", "/F"], {
899
- windowsHide: true,
900
- stdio: "ignore"
901
- });
902
- } catch {
903
- }
904
- try {
905
- child.kill();
906
- } catch {
907
- }
908
- return;
909
- }
910
- try {
911
- child.kill("SIGTERM");
912
- } catch {
913
- }
914
- setTimeout(() => {
915
- if (!child.killed && child.exitCode === null) {
916
- try {
917
- child.kill("SIGKILL");
918
- } catch {
919
- }
920
- }
921
- }, 500).unref();
945
+ killProcessTree(child);
922
946
  }
923
947
  function updateCwdFromCommand(command, baseCwd) {
924
948
  const cdMatches = [...command.matchAll(/(?:^|[;&|])\s*cd\s+(['"]?)([^\s;&|'"]+)\1/g)];
@@ -3925,7 +3949,7 @@ function collectMatchingFiles(dirPath, rootPath, regex, results, maxResults) {
3925
3949
  }
3926
3950
 
3927
3951
  // src/tools/builtin/run-interactive.ts
3928
- import { spawn as spawn3 } from "child_process";
3952
+ import { spawn as spawn4 } from "child_process";
3929
3953
  import { platform as platform4 } from "os";
3930
3954
  var IS_WINDOWS4 = platform4() === "win32";
3931
3955
  var runInteractiveTool = {
@@ -3989,7 +4013,7 @@ var runInteractiveTool = {
3989
4013
  };
3990
4014
  const prefixWarnings = [argsTypeWarning, stdinTypeWarning].filter(Boolean).join("");
3991
4015
  return new Promise((resolve7) => {
3992
- const child = spawn3(executable, cmdArgs.map(String), {
4016
+ const child = spawn4(executable, cmdArgs.map(String), {
3993
4017
  cwd: process.cwd(),
3994
4018
  env,
3995
4019
  stdio: ["pipe", "pipe", "pipe"]
@@ -5712,7 +5736,7 @@ var spawnAgentTool = {
5712
5736
  };
5713
5737
 
5714
5738
  // src/tools/builtin/task-manager.ts
5715
- import { spawn as spawn4 } from "child_process";
5739
+ import { spawn as spawn5 } from "child_process";
5716
5740
  import { randomUUID } from "crypto";
5717
5741
  import { platform as platform5 } from "os";
5718
5742
  var MAX_OUTPUT_CHARS = 1e4;
@@ -5748,7 +5772,7 @@ function createTask(command, description) {
5748
5772
  }
5749
5773
  const id = randomUUID().slice(0, 8);
5750
5774
  const { shell, args } = shellInvocation(command);
5751
- const proc = spawn4(shell, args, {
5775
+ const proc = spawn5(shell, args, {
5752
5776
  stdio: ["ignore", "pipe", "pipe"],
5753
5777
  detached: false,
5754
5778
  env: { ...process.env, PYTHONUTF8: "1", PYTHONIOENCODING: "utf-8" }
@@ -5800,7 +5824,7 @@ function stopTask(id) {
5800
5824
  const proc = task.process;
5801
5825
  if (platform5() === "win32" && proc.pid) {
5802
5826
  try {
5803
- spawn4("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
5827
+ spawn5("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
5804
5828
  windowsHide: true,
5805
5829
  stdio: "ignore"
5806
5830
  });
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-WF7FD7WS.js";
4
+ } from "./chunk-GQYRPBIQ.js";
5
5
  import {
6
6
  APP_NAME,
7
7
  CONFIG_DIR_NAME,
@@ -11,7 +11,7 @@ import {
11
11
  MCP_PROTOCOL_VERSION,
12
12
  MCP_TOOL_PREFIX,
13
13
  VERSION
14
- } from "./chunk-B7KTFHK2.js";
14
+ } from "./chunk-YQUBYTDR.js";
15
15
  import {
16
16
  atomicWriteFileSync
17
17
  } from "./chunk-IW3Q7AE5.js";
@@ -1,5 +1,5 @@
1
1
  // src/core/constants.ts
2
- var VERSION = "0.4.244";
2
+ var VERSION = "0.4.246";
3
3
  var APP_NAME = "ai-cli";
4
4
  var CONFIG_DIR_NAME = ".aicli";
5
5
  var CONFIG_FILE_NAME = "config.json";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-B7KTFHK2.js";
11
+ } from "./chunk-YQUBYTDR.js";
12
12
  import {
13
13
  atomicWriteFileSync
14
14
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-B7KTFHK2.js";
4
+ } from "./chunk-YQUBYTDR.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
  TEST_TIMEOUT
3
- } from "./chunk-ZQGCX4QD.js";
3
+ } from "./chunk-LZGPGPA6.js";
4
4
 
5
5
  // src/tools/builtin/run-tests.ts
6
6
  import { execSync, spawnSync } from "child_process";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  PLUGINS_DIR_NAME
5
- } from "./chunk-B7KTFHK2.js";
5
+ } from "./chunk-YQUBYTDR.js";
6
6
  import {
7
7
  atomicWriteFileSync
8
8
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-B7KTFHK2.js";
4
+ } from "./chunk-YQUBYTDR.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.244";
4
+ var VERSION = "0.4.246";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -6,7 +6,7 @@ import {
6
6
  MEMORY_FILE_NAME,
7
7
  MEMORY_MAX_CHARS,
8
8
  MEMORY_STORE_FILE_NAME
9
- } from "./chunk-B7KTFHK2.js";
9
+ } from "./chunk-YQUBYTDR.js";
10
10
  import {
11
11
  DEFAULT_PATTERNS,
12
12
  redactString
@@ -3,14 +3,14 @@ import {
3
3
  CI_COMMENT_MARKER,
4
4
  countSeverity,
5
5
  runCi
6
- } from "./chunk-P6AUULT2.js";
7
- import "./chunk-XZI4ULXF.js";
6
+ } from "./chunk-6Y42RN5H.js";
7
+ import "./chunk-P2LB6S4I.js";
8
8
  import "./chunk-HLWUDRBO.js";
9
9
  import "./chunk-QYQI7ZWK.js";
10
- import "./chunk-ACU6T7B3.js";
10
+ import "./chunk-OMSOAFXY.js";
11
11
  import "./chunk-O3XSFPYH.js";
12
12
  import "./chunk-5ULLIOVC.js";
13
- import "./chunk-B7KTFHK2.js";
13
+ import "./chunk-YQUBYTDR.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
  export {
16
16
  CI_COMMENT_MARKER,
@@ -6,8 +6,8 @@ import {
6
6
  formatCiResult,
7
7
  formatCiSarif,
8
8
  normalizeCiThresholds
9
- } from "./chunk-XZI4ULXF.js";
10
- import "./chunk-B7KTFHK2.js";
9
+ } from "./chunk-P2LB6S4I.js";
10
+ import "./chunk-YQUBYTDR.js";
11
11
  export {
12
12
  DEFAULT_CI_THRESHOLDS,
13
13
  detectCiGateSignals,
@@ -38,7 +38,7 @@ import {
38
38
  TEST_TIMEOUT,
39
39
  VERSION,
40
40
  buildUserIdentityPrompt
41
- } from "./chunk-B7KTFHK2.js";
41
+ } from "./chunk-YQUBYTDR.js";
42
42
  export {
43
43
  AGENTIC_BEHAVIOR_GUIDELINE,
44
44
  APP_NAME,
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  formatDoctorReport,
4
4
  runDoctorCli
5
- } from "./chunk-HN4FU37T.js";
5
+ } from "./chunk-DJDEXHOT.js";
6
6
  import "./chunk-QYQI7ZWK.js";
7
- import "./chunk-ACU6T7B3.js";
8
- import "./chunk-BO5UU3TY.js";
7
+ import "./chunk-OMSOAFXY.js";
8
+ import "./chunk-WYNPWHXB.js";
9
9
  import "./chunk-O3XSFPYH.js";
10
10
  import "./chunk-5ULLIOVC.js";
11
11
  import "./chunk-HOSJZMQS.js";
12
- import "./chunk-B7KTFHK2.js";
12
+ import "./chunk-YQUBYTDR.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
14
  export {
15
15
  formatDoctorReport,
@@ -34,14 +34,14 @@ import {
34
34
  touchMemoryReferences,
35
35
  updateMemoryApproval,
36
36
  updateMemoryEntry
37
- } from "./chunk-M7XY5AK5.js";
37
+ } from "./chunk-CJ3BPLHZ.js";
38
38
  import {
39
39
  redactJson,
40
40
  scanString
41
41
  } from "./chunk-YVTASHS5.js";
42
42
  import {
43
43
  runTestsTool
44
- } from "./chunk-MCC5BEZG.js";
44
+ } from "./chunk-USJF35NB.js";
45
45
  import {
46
46
  AGENTIC_BEHAVIOR_GUIDELINE,
47
47
  APP_NAME,
@@ -73,7 +73,7 @@ import {
73
73
  SUBAGENT_MAX_ROUNDS_LIMIT,
74
74
  VERSION,
75
75
  buildUserIdentityPrompt
76
- } from "./chunk-ZQGCX4QD.js";
76
+ } from "./chunk-LZGPGPA6.js";
77
77
  import {
78
78
  hasSemanticIndex,
79
79
  semanticSearch
@@ -4732,7 +4732,7 @@ var SessionManager = class {
4732
4732
  };
4733
4733
 
4734
4734
  // src/tools/builtin/bash.ts
4735
- import { spawn as spawn2 } from "child_process";
4735
+ import { spawn as spawn3 } from "child_process";
4736
4736
  import { existsSync as existsSync5, readdirSync as readdirSync2, statSync as statSync2 } from "fs";
4737
4737
  import { platform as platform3 } from "os";
4738
4738
  import { resolve } from "path";
@@ -4874,6 +4874,7 @@ function runWithSessionKey(sessionKey, fn) {
4874
4874
 
4875
4875
  // src/tools/win-shell.ts
4876
4876
  import { platform } from "os";
4877
+ import { spawn } from "child_process";
4877
4878
  var IS_WINDOWS = platform() === "win32";
4878
4879
  var WIN_UTF8_PREAMBLE = "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = [System.Text.Encoding]::UTF8; ";
4879
4880
  function shellInvocation(command) {
@@ -4894,9 +4895,50 @@ function decodeWindowsBuffer(buf) {
4894
4895
  return utf8;
4895
4896
  }
4896
4897
  }
4898
+ function killProcessTree(proc) {
4899
+ if (proc.killed || proc.exitCode !== null) return;
4900
+ if (IS_WINDOWS && proc.pid) {
4901
+ try {
4902
+ const tk = spawn("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
4903
+ windowsHide: true,
4904
+ stdio: "ignore"
4905
+ });
4906
+ tk.on("exit", () => {
4907
+ try {
4908
+ proc.kill();
4909
+ } catch {
4910
+ }
4911
+ });
4912
+ tk.on("error", () => {
4913
+ try {
4914
+ proc.kill();
4915
+ } catch {
4916
+ }
4917
+ });
4918
+ } catch {
4919
+ try {
4920
+ proc.kill();
4921
+ } catch {
4922
+ }
4923
+ }
4924
+ return;
4925
+ }
4926
+ try {
4927
+ proc.kill("SIGTERM");
4928
+ } catch {
4929
+ }
4930
+ setTimeout(() => {
4931
+ if (!proc.killed && proc.exitCode === null) {
4932
+ try {
4933
+ proc.kill("SIGKILL");
4934
+ } catch {
4935
+ }
4936
+ }
4937
+ }, 500).unref();
4938
+ }
4897
4939
 
4898
4940
  // src/tools/shell-pool.ts
4899
- import { spawn } from "child_process";
4941
+ import { spawn as spawn2 } from "child_process";
4900
4942
  import { platform as platform2 } from "os";
4901
4943
  var IS_WINDOWS2 = platform2() === "win32";
4902
4944
  var SHELL = IS_WINDOWS2 ? "powershell.exe" : process.env["SHELL"] ?? "/bin/bash";
@@ -4905,7 +4947,7 @@ var IDLE_EVICT_MS = 5 * 6e4;
4905
4947
  var evictionTimer = null;
4906
4948
  function spawnShell(cwd) {
4907
4949
  const shellArgs = IS_WINDOWS2 ? ["-NoProfile", "-NonInteractive", "-Command", "-"] : ["-s"];
4908
- const proc = spawn(SHELL, shellArgs, {
4950
+ const proc = spawn2(SHELL, shellArgs, {
4909
4951
  cwd,
4910
4952
  windowsHide: true,
4911
4953
  stdio: ["pipe", "pipe", "pipe"]
@@ -4986,10 +5028,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
4986
5028
  stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
4987
5029
  cleanup();
4988
5030
  resolve13({ stdout, stderr, exitCode: null, timedOut, aborted });
4989
- try {
4990
- proc.kill();
4991
- } catch {
4992
- }
5031
+ killProcessTree(proc);
4993
5032
  pool.delete(sessionKey);
4994
5033
  }, timeout);
4995
5034
  const onAbort = () => {
@@ -4999,10 +5038,7 @@ async function execInPool(sessionKey, command, timeout, cwd, abortSignal) {
4999
5038
  cleanup();
5000
5039
  stdout = stripMarkerOutput(stdout, markerStartPattern, markerEndPattern);
5001
5040
  resolve13({ stdout, stderr, exitCode: null, timedOut, aborted });
5002
- try {
5003
- proc.kill();
5004
- } catch {
5005
- }
5041
+ killProcessTree(proc);
5006
5042
  pool.delete(sessionKey);
5007
5043
  };
5008
5044
  if (abortSignal?.aborted) {
@@ -5207,7 +5243,7 @@ Important rules:
5207
5243
  }
5208
5244
  if (timedOut) {
5209
5245
  pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, effectiveCwd);
5210
- throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT));
5246
+ throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT, command));
5211
5247
  }
5212
5248
  if (status !== 0 || timedOut) {
5213
5249
  const poolStdout = (stdout ?? "").trim();
@@ -5270,7 +5306,7 @@ ${combined || formatFailureFallback(status)}
5270
5306
  const execErr = err;
5271
5307
  const isTimeout = execErr.code === "ETIMEDOUT" || execErr.status == null && execErr.signal === "SIGTERM" || /ETIMEDOUT/i.test(execErr.message ?? "");
5272
5308
  if (isTimeout) {
5273
- throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT));
5309
+ throw new ToolError("bash", formatTimeoutMessage(timeout, MAX_TIMEOUT, command));
5274
5310
  }
5275
5311
  if ("status" in execErr && execErr.status !== void 0) {
5276
5312
  const stderr = IS_WINDOWS3 && Buffer.isBuffer(execErr.stderr) ? decodeWindowsBuffer(execErr.stderr).trim() : execErr.stderr?.toString().trim() ?? "";
@@ -5295,11 +5331,24 @@ ${combined || execErr.message || formatFailureFallback(execErr.status)}
5295
5331
  function formatFailureHeader(status) {
5296
5332
  return typeof status === "number" ? `Exit code ${status}:` : "Command failed before exit code could be determined:";
5297
5333
  }
5298
- function formatTimeoutMessage(timeout, maxTimeout) {
5334
+ function looksLikeTestCommand(command) {
5335
+ return (
5336
+ // jest / vitest / mocha / pytest(可带 npx/yarn/pnpm 前缀,或跟在 cd xxx; 之后)
5337
+ /(?:^|[;&|(\s])(?:npx\s+|yarn\s+(?:run\s+)?|pnpm\s+(?:run\s+|exec\s+)?)?(?:jest|vitest|mocha|pytest)\b/.test(command) || // npm test / npm run test:xxx / yarn test / pnpm test
5338
+ /(?:^|[;&|(\s])(?:npm|yarn|pnpm)\s+(?:run\s+)?test\b/.test(command) || // go test / cargo test
5339
+ /(?:^|[;&|(\s])(?:go|cargo)\s+test\b/.test(command)
5340
+ );
5341
+ }
5342
+ function formatTimeoutMessage(timeout, maxTimeout, command) {
5299
5343
  const seconds = Math.round(timeout / 1e3);
5344
+ const testRunnerHint = command !== void 0 && looksLikeTestCommand(command) ? [
5345
+ "This looks like a TEST run. Prefer the 'run_tests' tool instead of running the test runner through bash: it has a 5-minute timeout, auto-detects the framework, and returns a structured summary (no findstr/grep filtering needed).",
5346
+ ""
5347
+ ] : [];
5300
5348
  return [
5301
5349
  `Command timed out after ${seconds}s.`,
5302
5350
  "",
5351
+ ...testRunnerHint,
5303
5352
  "The previous command ran for longer than the timeout limit and was killed. This usually means it is scanning a large filesystem tree (recursive Get-ChildItem / find), compressing a big archive, or waiting on a network request.",
5304
5353
  "",
5305
5354
  "How to recover (pick ONE \u2014 do NOT retry the same command):",
@@ -5307,6 +5356,7 @@ function formatTimeoutMessage(timeout, maxTimeout) {
5307
5356
  " 2. Use a non-recursive / narrower alternative (e.g. 'Get-ChildItem -File' without -Recurse, or limit depth with -Depth 1)",
5308
5357
  " 3. Split the work into smaller batches (process subdirectories one at a time)",
5309
5358
  " 4. For size/count queries, use '(Get-ChildItem X).Count' per directory instead of one giant pipeline",
5359
+ " 5. If this was 'git add'/'git commit' in a fresh project: a huge directory (node_modules, build output) is likely being staged \u2014 write a .gitignore excluding it FIRST, then retry. Also check for a stale '.git/index.lock' left behind by the killed git process and delete it if present.",
5310
5360
  "",
5311
5361
  "[Do NOT retry the identical command \u2014 it will time out again.]"
5312
5362
  ].join(String.fromCharCode(10));
@@ -5478,7 +5528,7 @@ function pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, cwd) {
5478
5528
  function runShell(command, opts) {
5479
5529
  return new Promise((resolvePromise) => {
5480
5530
  const shellArgs = IS_WINDOWS3 ? ["-NoProfile", "-NonInteractive", "-Command", WIN_UTF8_PREAMBLE + command] : ["-c", command];
5481
- const child = spawn2(SHELL2, shellArgs, {
5531
+ const child = spawn3(SHELL2, shellArgs, {
5482
5532
  cwd: opts.cwd,
5483
5533
  env: opts.env,
5484
5534
  windowsHide: true,
@@ -5539,33 +5589,7 @@ function runShell(command, opts) {
5539
5589
  });
5540
5590
  }
5541
5591
  function killChild(child) {
5542
- if (child.killed || child.exitCode !== null) return;
5543
- if (IS_WINDOWS3 && child.pid) {
5544
- try {
5545
- spawn2("taskkill", ["/PID", String(child.pid), "/T", "/F"], {
5546
- windowsHide: true,
5547
- stdio: "ignore"
5548
- });
5549
- } catch {
5550
- }
5551
- try {
5552
- child.kill();
5553
- } catch {
5554
- }
5555
- return;
5556
- }
5557
- try {
5558
- child.kill("SIGTERM");
5559
- } catch {
5560
- }
5561
- setTimeout(() => {
5562
- if (!child.killed && child.exitCode === null) {
5563
- try {
5564
- child.kill("SIGKILL");
5565
- } catch {
5566
- }
5567
- }
5568
- }, 500).unref();
5592
+ killProcessTree(child);
5569
5593
  }
5570
5594
  function updateCwdFromCommand(command, baseCwd) {
5571
5595
  const cdMatches = [...command.matchAll(/(?:^|[;&|])\s*cd\s+(['"]?)([^\s;&|'"]+)\1/g)];
@@ -8797,7 +8821,7 @@ function collectMatchingFiles(dirPath, rootPath, regex, results, maxResults) {
8797
8821
  }
8798
8822
 
8799
8823
  // src/tools/builtin/run-interactive.ts
8800
- import { spawn as spawn3 } from "child_process";
8824
+ import { spawn as spawn4 } from "child_process";
8801
8825
  import { platform as platform4 } from "os";
8802
8826
  var IS_WINDOWS4 = platform4() === "win32";
8803
8827
  var runInteractiveTool = {
@@ -8861,7 +8885,7 @@ var runInteractiveTool = {
8861
8885
  };
8862
8886
  const prefixWarnings = [argsTypeWarning, stdinTypeWarning].filter(Boolean).join("");
8863
8887
  return new Promise((resolve13) => {
8864
- const child = spawn3(executable, cmdArgs.map(String), {
8888
+ const child = spawn4(executable, cmdArgs.map(String), {
8865
8889
  cwd: process.cwd(),
8866
8890
  env,
8867
8891
  stdio: ["pipe", "pipe", "pipe"]
@@ -10964,7 +10988,7 @@ var spawnAgentTool = {
10964
10988
  };
10965
10989
 
10966
10990
  // src/tools/builtin/task-manager.ts
10967
- import { spawn as spawn4 } from "child_process";
10991
+ import { spawn as spawn5 } from "child_process";
10968
10992
  import { randomUUID } from "crypto";
10969
10993
  import { platform as platform5 } from "os";
10970
10994
  var MAX_OUTPUT_CHARS = 1e4;
@@ -11000,7 +11024,7 @@ function createTask(command, description) {
11000
11024
  }
11001
11025
  const id = randomUUID().slice(0, 8);
11002
11026
  const { shell, args } = shellInvocation(command);
11003
- const proc = spawn4(shell, args, {
11027
+ const proc = spawn5(shell, args, {
11004
11028
  stdio: ["ignore", "pipe", "pipe"],
11005
11029
  detached: false,
11006
11030
  env: { ...process.env, PYTHONUTF8: "1", PYTHONIOENCODING: "utf-8" }
@@ -11052,7 +11076,7 @@ function stopTask(id) {
11052
11076
  const proc = task.process;
11053
11077
  if (platform5() === "win32" && proc.pid) {
11054
11078
  try {
11055
- spawn4("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
11079
+ spawn5("taskkill", ["/PID", String(proc.pid), "/T", "/F"], {
11056
11080
  windowsHide: true,
11057
11081
  stdio: "ignore"
11058
11082
  });
@@ -12162,7 +12186,7 @@ var ToolRegistry = class {
12162
12186
  };
12163
12187
 
12164
12188
  // src/mcp/client.ts
12165
- import { spawn as spawn5 } from "child_process";
12189
+ import { spawn as spawn6 } from "child_process";
12166
12190
  var McpClient = class {
12167
12191
  serverId;
12168
12192
  config;
@@ -12200,7 +12224,7 @@ var McpClient = class {
12200
12224
  async connect() {
12201
12225
  const timeout = this.config.timeout ?? MCP_CONNECT_TIMEOUT;
12202
12226
  try {
12203
- this.process = spawn5(this.config.command, this.config.args ?? [], {
12227
+ this.process = spawn6(this.config.command, this.config.args ?? [], {
12204
12228
  stdio: ["pipe", "pipe", "pipe"],
12205
12229
  env: { ...process.env, ...this.config.env },
12206
12230
  // Windows 上 npx 等是 .cmd 脚本,需要 shell 模式
@@ -15089,7 +15113,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
15089
15113
  Cost: ${formatCost(cost)}` : "";
15090
15114
  let memoryLine = "";
15091
15115
  try {
15092
- const { countPendingMemories } = await import("./persistent-memory-OWXDBSZY.js");
15116
+ const { countPendingMemories } = await import("./persistent-memory-EKZ2JF7M.js");
15093
15117
  const pending = countPendingMemories(ctx.config.getConfigDir());
15094
15118
  if (pending > 0) memoryLine = `
15095
15119
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -15898,7 +15922,7 @@ async function handleSecurityReview(args, ctx) {
15898
15922
  async function handleTest(args, ctx) {
15899
15923
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
15900
15924
  try {
15901
- const { executeTests } = await import("./run-tests-EFWAH43I.js");
15925
+ const { executeTests } = await import("./run-tests-ZKHXKCQB.js");
15902
15926
  const argStr = args.join(" ").trim();
15903
15927
  let testArgs = {};
15904
15928
  if (argStr) {
@@ -16162,7 +16186,7 @@ async function handleMemory(args, ctx) {
16162
16186
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
16163
16187
  } else if (sub === "export") {
16164
16188
  if (args[1] === "md") {
16165
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-OWXDBSZY.js");
16189
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-EKZ2JF7M.js");
16166
16190
  ctx.send({
16167
16191
  type: "export_data",
16168
16192
  format: "md",
@@ -18999,13 +19023,13 @@ function parseCookie(cookie) {
18999
19023
  }
19000
19024
  async function openBrowser(url) {
19001
19025
  try {
19002
- const { spawn: spawn6 } = await import("child_process");
19026
+ const { spawn: spawn7 } = await import("child_process");
19003
19027
  if (process.platform === "win32") {
19004
- spawn6("cmd", ["/c", "start", '""', url], { detached: true, stdio: "ignore" }).unref();
19028
+ spawn7("cmd", ["/c", "start", '""', url], { detached: true, stdio: "ignore" }).unref();
19005
19029
  } else if (process.platform === "darwin") {
19006
- spawn6("open", [url], { detached: true, stdio: "ignore" }).unref();
19030
+ spawn7("open", [url], { detached: true, stdio: "ignore" }).unref();
19007
19031
  } else {
19008
- spawn6("xdg-open", [url], { detached: true, stdio: "ignore" }).unref();
19032
+ spawn7("xdg-open", [url], { detached: true, stdio: "ignore" }).unref();
19009
19033
  }
19010
19034
  } catch {
19011
19035
  }
@@ -154,7 +154,7 @@ ${content}`);
154
154
  }
155
155
  }
156
156
  async function runTaskMode(config, providers, configManager, topic) {
157
- const { TaskOrchestrator } = await import("./task-orchestrator-KHJYQXWU.js");
157
+ const { TaskOrchestrator } = await import("./task-orchestrator-FMCI4RPX.js");
158
158
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
159
159
  let interrupted = false;
160
160
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  scanProject,
18
18
  sessionHasMeaningfulContent,
19
19
  setupProxy
20
- } from "./chunk-OYFDGRYD.js";
20
+ } from "./chunk-LEKOBVOQ.js";
21
21
  import {
22
22
  computeCost,
23
23
  formatCost,
@@ -50,7 +50,7 @@ import {
50
50
  spawnAgentContext,
51
51
  theme,
52
52
  undoStack
53
- } from "./chunk-WF7FD7WS.js";
53
+ } from "./chunk-GQYRPBIQ.js";
54
54
  import {
55
55
  addMemoryEntry,
56
56
  backupMemoryStore,
@@ -76,7 +76,7 @@ import {
76
76
  touchMemoryReferences,
77
77
  updateMemoryApproval,
78
78
  updateMemoryEntry
79
- } from "./chunk-BKTCOL5D.js";
79
+ } from "./chunk-Z7JROM3J.js";
80
80
  import "./chunk-K3CF65QH.js";
81
81
  import "./chunk-UUSRWSSX.js";
82
82
  import "./chunk-CKH4KQ4E.js";
@@ -90,13 +90,13 @@ import {
90
90
  formatDoctorReport,
91
91
  loadContextFiles,
92
92
  writeCrashLog
93
- } from "./chunk-HN4FU37T.js";
93
+ } from "./chunk-DJDEXHOT.js";
94
94
  import {
95
95
  ProviderRegistry
96
96
  } from "./chunk-QYQI7ZWK.js";
97
97
  import {
98
98
  ConfigManager
99
- } from "./chunk-ACU6T7B3.js";
99
+ } from "./chunk-OMSOAFXY.js";
100
100
  import {
101
101
  describePlugin,
102
102
  getActivePluginAssets,
@@ -113,7 +113,7 @@ import {
113
113
  trustHook,
114
114
  trustPlugin,
115
115
  untrustHook
116
- } from "./chunk-BO5UU3TY.js";
116
+ } from "./chunk-WYNPWHXB.js";
117
117
  import {
118
118
  CONTENT_ONLY_STREAM_REMINDER,
119
119
  TEE_FINAL_USER_NUDGE,
@@ -146,7 +146,7 @@ import {
146
146
  import {
147
147
  fileCheckpoints
148
148
  } from "./chunk-4BKXL7SM.js";
149
- import "./chunk-6IAVHU3I.js";
149
+ import "./chunk-XK22CVID.js";
150
150
  import {
151
151
  AGENTIC_BEHAVIOR_GUIDELINE,
152
152
  AUTHOR,
@@ -165,7 +165,7 @@ import {
165
165
  SKILLS_DIR_NAME,
166
166
  VERSION,
167
167
  buildUserIdentityPrompt
168
- } from "./chunk-B7KTFHK2.js";
168
+ } from "./chunk-YQUBYTDR.js";
169
169
  import {
170
170
  buildChatIndex,
171
171
  clearChatIndex,
@@ -1387,7 +1387,7 @@ No tools match "${filter}".
1387
1387
  const { join: join6 } = await import("path");
1388
1388
  const { existsSync: existsSync5 } = await import("fs");
1389
1389
  const { getGitRoot: getGitRoot2 } = await import("./git-context-EXOEHQSF.js");
1390
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-OQ6FVQ23.js");
1390
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-J4OLBH72.js");
1391
1391
  const { approveProject, hashMcpFile } = await import("./project-trust-NKYHL3VZ.js");
1392
1392
  const cwd = process.cwd();
1393
1393
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2366,7 +2366,7 @@ function createReviewCommands() {
2366
2366
  usage: "/test [command|filter]",
2367
2367
  async execute(args, ctx) {
2368
2368
  try {
2369
- const { executeTests } = await import("./run-tests-XJ44FWIK.js");
2369
+ const { executeTests } = await import("./run-tests-PW4WC4OG.js");
2370
2370
  const argStr = args.join(" ").trim();
2371
2371
  let testArgs = {};
2372
2372
  if (argStr) {
@@ -8014,7 +8014,7 @@ program.command("web").description("Start Web UI server with browser-based chat
8014
8014
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
8015
8015
  process.exit(1);
8016
8016
  }
8017
- const { startWebServer } = await import("./server-6OPGWJ7S.js");
8017
+ const { startWebServer } = await import("./server-D2ID3GYA.js");
8018
8018
  await startWebServer({ port, host: options.host });
8019
8019
  });
8020
8020
  program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | logout-all <name> | migrate <name>)").action(async (action, username) => {
@@ -8181,11 +8181,11 @@ program.command("sessions").description("List recent conversation sessions").opt
8181
8181
  console.log(footer + "\n");
8182
8182
  });
8183
8183
  program.command("usage").description("Show token + cost usage grouped by provider/model (cross-session)").option("--days <n>", "Only the last N days (inclusive of today)").option("--month <ym>", "Only a specific month, format YYYY-MM (e.g. 2026-06)").option("--json", "Output as JSON (for scripting)").action(async (options) => {
8184
- const { runUsageCli } = await import("./usage-NW2ZXN6N.js");
8184
+ const { runUsageCli } = await import("./usage-DPLNMDSJ.js");
8185
8185
  await runUsageCli(options);
8186
8186
  });
8187
8187
  program.command("doctor").description("Health check: API keys, config, MCP, recent crashes, tool usage, disk usage").option("--json", "Output as JSON (for scripting)").option("--reset-stats", "Reset accumulated tool usage statistics").action(async (options) => {
8188
- const { runDoctorCli } = await import("./doctor-cli-LABZF3XG.js");
8188
+ const { runDoctorCli } = await import("./doctor-cli-IR3E3XHB.js");
8189
8189
  const argv = process.argv.slice(2);
8190
8190
  await runDoctorCli({
8191
8191
  json: !!options.json || argv.includes("--json"),
@@ -8194,7 +8194,7 @@ program.command("doctor").description("Health check: API keys, config, MCP, rece
8194
8194
  });
8195
8195
  program.command("batch <action> [arg] [arg2]").description("Anthropic Message Batches: submit | list | status <id> | results <id> [out] | cancel <id>").option("--dry-run", "Parse and validate input without submitting (submit only)").action(async (action, arg, arg2, options) => {
8196
8196
  try {
8197
- const batch = await import("./batch-GLB7ES6K.js");
8197
+ const batch = await import("./batch-AHW7WALD.js");
8198
8198
  switch (action) {
8199
8199
  case "submit":
8200
8200
  if (!arg) {
@@ -8237,7 +8237,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
8237
8237
  }
8238
8238
  });
8239
8239
  program.command("mcp-serve").description("Start an MCP server over STDIO, exposing aicli's built-in tools to Claude Desktop / Cursor / other MCP clients").option("--allow-destructive", "Allow bash / run_interactive / task_create (always destructive in MCP mode)").option("--allow-outside-cwd", "Allow tool path arguments to escape the sandbox root \u2014 disabled by default").option("--tools <list>", "Comma-separated whitelist of tools to expose (default: all eligible tools)").option("--cwd <path>", "Working directory AND sandbox root (default: current directory)").action(async (options) => {
8240
- const { startMcpServer } = await import("./server-B6WJWV3T.js");
8240
+ const { startMcpServer } = await import("./server-3HLBEWNZ.js");
8241
8241
  await startMcpServer({
8242
8242
  allowDestructive: !!options.allowDestructive,
8243
8243
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -8250,7 +8250,7 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8250
8250
  console.error(`Unknown pr action: ${action}. Use review | security-review | summarize.`);
8251
8251
  process.exit(1);
8252
8252
  }
8253
- const { runPrCli } = await import("./pr-HXJ6ML6M.js");
8253
+ const { runPrCli } = await import("./pr-BNS3OHDM.js");
8254
8254
  const result = await runPrCli({
8255
8255
  action,
8256
8256
  target,
@@ -8270,8 +8270,8 @@ program.command("pr <action> [target]").description("PR review helpers: review |
8270
8270
  process.exit(result.exitCode);
8271
8271
  });
8272
8272
  program.command("ci").description("Headless PR review (code + security) \u2014 reads git/gh diff, optionally posts to PR. Designed for GitHub Actions.").option("--pr <num>", "PR number or URL; diff fetched via gh pr diff <value>", (v) => /^#?\d+$/.test(v) ? parseInt(v.replace(/^#/, ""), 10) : v).option("--base <ref>", "Base ref for git diff <ref>...HEAD (ignored when --pr set)").option("--post", "Post review as a PR comment (requires gh CLI + GH_TOKEN, needs --pr)").option("--no-update", "Always create a new comment instead of updating the previous aicli review").option("--skip-code", "Skip the code review section").option("--skip-security", "Skip the security review section").option("--detailed", "Use the detailed code-review prompt").option("--max-diff <n>", "Max diff chars sent to the model (default 30000)", (v) => parseInt(v, 10)).option("--provider <id>", "Override provider (default: config.defaultProvider)").option("--model <id>", "Override model").option("--dry-run", "Print result to stdout instead of posting (overrides --post)").option("--json", "Output a structured JSON report").option("--markdown", "Output Markdown report (default)").option("--sarif", "Output SARIF 2.1.0 for code scanning artifacts").option("--fail-on-security-high", "Fail when the security review contains HIGH/CRITICAL findings (default)").option("--no-fail-on-security-high", "Do not fail on security HIGH/CRITICAL findings").option("--fail-on-test-failure", "Fail when the report mentions test failures (default)").option("--no-fail-on-test-failure", "Do not fail on test failure findings").option("--fail-on-lint-failure", "Fail when the report mentions lint/typecheck failures (default)").option("--no-fail-on-lint-failure", "Do not fail on lint/typecheck failure findings").action(async (options) => {
8273
- const { runCi } = await import("./ci-V7RGDIER.js");
8274
- const { formatCiResult } = await import("./ci-format-HSUEHAM2.js");
8273
+ const { runCi } = await import("./ci-VOGIC6S4.js");
8274
+ const { formatCiResult } = await import("./ci-format-BHCSMT5U.js");
8275
8275
  const formats = [options.json, options.markdown, options.sarif].filter(Boolean).length;
8276
8276
  if (formats > 1) {
8277
8277
  console.error("Choose only one output format: --json, --markdown, or --sarif.");
@@ -8429,7 +8429,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
8429
8429
  config.get("customProviders"),
8430
8430
  config.getConfigDir()
8431
8431
  );
8432
- const { startHub } = await import("./hub-RTFICY6M.js");
8432
+ const { startHub } = await import("./hub-SFFFYMGO.js");
8433
8433
  await startHub(
8434
8434
  {
8435
8435
  topic: topic ?? "",
@@ -28,9 +28,9 @@ import {
28
28
  touchMemoryReferences,
29
29
  updateMemoryApproval,
30
30
  updateMemoryEntry
31
- } from "./chunk-BKTCOL5D.js";
31
+ } from "./chunk-Z7JROM3J.js";
32
32
  import "./chunk-HOSJZMQS.js";
33
- import "./chunk-B7KTFHK2.js";
33
+ import "./chunk-YQUBYTDR.js";
34
34
  import "./chunk-B5TYJO7V.js";
35
35
  import "./chunk-IW3Q7AE5.js";
36
36
  export {
@@ -27,9 +27,9 @@ import {
27
27
  touchMemoryReferences,
28
28
  updateMemoryApproval,
29
29
  updateMemoryEntry
30
- } from "./chunk-M7XY5AK5.js";
30
+ } from "./chunk-CJ3BPLHZ.js";
31
31
  import "./chunk-YVTASHS5.js";
32
- import "./chunk-ZQGCX4QD.js";
32
+ import "./chunk-LZGPGPA6.js";
33
33
  import "./chunk-6BUTA5VW.js";
34
34
  export {
35
35
  addMemoryEntry,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  countSeverity,
4
4
  runCi
5
- } from "./chunk-P6AUULT2.js";
6
- import "./chunk-XZI4ULXF.js";
5
+ } from "./chunk-6Y42RN5H.js";
6
+ import "./chunk-P2LB6S4I.js";
7
7
  import {
8
8
  buildReviewPrompt,
9
9
  buildSecurityReviewPrompt,
@@ -14,12 +14,12 @@ import {
14
14
  } from "./chunk-QYQI7ZWK.js";
15
15
  import {
16
16
  ConfigManager
17
- } from "./chunk-ACU6T7B3.js";
17
+ } from "./chunk-OMSOAFXY.js";
18
18
  import "./chunk-O3XSFPYH.js";
19
19
  import "./chunk-5ULLIOVC.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-B7KTFHK2.js";
22
+ } from "./chunk-YQUBYTDR.js";
23
23
  import "./chunk-IW3Q7AE5.js";
24
24
 
25
25
  // src/cli/pr.ts
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-6IAVHU3I.js";
6
- import "./chunk-B7KTFHK2.js";
5
+ } from "./chunk-XK22CVID.js";
6
+ import "./chunk-YQUBYTDR.js";
7
7
  export {
8
8
  executeTests,
9
9
  runTestsTool
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-MCC5BEZG.js";
5
- import "./chunk-ZQGCX4QD.js";
4
+ } from "./chunk-USJF35NB.js";
5
+ import "./chunk-LZGPGPA6.js";
6
6
  export {
7
7
  executeTests,
8
8
  runTestsTool
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-WF7FD7WS.js";
5
- import "./chunk-BKTCOL5D.js";
4
+ } from "./chunk-GQYRPBIQ.js";
5
+ import "./chunk-Z7JROM3J.js";
6
6
  import "./chunk-K3CF65QH.js";
7
7
  import "./chunk-UUSRWSSX.js";
8
8
  import "./chunk-CKH4KQ4E.js";
9
9
  import "./chunk-BXP6YZ2P.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-BO5UU3TY.js";
12
+ } from "./chunk-WYNPWHXB.js";
13
13
  import {
14
14
  getDangerLevel,
15
15
  schemaToJsonSchema
@@ -17,10 +17,10 @@ import {
17
17
  import "./chunk-5ULLIOVC.js";
18
18
  import "./chunk-HOSJZMQS.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
- import "./chunk-6IAVHU3I.js";
20
+ import "./chunk-XK22CVID.js";
21
21
  import {
22
22
  VERSION
23
- } from "./chunk-B7KTFHK2.js";
23
+ } from "./chunk-YQUBYTDR.js";
24
24
  import "./chunk-IGPFYNZA.js";
25
25
  import "./chunk-KHYD3WXE.js";
26
26
  import "./chunk-PJ3ONBWZ.js";
@@ -23,7 +23,7 @@ import {
23
23
  scanDirTree,
24
24
  scanProject,
25
25
  setupProxy
26
- } from "./chunk-OYFDGRYD.js";
26
+ } from "./chunk-LEKOBVOQ.js";
27
27
  import {
28
28
  computeCost,
29
29
  formatCost,
@@ -63,7 +63,7 @@ import {
63
63
  spawnAgentContext,
64
64
  truncateOutput,
65
65
  undoStack
66
- } from "./chunk-WF7FD7WS.js";
66
+ } from "./chunk-GQYRPBIQ.js";
67
67
  import {
68
68
  addMemoryEntry,
69
69
  clearMemoryEntries,
@@ -77,7 +77,7 @@ import {
77
77
  parseWritableScope,
78
78
  updateMemoryApproval,
79
79
  updateMemoryEntry
80
- } from "./chunk-BKTCOL5D.js";
80
+ } from "./chunk-Z7JROM3J.js";
81
81
  import "./chunk-K3CF65QH.js";
82
82
  import "./chunk-UUSRWSSX.js";
83
83
  import "./chunk-CKH4KQ4E.js";
@@ -90,13 +90,13 @@ import {
90
90
  buildDoctorReport,
91
91
  formatDoctorReport,
92
92
  loadContextFiles
93
- } from "./chunk-HN4FU37T.js";
93
+ } from "./chunk-DJDEXHOT.js";
94
94
  import {
95
95
  ProviderRegistry
96
96
  } from "./chunk-QYQI7ZWK.js";
97
97
  import {
98
98
  ConfigManager
99
- } from "./chunk-ACU6T7B3.js";
99
+ } from "./chunk-OMSOAFXY.js";
100
100
  import {
101
101
  describePlugin,
102
102
  getActivePluginAssets,
@@ -111,7 +111,7 @@ import {
111
111
  runTool,
112
112
  setPluginEnabled,
113
113
  trustPlugin
114
- } from "./chunk-BO5UU3TY.js";
114
+ } from "./chunk-WYNPWHXB.js";
115
115
  import {
116
116
  CONTENT_ONLY_STREAM_REMINDER,
117
117
  TEE_FINAL_USER_NUDGE,
@@ -135,7 +135,7 @@ import {
135
135
  getGitRoot
136
136
  } from "./chunk-HOSJZMQS.js";
137
137
  import "./chunk-4BKXL7SM.js";
138
- import "./chunk-6IAVHU3I.js";
138
+ import "./chunk-XK22CVID.js";
139
139
  import {
140
140
  AGENTIC_BEHAVIOR_GUIDELINE,
141
141
  AUTHOR,
@@ -151,7 +151,7 @@ import {
151
151
  SKILLS_DIR_NAME,
152
152
  VERSION,
153
153
  buildUserIdentityPrompt
154
- } from "./chunk-B7KTFHK2.js";
154
+ } from "./chunk-YQUBYTDR.js";
155
155
  import "./chunk-IGPFYNZA.js";
156
156
  import "./chunk-KHYD3WXE.js";
157
157
  import "./chunk-PJ3ONBWZ.js";
@@ -803,7 +803,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
803
803
  Cost: ${formatCost(cost)}` : "";
804
804
  let memoryLine = "";
805
805
  try {
806
- const { countPendingMemories } = await import("./persistent-memory-P6LU5KDG.js");
806
+ const { countPendingMemories } = await import("./persistent-memory-3KH2EVHA.js");
807
807
  const pending = countPendingMemories(ctx.config.getConfigDir());
808
808
  if (pending > 0) memoryLine = `
809
809
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -1612,7 +1612,7 @@ async function handleSecurityReview(args, ctx) {
1612
1612
  async function handleTest(args, ctx) {
1613
1613
  ctx.send({ type: "info", message: "\u{1F9EA} Running tests..." });
1614
1614
  try {
1615
- const { executeTests } = await import("./run-tests-XJ44FWIK.js");
1615
+ const { executeTests } = await import("./run-tests-PW4WC4OG.js");
1616
1616
  const argStr = args.join(" ").trim();
1617
1617
  let testArgs = {};
1618
1618
  if (argStr) {
@@ -1876,7 +1876,7 @@ async function handleMemory(args, ctx) {
1876
1876
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
1877
1877
  } else if (sub === "export") {
1878
1878
  if (args[1] === "md") {
1879
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-P6LU5KDG.js");
1879
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-3KH2EVHA.js");
1880
1880
  ctx.send({
1881
1881
  type: "export_data",
1882
1882
  format: "md",
@@ -3,15 +3,15 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-WF7FD7WS.js";
7
- import "./chunk-BKTCOL5D.js";
6
+ } from "./chunk-GQYRPBIQ.js";
7
+ import "./chunk-Z7JROM3J.js";
8
8
  import "./chunk-K3CF65QH.js";
9
9
  import "./chunk-UUSRWSSX.js";
10
10
  import "./chunk-CKH4KQ4E.js";
11
11
  import "./chunk-BXP6YZ2P.js";
12
12
  import {
13
13
  runTool
14
- } from "./chunk-BO5UU3TY.js";
14
+ } from "./chunk-WYNPWHXB.js";
15
15
  import {
16
16
  getDangerLevel,
17
17
  runLeanAgentLoop
@@ -19,10 +19,10 @@ import {
19
19
  import "./chunk-5ULLIOVC.js";
20
20
  import "./chunk-HOSJZMQS.js";
21
21
  import "./chunk-4BKXL7SM.js";
22
- import "./chunk-6IAVHU3I.js";
22
+ import "./chunk-XK22CVID.js";
23
23
  import {
24
24
  SUBAGENT_ALLOWED_TOOLS
25
- } from "./chunk-B7KTFHK2.js";
25
+ } from "./chunk-YQUBYTDR.js";
26
26
  import "./chunk-IGPFYNZA.js";
27
27
  import "./chunk-KHYD3WXE.js";
28
28
  import "./chunk-PJ3ONBWZ.js";
@@ -8,9 +8,9 @@ import {
8
8
  } from "./chunk-E44DTERW.js";
9
9
  import {
10
10
  ConfigManager
11
- } from "./chunk-ACU6T7B3.js";
11
+ } from "./chunk-OMSOAFXY.js";
12
12
  import "./chunk-5ULLIOVC.js";
13
- import "./chunk-B7KTFHK2.js";
13
+ import "./chunk-YQUBYTDR.js";
14
14
  import "./chunk-IW3Q7AE5.js";
15
15
 
16
16
  // src/cli/usage.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.244",
3
+ "version": "0.4.246",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",