jinzd-ai-cli 0.4.184 → 0.4.186

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 (25) hide show
  1. package/dist/{batch-ROTBHZ56.js → batch-IPALJR2D.js} +2 -2
  2. package/dist/{chunk-NVCB6SFZ.js → chunk-2CLMIRKL.js} +1 -1
  3. package/dist/{chunk-HNSN575P.js → chunk-7HMX2MTY.js} +1 -1
  4. package/dist/{chunk-7D67AR56.js → chunk-A3I5WP5L.js} +1 -1
  5. package/dist/{chunk-4JWMT7XQ.js → chunk-JBTVDYJM.js} +3 -3
  6. package/dist/{chunk-WLMBMRIA.js → chunk-KNGDSMMF.js} +1 -1
  7. package/dist/{chunk-2DVGTYZG.js → chunk-MIXN7VBY.js} +1 -1
  8. package/dist/{chunk-QLHGIWTT.js → chunk-OFP5BE7H.js} +2 -2
  9. package/dist/{chunk-5LK7H45B.js → chunk-RADH6ECW.js} +8 -3
  10. package/dist/{chunk-BLRPRWZX.js → chunk-V37XOYOE.js} +11 -2
  11. package/dist/{chunk-PS6S4IIW.js → chunk-V7NTQ6UB.js} +1 -1
  12. package/dist/{chunk-WGJ7LE6T.js → chunk-ZLWYP3RB.js} +1 -1
  13. package/dist/{ci-Y5JKHJPG.js → ci-FYXVC5MX.js} +3 -3
  14. package/dist/{constants-UGNL2FJR.js → constants-RB5H7L34.js} +1 -1
  15. package/dist/{doctor-cli-6OZTPWTL.js → doctor-cli-ZWLHBS43.js} +5 -5
  16. package/dist/electron-server.js +21 -7
  17. package/dist/{hub-UMVOJF26.js → hub-X4OBH5A3.js} +1 -1
  18. package/dist/index.js +19 -19
  19. package/dist/{run-tests-L6773UMG.js → run-tests-625NA546.js} +1 -1
  20. package/dist/{run-tests-JHICSWKH.js → run-tests-CRVIUT4O.js} +2 -2
  21. package/dist/{server-D2NQLJBH.js → server-O6ZMNWNS.js} +9 -9
  22. package/dist/{server-KUJV27ZT.js → server-Q3A737OP.js} +4 -4
  23. package/dist/{task-orchestrator-DTX44RG2.js → task-orchestrator-TLUGDQMO.js} +4 -4
  24. package/dist/{usage-4724JLXN.js → usage-B4OU5CDJ.js} +20 -7
  25. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-WLMBMRIA.js";
4
+ } from "./chunk-KNGDSMMF.js";
5
5
  import "./chunk-TZQHYZKT.js";
6
- import "./chunk-2DVGTYZG.js";
6
+ import "./chunk-MIXN7VBY.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
 
9
9
  // src/cli/batch.ts
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-2DVGTYZG.js";
4
+ } from "./chunk-MIXN7VBY.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -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.184";
9
+ var VERSION = "0.4.186";
10
10
  var APP_NAME = "ai-cli";
11
11
  var CONFIG_DIR_NAME = ".aicli";
12
12
  var CONFIG_FILE_NAME = "config.json";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  computeCost,
4
4
  formatCost
5
- } from "./chunk-BLRPRWZX.js";
5
+ } from "./chunk-V37XOYOE.js";
6
6
 
7
7
  // src/core/cost-tracker.ts
8
8
  import { existsSync, readFileSync, writeFileSync, renameSync } from "fs";
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-HDSKW7Q3.js";
6
6
  import {
7
7
  runTestsTool
8
- } from "./chunk-NVCB6SFZ.js";
8
+ } from "./chunk-2CLMIRKL.js";
9
9
  import {
10
10
  runTool
11
- } from "./chunk-PS6S4IIW.js";
11
+ } from "./chunk-V7NTQ6UB.js";
12
12
  import {
13
13
  getDangerLevel,
14
14
  isFileWriteTool
@@ -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-2DVGTYZG.js";
28
+ } from "./chunk-MIXN7VBY.js";
29
29
  import {
30
30
  fileCheckpoints
31
31
  } from "./chunk-4BKXL7SM.js";
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-2DVGTYZG.js";
11
+ } from "./chunk-MIXN7VBY.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
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.184";
4
+ var VERSION = "0.4.186";
5
5
  var APP_NAME = "ai-cli";
6
6
  var CONFIG_DIR_NAME = ".aicli";
7
7
  var CONFIG_FILE_NAME = "config.json";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  truncateForPersist
4
- } from "./chunk-4JWMT7XQ.js";
4
+ } from "./chunk-JBTVDYJM.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-2DVGTYZG.js";
14
+ } from "./chunk-MIXN7VBY.js";
15
15
 
16
16
  // src/mcp/client.ts
17
17
  import { spawn } from "child_process";
@@ -2798,13 +2798,16 @@ var OllamaProvider = class extends OpenAICompatibleProvider {
2798
2798
  async initialize(apiKey, options) {
2799
2799
  const baseUrl = options?.baseUrl ?? this.defaultBaseUrl;
2800
2800
  await super.initialize(apiKey || "ollama", { ...options, baseUrl });
2801
- await this.tryConnect();
2801
+ await this.tryConnect(true);
2802
2802
  }
2803
2803
  /**
2804
2804
  * 尝试通过 OpenAI client 的 models.list() 刷新 Ollama 模型列表。
2805
2805
  * 成功返回 true,失败返回 false(不抛异常)。
2806
+ *
2807
+ * @param silent 为 true 时连接失败不写 stderr(用于启动探测;没装 Ollama 不该打扰用户)。
2808
+ * 用户主动选择 Ollama(listModels / validateApiKey)时保留诊断输出。
2806
2809
  */
2807
- async tryConnect() {
2810
+ async tryConnect(silent = false) {
2808
2811
  try {
2809
2812
  const response = await this.client.models.list();
2810
2813
  const modelIds = response.data.map((m) => m.id);
@@ -2828,8 +2831,10 @@ var OllamaProvider = class extends OpenAICompatibleProvider {
2828
2831
  });
2829
2832
  return true;
2830
2833
  } catch (err) {
2831
- process.stderr.write(`[ollama] connect failed: ${err instanceof Error ? err.message : String(err)}
2834
+ if (!silent) {
2835
+ process.stderr.write(`[ollama] connect failed: ${err instanceof Error ? err.message : String(err)}
2832
2836
  `);
2837
+ }
2833
2838
  return false;
2834
2839
  }
2835
2840
  }
@@ -16,6 +16,10 @@ var PRICING_TABLE = {
16
16
  "claude-3-5-haiku": { input: 0.8, output: 4, cacheWrite: 1, cacheRead: 0.08 },
17
17
  "claude-3-opus": { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.5 },
18
18
  // ── OpenAI ────────────────────────────────────────────────────
19
+ // GAP (v0.4.184): the GPT-5 family (gpt-5, gpt-5-mini/nano, gpt-5.4, gpt-5.4-pro)
20
+ // and o4-mini are in the provider's model list but have NO verified pricing yet —
21
+ // left unpriced on purpose so `aicli usage` shows "—" (unknown) rather than a
22
+ // deceptive $0.00. Add real rates when confirmed from the official pricing page.
19
23
  "gpt-4o": { input: 2.5, output: 10, cacheRead: 1.25 },
20
24
  "gpt-4o-mini": { input: 0.15, output: 0.6, cacheRead: 0.075 },
21
25
  "gpt-4-turbo": { input: 10, output: 30 },
@@ -61,10 +65,15 @@ var PRICING_TABLE = {
61
65
  "glm-z1": { input: 0.5, output: 1.5 },
62
66
  "glm-z1-air": { input: 0.2, output: 0.6 },
63
67
  "glm-z1-flash": { input: 0, output: 0 }
68
+ // ── MiniMax (海螺) ────────────────────────────────────────────
69
+ // GAP (v0.4.184): MiniMax-M3 / M2.x are unpriced — no verified rate anchor yet.
70
+ // Unpriced → `aicli usage` shows "—" (unknown), not a false $0.00. Add when confirmed.
64
71
  // ── OpenRouter (pass-through — actual cost depends on underlying model) ──
65
- // Left empty; callers should resolve via underlying model ID.
72
+ // Left empty by design: model IDs are "vendor/model" (e.g. anthropic/claude-sonnet-4)
73
+ // and the real price is set by the underlying model + OpenRouter markup, not statically
74
+ // resolvable here. Shows "—" (unknown) in `aicli usage`.
66
75
  // ── Ollama (local, zero cost) ─────────────────────────────────
67
- // Handled via provider check below.
76
+ // Handled via provider check below (FREE_PROVIDERS → genuine $0.00, not "unknown").
68
77
  };
69
78
  var FREE_PROVIDERS = /* @__PURE__ */ new Set(["ollama"]);
70
79
  function getPricing(provider, model) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONFIG_DIR_NAME
4
- } from "./chunk-2DVGTYZG.js";
4
+ } from "./chunk-MIXN7VBY.js";
5
5
 
6
6
  // src/diagnostics/tool-stats.ts
7
7
  import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync } from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  VERSION
5
- } from "./chunk-2DVGTYZG.js";
5
+ } from "./chunk-MIXN7VBY.js";
6
6
 
7
7
  // src/diagnostics/crash-log.ts
8
8
  import {
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-HLWUDRBO.js";
7
7
  import {
8
8
  ProviderRegistry
9
- } from "./chunk-5LK7H45B.js";
9
+ } from "./chunk-RADH6ECW.js";
10
10
  import "./chunk-HIU2SH4V.js";
11
11
  import {
12
12
  ConfigManager
13
- } from "./chunk-WLMBMRIA.js";
13
+ } from "./chunk-KNGDSMMF.js";
14
14
  import "./chunk-TZQHYZKT.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-2DVGTYZG.js";
17
+ } from "./chunk-MIXN7VBY.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-2DVGTYZG.js";
39
+ } from "./chunk-MIXN7VBY.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-WGJ7LE6T.js";
5
+ } from "./chunk-ZLWYP3RB.js";
6
6
  import {
7
7
  ProviderRegistry
8
- } from "./chunk-5LK7H45B.js";
8
+ } from "./chunk-RADH6ECW.js";
9
9
  import {
10
10
  getStatsSnapshot,
11
11
  getTopFailingTools,
12
12
  getTopUsedTools,
13
13
  resetStats
14
- } from "./chunk-PS6S4IIW.js";
14
+ } from "./chunk-V7NTQ6UB.js";
15
15
  import "./chunk-HIU2SH4V.js";
16
16
  import {
17
17
  ConfigManager
18
- } from "./chunk-WLMBMRIA.js";
18
+ } from "./chunk-KNGDSMMF.js";
19
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-2DVGTYZG.js";
24
+ } from "./chunk-MIXN7VBY.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-HNSN575P.js";
39
+ } from "./chunk-7HMX2MTY.js";
40
40
  import {
41
41
  hasSemanticIndex,
42
42
  semanticSearch
@@ -3326,13 +3326,16 @@ var OllamaProvider = class extends OpenAICompatibleProvider {
3326
3326
  async initialize(apiKey, options) {
3327
3327
  const baseUrl = options?.baseUrl ?? this.defaultBaseUrl;
3328
3328
  await super.initialize(apiKey || "ollama", { ...options, baseUrl });
3329
- await this.tryConnect();
3329
+ await this.tryConnect(true);
3330
3330
  }
3331
3331
  /**
3332
3332
  * 尝试通过 OpenAI client 的 models.list() 刷新 Ollama 模型列表。
3333
3333
  * 成功返回 true,失败返回 false(不抛异常)。
3334
+ *
3335
+ * @param silent 为 true 时连接失败不写 stderr(用于启动探测;没装 Ollama 不该打扰用户)。
3336
+ * 用户主动选择 Ollama(listModels / validateApiKey)时保留诊断输出。
3334
3337
  */
3335
- async tryConnect() {
3338
+ async tryConnect(silent = false) {
3336
3339
  try {
3337
3340
  const response = await this.client.models.list();
3338
3341
  const modelIds = response.data.map((m) => m.id);
@@ -3356,8 +3359,10 @@ var OllamaProvider = class extends OpenAICompatibleProvider {
3356
3359
  });
3357
3360
  return true;
3358
3361
  } catch (err) {
3359
- process.stderr.write(`[ollama] connect failed: ${err instanceof Error ? err.message : String(err)}
3362
+ if (!silent) {
3363
+ process.stderr.write(`[ollama] connect failed: ${err instanceof Error ? err.message : String(err)}
3360
3364
  `);
3365
+ }
3361
3366
  return false;
3362
3367
  }
3363
3368
  }
@@ -11016,6 +11021,10 @@ var PRICING_TABLE = {
11016
11021
  "claude-3-5-haiku": { input: 0.8, output: 4, cacheWrite: 1, cacheRead: 0.08 },
11017
11022
  "claude-3-opus": { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.5 },
11018
11023
  // ── OpenAI ────────────────────────────────────────────────────
11024
+ // GAP (v0.4.184): the GPT-5 family (gpt-5, gpt-5-mini/nano, gpt-5.4, gpt-5.4-pro)
11025
+ // and o4-mini are in the provider's model list but have NO verified pricing yet —
11026
+ // left unpriced on purpose so `aicli usage` shows "—" (unknown) rather than a
11027
+ // deceptive $0.00. Add real rates when confirmed from the official pricing page.
11019
11028
  "gpt-4o": { input: 2.5, output: 10, cacheRead: 1.25 },
11020
11029
  "gpt-4o-mini": { input: 0.15, output: 0.6, cacheRead: 0.075 },
11021
11030
  "gpt-4-turbo": { input: 10, output: 30 },
@@ -11061,10 +11070,15 @@ var PRICING_TABLE = {
11061
11070
  "glm-z1": { input: 0.5, output: 1.5 },
11062
11071
  "glm-z1-air": { input: 0.2, output: 0.6 },
11063
11072
  "glm-z1-flash": { input: 0, output: 0 }
11073
+ // ── MiniMax (海螺) ────────────────────────────────────────────
11074
+ // GAP (v0.4.184): MiniMax-M3 / M2.x are unpriced — no verified rate anchor yet.
11075
+ // Unpriced → `aicli usage` shows "—" (unknown), not a false $0.00. Add when confirmed.
11064
11076
  // ── OpenRouter (pass-through — actual cost depends on underlying model) ──
11065
- // Left empty; callers should resolve via underlying model ID.
11077
+ // Left empty by design: model IDs are "vendor/model" (e.g. anthropic/claude-sonnet-4)
11078
+ // and the real price is set by the underlying model + OpenRouter markup, not statically
11079
+ // resolvable here. Shows "—" (unknown) in `aicli usage`.
11066
11080
  // ── Ollama (local, zero cost) ─────────────────────────────────
11067
- // Handled via provider check below.
11081
+ // Handled via provider check below (FREE_PROVIDERS → genuine $0.00, not "unknown").
11068
11082
  };
11069
11083
  var FREE_PROVIDERS = /* @__PURE__ */ new Set(["ollama"]);
11070
11084
  function getPricing(provider, model) {
@@ -13852,7 +13866,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
13852
13866
  case "test": {
13853
13867
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
13854
13868
  try {
13855
- const { executeTests } = await import("./run-tests-L6773UMG.js");
13869
+ const { executeTests } = await import("./run-tests-625NA546.js");
13856
13870
  const argStr = args.join(" ").trim();
13857
13871
  let testArgs = {};
13858
13872
  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-DTX44RG2.js");
158
+ const { TaskOrchestrator } = await import("./task-orchestrator-TLUGDQMO.js");
159
159
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
160
160
  let interrupted = false;
161
161
  const onSigint = () => {
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  saveDevState,
16
16
  sessionHasMeaningfulContent,
17
17
  setupProxy
18
- } from "./chunk-QLHGIWTT.js";
18
+ } from "./chunk-OFP5BE7H.js";
19
19
  import {
20
20
  ToolExecutor,
21
21
  ToolRegistry,
@@ -34,27 +34,27 @@ import {
34
34
  spawnAgentContext,
35
35
  theme,
36
36
  undoStack
37
- } from "./chunk-4JWMT7XQ.js";
37
+ } from "./chunk-JBTVDYJM.js";
38
38
  import "./chunk-HDSKW7Q3.js";
39
39
  import "./chunk-ZWVIDFGY.js";
40
- import "./chunk-NVCB6SFZ.js";
40
+ import "./chunk-2CLMIRKL.js";
41
41
  import {
42
42
  SessionManager,
43
43
  getContentText
44
44
  } from "./chunk-RIVZNS3K.js";
45
45
  import {
46
46
  CostTracker
47
- } from "./chunk-7D67AR56.js";
47
+ } from "./chunk-A3I5WP5L.js";
48
48
  import {
49
49
  computeCost,
50
50
  formatCost,
51
51
  getPricing
52
- } from "./chunk-BLRPRWZX.js";
52
+ } from "./chunk-V37XOYOE.js";
53
53
  import {
54
54
  getConfigDirUsage,
55
55
  listRecentCrashes,
56
56
  writeCrashLog
57
- } from "./chunk-WGJ7LE6T.js";
57
+ } from "./chunk-ZLWYP3RB.js";
58
58
  import {
59
59
  BudgetWarner,
60
60
  CONTENT_ONLY_STREAM_REMINDER,
@@ -84,17 +84,17 @@ import {
84
84
  stripPseudoToolCalls,
85
85
  stripToolCallReminder,
86
86
  summarizeRecentTools
87
- } from "./chunk-5LK7H45B.js";
87
+ } from "./chunk-RADH6ECW.js";
88
88
  import {
89
89
  getStatsSnapshot,
90
90
  getTopFailingTools,
91
91
  getTopUsedTools,
92
92
  installFlushOnExit
93
- } from "./chunk-PS6S4IIW.js";
93
+ } from "./chunk-V7NTQ6UB.js";
94
94
  import "./chunk-HIU2SH4V.js";
95
95
  import {
96
96
  ConfigManager
97
- } from "./chunk-WLMBMRIA.js";
97
+ } from "./chunk-KNGDSMMF.js";
98
98
  import {
99
99
  AuthError,
100
100
  ProviderError,
@@ -121,7 +121,7 @@ import {
121
121
  SKILLS_DIR_NAME,
122
122
  VERSION,
123
123
  buildUserIdentityPrompt
124
- } from "./chunk-2DVGTYZG.js";
124
+ } from "./chunk-MIXN7VBY.js";
125
125
  import {
126
126
  formatGitContextForPrompt,
127
127
  getGitContext,
@@ -1836,7 +1836,7 @@ No tools match "${filter}".
1836
1836
  const { join: join5 } = await import("path");
1837
1837
  const { existsSync: existsSync5 } = await import("fs");
1838
1838
  const { getGitRoot: getGitRoot2 } = await import("./git-context-7KIP4X2V.js");
1839
- const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-UGNL2FJR.js");
1839
+ const { MCP_PROJECT_CONFIG_NAME: MCP_PROJECT_CONFIG_NAME2 } = await import("./constants-RB5H7L34.js");
1840
1840
  const { approveProject, hashMcpFile } = await import("./project-trust-IFM7FXEV.js");
1841
1841
  const cwd = process.cwd();
1842
1842
  const projectRoot = getGitRoot2(cwd) ?? cwd;
@@ -2897,7 +2897,7 @@ ${hint}` : "")
2897
2897
  usage: "/test [command|filter]",
2898
2898
  async execute(args, ctx) {
2899
2899
  try {
2900
- const { executeTests } = await import("./run-tests-JHICSWKH.js");
2900
+ const { executeTests } = await import("./run-tests-CRVIUT4O.js");
2901
2901
  const argStr = args.join(" ").trim();
2902
2902
  let testArgs = {};
2903
2903
  if (argStr) {
@@ -7360,7 +7360,7 @@ program.command("web").description("Start Web UI server with browser-based chat
7360
7360
  console.error("Error: Invalid port number. Must be between 1 and 65535.");
7361
7361
  process.exit(1);
7362
7362
  }
7363
- const { startWebServer } = await import("./server-D2NQLJBH.js");
7363
+ const { startWebServer } = await import("./server-O6ZMNWNS.js");
7364
7364
  await startWebServer({ port, host: options.host });
7365
7365
  });
7366
7366
  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) => {
@@ -7527,16 +7527,16 @@ program.command("sessions").description("List recent conversation sessions").opt
7527
7527
  console.log(footer + "\n");
7528
7528
  });
7529
7529
  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) => {
7530
- const { runUsageCli } = await import("./usage-4724JLXN.js");
7530
+ const { runUsageCli } = await import("./usage-B4OU5CDJ.js");
7531
7531
  await runUsageCli(options);
7532
7532
  });
7533
7533
  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) => {
7534
- const { runDoctorCli } = await import("./doctor-cli-6OZTPWTL.js");
7534
+ const { runDoctorCli } = await import("./doctor-cli-ZWLHBS43.js");
7535
7535
  await runDoctorCli({ json: !!options.json, resetStats: !!options.resetStats });
7536
7536
  });
7537
7537
  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) => {
7538
7538
  try {
7539
- const batch = await import("./batch-ROTBHZ56.js");
7539
+ const batch = await import("./batch-IPALJR2D.js");
7540
7540
  switch (action) {
7541
7541
  case "submit":
7542
7542
  if (!arg) {
@@ -7579,7 +7579,7 @@ program.command("batch <action> [arg] [arg2]").description("Anthropic Message Ba
7579
7579
  }
7580
7580
  });
7581
7581
  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) => {
7582
- const { startMcpServer } = await import("./server-KUJV27ZT.js");
7582
+ const { startMcpServer } = await import("./server-Q3A737OP.js");
7583
7583
  await startMcpServer({
7584
7584
  allowDestructive: !!options.allowDestructive,
7585
7585
  allowOutsideCwd: !!options.allowOutsideCwd,
@@ -7588,7 +7588,7 @@ program.command("mcp-serve").description("Start an MCP server over STDIO, exposi
7588
7588
  });
7589
7589
  });
7590
7590
  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) => {
7591
- const { runCi } = await import("./ci-Y5JKHJPG.js");
7591
+ const { runCi } = await import("./ci-FYXVC5MX.js");
7592
7592
  const result = await runCi({
7593
7593
  pr: options.pr,
7594
7594
  base: options.base,
@@ -7734,7 +7734,7 @@ program.command("hub [topic]").description("Start multi-agent hub (discuss / bra
7734
7734
  }),
7735
7735
  config.get("customProviders")
7736
7736
  );
7737
- const { startHub } = await import("./hub-UMVOJF26.js");
7737
+ const { startHub } = await import("./hub-X4OBH5A3.js");
7738
7738
  await startHub(
7739
7739
  {
7740
7740
  topic: topic ?? "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeTests,
3
3
  runTestsTool
4
- } from "./chunk-HNSN575P.js";
4
+ } from "./chunk-7HMX2MTY.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
  export {
7
7
  executeTests,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  executeTests,
4
4
  runTestsTool
5
- } from "./chunk-NVCB6SFZ.js";
6
- import "./chunk-2DVGTYZG.js";
5
+ } from "./chunk-2CLMIRKL.js";
6
+ import "./chunk-MIXN7VBY.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
9
9
  executeTests,
@@ -19,7 +19,7 @@ import {
19
19
  loadDevState,
20
20
  persistToolRound,
21
21
  setupProxy
22
- } from "./chunk-QLHGIWTT.js";
22
+ } from "./chunk-OFP5BE7H.js";
23
23
  import {
24
24
  ToolExecutor,
25
25
  ToolRegistry,
@@ -37,10 +37,10 @@ import {
37
37
  spawnAgentContext,
38
38
  truncateOutput,
39
39
  undoStack
40
- } from "./chunk-4JWMT7XQ.js";
40
+ } from "./chunk-JBTVDYJM.js";
41
41
  import "./chunk-HDSKW7Q3.js";
42
42
  import "./chunk-ZWVIDFGY.js";
43
- import "./chunk-NVCB6SFZ.js";
43
+ import "./chunk-2CLMIRKL.js";
44
44
  import {
45
45
  SessionManager,
46
46
  getContentText
@@ -48,7 +48,7 @@ import {
48
48
  import {
49
49
  computeCost,
50
50
  formatCost
51
- } from "./chunk-BLRPRWZX.js";
51
+ } from "./chunk-V37XOYOE.js";
52
52
  import {
53
53
  BudgetWarner,
54
54
  CONTENT_ONLY_STREAM_REMINDER,
@@ -73,16 +73,16 @@ import {
73
73
  stripPseudoToolCalls,
74
74
  stripToolCallReminder,
75
75
  summarizeRecentTools
76
- } from "./chunk-5LK7H45B.js";
76
+ } from "./chunk-RADH6ECW.js";
77
77
  import {
78
78
  runTool
79
- } from "./chunk-PS6S4IIW.js";
79
+ } from "./chunk-V7NTQ6UB.js";
80
80
  import {
81
81
  getDangerLevel
82
82
  } from "./chunk-HIU2SH4V.js";
83
83
  import {
84
84
  ConfigManager
85
- } from "./chunk-WLMBMRIA.js";
85
+ } from "./chunk-KNGDSMMF.js";
86
86
  import "./chunk-TZQHYZKT.js";
87
87
  import {
88
88
  AGENTIC_BEHAVIOR_GUIDELINE,
@@ -102,7 +102,7 @@ import {
102
102
  SKILLS_DIR_NAME,
103
103
  VERSION,
104
104
  buildUserIdentityPrompt
105
- } from "./chunk-2DVGTYZG.js";
105
+ } from "./chunk-MIXN7VBY.js";
106
106
  import {
107
107
  formatGitContextForPrompt,
108
108
  getGitContext,
@@ -2489,7 +2489,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
2489
2489
  case "test": {
2490
2490
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
2491
2491
  try {
2492
- const { executeTests } = await import("./run-tests-JHICSWKH.js");
2492
+ const { executeTests } = await import("./run-tests-CRVIUT4O.js");
2493
2493
  const argStr = args.join(" ").trim();
2494
2494
  let testArgs = {};
2495
2495
  if (argStr) {
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-4JWMT7XQ.js";
4
+ } from "./chunk-JBTVDYJM.js";
5
5
  import "./chunk-HDSKW7Q3.js";
6
6
  import "./chunk-ZWVIDFGY.js";
7
- import "./chunk-NVCB6SFZ.js";
7
+ import "./chunk-2CLMIRKL.js";
8
8
  import {
9
9
  runTool
10
- } from "./chunk-PS6S4IIW.js";
10
+ } from "./chunk-V7NTQ6UB.js";
11
11
  import {
12
12
  getDangerLevel,
13
13
  schemaToJsonSchema
@@ -15,7 +15,7 @@ import {
15
15
  import "./chunk-TZQHYZKT.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-2DVGTYZG.js";
18
+ } from "./chunk-MIXN7VBY.js";
19
19
  import "./chunk-4BKXL7SM.js";
20
20
  import "./chunk-MM3F43H6.js";
21
21
  import "./chunk-KHYD3WXE.js";
@@ -3,20 +3,20 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-4JWMT7XQ.js";
6
+ } from "./chunk-JBTVDYJM.js";
7
7
  import "./chunk-HDSKW7Q3.js";
8
8
  import "./chunk-ZWVIDFGY.js";
9
- import "./chunk-NVCB6SFZ.js";
9
+ import "./chunk-2CLMIRKL.js";
10
10
  import {
11
11
  runTool
12
- } from "./chunk-PS6S4IIW.js";
12
+ } from "./chunk-V7NTQ6UB.js";
13
13
  import {
14
14
  getDangerLevel
15
15
  } from "./chunk-HIU2SH4V.js";
16
16
  import "./chunk-TZQHYZKT.js";
17
17
  import {
18
18
  SUBAGENT_ALLOWED_TOOLS
19
- } from "./chunk-2DVGTYZG.js";
19
+ } from "./chunk-MIXN7VBY.js";
20
20
  import "./chunk-4BKXL7SM.js";
21
21
  import "./chunk-MM3F43H6.js";
22
22
  import "./chunk-KHYD3WXE.js";
@@ -1,18 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CostTracker
4
- } from "./chunk-7D67AR56.js";
4
+ } from "./chunk-A3I5WP5L.js";
5
5
  import {
6
- formatCost
7
- } from "./chunk-BLRPRWZX.js";
6
+ formatCost,
7
+ getPricing
8
+ } from "./chunk-V37XOYOE.js";
8
9
  import {
9
10
  ConfigManager
10
- } from "./chunk-WLMBMRIA.js";
11
+ } from "./chunk-KNGDSMMF.js";
11
12
  import "./chunk-TZQHYZKT.js";
12
- import "./chunk-2DVGTYZG.js";
13
+ import "./chunk-MIXN7VBY.js";
13
14
  import "./chunk-PDX44BCA.js";
14
15
 
15
16
  // src/cli/usage.ts
17
+ function classifyRowCost(row) {
18
+ if (row.cost > 0) return "paid";
19
+ if (row.provider === "(unattributed)") return "legacy";
20
+ return getPricing(row.provider, row.model) ? "free" : "unknown";
21
+ }
16
22
  function num(n) {
17
23
  return n.toLocaleString("en-US");
18
24
  }
@@ -56,11 +62,14 @@ async function runUsageCli(options = {}) {
56
62
  " " + chalk.bold("Provider / Model".padEnd(nameW)) + chalk.bold("Calls".padStart(7)) + chalk.bold("Input".padStart(14)) + chalk.bold("Output".padStart(14)) + chalk.bold("Cost".padStart(13))
57
63
  );
58
64
  console.log(rule);
65
+ let unknownCount = 0;
59
66
  for (const r of rows) {
60
- const isFree = r.cost === 0;
67
+ const cls = classifyRowCost(r);
68
+ if (cls === "unknown") unknownCount++;
61
69
  const namePad = r.provider === "(unattributed)" ? chalk.dim("(unattributed, pre-v0.4.184)".padEnd(nameW)) : chalk.cyan(label(r).padEnd(nameW));
70
+ const costCell = cls === "paid" ? chalk.cyan(formatCost(r.cost).padStart(13)) : cls === "unknown" ? chalk.yellow("\u2014".padStart(13)) : chalk.dim("$0.00".padStart(13));
62
71
  console.log(
63
- " " + namePad + chalk.white(num(r.calls).padStart(7)) + chalk.white(num(r.inputTokens).padStart(14)) + chalk.white(num(r.outputTokens).padStart(14)) + (isFree ? chalk.dim("$0.00".padStart(13)) : chalk.cyan(formatCost(r.cost).padStart(13)))
72
+ " " + namePad + chalk.white(num(r.calls).padStart(7)) + chalk.white(num(r.inputTokens).padStart(14)) + chalk.white(num(r.outputTokens).padStart(14)) + costCell
64
73
  );
65
74
  }
66
75
  console.log(rule);
@@ -70,11 +79,15 @@ async function runUsageCli(options = {}) {
70
79
  if (totals.cacheReadTokens > 0) {
71
80
  console.log(chalk.dim(` (incl. ${num(totals.cacheReadTokens)} cached-read tokens billed at the cache rate)`));
72
81
  }
82
+ if (unknownCount > 0) {
83
+ console.log(chalk.yellow(` \u2014 = no pricing data for ${unknownCount} model(s); their tokens are tracked but cost is excluded from the total.`));
84
+ }
73
85
  console.log();
74
86
  }
75
87
  function label(r) {
76
88
  return r.model ? `${r.provider}/${r.model}` : r.provider;
77
89
  }
78
90
  export {
91
+ classifyRowCost,
79
92
  runUsageCli
80
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.184",
3
+ "version": "0.4.186",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",