ccjk 13.3.6 → 13.3.7

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 (150) hide show
  1. package/dist/chunks/agent-teams.mjs +7 -5
  2. package/dist/chunks/agent.mjs +2 -2
  3. package/dist/chunks/agents.mjs +16 -16
  4. package/dist/chunks/api-cli.mjs +6 -6
  5. package/dist/chunks/api-providers.mjs +1 -1
  6. package/dist/chunks/api.mjs +4 -4
  7. package/dist/chunks/auto-bootstrap.mjs +1 -1
  8. package/dist/chunks/auto-fix.mjs +49 -4
  9. package/dist/chunks/auto-fixer.mjs +7 -5
  10. package/dist/chunks/auto-init.mjs +9 -7208
  11. package/dist/chunks/auto-memory-bridge.mjs +9 -3
  12. package/dist/chunks/auto-updater.mjs +9 -9
  13. package/dist/chunks/auto-upgrade.mjs +5 -3
  14. package/dist/chunks/banner.mjs +4 -3
  15. package/dist/chunks/boost.mjs +118 -62
  16. package/dist/chunks/ccjk-agents.mjs +3 -3
  17. package/dist/chunks/ccjk-all.mjs +7 -7
  18. package/dist/chunks/ccjk-config.mjs +2 -2
  19. package/dist/chunks/ccjk-hooks.mjs +4 -4
  20. package/dist/chunks/ccjk-mcp.mjs +5 -5
  21. package/dist/chunks/ccjk-setup.mjs +5 -5
  22. package/dist/chunks/ccjk-skills.mjs +5 -5
  23. package/dist/chunks/ccr.mjs +18 -16
  24. package/dist/chunks/ccu.mjs +2 -2
  25. package/dist/chunks/check-updates.mjs +8 -8
  26. package/dist/chunks/claude-code-config-manager.mjs +12 -10
  27. package/dist/chunks/claude-code-incremental-manager.mjs +7 -7
  28. package/dist/chunks/claude-config.mjs +1 -1
  29. package/dist/chunks/claude-wrapper.mjs +1 -1
  30. package/dist/chunks/cli-hook.mjs +15 -15
  31. package/dist/chunks/codex-config-switch.mjs +7 -7
  32. package/dist/chunks/codex-provider-manager.mjs +7 -7
  33. package/dist/chunks/codex-uninstaller.mjs +2 -2
  34. package/dist/chunks/codex.mjs +5 -5
  35. package/dist/chunks/commands.mjs +2 -2
  36. package/dist/chunks/commands2.mjs +3 -3
  37. package/dist/chunks/commit.mjs +2 -2
  38. package/dist/chunks/completion.mjs +2 -2
  39. package/dist/chunks/config-consolidator.mjs +2 -2
  40. package/dist/chunks/config-switch.mjs +8 -8
  41. package/dist/chunks/config.mjs +6 -5
  42. package/dist/chunks/config2.mjs +5 -5
  43. package/dist/chunks/config3.mjs +4 -4
  44. package/dist/chunks/constants.mjs +1 -1
  45. package/dist/chunks/context-opt.mjs +92 -90
  46. package/dist/chunks/context.mjs +659 -0
  47. package/dist/chunks/dashboard.mjs +14 -9
  48. package/dist/chunks/doctor.mjs +4 -4
  49. package/dist/chunks/eval.mjs +502 -0
  50. package/dist/chunks/evolution.mjs +46 -39
  51. package/dist/chunks/health-alerts.mjs +9 -9
  52. package/dist/chunks/help.mjs +1 -1
  53. package/dist/chunks/hook-installer.mjs +6 -3
  54. package/dist/chunks/index.mjs +23 -0
  55. package/dist/chunks/index10.mjs +634 -571
  56. package/dist/chunks/index11.mjs +1061 -569
  57. package/dist/chunks/index12.mjs +914 -1076
  58. package/dist/chunks/index13.mjs +136 -951
  59. package/dist/chunks/index14.mjs +209 -185
  60. package/dist/chunks/index2.mjs +19 -24
  61. package/dist/chunks/index3.mjs +19085 -12
  62. package/dist/chunks/index4.mjs +16 -19092
  63. package/dist/chunks/index5.mjs +7602 -16
  64. package/dist/chunks/index6.mjs +159 -7590
  65. package/dist/chunks/index7.mjs +1602 -171
  66. package/dist/chunks/index8.mjs +19 -1602
  67. package/dist/chunks/index9.mjs +612 -15
  68. package/dist/chunks/init.mjs +26 -19
  69. package/dist/chunks/installer.mjs +5 -5
  70. package/dist/chunks/installer2.mjs +2 -2
  71. package/dist/chunks/intent-engine.mjs +1 -1
  72. package/dist/chunks/interview.mjs +4 -4
  73. package/dist/chunks/manager.mjs +1 -1
  74. package/dist/chunks/marketplace.mjs +2 -2
  75. package/dist/chunks/mcp-cli.mjs +12 -12
  76. package/dist/chunks/mcp.mjs +8 -8
  77. package/dist/chunks/memory.mjs +8 -8
  78. package/dist/chunks/menu-hierarchical.mjs +24 -22
  79. package/dist/chunks/menu.mjs +27 -22
  80. package/dist/chunks/metrics-display.mjs +2 -2
  81. package/dist/chunks/migrator.mjs +1 -1
  82. package/dist/chunks/monitor.mjs +2 -2
  83. package/dist/chunks/notification.mjs +6 -6
  84. package/dist/chunks/onboarding-wizard.mjs +6 -5
  85. package/dist/chunks/onboarding.mjs +4 -4
  86. package/dist/chunks/package.mjs +1 -1
  87. package/dist/chunks/paradigm.mjs +2 -2
  88. package/dist/chunks/permission-manager.mjs +2 -2
  89. package/dist/chunks/permissions.mjs +3 -3
  90. package/dist/chunks/persistence-manager.mjs +19 -12
  91. package/dist/chunks/persistence.mjs +5 -3
  92. package/dist/chunks/plugin.mjs +2 -2
  93. package/dist/chunks/prompts.mjs +5 -5
  94. package/dist/chunks/providers.mjs +2 -2
  95. package/dist/chunks/quick-actions.mjs +7 -6
  96. package/dist/chunks/quick-provider.mjs +5 -4
  97. package/dist/chunks/quick-setup.mjs +20 -15
  98. package/dist/chunks/remote.mjs +15 -16
  99. package/dist/chunks/{convoy-manager.mjs → session-manager.mjs} +1129 -1095
  100. package/dist/chunks/session.mjs +2 -2
  101. package/dist/chunks/sessions.mjs +3 -3
  102. package/dist/chunks/silent-updater.mjs +1 -1
  103. package/dist/chunks/simple-config.mjs +2 -2
  104. package/dist/chunks/skill2.mjs +3 -3
  105. package/dist/chunks/skills-sync.mjs +5 -5
  106. package/dist/chunks/skills.mjs +3 -3
  107. package/dist/chunks/slash-commands.mjs +9 -8
  108. package/dist/chunks/smart-defaults.mjs +9 -5
  109. package/dist/chunks/startup.mjs +1 -1
  110. package/dist/chunks/stats.mjs +2 -2
  111. package/dist/chunks/status.mjs +37 -22
  112. package/dist/chunks/team.mjs +3 -3
  113. package/dist/chunks/thinking.mjs +4 -4
  114. package/dist/chunks/trace.mjs +2 -2
  115. package/dist/chunks/uninstall.mjs +9 -9
  116. package/dist/chunks/update.mjs +14 -11
  117. package/dist/chunks/upgrade-manager.mjs +3 -3
  118. package/dist/chunks/upgrade.mjs +25 -9
  119. package/dist/chunks/version-checker.mjs +4 -4
  120. package/dist/chunks/vim.mjs +3 -3
  121. package/dist/chunks/workflows.mjs +1 -1
  122. package/dist/chunks/wsl.mjs +1 -1
  123. package/dist/chunks/zero-config.mjs +4 -4
  124. package/dist/cli.mjs +60 -26
  125. package/dist/index.d.mts +4392 -4392
  126. package/dist/index.d.ts +4392 -4392
  127. package/dist/index.mjs +4314 -4314
  128. package/dist/shared/{ccjk.DcKLglJQ.mjs → ccjk.BIxuVL3_.mjs} +2 -2
  129. package/dist/shared/{ccjk.DJdmgr2d.mjs → ccjk.BJMRY2Ra.mjs} +5 -3
  130. package/dist/shared/{ccjk.B1TwPltj.mjs → ccjk.BOu1yav7.mjs} +3 -2
  131. package/dist/shared/{ccjk.mJpVRDZ8.mjs → ccjk.BWFpnOr3.mjs} +1 -1
  132. package/dist/shared/{ccjk.BfIpomdz.mjs → ccjk.CHUEFqmw.mjs} +3 -2
  133. package/dist/shared/{ccjk.CqdbaXqU.mjs → ccjk.CLUL0pAV.mjs} +9 -5
  134. package/dist/shared/{ccjk.Cot9p9_n.mjs → ccjk.Cjj8SVrn.mjs} +1 -1
  135. package/dist/shared/{ccjk.CfrpIIKy.mjs → ccjk.Crd_nEfj.mjs} +38 -20
  136. package/dist/shared/{ccjk.DCw2WnZU.mjs → ccjk.CvChMYvB.mjs} +1 -1
  137. package/dist/shared/{ccjk.CXzjn01x.mjs → ccjk.D8ZLYSZZ.mjs} +1 -1
  138. package/dist/shared/{ccjk.BrPUmTqm.mjs → ccjk.DJuyfrlL.mjs} +164 -82
  139. package/dist/shared/{ccjk.DHXfsrwn.mjs → ccjk.DRfdq6yl.mjs} +4 -4
  140. package/dist/shared/{ccjk.DXRAZcix.mjs → ccjk.DScm_NnL.mjs} +8 -4
  141. package/dist/shared/{ccjk.XsJWJuQP.mjs → ccjk.DfZKjHvG.mjs} +6 -128
  142. package/dist/shared/{ccjk.BFxsJM0k.mjs → ccjk.DwSebGy0.mjs} +4 -3
  143. package/dist/shared/ccjk.DxWqH-EF.mjs +170 -0
  144. package/dist/shared/{ccjk.Cwa_FiTX.mjs → ccjk.I6IuYdc_.mjs} +2 -2
  145. package/dist/shared/{ccjk.DpstNaeR.mjs → ccjk.KpFl2RDA.mjs} +3 -3
  146. package/dist/shared/{ccjk.dYDLfmph.mjs → ccjk._dESH4Rk.mjs} +1 -1
  147. package/dist/shared/{ccjk.BxSmJ8B7.mjs → ccjk.wLJHO0Af.mjs} +2 -1
  148. package/package.json +2 -1
  149. package/dist/chunks/index15.mjs +0 -218
  150. package/dist/shared/{ccjk.c-ETfBZ_.mjs → ccjk.eIn-g1yI.mjs} +96 -96
@@ -1,10 +1,10 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import process__default from 'node:process';
3
- import a from './index3.mjs';
4
- import { i as inquirer } from './index4.mjs';
3
+ import a from './index2.mjs';
4
+ import { i as inquirer } from './index3.mjs';
5
5
  import { getApiProviderPresets } from './api-providers.mjs';
6
6
  import { SETTINGS_FILE } from './constants.mjs';
7
- import { i18n } from './index6.mjs';
7
+ import { i18n } from './index5.mjs';
8
8
  import { b as backupExistingConfig } from './config.mjs';
9
9
  import '../shared/ccjk.BAGoDD49.mjs';
10
10
  import 'node:readline';
@@ -33,7 +33,7 @@ import './main.mjs';
33
33
  import 'module';
34
34
  import 'node:child_process';
35
35
  import 'node:stream';
36
- import '../shared/ccjk.DXRAZcix.mjs';
36
+ import '../shared/ccjk.DScm_NnL.mjs';
37
37
 
38
38
  async function getConfig(key, options = {}) {
39
39
  const isZh = i18n.language === "zh-CN";
@@ -1,5 +1,5 @@
1
1
  import { homedir } from 'node:os';
2
- import { i18n } from './index6.mjs';
2
+ import { i18n } from './index5.mjs';
3
3
  import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:process';
@@ -1,9 +1,86 @@
1
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import cron from 'node-cron';
1
4
  import initSqlJs from 'sql.js';
2
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
- import { homedir } from 'os';
4
- import { existsSync as existsSync$1, mkdirSync } from 'fs';
5
5
  import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
6
- import cron from 'node-cron';
6
+
7
+ class DecayScheduler {
8
+ memoryTree;
9
+ task = null;
10
+ archiveThreshold;
11
+ constructor(memoryTree, archiveThreshold = 0.3) {
12
+ this.memoryTree = memoryTree;
13
+ this.archiveThreshold = archiveThreshold;
14
+ }
15
+ /**
16
+ * Start scheduled decay (user must explicitly call this)
17
+ */
18
+ start(schedule = "0 2 * * *") {
19
+ if (this.task) {
20
+ console.warn("[CCJK Context] Decay scheduler already running");
21
+ return;
22
+ }
23
+ if (!cron.validate(schedule)) {
24
+ throw new Error(`Invalid cron expression: ${schedule}`);
25
+ }
26
+ console.log(`[CCJK Context] Starting decay scheduler: ${schedule}`);
27
+ console.log("[CCJK Context] This will run in the background. Use .stop() to disable.");
28
+ this.task = cron.schedule(schedule, async () => {
29
+ console.log("[CCJK Context] Running scheduled decay...");
30
+ try {
31
+ const result = await this.runDecay();
32
+ console.log(`[CCJK Context] Decayed ${result.decayed} nodes, archived ${result.archived} nodes`);
33
+ } catch (err) {
34
+ console.error("[CCJK Context] Decay error:", err);
35
+ }
36
+ });
37
+ }
38
+ /**
39
+ * Stop scheduled decay
40
+ */
41
+ stop() {
42
+ if (this.task) {
43
+ this.task.stop();
44
+ this.task = null;
45
+ console.log("[CCJK Context] Decay scheduler stopped");
46
+ }
47
+ }
48
+ /**
49
+ * Check if scheduler is running
50
+ */
51
+ isRunning() {
52
+ return this.task !== null;
53
+ }
54
+ /**
55
+ * Run decay manually
56
+ */
57
+ async runNow() {
58
+ return this.runDecay();
59
+ }
60
+ /**
61
+ * Preview what would be decayed (dry run)
62
+ */
63
+ async preview() {
64
+ const stats = await this.memoryTree.getStats();
65
+ return {
66
+ wouldDecay: stats.totalNodes - (stats.byPriority.P0 || 0) || 0,
67
+ wouldArchive: stats.brownLeaves,
68
+ stats
69
+ };
70
+ }
71
+ /**
72
+ * Internal decay execution
73
+ */
74
+ async runDecay() {
75
+ const decayed = await this.memoryTree.applyDecay();
76
+ const archived = await this.memoryTree.archiveLowConfidence(this.archiveThreshold);
77
+ return {
78
+ decayed,
79
+ archived,
80
+ details: { threshold: this.archiveThreshold }
81
+ };
82
+ }
83
+ }
7
84
 
8
85
  let SQL = null;
9
86
  async function initSQL() {
@@ -46,7 +123,7 @@ class MemoryTree {
46
123
  }
47
124
  ensureDbDirectory() {
48
125
  const dir = this.dbPath.substring(0, this.dbPath.lastIndexOf("/"));
49
- if (!existsSync$1(dir)) {
126
+ if (!existsSync(dir)) {
50
127
  mkdirSync(dir, { recursive: true });
51
128
  }
52
129
  }
@@ -84,7 +161,8 @@ class MemoryTree {
84
161
  async getNode(id) {
85
162
  await this.init();
86
163
  const results = this.db.exec(`SELECT * FROM memory_nodes WHERE id = ?`, [id]);
87
- if (!results.length || !results[0].values.length) return null;
164
+ if (!results.length || !results[0].values.length)
165
+ return null;
88
166
  const row = results[0].values[0];
89
167
  return this.rowToNode(results[0].columns, row);
90
168
  }
@@ -108,7 +186,8 @@ class MemoryTree {
108
186
  LIMIT ?
109
187
  `;
110
188
  const results = this.db.exec(sql, [pattern, pattern, pattern, pattern, minConfidence, ...priorities, limit]);
111
- if (!results.length || !results[0].values.length) return [];
189
+ if (!results.length || !results[0].values.length)
190
+ return [];
112
191
  return results[0].values.map((row) => {
113
192
  const node = this.rowToNode(results[0].columns, row);
114
193
  return { ...node, score: row[results[0].columns.indexOf("score")] };
@@ -217,7 +296,8 @@ class MemoryTree {
217
296
  params.push(limit);
218
297
  }
219
298
  const results = this.db.exec(sql, params);
220
- if (!results.length || !results[0].values.length) return [];
299
+ if (!results.length || !results[0].values.length)
300
+ return [];
221
301
  return results[0].values.map((row) => this.rowToNode(results[0].columns, row));
222
302
  }
223
303
  async deleteNode(id) {
@@ -263,84 +343,6 @@ class MemoryTree {
263
343
  }
264
344
  }
265
345
 
266
- class DecayScheduler {
267
- memoryTree;
268
- task = null;
269
- archiveThreshold;
270
- constructor(memoryTree, archiveThreshold = 0.3) {
271
- this.memoryTree = memoryTree;
272
- this.archiveThreshold = archiveThreshold;
273
- }
274
- /**
275
- * Start scheduled decay (user must explicitly call this)
276
- */
277
- start(schedule = "0 2 * * *") {
278
- if (this.task) {
279
- console.warn("[CCJK Context] Decay scheduler already running");
280
- return;
281
- }
282
- if (!cron.validate(schedule)) {
283
- throw new Error(`Invalid cron expression: ${schedule}`);
284
- }
285
- console.log(`[CCJK Context] Starting decay scheduler: ${schedule}`);
286
- console.log("[CCJK Context] This will run in the background. Use .stop() to disable.");
287
- this.task = cron.schedule(schedule, async () => {
288
- console.log("[CCJK Context] Running scheduled decay...");
289
- try {
290
- const result = await this.runDecay();
291
- console.log(`[CCJK Context] Decayed ${result.decayed} nodes, archived ${result.archived} nodes`);
292
- } catch (err) {
293
- console.error("[CCJK Context] Decay error:", err);
294
- }
295
- });
296
- }
297
- /**
298
- * Stop scheduled decay
299
- */
300
- stop() {
301
- if (this.task) {
302
- this.task.stop();
303
- this.task = null;
304
- console.log("[CCJK Context] Decay scheduler stopped");
305
- }
306
- }
307
- /**
308
- * Check if scheduler is running
309
- */
310
- isRunning() {
311
- return this.task !== null;
312
- }
313
- /**
314
- * Run decay manually
315
- */
316
- async runNow() {
317
- return this.runDecay();
318
- }
319
- /**
320
- * Preview what would be decayed (dry run)
321
- */
322
- async preview() {
323
- const stats = this.memoryTree.getStats();
324
- return {
325
- wouldDecay: stats.totalNodes - stats.byPriority["P0"] || 0,
326
- wouldArchive: stats.brownLeaves,
327
- stats
328
- };
329
- }
330
- /**
331
- * Internal decay execution
332
- */
333
- async runDecay() {
334
- const decayResult = this.memoryTree.decay();
335
- const archived = this.memoryTree.archiveLowConfidence(this.archiveThreshold);
336
- return {
337
- decayed: decayResult.decayed,
338
- archived,
339
- details: decayResult.details
340
- };
341
- }
342
- }
343
-
344
346
  async function contextOptStats() {
345
347
  if (process.env.CCJK_MEMORY_TREE !== "true") {
346
348
  console.error("\u274C Memory tree not enabled. Set CCJK_MEMORY_TREE=true");
@@ -360,9 +362,9 @@ async function contextOptStats() {
360
362
  console.log(` \u26AB Archived (<0.3): ${stats.archived}
361
363
  `);
362
364
  console.log("By Priority:");
363
- console.log(` P0 (Critical): ${stats.byPriority["P0"] || 0}`);
364
- console.log(` P1 (Important): ${stats.byPriority["P1"] || 0}`);
365
- console.log(` P2 (Routine): ${stats.byPriority["P2"] || 0}`);
365
+ console.log(` P0 (Critical): ${stats.byPriority.P0 || 0}`);
366
+ console.log(` P1 (Important): ${stats.byPriority.P1 || 0}`);
367
+ console.log(` P2 (Routine): ${stats.byPriority.P2 || 0}`);
366
368
  tree.close();
367
369
  } catch (err) {
368
370
  console.error("\u274C Failed to get stats:", err);
@@ -433,7 +435,7 @@ async function contextOptConfig() {
433
435
  `);
434
436
  const ccjkDir = process.env.ZCF_CONFIG_DIR || join(homedir(), ".ccjk");
435
437
  const dbPath = join(ccjkDir, "memory.db");
436
- const dbExists = existsSync$1(dbPath);
438
+ const dbExists = existsSync(dbPath);
437
439
  console.log(`Memory DB: ${dbPath}`);
438
440
  console.log(`DB Exists: ${dbExists ? "\u2705" : "\u274C"}
439
441
  `);