ccjk 4.0.0-beta.1 → 4.0.0-beta.3

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.
@@ -1,7 +1,7 @@
1
1
  import { execSync } from 'node:child_process';
2
2
  import * as path from 'node:path';
3
3
  import * as process from 'node:process';
4
- import * as fs from 'node:fs';
4
+ import * as nodeFs from 'node:fs';
5
5
 
6
6
  function getFixCommits(options) {
7
7
  const { since, until, limit = 100, cwd = process.cwd() } = options;
@@ -618,8 +618,8 @@ class PostmortemManager {
618
618
  path.join(this.postmortemDir, "summaries")
619
619
  ];
620
620
  for (const dir of dirs) {
621
- if (!fs.existsSync(dir)) {
622
- fs.mkdirSync(dir, { recursive: true });
621
+ if (!nodeFs.existsSync(dir)) {
622
+ nodeFs.mkdirSync(dir, { recursive: true });
623
623
  }
624
624
  }
625
625
  }
@@ -633,9 +633,9 @@ class PostmortemManager {
633
633
  const filename = `${report.id}-${this.slugify(report.title)}.md`;
634
634
  const filepath = path.join(this.postmortemDir, filename);
635
635
  const content = this.renderReportToMarkdown(report);
636
- fs.writeFileSync(filepath, content, "utf-8");
636
+ nodeFs.writeFileSync(filepath, content, "utf-8");
637
637
  const jsonPath = path.join(this.postmortemDir, `${report.id}.json`);
638
- fs.writeFileSync(jsonPath, JSON.stringify(report, null, 2), "utf-8");
638
+ nodeFs.writeFileSync(jsonPath, JSON.stringify(report, null, 2), "utf-8");
639
639
  return filepath;
640
640
  }
641
641
  /**
@@ -643,11 +643,11 @@ class PostmortemManager {
643
643
  */
644
644
  getReport(id) {
645
645
  const jsonPath = path.join(this.postmortemDir, `${id}.json`);
646
- if (!fs.existsSync(jsonPath)) {
646
+ if (!nodeFs.existsSync(jsonPath)) {
647
647
  return null;
648
648
  }
649
649
  try {
650
- const content = fs.readFileSync(jsonPath, "utf-8");
650
+ const content = nodeFs.readFileSync(jsonPath, "utf-8");
651
651
  return JSON.parse(content);
652
652
  } catch {
653
653
  return null;
@@ -779,11 +779,11 @@ ${report.tags.map((t) => `\`${t}\``).join(" ")}
779
779
  */
780
780
  loadIndex() {
781
781
  const indexPath = path.join(this.postmortemDir, INDEX_FILE);
782
- if (!fs.existsSync(indexPath)) {
782
+ if (!nodeFs.existsSync(indexPath)) {
783
783
  return null;
784
784
  }
785
785
  try {
786
- const content = fs.readFileSync(indexPath, "utf-8");
786
+ const content = nodeFs.readFileSync(indexPath, "utf-8");
787
787
  return JSON.parse(content);
788
788
  } catch {
789
789
  return null;
@@ -794,17 +794,17 @@ ${report.tags.map((t) => `\`${t}\``).join(" ")}
794
794
  */
795
795
  saveIndex(index) {
796
796
  const indexPath = path.join(this.postmortemDir, INDEX_FILE);
797
- fs.writeFileSync(indexPath, JSON.stringify(index, null, 2), "utf-8");
797
+ nodeFs.writeFileSync(indexPath, JSON.stringify(index, null, 2), "utf-8");
798
798
  }
799
799
  /**
800
800
  * 更新索引
801
801
  */
802
802
  updateIndex() {
803
803
  const index = this.createEmptyIndex();
804
- const files = fs.readdirSync(this.postmortemDir).filter((f) => f.startsWith("PM-") && f.endsWith(".json"));
804
+ const files = nodeFs.readdirSync(this.postmortemDir).filter((f) => f.startsWith("PM-") && f.endsWith(".json"));
805
805
  for (const file of files) {
806
806
  try {
807
- const content = fs.readFileSync(path.join(this.postmortemDir, file), "utf-8");
807
+ const content = nodeFs.readFileSync(path.join(this.postmortemDir, file), "utf-8");
808
808
  const report = JSON.parse(content);
809
809
  index.stats.total++;
810
810
  index.stats.bySeverity[report.severity]++;
@@ -843,8 +843,8 @@ ${report.tags.map((t) => `\`${t}\``).join(" ")}
843
843
  const claudeMdPath = path.join(this.projectRoot, "CLAUDE.md");
844
844
  const injection = this.generateClaudeMdInjection();
845
845
  let content = "";
846
- if (fs.existsSync(claudeMdPath)) {
847
- content = fs.readFileSync(claudeMdPath, "utf-8");
846
+ if (nodeFs.existsSync(claudeMdPath)) {
847
+ content = nodeFs.readFileSync(claudeMdPath, "utf-8");
848
848
  }
849
849
  const startIndex = content.indexOf(CLAUDE_MD_SECTION_START);
850
850
  const endIndex = content.indexOf(CLAUDE_MD_SECTION_END);
@@ -860,7 +860,7 @@ ${CLAUDE_MD_SECTION_END}
860
860
 
861
861
  ${injectionContent.trim()}
862
862
  `;
863
- fs.writeFileSync(claudeMdPath, content, "utf-8");
863
+ nodeFs.writeFileSync(claudeMdPath, content, "utf-8");
864
864
  return {
865
865
  synced: injection.sourcePostmortems.length,
866
866
  claudeMdPath
@@ -983,9 +983,9 @@ ${injectionContent.trim()}
983
983
  }
984
984
  for (const file of filesToCheck) {
985
985
  const fullPath = path.isAbsolute(file) ? file : path.join(this.projectRoot, file);
986
- if (!fs.existsSync(fullPath))
986
+ if (!nodeFs.existsSync(fullPath))
987
987
  continue;
988
- const content = fs.readFileSync(fullPath, "utf-8");
988
+ const content = nodeFs.readFileSync(fullPath, "utf-8");
989
989
  const lines = content.split("\n");
990
990
  for (const { pattern, postmortemId } of patterns) {
991
991
  if (!pattern.fileTypes.some((ft) => file.endsWith(ft))) {
@@ -1048,7 +1048,7 @@ ${injectionContent.trim()}
1048
1048
  getAllSourceFiles() {
1049
1049
  const files = [];
1050
1050
  const walk = (dir) => {
1051
- const entries = fs.readdirSync(dir, { withFileTypes: true });
1051
+ const entries = nodeFs.readdirSync(dir, { withFileTypes: true });
1052
1052
  for (const entry of entries) {
1053
1053
  const fullPath = path.join(dir, entry.name);
1054
1054
  const relativePath = path.relative(this.projectRoot, fullPath);
@@ -1121,7 +1121,7 @@ ${injectionContent.trim()}
1121
1121
  keyLessons: this.extractKeyLessons(newReports)
1122
1122
  };
1123
1123
  const summaryPath = path.join(this.postmortemDir, "summaries", `${version}.json`);
1124
- fs.writeFileSync(summaryPath, JSON.stringify(summary, null, 2), "utf-8");
1124
+ nodeFs.writeFileSync(summaryPath, JSON.stringify(summary, null, 2), "utf-8");
1125
1125
  if (this.config.autoSyncToClaudeMd) {
1126
1126
  await this.syncToClaudeMd();
1127
1127
  }
@@ -1,30 +1,30 @@
1
1
  import './init.mjs';
2
- import { CCJK_PLUGINS_DIR, CCJK_GROUPS_DIR, AIDER_DIR, AIDER_CONFIG_FILE, AIDER_ENV_FILE, CODEX_AUTH_FILE, CODEX_DIR, CODEX_CONFIG_FILE, CODEX_AGENTS_FILE, CODEX_PROMPTS_DIR, CONTINUE_DIR, CONTINUE_CONFIG_FILE, CURSOR_CONFIG_FILE, CLINE_CONFIG_FILE, CLAUDE_DIR, CURSOR_DIR, CLINE_DIR, CODE_TOOL_TYPES, CODE_TOOL_INFO } from './constants.mjs';
3
- import { existsSync, readFileSync, writeFileSync, readdirSync, mkdirSync } from 'node:fs';
4
- import process__default, { env } from 'node:process';
5
- import { join as join$1 } from 'pathe';
6
- import { version } from './package.mjs';
7
- import { i18n, ensureI18nInitialized } from './index2.mjs';
8
- import { writeFileAtomic } from './fs-operations.mjs';
2
+ import { CCJK_GROUPS_DIR, AIDER_DIR, AIDER_CONFIG_FILE, AIDER_ENV_FILE, CODEX_AUTH_FILE, CODEX_DIR, CODEX_CONFIG_FILE, CODEX_AGENTS_FILE, CODEX_PROMPTS_DIR, CONTINUE_DIR, CONTINUE_CONFIG_FILE, CURSOR_CONFIG_FILE, CLINE_CONFIG_FILE, CLAUDE_DIR, CURSOR_DIR, CLINE_DIR, CODE_TOOL_TYPES, CODE_TOOL_INFO } from './constants.mjs';
9
3
  import { S as STATUS, r as renderProgressBar, s as sectionDivider, t as theme } from '../shared/ccjk.Zwx-YR_P.mjs';
10
4
  import './config.mjs';
11
5
  import { detectAllConfigs } from './config-consolidator.mjs';
12
6
  import '../shared/ccjk.BjUZt6kx.mjs';
13
7
  import { homedir } from 'node:os';
8
+ import process__default from 'node:process';
14
9
  import ansis from 'ansis';
15
10
  import ora from 'ora';
16
11
  import { exec } from 'tinyexec';
12
+ import { version } from './package.mjs';
17
13
  import { getCurrentTemplateId } from './permission-manager.mjs';
18
14
  import { checkClaudeCodeVersion, checkCcjkVersion } from './upgrade-manager.mjs';
19
15
  import './onboarding.mjs';
20
16
  import './platform.mjs';
17
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
21
18
  import { join } from 'node:path';
22
19
  import '../shared/ccjk.BlPCiSHj.mjs';
23
20
  import { EventEmitter } from 'node:events';
24
21
  import '../shared/ccjk.CGzQzzn_.mjs';
22
+ import { join as join$1 } from 'pathe';
23
+ import { writeFileAtomic } from './fs-operations.mjs';
25
24
  import '../shared/ccjk.CcGtObYC.mjs';
26
25
  import { r as readCodexConfig, n as backupCodexComplete, w as writeCodexConfig, o as writeAuthFile, p as detectConfigManagementMode } from './codex.mjs';
27
26
  import inquirer from 'inquirer';
27
+ import { ensureI18nInitialized, i18n } from './index2.mjs';
28
28
  import { readJsonConfig } from './json-config.mjs';
29
29
  import { a as addNumbersToChoices, p as promptBoolean } from '../shared/ccjk.DhBeLRzf.mjs';
30
30
  import { pathExists } from 'fs-extra';
@@ -1579,235 +1579,6 @@ const ZeroConfig = {
1579
1579
  getBrowserToolGuide
1580
1580
  };
1581
1581
 
1582
- const loadedPlugins = /* @__PURE__ */ new Map();
1583
- const PLUGIN_CONFIG_FILE = join$1(CCJK_PLUGINS_DIR, "plugins.json");
1584
- function ensurePluginsDir() {
1585
- if (!existsSync(CCJK_PLUGINS_DIR)) {
1586
- mkdirSync(CCJK_PLUGINS_DIR, { recursive: true });
1587
- }
1588
- }
1589
- function createLogger(pluginName) {
1590
- const prefix = `[${pluginName}]`;
1591
- return {
1592
- info: (msg) => console.log(`${prefix} ${msg}`),
1593
- warn: (msg) => console.warn(`${prefix} ${msg}`),
1594
- error: (msg) => console.error(`${prefix} ${msg}`),
1595
- debug: (msg) => {
1596
- if (env.DEBUG)
1597
- console.log(`${prefix} [DEBUG] ${msg}`);
1598
- }
1599
- };
1600
- }
1601
- function createStorage(pluginName) {
1602
- const storageFile = join$1(CCJK_PLUGINS_DIR, pluginName, "storage.json");
1603
- let data = {};
1604
- if (existsSync(storageFile)) {
1605
- try {
1606
- data = JSON.parse(readFileSync(storageFile, "utf-8"));
1607
- } catch {
1608
- data = {};
1609
- }
1610
- }
1611
- const save = () => {
1612
- const dir = join$1(CCJK_PLUGINS_DIR, pluginName);
1613
- if (!existsSync(dir)) {
1614
- mkdirSync(dir, { recursive: true });
1615
- }
1616
- writeFileAtomic(storageFile, JSON.stringify(data, null, 2));
1617
- };
1618
- return {
1619
- get: (key) => data[key],
1620
- set: (key, value) => {
1621
- data[key] = value;
1622
- save();
1623
- },
1624
- delete: (key) => {
1625
- delete data[key];
1626
- save();
1627
- },
1628
- clear: () => {
1629
- data = {};
1630
- save();
1631
- }
1632
- };
1633
- }
1634
- function createContext(pluginName) {
1635
- return {
1636
- ccjkVersion: version,
1637
- configDir: join$1(CCJK_PLUGINS_DIR, pluginName),
1638
- i18n,
1639
- logger: createLogger(pluginName),
1640
- storage: createStorage(pluginName)
1641
- };
1642
- }
1643
- function readPluginConfig() {
1644
- ensurePluginsDir();
1645
- if (existsSync(PLUGIN_CONFIG_FILE)) {
1646
- try {
1647
- return JSON.parse(readFileSync(PLUGIN_CONFIG_FILE, "utf-8"));
1648
- } catch {
1649
- }
1650
- }
1651
- return {
1652
- enabled: [],
1653
- disabled: [],
1654
- settings: {}
1655
- };
1656
- }
1657
- function writePluginConfig(config) {
1658
- ensurePluginsDir();
1659
- writeFileAtomic(PLUGIN_CONFIG_FILE, JSON.stringify(config, null, 2));
1660
- }
1661
- async function discoverPlugins() {
1662
- ensurePluginsDir();
1663
- const results = [];
1664
- const dirs = readdirSync(CCJK_PLUGINS_DIR, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
1665
- for (const dir of dirs) {
1666
- const pluginPath = join$1(CCJK_PLUGINS_DIR, dir);
1667
- const packagePath = join$1(pluginPath, "package.json");
1668
- if (!existsSync(packagePath)) {
1669
- results.push({
1670
- name: dir,
1671
- path: pluginPath,
1672
- metadata: { name: dir, version: "0.0.0", description: "" },
1673
- valid: false,
1674
- error: "Missing package.json"
1675
- });
1676
- continue;
1677
- }
1678
- try {
1679
- const pkg = JSON.parse(readFileSync(packagePath, "utf-8"));
1680
- results.push({
1681
- name: pkg.name || dir,
1682
- path: pluginPath,
1683
- metadata: {
1684
- name: pkg.name || dir,
1685
- version: pkg.version || "0.0.0",
1686
- description: pkg.description || "",
1687
- author: pkg.author,
1688
- license: pkg.license,
1689
- keywords: pkg.keywords
1690
- },
1691
- valid: true
1692
- });
1693
- } catch (error) {
1694
- results.push({
1695
- name: dir,
1696
- path: pluginPath,
1697
- metadata: { name: dir, version: "0.0.0", description: "" },
1698
- valid: false,
1699
- error: error instanceof Error ? error.message : "Invalid package.json"
1700
- });
1701
- }
1702
- }
1703
- return results;
1704
- }
1705
- async function loadPlugin(pathOrName) {
1706
- const isPath = pathOrName.includes("/") || pathOrName.includes("\\");
1707
- const pluginPath = isPath ? pathOrName : join$1(CCJK_PLUGINS_DIR, pathOrName);
1708
- if (!existsSync(pluginPath)) {
1709
- console.error(`Plugin not found: ${pluginPath}`);
1710
- return null;
1711
- }
1712
- try {
1713
- const indexPath = join$1(pluginPath, "index.js");
1714
- const tsIndexPath = join$1(pluginPath, "index.ts");
1715
- let plugin;
1716
- let loadedModule;
1717
- if (existsSync(indexPath)) {
1718
- loadedModule = await import(indexPath);
1719
- plugin = loadedModule.default || loadedModule;
1720
- } else if (existsSync(tsIndexPath)) {
1721
- loadedModule = await import(tsIndexPath);
1722
- plugin = loadedModule.default || loadedModule;
1723
- } else {
1724
- const pkg = JSON.parse(readFileSync(join$1(pluginPath, "package.json"), "utf-8"));
1725
- if (pkg.main) {
1726
- const mainPath = join$1(pluginPath, pkg.main);
1727
- loadedModule = await import(mainPath);
1728
- plugin = loadedModule.default || loadedModule;
1729
- } else {
1730
- throw new Error("No entry point found");
1731
- }
1732
- }
1733
- const context = createContext(plugin.metadata.name);
1734
- if (plugin.onLoad) {
1735
- await plugin.onLoad(context);
1736
- }
1737
- const loaded = {
1738
- plugin,
1739
- path: pluginPath,
1740
- enabled: true,
1741
- loadedAt: /* @__PURE__ */ new Date()
1742
- };
1743
- loadedPlugins.set(plugin.metadata.name, loaded);
1744
- return loaded;
1745
- } catch (error) {
1746
- console.error(`Failed to load plugin: ${pathOrName}`, error);
1747
- return null;
1748
- }
1749
- }
1750
- async function unloadPlugin(name) {
1751
- const loaded = loadedPlugins.get(name);
1752
- if (!loaded)
1753
- return false;
1754
- try {
1755
- if (loaded.plugin.onUnload) {
1756
- await loaded.plugin.onUnload();
1757
- }
1758
- loadedPlugins.delete(name);
1759
- return true;
1760
- } catch (error) {
1761
- console.error(`Failed to unload plugin: ${name}`, error);
1762
- return false;
1763
- }
1764
- }
1765
- function getLoadedPlugins() {
1766
- return Array.from(loadedPlugins.values());
1767
- }
1768
- async function listPlugins() {
1769
- const discovered = await discoverPlugins();
1770
- const config = readPluginConfig();
1771
- return discovered.map((d) => {
1772
- const loaded = loadedPlugins.get(d.name);
1773
- return {
1774
- name: d.name,
1775
- version: d.metadata.version,
1776
- description: d.metadata.description,
1777
- enabled: loaded?.enabled ?? !config.disabled.includes(d.name),
1778
- path: d.path,
1779
- author: d.metadata.author
1780
- };
1781
- });
1782
- }
1783
- async function enablePlugin(name) {
1784
- const config = readPluginConfig();
1785
- config.disabled = config.disabled.filter((n) => n !== name);
1786
- if (!config.enabled.includes(name)) {
1787
- config.enabled.push(name);
1788
- }
1789
- writePluginConfig(config);
1790
- if (!loadedPlugins.has(name)) {
1791
- await loadPlugin(name);
1792
- } else {
1793
- const loaded = loadedPlugins.get(name);
1794
- loaded.enabled = true;
1795
- }
1796
- return true;
1797
- }
1798
- async function disablePlugin(name) {
1799
- const config = readPluginConfig();
1800
- config.enabled = config.enabled.filter((n) => n !== name);
1801
- if (!config.disabled.includes(name)) {
1802
- config.disabled.push(name);
1803
- }
1804
- writePluginConfig(config);
1805
- if (loadedPlugins.has(name)) {
1806
- await unloadPlugin(name);
1807
- }
1808
- return true;
1809
- }
1810
-
1811
1582
  const PREDEFINED_GROUPS = [
1812
1583
  // TypeScript Development Group
1813
1584
  {
@@ -5556,4 +5327,4 @@ async function executeWorkflowTemplate(templateId, input, options) {
5556
5327
  return getGlobalExecutor().executeTemplate(templateId, input, options);
5557
5328
  }
5558
5329
 
5559
- export { importGroups as $, AgentOrchestrator as A, PluginValidationError as B, PluginExecutionError as C, PluginManager as D, createPlugin as E, detectTechStack as F, detectAvailableTools as G, HookExecutor as H, detectEnvironment as I, generateRecommendations$1 as J, createZeroConfigContext as K, autoInstallTool as L, MCPOptimizer as M, selectBrowserTool as N, getBrowserToolGuide as O, PluginHookType as P, addGroup as Q, disableGroup as R, enableGroup as S, ensureGroupsDir as T, exportGroups as U, getAllGroups as V, getEnabledAgents as W, getEnabledSkillIds as X, getGroup as Y, ZeroConfig as Z, getRegistry as _, loadPlugin as a, getWorkflowTemplatesByCategory as a$, isGroupEnabled as a0, refreshRegistry as a1, removeGroup as a2, searchGroups as a3, isAiderInstalled as a4, getAiderVersion as a5, installAider as a6, ensureAiderDir as a7, readAiderConfig as a8, writeAiderConfig as a9, getAllToolsStatus as aA, getInstalledTools as aB, installTool as aC, getToolInfo as aD, getAllToolsInfo as aE, getToolsByCategory as aF, formatToolStatus as aG, getRecommendedTools as aH, runHealthCheck as aI, displayHealthReport as aJ, runDoctor as aK, MenuBuilder as aL, showQuickMenu as aM, confirm as aN, showStatus as aO, createExecutor as aP, executeWorkflow as aQ, executeWorkflowTemplate as aR, getGlobalExecutor as aS, WorkflowExecutor as aT, bugFixTemplate as aU, codeReviewTemplate as aV, documentationTemplate as aW, featureDevelopmentTemplate as aX, getAllWorkflowTemplates as aY, getWorkflowTemplate as aZ, getWorkflowTemplateIds as a_, configureAiderApi as aa, getAiderModelPresets as ab, runAider as ac, configureIncrementalManagement as ad, addProviderToExisting as ae, editExistingProvider as af, deleteProviders as ag, validateProviderData as ah, CodexUninstaller as ai, ensureContinueDir as aj, isContinueConfigured as ak, readContinueConfig as al, writeContinueConfig as am, addContinueModel as an, removeContinueModel as ao, getContinueProviderPresets as ap, configureContinueApi as aq, addContinueMcpServer as ar, addContinueCustomCommand as as, enableContinueContextProvider as at, syncSkillsToContinue as au, getToolConfigPath as av, getToolDir as aw, isToolInstalled as ax, getToolVersion as ay, getToolStatus as az, createParallelWorkflow as b, refactoringTemplate as b0, searchWorkflowTemplates as b1, workflowTemplates as b2, codexProviderManager as b3, codexConfigSwitch$1 as b4, codexUninstaller as b5, createOrchestrator as c, disablePlugin as d, enablePlugin as e, createPipelineWorkflow as f, getLoadedPlugins as g, createSequentialWorkflow as h, profilingHook as i, analyticsHook as j, cleanupHook as k, listPlugins as l, errorLoggingHook as m, HookUtils as n, builtInHooks as o, pluginManager as p, executeHook as q, registerBuiltInHooks as r, executeHookWithRetry as s, getMCPConfigPaths as t, unloadPlugin as u, findMCPConfig as v, analyzeMCPConfig as w, generateOptimizationReport as x, applyOptimization as y, runMCPOptimizer as z };
5330
+ export { getAiderVersion as $, AgentOrchestrator as A, detectEnvironment as B, generateRecommendations$1 as C, createZeroConfigContext as D, autoInstallTool as E, selectBrowserTool as F, getBrowserToolGuide as G, HookExecutor as H, addGroup as I, disableGroup as J, enableGroup as K, ensureGroupsDir as L, MCPOptimizer as M, exportGroups as N, getAllGroups as O, PluginHookType as P, getEnabledAgents as Q, getEnabledSkillIds as R, getGroup as S, getRegistry as T, importGroups as U, isGroupEnabled as V, refreshRegistry as W, removeGroup as X, searchGroups as Y, ZeroConfig as Z, isAiderInstalled as _, createParallelWorkflow as a, codexUninstaller as a$, installAider as a0, ensureAiderDir as a1, readAiderConfig as a2, writeAiderConfig as a3, configureAiderApi as a4, getAiderModelPresets as a5, runAider as a6, configureIncrementalManagement as a7, addProviderToExisting as a8, editExistingProvider as a9, formatToolStatus as aA, getRecommendedTools as aB, runHealthCheck as aC, displayHealthReport as aD, runDoctor as aE, MenuBuilder as aF, showQuickMenu as aG, confirm as aH, showStatus as aI, createExecutor as aJ, executeWorkflow as aK, executeWorkflowTemplate as aL, getGlobalExecutor as aM, WorkflowExecutor as aN, bugFixTemplate as aO, codeReviewTemplate as aP, documentationTemplate as aQ, featureDevelopmentTemplate as aR, getAllWorkflowTemplates as aS, getWorkflowTemplate as aT, getWorkflowTemplateIds as aU, getWorkflowTemplatesByCategory as aV, refactoringTemplate as aW, searchWorkflowTemplates as aX, workflowTemplates as aY, codexProviderManager as aZ, codexConfigSwitch$1 as a_, deleteProviders as aa, validateProviderData as ab, CodexUninstaller as ac, ensureContinueDir as ad, isContinueConfigured as ae, readContinueConfig as af, writeContinueConfig as ag, addContinueModel as ah, removeContinueModel as ai, getContinueProviderPresets as aj, configureContinueApi as ak, addContinueMcpServer as al, addContinueCustomCommand as am, enableContinueContextProvider as an, syncSkillsToContinue as ao, getToolConfigPath as ap, getToolDir as aq, isToolInstalled as ar, getToolVersion as as, getToolStatus as at, getAllToolsStatus as au, getInstalledTools as av, installTool as aw, getToolInfo as ax, getAllToolsInfo as ay, getToolsByCategory as az, createPipelineWorkflow as b, createOrchestrator as c, createSequentialWorkflow as d, profilingHook as e, analyticsHook as f, cleanupHook as g, errorLoggingHook as h, HookUtils as i, builtInHooks as j, executeHook as k, executeHookWithRetry as l, getMCPConfigPaths as m, findMCPConfig as n, analyzeMCPConfig as o, pluginManager as p, generateOptimizationReport as q, registerBuiltInHooks as r, applyOptimization as s, runMCPOptimizer as t, PluginValidationError as u, PluginExecutionError as v, PluginManager as w, createPlugin as x, detectTechStack as y, detectAvailableTools as z };
@@ -1,10 +1,10 @@
1
- import * as fs from 'node:fs';
1
+ import * as nodeFs from 'node:fs';
2
2
  import { existsSync, copyFileSync, mkdirSync } from 'node:fs';
3
3
  import process__default from 'node:process';
4
4
  import ansis from 'ansis';
5
5
  import inquirer from 'inquirer';
6
6
  import { version } from './package.mjs';
7
- import { h as runCodexFullInit, s as selectMcpServices, g as getMcpServices, M as MCP_SERVICE_CONFIGS } from './codex.mjs';
7
+ import { m as runCodexFullInit, s as selectMcpServices, g as getMcpServices, M as MCP_SERVICE_CONFIGS } from './codex.mjs';
8
8
  import { WORKFLOW_CONFIG_BASE } from './workflows.mjs';
9
9
  import { SETTINGS_FILE, DEFAULT_CODE_TOOL_TYPE, CODE_TOOL_BANNERS, API_DEFAULT_URL } from './constants.mjs';
10
10
  import { ensureI18nInitialized, i18n } from './index2.mjs';
@@ -21,7 +21,7 @@ import { p as promptBoolean, a as addNumbersToChoices } from '../shared/ccjk.DhB
21
21
  import { updateCcr, updateClaudeCode } from './auto-updater.mjs';
22
22
  import { wrapCommandWithSudo, isWindows, findCommandPath, getPlatform, getHomebrewCommandPaths, isTermux, getTermuxPrefix, isWSL, getWSLInfo, commandExists, getRecommendedInstallMethods } from './platform.mjs';
23
23
  import { r as resolveCodeType } from '../shared/ccjk.CUdzQluX.mjs';
24
- import { exists } from './fs-operations.mjs';
24
+ import { exists, ensureDir } from './fs-operations.mjs';
25
25
  import { m as modifyApiConfigPartially, b as configureApiCompletely, n as needsMigration, a as migrateSettingsForTokenRetrieval, d as displayMigrationResult, p as promptMigration, s as selectAndInstallWorkflows, c as configureOutputStyle, f as formatApiKeyDisplay } from '../shared/ccjk.DtWIPt8E.mjs';
26
26
  import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.f40us0yY.mjs';
27
27
  import ora from 'ora';
@@ -1217,7 +1217,7 @@ async function createHomebrewSymlink(command, sourcePath) {
1217
1217
  ];
1218
1218
  let targetDir = null;
1219
1219
  for (const binPath of homebrewBinPaths) {
1220
- if (fs.existsSync(binPath)) {
1220
+ if (nodeFs.existsSync(binPath)) {
1221
1221
  targetDir = binPath;
1222
1222
  break;
1223
1223
  }
@@ -1231,16 +1231,16 @@ async function createHomebrewSymlink(command, sourcePath) {
1231
1231
  }
1232
1232
  const symlinkPath = join(targetDir, command);
1233
1233
  try {
1234
- const stats = fs.lstatSync(symlinkPath);
1234
+ const stats = nodeFs.lstatSync(symlinkPath);
1235
1235
  if (stats.isSymbolicLink()) {
1236
- const existingTarget = fs.readlinkSync(symlinkPath);
1236
+ const existingTarget = nodeFs.readlinkSync(symlinkPath);
1237
1237
  if (existingTarget === sourcePath) {
1238
1238
  return {
1239
1239
  success: true,
1240
1240
  symlinkPath
1241
1241
  };
1242
1242
  }
1243
- fs.unlinkSync(symlinkPath);
1243
+ nodeFs.unlinkSync(symlinkPath);
1244
1244
  } else {
1245
1245
  return {
1246
1246
  success: false,
@@ -1258,7 +1258,7 @@ async function createHomebrewSymlink(command, sourcePath) {
1258
1258
  }
1259
1259
  }
1260
1260
  try {
1261
- fs.symlinkSync(sourcePath, symlinkPath);
1261
+ nodeFs.symlinkSync(sourcePath, symlinkPath);
1262
1262
  return {
1263
1263
  success: true,
1264
1264
  symlinkPath
@@ -1334,6 +1334,20 @@ const installer = {
1334
1334
  verifyInstallation: verifyInstallation
1335
1335
  };
1336
1336
 
1337
+ async function ensurePlanDirectories() {
1338
+ const planDirs = [
1339
+ // Project-local plan directories
1340
+ join(process__default.cwd(), ".ccjk", "plan", "current"),
1341
+ join(process__default.cwd(), ".ccjk", "plan", "archive"),
1342
+ // Global plan directories (for cross-project planning)
1343
+ join(homedir(), ".claude", "plan", "current"),
1344
+ join(homedir(), ".claude", "plan", "archive")
1345
+ ];
1346
+ for (const dir of planDirs) {
1347
+ await ensureDir(dir);
1348
+ }
1349
+ }
1350
+
1337
1351
  const execAsync = promisify(exec);
1338
1352
  function getClaudePluginDir() {
1339
1353
  return join(homedir(), ".claude", "plugins");
@@ -2100,6 +2114,7 @@ async function init(options = {}) {
2100
2114
  } else {
2101
2115
  await selectAndInstallWorkflows(configLang);
2102
2116
  }
2117
+ await ensurePlanDirectories();
2103
2118
  } else if (["backup", "merge", "new"].includes(action)) {
2104
2119
  copyConfigFiles(false);
2105
2120
  if (options.skipPrompt) {
@@ -2109,6 +2124,7 @@ async function init(options = {}) {
2109
2124
  } else {
2110
2125
  await selectAndInstallWorkflows(configLang);
2111
2126
  }
2127
+ await ensurePlanDirectories();
2112
2128
  }
2113
2129
  applyAiLanguageDirective(aiOutputLang);
2114
2130
  if (options.skipPrompt) {
@@ -2406,7 +2422,7 @@ async function handleClaudeCodeConfigs(configs) {
2406
2422
  await ClaudeCodeConfigManager.syncCcrProfile();
2407
2423
  }
2408
2424
  async function handleCodexConfigs(configs) {
2409
- const { addProviderToExisting } = await import('./index4.mjs').then(function (n) { return n.b3; });
2425
+ const { addProviderToExisting } = await import('./index4.mjs').then(function (n) { return n.aZ; });
2410
2426
  const addedProviderIds = [];
2411
2427
  for (const config of configs) {
2412
2428
  try {
@@ -7,7 +7,7 @@ import { CODE_TOOL_BANNERS, CLAUDE_DIR, isCodeToolType, DEFAULT_CODE_TOOL_TYPE }
7
7
  import { ensureI18nInitialized, i18n } from './index2.mjs';
8
8
  import { a as displayBannerWithInfo } from '../shared/ccjk.Zwx-YR_P.mjs';
9
9
  import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
10
- import { d as runCodexUpdate, i as runCodexUninstall, j as configureCodexMcp, k as configureCodexApi, m as runCodexWorkflowImportWithLanguageSelection, h as runCodexFullInit } from './codex.mjs';
10
+ import { d as runCodexUpdate, h as runCodexUninstall, i as configureCodexMcp, j as configureCodexApi, k as runCodexWorkflowImportWithLanguageSelection, m as runCodexFullInit } from './codex.mjs';
11
11
  import { r as resolveCodeType } from '../shared/ccjk.CUdzQluX.mjs';
12
12
  import { a as handleExitPromptError, h as handleGeneralError } from '../shared/ccjk.f40us0yY.mjs';
13
13
  import { changeScriptLanguageFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature, configureEnvPermissionFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureMcpFeature, configureApiFeature } from './features.mjs';
@@ -1,8 +1,8 @@
1
1
  import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
3
  import { i18n } from './index2.mjs';
4
- import * as fs from 'node:fs';
5
- import fs__default, { existsSync, readFileSync, mkdirSync, unlinkSync } from 'node:fs';
4
+ import * as nodeFs from 'node:fs';
5
+ import nodeFs__default, { existsSync, readFileSync, mkdirSync, unlinkSync } from 'node:fs';
6
6
  import * as os from 'node:os';
7
7
  import os__default, { homedir } from 'node:os';
8
8
  import { join } from 'pathe';
@@ -588,8 +588,8 @@ else:
588
588
  });
589
589
  } finally {
590
590
  try {
591
- if (fs.existsSync(TEMP_NOTIFICATION_FILE)) {
592
- fs.unlinkSync(TEMP_NOTIFICATION_FILE);
591
+ if (nodeFs.existsSync(TEMP_NOTIFICATION_FILE)) {
592
+ nodeFs.unlinkSync(TEMP_NOTIFICATION_FILE);
593
593
  }
594
594
  } catch {
595
595
  }
@@ -744,10 +744,10 @@ else:
744
744
  }
745
745
  async function loadLocalNotificationConfig() {
746
746
  try {
747
- if (!fs.existsSync(CONFIG_FILE)) {
747
+ if (!nodeFs.existsSync(CONFIG_FILE)) {
748
748
  return { ...DEFAULT_CONFIG };
749
749
  }
750
- const content = fs.readFileSync(CONFIG_FILE, "utf-8");
750
+ const content = nodeFs.readFileSync(CONFIG_FILE, "utf-8");
751
751
  const config = JSON.parse(content);
752
752
  return {
753
753
  ...DEFAULT_CONFIG,
@@ -760,8 +760,8 @@ async function loadLocalNotificationConfig() {
760
760
  }
761
761
  async function saveLocalNotificationConfig(config) {
762
762
  try {
763
- if (!fs.existsSync(CONFIG_DIR)) {
764
- fs.mkdirSync(CONFIG_DIR, { recursive: true });
763
+ if (!nodeFs.existsSync(CONFIG_DIR)) {
764
+ nodeFs.mkdirSync(CONFIG_DIR, { recursive: true });
765
765
  }
766
766
  const existingConfig = await loadLocalNotificationConfig();
767
767
  const newConfig = { ...existingConfig, ...config };
@@ -936,13 +936,13 @@ const CONFIG_FILE_PATH = path__default.join(CCJK_CONFIG_DIR, "config.toml");
936
936
  const SECRETS_FILE_PATH = path__default.join(CCJK_CONFIG_DIR, ".notification-secrets");
937
937
  async function loadNotificationConfig() {
938
938
  try {
939
- if (!fs__default.existsSync(CCJK_CONFIG_DIR)) {
940
- fs__default.mkdirSync(CCJK_CONFIG_DIR, { recursive: true });
939
+ if (!nodeFs__default.existsSync(CCJK_CONFIG_DIR)) {
940
+ nodeFs__default.mkdirSync(CCJK_CONFIG_DIR, { recursive: true });
941
941
  }
942
- if (!fs__default.existsSync(CONFIG_FILE_PATH)) {
942
+ if (!nodeFs__default.existsSync(CONFIG_FILE_PATH)) {
943
943
  return { ...DEFAULT_NOTIFICATION_CONFIG };
944
944
  }
945
- const configContent = fs__default.readFileSync(CONFIG_FILE_PATH, "utf-8");
945
+ const configContent = nodeFs__default.readFileSync(CONFIG_FILE_PATH, "utf-8");
946
946
  const config = parse(configContent);
947
947
  const notificationConfig = config.notification;
948
948
  if (!notificationConfig) {
@@ -978,10 +978,10 @@ async function loadNotificationConfig() {
978
978
  }
979
979
  async function loadDeviceToken() {
980
980
  try {
981
- if (!fs__default.existsSync(SECRETS_FILE_PATH)) {
981
+ if (!nodeFs__default.existsSync(SECRETS_FILE_PATH)) {
982
982
  return null;
983
983
  }
984
- const secretsContent = fs__default.readFileSync(SECRETS_FILE_PATH, "utf-8");
984
+ const secretsContent = nodeFs__default.readFileSync(SECRETS_FILE_PATH, "utf-8");
985
985
  const secrets = JSON.parse(secretsContent);
986
986
  if (!secrets.deviceToken) {
987
987
  return null;
@@ -994,12 +994,12 @@ async function loadDeviceToken() {
994
994
  }
995
995
  async function saveNotificationConfig(config) {
996
996
  try {
997
- if (!fs__default.existsSync(CCJK_CONFIG_DIR)) {
998
- fs__default.mkdirSync(CCJK_CONFIG_DIR, { recursive: true });
997
+ if (!nodeFs__default.existsSync(CCJK_CONFIG_DIR)) {
998
+ nodeFs__default.mkdirSync(CCJK_CONFIG_DIR, { recursive: true });
999
999
  }
1000
1000
  let existingConfig = {};
1001
- if (fs__default.existsSync(CONFIG_FILE_PATH)) {
1002
- const configContent = fs__default.readFileSync(CONFIG_FILE_PATH, "utf-8");
1001
+ if (nodeFs__default.existsSync(CONFIG_FILE_PATH)) {
1002
+ const configContent = nodeFs__default.readFileSync(CONFIG_FILE_PATH, "utf-8");
1003
1003
  existingConfig = parse(configContent);
1004
1004
  }
1005
1005
  const notificationConfig = { ...config };
@@ -1021,8 +1021,8 @@ async function saveDeviceToken(token) {
1021
1021
  try {
1022
1022
  const encryptedToken = encryptToken(token);
1023
1023
  let secrets = {};
1024
- if (fs__default.existsSync(SECRETS_FILE_PATH)) {
1025
- const secretsContent = fs__default.readFileSync(SECRETS_FILE_PATH, "utf-8");
1024
+ if (nodeFs__default.existsSync(SECRETS_FILE_PATH)) {
1025
+ const secretsContent = nodeFs__default.readFileSync(SECRETS_FILE_PATH, "utf-8");
1026
1026
  secrets = JSON.parse(secretsContent);
1027
1027
  }
1028
1028
  secrets.deviceToken = encryptedToken;
@@ -1,4 +1,4 @@
1
- const version = "4.0.0-beta.1";
1
+ const version = "4.0.0-beta.3";
2
2
  const homepage = "https://github.com/miounet11/ccjk";
3
3
 
4
4
  export { homepage, version };