ccjk 10.1.0 โ†’ 10.2.0

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 (109) hide show
  1. package/dist/chunks/agent-teams.mjs +1 -1
  2. package/dist/chunks/agent.mjs +1 -1
  3. package/dist/chunks/api-providers.mjs +1 -1
  4. package/dist/chunks/api.mjs +3 -3
  5. package/dist/chunks/auto-bootstrap.mjs +1 -1
  6. package/dist/chunks/auto-updater.mjs +1 -1
  7. package/dist/{shared/ccjk.Br91zBIG.mjs โ†’ chunks/banner.mjs} +52 -3
  8. package/dist/chunks/boost.mjs +2 -2
  9. package/dist/chunks/ccjk-agents.mjs +1 -1
  10. package/dist/chunks/ccjk-all.mjs +1 -1
  11. package/dist/chunks/ccjk-config.mjs +1 -1
  12. package/dist/chunks/ccjk-hooks.mjs +1 -1
  13. package/dist/chunks/ccjk-mcp.mjs +2 -2
  14. package/dist/chunks/ccjk-setup.mjs +1 -1
  15. package/dist/chunks/ccjk-skills.mjs +1 -1
  16. package/dist/chunks/ccr.mjs +10 -10
  17. package/dist/chunks/ccu.mjs +1 -1
  18. package/dist/chunks/check-updates.mjs +3 -3
  19. package/dist/chunks/claude-code-config-manager.mjs +7 -7
  20. package/dist/chunks/claude-code-incremental-manager.mjs +2 -2
  21. package/dist/chunks/claude-config.mjs +3 -3
  22. package/dist/chunks/claude-wrapper.mjs +2 -2
  23. package/dist/chunks/codex-config-switch.mjs +2 -2
  24. package/dist/chunks/codex-provider-manager.mjs +2 -2
  25. package/dist/chunks/codex-uninstaller.mjs +2 -2
  26. package/dist/chunks/codex.mjs +5 -5
  27. package/dist/chunks/commands.mjs +88 -391
  28. package/dist/chunks/commands2.mjs +391 -88
  29. package/dist/chunks/completion.mjs +1 -1
  30. package/dist/chunks/config-consolidator.mjs +2 -2
  31. package/dist/chunks/config-switch.mjs +3 -3
  32. package/dist/chunks/config.mjs +5 -5
  33. package/dist/chunks/config2.mjs +410 -400
  34. package/dist/chunks/config3.mjs +400 -410
  35. package/dist/chunks/constants.mjs +1 -1
  36. package/dist/chunks/context.mjs +283 -1
  37. package/dist/chunks/dashboard.mjs +365 -0
  38. package/dist/chunks/doctor.mjs +4 -4
  39. package/dist/chunks/features.mjs +11 -11
  40. package/dist/chunks/fs-operations.mjs +1 -1
  41. package/dist/chunks/health-alerts.mjs +304 -0
  42. package/dist/chunks/health-check.mjs +532 -0
  43. package/dist/chunks/index.mjs +10 -177
  44. package/dist/chunks/index2.mjs +168 -1162
  45. package/dist/chunks/index3.mjs +1076 -910
  46. package/dist/chunks/index4.mjs +947 -137
  47. package/dist/chunks/index5.mjs +167 -635
  48. package/dist/chunks/index6.mjs +663 -0
  49. package/dist/chunks/init.mjs +19 -19
  50. package/dist/chunks/installer.mjs +649 -147
  51. package/dist/chunks/installer2.mjs +147 -649
  52. package/dist/chunks/interview.mjs +2 -2
  53. package/dist/chunks/marketplace.mjs +1 -1
  54. package/dist/chunks/mcp.mjs +4 -4
  55. package/dist/chunks/menu.mjs +16 -9
  56. package/dist/chunks/metrics-display.mjs +152 -0
  57. package/dist/chunks/migrator.mjs +1 -1
  58. package/dist/chunks/monitor.mjs +2 -2
  59. package/dist/chunks/notification.mjs +1 -1
  60. package/dist/chunks/onboarding.mjs +2 -2
  61. package/dist/chunks/package.mjs +1 -1
  62. package/dist/chunks/permission-manager.mjs +2 -2
  63. package/dist/chunks/permissions.mjs +1 -1
  64. package/dist/chunks/persistence-manager.mjs +781 -0
  65. package/dist/chunks/persistence.mjs +667 -0
  66. package/dist/chunks/platform.mjs +1 -1
  67. package/dist/chunks/plugin.mjs +1 -1
  68. package/dist/chunks/prompts.mjs +1 -1
  69. package/dist/chunks/providers.mjs +1 -1
  70. package/dist/chunks/quick-actions.mjs +321 -0
  71. package/dist/chunks/quick-setup.mjs +8 -8
  72. package/dist/chunks/silent-updater.mjs +1 -1
  73. package/dist/chunks/simple-config.mjs +2 -2
  74. package/dist/chunks/skill.mjs +1 -1
  75. package/dist/chunks/skills-sync.mjs +1 -1
  76. package/dist/chunks/skills.mjs +1 -1
  77. package/dist/chunks/slash-commands.mjs +208 -0
  78. package/dist/chunks/smart-defaults.mjs +1 -1
  79. package/dist/chunks/startup.mjs +1 -1
  80. package/dist/chunks/stats.mjs +1 -1
  81. package/dist/chunks/status.mjs +31 -2
  82. package/dist/chunks/team.mjs +1 -1
  83. package/dist/chunks/thinking.mjs +2 -2
  84. package/dist/chunks/uninstall.mjs +5 -5
  85. package/dist/chunks/update.mjs +7 -7
  86. package/dist/chunks/upgrade-manager.mjs +2 -2
  87. package/dist/chunks/version-checker.mjs +3 -3
  88. package/dist/chunks/vim.mjs +1 -1
  89. package/dist/cli.mjs +191 -21
  90. package/dist/i18n/locales/en/cli.json +14 -1
  91. package/dist/i18n/locales/en/common.json +27 -0
  92. package/dist/i18n/locales/en/context.json +54 -1
  93. package/dist/i18n/locales/en/dashboard.json +78 -0
  94. package/dist/i18n/locales/en/persistence.json +127 -0
  95. package/dist/i18n/locales/en/quick-actions.json +78 -0
  96. package/dist/i18n/locales/zh-CN/cli.json +14 -1
  97. package/dist/i18n/locales/zh-CN/common.json +27 -0
  98. package/dist/i18n/locales/zh-CN/context.json +54 -1
  99. package/dist/i18n/locales/zh-CN/dashboard.json +78 -0
  100. package/dist/i18n/locales/zh-CN/persistence.json +127 -0
  101. package/dist/i18n/locales/zh-CN/quick-actions.json +78 -0
  102. package/dist/index.mjs +2 -2
  103. package/dist/shared/{ccjk.DE91nClQ.mjs โ†’ ccjk.BKoi8-Hy.mjs} +1 -1
  104. package/dist/shared/{ccjk.Dpw86UX0.mjs โ†’ ccjk.CxtuJxaS.mjs} +1 -1
  105. package/dist/shared/{ccjk.ClzTOz9n.mjs โ†’ ccjk.DB2UYcq0.mjs} +5 -5
  106. package/dist/shared/{ccjk.Bndhan7G.mjs โ†’ ccjk.DfwJOEok.mjs} +1 -1
  107. package/dist/shared/{ccjk.DvIrK0wz.mjs โ†’ ccjk.DrMygfCF.mjs} +1 -1
  108. package/dist/shared/{ccjk.CmsW23FN.mjs โ†’ ccjk.IbImMVWM.mjs} +3 -3
  109. package/package.json +19 -19
@@ -4,10 +4,13 @@ import process__default from 'node:process';
4
4
  import ansis from 'ansis';
5
5
  import { join } from 'pathe';
6
6
  import { s as scanProject } from '../shared/ccjk.DKojSRzw.mjs';
7
- import { r as runHealthCheck } from '../shared/ccjk.Bndhan7G.mjs';
7
+ import { getContextPersistence } from './persistence.mjs';
8
+ import { MetricsDisplay } from './metrics-display.mjs';
9
+ import { r as runHealthCheck } from '../shared/ccjk.DfwJOEok.mjs';
8
10
  import 'node:child_process';
11
+ import 'better-sqlite3';
9
12
  import './constants.mjs';
10
- import './index.mjs';
13
+ import './index2.mjs';
11
14
  import 'node:url';
12
15
  import 'i18next';
13
16
  import 'i18next-fs-backend';
@@ -185,6 +188,28 @@ function renderClaudeCodeSection(defaults) {
185
188
  }
186
189
  return lines;
187
190
  }
191
+ function renderCompressionMetricsSection(projectHash) {
192
+ const lines = [];
193
+ lines.push(heading("Compression Metrics"));
194
+ try {
195
+ const persistence = getContextPersistence();
196
+ const stats = persistence.getCompressionMetricsStats(projectHash);
197
+ if (stats.totalCompressions === 0) {
198
+ lines.push(` ${ansis.gray("No compression data available")}`);
199
+ return lines;
200
+ }
201
+ lines.push(` ${label("Total Saved:".padEnd(14))} ${ansis.green(MetricsDisplay.formatTokenCount(stats.totalTokensSaved))} tokens`);
202
+ lines.push(` ${label("Avg Reduction:".padEnd(14))} ${ansis.yellow(MetricsDisplay.formatRatio(stats.averageCompressionRatio))}`);
203
+ lines.push(` ${label("Cost Savings:".padEnd(14))} ${ansis.green.bold(MetricsDisplay.formatCost(stats.estimatedCostSavings))}`);
204
+ if (stats.sessionStats && stats.sessionStats.compressions > 0) {
205
+ lines.push(` ${label("Session (24h):".padEnd(14))} ${ansis.white(stats.sessionStats.compressions)} compressions, ${ansis.green(MetricsDisplay.formatCost(stats.sessionStats.costSavings))} saved`);
206
+ }
207
+ return lines;
208
+ } catch {
209
+ lines.push(` ${ansis.gray("Metrics unavailable")}`);
210
+ return lines;
211
+ }
212
+ }
188
213
  function renderHealthSection(report, compact) {
189
214
  const lines = [];
190
215
  lines.push(heading("Brain Dashboard"));
@@ -242,6 +267,10 @@ async function statusCommand(options = {}) {
242
267
  sections.push(renderClaudeCodeSection(null));
243
268
  }
244
269
  sections.push(renderHealthSection(health, options.compact || false));
270
+ try {
271
+ sections.push(renderCompressionMetricsSection());
272
+ } catch {
273
+ }
245
274
  console.log();
246
275
  for (let i = 0; i < sections.length; i++) {
247
276
  console.log(sections[i].join("\n"));
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, readFileSync } from 'node:fs';
2
2
  import ansis from 'ansis';
3
3
  import inquirer from 'inquirer';
4
4
  import { join } from 'pathe';
5
- import { i18n } from './index.mjs';
5
+ import { i18n } from './index2.mjs';
6
6
  import { writeFileAtomic } from './fs-operations.mjs';
7
7
  import 'node:process';
8
8
  import 'node:url';
@@ -1,9 +1,9 @@
1
1
  import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
3
  import { SETTINGS_FILE } from './constants.mjs';
4
- import { i18n } from './index.mjs';
4
+ import { i18n } from './index2.mjs';
5
5
  import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
6
- import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DvIrK0wz.mjs';
6
+ import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DrMygfCF.mjs';
7
7
  import 'node:os';
8
8
  import 'pathe';
9
9
  import 'node:fs';
@@ -1,10 +1,10 @@
1
1
  import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
3
  import { ZCF_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, isCodeToolType } from './constants.mjs';
4
- import { i18n, ensureI18nInitialized } from './index.mjs';
4
+ import { i18n, ensureI18nInitialized } from './index2.mjs';
5
5
  import { readZcfConfig } from './ccjk-config.mjs';
6
- import { r as resolveCodeType } from '../shared/ccjk.Dpw86UX0.mjs';
7
- import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DvIrK0wz.mjs';
6
+ import { r as resolveCodeType } from '../shared/ccjk.CxtuJxaS.mjs';
7
+ import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DrMygfCF.mjs';
8
8
  import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
9
9
  import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
10
10
  import { promises } from 'node:fs';
@@ -21,12 +21,12 @@ import 'smol-toml';
21
21
  import './fs-operations.mjs';
22
22
  import 'node:crypto';
23
23
  import 'node:fs/promises';
24
+ import 'dayjs';
24
25
  import './smart-defaults.mjs';
25
26
  import 'node:child_process';
26
27
  import './platform.mjs';
27
28
  import '../shared/ccjk.DKojSRzw.mjs';
28
29
  import 'inquirer-toggle';
29
- import 'dayjs';
30
30
  import 'trash';
31
31
 
32
32
  async function pathExists(p) {
@@ -324,7 +324,7 @@ class ZcfUninstaller {
324
324
  result.removed.push(".claude.json (includes MCP configuration)");
325
325
  }
326
326
  try {
327
- const { uninstallCodeTool } = await import('./installer2.mjs');
327
+ const { uninstallCodeTool } = await import('./installer.mjs');
328
328
  const success = await uninstallCodeTool("claude-code");
329
329
  if (success) {
330
330
  result.removed.push("@anthropic-ai/claude-code");
@@ -3,15 +3,15 @@ import ansis from 'ansis';
3
3
  import inquirer from 'inquirer';
4
4
  import { version } from './package.mjs';
5
5
  import { SETTINGS_FILE, DEFAULT_CODE_TOOL_TYPE, resolveCodeToolType as resolveCodeToolType$1, isCodeToolType } from './constants.mjs';
6
- import { a as runCodexUpdate, M as MCP_SERVICE_CONFIGS, g as getMcpServices } from './codex.mjs';
7
- import { i18n } from './index.mjs';
8
- import { a as displayBanner } from '../shared/ccjk.Br91zBIG.mjs';
6
+ import { r as runCodexUpdate, M as MCP_SERVICE_CONFIGS, g as getMcpServices } from './codex.mjs';
7
+ import { i18n } from './index2.mjs';
8
+ import { displayBanner } from './banner.mjs';
9
9
  import { readZcfConfig, updateZcfConfig } from './ccjk-config.mjs';
10
10
  import { r as readMcpConfig } from './claude-config.mjs';
11
- import { a as copyConfigFiles } from './config.mjs';
12
- import { n as needsMigration, a as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration, u as updatePromptOnly, s as selectAndInstallWorkflows } from '../shared/ccjk.CmsW23FN.mjs';
13
- import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DvIrK0wz.mjs';
14
- import { b as installMcpServices } from '../shared/ccjk.ClzTOz9n.mjs';
11
+ import { c as copyConfigFiles } from './config.mjs';
12
+ import { n as needsMigration, m as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration, u as updatePromptOnly, s as selectAndInstallWorkflows } from '../shared/ccjk.IbImMVWM.mjs';
13
+ import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DrMygfCF.mjs';
14
+ import { i as installMcpServices } from '../shared/ccjk.DB2UYcq0.mjs';
15
15
  import { resolveAiOutputLanguage } from './prompts.mjs';
16
16
  import { checkClaudeCodeVersionAndPrompt } from './version-checker.mjs';
17
17
  import 'node:os';
@@ -4,8 +4,8 @@ import ora from 'ora';
4
4
  import * as semver from 'semver';
5
5
  import { exec } from 'tinyexec';
6
6
  import { version } from './package.mjs';
7
- import { S as STATUS } from '../shared/ccjk.Br91zBIG.mjs';
8
- import './index.mjs';
7
+ import { STATUS } from './banner.mjs';
8
+ import './index2.mjs';
9
9
  import 'node:fs';
10
10
  import 'node:url';
11
11
  import 'i18next';
@@ -4,7 +4,7 @@ import * as path from 'node:path';
4
4
  import process__default from 'node:process';
5
5
  import { promisify } from 'node:util';
6
6
  import * as semver from 'semver';
7
- import { d as getPlatform, f as findCommandPath, e as getHomebrewCommandPaths } from './platform.mjs';
7
+ import { g as getPlatform, f as findCommandPath, a as getHomebrewCommandPaths } from './platform.mjs';
8
8
  import 'node:os';
9
9
  import 'pathe';
10
10
  import 'tinyexec';
@@ -650,7 +650,7 @@ async function performNpmRemovalAndActivateHomebrew(_npmInstallation, homebrewIn
650
650
  if (homebrewInstallation && !homebrewInstallation.isActive) {
651
651
  console.log("");
652
652
  console.log(ansis.green(`\u{1F517} ${i18n.t("installation:activatingHomebrew")}`));
653
- const { createHomebrewSymlink } = await import('./installer2.mjs');
653
+ const { createHomebrewSymlink } = await import('./installer.mjs');
654
654
  const symlinkResult = await createHomebrewSymlink("claude", homebrewInstallation.path);
655
655
  if (symlinkResult.success) {
656
656
  console.log(ansis.green(`\u2714 ${i18n.t("installation:symlinkCreated", { path: symlinkResult.symlinkPath || "/usr/local/bin/claude" })}`));
@@ -674,7 +674,7 @@ async function performNpmRemovalAndActivateHomebrew(_npmInstallation, homebrewIn
674
674
  }
675
675
  }
676
676
  async function handleDuplicateInstallations(skipPrompt = false) {
677
- const { ensureI18nInitialized, format, i18n } = await import('./index.mjs');
677
+ const { ensureI18nInitialized, format, i18n } = await import('./index2.mjs');
678
678
  const ansis = (await import('ansis')).default;
679
679
  ensureI18nInitialized();
680
680
  const duplicateInfo = await checkDuplicateInstallations();
@@ -1,6 +1,6 @@
1
1
  import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
- import { ensureI18nInitialized, i18n } from './index.mjs';
3
+ import { ensureI18nInitialized, i18n } from './index2.mjs';
4
4
  import { existsSync, readFileSync } from 'node:fs';
5
5
  import { readFile, writeFile, mkdir } from 'node:fs/promises';
6
6
  import { homedir } from 'node:os';
package/dist/cli.mjs CHANGED
@@ -202,25 +202,25 @@ const COMMANDS = [
202
202
  const actionStr = action;
203
203
  const argsArr = args;
204
204
  if (actionStr === "install") {
205
- const { installAgentBrowser } = await import('./chunks/installer.mjs');
205
+ const { installAgentBrowser } = await import('./chunks/installer2.mjs');
206
206
  await installAgentBrowser(options);
207
207
  } else if (actionStr === "uninstall") {
208
- const { uninstallAgentBrowser } = await import('./chunks/installer.mjs');
208
+ const { uninstallAgentBrowser } = await import('./chunks/installer2.mjs');
209
209
  await uninstallAgentBrowser(options);
210
210
  } else if (actionStr === "status") {
211
- const { agentBrowserStatus } = await import('./chunks/commands.mjs');
211
+ const { agentBrowserStatus } = await import('./chunks/commands2.mjs');
212
212
  await agentBrowserStatus(options);
213
213
  } else if (actionStr === "start") {
214
- const { startBrowserSession } = await import('./chunks/commands.mjs');
214
+ const { startBrowserSession } = await import('./chunks/commands2.mjs');
215
215
  await startBrowserSession(argsArr[0], options);
216
216
  } else if (actionStr === "stop") {
217
- const { stopBrowserSession } = await import('./chunks/commands.mjs');
217
+ const { stopBrowserSession } = await import('./chunks/commands2.mjs');
218
218
  await stopBrowserSession(options);
219
219
  } else if (actionStr === "config") {
220
- const { configureBrowser } = await import('./chunks/commands.mjs');
220
+ const { configureBrowser } = await import('./chunks/commands2.mjs');
221
221
  await configureBrowser(options);
222
222
  } else {
223
- const { agentBrowserHelp } = await import('./chunks/commands.mjs');
223
+ const { agentBrowserHelp } = await import('./chunks/commands2.mjs');
224
224
  agentBrowserHelp(options);
225
225
  }
226
226
  };
@@ -304,25 +304,25 @@ const COMMANDS = [
304
304
  const argsArr = args;
305
305
  const configOptions = { global: !!options.global, json: options.format === "json" };
306
306
  if (!actionStr || actionStr === "list") {
307
- const { listConfig } = await import('./chunks/config2.mjs');
307
+ const { listConfig } = await import('./chunks/config3.mjs');
308
308
  await listConfig(configOptions);
309
309
  } else if (actionStr === "get") {
310
- const { getConfig } = await import('./chunks/config2.mjs');
310
+ const { getConfig } = await import('./chunks/config3.mjs');
311
311
  await getConfig(argsArr[0] || "", configOptions);
312
312
  } else if (actionStr === "set") {
313
- const { setConfig } = await import('./chunks/config2.mjs');
313
+ const { setConfig } = await import('./chunks/config3.mjs');
314
314
  await setConfig(argsArr[0] || "", argsArr[1] || "", configOptions);
315
315
  } else if (actionStr === "unset") {
316
- const { unsetConfig } = await import('./chunks/config2.mjs');
316
+ const { unsetConfig } = await import('./chunks/config3.mjs');
317
317
  await unsetConfig(argsArr[0] || "", configOptions);
318
318
  } else if (actionStr === "reset") {
319
- const { resetConfig } = await import('./chunks/config2.mjs');
319
+ const { resetConfig } = await import('./chunks/config3.mjs');
320
320
  await resetConfig(configOptions);
321
321
  } else if (actionStr === "edit") {
322
- const { editConfig } = await import('./chunks/config2.mjs');
322
+ const { editConfig } = await import('./chunks/config3.mjs');
323
323
  await editConfig(configOptions);
324
324
  } else if (actionStr === "validate") {
325
- const { validateConfig } = await import('./chunks/config2.mjs');
325
+ const { validateConfig } = await import('./chunks/config3.mjs');
326
326
  await validateConfig(configOptions);
327
327
  } else {
328
328
  console.error(`Unknown config action: ${actionStr}`);
@@ -468,7 +468,7 @@ const COMMANDS = [
468
468
  ],
469
469
  loader: async () => {
470
470
  return async (options, action, args) => {
471
- const { initI18n } = await import('./chunks/index.mjs');
471
+ const { initI18n } = await import('./chunks/index2.mjs');
472
472
  await initI18n(options.lang || "zh-CN");
473
473
  const actionStr = action;
474
474
  const argsArr = args;
@@ -693,7 +693,18 @@ const COMMANDS = [
693
693
  aliases: ["ctx"],
694
694
  tier: "extended",
695
695
  options: [
696
- { flags: "--verbose, -v", description: "Verbose output" }
696
+ { flags: "--verbose, -v", description: "Verbose output" },
697
+ { flags: "--show", description: "Show context layers" },
698
+ { flags: "--layers <layers>", description: "Specific layers to show" },
699
+ { flags: "--task <task>", description: "Preview context for task" },
700
+ { flags: "--clear", description: "Clear context cache" },
701
+ { flags: "--health", description: "Run database health check" },
702
+ { flags: "--alerts", description: "Show current health alerts" },
703
+ { flags: "--alert-history", description: "Show alert history" },
704
+ { flags: "--checkpoint", description: "Checkpoint WAL file" },
705
+ { flags: "--vacuum", description: "Vacuum database" },
706
+ { flags: "--backup", description: "Create database backup" },
707
+ { flags: "--recover", description: "Attempt database recovery" }
697
708
  ],
698
709
  loader: async () => {
699
710
  const { contextCommand } = await import('./chunks/context.mjs');
@@ -790,7 +801,7 @@ const COMMANDS = [
790
801
  return async (options, action, args) => {
791
802
  const actionStr = action;
792
803
  const argsArr = args || [];
793
- const { getPostmortemManager } = await import('./chunks/index2.mjs');
804
+ const { getPostmortemManager } = await import('./chunks/index3.mjs');
794
805
  const manager = getPostmortemManager(process__default.cwd());
795
806
  if (actionStr === "init") {
796
807
  const ora = (await import('ora')).default;
@@ -1030,7 +1041,7 @@ ${ansis.yellow("By Status:")}`);
1030
1041
  { flags: "--json", description: "Output in JSON format" }
1031
1042
  ],
1032
1043
  loader: async () => {
1033
- const { configCommand } = await import('./chunks/config2.mjs');
1044
+ const { configCommand } = await import('./chunks/config3.mjs');
1034
1045
  return async (options, action, key, value) => {
1035
1046
  const args = [];
1036
1047
  if (key !== void 0)
@@ -1150,6 +1161,21 @@ ${ansis.yellow("By Status:")}`);
1150
1161
  };
1151
1162
  }
1152
1163
  },
1164
+ {
1165
+ name: "ccjk:persistence",
1166
+ description: "Manage context persistence and storage tiers",
1167
+ aliases: ["ccjk-persistence", "persistence"],
1168
+ tier: "extended",
1169
+ options: [
1170
+ { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1171
+ ],
1172
+ loader: async () => {
1173
+ return async (options) => {
1174
+ const { persistenceManager } = await import('./chunks/persistence-manager.mjs');
1175
+ await persistenceManager();
1176
+ };
1177
+ }
1178
+ },
1153
1179
  {
1154
1180
  name: "ccjk:hooks",
1155
1181
  description: "Auto-recommend and configure CCJK hooks based on project analysis",
@@ -1390,6 +1416,79 @@ ${ansis.yellow("By Status:")}`);
1390
1416
  };
1391
1417
  }
1392
1418
  },
1419
+ {
1420
+ name: "dashboard",
1421
+ description: "Brain Dashboard - context compression and persistence monitoring",
1422
+ aliases: ["dash", "db"],
1423
+ tier: "core",
1424
+ options: [
1425
+ { flags: "--json", description: "Output as JSON" },
1426
+ { flags: "--compact", description: "Compact output" }
1427
+ ],
1428
+ loader: async () => {
1429
+ const { dashboardCommand } = await import('./chunks/dashboard.mjs');
1430
+ return async (options) => {
1431
+ await dashboardCommand({
1432
+ json: options.json,
1433
+ compact: options.compact
1434
+ });
1435
+ };
1436
+ }
1437
+ },
1438
+ {
1439
+ name: "morning",
1440
+ description: "Morning health check + stats summary",
1441
+ tier: "core",
1442
+ options: [
1443
+ { flags: "--json", description: "Output as JSON" },
1444
+ { flags: "--silent", description: "Silent mode" }
1445
+ ],
1446
+ loader: async () => {
1447
+ const { morningCommand } = await import('./chunks/quick-actions.mjs');
1448
+ return async (options) => {
1449
+ await morningCommand({
1450
+ json: options.json,
1451
+ silent: options.silent
1452
+ });
1453
+ };
1454
+ }
1455
+ },
1456
+ {
1457
+ name: "review",
1458
+ description: "Daily review - contexts used, tokens saved",
1459
+ tier: "core",
1460
+ options: [
1461
+ { flags: "--json", description: "Output as JSON" },
1462
+ { flags: "--silent", description: "Silent mode" }
1463
+ ],
1464
+ loader: async () => {
1465
+ const { reviewCommand } = await import('./chunks/quick-actions.mjs');
1466
+ return async (options) => {
1467
+ await reviewCommand({
1468
+ json: options.json,
1469
+ silent: options.silent
1470
+ });
1471
+ };
1472
+ }
1473
+ },
1474
+ {
1475
+ name: "cleanup",
1476
+ description: "Weekly cleanup - old contexts, VACUUM",
1477
+ tier: "core",
1478
+ options: [
1479
+ { flags: "--json", description: "Output as JSON" },
1480
+ { flags: "--silent", description: "Silent mode" }
1481
+ ],
1482
+ loader: async () => {
1483
+ const { cleanupCommand } = await import('./chunks/quick-actions.mjs');
1484
+ return async (options) => {
1485
+ await cleanupCommand({
1486
+ json: options.json,
1487
+ silent: options.silent
1488
+ });
1489
+ };
1490
+ }
1491
+ },
1393
1492
  {
1394
1493
  name: "boost",
1395
1494
  description: "One-click optimization - auto-apply all recommendations",
@@ -1421,7 +1520,7 @@ ${ansis.yellow("By Status:")}`);
1421
1520
  { flags: "--lang, -l <lang>", description: "Display language (zh-CN, en)" }
1422
1521
  ],
1423
1522
  loader: async () => {
1424
- const { addCommand } = await import('./chunks/index3.mjs');
1523
+ const { addCommand } = await import('./chunks/index4.mjs');
1425
1524
  return async (options, source) => {
1426
1525
  await addCommand(source, {
1427
1526
  type: options.type,
@@ -1439,7 +1538,7 @@ let currentLang = "en";
1439
1538
  async function initI18nLazy(lang) {
1440
1539
  if (i18nInitialized && lang === currentLang)
1441
1540
  return;
1442
- const { initI18n, changeLanguage } = await import('./chunks/index.mjs');
1541
+ const { initI18n, changeLanguage } = await import('./chunks/index2.mjs');
1443
1542
  if (!i18nInitialized) {
1444
1543
  await initI18n(lang || "en");
1445
1544
  i18nInitialized = true;
@@ -1499,6 +1598,7 @@ async function setupCommandsLazy(cli) {
1499
1598
  if (cmd.name !== "claude") {
1500
1599
  command.option("--lang, -l <lang>", "Display language (zh-CN, en)");
1501
1600
  command.option("--all-lang, -g <lang>", "Set all language parameters");
1601
+ command.option("--no-banner", "Skip command discovery banner");
1502
1602
  } else {
1503
1603
  command.allowUnknownOptions();
1504
1604
  }
@@ -1729,6 +1829,65 @@ function customizeHelpLazy(_sections, version) {
1729
1829
  });
1730
1830
  return newSections;
1731
1831
  }
1832
+ async function runHealthAlertsCheck() {
1833
+ try {
1834
+ const args = process__default.argv.slice(2);
1835
+ if (args.includes("--silent")) {
1836
+ return;
1837
+ }
1838
+ const shouldCheck = args.length === 0 || args[0] === "status" || args[0] === "doctor";
1839
+ if (!shouldCheck) {
1840
+ return;
1841
+ }
1842
+ const { join } = await import('pathe');
1843
+ const dbPath = join(
1844
+ process__default.env.HOME || process__default.env.USERPROFILE || ".",
1845
+ ".ccjk",
1846
+ "context",
1847
+ "contexts.db"
1848
+ );
1849
+ const { runStartupHealthCheck } = await import('./chunks/health-alerts.mjs');
1850
+ await runStartupHealthCheck(dbPath, { silent: false });
1851
+ } catch {
1852
+ }
1853
+ }
1854
+ async function showCommandDiscoveryBanner() {
1855
+ try {
1856
+ const args = process__default.argv.slice(2);
1857
+ if (args.includes("--no-banner")) {
1858
+ return;
1859
+ }
1860
+ if (args.length > 0 && !args[0].startsWith("-")) {
1861
+ return;
1862
+ }
1863
+ const { join } = await import('pathe');
1864
+ const { existsSync, writeFileSync } = await import('node:fs');
1865
+ const markerPath = join(
1866
+ process__default.env.HOME || process__default.env.USERPROFILE || ".",
1867
+ ".ccjk",
1868
+ ".banner-shown"
1869
+ );
1870
+ const isFirstRun = !existsSync(markerPath);
1871
+ const showHelp = args.includes("--help") || args.includes("-h");
1872
+ if (isFirstRun || showHelp) {
1873
+ const envLang = process__default.env.CCJK_LANG;
1874
+ if (envLang) {
1875
+ await initI18nLazy(envLang);
1876
+ }
1877
+ const { displayCommandDiscovery } = await import('./chunks/banner.mjs');
1878
+ displayCommandDiscovery();
1879
+ if (isFirstRun) {
1880
+ try {
1881
+ const { ensureDir } = await import('./chunks/fs-operations.mjs');
1882
+ await ensureDir(join(process__default.env.HOME || process__default.env.USERPROFILE || ".", ".ccjk"));
1883
+ writeFileSync(markerPath, (/* @__PURE__ */ new Date()).toISOString());
1884
+ } catch {
1885
+ }
1886
+ }
1887
+ }
1888
+ } catch {
1889
+ }
1890
+ }
1732
1891
  async function runLazyCli() {
1733
1892
  const spinner = await showStartupSpinner();
1734
1893
  try {
@@ -1743,10 +1902,21 @@ async function runLazyCli() {
1743
1902
  spinner?.stop();
1744
1903
  return;
1745
1904
  }
1905
+ const args = process__default.argv.slice(2);
1906
+ if (args.length > 0 && args[0].startsWith("/")) {
1907
+ spinner?.stop();
1908
+ const { executeSlashCommand } = await import('./chunks/slash-commands.mjs');
1909
+ const slashHandled = await executeSlashCommand(args.join(" "));
1910
+ if (slashHandled) {
1911
+ return;
1912
+ }
1913
+ }
1746
1914
  const cac = (await import('cac')).default;
1747
1915
  const cli = cac("ccjk");
1748
1916
  await setupCommandsLazy(cli);
1749
1917
  spinner?.stop();
1918
+ await runHealthAlertsCheck();
1919
+ await showCommandDiscoveryBanner();
1750
1920
  cli.parse();
1751
1921
  } catch (error) {
1752
1922
  spinner?.stop();
@@ -1822,7 +1992,7 @@ function bootstrapCloudServices() {
1822
1992
  await autoBootstrap();
1823
1993
  const { autoUpgrade } = await import('./chunks/silent-updater.mjs');
1824
1994
  await autoUpgrade();
1825
- const { activateSuperpowers } = await import('./chunks/index4.mjs');
1995
+ const { activateSuperpowers } = await import('./chunks/index5.mjs');
1826
1996
  await activateSuperpowers("zh-CN");
1827
1997
  const { setupBrainHook } = await import('./chunks/cli-hook.mjs');
1828
1998
  await setupBrainHook({
@@ -135,5 +135,18 @@
135
135
  "commands.ccjkSetup.args.verbose": "Enable verbose output",
136
136
  "commands.ccjkSetup.args.backup": "Create backup before setup",
137
137
  "commands.ccjkSetup.args.rollbackOnError": "Auto-rollback on failure",
138
- "commands.ccjkSetup.args.lang": "Display language"
138
+ "commands.ccjkSetup.args.lang": "Display language",
139
+ "commandDiscovery.title": "๐Ÿง  CCJK Commands (ccjk ๅ‘ฝไปค)",
140
+ "commandDiscovery.claudeCodeTitle": "๐Ÿค– Claude Code Commands",
141
+ "commandDiscovery.status": "Brain Dashboard",
142
+ "commandDiscovery.health": "Health Check",
143
+ "commandDiscovery.search": "Search Contexts",
144
+ "commandDiscovery.compress": "Compression Stats",
145
+ "commandDiscovery.tasks": "Task Manager",
146
+ "commandDiscovery.backup": "Create Backup",
147
+ "commandDiscovery.optimize": "Optimize DB",
148
+ "commandDiscovery.help": "Show all commands",
149
+ "commandDiscovery.clear": "Clear conversation",
150
+ "commandDiscovery.reset": "Reset session",
151
+ "commandDiscovery.footer": "Type 'ccjk --help' for full command list"
139
152
  }
@@ -37,5 +37,32 @@
37
37
  "body": "Conversation is getting long ({{toolCalls}} tool calls, {{messageCount}} messages)",
38
38
  "suggestion": "Recommend running /compact to clean up context and avoid \"prompt is too long\" errors",
39
39
  "command": "Run: /compact"
40
+ },
41
+ "slashCommands": {
42
+ "title": "๐Ÿ’ก Quick Commands",
43
+ "ccjkCommands": "๐Ÿง  CCJK Commands",
44
+ "claudeCodeCommands": "๐Ÿค– Claude Code Commands",
45
+ "helpTip": "Type /help for full command list",
46
+ "unknownCommand": "Unknown command: /{command}",
47
+ "typeHelp": "Type /help to see all available commands",
48
+ "categories": {
49
+ "brain": "๐Ÿง  Brain System",
50
+ "context": "๐Ÿ“ฆ Context Management",
51
+ "system": "โš™๏ธ System Tools"
52
+ },
53
+ "commands": {
54
+ "status": "Show Brain Dashboard with health score",
55
+ "health": "Run comprehensive health check",
56
+ "search": "Search contexts using FTS5 full-text search",
57
+ "compress": "Show compression statistics and metrics",
58
+ "tasks": "Open task manager (Brain system)",
59
+ "backup": "Create configuration backup",
60
+ "optimize": "Run VACUUM + checkpoint on context database",
61
+ "help": "Show all CCJK slash commands"
62
+ },
63
+ "usage": {
64
+ "search": "Usage: /search <query>",
65
+ "searchExample": "Example: /search \"authentication logic\""
66
+ }
40
67
  }
41
68
  }
@@ -28,5 +28,58 @@
28
28
  "helpStatusDesc": "Show current wrapper status",
29
29
  "helpInstallDesc": "Install shell hook for transparent wrapping",
30
30
  "helpUninstallDesc": "Uninstall shell hook",
31
- "helpExamples": "Examples:"
31
+ "helpExamples": "Examples:",
32
+ "healthAlertsTitle": "Database Health Alerts",
33
+ "healthCheckFailed": "Health check failed",
34
+ "corruptionDetected": "Database corruption detected",
35
+ "corruptionAction": "Run: ccjk context recover",
36
+ "walSizeLarge": "WAL file is {{size}}MB (threshold: {{threshold}}MB)",
37
+ "walSizeInfo": "WAL file is {{size}}MB",
38
+ "walAction": "Run: ccjk context checkpoint",
39
+ "walActionSoon": "Consider checkpointing soon",
40
+ "diskUtilizationLow": "Disk utilization is {{percent}}% (threshold: {{threshold}}%)",
41
+ "diskAction": "Run: ccjk context vacuum",
42
+ "noBackups": "No backups found",
43
+ "backupOld": "Latest backup is {{days}} days old (threshold: {{threshold}} days)",
44
+ "backupInfo": "Latest backup is {{days}} days old",
45
+ "backupAction": "Run: ccjk context backup",
46
+ "backupActionSoon": "Consider creating a new backup",
47
+ "performanceSlow": "Query performance is slow ({{time}}ms)",
48
+ "performanceAction": "Check database indexes",
49
+ "alertCritical": "CRITICAL",
50
+ "alertWarning": "WARNING",
51
+ "alertInfo": "INFO",
52
+ "alertHistoryTitle": "Alert History",
53
+ "alertHistoryEmpty": "No alert history",
54
+ "alertResolved": "Resolved",
55
+ "alertUnresolved": "Unresolved",
56
+ "alertSummaryTitle": "Alert Summary",
57
+ "alertSummaryTotal": "Total Alerts",
58
+ "alertSummaryCritical": "Critical",
59
+ "alertSummaryWarning": "Warnings",
60
+ "alertSummaryInfo": "Info",
61
+ "alertSummaryUnresolved": "Unresolved",
62
+ "alertSummaryLastCheck": "Last Check",
63
+ "metricsTitle": "Compression Metrics",
64
+ "metricsOverall": "Overall",
65
+ "metricsSession": "Session (24h)",
66
+ "metricsWeekly": "Weekly (7d)",
67
+ "metricsMonthly": "Monthly (30d)",
68
+ "metricsTotalCompressions": "Total Compressions",
69
+ "metricsTokensSaved": "Tokens Saved",
70
+ "metricsAvgCompression": "Avg Compression",
71
+ "metricsAvgTime": "Avg Time",
72
+ "metricsCostSavings": "Cost Savings",
73
+ "metricsCompressions": "Compressions",
74
+ "metricsCompressed": "Compressed",
75
+ "metricsReduction": "reduction",
76
+ "metricsRecentCompressions": "Recent Compressions",
77
+ "metricsOriginal": "Original",
78
+ "metricsCompressedTokens": "Compressed",
79
+ "metricsRatio": "Ratio",
80
+ "metricsTime": "Time",
81
+ "metricsStrategy": "Strategy",
82
+ "metricsAlgorithm": "Algorithm",
83
+ "metricsNoData": "No compression metrics available",
84
+ "metricsCostNote": "Cost based on $0.015 per 1K tokens (Claude Opus pricing)"
32
85
  }