jinzd-ai-cli 0.4.269 → 0.4.270

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 (70) hide show
  1. package/dist/{batch-HUOYPVJQ.js → batch-IMLMUXJL.js} +2 -2
  2. package/dist/{chunk-3TOMHXDW.js → chunk-75SPJKDY.js} +1 -1
  3. package/dist/{chunk-KIHNZBEA.js → chunk-BOMB6XCF.js} +1 -1
  4. package/dist/{chunk-DJNGUPM3.js → chunk-DIJIYWQE.js} +4 -4
  5. package/dist/{chunk-5IUFUCIT.js → chunk-F26YTEMB.js} +9 -1
  6. package/dist/{chunk-XJAGGJVU.js → chunk-FXCDD7JS.js} +3 -3
  7. package/dist/{chunk-6PROC2JO.js → chunk-HOT76ATM.js} +3 -3
  8. package/dist/{chunk-4HTJMLFY.js → chunk-JJVVCWO4.js} +1 -1
  9. package/dist/{chunk-R7GERZDA.js → chunk-JT6UN5C6.js} +26 -5
  10. package/dist/{chunk-5PRWBJCI.js → chunk-M3GDYEUH.js} +1 -1
  11. package/dist/{chunk-AAERHPBN.js → chunk-PLFXDRNX.js} +1 -1
  12. package/dist/{chunk-V6KQ67VF.js → chunk-TG4PF7FZ.js} +1 -1
  13. package/dist/{chunk-NVN3FHXI.js → chunk-UDUE4DAE.js} +1 -1
  14. package/dist/{chunk-S3F5LOV3.js → chunk-X3JPBJ6C.js} +4 -4
  15. package/dist/{chunk-QPPUYCRF.js → chunk-YHLTSZVH.js} +1 -1
  16. package/dist/{ci-4QS2J7BG.js → ci-HQVXWJ53.js} +4 -4
  17. package/dist/{ci-format-6L6M67WC.js → ci-format-762IL4OM.js} +2 -2
  18. package/dist/{constants-IO5VJLEE.js → constants-4TPE3JSV.js} +1 -1
  19. package/dist/{doctor-cli-ZU4E2DDL.js → doctor-cli-3ES6NFVL.js} +4 -4
  20. package/dist/electron-server.js +61 -13
  21. package/dist/{hub-AMDWXSKZ.js → hub-QXRWPBJP.js} +1 -1
  22. package/dist/index.js +23 -21
  23. package/dist/{persistent-memory-H4DNDIOQ.js → persistent-memory-F4JPWYZJ.js} +2 -2
  24. package/dist/{persistent-memory-52SE5K44.js → persistent-memory-URIJJJ3N.js} +2 -2
  25. package/dist/{pr-Z4O5H6I3.js → pr-HVVHZOJ2.js} +4 -4
  26. package/dist/{run-tests-PYKKYMPA.js → run-tests-UZG6SVJ5.js} +2 -2
  27. package/dist/{run-tests-FZSYHWYX.js → run-tests-WM7TMO2N.js} +2 -2
  28. package/dist/{server-ZSTVYSYC.js → server-E5OBXT33.js} +5 -5
  29. package/dist/{server-WTJSM2MT.js → server-HPRLFLOI.js} +44 -15
  30. package/dist/{task-orchestrator-PNLI3V36.js → task-orchestrator-HJUUL55Y.js} +5 -5
  31. package/dist/{usage-GVFUVYUG.js → usage-L3DUPHD6.js} +11 -4
  32. package/dist/web/client/actions.js.br +0 -0
  33. package/dist/web/client/actions.js.gz +0 -0
  34. package/dist/web/client/api.js.br +0 -0
  35. package/dist/web/client/api.js.gz +0 -0
  36. package/dist/web/client/app.js +3 -6
  37. package/dist/web/client/app.js.br +0 -0
  38. package/dist/web/client/app.js.gz +0 -0
  39. package/dist/web/client/dom.js.br +0 -0
  40. package/dist/web/client/dom.js.gz +0 -0
  41. package/dist/web/client/icon.svg.br +0 -0
  42. package/dist/web/client/icon.svg.gz +0 -0
  43. package/dist/web/client/index.html.br +0 -0
  44. package/dist/web/client/index.html.gz +0 -0
  45. package/dist/web/client/sidebar-tabs.js.br +0 -0
  46. package/dist/web/client/sidebar-tabs.js.gz +0 -0
  47. package/dist/web/client/state.js.br +0 -0
  48. package/dist/web/client/state.js.gz +0 -0
  49. package/dist/web/client/style.css.br +0 -0
  50. package/dist/web/client/style.css.gz +0 -0
  51. package/dist/web/client/sw.js.br +0 -0
  52. package/dist/web/client/sw.js.gz +0 -0
  53. package/dist/web/client/templates.js.br +0 -0
  54. package/dist/web/client/templates.js.gz +0 -0
  55. package/dist/web/client/util.js +22 -0
  56. package/dist/web/client/util.js.br +0 -0
  57. package/dist/web/client/util.js.gz +0 -0
  58. package/dist/web/client/vendor/daisyui-full.min.css.br +0 -0
  59. package/dist/web/client/vendor/daisyui-full.min.css.gz +0 -0
  60. package/dist/web/client/vendor/github-dark.min.css.br +0 -0
  61. package/dist/web/client/vendor/github-dark.min.css.gz +0 -0
  62. package/dist/web/client/vendor/github.min.css.br +0 -0
  63. package/dist/web/client/vendor/github.min.css.gz +0 -0
  64. package/dist/web/client/vendor/highlight.min.js.br +0 -0
  65. package/dist/web/client/vendor/highlight.min.js.gz +0 -0
  66. package/dist/web/client/vendor/marked.min.js.br +0 -0
  67. package/dist/web/client/vendor/marked.min.js.gz +0 -0
  68. package/dist/web/client/vendor/tailwind.js.br +0 -0
  69. package/dist/web/client/vendor/tailwind.js.gz +0 -0
  70. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigManager
4
- } from "./chunk-5IUFUCIT.js";
4
+ } from "./chunk-F26YTEMB.js";
5
5
  import "./chunk-TU3L3PW7.js";
6
- import "./chunk-3TOMHXDW.js";
6
+ import "./chunk-75SPJKDY.js";
7
7
  import {
8
8
  atomicWriteFileSync
9
9
  } from "./chunk-IW3Q7AE5.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/core/constants.ts
4
- var VERSION = "0.4.269";
4
+ var VERSION = "0.4.270";
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-4HTJMLFY.js";
9
+ } from "./chunk-JJVVCWO4.js";
10
10
  import {
11
11
  atomicWriteFileSync
12
12
  } from "./chunk-6BUTA5VW.js";
@@ -7,7 +7,7 @@ import {
7
7
  searchPersistentMemories,
8
8
  touchMemoryReferences,
9
9
  updateMemoryEntry
10
- } from "./chunk-QPPUYCRF.js";
10
+ } from "./chunk-YHLTSZVH.js";
11
11
  import {
12
12
  indexProject
13
13
  } from "./chunk-GLSR2NR3.js";
@@ -26,7 +26,7 @@ import {
26
26
  runHook,
27
27
  runLifecycleHooks,
28
28
  runTool
29
- } from "./chunk-5PRWBJCI.js";
29
+ } from "./chunk-M3GDYEUH.js";
30
30
  import {
31
31
  buildTruncatedArgumentsError,
32
32
  getDangerLevel,
@@ -43,14 +43,14 @@ import {
43
43
  } from "./chunk-4BKXL7SM.js";
44
44
  import {
45
45
  runTestsTool
46
- } from "./chunk-V6KQ67VF.js";
46
+ } from "./chunk-TG4PF7FZ.js";
47
47
  import {
48
48
  CONFIG_DIR_NAME,
49
49
  DEFAULT_MAX_TOOL_OUTPUT_CHARS_CAP,
50
50
  SUBAGENT_ALLOWED_TOOLS,
51
51
  SUBAGENT_DEFAULT_MAX_ROUNDS,
52
52
  SUBAGENT_MAX_ROUNDS_LIMIT
53
- } from "./chunk-3TOMHXDW.js";
53
+ } from "./chunk-75SPJKDY.js";
54
54
  import {
55
55
  loadChatIndex,
56
56
  searchChatMemory
@@ -8,7 +8,7 @@ import {
8
8
  CONFIG_FILE_NAME,
9
9
  HISTORY_DIR_NAME,
10
10
  PLUGINS_DIR_NAME
11
- } from "./chunk-3TOMHXDW.js";
11
+ } from "./chunk-75SPJKDY.js";
12
12
  import {
13
13
  atomicWriteFileSync
14
14
  } from "./chunk-IW3Q7AE5.js";
@@ -102,6 +102,14 @@ var ConfigSchema = z.object({
102
102
  wordWrap: z.number().int().min(0).default(0),
103
103
  /** Skill 文件过大警告阈值(字符数)。超过此值的 skill 在启动加载时打印警告。0 = 静默。默认 10000 */
104
104
  skillSizeWarn: z.number().int().min(0).default(1e4),
105
+ /**
106
+ * 成本显示币种:usd(默认)| cny。
107
+ *
108
+ * 只影响**展示**——存储、monthlyBudget、cost-history.json 恒为美元。
109
+ * 人民币按 pricing.ts 的记账汇率换算并在输出里标注,避免造出一个
110
+ * 看起来像实时汇率的假数字(2026-08-14 审计 P3-02)。
111
+ */
112
+ currency: z.enum(["usd", "cny"]).default("usd"),
105
113
  /** 颜色主题:'dark'(默认)| 'light' | 'custom' */
106
114
  theme: z.enum(["dark", "light", "custom"]).default("dark"),
107
115
  /** 自定义颜色覆盖(仅在 theme='custom' 时生效)。值为 chalk 颜色名或 '#hex',支持 'bold.cyan' 组合 */
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  evaluateCiGate,
4
4
  normalizeCiThresholds
5
- } from "./chunk-AAERHPBN.js";
5
+ } from "./chunk-PLFXDRNX.js";
6
6
  import {
7
7
  buildReviewPrompt,
8
8
  buildSecurityReviewPrompt,
@@ -16,10 +16,10 @@ import {
16
16
  } from "./chunk-AUEX6RNY.js";
17
17
  import {
18
18
  ConfigManager
19
- } from "./chunk-5IUFUCIT.js";
19
+ } from "./chunk-F26YTEMB.js";
20
20
  import {
21
21
  VERSION
22
- } from "./chunk-3TOMHXDW.js";
22
+ } from "./chunk-75SPJKDY.js";
23
23
 
24
24
  // src/cli/ci.ts
25
25
  import { execFileSync } from "child_process";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-AUEX6RNY.js";
5
5
  import {
6
6
  ConfigManager
7
- } from "./chunk-5IUFUCIT.js";
7
+ } from "./chunk-F26YTEMB.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-5PRWBJCI.js";
17
+ } from "./chunk-M3GDYEUH.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-3TOMHXDW.js";
29
+ } from "./chunk-75SPJKDY.js";
30
30
 
31
31
  // src/diagnostics/doctor-report.ts
32
32
  import { existsSync as existsSync3, statSync as statSync2 } from "fs";
@@ -1,5 +1,5 @@
1
1
  // src/core/constants.ts
2
- var VERSION = "0.4.269";
2
+ var VERSION = "0.4.270";
3
3
  var APP_NAME = "ai-cli";
4
4
  var CONFIG_DIR_NAME = ".aicli";
5
5
  var CONFIG_FILE_NAME = "config.json";
@@ -4,13 +4,13 @@ import {
4
4
  } from "./chunk-IW3Q7AE5.js";
5
5
 
6
6
  // src/core/pricing.ts
7
- var DEEPSEEK_CNY_PER_USD = 6.9;
7
+ var CNY_PER_USD = 6.9;
8
8
  var DEEPSEEK_TIME_PRICING_EFFECTIVE_AT = /* @__PURE__ */ new Date("2026-08-16T16:00:00.000Z");
9
9
  function deepSeekCnyPricing(cacheRead, input, output) {
10
10
  return {
11
- cacheRead: cacheRead / DEEPSEEK_CNY_PER_USD,
12
- input: input / DEEPSEEK_CNY_PER_USD,
13
- output: output / DEEPSEEK_CNY_PER_USD
11
+ cacheRead: cacheRead / CNY_PER_USD,
12
+ input: input / CNY_PER_USD,
13
+ output: output / CNY_PER_USD
14
14
  };
15
15
  }
16
16
  function getDeepSeekV4Pricing(model, at) {
@@ -138,12 +138,29 @@ function computeCost(provider, model, usage, at = /* @__PURE__ */ new Date()) {
138
138
  const cacheRead = (usage.cacheReadTokens ?? 0) * (p.cacheRead ?? p.input);
139
139
  return (input + output + cacheWrite + cacheRead) / 1e6;
140
140
  }
141
- function formatCost(amount) {
141
+ var displayCurrency = "usd";
142
+ function setCostCurrency(currency) {
143
+ displayCurrency = currency === "cny" ? "cny" : "usd";
144
+ }
145
+ function getCostCurrency() {
146
+ return displayCurrency;
147
+ }
148
+ function formatCost(amount, currency = displayCurrency) {
149
+ if (currency === "cny") {
150
+ const cny = amount * CNY_PER_USD;
151
+ if (cny === 0) return "\xA50.0000";
152
+ if (cny < 0.01) return `\xA5${cny.toFixed(4)}`;
153
+ if (cny < 1) return `\xA5${cny.toFixed(3)}`;
154
+ return `\xA5${cny.toFixed(2)}`;
155
+ }
142
156
  if (amount === 0) return "$0.0000";
143
157
  if (amount < 0.01) return `$${amount.toFixed(4)}`;
144
158
  if (amount < 1) return `$${amount.toFixed(3)}`;
145
159
  return `$${amount.toFixed(2)}`;
146
160
  }
161
+ function currencyNote(currency = displayCurrency) {
162
+ return currency === "cny" ? `converted at \xA5${CNY_PER_USD}/$1 (accounting rate, not live FX)` : null;
163
+ }
147
164
 
148
165
  // src/core/cost-tracker.ts
149
166
  import { existsSync, readFileSync } from "fs";
@@ -399,8 +416,12 @@ var CostTracker = class _CostTracker {
399
416
  };
400
417
 
401
418
  export {
419
+ CNY_PER_USD,
402
420
  getPricing,
403
421
  computeCost,
422
+ setCostCurrency,
423
+ getCostCurrency,
404
424
  formatCost,
425
+ currencyNote,
405
426
  CostTracker
406
427
  };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONFIG_DIR_NAME,
4
4
  PLUGINS_DIR_NAME
5
- } from "./chunk-3TOMHXDW.js";
5
+ } from "./chunk-75SPJKDY.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
  VERSION
4
- } from "./chunk-3TOMHXDW.js";
4
+ } from "./chunk-75SPJKDY.js";
5
5
 
6
6
  // src/cli/ci-format.ts
7
7
  var DEFAULT_CI_THRESHOLDS = {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  TEST_TIMEOUT
4
- } from "./chunk-3TOMHXDW.js";
4
+ } from "./chunk-75SPJKDY.js";
5
5
 
6
6
  // src/tools/builtin/run-tests.ts
7
7
  import { execSync, spawnSync } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TEST_TIMEOUT
3
- } from "./chunk-4HTJMLFY.js";
3
+ } from "./chunk-JJVVCWO4.js";
4
4
 
5
5
  // src/tools/builtin/run-tests.ts
6
6
  import { execSync, spawnSync } from "child_process";
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  computeCost
4
- } from "./chunk-R7GERZDA.js";
4
+ } from "./chunk-JT6UN5C6.js";
5
5
  import {
6
6
  estimateTokens,
7
7
  truncateForPersist
8
- } from "./chunk-DJNGUPM3.js";
8
+ } from "./chunk-DIJIYWQE.js";
9
9
  import {
10
10
  isMemoryExpired,
11
11
  isMemoryStale
12
- } from "./chunk-QPPUYCRF.js";
12
+ } from "./chunk-YHLTSZVH.js";
13
13
  import {
14
14
  APP_NAME,
15
15
  CONFIG_DIR_NAME,
@@ -20,7 +20,7 @@ import {
20
20
  MCP_PROTOCOL_VERSION,
21
21
  MCP_TOOL_PREFIX,
22
22
  VERSION
23
- } from "./chunk-3TOMHXDW.js";
23
+ } from "./chunk-75SPJKDY.js";
24
24
  import {
25
25
  atomicWriteFileSync
26
26
  } from "./chunk-IW3Q7AE5.js";
@@ -6,7 +6,7 @@ import {
6
6
  MEMORY_FILE_NAME,
7
7
  MEMORY_MAX_CHARS,
8
8
  MEMORY_STORE_FILE_NAME
9
- } from "./chunk-3TOMHXDW.js";
9
+ } from "./chunk-75SPJKDY.js";
10
10
  import {
11
11
  DEFAULT_PATTERNS,
12
12
  redactString
@@ -3,15 +3,15 @@ import {
3
3
  CI_COMMENT_MARKER,
4
4
  countSeverity,
5
5
  runCi
6
- } from "./chunk-XJAGGJVU.js";
7
- import "./chunk-AAERHPBN.js";
6
+ } from "./chunk-FXCDD7JS.js";
7
+ import "./chunk-PLFXDRNX.js";
8
8
  import "./chunk-HLWUDRBO.js";
9
9
  import "./chunk-6YZEZFX5.js";
10
10
  import "./chunk-AUEX6RNY.js";
11
- import "./chunk-5IUFUCIT.js";
11
+ import "./chunk-F26YTEMB.js";
12
12
  import "./chunk-3OBY7WSS.js";
13
13
  import "./chunk-TU3L3PW7.js";
14
- import "./chunk-3TOMHXDW.js";
14
+ import "./chunk-75SPJKDY.js";
15
15
  import "./chunk-IW3Q7AE5.js";
16
16
  export {
17
17
  CI_COMMENT_MARKER,
@@ -6,8 +6,8 @@ import {
6
6
  formatCiResult,
7
7
  formatCiSarif,
8
8
  normalizeCiThresholds
9
- } from "./chunk-AAERHPBN.js";
10
- import "./chunk-3TOMHXDW.js";
9
+ } from "./chunk-PLFXDRNX.js";
10
+ import "./chunk-75SPJKDY.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-3TOMHXDW.js";
41
+ } from "./chunk-75SPJKDY.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-6PROC2JO.js";
5
+ } from "./chunk-HOT76ATM.js";
6
6
  import "./chunk-AUEX6RNY.js";
7
- import "./chunk-5IUFUCIT.js";
8
- import "./chunk-5PRWBJCI.js";
7
+ import "./chunk-F26YTEMB.js";
8
+ import "./chunk-M3GDYEUH.js";
9
9
  import "./chunk-3OBY7WSS.js";
10
10
  import "./chunk-TU3L3PW7.js";
11
11
  import "./chunk-HOSJZMQS.js";
12
- import "./chunk-3TOMHXDW.js";
12
+ import "./chunk-75SPJKDY.js";
13
13
  import "./chunk-IW3Q7AE5.js";
14
14
  export {
15
15
  formatDoctorReport,
@@ -36,14 +36,14 @@ import {
36
36
  touchMemoryReferences,
37
37
  updateMemoryApproval,
38
38
  updateMemoryEntry
39
- } from "./chunk-KIHNZBEA.js";
39
+ } from "./chunk-BOMB6XCF.js";
40
40
  import {
41
41
  redactJson,
42
42
  scanString
43
43
  } from "./chunk-YVTASHS5.js";
44
44
  import {
45
45
  runTestsTool
46
- } from "./chunk-NVN3FHXI.js";
46
+ } from "./chunk-UDUE4DAE.js";
47
47
  import {
48
48
  AGENTIC_BEHAVIOR_GUIDELINE,
49
49
  APP_NAME,
@@ -76,7 +76,7 @@ import {
76
76
  SUBAGENT_MAX_ROUNDS_LIMIT,
77
77
  VERSION,
78
78
  buildUserIdentityPrompt
79
- } from "./chunk-4HTJMLFY.js";
79
+ } from "./chunk-JJVVCWO4.js";
80
80
  import {
81
81
  hasSemanticIndex,
82
82
  semanticSearch
@@ -94,8 +94,8 @@ import {
94
94
  import express from "express";
95
95
  import { createServer } from "http";
96
96
  import { WebSocketServer } from "ws";
97
- import { join as join26, dirname as dirname10, resolve as resolve10, relative as relative6, sep as sep4 } from "path";
98
- import { existsSync as existsSync31, readFileSync as readFileSync25, readdirSync as readdirSync15, statSync as statSync14, realpathSync as realpathSync3 } from "fs";
97
+ import { join as join26, dirname as dirname10, resolve as resolve10, relative as relative6, sep as sep4, extname as extname3, resolve as resolvePath } from "path";
98
+ import { existsSync as existsSync31, readFileSync as readFileSync25, readdirSync as readdirSync15, statSync as statSync14, realpathSync as realpathSync3, createReadStream } from "fs";
99
99
  import { networkInterfaces } from "os";
100
100
 
101
101
  // src/config/config-manager.ts
@@ -187,6 +187,14 @@ var ConfigSchema = z.object({
187
187
  wordWrap: z.number().int().min(0).default(0),
188
188
  /** Skill 文件过大警告阈值(字符数)。超过此值的 skill 在启动加载时打印警告。0 = 静默。默认 10000 */
189
189
  skillSizeWarn: z.number().int().min(0).default(1e4),
190
+ /**
191
+ * 成本显示币种:usd(默认)| cny。
192
+ *
193
+ * 只影响**展示**——存储、monthlyBudget、cost-history.json 恒为美元。
194
+ * 人民币按 pricing.ts 的记账汇率换算并在输出里标注,避免造出一个
195
+ * 看起来像实时汇率的假数字(2026-08-14 审计 P3-02)。
196
+ */
197
+ currency: z.enum(["usd", "cny"]).default("usd"),
190
198
  /** 颜色主题:'dark'(默认)| 'light' | 'custom' */
191
199
  theme: z.enum(["dark", "light", "custom"]).default("dark"),
192
200
  /** 自定义颜色覆盖(仅在 theme='custom' 时生效)。值为 chalk 颜色名或 '#hex',支持 'bold.cyan' 组合 */
@@ -717,13 +725,13 @@ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
717
725
  import { join as join2 } from "path";
718
726
 
719
727
  // src/core/pricing.ts
720
- var DEEPSEEK_CNY_PER_USD = 6.9;
728
+ var CNY_PER_USD = 6.9;
721
729
  var DEEPSEEK_TIME_PRICING_EFFECTIVE_AT = /* @__PURE__ */ new Date("2026-08-16T16:00:00.000Z");
722
730
  function deepSeekCnyPricing(cacheRead, input, output) {
723
731
  return {
724
- cacheRead: cacheRead / DEEPSEEK_CNY_PER_USD,
725
- input: input / DEEPSEEK_CNY_PER_USD,
726
- output: output / DEEPSEEK_CNY_PER_USD
732
+ cacheRead: cacheRead / CNY_PER_USD,
733
+ input: input / CNY_PER_USD,
734
+ output: output / CNY_PER_USD
727
735
  };
728
736
  }
729
737
  function getDeepSeekV4Pricing(model, at) {
@@ -851,7 +859,21 @@ function computeCost(provider, model, usage, at = /* @__PURE__ */ new Date()) {
851
859
  const cacheRead = (usage.cacheReadTokens ?? 0) * (p.cacheRead ?? p.input);
852
860
  return (input + output + cacheWrite + cacheRead) / 1e6;
853
861
  }
854
- function formatCost(amount) {
862
+ var displayCurrency = "usd";
863
+ function setCostCurrency(currency) {
864
+ displayCurrency = currency === "cny" ? "cny" : "usd";
865
+ }
866
+ function getCostCurrency() {
867
+ return displayCurrency;
868
+ }
869
+ function formatCost(amount, currency = displayCurrency) {
870
+ if (currency === "cny") {
871
+ const cny = amount * CNY_PER_USD;
872
+ if (cny === 0) return "\xA50.0000";
873
+ if (cny < 0.01) return `\xA5${cny.toFixed(4)}`;
874
+ if (cny < 1) return `\xA5${cny.toFixed(3)}`;
875
+ return `\xA5${cny.toFixed(2)}`;
876
+ }
855
877
  if (amount === 0) return "$0.0000";
856
878
  if (amount < 0.01) return `$${amount.toFixed(4)}`;
857
879
  if (amount < 1) return `$${amount.toFixed(3)}`;
@@ -16017,7 +16039,7 @@ Cache: write=${cacheCreate} read=${cacheRead}` : "";
16017
16039
  Cost: ${formatCost(cost)}` : "";
16018
16040
  let memoryLine = "";
16019
16041
  try {
16020
- const { countPendingMemories } = await import("./persistent-memory-52SE5K44.js");
16042
+ const { countPendingMemories } = await import("./persistent-memory-URIJJJ3N.js");
16021
16043
  const pending = countPendingMemories(ctx.config.getConfigDir());
16022
16044
  if (pending > 0) memoryLine = `
16023
16045
  Memory: \u26A0 ${pending} pending approval \u2014 see the Memory panel or /memory`;
@@ -16830,7 +16852,7 @@ async function handleTest(args, ctx) {
16830
16852
  const isCommand = argStr.includes(" ") || /^(mvn|gradle|npm|pytest|cargo|go)\b/.test(argStr);
16831
16853
  testArgs = isCommand ? { command: argStr } : { filter: argStr };
16832
16854
  }
16833
- const runTests = ctx.runTests ?? (await import("./run-tests-PYKKYMPA.js")).executeTests;
16855
+ const runTests = ctx.runTests ?? (await import("./run-tests-UZG6SVJ5.js")).executeTests;
16834
16856
  const report = await runTests(testArgs);
16835
16857
  ctx.send({ type: "info", message: report });
16836
16858
  } catch (err) {
@@ -17088,7 +17110,7 @@ async function handleMemory(args, ctx) {
17088
17110
  ctx.handleMemoryManage(sub, args[1], sub === "expire" ? args[2] : void 0);
17089
17111
  } else if (sub === "export") {
17090
17112
  if (args[1] === "md") {
17091
- const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-52SE5K44.js");
17113
+ const { exportMemoryEntries: exportMemoryEntries2 } = await import("./persistent-memory-URIJJJ3N.js");
17092
17114
  ctx.send({
17093
17115
  type: "export_data",
17094
17116
  format: "md",
@@ -17819,6 +17841,8 @@ var SessionHandler = class {
17819
17841
  permissionProfile: this.config.get("defaultPermissionProfile") ?? "legacy",
17820
17842
  tokenUsage: { ...this.sessionTokenUsage },
17821
17843
  costUsd,
17844
+ costCurrency: getCostCurrency(),
17845
+ costCnyPerUsd: CNY_PER_USD,
17822
17846
  costPricingUnknown,
17823
17847
  providers: providerList,
17824
17848
  branches,
@@ -19619,6 +19643,7 @@ async function startWebServer(options = {}) {
19619
19643
  console.log(` Skills: ${count} available`);
19620
19644
  }
19621
19645
  }
19646
+ setCostCurrency(config.get("ui").currency);
19622
19647
  const shared = {
19623
19648
  config,
19624
19649
  costTracker: new CostTracker(config.getConfigDir()),
@@ -19698,6 +19723,29 @@ async function startWebServer(options = {}) {
19698
19723
  clientDir = join26(process.cwd(), "src", "web", "client");
19699
19724
  }
19700
19725
  console.log(` Static files: ${clientDir}`);
19726
+ const PRECOMPRESSED_TYPES = {
19727
+ ".js": "text/javascript; charset=utf-8",
19728
+ ".css": "text/css; charset=utf-8",
19729
+ ".html": "text/html; charset=utf-8",
19730
+ ".json": "application/json; charset=utf-8",
19731
+ ".svg": "image/svg+xml",
19732
+ ".map": "application/json; charset=utf-8"
19733
+ };
19734
+ app.get(/.*/, (req, res, next) => {
19735
+ const ext = extname3(req.path).toLowerCase();
19736
+ const contentType = PRECOMPRESSED_TYPES[ext];
19737
+ if (!contentType) return next();
19738
+ const accept = String(req.headers["accept-encoding"] ?? "");
19739
+ const encoding = /\bbr\b/.test(accept) ? "br" : /\bgzip\b/.test(accept) ? "gzip" : null;
19740
+ if (!encoding) return next();
19741
+ const target = resolvePath(clientDir, `.${req.path}`) + (encoding === "br" ? ".br" : ".gz");
19742
+ if (!target.startsWith(clientDir) || !existsSync31(target)) return next();
19743
+ res.setHeader("Content-Type", contentType);
19744
+ res.setHeader("Content-Encoding", encoding);
19745
+ res.setHeader("Vary", "Accept-Encoding");
19746
+ if (req.path.startsWith("/vendor/")) res.setHeader("Cache-Control", "public, max-age=31536000, immutable");
19747
+ createReadStream(target).pipe(res);
19748
+ });
19701
19749
  app.use("/vendor", express.static(join26(clientDir, "vendor"), { maxAge: "1y", immutable: true }));
19702
19750
  app.use(express.static(clientDir));
19703
19751
  app.get("/api/status", (_req, res) => {
@@ -158,7 +158,7 @@ ${content}`);
158
158
  }
159
159
  }
160
160
  async function runTaskMode(config, providers, configManager, topic) {
161
- const { TaskOrchestrator } = await import("./task-orchestrator-PNLI3V36.js");
161
+ const { TaskOrchestrator } = await import("./task-orchestrator-HJUUL55Y.js");
162
162
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
163
163
  let interrupted = false;
164
164
  const onSigint = () => {