ccjk 12.0.0 → 12.0.2

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 (161) hide show
  1. package/dist/chunks/agent-teams.mjs +17 -18
  2. package/dist/chunks/agent.mjs +105 -102
  3. package/dist/chunks/agents.mjs +87 -77
  4. package/dist/chunks/api-cli.mjs +41 -27
  5. package/dist/chunks/api-providers.mjs +2 -4
  6. package/dist/chunks/api.mjs +22 -11
  7. package/dist/chunks/auto-bootstrap.mjs +3 -5
  8. package/dist/chunks/auto-init.mjs +3 -4
  9. package/dist/chunks/auto-updater.mjs +103 -91
  10. package/dist/chunks/banner.mjs +41 -42
  11. package/dist/chunks/boost.mjs +30 -31
  12. package/dist/chunks/ccjk-agents.mjs +6 -9
  13. package/dist/chunks/ccjk-all.mjs +703 -85
  14. package/dist/chunks/ccjk-config.mjs +6 -6
  15. package/dist/chunks/ccjk-hooks.mjs +20 -9
  16. package/dist/chunks/ccjk-mcp.mjs +64 -52
  17. package/dist/chunks/ccjk-setup.mjs +35 -25
  18. package/dist/chunks/ccjk-skills.mjs +51 -41
  19. package/dist/chunks/ccr.mjs +42 -32
  20. package/dist/chunks/ccu.mjs +16 -12
  21. package/dist/chunks/check-updates.mjs +30 -19
  22. package/dist/chunks/claude-code-config-manager.mjs +25 -10
  23. package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
  24. package/dist/chunks/claude-config.mjs +2 -2
  25. package/dist/chunks/claude-wrapper.mjs +9 -6
  26. package/dist/chunks/cleanup-migration.mjs +1 -1
  27. package/dist/chunks/cli-hook.mjs +10 -3
  28. package/dist/chunks/cloud-sync.mjs +1 -1
  29. package/dist/chunks/codex-config-switch.mjs +58 -45
  30. package/dist/chunks/codex-provider-manager.mjs +29 -16
  31. package/dist/chunks/codex-uninstaller.mjs +5 -6
  32. package/dist/chunks/codex.mjs +89 -89
  33. package/dist/chunks/commands.mjs +28 -29
  34. package/dist/chunks/commands2.mjs +4 -3
  35. package/dist/chunks/commit.mjs +42 -23
  36. package/dist/chunks/completion.mjs +46 -47
  37. package/dist/chunks/config-consolidator.mjs +12 -13
  38. package/dist/chunks/config-switch.mjs +66 -53
  39. package/dist/chunks/config.mjs +10 -10
  40. package/dist/chunks/config2.mjs +53 -42
  41. package/dist/chunks/config3.mjs +107 -93
  42. package/dist/chunks/constants.mjs +2 -4
  43. package/dist/chunks/context-loader.mjs +5 -4
  44. package/dist/chunks/context.mjs +77 -76
  45. package/dist/chunks/convoy-manager.mjs +4 -4
  46. package/dist/chunks/dashboard.mjs +28 -29
  47. package/dist/chunks/doctor.mjs +68 -54
  48. package/dist/chunks/evolution.mjs +37 -38
  49. package/dist/chunks/features.mjs +103 -92
  50. package/dist/chunks/fs-operations.mjs +1 -1
  51. package/dist/chunks/health-alerts.mjs +1 -1
  52. package/dist/chunks/health-check.mjs +1 -1
  53. package/dist/chunks/help.mjs +117 -116
  54. package/dist/chunks/hook-installer.mjs +3 -2
  55. package/dist/chunks/index.mjs +20 -6
  56. package/dist/chunks/index10.mjs +1171 -0
  57. package/dist/chunks/index11.mjs +1008 -0
  58. package/dist/chunks/index12.mjs +193 -0
  59. package/dist/chunks/index13.mjs +218 -0
  60. package/dist/chunks/index14.mjs +663 -0
  61. package/dist/chunks/index2.mjs +19 -10
  62. package/dist/chunks/index3.mjs +19079 -164
  63. package/dist/chunks/index4.mjs +8 -1171
  64. package/dist/chunks/index5.mjs +7479 -884
  65. package/dist/chunks/index6.mjs +160 -184
  66. package/dist/chunks/index7.mjs +3573 -653
  67. package/dist/chunks/index8.mjs +19 -0
  68. package/dist/chunks/index9.mjs +616 -0
  69. package/dist/chunks/init.mjs +173 -173
  70. package/dist/chunks/installer.mjs +92 -82
  71. package/dist/chunks/installer2.mjs +3 -2
  72. package/dist/chunks/interview.mjs +118 -107
  73. package/dist/chunks/json-config.mjs +3 -2
  74. package/dist/chunks/linux.mjs +3863 -0
  75. package/dist/chunks/macos.mjs +69 -0
  76. package/dist/chunks/main.mjs +635 -0
  77. package/dist/chunks/marketplace.mjs +69 -66
  78. package/dist/chunks/mcp-cli.mjs +61 -48
  79. package/dist/chunks/mcp.mjs +140 -127
  80. package/dist/chunks/menu.mjs +85 -85
  81. package/dist/chunks/metrics-display.mjs +41 -40
  82. package/dist/chunks/migrator.mjs +4 -5
  83. package/dist/chunks/monitor.mjs +95 -95
  84. package/dist/chunks/notification.mjs +151 -141
  85. package/dist/chunks/onboarding.mjs +26 -15
  86. package/dist/chunks/package.mjs +1 -1
  87. package/dist/chunks/paradigm.mjs +24 -23
  88. package/dist/chunks/permission-manager.mjs +10 -11
  89. package/dist/chunks/permissions.mjs +72 -57
  90. package/dist/chunks/persistence-manager.mjs +97 -84
  91. package/dist/chunks/persistence.mjs +1 -1
  92. package/dist/chunks/platform.mjs +29 -29
  93. package/dist/chunks/plugin.mjs +104 -105
  94. package/dist/chunks/prompts.mjs +36 -25
  95. package/dist/chunks/providers.mjs +68 -69
  96. package/dist/chunks/quick-actions.mjs +71 -72
  97. package/dist/chunks/quick-provider.mjs +56 -40
  98. package/dist/chunks/quick-setup.mjs +71 -60
  99. package/dist/chunks/remote.mjs +21 -12
  100. package/dist/chunks/session.mjs +116 -103
  101. package/dist/chunks/sessions.mjs +29 -28
  102. package/dist/chunks/silent-updater.mjs +8 -10
  103. package/dist/chunks/simple-config.mjs +13 -10
  104. package/dist/chunks/skill.mjs +8560 -103
  105. package/dist/chunks/skills-sync.mjs +5212 -79
  106. package/dist/chunks/skills.mjs +105 -94
  107. package/dist/chunks/slash-commands.mjs +36 -37
  108. package/dist/chunks/smart-defaults.mjs +7 -3
  109. package/dist/chunks/smart-guide.mjs +1 -1
  110. package/dist/chunks/startup.mjs +2 -4
  111. package/dist/chunks/stats.mjs +41 -42
  112. package/dist/chunks/status.mjs +49 -50
  113. package/dist/chunks/team.mjs +24 -12
  114. package/dist/chunks/thinking.mjs +74 -63
  115. package/dist/chunks/trace.mjs +20 -19
  116. package/dist/chunks/uninstall.mjs +69 -56
  117. package/dist/chunks/update.mjs +39 -28
  118. package/dist/chunks/upgrade-manager.mjs +24 -18
  119. package/dist/chunks/version-checker.mjs +45 -41
  120. package/dist/chunks/vim.mjs +81 -69
  121. package/dist/chunks/windows.mjs +14 -0
  122. package/dist/chunks/workflows.mjs +15 -15
  123. package/dist/chunks/wsl.mjs +129 -0
  124. package/dist/chunks/zero-config.mjs +45 -34
  125. package/dist/cli.mjs +20 -20
  126. package/dist/index.mjs +41 -31
  127. package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
  128. package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
  129. package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
  130. package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
  131. package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
  132. package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
  133. package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
  134. package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
  135. package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
  136. package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
  137. package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
  138. package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
  139. package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
  140. package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
  141. package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
  142. package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
  143. package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
  144. package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
  145. package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
  146. package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
  147. package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
  148. package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
  149. package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
  150. package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
  151. package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
  152. package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
  153. package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
  154. package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
  155. package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
  156. package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
  157. package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
  158. package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
  159. package/package.json +31 -30
  160. package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
  161. package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
@@ -1,34 +1,33 @@
1
- import ansis from 'ansis';
1
+ import a from './index2.mjs';
2
2
  import { getApiProviderPresets } from './api-providers.mjs';
3
- import { i18n } from './index3.mjs';
3
+ import { i18n } from './index5.mjs';
4
4
  import { P as ProviderHealthMonitor } from '../shared/ccjk.J8YiPsOw.mjs';
5
+ import '../shared/ccjk.BAGoDD49.mjs';
5
6
  import './constants.mjs';
6
7
  import 'node:os';
7
- import 'pathe';
8
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
8
9
  import 'node:fs';
9
10
  import 'node:process';
10
11
  import 'node:url';
11
- import 'i18next';
12
- import 'i18next-fs-backend';
13
12
 
14
13
  async function listProviders(options = {}) {
15
14
  const isZh = i18n.language === "zh-CN";
16
15
  const codeType = options.codeType || "claude-code";
17
16
  console.log("");
18
- console.log(ansis.bold.cyan(isZh ? "\u{1F4CB} \u53EF\u7528\u7684 API \u4F9B\u5E94\u5546" : "\u{1F4CB} Available API Providers"));
19
- console.log(ansis.dim("\u2500".repeat(60)));
17
+ console.log(a.bold.cyan(isZh ? "\u{1F4CB} \u53EF\u7528\u7684 API \u4F9B\u5E94\u5546" : "\u{1F4CB} Available API Providers"));
18
+ console.log(a.dim("\u2500".repeat(60)));
20
19
  console.log("");
21
20
  try {
22
21
  const providers = await getApiProviderPresets(codeType);
23
22
  if (providers.length === 0) {
24
- console.log(ansis.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
23
+ console.log(a.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
25
24
  console.log("");
26
25
  return;
27
26
  }
28
27
  const cloudProviders = providers.filter((p) => p.isCloud);
29
28
  const localProviders = providers.filter((p) => !p.isCloud);
30
29
  if (cloudProviders.length > 0) {
31
- console.log(ansis.bold.green(isZh ? "\u2601\uFE0F \u4E91\u7AEF\u4F9B\u5E94\u5546" : "\u2601\uFE0F Cloud Providers"));
30
+ console.log(a.bold.green(isZh ? "\u2601\uFE0F \u4E91\u7AEF\u4F9B\u5E94\u5546" : "\u2601\uFE0F Cloud Providers"));
32
31
  console.log("");
33
32
  for (const provider of cloudProviders) {
34
33
  displayProvider(provider, codeType, options.verbose || false, isZh);
@@ -38,47 +37,47 @@ async function listProviders(options = {}) {
38
37
  if (cloudProviders.length > 0) {
39
38
  console.log("");
40
39
  }
41
- console.log(ansis.bold.blue(isZh ? "\u{1F4BE} \u672C\u5730\u4F9B\u5E94\u5546" : "\u{1F4BE} Local Providers"));
40
+ console.log(a.bold.blue(isZh ? "\u{1F4BE} \u672C\u5730\u4F9B\u5E94\u5546" : "\u{1F4BE} Local Providers"));
42
41
  console.log("");
43
42
  for (const provider of localProviders) {
44
43
  displayProvider(provider, codeType, options.verbose || false, isZh);
45
44
  }
46
45
  }
47
46
  console.log("");
48
- console.log(ansis.dim("\u2500".repeat(60)));
49
- console.log(ansis.dim(isZh ? `\u603B\u8BA1: ${providers.length} \u4E2A\u4F9B\u5E94\u5546 (${cloudProviders.length} \u4E91\u7AEF, ${localProviders.length} \u672C\u5730)` : `Total: ${providers.length} providers (${cloudProviders.length} cloud, ${localProviders.length} local)`));
47
+ console.log(a.dim("\u2500".repeat(60)));
48
+ console.log(a.dim(isZh ? `\u603B\u8BA1: ${providers.length} \u4E2A\u4F9B\u5E94\u5546 (${cloudProviders.length} \u4E91\u7AEF, ${localProviders.length} \u672C\u5730)` : `Total: ${providers.length} providers (${cloudProviders.length} cloud, ${localProviders.length} local)`));
50
49
  console.log("");
51
50
  } catch (error) {
52
- console.error(ansis.red(isZh ? "\u274C \u83B7\u53D6\u4F9B\u5E94\u5546\u5217\u8868\u5931\u8D25" : "\u274C Failed to fetch providers"));
51
+ console.error(a.red(isZh ? "\u274C \u83B7\u53D6\u4F9B\u5E94\u5546\u5217\u8868\u5931\u8D25" : "\u274C Failed to fetch providers"));
53
52
  if (options.verbose && error instanceof Error) {
54
- console.error(ansis.dim(error.message));
53
+ console.error(a.dim(error.message));
55
54
  }
56
55
  console.log("");
57
56
  }
58
57
  }
59
58
  function displayProvider(provider, codeType, verbose, isZh) {
60
59
  const config = codeType === "codex" ? provider.codex : provider.claudeCode;
61
- console.log(` ${ansis.bold(provider.name)} ${ansis.dim(`(${provider.id})`)}`);
60
+ console.log(` ${a.bold(provider.name)} ${a.dim(`(${provider.id})`)}`);
62
61
  if (provider.description) {
63
- console.log(` ${ansis.dim(provider.description)}`);
62
+ console.log(` ${a.dim(provider.description)}`);
64
63
  }
65
64
  if (config) {
66
- console.log(` ${ansis.green(isZh ? "\u63A5\u53E3\u5730\u5740" : "Base URL")}: ${config.baseUrl}`);
65
+ console.log(` ${a.green(isZh ? "\u63A5\u53E3\u5730\u5740" : "Base URL")}: ${config.baseUrl}`);
67
66
  if (codeType === "claude-code" && config.authType) {
68
- console.log(` ${ansis.green(isZh ? "\u8BA4\u8BC1\u65B9\u5F0F" : "Auth Type")}: ${config.authType}`);
67
+ console.log(` ${a.green(isZh ? "\u8BA4\u8BC1\u65B9\u5F0F" : "Auth Type")}: ${config.authType}`);
69
68
  }
70
69
  if (codeType === "codex" && config.wireApi) {
71
- console.log(` ${ansis.green(isZh ? "\u534F\u8BAE\u7C7B\u578B" : "Wire API")}: ${config.wireApi}`);
70
+ console.log(` ${a.green(isZh ? "\u534F\u8BAE\u7C7B\u578B" : "Wire API")}: ${config.wireApi}`);
72
71
  }
73
72
  if (verbose) {
74
73
  if (config.defaultModels && config.defaultModels.length > 0) {
75
- console.log(` ${ansis.green(isZh ? "\u9ED8\u8BA4\u6A21\u578B" : "Default Models")}: ${config.defaultModels.join(", ")}`);
74
+ console.log(` ${a.green(isZh ? "\u9ED8\u8BA4\u6A21\u578B" : "Default Models")}: ${config.defaultModels.join(", ")}`);
76
75
  }
77
76
  if (config.defaultModel) {
78
- console.log(` ${ansis.green(isZh ? "\u9ED8\u8BA4\u6A21\u578B" : "Default Model")}: ${config.defaultModel}`);
77
+ console.log(` ${a.green(isZh ? "\u9ED8\u8BA4\u6A21\u578B" : "Default Model")}: ${config.defaultModel}`);
79
78
  }
80
79
  if (provider.website) {
81
- console.log(` ${ansis.green(isZh ? "\u5B98\u7F51" : "Website")}: ${provider.website}`);
80
+ console.log(` ${a.green(isZh ? "\u5B98\u7F51" : "Website")}: ${provider.website}`);
82
81
  }
83
82
  }
84
83
  }
@@ -88,13 +87,13 @@ async function checkProvidersHealth(options = {}) {
88
87
  const isZh = i18n.language === "zh-CN";
89
88
  const codeType = options.codeType || "claude-code";
90
89
  console.log("");
91
- console.log(ansis.bold.cyan(isZh ? "\u{1F3E5} \u4F9B\u5E94\u5546\u5065\u5EB7\u68C0\u67E5" : "\u{1F3E5} Provider Health Check"));
92
- console.log(ansis.dim("\u2500".repeat(60)));
90
+ console.log(a.bold.cyan(isZh ? "\u{1F3E5} \u4F9B\u5E94\u5546\u5065\u5EB7\u68C0\u67E5" : "\u{1F3E5} Provider Health Check"));
91
+ console.log(a.dim("\u2500".repeat(60)));
93
92
  console.log("");
94
93
  try {
95
94
  const providers = await getApiProviderPresets(codeType);
96
95
  if (providers.length === 0) {
97
- console.log(ansis.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
96
+ console.log(a.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
98
97
  console.log("");
99
98
  return;
100
99
  }
@@ -104,7 +103,7 @@ async function checkProvidersHealth(options = {}) {
104
103
  unhealthyLatencyThreshold: 3e3
105
104
  });
106
105
  monitor.setProviders(providers);
107
- console.log(ansis.dim(isZh ? "\u6B63\u5728\u68C0\u67E5\u4F9B\u5E94\u5546\u5065\u5EB7\u72B6\u6001..." : "Checking provider health..."));
106
+ console.log(a.dim(isZh ? "\u6B63\u5728\u68C0\u67E5\u4F9B\u5E94\u5546\u5065\u5EB7\u72B6\u6001..." : "Checking provider health..."));
108
107
  console.log("");
109
108
  const results = await Promise.all(
110
109
  providers.map(async (provider) => {
@@ -113,31 +112,31 @@ async function checkProvidersHealth(options = {}) {
113
112
  })
114
113
  );
115
114
  for (const { provider, result } of results) {
116
- const statusIcon = result.success ? ansis.green("\u2705") : ansis.red("\u274C");
117
- const latencyColor = result.latency < 1e3 ? ansis.green : result.latency < 3e3 ? ansis.yellow : ansis.red;
118
- console.log(`${statusIcon} ${ansis.bold(provider.name)}`);
115
+ const statusIcon = result.success ? a.green("\u2705") : a.red("\u274C");
116
+ const latencyColor = result.latency < 1e3 ? a.green : result.latency < 3e3 ? a.yellow : a.red;
117
+ console.log(`${statusIcon} ${a.bold(provider.name)}`);
119
118
  if (result.success) {
120
- console.log(` ${ansis.green(isZh ? "\u5EF6\u8FDF" : "Latency")}: ${latencyColor(`${result.latency}ms`)}`);
121
- console.log(` ${ansis.green(isZh ? "\u72B6\u6001: \u6B63\u5E38" : "Status: Healthy")}`);
119
+ console.log(` ${a.green(isZh ? "\u5EF6\u8FDF" : "Latency")}: ${latencyColor(`${result.latency}ms`)}`);
120
+ console.log(` ${a.green(isZh ? "\u72B6\u6001: \u6B63\u5E38" : "Status: Healthy")}`);
122
121
  } else {
123
- console.log(` ${ansis.red(isZh ? "\u72B6\u6001: \u4E0D\u53EF\u7528" : "Status: Unavailable")}`);
122
+ console.log(` ${a.red(isZh ? "\u72B6\u6001: \u4E0D\u53EF\u7528" : "Status: Unavailable")}`);
124
123
  if (result.error) {
125
- console.log(` ${ansis.dim(isZh ? "\u9519\u8BEF" : "Error")}: ${result.error}`);
124
+ console.log(` ${a.dim(isZh ? "\u9519\u8BEF" : "Error")}: ${result.error}`);
126
125
  }
127
126
  }
128
127
  console.log("");
129
128
  }
130
129
  const healthyCount = results.filter((r) => r.result.success).length;
131
130
  const unhealthyCount = results.length - healthyCount;
132
- console.log(ansis.dim("\u2500".repeat(60)));
133
- console.log(ansis.bold(isZh ? "\u6458\u8981" : "Summary"));
134
- console.log(` ${ansis.green("\u2705")} ${isZh ? "\u5065\u5EB7" : "Healthy"}: ${healthyCount}`);
135
- console.log(` ${ansis.red("\u274C")} ${isZh ? "\u4E0D\u53EF\u7528" : "Unavailable"}: ${unhealthyCount}`);
131
+ console.log(a.dim("\u2500".repeat(60)));
132
+ console.log(a.bold(isZh ? "\u6458\u8981" : "Summary"));
133
+ console.log(` ${a.green("\u2705")} ${isZh ? "\u5065\u5EB7" : "Healthy"}: ${healthyCount}`);
134
+ console.log(` ${a.red("\u274C")} ${isZh ? "\u4E0D\u53EF\u7528" : "Unavailable"}: ${unhealthyCount}`);
136
135
  console.log("");
137
136
  } catch (error) {
138
- console.error(ansis.red(isZh ? "\u274C \u5065\u5EB7\u68C0\u67E5\u5931\u8D25" : "\u274C Health check failed"));
137
+ console.error(a.red(isZh ? "\u274C \u5065\u5EB7\u68C0\u67E5\u5931\u8D25" : "\u274C Health check failed"));
139
138
  if (options.verbose && error instanceof Error) {
140
- console.error(ansis.dim(error.message));
139
+ console.error(a.dim(error.message));
141
140
  }
142
141
  console.log("");
143
142
  }
@@ -146,13 +145,13 @@ async function recommendProvider(options = {}) {
146
145
  const isZh = i18n.language === "zh-CN";
147
146
  const codeType = options.codeType || "claude-code";
148
147
  console.log("");
149
- console.log(ansis.bold.cyan(isZh ? "\u{1F3AF} \u4F9B\u5E94\u5546\u63A8\u8350" : "\u{1F3AF} Provider Recommendation"));
150
- console.log(ansis.dim("\u2500".repeat(60)));
148
+ console.log(a.bold.cyan(isZh ? "\u{1F3AF} \u4F9B\u5E94\u5546\u63A8\u8350" : "\u{1F3AF} Provider Recommendation"));
149
+ console.log(a.dim("\u2500".repeat(60)));
151
150
  console.log("");
152
151
  try {
153
152
  const providers = await getApiProviderPresets(codeType);
154
153
  if (providers.length === 0) {
155
- console.log(ansis.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
154
+ console.log(a.yellow(isZh ? "\u672A\u627E\u5230\u4F9B\u5E94\u5546" : "No providers found"));
156
155
  console.log("");
157
156
  return;
158
157
  }
@@ -162,7 +161,7 @@ async function recommendProvider(options = {}) {
162
161
  unhealthyLatencyThreshold: 3e3
163
162
  });
164
163
  monitor.setProviders(providers);
165
- console.log(ansis.dim(isZh ? "\u6B63\u5728\u5206\u6790\u4F9B\u5E94\u5546\u6027\u80FD..." : "Analyzing provider performance..."));
164
+ console.log(a.dim(isZh ? "\u6B63\u5728\u5206\u6790\u4F9B\u5E94\u5546\u6027\u80FD..." : "Analyzing provider performance..."));
166
165
  console.log("");
167
166
  await Promise.all(
168
167
  providers.map(async (provider) => {
@@ -173,55 +172,55 @@ async function recommendProvider(options = {}) {
173
172
  const sortedProviders = monitor.getProvidersByHealth();
174
173
  const bestProvider = sortedProviders[0];
175
174
  if (!bestProvider) {
176
- console.log(ansis.yellow(isZh ? "\u65E0\u6CD5\u786E\u5B9A\u6700\u4F73\u4F9B\u5E94\u5546" : "Unable to determine best provider"));
175
+ console.log(a.yellow(isZh ? "\u65E0\u6CD5\u786E\u5B9A\u6700\u4F73\u4F9B\u5E94\u5546" : "Unable to determine best provider"));
177
176
  console.log("");
178
177
  return;
179
178
  }
180
- console.log(ansis.bold.green(isZh ? "\u{1F3C6} \u63A8\u8350\u4F9B\u5E94\u5546" : "\u{1F3C6} Recommended Provider"));
179
+ console.log(a.bold.green(isZh ? "\u{1F3C6} \u63A8\u8350\u4F9B\u5E94\u5546" : "\u{1F3C6} Recommended Provider"));
181
180
  console.log("");
182
- console.log(` ${ansis.bold.cyan(bestProvider.name)} ${ansis.dim(`(${bestProvider.id})`)}`);
181
+ console.log(` ${a.bold.cyan(bestProvider.name)} ${a.dim(`(${bestProvider.id})`)}`);
183
182
  if (bestProvider.description) {
184
- console.log(` ${ansis.dim(bestProvider.description)}`);
183
+ console.log(` ${a.dim(bestProvider.description)}`);
185
184
  }
186
185
  const health = monitor.getProviderHealth(bestProvider.id);
187
186
  if (health) {
188
187
  console.log("");
189
- console.log(ansis.bold(isZh ? "\u6027\u80FD\u6307\u6807" : "Performance Metrics"));
190
- console.log(` ${ansis.green(isZh ? "\u5EF6\u8FDF" : "Latency")}: ${health.latency.toFixed(0)}ms`);
191
- console.log(` ${ansis.green(isZh ? "\u6210\u529F\u7387" : "Success Rate")}: ${(health.successRate * 100).toFixed(1)}%`);
192
- console.log(` ${ansis.green(isZh ? "\u72B6\u6001" : "Status")}: ${getStatusDisplay(health.status, isZh)}`);
188
+ console.log(a.bold(isZh ? "\u6027\u80FD\u6307\u6807" : "Performance Metrics"));
189
+ console.log(` ${a.green(isZh ? "\u5EF6\u8FDF" : "Latency")}: ${health.latency.toFixed(0)}ms`);
190
+ console.log(` ${a.green(isZh ? "\u6210\u529F\u7387" : "Success Rate")}: ${(health.successRate * 100).toFixed(1)}%`);
191
+ console.log(` ${a.green(isZh ? "\u72B6\u6001" : "Status")}: ${getStatusDisplay(health.status, isZh)}`);
193
192
  }
194
193
  if (sortedProviders.length > 1) {
195
194
  console.log("");
196
- console.log(ansis.bold(isZh ? "\u5907\u9009\u4F9B\u5E94\u5546" : "Alternative Providers"));
195
+ console.log(a.bold(isZh ? "\u5907\u9009\u4F9B\u5E94\u5546" : "Alternative Providers"));
197
196
  console.log("");
198
197
  for (let i = 1; i < Math.min(4, sortedProviders.length); i++) {
199
198
  const provider = sortedProviders[i];
200
199
  const health2 = monitor.getProviderHealth(provider.id);
201
- console.log(` ${i}. ${ansis.bold(provider.name)} ${ansis.dim(`(${provider.id})`)}`);
200
+ console.log(` ${i}. ${a.bold(provider.name)} ${a.dim(`(${provider.id})`)}`);
202
201
  if (health2) {
203
- console.log(` ${ansis.dim(`${health2.latency.toFixed(0)}ms | ${(health2.successRate * 100).toFixed(1)}% | ${health2.status}`)}`);
202
+ console.log(` ${a.dim(`${health2.latency.toFixed(0)}ms | ${(health2.successRate * 100).toFixed(1)}% | ${health2.status}`)}`);
204
203
  }
205
204
  }
206
205
  }
207
206
  console.log("");
208
- console.log(ansis.dim("\u2500".repeat(60)));
209
- console.log(ansis.dim(isZh ? '\u{1F4A1} \u63D0\u793A: \u4F7F\u7528 "ccjk config set provider <id>" \u5207\u6362\u4F9B\u5E94\u5546' : '\u{1F4A1} Tip: Use "ccjk config set provider <id>" to switch provider'));
207
+ console.log(a.dim("\u2500".repeat(60)));
208
+ console.log(a.dim(isZh ? '\u{1F4A1} \u63D0\u793A: \u4F7F\u7528 "ccjk config set provider <id>" \u5207\u6362\u4F9B\u5E94\u5546' : '\u{1F4A1} Tip: Use "ccjk config set provider <id>" to switch provider'));
210
209
  console.log("");
211
210
  } catch (error) {
212
- console.error(ansis.red(isZh ? "\u274C \u63A8\u8350\u5931\u8D25" : "\u274C Recommendation failed"));
211
+ console.error(a.red(isZh ? "\u274C \u63A8\u8350\u5931\u8D25" : "\u274C Recommendation failed"));
213
212
  if (options.verbose && error instanceof Error) {
214
- console.error(ansis.dim(error.message));
213
+ console.error(a.dim(error.message));
215
214
  }
216
215
  console.log("");
217
216
  }
218
217
  }
219
218
  function getStatusDisplay(status, isZh) {
220
219
  const statusMap = {
221
- healthy: { en: "Healthy", zh: "\u5065\u5EB7", color: ansis.green },
222
- degraded: { en: "Degraded", zh: "\u964D\u7EA7", color: ansis.yellow },
223
- unhealthy: { en: "Unhealthy", zh: "\u4E0D\u5065\u5EB7", color: ansis.red },
224
- unknown: { en: "Unknown", zh: "\u672A\u77E5", color: ansis.dim }
220
+ healthy: { en: "Healthy", zh: "\u5065\u5EB7", color: a.green },
221
+ degraded: { en: "Degraded", zh: "\u964D\u7EA7", color: a.yellow },
222
+ unhealthy: { en: "Unhealthy", zh: "\u4E0D\u5065\u5EB7", color: a.red },
223
+ unknown: { en: "Unknown", zh: "\u672A\u77E5", color: a.dim }
225
224
  };
226
225
  const info = statusMap[status] || statusMap.unknown;
227
226
  const text = isZh ? info.zh : info.en;
@@ -244,15 +243,15 @@ async function providersCommand(action, options = {}) {
244
243
  default: {
245
244
  const isZh = i18n.language === "zh-CN";
246
245
  console.log("");
247
- console.log(ansis.bold.cyan(isZh ? "\u{1F4E6} \u4F9B\u5E94\u5546\u7BA1\u7406\u547D\u4EE4" : "\u{1F4E6} Provider Management Commands"));
246
+ console.log(a.bold.cyan(isZh ? "\u{1F4E6} \u4F9B\u5E94\u5546\u7BA1\u7406\u547D\u4EE4" : "\u{1F4E6} Provider Management Commands"));
248
247
  console.log("");
249
- console.log(` ${ansis.green("ccjk providers list")} ${isZh ? "\u5217\u51FA\u6240\u6709\u4F9B\u5E94\u5546" : "List all providers"}`);
250
- console.log(` ${ansis.green("ccjk providers health")} ${isZh ? "\u68C0\u67E5\u4F9B\u5E94\u5546\u5065\u5EB7\u72B6\u6001" : "Check provider health"}`);
251
- console.log(` ${ansis.green("ccjk providers recommend")} ${isZh ? "\u63A8\u8350\u6700\u4F73\u4F9B\u5E94\u5546" : "Recommend best provider"}`);
248
+ console.log(` ${a.green("ccjk providers list")} ${isZh ? "\u5217\u51FA\u6240\u6709\u4F9B\u5E94\u5546" : "List all providers"}`);
249
+ console.log(` ${a.green("ccjk providers health")} ${isZh ? "\u68C0\u67E5\u4F9B\u5E94\u5546\u5065\u5EB7\u72B6\u6001" : "Check provider health"}`);
250
+ console.log(` ${a.green("ccjk providers recommend")} ${isZh ? "\u63A8\u8350\u6700\u4F73\u4F9B\u5E94\u5546" : "Recommend best provider"}`);
252
251
  console.log("");
253
- console.log(ansis.bold(isZh ? "\u9009\u9879" : "Options"));
254
- console.log(` ${ansis.green("--code-type, -T")} <type> ${isZh ? "\u4EE3\u7801\u5DE5\u5177\u7C7B\u578B (claude-code, codex)" : "Code tool type (claude-code, codex)"}`);
255
- console.log(` ${ansis.green("--verbose, -v")} ${isZh ? "\u8BE6\u7EC6\u8F93\u51FA" : "Verbose output"}`);
252
+ console.log(a.bold(isZh ? "\u9009\u9879" : "Options"));
253
+ console.log(` ${a.green("--code-type, -T")} <type> ${isZh ? "\u4EE3\u7801\u5DE5\u5177\u7C7B\u578B (claude-code, codex)" : "Code tool type (claude-code, codex)"}`);
254
+ console.log(` ${a.green("--verbose, -v")} ${isZh ? "\u8BE6\u7EC6\u8F93\u51FA" : "Verbose output"}`);
256
255
  console.log("");
257
256
  }
258
257
  }
@@ -1,17 +1,16 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import { homedir } from 'node:os';
3
- import ansis from 'ansis';
4
- import { join } from 'pathe';
3
+ import a from './index2.mjs';
5
4
  import { getContextPersistence } from './persistence.mjs';
6
5
  import { MetricsDisplay } from './metrics-display.mjs';
7
- import { r as runHealthCheck } from '../shared/ccjk.DfwJOEok.mjs';
6
+ import { r as runHealthCheck } from '../shared/ccjk.D5MFQT7w.mjs';
7
+ import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
8
+ import '../shared/ccjk.BAGoDD49.mjs';
8
9
  import 'better-sqlite3';
9
10
  import './constants.mjs';
10
- import './index3.mjs';
11
+ import './index5.mjs';
11
12
  import 'node:process';
12
13
  import 'node:url';
13
- import 'i18next';
14
- import 'i18next-fs-backend';
15
14
 
16
15
  const HABIT_FILE = join(homedir(), ".ccjk", "habits.json");
17
16
  function loadHabitStats() {
@@ -80,33 +79,33 @@ function getDaysUsed() {
80
79
  function getMotivationalMessage(stats, tokensSaved, costSavings) {
81
80
  const messages = [];
82
81
  if (stats.streak >= 7) {
83
- messages.push(ansis.green.bold(`\u{1F389} ${stats.streak}-day streak! You're on fire!`));
82
+ messages.push(a.green.bold(`\u{1F389} ${stats.streak}-day streak! You're on fire!`));
84
83
  } else if (stats.streak >= 3) {
85
- messages.push(ansis.cyan(`\u{1F525} ${stats.streak}-day streak! Keep it going!`));
84
+ messages.push(a.cyan(`\u{1F525} ${stats.streak}-day streak! Keep it going!`));
86
85
  } else if (stats.streak === 1) {
87
- messages.push(ansis.yellow(`\u2728 New streak started! Come back tomorrow!`));
86
+ messages.push(a.yellow(`\u2728 New streak started! Come back tomorrow!`));
88
87
  }
89
88
  if (costSavings >= 50) {
90
- messages.push(ansis.green.bold(`\u{1F4B0} You've saved $${costSavings.toFixed(2)} this week!`));
89
+ messages.push(a.green.bold(`\u{1F4B0} You've saved $${costSavings.toFixed(2)} this week!`));
91
90
  } else if (costSavings >= 10) {
92
- messages.push(ansis.cyan(`\u{1F4B5} $${costSavings.toFixed(2)} saved this week!`));
91
+ messages.push(a.cyan(`\u{1F4B5} $${costSavings.toFixed(2)} saved this week!`));
93
92
  }
94
93
  if (tokensSaved >= 1e5) {
95
- messages.push(ansis.magenta.bold(`\u{1F680} ${MetricsDisplay.formatTokenCount(tokensSaved)} tokens saved!`));
94
+ messages.push(a.magenta.bold(`\u{1F680} ${MetricsDisplay.formatTokenCount(tokensSaved)} tokens saved!`));
96
95
  } else if (tokensSaved >= 1e4) {
97
- messages.push(ansis.blue(`\u{1F4CA} ${MetricsDisplay.formatTokenCount(tokensSaved)} tokens saved!`));
96
+ messages.push(a.blue(`\u{1F4CA} ${MetricsDisplay.formatTokenCount(tokensSaved)} tokens saved!`));
98
97
  }
99
98
  if (stats.totalCommands === 10) {
100
- messages.push(ansis.yellow(`\u{1F3AF} 10 commands milestone! You're getting the hang of it!`));
99
+ messages.push(a.yellow(`\u{1F3AF} 10 commands milestone! You're getting the hang of it!`));
101
100
  } else if (stats.totalCommands === 50) {
102
- messages.push(ansis.green(`\u{1F3C6} 50 commands milestone! You're a power user!`));
101
+ messages.push(a.green(`\u{1F3C6} 50 commands milestone! You're a power user!`));
103
102
  } else if (stats.totalCommands === 100) {
104
- messages.push(ansis.magenta.bold(`\u{1F451} 100 commands milestone! You're a CCJK master!`));
103
+ messages.push(a.magenta.bold(`\u{1F451} 100 commands milestone! You're a CCJK master!`));
105
104
  }
106
105
  if (stats.longestStreak >= 30) {
107
- messages.push(ansis.magenta.bold(`\u{1F3C5} Longest streak: ${stats.longestStreak} days! Legendary!`));
106
+ messages.push(a.magenta.bold(`\u{1F3C5} Longest streak: ${stats.longestStreak} days! Legendary!`));
108
107
  } else if (stats.longestStreak >= 14) {
109
- messages.push(ansis.green(`\u{1F3C5} Longest streak: ${stats.longestStreak} days!`));
108
+ messages.push(a.green(`\u{1F3C5} Longest streak: ${stats.longestStreak} days!`));
110
109
  }
111
110
  return messages.length > 0 ? messages.join("\n ") : "";
112
111
  }
@@ -115,18 +114,18 @@ function getSuggestion(stats) {
115
114
  const lastUsed = stats.lastUsed;
116
115
  const hoursSinceLastUse = (now - lastUsed) / (1e3 * 60 * 60);
117
116
  if (hoursSinceLastUse >= 168) {
118
- return ansis.yellow(`\u{1F4A1} Tip: Run ${ansis.cyan("ccjk cleanup")} weekly to keep DB healthy`);
117
+ return a.yellow(`\u{1F4A1} Tip: Run ${a.cyan("ccjk cleanup")} weekly to keep DB healthy`);
119
118
  }
120
119
  if (hoursSinceLastUse >= 24) {
121
- return ansis.yellow(`\u{1F4A1} Tip: Run ${ansis.cyan("ccjk review")} to see your daily stats`);
120
+ return a.yellow(`\u{1F4A1} Tip: Run ${a.cyan("ccjk review")} to see your daily stats`);
122
121
  }
123
122
  if ((stats.commandCounts.commit || 0) < 5) {
124
- return ansis.yellow(`\u{1F4A1} Tip: Try ${ansis.cyan("ccjk commit")} for smart commits with compression stats`);
123
+ return a.yellow(`\u{1F4A1} Tip: Try ${a.cyan("ccjk commit")} for smart commits with compression stats`);
125
124
  }
126
125
  const tips = [
127
- `\u{1F4A1} Tip: ${ansis.cyan("ccjk morning")} gives you a quick health check`,
128
- `\u{1F4A1} Tip: ${ansis.cyan("ccjk review")} shows your token savings`,
129
- `\u{1F4A1} Tip: ${ansis.cyan("ccjk cleanup")} keeps your database optimized`
126
+ `\u{1F4A1} Tip: ${a.cyan("ccjk morning")} gives you a quick health check`,
127
+ `\u{1F4A1} Tip: ${a.cyan("ccjk review")} shows your token savings`,
128
+ `\u{1F4A1} Tip: ${a.cyan("ccjk cleanup")} keeps your database optimized`
130
129
  ];
131
130
  return tips[Math.floor(Math.random() * tips.length)];
132
131
  }
@@ -134,7 +133,7 @@ async function morningCommand(options = {}) {
134
133
  const stats = updateHabitStats("morning");
135
134
  if (!options.silent) {
136
135
  console.log();
137
- console.log(ansis.cyan.bold("\u2600\uFE0F Good morning! Here's your CCJK status:"));
136
+ console.log(a.cyan.bold("\u2600\uFE0F Good morning! Here's your CCJK status:"));
138
137
  console.log();
139
138
  }
140
139
  try {
@@ -149,17 +148,17 @@ async function morningCommand(options = {}) {
149
148
  }, null, 2));
150
149
  return;
151
150
  }
152
- const gradeColor = health.grade === "S" ? ansis.magenta.bold : health.grade === "A" ? ansis.green.bold : health.grade === "B" ? ansis.cyan.bold : health.grade === "C" ? ansis.yellow.bold : ansis.red.bold;
153
- console.log(` ${ansis.gray("Health Score:")} ${gradeColor(health.grade)} ${ansis.gray(`(${health.totalScore}/100)`)}`);
151
+ const gradeColor = health.grade === "S" ? a.magenta.bold : health.grade === "A" ? a.green.bold : health.grade === "B" ? a.cyan.bold : health.grade === "C" ? a.yellow.bold : a.red.bold;
152
+ console.log(` ${a.gray("Health Score:")} ${gradeColor(health.grade)} ${a.gray(`(${health.totalScore}/100)`)}`);
154
153
  if (metrics.totalCompressions > 0) {
155
- console.log(` ${ansis.gray("Total Saved:")} ${ansis.green(MetricsDisplay.formatTokenCount(metrics.totalTokensSaved))} tokens`);
156
- console.log(` ${ansis.gray("Cost Savings:")} ${ansis.green.bold(MetricsDisplay.formatCost(metrics.estimatedCostSavings))}`);
154
+ console.log(` ${a.gray("Total Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.totalTokensSaved))} tokens`);
155
+ console.log(` ${a.gray("Cost Savings:")} ${a.green.bold(MetricsDisplay.formatCost(metrics.estimatedCostSavings))}`);
157
156
  if (metrics.sessionStats && metrics.sessionStats.compressions > 0) {
158
- console.log(` ${ansis.gray("Last 24h:")} ${ansis.white(metrics.sessionStats.compressions)} compressions, ${ansis.green(MetricsDisplay.formatCost(metrics.sessionStats.costSavings))} saved`);
157
+ console.log(` ${a.gray("Last 24h:")} ${a.white(metrics.sessionStats.compressions)} compressions, ${a.green(MetricsDisplay.formatCost(metrics.sessionStats.costSavings))} saved`);
159
158
  }
160
159
  }
161
160
  if (stats.streak > 0) {
162
- console.log(` ${ansis.gray("Streak:")} ${ansis.yellow(`${stats.streak} day${stats.streak > 1 ? "s" : ""}`)}`);
161
+ console.log(` ${a.gray("Streak:")} ${a.yellow(`${stats.streak} day${stats.streak > 1 ? "s" : ""}`)}`);
163
162
  }
164
163
  console.log();
165
164
  const message = getMotivationalMessage(stats, metrics.totalTokensSaved, metrics.weeklyStats?.costSavings || 0);
@@ -168,12 +167,12 @@ async function morningCommand(options = {}) {
168
167
  console.log();
169
168
  }
170
169
  if (health.recommendations.length > 0) {
171
- console.log(ansis.yellow.bold(" \u{1F4CB} Top Recommendations:"));
170
+ console.log(a.yellow.bold(" \u{1F4CB} Top Recommendations:"));
172
171
  for (const rec of health.recommendations.slice(0, 2)) {
173
- const priority = rec.priority === "high" ? ansis.red("!") : rec.priority === "medium" ? ansis.yellow("\u2022") : ansis.gray("\xB7");
172
+ const priority = rec.priority === "high" ? a.red("!") : rec.priority === "medium" ? a.yellow("\u2022") : a.gray("\xB7");
174
173
  console.log(` ${priority} ${rec.title}`);
175
174
  if (rec.command) {
176
- console.log(` ${ansis.gray("\u2192")} ${ansis.cyan(rec.command)}`);
175
+ console.log(` ${a.gray("\u2192")} ${a.cyan(rec.command)}`);
177
176
  }
178
177
  }
179
178
  console.log();
@@ -184,7 +183,7 @@ async function morningCommand(options = {}) {
184
183
  console.log();
185
184
  }
186
185
  } catch (error) {
187
- console.error(ansis.red("Error running morning command:"), error);
186
+ console.error(a.red("Error running morning command:"), error);
188
187
  process.exit(1);
189
188
  }
190
189
  }
@@ -192,7 +191,7 @@ async function reviewCommand(options = {}) {
192
191
  const stats = updateHabitStats("review");
193
192
  if (!options.silent) {
194
193
  console.log();
195
- console.log(ansis.cyan.bold("\u{1F4CA} Daily Review"));
194
+ console.log(a.cyan.bold("\u{1F4CA} Daily Review"));
196
195
  console.log();
197
196
  }
198
197
  try {
@@ -205,38 +204,38 @@ async function reviewCommand(options = {}) {
205
204
  }, null, 2));
206
205
  return;
207
206
  }
208
- console.log(ansis.cyan.bold(" Overall Statistics"));
209
- console.log(` ${ansis.gray("Total Compressions:")} ${ansis.white(metrics.totalCompressions)}`);
210
- console.log(` ${ansis.gray("Total Saved:")} ${ansis.green(MetricsDisplay.formatTokenCount(metrics.totalTokensSaved))} tokens`);
211
- console.log(` ${ansis.gray("Avg Reduction:")} ${ansis.yellow(MetricsDisplay.formatRatio(metrics.averageCompressionRatio))}`);
212
- console.log(` ${ansis.gray("Cost Savings:")} ${ansis.green.bold(MetricsDisplay.formatCost(metrics.estimatedCostSavings))}`);
207
+ console.log(a.cyan.bold(" Overall Statistics"));
208
+ console.log(` ${a.gray("Total Compressions:")} ${a.white(metrics.totalCompressions)}`);
209
+ console.log(` ${a.gray("Total Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.totalTokensSaved))} tokens`);
210
+ console.log(` ${a.gray("Avg Reduction:")} ${a.yellow(MetricsDisplay.formatRatio(metrics.averageCompressionRatio))}`);
211
+ console.log(` ${a.gray("Cost Savings:")} ${a.green.bold(MetricsDisplay.formatCost(metrics.estimatedCostSavings))}`);
213
212
  console.log();
214
213
  if (metrics.sessionStats && metrics.sessionStats.compressions > 0) {
215
- console.log(ansis.cyan.bold(" Last 24 Hours"));
216
- console.log(` ${ansis.gray("Compressions:")} ${ansis.white(metrics.sessionStats.compressions)}`);
217
- console.log(` ${ansis.gray("Tokens Saved:")} ${ansis.green(MetricsDisplay.formatTokenCount(metrics.sessionStats.tokensSaved))}`);
218
- console.log(` ${ansis.gray("Cost Savings:")} ${ansis.green(MetricsDisplay.formatCost(metrics.sessionStats.costSavings))}`);
214
+ console.log(a.cyan.bold(" Last 24 Hours"));
215
+ console.log(` ${a.gray("Compressions:")} ${a.white(metrics.sessionStats.compressions)}`);
216
+ console.log(` ${a.gray("Tokens Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.sessionStats.tokensSaved))}`);
217
+ console.log(` ${a.gray("Cost Savings:")} ${a.green(MetricsDisplay.formatCost(metrics.sessionStats.costSavings))}`);
219
218
  console.log();
220
219
  }
221
220
  if (metrics.weeklyStats && metrics.weeklyStats.compressions > 0) {
222
- console.log(ansis.cyan.bold(" Last 7 Days"));
223
- console.log(` ${ansis.gray("Compressions:")} ${ansis.white(metrics.weeklyStats.compressions)}`);
224
- console.log(` ${ansis.gray("Tokens Saved:")} ${ansis.green(MetricsDisplay.formatTokenCount(metrics.weeklyStats.tokensSaved))}`);
225
- console.log(` ${ansis.gray("Cost Savings:")} ${ansis.green(MetricsDisplay.formatCost(metrics.weeklyStats.costSavings))}`);
221
+ console.log(a.cyan.bold(" Last 7 Days"));
222
+ console.log(` ${a.gray("Compressions:")} ${a.white(metrics.weeklyStats.compressions)}`);
223
+ console.log(` ${a.gray("Tokens Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.weeklyStats.tokensSaved))}`);
224
+ console.log(` ${a.gray("Cost Savings:")} ${a.green(MetricsDisplay.formatCost(metrics.weeklyStats.costSavings))}`);
226
225
  console.log();
227
226
  }
228
227
  if (metrics.monthlyStats && metrics.monthlyStats.compressions > 0) {
229
- console.log(ansis.cyan.bold(" Last 30 Days"));
230
- console.log(` ${ansis.gray("Compressions:")} ${ansis.white(metrics.monthlyStats.compressions)}`);
231
- console.log(` ${ansis.gray("Tokens Saved:")} ${ansis.green(MetricsDisplay.formatTokenCount(metrics.monthlyStats.tokensSaved))}`);
232
- console.log(` ${ansis.gray("Cost Savings:")} ${ansis.green(MetricsDisplay.formatCost(metrics.monthlyStats.costSavings))}`);
228
+ console.log(a.cyan.bold(" Last 30 Days"));
229
+ console.log(` ${a.gray("Compressions:")} ${a.white(metrics.monthlyStats.compressions)}`);
230
+ console.log(` ${a.gray("Tokens Saved:")} ${a.green(MetricsDisplay.formatTokenCount(metrics.monthlyStats.tokensSaved))}`);
231
+ console.log(` ${a.gray("Cost Savings:")} ${a.green(MetricsDisplay.formatCost(metrics.monthlyStats.costSavings))}`);
233
232
  console.log();
234
233
  }
235
- console.log(ansis.cyan.bold(" Your Habits"));
236
- console.log(` ${ansis.gray("Total Commands:")} ${ansis.white(stats.totalCommands)}`);
237
- console.log(` ${ansis.gray("Current Streak:")} ${ansis.yellow(`${stats.streak} day${stats.streak !== 1 ? "s" : ""}`)}`);
238
- console.log(` ${ansis.gray("Longest Streak:")} ${ansis.yellow(`${stats.longestStreak} day${stats.longestStreak !== 1 ? "s" : ""}`)}`);
239
- console.log(` ${ansis.gray("Days Active:")} ${ansis.white(getDaysUsed())}`);
234
+ console.log(a.cyan.bold(" Your Habits"));
235
+ console.log(` ${a.gray("Total Commands:")} ${a.white(stats.totalCommands)}`);
236
+ console.log(` ${a.gray("Current Streak:")} ${a.yellow(`${stats.streak} day${stats.streak !== 1 ? "s" : ""}`)}`);
237
+ console.log(` ${a.gray("Longest Streak:")} ${a.yellow(`${stats.longestStreak} day${stats.longestStreak !== 1 ? "s" : ""}`)}`);
238
+ console.log(` ${a.gray("Days Active:")} ${a.white(getDaysUsed())}`);
240
239
  console.log();
241
240
  const message = getMotivationalMessage(stats, metrics.totalTokensSaved, metrics.weeklyStats?.costSavings || 0);
242
241
  if (message) {
@@ -249,7 +248,7 @@ async function reviewCommand(options = {}) {
249
248
  console.log();
250
249
  }
251
250
  } catch (error) {
252
- console.error(ansis.red("Error running review command:"), error);
251
+ console.error(a.red("Error running review command:"), error);
253
252
  process.exit(1);
254
253
  }
255
254
  }
@@ -257,41 +256,41 @@ async function cleanupCommand(options = {}) {
257
256
  const stats = updateHabitStats("cleanup");
258
257
  if (!options.silent) {
259
258
  console.log();
260
- console.log(ansis.cyan.bold("\u{1F9F9} Database Cleanup"));
259
+ console.log(a.cyan.bold("\u{1F9F9} Database Cleanup"));
261
260
  console.log();
262
261
  }
263
262
  try {
264
263
  const persistence = getContextPersistence();
265
264
  const statsBefore = persistence.getStats();
266
265
  if (!options.silent) {
267
- console.log(` ${ansis.gray("Database size before:")} ${ansis.white(MetricsDisplay.formatBytes(statsBefore.totalSize))}`);
268
- console.log(` ${ansis.gray("Total contexts:")} ${ansis.white(statsBefore.totalContexts)}`);
266
+ console.log(` ${a.gray("Database size before:")} ${a.white(MetricsDisplay.formatBytes(statsBefore.totalSize))}`);
267
+ console.log(` ${a.gray("Total contexts:")} ${a.white(statsBefore.totalContexts)}`);
269
268
  console.log();
270
269
  }
271
270
  const maxAge = 30 * 24 * 60 * 60 * 1e3;
272
271
  const deletedContexts = persistence.cleanup(maxAge);
273
272
  if (!options.silent && deletedContexts > 0) {
274
- console.log(` ${ansis.green("\u2713")} Deleted ${ansis.white(deletedContexts)} old context${deletedContexts !== 1 ? "s" : ""}`);
273
+ console.log(` ${a.green("\u2713")} Deleted ${a.white(deletedContexts)} old context${deletedContexts !== 1 ? "s" : ""}`);
275
274
  }
276
275
  const metricsMaxAge = 90 * 24 * 60 * 60 * 1e3;
277
276
  const deletedMetrics = persistence.cleanupCompressionMetrics(metricsMaxAge);
278
277
  if (!options.silent && deletedMetrics > 0) {
279
- console.log(` ${ansis.green("\u2713")} Deleted ${ansis.white(deletedMetrics)} old metric${deletedMetrics !== 1 ? "s" : ""}`);
278
+ console.log(` ${a.green("\u2713")} Deleted ${a.white(deletedMetrics)} old metric${deletedMetrics !== 1 ? "s" : ""}`);
280
279
  }
281
280
  if (!options.silent) {
282
- console.log(` ${ansis.gray("Running VACUUM...")}`);
281
+ console.log(` ${a.gray("Running VACUUM...")}`);
283
282
  }
284
283
  persistence.vacuum();
285
284
  const statsAfter = persistence.getStats();
286
285
  const sizeSaved = statsBefore.totalSize - statsAfter.totalSize;
287
286
  if (!options.silent) {
288
- console.log(` ${ansis.green("\u2713")} VACUUM complete`);
287
+ console.log(` ${a.green("\u2713")} VACUUM complete`);
289
288
  console.log();
290
- console.log(` ${ansis.gray("Database size after:")} ${ansis.white(MetricsDisplay.formatBytes(statsAfter.totalSize))}`);
291
- console.log(` ${ansis.gray("Space reclaimed:")} ${ansis.green(MetricsDisplay.formatBytes(sizeSaved))}`);
292
- console.log(` ${ansis.gray("Total contexts:")} ${ansis.white(statsAfter.totalContexts)}`);
289
+ console.log(` ${a.gray("Database size after:")} ${a.white(MetricsDisplay.formatBytes(statsAfter.totalSize))}`);
290
+ console.log(` ${a.gray("Space reclaimed:")} ${a.green(MetricsDisplay.formatBytes(sizeSaved))}`);
291
+ console.log(` ${a.gray("Total contexts:")} ${a.white(statsAfter.totalContexts)}`);
293
292
  console.log();
294
- console.log(` ${ansis.green.bold("\u2713 Cleanup complete!")}`);
293
+ console.log(` ${a.green.bold("\u2713 Cleanup complete!")}`);
295
294
  console.log();
296
295
  }
297
296
  if (options.json) {
@@ -309,11 +308,11 @@ async function cleanupCommand(options = {}) {
309
308
  console.log(` ${message}`);
310
309
  console.log();
311
310
  }
312
- console.log(` ${ansis.yellow(`\u{1F4A1} Tip: Run cleanup weekly to keep your database healthy`)}`);
311
+ console.log(` ${a.yellow(`\u{1F4A1} Tip: Run cleanup weekly to keep your database healthy`)}`);
313
312
  console.log();
314
313
  }
315
314
  } catch (error) {
316
- console.error(ansis.red("Error running cleanup command:"), error);
315
+ console.error(a.red("Error running cleanup command:"), error);
317
316
  process.exit(1);
318
317
  }
319
318
  }