jinzd-ai-cli 0.4.164 → 0.4.166

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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-LNW3ASRM.js";
5
- import "./chunk-2ZD3YTVM.js";
6
- import "./chunk-PDN5D35Y.js";
4
+ } from "./chunk-3Q2B5YQP.js";
5
+ import "./chunk-TZQHYZKT.js";
6
+ import "./chunk-CQDCL3CR.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
 
9
9
  // src/cli/batch.ts
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  VERSION
5
- } from "./chunk-PDN5D35Y.js";
5
+ } from "./chunk-CQDCL3CR.js";
6
6
 
7
7
  // src/diagnostics/crash-log.ts
8
8
  import {
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  ConfigError,
4
4
  EnvLoader
5
- } from "./chunk-2ZD3YTVM.js";
5
+ } from "./chunk-TZQHYZKT.js";
6
6
  import {
7
7
  CONFIG_DIR_NAME,
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-PDN5D35Y.js";
11
+ } from "./chunk-CQDCL3CR.js";
12
12
 
13
13
  // src/config/config-manager.ts
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONFIG_DIR_NAME
4
- } from "./chunk-PDN5D35Y.js";
4
+ } from "./chunk-CQDCL3CR.js";
5
5
 
6
6
  // src/diagnostics/tool-stats.ts
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync } 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.164";
4
+ var VERSION = "0.4.166";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -7,7 +7,7 @@ import {
7
7
  ProviderError,
8
8
  ProviderNotFoundError,
9
9
  RateLimitError
10
- } from "./chunk-2ZD3YTVM.js";
10
+ } from "./chunk-TZQHYZKT.js";
11
11
 
12
12
  // src/providers/claude.ts
13
13
  import Anthropic from "@anthropic-ai/sdk";
@@ -1737,6 +1737,42 @@ function extractWrittenFilePaths(extraMessages) {
1737
1737
  }
1738
1738
  return Array.from(paths);
1739
1739
  }
1740
+ function extractBashCommands(extraMessages) {
1741
+ const cmds = [];
1742
+ const msgs = extraMessages;
1743
+ const addCmd = (raw) => {
1744
+ if (typeof raw === "string") {
1745
+ try {
1746
+ const parsed = JSON.parse(raw);
1747
+ if (typeof parsed.command === "string") cmds.push(parsed.command);
1748
+ } catch {
1749
+ }
1750
+ } else if (raw && typeof raw === "object") {
1751
+ const c = raw.command;
1752
+ if (typeof c === "string") cmds.push(c);
1753
+ }
1754
+ };
1755
+ for (const msg of msgs) {
1756
+ if (msg.role === "assistant" && Array.isArray(msg.tool_calls)) {
1757
+ for (const tc of msg.tool_calls) {
1758
+ const fn = tc.function;
1759
+ if (fn?.name === "bash") addCmd(fn?.arguments);
1760
+ }
1761
+ }
1762
+ if (msg.role === "assistant" && Array.isArray(msg.content)) {
1763
+ for (const block of msg.content) {
1764
+ if (block.type === "tool_use" && block.name === "bash") addCmd(block.input);
1765
+ }
1766
+ }
1767
+ if (msg.role === "model" && Array.isArray(msg.parts)) {
1768
+ for (const part of msg.parts) {
1769
+ const fc = part.functionCall;
1770
+ if (fc && fc.name === "bash") addCmd(fc.args);
1771
+ }
1772
+ }
1773
+ }
1774
+ return cmds;
1775
+ }
1740
1776
  function findPhantomClaims(content, extraMessages) {
1741
1777
  const claimed = extractClaimedFilePaths(content);
1742
1778
  if (claimed.length === 0) return [];
@@ -1748,6 +1784,7 @@ function findPhantomClaims(content, extraMessages) {
1748
1784
  const written = extractWrittenFilePaths(extraMessages).map(normalize);
1749
1785
  const writtenBases = new Set(written.map(basename));
1750
1786
  const writtenFull = new Set(written);
1787
+ const bashText = extractBashCommands(extraMessages).map((c) => c.replace(/\\/g, "/").toLowerCase()).join("\n");
1751
1788
  return claimed.filter((raw) => {
1752
1789
  const norm = normalize(raw);
1753
1790
  if (writtenFull.has(norm)) return false;
@@ -1755,6 +1792,8 @@ function findPhantomClaims(content, extraMessages) {
1755
1792
  if (w.endsWith("/" + norm) || norm.endsWith("/" + w)) return false;
1756
1793
  }
1757
1794
  if (writtenBases.has(basename(norm))) return false;
1795
+ const base = basename(norm);
1796
+ if (base && bashText.includes(base)) return false;
1758
1797
  return true;
1759
1798
  });
1760
1799
  }
@@ -2111,6 +2150,69 @@ var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
2111
2150
  }
2112
2151
  };
2113
2152
 
2153
+ // src/providers/minimax.ts
2154
+ var MiniMaxProvider = class extends OpenAICompatibleProvider {
2155
+ defaultBaseUrl = "https://api.minimaxi.com/v1";
2156
+ info = {
2157
+ id: "minimax",
2158
+ displayName: "MiniMax (\u6D77\u87BA)",
2159
+ defaultModel: "MiniMax-M3",
2160
+ apiKeyEnvVar: "AICLI_API_KEY_MINIMAX",
2161
+ requiresApiKey: true,
2162
+ baseUrl: this.defaultBaseUrl,
2163
+ models: [
2164
+ {
2165
+ id: "MiniMax-M3",
2166
+ displayName: "MiniMax M3\uFF08\u65D7\u8230\uFF0C1M \u4E0A\u4E0B\u6587\uFF09",
2167
+ contextWindow: 1e6,
2168
+ supportsStreaming: true
2169
+ },
2170
+ {
2171
+ id: "MiniMax-M2.7",
2172
+ displayName: "MiniMax M2.7",
2173
+ contextWindow: 1e6,
2174
+ supportsStreaming: true
2175
+ },
2176
+ {
2177
+ id: "MiniMax-M2.7-highspeed",
2178
+ displayName: "MiniMax M2.7 Highspeed",
2179
+ contextWindow: 1e6,
2180
+ supportsStreaming: true
2181
+ },
2182
+ {
2183
+ id: "MiniMax-M2.5",
2184
+ displayName: "MiniMax M2.5",
2185
+ contextWindow: 1e6,
2186
+ supportsStreaming: true
2187
+ },
2188
+ {
2189
+ id: "MiniMax-M2.5-highspeed",
2190
+ displayName: "MiniMax M2.5 Highspeed",
2191
+ contextWindow: 1e6,
2192
+ supportsStreaming: true
2193
+ },
2194
+ {
2195
+ id: "MiniMax-M2.1",
2196
+ displayName: "MiniMax M2.1",
2197
+ contextWindow: 1e6,
2198
+ supportsStreaming: true
2199
+ },
2200
+ {
2201
+ id: "MiniMax-M2.1-highspeed",
2202
+ displayName: "MiniMax M2.1 Highspeed",
2203
+ contextWindow: 1e6,
2204
+ supportsStreaming: true
2205
+ },
2206
+ {
2207
+ id: "MiniMax-M2",
2208
+ displayName: "MiniMax M2",
2209
+ contextWindow: 1e6,
2210
+ supportsStreaming: true
2211
+ }
2212
+ ]
2213
+ };
2214
+ };
2215
+
2114
2216
  // src/providers/openai.ts
2115
2217
  var OpenAIProvider = class extends OpenAICompatibleProvider {
2116
2218
  defaultBaseUrl = "https://api.openai.com/v1";
@@ -2448,6 +2550,7 @@ var BUILT_IN_PROVIDERS = [
2448
2550
  DeepSeekProvider,
2449
2551
  ZhipuProvider,
2450
2552
  KimiProvider,
2553
+ MiniMaxProvider,
2451
2554
  OpenAIProvider,
2452
2555
  OpenRouterProvider,
2453
2556
  OllamaProvider
@@ -2536,6 +2639,7 @@ export {
2536
2639
  buildWriteRoundReminder,
2537
2640
  HALLUCINATION_CORRECTION_MESSAGE,
2538
2641
  extractWrittenFilePaths,
2642
+ extractBashCommands,
2539
2643
  findPhantomClaims,
2540
2644
  buildPhantomCorrectionMessage,
2541
2645
  detectPseudoToolCalls,
@@ -6,7 +6,7 @@ import { platform } from "os";
6
6
  import chalk from "chalk";
7
7
 
8
8
  // src/core/constants.ts
9
- var VERSION = "0.4.164";
9
+ var VERSION = "0.4.166";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-HDSKW7Q3.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-W24BZLEM.js";
8
+ } from "./chunk-X65N6VMM.js";
9
9
  import {
10
10
  runTool
11
- } from "./chunk-WK3PULZ7.js";
11
+ } from "./chunk-AUOY5WJL.js";
12
12
  import {
13
13
  getDangerLevel,
14
14
  isFileWriteTool
@@ -17,7 +17,7 @@ import {
17
17
  EnvLoader,
18
18
  NetworkError,
19
19
  ToolError
20
- } from "./chunk-2ZD3YTVM.js";
20
+ } from "./chunk-TZQHYZKT.js";
21
21
  import {
22
22
  CONFIG_DIR_NAME,
23
23
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
@@ -25,7 +25,7 @@ import {
25
25
  SUBAGENT_ALLOWED_TOOLS,
26
26
  SUBAGENT_DEFAULT_MAX_ROUNDS,
27
27
  SUBAGENT_MAX_ROUNDS_LIMIT
28
- } from "./chunk-PDN5D35Y.js";
28
+ } from "./chunk-CQDCL3CR.js";
29
29
  import {
30
30
  fileCheckpoints
31
31
  } from "./chunk-4BKXL7SM.js";
@@ -7,6 +7,7 @@ var ENV_KEY_MAP = {
7
7
  deepseek: "AICLI_API_KEY_DEEPSEEK",
8
8
  zhipu: "AICLI_API_KEY_ZHIPU",
9
9
  kimi: "AICLI_API_KEY_KIMI",
10
+ minimax: "AICLI_API_KEY_MINIMAX",
10
11
  openai: "AICLI_API_KEY_OPENAI",
11
12
  openrouter: "AICLI_API_KEY_OPENROUTER",
12
13
  "google-search": "AICLI_API_KEY_GOOGLESEARCH",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-PDN5D35Y.js";
4
+ } from "./chunk-CQDCL3CR.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
  import {
3
3
  truncateForPersist
4
- } from "./chunk-DDSYKCPE.js";
4
+ } from "./chunk-MSUBGV52.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-PDN5D35Y.js";
14
+ } from "./chunk-CQDCL3CR.js";
15
15
 
16
16
  // src/mcp/client.ts
17
17
  import { spawn } from "child_process";
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-HLWUDRBO.js";
7
7
  import {
8
8
  ProviderRegistry
9
- } from "./chunk-AIZOARZY.js";
9
+ } from "./chunk-GNJOC6ZN.js";
10
10
  import "./chunk-NXXNLLSG.js";
11
11
  import {
12
12
  ConfigManager
13
- } from "./chunk-LNW3ASRM.js";
14
- import "./chunk-2ZD3YTVM.js";
13
+ } from "./chunk-3Q2B5YQP.js";
14
+ import "./chunk-TZQHYZKT.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-PDN5D35Y.js";
17
+ } from "./chunk-CQDCL3CR.js";
18
18
  import "./chunk-PDX44BCA.js";
19
19
 
20
20
  // src/cli/ci.ts
@@ -36,7 +36,7 @@ import {
36
36
  TEST_TIMEOUT,
37
37
  VERSION,
38
38
  buildUserIdentityPrompt
39
- } from "./chunk-PDN5D35Y.js";
39
+ } from "./chunk-CQDCL3CR.js";
40
40
  import "./chunk-PDX44BCA.js";
41
41
  export {
42
42
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -2,26 +2,26 @@
2
2
  import {
3
3
  getConfigDirUsage,
4
4
  listRecentCrashes
5
- } from "./chunk-WE3LVCMV.js";
5
+ } from "./chunk-2RBJNHBS.js";
6
6
  import {
7
7
  ProviderRegistry
8
- } from "./chunk-AIZOARZY.js";
8
+ } from "./chunk-GNJOC6ZN.js";
9
9
  import {
10
10
  getStatsSnapshot,
11
11
  getTopFailingTools,
12
12
  getTopUsedTools,
13
13
  resetStats
14
- } from "./chunk-WK3PULZ7.js";
14
+ } from "./chunk-AUOY5WJL.js";
15
15
  import "./chunk-NXXNLLSG.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-LNW3ASRM.js";
19
- import "./chunk-2ZD3YTVM.js";
18
+ } from "./chunk-3Q2B5YQP.js";
19
+ import "./chunk-TZQHYZKT.js";
20
20
  import {
21
21
  DEV_STATE_FILE_NAME,
22
22
  MEMORY_FILE_NAME,
23
23
  VERSION
24
- } from "./chunk-PDN5D35Y.js";
24
+ } from "./chunk-CQDCL3CR.js";
25
25
  import "./chunk-PDX44BCA.js";
26
26
 
27
27
  // src/diagnostics/doctor-cli.ts
@@ -36,7 +36,7 @@ import {
36
36
  VERSION,
37
37
  buildUserIdentityPrompt,
38
38
  runTestsTool
39
- } from "./chunk-7YBXXLJA.js";
39
+ } from "./chunk-HAFUJYZQ.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -316,6 +316,7 @@ var ENV_KEY_MAP = {
316
316
  deepseek: "AICLI_API_KEY_DEEPSEEK",
317
317
  zhipu: "AICLI_API_KEY_ZHIPU",
318
318
  kimi: "AICLI_API_KEY_KIMI",
319
+ minimax: "AICLI_API_KEY_MINIMAX",
319
320
  openai: "AICLI_API_KEY_OPENAI",
320
321
  openrouter: "AICLI_API_KEY_OPENROUTER",
321
322
  "google-search": "AICLI_API_KEY_GOOGLESEARCH",
@@ -2291,6 +2292,42 @@ CRITICAL \u2014 Batch file generation rules:
2291
2292
  4. Only produce a text summary AFTER all write_file calls have been made and returned success.
2292
2293
  5. The system compares every "file saved" claim against actual tool calls. Phantom claims trigger an automatic retry \u2014 do not waste rounds.`;
2293
2294
  var HALLUCINATION_CORRECTION_MESSAGE = "You did NOT actually call the write_file tool \u2014 the file was NOT created! Please immediately use the write_file tool via the function calling API to perform the actual file write. Do NOT describe file content in text \u2014 you MUST invoke write_file through the tool_calls mechanism.";
2295
+ function extractBashCommands(extraMessages) {
2296
+ const cmds = [];
2297
+ const msgs = extraMessages;
2298
+ const addCmd = (raw) => {
2299
+ if (typeof raw === "string") {
2300
+ try {
2301
+ const parsed = JSON.parse(raw);
2302
+ if (typeof parsed.command === "string") cmds.push(parsed.command);
2303
+ } catch {
2304
+ }
2305
+ } else if (raw && typeof raw === "object") {
2306
+ const c = raw.command;
2307
+ if (typeof c === "string") cmds.push(c);
2308
+ }
2309
+ };
2310
+ for (const msg of msgs) {
2311
+ if (msg.role === "assistant" && Array.isArray(msg.tool_calls)) {
2312
+ for (const tc of msg.tool_calls) {
2313
+ const fn = tc.function;
2314
+ if (fn?.name === "bash") addCmd(fn?.arguments);
2315
+ }
2316
+ }
2317
+ if (msg.role === "assistant" && Array.isArray(msg.content)) {
2318
+ for (const block of msg.content) {
2319
+ if (block.type === "tool_use" && block.name === "bash") addCmd(block.input);
2320
+ }
2321
+ }
2322
+ if (msg.role === "model" && Array.isArray(msg.parts)) {
2323
+ for (const part of msg.parts) {
2324
+ const fc = part.functionCall;
2325
+ if (fc && fc.name === "bash") addCmd(fc.args);
2326
+ }
2327
+ }
2328
+ }
2329
+ return cmds;
2330
+ }
2294
2331
  var PSEUDO_TOOL_CALL_PATTERNS = [
2295
2332
  // <tool_call name="..."> ... </tool_call> (DeepSeek V4 thinking, GLM)
2296
2333
  /<tool_call\s+name\s*=\s*["'][\w._-]+["']/,
@@ -2640,6 +2677,69 @@ var KimiProvider = class _KimiProvider extends OpenAICompatibleProvider {
2640
2677
  }
2641
2678
  };
2642
2679
 
2680
+ // src/providers/minimax.ts
2681
+ var MiniMaxProvider = class extends OpenAICompatibleProvider {
2682
+ defaultBaseUrl = "https://api.minimaxi.com/v1";
2683
+ info = {
2684
+ id: "minimax",
2685
+ displayName: "MiniMax (\u6D77\u87BA)",
2686
+ defaultModel: "MiniMax-M3",
2687
+ apiKeyEnvVar: "AICLI_API_KEY_MINIMAX",
2688
+ requiresApiKey: true,
2689
+ baseUrl: this.defaultBaseUrl,
2690
+ models: [
2691
+ {
2692
+ id: "MiniMax-M3",
2693
+ displayName: "MiniMax M3\uFF08\u65D7\u8230\uFF0C1M \u4E0A\u4E0B\u6587\uFF09",
2694
+ contextWindow: 1e6,
2695
+ supportsStreaming: true
2696
+ },
2697
+ {
2698
+ id: "MiniMax-M2.7",
2699
+ displayName: "MiniMax M2.7",
2700
+ contextWindow: 1e6,
2701
+ supportsStreaming: true
2702
+ },
2703
+ {
2704
+ id: "MiniMax-M2.7-highspeed",
2705
+ displayName: "MiniMax M2.7 Highspeed",
2706
+ contextWindow: 1e6,
2707
+ supportsStreaming: true
2708
+ },
2709
+ {
2710
+ id: "MiniMax-M2.5",
2711
+ displayName: "MiniMax M2.5",
2712
+ contextWindow: 1e6,
2713
+ supportsStreaming: true
2714
+ },
2715
+ {
2716
+ id: "MiniMax-M2.5-highspeed",
2717
+ displayName: "MiniMax M2.5 Highspeed",
2718
+ contextWindow: 1e6,
2719
+ supportsStreaming: true
2720
+ },
2721
+ {
2722
+ id: "MiniMax-M2.1",
2723
+ displayName: "MiniMax M2.1",
2724
+ contextWindow: 1e6,
2725
+ supportsStreaming: true
2726
+ },
2727
+ {
2728
+ id: "MiniMax-M2.1-highspeed",
2729
+ displayName: "MiniMax M2.1 Highspeed",
2730
+ contextWindow: 1e6,
2731
+ supportsStreaming: true
2732
+ },
2733
+ {
2734
+ id: "MiniMax-M2",
2735
+ displayName: "MiniMax M2",
2736
+ contextWindow: 1e6,
2737
+ supportsStreaming: true
2738
+ }
2739
+ ]
2740
+ };
2741
+ };
2742
+
2643
2743
  // src/providers/openai.ts
2644
2744
  var OpenAIProvider = class extends OpenAICompatibleProvider {
2645
2745
  defaultBaseUrl = "https://api.openai.com/v1";
@@ -2977,6 +3077,7 @@ var BUILT_IN_PROVIDERS = [
2977
3077
  DeepSeekProvider,
2978
3078
  ZhipuProvider,
2979
3079
  KimiProvider,
3080
+ MiniMaxProvider,
2980
3081
  OpenAIProvider,
2981
3082
  OpenRouterProvider,
2982
3083
  OllamaProvider
@@ -12046,7 +12147,8 @@ Details: ${errMsg.split("\n")[0]}
12046
12147
  if (result.content && !result.toolCalls) {
12047
12148
  const hasWriteTools = toolDefs.some((t) => t.name === "write_file" || t.name === "edit_file");
12048
12149
  const alreadyWrote = hadPreviousWriteToolCalls(extraMessages);
12049
- if (hasWriteTools && !alreadyWrote && detectsHallucinatedFileOp(result.content) && round < maxToolRounds - 1) {
12150
+ const bashRanThisTurn = extractBashCommands(extraMessages).length > 0;
12151
+ if (hasWriteTools && !alreadyWrote && !bashRanThisTurn && detectsHallucinatedFileOp(result.content) && round < maxToolRounds - 1) {
12050
12152
  this.send({ type: "info", message: "\u26A0 Hallucinated completion detected, forcing retry..." });
12051
12153
  const reasoningField = result.reasoningContent ? { reasoning_content: result.reasoningContent } : this.currentProvider === "deepseek" ? { reasoning_content: "" } : {};
12052
12154
  extraMessages.push(
@@ -13446,7 +13548,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
13446
13548
  case "test": {
13447
13549
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
13448
13550
  try {
13449
- const { executeTests } = await import("./run-tests-THRQ5PNH.js");
13551
+ const { executeTests } = await import("./run-tests-NQGUFKOJ.js");
13450
13552
  const argStr = args.join(" ").trim();
13451
13553
  let testArgs = {};
13452
13554
  if (argStr) {
@@ -155,7 +155,7 @@ ${content}`);
155
155
  }
156
156
  }
157
157
  async function runTaskMode(config, providers, configManager, topic) {
158
- const { TaskOrchestrator } = await import("./task-orchestrator-HEQ6MPJO.js");
158
+ const { TaskOrchestrator } = await import("./task-orchestrator-MOCZJHX3.js");
159
159
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
160
160
  let interrupted = false;
161
161
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  saveDevState,
19
19
  sessionHasMeaningfulContent,
20
20
  setupProxy
21
- } from "./chunk-FG25CPMV.js";
21
+ } from "./chunk-ZGH5QTIF.js";
22
22
  import {
23
23
  ToolExecutor,
24
24
  ToolRegistry,
@@ -37,10 +37,10 @@ import {
37
37
  spawnAgentContext,
38
38
  theme,
39
39
  undoStack
40
- } from "./chunk-DDSYKCPE.js";
40
+ } from "./chunk-MSUBGV52.js";
41
41
  import "./chunk-HDSKW7Q3.js";
42
42
  import "./chunk-ZWVIDFGY.js";
43
- import "./chunk-W24BZLEM.js";
43
+ import "./chunk-X65N6VMM.js";
44
44
  import {
45
45
  SessionManager,
46
46
  getContentText
@@ -49,7 +49,7 @@ import {
49
49
  getConfigDirUsage,
50
50
  listRecentCrashes,
51
51
  writeCrashLog
52
- } from "./chunk-WE3LVCMV.js";
52
+ } from "./chunk-2RBJNHBS.js";
53
53
  import {
54
54
  CONTENT_ONLY_STREAM_REMINDER,
55
55
  HALLUCINATION_CORRECTION_MESSAGE,
@@ -61,28 +61,29 @@ import {
61
61
  detectMetaNarration,
62
62
  detectPseudoToolCalls,
63
63
  detectsHallucinatedFileOp,
64
+ extractBashCommands,
64
65
  extractWrittenFilePaths,
65
66
  findPhantomClaims,
66
67
  hadPreviousWriteToolCalls,
67
68
  looksLikeDocumentBody,
68
69
  stripPseudoToolCalls,
69
70
  stripToolCallReminder
70
- } from "./chunk-AIZOARZY.js";
71
+ } from "./chunk-GNJOC6ZN.js";
71
72
  import {
72
73
  getStatsSnapshot,
73
74
  getTopFailingTools,
74
75
  getTopUsedTools,
75
76
  installFlushOnExit
76
- } from "./chunk-WK3PULZ7.js";
77
+ } from "./chunk-AUOY5WJL.js";
77
78
  import "./chunk-NXXNLLSG.js";
78
79
  import {
79
80
  ConfigManager
80
- } from "./chunk-LNW3ASRM.js";
81
+ } from "./chunk-3Q2B5YQP.js";
81
82
  import {
82
83
  AuthError,
83
84
  ProviderError,
84
85
  RateLimitError
85
- } from "./chunk-2ZD3YTVM.js";
86
+ } from "./chunk-TZQHYZKT.js";
86
87
  import {
87
88
  AGENTIC_BEHAVIOR_GUIDELINE,
88
89
  AUTHOR,
@@ -104,7 +105,7 @@ import {
104
105
  SKILLS_DIR_NAME,
105
106
  VERSION,
106
107
  buildUserIdentityPrompt
107
- } from "./chunk-PDN5D35Y.js";
108
+ } from "./chunk-CQDCL3CR.js";
108
109
  import {
109
110
  formatGitContextForPrompt,
110
111
  getGitContext,
@@ -319,14 +320,14 @@ var Renderer = class {
319
320
  const feat = (s) => theme.dim(" \u2726 ") + chalk.white(s);
320
321
  console.log();
321
322
  console.log(
322
- theme.heading(" \u{1F916} ai-cli") + theme.dim(` v${VERSION}`) + theme.dim(" \u2014 Cross-platform REPL-style AI chat tool")
323
+ theme.heading(" \u{1F916} ai-cli") + theme.dim(` v${VERSION}`) + theme.dim(" \u2014 Cross-platform agentic AI assistant (REPL \xB7 Web \xB7 Desktop, 9 providers)")
323
324
  );
324
325
  console.log(HR);
325
326
  console.log(label("Desc") + chalk.white(DESCRIPTION));
326
327
  console.log(label("Author") + theme.warning(AUTHOR) + theme.dim(" <" + AUTHOR_EMAIL + ">"));
327
328
  console.log(HR);
328
- console.log(theme.dim(" Supported Providers (8):"));
329
- console.log(theme.dim(" OpenAI \xB7 DeepSeek \xB7 Kimi (Moonshot) \xB7 Claude (Anthropic)"));
329
+ console.log(theme.dim(" Supported Providers (9):"));
330
+ console.log(theme.dim(" OpenAI \xB7 DeepSeek \xB7 Kimi (Moonshot) \xB7 Claude (Anthropic) \xB7 MiniMax (\u6D77\u87BA)"));
330
331
  console.log(theme.dim(" Gemini (Google) \xB7 Zhipu (GLM) \xB7 OpenRouter \xB7 Ollama (Local, no API key)"));
331
332
  console.log(HR);
332
333
  const mcpToolCount = mcpInfo?.tools ?? 0;
@@ -459,6 +460,20 @@ var Renderer = class {
459
460
  console.log(feat("write_file long-content guidance (v0.4.103+): tool description no longer encourages AI to chunk long files \u2014 single-shot writes prevented from being split into truncated parts"));
460
461
  console.log(feat("Provider retry + fallback chain (v0.4.144+): transient network / 5xx / 429 errors retry on the same provider with exponential backoff; persistent failures walk config.fallback.chain (per-entry provider+model). Opt-in via config.fallback.enabled. Stream-safe: never retries after first chunk yielded"));
461
462
  console.log(feat("aicli ci \u2014 headless PR review for GitHub Actions (v0.4.145+): `aicli ci --pr <num> --post` reads diff via gh CLI, runs code + security review, posts/updates a single PR comment via sentinel marker. Drop-in workflow YAML at docs/github-actions-example.yml. Critical/high findings \u2192 exit 1 (CI gate)"));
463
+ console.log(feat("Kimi K2.6 family + temperature fix (v0.4.146\u20130.4.149): kimi-k2.6 / k2.5 / k2-thinking default models; auto-migrate retired k2-0711/k2-turbo ids in config + history; K2.x models force temperature=1 (API requires it)"));
464
+ console.log(feat("bash error hints (v0.4.146\u20130.4.165): on common Windows/PowerShell failures the bash tool appends actionable hints \u2014 Test-Path over -EA SilentlyContinue probes, python (not python3) incl. the WindowsApps stub that exits 1 silently, write_file over hallucinated Write-Content cmdlets"));
465
+ console.log(feat("6th security + perf audit (v0.4.151): SSRF hardening (IPv4 int/hex/octal + IPv6 + DNS-rebinding pinned via undici lookup), newline command-chain bypass in permissions, timing-safe token compare, interpreter inline-code (-c/-e) danger elevation, vector-store top-k + redactor perf"));
466
+ console.log(feat("C1/C2 index extended to Go/Rust/Java/C++ (v0.4.143): find_symbol/get_outline/find_references/search_code now cover 8 languages via bundled tree-sitter grammars"));
467
+ console.log(feat("Provider streaming tool-call fixes (v0.4.142): Zhipu/GLM repeated id+name delta aggregation no longer drops args; conformance tests across OpenAI-standard vs repeated-chunk shapes"));
468
+ console.log(feat("Hub P1 \u2014 mixed multi-model brainstorm (v0.4.152): aicli hub --mix spreads configured providers across roles (Claude vs GPT vs DeepSeek really debate); fixes per-role model bug via resolveRoleProviders"));
469
+ console.log(feat("Hub P2 \u2014 human-in-the-loop + convergence (v0.4.154): --steer pauses each round for guidance/stop; --vote lets agents append [CONVERGED], 2/3 majority ends early (zero extra API calls); structured Decision/Action-Items summary"));
470
+ console.log(feat("Hub P3 \u2014 discussion persistence (v0.4.155): finished discussions auto-save to ~/.aicli/history as a normal session, listed by `aicli sessions`, replayable via Web UI \u{1F3AC} \u2014 reuses Session Replay, zero new machinery"));
471
+ console.log(feat("Hub P4 \u2014 Web UI multi-agent room (v0.4.156\u20130.4.158): \u{1F3DB} Hub sidebar tab runs discussions live in the browser (streaming per-role blocks, vote rows, summary card); P4b adds in-browser --steer and side-by-side agent lanes. Hub roadmap complete"));
472
+ console.log(feat("aicli web fixes (v0.4.153): honor config.mcpEnabled in web mode; vendor Tailwind/DaisyUI/marked/highlight.js locally (GFW-blocked CDNs broke styling + login overlay)"));
473
+ console.log(feat("Self-updating service worker (v0.4.159): network-only HTML/JS + activate-time reload broadcast \u2014 upgrades take effect without manual SW unregister; fixes stale-cache ghost"));
474
+ console.log(feat("Web UI CSP fix (v0.4.160\u20130.4.162): restore missing \u{1F3DB} Hub tab button; loosen script-src to unsafe-inline so inline onclick handlers fire (strict CSP had silently blocked every button)"));
475
+ console.log(feat("Windows process-tree kill (v0.4.163): killChild uses taskkill /T /F so Ctrl+C actually interrupts ssh/psql grandchildren (child.kill only hit the powershell parent)"));
476
+ console.log(feat("Hallucination detector bash-aware (v0.4.165): files written via bash (python open().write(), Out-File, scp, redirects) no longer false-flagged as phantom claims; coarse check suppressed when bash ran this turn"));
462
477
  console.log();
463
478
  }
464
479
  printPrompt(provider, _model) {
@@ -1773,7 +1788,7 @@ No tools match "${filter}".
1773
1788
  const { join: join6 } = await import("path");
1774
1789
  const { existsSync: existsSync6 } = await import("fs");
1775
1790
  const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
1776
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-PFFL4A6S.js");
1791
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-WTXRMREX.js");
1777
1792
  const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
1778
1793
  const cwd = process.cwd();
1779
1794
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2834,7 +2849,7 @@ ${hint}` : "")
2834
2849
  usage: "/test [command|filter]",
2835
2850
  async execute(args, ctx) {
2836
2851
  try {
2837
- const { executeTests } = await import("./run-tests-5JRF7VYH.js");
2852
+ const { executeTests } = await import("./run-tests-3G2PJXGO.js");
2838
2853
  const argStr = args.join(" ").trim();
2839
2854
  let testArgs = {};
2840
2855
  if (argStr) {
@@ -6712,7 +6727,9 @@ ${mcpBudgetNote}` : "");
6712
6727
  const alreadyWrote = hadPreviousWriteToolCalls(extraMessages);
6713
6728
  const coarseHallucination = !this.planMode && hasWriteTools && !alreadyWrote && !!result.content && detectsHallucinatedFileOp(result.content);
6714
6729
  const phantomPaths = (coarseHallucination || alreadyWrote) && !this.planMode && hasWriteTools && result.content ? findPhantomClaims(result.content, extraMessages) : [];
6715
- if ((phantomPaths.length > 0 || coarseHallucination) && round < maxToolRounds - 1) {
6730
+ const bashRanThisTurn = extractBashCommands(extraMessages).length > 0;
6731
+ const coarseShouldFire = coarseHallucination && !bashRanThisTurn;
6732
+ if ((phantomPaths.length > 0 || coarseShouldFire) && round < maxToolRounds - 1) {
6716
6733
  const providerName = this.currentProvider;
6717
6734
  const detail = phantomPaths.length > 0 ? ` phantom files: ${phantomPaths.join(", ")}` : "";
6718
6735
  process.stderr.write(
@@ -7534,7 +7551,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7534
7551
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7535
7552
  process.exit(1);
7536
7553
  }
7537
- const { startWebServer } = await import("./server-F2TQEZJL.js");
7554
+ const { startWebServer } = await import("./server-MXD7VVUS.js");
7538
7555
  await startWebServer({ port, host: options.host });
7539
7556
  });
7540
7557
  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) => {
@@ -7701,12 +7718,12 @@ program.command("sessions").description("List recent conversation sessions").opt
7701
7718
  console.log(footer + "\n");
7702
7719
  });
7703
7720
  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) => {
7704
- const { runDoctorCli } = await import("./doctor-cli-5FVX63AP.js");
7721
+ const { runDoctorCli } = await import("./doctor-cli-LOEEIEOP.js");
7705
7722
  await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
7706
7723
  });
7707
7724
  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) => {
7708
7725
  try {
7709
- const batch = await import("./batch-JCUT746Z.js");
7726
+ const batch = await import("./batch-XYA52SO5.js");
7710
7727
  switch (action) {
7711
7728
  case "submit":
7712
7729
  if (!arg) {
@@ -7749,7 +7766,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7749
7766
  }
7750
7767
  });
7751
7768
  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) => {
7752
- const { startMcpServer } = await import("./server-6JXLNUC3.js");
7769
+ const { startMcpServer } = await import("./server-32ZENZ3A.js");
7753
7770
  await startMcpServer({
7754
7771
  allowDestructive: !!options.allowDestructive,
7755
7772
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7758,7 +7775,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
7758
7775
  });
7759
7776
  });
7760
7777
  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; diff fetched via `gh pr diff <num>`", (v) => parseInt(v, 10)).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)").action(async (options) => {
7761
- const { runCi } = await import("./ci-QMCW6W5I.js");
7778
+ const { runCi } = await import("./ci-65KIRMAD.js");
7762
7779
  const result = await runCi({
7763
7780
  pr: options.pr,
7764
7781
  base: options.base,
@@ -7903,7 +7920,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7903
7920
  }),
7904
7921
  config.get("customProviders")
7905
7922
  );
7906
- const { startHub } = await import("./hub-ESVXALOP.js");
7923
+ const { startHub } = await import("./hub-UM3LKKSJ.js");
7907
7924
  await startHub(
7908
7925
  {
7909
7926
  topic: topic ?? "",
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-W24BZLEM.js";
6
- import "./chunk-PDN5D35Y.js";
5
+ } from "./chunk-X65N6VMM.js";
6
+ import "./chunk-CQDCL3CR.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
9
9
  executeTests,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-7YBXXLJA.js";
4
+ } from "./chunk-HAFUJYZQ.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
  export {
7
7
  executeTests,
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-DDSYKCPE.js";
4
+ } from "./chunk-MSUBGV52.js";
5
5
  import "./chunk-HDSKW7Q3.js";
6
6
  import "./chunk-ZWVIDFGY.js";
7
- import "./chunk-W24BZLEM.js";
7
+ import "./chunk-X65N6VMM.js";
8
8
  import {
9
9
  runTool
10
- } from "./chunk-WK3PULZ7.js";
10
+ } from "./chunk-AUOY5WJL.js";
11
11
  import {
12
12
  getDangerLevel,
13
13
  schemaToJsonSchema
14
14
  } from "./chunk-NXXNLLSG.js";
15
- import "./chunk-2ZD3YTVM.js";
15
+ import "./chunk-TZQHYZKT.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-PDN5D35Y.js";
18
+ } from "./chunk-CQDCL3CR.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
20
  import "./chunk-MM3F43H6.js";
21
21
  import "./chunk-KHYD3WXE.js";
@@ -21,7 +21,7 @@ import {
21
21
  loadDevState,
22
22
  persistToolRound,
23
23
  setupProxy
24
- } from "./chunk-FG25CPMV.js";
24
+ } from "./chunk-ZGH5QTIF.js";
25
25
  import {
26
26
  ToolExecutor,
27
27
  ToolRegistry,
@@ -39,10 +39,10 @@ import {
39
39
  spawnAgentContext,
40
40
  truncateOutput,
41
41
  undoStack
42
- } from "./chunk-DDSYKCPE.js";
42
+ } from "./chunk-MSUBGV52.js";
43
43
  import "./chunk-HDSKW7Q3.js";
44
44
  import "./chunk-ZWVIDFGY.js";
45
- import "./chunk-W24BZLEM.js";
45
+ import "./chunk-X65N6VMM.js";
46
46
  import {
47
47
  SessionManager,
48
48
  getContentText
@@ -56,21 +56,22 @@ import {
56
56
  detectMetaNarration,
57
57
  detectPseudoToolCalls,
58
58
  detectsHallucinatedFileOp,
59
+ extractBashCommands,
59
60
  hadPreviousWriteToolCalls,
60
61
  looksLikeDocumentBody,
61
62
  stripPseudoToolCalls,
62
63
  stripToolCallReminder
63
- } from "./chunk-AIZOARZY.js";
64
+ } from "./chunk-GNJOC6ZN.js";
64
65
  import {
65
66
  runTool
66
- } from "./chunk-WK3PULZ7.js";
67
+ } from "./chunk-AUOY5WJL.js";
67
68
  import {
68
69
  getDangerLevel
69
70
  } from "./chunk-NXXNLLSG.js";
70
71
  import {
71
72
  ConfigManager
72
- } from "./chunk-LNW3ASRM.js";
73
- import "./chunk-2ZD3YTVM.js";
73
+ } from "./chunk-3Q2B5YQP.js";
74
+ import "./chunk-TZQHYZKT.js";
74
75
  import {
75
76
  AGENTIC_BEHAVIOR_GUIDELINE,
76
77
  AUTHOR,
@@ -89,7 +90,7 @@ import {
89
90
  SKILLS_DIR_NAME,
90
91
  VERSION,
91
92
  buildUserIdentityPrompt
92
- } from "./chunk-PDN5D35Y.js";
93
+ } from "./chunk-CQDCL3CR.js";
93
94
  import {
94
95
  formatGitContextForPrompt,
95
96
  getGitContext,
@@ -1175,7 +1176,8 @@ Details: ${errMsg.split("\n")[0]}
1175
1176
  if (result.content && !result.toolCalls) {
1176
1177
  const hasWriteTools = toolDefs.some((t) => t.name === "write_file" || t.name === "edit_file");
1177
1178
  const alreadyWrote = hadPreviousWriteToolCalls(extraMessages);
1178
- if (hasWriteTools && !alreadyWrote && detectsHallucinatedFileOp(result.content) && round < maxToolRounds - 1) {
1179
+ const bashRanThisTurn = extractBashCommands(extraMessages).length > 0;
1180
+ if (hasWriteTools && !alreadyWrote && !bashRanThisTurn && detectsHallucinatedFileOp(result.content) && round < maxToolRounds - 1) {
1179
1181
  this.send({ type: "info", message: "\u26A0 Hallucinated completion detected, forcing retry..." });
1180
1182
  const reasoningField = result.reasoningContent ? { reasoning_content: result.reasoningContent } : this.currentProvider === "deepseek" ? { reasoning_content: "" } : {};
1181
1183
  extraMessages.push(
@@ -2575,7 +2577,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2575
2577
  case "test": {
2576
2578
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2577
2579
  try {
2578
- const { executeTests } = await import("./run-tests-5JRF7VYH.js");
2580
+ const { executeTests } = await import("./run-tests-3G2PJXGO.js");
2579
2581
  const argStr = args.join(" ").trim();
2580
2582
  let testArgs = {};
2581
2583
  if (argStr) {
@@ -3,20 +3,20 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-DDSYKCPE.js";
6
+ } from "./chunk-MSUBGV52.js";
7
7
  import "./chunk-HDSKW7Q3.js";
8
8
  import "./chunk-ZWVIDFGY.js";
9
- import "./chunk-W24BZLEM.js";
9
+ import "./chunk-X65N6VMM.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-WK3PULZ7.js";
12
+ } from "./chunk-AUOY5WJL.js";
13
13
  import {
14
14
  getDangerLevel
15
15
  } from "./chunk-NXXNLLSG.js";
16
- import "./chunk-2ZD3YTVM.js";
16
+ import "./chunk-TZQHYZKT.js";
17
17
  import {
18
18
  SUBAGENT_ALLOWED_TOOLS
19
- } from "./chunk-PDN5D35Y.js";
19
+ } from "./chunk-CQDCL3CR.js";
20
20
  import "./chunk-4BKXL7SM.js";
21
21
  import "./chunk-MM3F43H6.js";
22
22
  import "./chunk-KHYD3WXE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.164",
3
+ "version": "0.4.166",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",