jinzd-ai-cli 0.4.265 → 0.4.267

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 (33) hide show
  1. package/dist/{batch-C7SHXRQ2.js → batch-GY5MAN5F.js} +2 -2
  2. package/dist/{chunk-TJBG4F2R.js → chunk-5AEOIETL.js} +4 -4
  3. package/dist/{chunk-NOS3QV7G.js → chunk-5CU72V6P.js} +3 -3
  4. package/dist/{chunk-IFTUBTDA.js → chunk-6C6FLDGH.js} +1 -1
  5. package/dist/{chunk-M2RKBTVZ.js → chunk-7HECI3U5.js} +1 -1
  6. package/dist/{chunk-NJLPA6S4.js → chunk-ARYCWJN6.js} +1 -1
  7. package/dist/{chunk-X6NWK2YK.js → chunk-EWRZMIQE.js} +1 -1
  8. package/dist/{chunk-YXYOLPDB.js → chunk-FI6IWUXW.js} +1 -1
  9. package/dist/{chunk-CVI3LSGR.js → chunk-JH343BDI.js} +105 -2
  10. package/dist/{chunk-E3JRGJCJ.js → chunk-QN7WD2SM.js} +3 -3
  11. package/dist/{chunk-V4D7YD24.js → chunk-R7GERZDA.js} +145 -4
  12. package/dist/{chunk-LZBD2VGJ.js → chunk-RVNL7MQG.js} +1 -1
  13. package/dist/{chunk-Y7KJPNQI.js → chunk-THHPKZJ3.js} +1 -1
  14. package/dist/{chunk-2MR7EP24.js → chunk-WPN7LDLM.js} +1 -1
  15. package/dist/{chunk-YDTYBUAB.js → chunk-XLLUQEGO.js} +1 -1
  16. package/dist/{ci-TDXLI3OM.js → ci-MUEQSNKU.js} +4 -4
  17. package/dist/{ci-format-AFX2LP4Y.js → ci-format-2ZGGSOFK.js} +2 -2
  18. package/dist/{constants-66TQEDGO.js → constants-SZTJESDF.js} +1 -1
  19. package/dist/{doctor-cli-GMCOGCDR.js → doctor-cli-Z272364P.js} +4 -4
  20. package/dist/electron-server.js +781 -420
  21. package/dist/{hub-2YXETHPY.js → hub-MRLGKMRI.js} +1 -1
  22. package/dist/index.js +51 -93
  23. package/dist/{persistent-memory-WTZO5CQ7.js → persistent-memory-3FTOC7QT.js} +2 -2
  24. package/dist/{persistent-memory-2DKCETB7.js → persistent-memory-HZASMDJQ.js} +2 -2
  25. package/dist/{pr-Y2LDG3R7.js → pr-VLLIALRK.js} +4 -4
  26. package/dist/{run-tests-FIUGDIDL.js → run-tests-6MWE6D5S.js} +2 -2
  27. package/dist/{run-tests-PWTNSUVP.js → run-tests-NTDZ6DDU.js} +2 -2
  28. package/dist/{server-OZ4RFDFH.js → server-IALCWKSU.js} +61 -48
  29. package/dist/{server-ZCG5QD6P.js → server-SP3AEHRQ.js} +5 -5
  30. package/dist/{task-orchestrator-Q2L6JEUX.js → task-orchestrator-Q6WFFI4J.js} +5 -5
  31. package/dist/{usage-SDL5Z4CS.js → usage-DJDLHICZ.js} +4 -6
  32. package/package.json +1 -1
  33. package/dist/chunk-YRD6M5XI.js +0 -149
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ToolRegistry
4
- } from "./chunk-TJBG4F2R.js";
5
- import "./chunk-LZBD2VGJ.js";
4
+ } from "./chunk-5AEOIETL.js";
5
+ import "./chunk-RVNL7MQG.js";
6
6
  import "./chunk-GLSR2NR3.js";
7
7
  import "./chunk-UUSRWSSX.js";
8
8
  import "./chunk-CKH4KQ4E.js";
@@ -10,7 +10,7 @@ import "./chunk-BXP6YZ2P.js";
10
10
  import "./chunk-5C76XDDF.js";
11
11
  import {
12
12
  runTool
13
- } from "./chunk-2MR7EP24.js";
13
+ } from "./chunk-WPN7LDLM.js";
14
14
  import {
15
15
  getDangerLevel,
16
16
  schemaToJsonSchema
@@ -18,10 +18,10 @@ import {
18
18
  import "./chunk-TU3L3PW7.js";
19
19
  import "./chunk-HOSJZMQS.js";
20
20
  import "./chunk-4BKXL7SM.js";
21
- import "./chunk-YDTYBUAB.js";
21
+ import "./chunk-XLLUQEGO.js";
22
22
  import {
23
23
  VERSION
24
- } from "./chunk-Y7KJPNQI.js";
24
+ } from "./chunk-THHPKZJ3.js";
25
25
  import "./chunk-6RPGQ5CG.js";
26
26
  import "./chunk-KHYD3WXE.js";
27
27
  import "./chunk-NYNSYLFY.js";
@@ -3,8 +3,8 @@ import {
3
3
  ToolRegistry,
4
4
  googleSearchContext,
5
5
  truncateOutput
6
- } from "./chunk-TJBG4F2R.js";
7
- import "./chunk-LZBD2VGJ.js";
6
+ } from "./chunk-5AEOIETL.js";
7
+ import "./chunk-RVNL7MQG.js";
8
8
  import "./chunk-GLSR2NR3.js";
9
9
  import "./chunk-UUSRWSSX.js";
10
10
  import "./chunk-CKH4KQ4E.js";
@@ -12,7 +12,7 @@ import "./chunk-BXP6YZ2P.js";
12
12
  import "./chunk-5C76XDDF.js";
13
13
  import {
14
14
  runTool
15
- } from "./chunk-2MR7EP24.js";
15
+ } from "./chunk-WPN7LDLM.js";
16
16
  import {
17
17
  getDangerLevel,
18
18
  runLeanAgentLoop
@@ -20,10 +20,10 @@ import {
20
20
  import "./chunk-TU3L3PW7.js";
21
21
  import "./chunk-HOSJZMQS.js";
22
22
  import "./chunk-4BKXL7SM.js";
23
- import "./chunk-YDTYBUAB.js";
23
+ import "./chunk-XLLUQEGO.js";
24
24
  import {
25
25
  SUBAGENT_ALLOWED_TOOLS
26
- } from "./chunk-Y7KJPNQI.js";
26
+ } from "./chunk-THHPKZJ3.js";
27
27
  import "./chunk-6RPGQ5CG.js";
28
28
  import "./chunk-KHYD3WXE.js";
29
29
  import "./chunk-NYNSYLFY.js";
@@ -1,16 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- CostTracker
4
- } from "./chunk-V4D7YD24.js";
5
- import {
3
+ CostTracker,
6
4
  formatCost,
7
5
  getPricing
8
- } from "./chunk-YRD6M5XI.js";
6
+ } from "./chunk-R7GERZDA.js";
9
7
  import {
10
8
  ConfigManager
11
- } from "./chunk-X6NWK2YK.js";
9
+ } from "./chunk-EWRZMIQE.js";
12
10
  import "./chunk-TU3L3PW7.js";
13
- import "./chunk-Y7KJPNQI.js";
11
+ import "./chunk-THHPKZJ3.js";
14
12
  import "./chunk-IW3Q7AE5.js";
15
13
 
16
14
  // src/cli/usage.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jinzd-ai-cli",
3
- "version": "0.4.265",
3
+ "version": "0.4.267",
4
4
  "description": "Cross-platform REPL-style AI CLI with multi-provider support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,149 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/core/pricing.ts
4
- var DEEPSEEK_CNY_PER_USD = 6.9;
5
- var DEEPSEEK_TIME_PRICING_EFFECTIVE_AT = /* @__PURE__ */ new Date("2026-08-16T16:00:00.000Z");
6
- function deepSeekCnyPricing(cacheRead, input, output) {
7
- return {
8
- cacheRead: cacheRead / DEEPSEEK_CNY_PER_USD,
9
- input: input / DEEPSEEK_CNY_PER_USD,
10
- output: output / DEEPSEEK_CNY_PER_USD
11
- };
12
- }
13
- function getDeepSeekV4Pricing(model, at) {
14
- const isPro = model.startsWith("deepseek-v4-pro");
15
- const isFlash = model.startsWith("deepseek-v4-flash");
16
- if (!isPro && !isFlash) return null;
17
- if (at < DEEPSEEK_TIME_PRICING_EFFECTIVE_AT) {
18
- return isPro ? deepSeekCnyPricing(0.025, 3, 6) : deepSeekCnyPricing(0.02, 1, 2);
19
- }
20
- const beijingHour = (at.getUTCHours() + 8) % 24;
21
- const isPeak = beijingHour >= 9 && beijingHour < 12 || beijingHour >= 14 && beijingHour < 18;
22
- if (isPro) {
23
- return isPeak ? deepSeekCnyPricing(0.3, 9, 27) : deepSeekCnyPricing(0.15, 4.5, 13.5);
24
- }
25
- return isPeak ? deepSeekCnyPricing(0.1, 3, 9) : deepSeekCnyPricing(0.05, 1.5, 4.5);
26
- }
27
- var PRICING_TABLE = {
28
- // ── Anthropic Claude ──────────────────────────────────────────
29
- "claude-opus-4-8": { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.5 },
30
- "claude-opus-4-7": { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.5 },
31
- "claude-opus-4-6": { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.5 },
32
- "claude-opus-4-5": { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.5 },
33
- "claude-sonnet-4-6": { input: 3, output: 15, cacheWrite: 3.75, cacheRead: 0.3 },
34
- "claude-sonnet-4-5-20250929": { input: 3, output: 15, cacheWrite: 3.75, cacheRead: 0.3 },
35
- "claude-haiku-4-5-20251001": { input: 1, output: 5, cacheWrite: 1.25, cacheRead: 0.1 },
36
- "claude-haiku-4-5": { input: 1, output: 5, cacheWrite: 1.25, cacheRead: 0.1 },
37
- // Legacy Claude 3.x families (prefix fallback handles minor date suffixes)
38
- "claude-3-5-sonnet": { input: 3, output: 15, cacheWrite: 3.75, cacheRead: 0.3 },
39
- "claude-3-5-haiku": { input: 0.8, output: 4, cacheWrite: 1, cacheRead: 0.08 },
40
- "claude-3-opus": { input: 15, output: 75, cacheWrite: 18.75, cacheRead: 1.5 },
41
- // ── OpenAI ────────────────────────────────────────────────────
42
- // GAP (v0.4.184): the GPT-5 family (gpt-5, gpt-5-mini/nano, gpt-5.4, gpt-5.4-pro)
43
- // and o4-mini are in the provider's model list but have NO verified pricing yet —
44
- // left unpriced on purpose so `aicli usage` shows "—" (unknown) rather than a
45
- // deceptive $0.00. Add real rates when confirmed from the official pricing page.
46
- "gpt-4o": { input: 2.5, output: 10, cacheRead: 1.25 },
47
- "gpt-4o-mini": { input: 0.15, output: 0.6, cacheRead: 0.075 },
48
- "gpt-4-turbo": { input: 10, output: 30 },
49
- "gpt-4": { input: 30, output: 60 },
50
- "gpt-4.1": { input: 2, output: 8, cacheRead: 0.5 },
51
- "gpt-4.1-mini": { input: 0.4, output: 1.6, cacheRead: 0.1 },
52
- "gpt-4.1-nano": { input: 0.1, output: 0.4, cacheRead: 0.025 },
53
- "o1": { input: 15, output: 60, cacheRead: 7.5 },
54
- "o1-mini": { input: 3, output: 12, cacheRead: 1.5 },
55
- "o3": { input: 10, output: 40, cacheRead: 2.5 },
56
- "o3-mini": { input: 1.1, output: 4.4, cacheRead: 0.55 },
57
- // ── Google Gemini ─────────────────────────────────────────────
58
- "gemini-2.5-pro": { input: 1.25, output: 10 },
59
- "gemini-2.5-flash": { input: 0.3, output: 2.5 },
60
- "gemini-2.0-flash": { input: 0.1, output: 0.4 },
61
- "gemini-1.5-pro": { input: 1.25, output: 5 },
62
- "gemini-1.5-flash": { input: 0.075, output: 0.3 },
63
- // ── DeepSeek ──────────────────────────────────────────────────
64
- // V4 family (2026-04-23+):1M context, Thinking / Non-Thinking dual-mode, 384K max output
65
- // 费率 2026-08-01 对 api-docs.deepseek.com/quick_start/pricing 官方 USD 表逐项核对。
66
- // 修正前 pro 三项整齐高 4×(官方降过价未跟)、flash cacheRead 高 10×(像是按 input 的
67
- // 20% 拍脑袋而非抄文档)——`aicli usage` 因此系统性高报 DeepSeek 成本。
68
- // 待办:官方已公告峰谷定价(北京时间 9-12 点、14-18 点为平时 2 倍),本表仍是单一费率,
69
- // 届时高峰时段会低报;等该策略实际生效后再决定是否引入时段维度。
70
- // Legacy aliases:retires 2026-07-24 UTC 15:59,官方 route 到 V4 Flash。
71
- // 这几条只服务历史 session 的成本回算,保留当时的费率口径,不随现价改动。
72
- "deepseek-chat": { input: 0.14, output: 0.28, cacheRead: 0.028 },
73
- "deepseek-reasoner": { input: 0.14, output: 0.28, cacheRead: 0.028 },
74
- "deepseek-v3": { input: 0.27, output: 1.1, cacheRead: 0.07 },
75
- // ── Moonshot Kimi ─────────────────────────────────────────────
76
- "moonshot-v1-8k": { input: 0.17, output: 0.17 },
77
- "moonshot-v1-32k": { input: 0.33, output: 0.33 },
78
- "moonshot-v1-128k": { input: 0.83, output: 0.83 },
79
- "kimi-k2": { input: 0.6, output: 2.5 },
80
- "kimi-latest": { input: 0.6, output: 2.5 },
81
- // Kimi K3(2026-07 旗舰,1M 上下文)官方定价 platform.kimi.ai/pricing/chat-k3:
82
- // 输入 cache-miss $3.00 / cache-hit $0.30,输出 $15.00(/MTok)。
83
- "kimi-k3": { input: 3, output: 15, cacheRead: 0.3 },
84
- // ── Zhipu GLM ─────────────────────────────────────────────────
85
- "glm-4-plus": { input: 0.7, output: 0.7 },
86
- "glm-4": { input: 0.14, output: 0.14 },
87
- "glm-4-flash": { input: 0, output: 0 },
88
- "glm-4.5": { input: 0.29, output: 1.14 },
89
- "glm-4.6": { input: 0.6, output: 2.2 },
90
- "glm-4.6v": { input: 0.6, output: 2.2 },
91
- "glm-5": { input: 0.85, output: 2.85 },
92
- // GLM-5.2(2026-06)官方直连 API 定价 $1.40 / $4.40。
93
- "glm-5.2": { input: 1.4, output: 4.4 },
94
- // GLM-5V-Turbo(2026-04 视觉编程旗舰)官方直连 API 定价 $1.20 / $4.00。
95
- "glm-5v-turbo": { input: 1.2, output: 4 },
96
- "glm-5.1": { input: 0.95, output: 3.15 },
97
- "glm-5.1-reasoning": { input: 1.4, output: 4.4 },
98
- "glm-5.1-air": { input: 0.4, output: 1.2 },
99
- "glm-z1": { input: 0.5, output: 1.5 },
100
- "glm-z1-air": { input: 0.2, output: 0.6 },
101
- "glm-z1-flash": { input: 0, output: 0 }
102
- // ── MiniMax (海螺) ────────────────────────────────────────────
103
- // GAP (v0.4.184): MiniMax-M3 / M2.x are unpriced — no verified rate anchor yet.
104
- // Unpriced → `aicli usage` shows "—" (unknown), not a false $0.00. Add when confirmed.
105
- // ── OpenRouter (pass-through — actual cost depends on underlying model) ──
106
- // Left empty by design: model IDs are "vendor/model" (e.g. anthropic/claude-sonnet-4)
107
- // and the real price is set by the underlying model + OpenRouter markup, not statically
108
- // resolvable here. Shows "—" (unknown) in `aicli usage`.
109
- // ── Ollama (local, zero cost) ─────────────────────────────────
110
- // Handled via provider check below (FREE_PROVIDERS → genuine $0.00, not "unknown").
111
- };
112
- var FREE_PROVIDERS = /* @__PURE__ */ new Set(["ollama"]);
113
- function getPricing(provider, model, at = /* @__PURE__ */ new Date()) {
114
- if (FREE_PROVIDERS.has(provider.toLowerCase())) {
115
- return { input: 0, output: 0 };
116
- }
117
- const key = model.toLowerCase();
118
- if (provider.toLowerCase() === "deepseek") {
119
- const dynamicPricing = getDeepSeekV4Pricing(key, at);
120
- if (dynamicPricing) return dynamicPricing;
121
- }
122
- if (PRICING_TABLE[key]) return PRICING_TABLE[key];
123
- const keys = Object.keys(PRICING_TABLE).sort((a, b) => b.length - a.length);
124
- for (const k of keys) {
125
- if (key.startsWith(k)) return PRICING_TABLE[k];
126
- }
127
- return null;
128
- }
129
- function computeCost(provider, model, usage, at = /* @__PURE__ */ new Date()) {
130
- const p = getPricing(provider, model, at);
131
- if (!p) return null;
132
- const input = usage.inputTokens * p.input;
133
- const output = usage.outputTokens * p.output;
134
- const cacheWrite = (usage.cacheCreationTokens ?? 0) * (p.cacheWrite ?? p.input);
135
- const cacheRead = (usage.cacheReadTokens ?? 0) * (p.cacheRead ?? p.input);
136
- return (input + output + cacheWrite + cacheRead) / 1e6;
137
- }
138
- function formatCost(amount) {
139
- if (amount === 0) return "$0.0000";
140
- if (amount < 0.01) return `$${amount.toFixed(4)}`;
141
- if (amount < 1) return `$${amount.toFixed(3)}`;
142
- return `$${amount.toFixed(2)}`;
143
- }
144
-
145
- export {
146
- getPricing,
147
- computeCost,
148
- formatCost
149
- };