ccjk 9.4.9 → 9.4.11
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.
- package/dist/chunks/agent.mjs +3 -3
- package/dist/chunks/api-config-selector.mjs +152 -0
- package/dist/chunks/ccjk-agents.mjs +11 -5
- package/dist/chunks/ccjk-all.mjs +5 -5
- package/dist/chunks/ccjk-hooks.mjs +6 -6
- package/dist/chunks/ccjk-mcp.mjs +5 -5
- package/dist/chunks/ccjk-setup.mjs +5 -5
- package/dist/chunks/ccjk-skills.mjs +4 -4
- package/dist/chunks/ccr.mjs +5 -4
- package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +4 -4
- package/dist/chunks/cli.mjs +6 -6
- package/dist/chunks/commands2.mjs +2 -2
- package/dist/chunks/config.mjs +17 -1
- package/dist/chunks/doctor.mjs +3 -3
- package/dist/chunks/features.mjs +1 -1
- package/dist/chunks/index6.mjs +134 -129
- package/dist/chunks/init.mjs +19 -18
- package/dist/chunks/installer2.mjs +1 -1
- package/dist/chunks/menu.mjs +10 -122
- package/dist/chunks/onboarding.mjs +1 -1
- package/dist/chunks/package.mjs +7 -7
- package/dist/chunks/permissions.mjs +1 -1
- package/dist/chunks/quick-setup.mjs +2 -2
- package/dist/chunks/skill.mjs +4 -3
- package/dist/chunks/smart-defaults.mjs +60 -10
- package/dist/chunks/startup.mjs +2 -2
- package/dist/chunks/thinking.mjs +9 -9
- package/dist/chunks/uninstall.mjs +1 -1
- package/dist/chunks/update.mjs +1 -1
- package/dist/index.d.mts +3207 -3201
- package/dist/index.d.ts +3207 -3201
- package/dist/index.mjs +6548 -6548
- package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.6uSMSDCL.mjs} +1 -1
- package/dist/shared/{ccjk.BqF4q-Hs.mjs → ccjk.BNwRnWYx.mjs} +7 -7
- package/dist/shared/{ccjk.C4Z5DNIG.mjs → ccjk.CS0ybJCf.mjs} +1 -1
- package/dist/shared/{ccjk.Cg7t5XaL.mjs → ccjk.Drzxa8gd.mjs} +6 -6
- package/dist/shared/{ccjk.pi0nsyn3.mjs → ccjk.h7_W-wTs.mjs} +2 -2
- package/package.json +7 -7
- package/templates/agents/fullstack-developer.json +1 -0
- package/templates/agents/go-expert.json +1 -0
- package/templates/agents/python-expert.json +1 -0
- package/templates/agents/react-specialist.json +1 -0
- package/templates/agents/testing-automation-expert.json +1 -0
- package/templates/agents/typescript-architect.json +1 -0
- package/templates/claude-code/common/settings.json +9 -0
- package/templates/common/workflow/essential/en/agents/init-architect.md +1 -0
- package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +1 -0
package/dist/chunks/agent.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import ansis from 'ansis';
|
|
|
2
2
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'node:fs';
|
|
3
3
|
import { join } from 'pathe';
|
|
4
4
|
import { CCJK_CONFIG_DIR } from './constants.mjs';
|
|
5
|
-
import { w as writeAgentFile } from '../shared/ccjk.
|
|
6
|
-
import { g as getPluginManager } from '../shared/ccjk.
|
|
5
|
+
import { w as writeAgentFile } from '../shared/ccjk.6uSMSDCL.mjs';
|
|
6
|
+
import { g as getPluginManager } from '../shared/ccjk.Drzxa8gd.mjs';
|
|
7
7
|
import { homedir } from 'node:os';
|
|
8
8
|
import './index2.mjs';
|
|
9
9
|
import 'node:process';
|
|
@@ -791,7 +791,7 @@ class AgentCreator {
|
|
|
791
791
|
return templates;
|
|
792
792
|
}
|
|
793
793
|
/**
|
|
794
|
-
* Write agent to Claude Code compatible location (project-local .claude/agents/)
|
|
794
|
+
* Write agent to Claude Code compatible location (project-local .claude-code/agents/)
|
|
795
795
|
*/
|
|
796
796
|
async writeToClaudeCode(agent, options) {
|
|
797
797
|
return writeAgentFile(agent, {
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import ansis from 'ansis';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import { isCodeToolType, DEFAULT_CODE_TOOL_TYPE } from './constants.mjs';
|
|
4
|
+
import { i18n } from './index2.mjs';
|
|
5
|
+
import { readZcfConfig } from './ccjk-config.mjs';
|
|
6
|
+
import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
|
|
7
|
+
import { handleCustomApiMode } from './features.mjs';
|
|
8
|
+
import { configSwitchCommand } from './config-switch.mjs';
|
|
9
|
+
import 'node:os';
|
|
10
|
+
import 'pathe';
|
|
11
|
+
import 'node:fs';
|
|
12
|
+
import 'node:process';
|
|
13
|
+
import 'node:url';
|
|
14
|
+
import 'i18next';
|
|
15
|
+
import 'i18next-fs-backend';
|
|
16
|
+
import 'smol-toml';
|
|
17
|
+
import './fs-operations.mjs';
|
|
18
|
+
import 'node:crypto';
|
|
19
|
+
import 'node:fs/promises';
|
|
20
|
+
import './json-config.mjs';
|
|
21
|
+
import 'dayjs';
|
|
22
|
+
import './config.mjs';
|
|
23
|
+
import './claude-config.mjs';
|
|
24
|
+
import './platform.mjs';
|
|
25
|
+
import 'tinyexec';
|
|
26
|
+
import '../shared/ccjk.CS0ybJCf.mjs';
|
|
27
|
+
import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
28
|
+
import '../shared/ccjk.DHbrGcgg.mjs';
|
|
29
|
+
import 'inquirer-toggle';
|
|
30
|
+
import './simple-config.mjs';
|
|
31
|
+
import './codex.mjs';
|
|
32
|
+
import 'ora';
|
|
33
|
+
import 'semver';
|
|
34
|
+
import './prompts.mjs';
|
|
35
|
+
import './package.mjs';
|
|
36
|
+
import 'node:child_process';
|
|
37
|
+
import '../shared/ccjk.f40us0yY.mjs';
|
|
38
|
+
|
|
39
|
+
function getCurrentCodeTool() {
|
|
40
|
+
const config = readZcfConfig();
|
|
41
|
+
if (config?.codeToolType && isCodeToolType(config.codeToolType)) {
|
|
42
|
+
return config.codeToolType;
|
|
43
|
+
}
|
|
44
|
+
return DEFAULT_CODE_TOOL_TYPE;
|
|
45
|
+
}
|
|
46
|
+
async function showApiConfigMenu(title) {
|
|
47
|
+
const lang = i18n.language;
|
|
48
|
+
const isZh = lang === "zh-CN";
|
|
49
|
+
console.log("");
|
|
50
|
+
console.log(ansis.bold.cyan(title || (isZh ? "\u{1F511} API \u914D\u7F6E\u7BA1\u7406" : "\u{1F511} API Configuration")));
|
|
51
|
+
console.log("");
|
|
52
|
+
const choices = [
|
|
53
|
+
{ name: isZh ? "1. \u4F7F\u7528\u5B98\u65B9\u767B\u5F55\uFF08\u4E0D\u914D\u7F6E API\uFF09" : "1. Use Official Login (No API Config)", value: "official" },
|
|
54
|
+
{ name: isZh ? "2. \u81EA\u5B9A\u4E49 API \u914D\u7F6E" : "2. Custom API Configuration", value: "custom" },
|
|
55
|
+
{ name: isZh ? "3. \u4F7F\u7528 CCR \u4EE3\u7406" : "3. Use CCR Proxy", value: "ccr" },
|
|
56
|
+
{ name: isZh ? "4. \u5207\u6362 API \u914D\u7F6E" : "4. Switch API Configuration", value: "switch" },
|
|
57
|
+
{ name: isZh ? "5. \u67E5\u770B\u5F53\u524D\u914D\u7F6E" : "5. View Current Configuration", value: "view" },
|
|
58
|
+
{ name: isZh ? "6. \u8DF3\u8FC7 API \u914D\u7F6E" : "6. Skip API Configuration", value: "skip" }
|
|
59
|
+
];
|
|
60
|
+
const { choice } = await inquirer.prompt({
|
|
61
|
+
type: "list",
|
|
62
|
+
name: "choice",
|
|
63
|
+
message: isZh ? "\u8BF7\u9009\u62E9 API \u914D\u7F6E\u6A21\u5F0F:" : "Select API configuration mode:",
|
|
64
|
+
choices,
|
|
65
|
+
pageSize: 10
|
|
66
|
+
});
|
|
67
|
+
const codeTool = getCurrentCodeTool();
|
|
68
|
+
switch (choice) {
|
|
69
|
+
case "official":
|
|
70
|
+
return await handleOfficialLogin(codeTool, isZh);
|
|
71
|
+
case "custom":
|
|
72
|
+
return await handleCustomConfig();
|
|
73
|
+
case "ccr":
|
|
74
|
+
return await handleCcrProxy(codeTool, isZh);
|
|
75
|
+
case "switch":
|
|
76
|
+
return await handleConfigSwitch(codeTool);
|
|
77
|
+
case "view":
|
|
78
|
+
return await handleViewConfig(codeTool);
|
|
79
|
+
case "skip":
|
|
80
|
+
return { mode: "skip", success: true, cancelled: false };
|
|
81
|
+
default:
|
|
82
|
+
return { mode: "skip", success: true, cancelled: false };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function handleOfficialLogin(codeTool, isZh) {
|
|
86
|
+
if (codeTool === "claude-code") {
|
|
87
|
+
const result = await ClaudeCodeConfigManager.switchToOfficial();
|
|
88
|
+
if (result.success) {
|
|
89
|
+
console.log("");
|
|
90
|
+
console.log(ansis.green(isZh ? "\u2705 \u5DF2\u5207\u6362\u5230\u5B98\u65B9\u767B\u5F55" : "\u2705 Switched to official login"));
|
|
91
|
+
console.log("");
|
|
92
|
+
return { mode: "official", success: true, cancelled: false };
|
|
93
|
+
} else {
|
|
94
|
+
console.log("");
|
|
95
|
+
console.log(ansis.red(isZh ? `\u274C \u5207\u6362\u5931\u8D25: ${result.error}` : `\u274C Failed to switch: ${result.error}`));
|
|
96
|
+
console.log("");
|
|
97
|
+
return { mode: "official", success: false, cancelled: false };
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
console.log("");
|
|
101
|
+
console.log(ansis.yellow(isZh ? "\u26A0\uFE0F \u5F53\u524D\u4EE3\u7801\u5DE5\u5177\u4E0D\u652F\u6301\u6B64\u529F\u80FD" : "\u26A0\uFE0F Current code tool does not support this feature"));
|
|
102
|
+
console.log("");
|
|
103
|
+
return { mode: "official", success: false, cancelled: false };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function handleCustomConfig(_isZh) {
|
|
107
|
+
try {
|
|
108
|
+
await handleCustomApiMode();
|
|
109
|
+
return { mode: "custom", success: true, cancelled: false };
|
|
110
|
+
} catch {
|
|
111
|
+
return { mode: "custom", success: false, cancelled: false };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function handleCcrProxy(codeTool, isZh) {
|
|
115
|
+
if (codeTool === "claude-code") {
|
|
116
|
+
const result = await ClaudeCodeConfigManager.switchToCcr();
|
|
117
|
+
if (result.success) {
|
|
118
|
+
console.log("");
|
|
119
|
+
console.log(ansis.green(isZh ? "\u2705 \u5DF2\u5207\u6362\u5230 CCR \u4EE3\u7406" : "\u2705 Switched to CCR proxy"));
|
|
120
|
+
console.log("");
|
|
121
|
+
return { mode: "ccr", success: true, cancelled: false };
|
|
122
|
+
} else {
|
|
123
|
+
console.log("");
|
|
124
|
+
console.log(ansis.red(isZh ? `\u274C \u5207\u6362\u5931\u8D25: ${result.error}` : `\u274C Failed to switch: ${result.error}`));
|
|
125
|
+
console.log("");
|
|
126
|
+
return { mode: "ccr", success: false, cancelled: false };
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
console.log("");
|
|
130
|
+
console.log(ansis.yellow(isZh ? "\u26A0\uFE0F \u5F53\u524D\u4EE3\u7801\u5DE5\u5177\u4E0D\u652F\u6301\u6B64\u529F\u80FD" : "\u26A0\uFE0F Current code tool does not support this feature"));
|
|
131
|
+
console.log("");
|
|
132
|
+
return { mode: "ccr", success: false, cancelled: false };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async function handleConfigSwitch(codeTool) {
|
|
136
|
+
try {
|
|
137
|
+
await configSwitchCommand({ codeType: codeTool });
|
|
138
|
+
return { mode: "switch", success: true, cancelled: false };
|
|
139
|
+
} catch {
|
|
140
|
+
return { mode: "switch", success: false, cancelled: false };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async function handleViewConfig(codeTool) {
|
|
144
|
+
try {
|
|
145
|
+
await configSwitchCommand({ codeType: codeTool, list: true });
|
|
146
|
+
return { mode: "view", success: true, cancelled: false };
|
|
147
|
+
} catch {
|
|
148
|
+
return { mode: "view", success: false, cancelled: false };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export { showApiConfigMenu };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import process__default, { cwd } from 'node:process';
|
|
2
2
|
import consola from 'consola';
|
|
3
|
-
import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.
|
|
3
|
+
import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.BNwRnWYx.mjs';
|
|
4
4
|
import { i18n } from './index2.mjs';
|
|
5
5
|
import { existsSync, readFileSync, writeFileSync, readdirSync } from 'node:fs';
|
|
6
6
|
import { join, dirname } from 'pathe';
|
|
7
7
|
import { CLAUDE_AGENTS_DIR } from './constants.mjs';
|
|
8
|
-
import { w as writeAgentFile } from '../shared/ccjk.
|
|
8
|
+
import { w as writeAgentFile } from '../shared/ccjk.6uSMSDCL.mjs';
|
|
9
9
|
import { fileURLToPath } from 'node:url';
|
|
10
10
|
import { e as extractDisplayName, a as extractString } from '../shared/ccjk.AqnXPAzw.mjs';
|
|
11
11
|
import 'tinyglobby';
|
|
@@ -189,7 +189,7 @@ async function ccjkAgents(options = {}) {
|
|
|
189
189
|
if (recommendations.length > 0) {
|
|
190
190
|
consola.success(isZh ? `\u4ECE\u4E91\u7AEF\u83B7\u53D6 ${recommendations.length} \u4E2A\u4E13\u4E1A\u4EE3\u7406` : `Fetched ${recommendations.length} specialist agents from cloud`);
|
|
191
191
|
}
|
|
192
|
-
} catch (
|
|
192
|
+
} catch (_error) {
|
|
193
193
|
consola.warn(isZh ? "\u4E91\u7AEF\u83B7\u53D6\u5931\u8D25\uFF0C\u4F7F\u7528\u672C\u5730\u6A21\u677F" : "Cloud fetch failed, using local templates");
|
|
194
194
|
}
|
|
195
195
|
if (!recommendations || recommendations.length === 0) {
|
|
@@ -341,7 +341,10 @@ async function createAgent(recommendation, options) {
|
|
|
341
341
|
consola.info(`[DRY RUN] ${isZh ? "\u5C06\u521B\u5EFA\u4EE3\u7406" : "Would create agent"}: ${agentName}`);
|
|
342
342
|
return agentName;
|
|
343
343
|
}
|
|
344
|
-
await writeAgentFile(agentDef
|
|
344
|
+
await writeAgentFile(agentDef, {
|
|
345
|
+
projectDir: cwd(),
|
|
346
|
+
global: false
|
|
347
|
+
});
|
|
345
348
|
await registerAgent(agentDef);
|
|
346
349
|
return agentName;
|
|
347
350
|
} catch (error) {
|
|
@@ -391,7 +394,10 @@ async function createCustomAgent(options) {
|
|
|
391
394
|
consola.info(`[DRY RUN] ${isZh ? "\u5C06\u521B\u5EFA\u81EA\u5B9A\u4E49\u4EE3\u7406" : "Would create custom agent"}: ${agentName}`);
|
|
392
395
|
return agentName;
|
|
393
396
|
}
|
|
394
|
-
await writeAgentFile(agentDef
|
|
397
|
+
await writeAgentFile(agentDef, {
|
|
398
|
+
projectDir: cwd(),
|
|
399
|
+
global: false
|
|
400
|
+
});
|
|
395
401
|
await registerAgent(agentDef);
|
|
396
402
|
return agentName;
|
|
397
403
|
} catch (error) {
|
package/dist/chunks/ccjk-all.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
7
7
|
import { ofetch } from 'ofetch';
|
|
8
8
|
import { randomUUID, createHash } from 'node:crypto';
|
|
9
9
|
import { i18n, ensureI18nInitialized } from './index2.mjs';
|
|
10
|
-
import { a as analyzeProject } from '../shared/ccjk.
|
|
10
|
+
import { a as analyzeProject } from '../shared/ccjk.BNwRnWYx.mjs';
|
|
11
11
|
import { ccjkAgents } from './ccjk-agents.mjs';
|
|
12
12
|
import { ccjkHooks } from './ccjk-hooks.mjs';
|
|
13
13
|
import { ccjkMcp } from './ccjk-mcp.mjs';
|
|
@@ -21,7 +21,7 @@ import 'tinyglobby';
|
|
|
21
21
|
import 'smol-toml';
|
|
22
22
|
import './constants.mjs';
|
|
23
23
|
import 'node:os';
|
|
24
|
-
import '../shared/ccjk.
|
|
24
|
+
import '../shared/ccjk.6uSMSDCL.mjs';
|
|
25
25
|
import 'node:perf_hooks';
|
|
26
26
|
import 'inquirer';
|
|
27
27
|
import 'node:child_process';
|
|
@@ -1025,7 +1025,7 @@ class FallbackCloudClient {
|
|
|
1025
1025
|
/**
|
|
1026
1026
|
* Get local fallback template
|
|
1027
1027
|
*/
|
|
1028
|
-
getLocalTemplate(id,
|
|
1028
|
+
getLocalTemplate(id, _language) {
|
|
1029
1029
|
const templates = {
|
|
1030
1030
|
"basic-workflow": {
|
|
1031
1031
|
id: "basic-workflow",
|
|
@@ -1265,7 +1265,7 @@ class CloudSetupOrchestrator {
|
|
|
1265
1265
|
insights: this.extractInsights(response)
|
|
1266
1266
|
};
|
|
1267
1267
|
return recommendations;
|
|
1268
|
-
} catch (
|
|
1268
|
+
} catch (_error) {
|
|
1269
1269
|
this.logger.warn("Failed to get cloud recommendations, using local fallback");
|
|
1270
1270
|
return this.getLocalRecommendations(analysis);
|
|
1271
1271
|
}
|
|
@@ -1421,7 +1421,7 @@ class CloudSetupOrchestrator {
|
|
|
1421
1421
|
/**
|
|
1422
1422
|
* Extract insights from response
|
|
1423
1423
|
*/
|
|
1424
|
-
extractInsights(
|
|
1424
|
+
extractInsights(_response) {
|
|
1425
1425
|
return {
|
|
1426
1426
|
insights: [
|
|
1427
1427
|
i18n.t("cloud-setup:cloudRecommendationsGenerated")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { consola } from 'consola';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
|
-
import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.
|
|
4
|
+
import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.BNwRnWYx.mjs';
|
|
5
5
|
import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
6
6
|
import process__default from 'node:process';
|
|
7
7
|
import { join, dirname } from 'pathe';
|
|
@@ -619,7 +619,7 @@ async function validateHookTrigger(trigger, projectInfo) {
|
|
|
619
619
|
return false;
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
async function validateGitTrigger(pattern, condition,
|
|
622
|
+
async function validateGitTrigger(pattern, condition, _projectInfo) {
|
|
623
623
|
const gitDir = join(process.cwd(), ".git");
|
|
624
624
|
if (!existsSync(gitDir)) {
|
|
625
625
|
throw new Error("Git repository not found");
|
|
@@ -664,7 +664,7 @@ async function validateGitTrigger(pattern, condition, projectInfo) {
|
|
|
664
664
|
}
|
|
665
665
|
return true;
|
|
666
666
|
}
|
|
667
|
-
async function validateFileTrigger(pattern, condition,
|
|
667
|
+
async function validateFileTrigger(pattern, condition, _projectInfo) {
|
|
668
668
|
if (!pattern || pattern.length === 0) {
|
|
669
669
|
throw new Error("File pattern cannot be empty");
|
|
670
670
|
}
|
|
@@ -697,7 +697,7 @@ async function validateFileTrigger(pattern, condition, projectInfo) {
|
|
|
697
697
|
}
|
|
698
698
|
return true;
|
|
699
699
|
}
|
|
700
|
-
async function validateCommandTrigger(pattern, condition,
|
|
700
|
+
async function validateCommandTrigger(pattern, condition, _projectInfo) {
|
|
701
701
|
if (!pattern || pattern.length === 0) {
|
|
702
702
|
throw new Error("Command pattern cannot be empty");
|
|
703
703
|
}
|
|
@@ -740,7 +740,7 @@ async function validateCommandTrigger(pattern, condition, projectInfo) {
|
|
|
740
740
|
}
|
|
741
741
|
return true;
|
|
742
742
|
}
|
|
743
|
-
async function validateScheduleTrigger(pattern,
|
|
743
|
+
async function validateScheduleTrigger(pattern, _condition) {
|
|
744
744
|
const cronParts = pattern.split(" ");
|
|
745
745
|
if (cronParts.length !== 5) {
|
|
746
746
|
throw new Error(`Invalid cron pattern: ${pattern}. Expected 5 parts.`);
|
|
@@ -861,7 +861,7 @@ async function ccjkHooks(options = {}) {
|
|
|
861
861
|
recommendedHooks.push(hookConfig);
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
} catch (
|
|
864
|
+
} catch (_error) {
|
|
865
865
|
consola.warn(isZh ? "\u4E91\u7AEF\u83B7\u53D6\u5931\u8D25\uFF0C\u4F7F\u7528\u672C\u5730\u6A21\u677F" : "Cloud fetch failed, using local templates");
|
|
866
866
|
const templates = await loadHookTemplates();
|
|
867
867
|
recommendedHooks = templates.filter(
|
package/dist/chunks/ccjk-mcp.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { cwd } from 'node:process';
|
|
|
3
3
|
import ansis from 'ansis';
|
|
4
4
|
import consola from 'consola';
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
|
-
import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.
|
|
6
|
+
import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.BNwRnWYx.mjs';
|
|
7
7
|
import { CLAUDE_DIR } from './constants.mjs';
|
|
8
8
|
import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
9
9
|
import { b as backupMcpConfig, r as readMcpConfig, m as mergeMcpServers, w as writeMcpConfig } from './claude-config.mjs';
|
|
@@ -375,7 +375,7 @@ async function ccjkMcp(options = {}) {
|
|
|
375
375
|
coreServices.forEach((service) => {
|
|
376
376
|
const installed = isServiceInstalled(service.id);
|
|
377
377
|
const status = installed ? ansis.green("\u2705") : ansis.yellow("\u2B55");
|
|
378
|
-
const
|
|
378
|
+
const _name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
379
379
|
const desc = isZh ? service.description["zh-CN"] : service.description.en;
|
|
380
380
|
console.log(` ${status} ${ansis.bold(service.id.padEnd(30))} - ${desc}`);
|
|
381
381
|
});
|
|
@@ -386,7 +386,7 @@ async function ccjkMcp(options = {}) {
|
|
|
386
386
|
ondemandServices.forEach((service) => {
|
|
387
387
|
const installed = isServiceInstalled(service.id);
|
|
388
388
|
const status = installed ? ansis.green("\u2705") : ansis.yellow("\u2B55");
|
|
389
|
-
const
|
|
389
|
+
const _name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
390
390
|
const desc = isZh ? service.description["zh-CN"] : service.description.en;
|
|
391
391
|
console.log(` ${status} ${ansis.bold(service.id.padEnd(30))} - ${desc}`);
|
|
392
392
|
});
|
|
@@ -397,7 +397,7 @@ async function ccjkMcp(options = {}) {
|
|
|
397
397
|
scenarioServices.forEach((service) => {
|
|
398
398
|
const installed = isServiceInstalled(service.id);
|
|
399
399
|
const status = installed ? ansis.green("\u2705") : ansis.yellow("\u2B55");
|
|
400
|
-
const
|
|
400
|
+
const _name = isZh ? service.name["zh-CN"] : service.name.en;
|
|
401
401
|
const desc = isZh ? service.description["zh-CN"] : service.description.en;
|
|
402
402
|
console.log(` ${status} ${ansis.bold(service.id.padEnd(30))} - ${desc}`);
|
|
403
403
|
});
|
|
@@ -605,7 +605,7 @@ async function getRecommendedServices(analysis, options) {
|
|
|
605
605
|
return services;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
} catch (
|
|
608
|
+
} catch (_error) {
|
|
609
609
|
consola.warn(isZh ? "\u4E91\u7AEF\u83B7\u53D6\u5931\u8D25\uFF0C\u4F7F\u7528\u672C\u5730\u6A21\u677F" : "Cloud fetch failed, using local templates");
|
|
610
610
|
}
|
|
611
611
|
const allServices = getCompatibleMcpServiceTemplates();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ansis from 'ansis';
|
|
2
2
|
import { consola } from 'consola';
|
|
3
|
-
import { P as ProjectAnalyzer } from '../shared/ccjk.
|
|
3
|
+
import { P as ProjectAnalyzer } from '../shared/ccjk.BNwRnWYx.mjs';
|
|
4
4
|
import { i18n } from './index2.mjs';
|
|
5
5
|
import { promises } from 'node:fs';
|
|
6
6
|
import { performance } from 'node:perf_hooks';
|
|
@@ -19,7 +19,7 @@ import 'i18next';
|
|
|
19
19
|
import 'i18next-fs-backend';
|
|
20
20
|
import './constants.mjs';
|
|
21
21
|
import 'node:os';
|
|
22
|
-
import '../shared/ccjk.
|
|
22
|
+
import '../shared/ccjk.6uSMSDCL.mjs';
|
|
23
23
|
import '../shared/ccjk.AqnXPAzw.mjs';
|
|
24
24
|
import 'inquirer';
|
|
25
25
|
import 'node:child_process';
|
|
@@ -64,7 +64,7 @@ async function createBackup(operation, options = {}) {
|
|
|
64
64
|
await promises.mkdir(join(destPath, ".."), { recursive: true });
|
|
65
65
|
await promises.copyFile(sourcePath, destPath);
|
|
66
66
|
}
|
|
67
|
-
} catch (
|
|
67
|
+
} catch (_error) {
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
const manifest = {
|
|
@@ -445,7 +445,7 @@ class SetupOrchestrator {
|
|
|
445
445
|
}
|
|
446
446
|
return hooks;
|
|
447
447
|
}
|
|
448
|
-
async showPlanAndConfirm(
|
|
448
|
+
async showPlanAndConfirm(_plan, _options) {
|
|
449
449
|
return true;
|
|
450
450
|
}
|
|
451
451
|
async executePhases(plan, options) {
|
|
@@ -665,7 +665,7 @@ class SetupOrchestrator {
|
|
|
665
665
|
this.logger.error(i18n.t("setup.rollbackFailed"), error);
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
async rollbackPhase(phase,
|
|
668
|
+
async rollbackPhase(phase, _phaseResult) {
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
|
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import ansis from 'ansis';
|
|
6
6
|
import consola from 'consola';
|
|
7
7
|
import inquirer from 'inquirer';
|
|
8
|
-
import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.
|
|
8
|
+
import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.BNwRnWYx.mjs';
|
|
9
9
|
import { i18n } from './index2.mjs';
|
|
10
10
|
import { g as getSkillParser } from '../shared/ccjk.Bdhyg3X-.mjs';
|
|
11
11
|
import 'pathe';
|
|
@@ -131,7 +131,7 @@ async function ccjkSkills(options = {}) {
|
|
|
131
131
|
throw error;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
function displayProjectInfo(analysis,
|
|
134
|
+
function displayProjectInfo(analysis, _lang) {
|
|
135
135
|
const pm = analysis.packageManager || "unknown";
|
|
136
136
|
const frameworks = analysis.frameworks.map((f) => f.name).join(", ");
|
|
137
137
|
const languages = analysis.languages.filter((l) => l.confidence > 0.5).map((l) => l.language).join(", ");
|
|
@@ -159,7 +159,7 @@ async function getRecommendedSkills(analysis, options) {
|
|
|
159
159
|
logger.success(isZh ? `\u4ECE\u4E91\u7AEF\u83B7\u53D6 ${cloudSkills.length} \u4E2A\u6280\u80FD` : `Fetched ${cloudSkills.length} skills from cloud`);
|
|
160
160
|
const relevantSkills = cloudSkills.filter((skill) => {
|
|
161
161
|
const tags = skill.tags || [];
|
|
162
|
-
const
|
|
162
|
+
const _category = skill.category || "";
|
|
163
163
|
const compatibility = skill.compatibility || {};
|
|
164
164
|
return tags.some((tag) => languages.includes(tag) || frameworks.includes(tag) || projectType.includes(tag)) || (compatibility.languages || []).some((lang) => languages.includes(lang.toLowerCase())) || (compatibility.frameworks || []).some((fw) => frameworks.includes(fw.toLowerCase()));
|
|
165
165
|
});
|
|
@@ -448,7 +448,7 @@ async function loadSkillTemplate(skill) {
|
|
|
448
448
|
function generateSkillMdFromTemplate(skill, templateContent) {
|
|
449
449
|
return templateContent;
|
|
450
450
|
}
|
|
451
|
-
function displayInstallationResults(results,
|
|
451
|
+
function displayInstallationResults(results, _lang) {
|
|
452
452
|
console.log("");
|
|
453
453
|
const successful = results.filter((r) => r.success);
|
|
454
454
|
const failed = results.filter((r) => !r.success);
|
package/dist/chunks/ccr.mjs
CHANGED
|
@@ -39,19 +39,20 @@ import './ccjk-config.mjs';
|
|
|
39
39
|
import 'smol-toml';
|
|
40
40
|
import '../shared/ccjk.CUdzQluX.mjs';
|
|
41
41
|
import './features.mjs';
|
|
42
|
-
import '../shared/ccjk.
|
|
42
|
+
import '../shared/ccjk.CS0ybJCf.mjs';
|
|
43
43
|
import '../shared/ccjk.BFQ7yr5S.mjs';
|
|
44
44
|
import './simple-config.mjs';
|
|
45
|
+
import './api-config-selector.mjs';
|
|
45
46
|
import './claude-code-config-manager.mjs';
|
|
46
47
|
import './config-switch.mjs';
|
|
47
48
|
import './codex.mjs';
|
|
48
49
|
import './prompts.mjs';
|
|
49
50
|
import './ccjk-agents.mjs';
|
|
50
51
|
import 'consola';
|
|
51
|
-
import '../shared/ccjk.
|
|
52
|
+
import '../shared/ccjk.BNwRnWYx.mjs';
|
|
52
53
|
import 'tinyglobby';
|
|
53
54
|
import 'ofetch';
|
|
54
|
-
import '../shared/ccjk.
|
|
55
|
+
import '../shared/ccjk.6uSMSDCL.mjs';
|
|
55
56
|
import '../shared/ccjk.AqnXPAzw.mjs';
|
|
56
57
|
import './ccjk-mcp.mjs';
|
|
57
58
|
import './ccjk-skills.mjs';
|
|
@@ -59,7 +60,7 @@ import '../shared/ccjk.Bdhyg3X-.mjs';
|
|
|
59
60
|
import './check-updates.mjs';
|
|
60
61
|
import './doctor.mjs';
|
|
61
62
|
import './api-providers.mjs';
|
|
62
|
-
import '../shared/ccjk.
|
|
63
|
+
import '../shared/ccjk.h7_W-wTs.mjs';
|
|
63
64
|
import '../shared/ccjk.J8YiPsOw.mjs';
|
|
64
65
|
import './init.mjs';
|
|
65
66
|
import './workflows.mjs';
|
|
@@ -4,7 +4,7 @@ import { ensureI18nInitialized, i18n } from './index2.mjs';
|
|
|
4
4
|
import { ClaudeCodeConfigManager } from './claude-code-config-manager.mjs';
|
|
5
5
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
6
6
|
import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
|
|
7
|
-
import { v as validateApiKey } from '../shared/ccjk.
|
|
7
|
+
import { v as validateApiKey } from '../shared/ccjk.CS0ybJCf.mjs';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:process';
|
|
10
10
|
import 'node:url';
|
package/dist/chunks/cli-hook.mjs
CHANGED
|
@@ -1747,7 +1747,7 @@ class MayorAgent extends EventEmitter {
|
|
|
1747
1747
|
return "complex";
|
|
1748
1748
|
return "very_complex";
|
|
1749
1749
|
}
|
|
1750
|
-
determineRequiredRoles(type,
|
|
1750
|
+
determineRequiredRoles(type, _entities) {
|
|
1751
1751
|
const roles = ["researcher"];
|
|
1752
1752
|
switch (type) {
|
|
1753
1753
|
case "feature":
|
|
@@ -1775,7 +1775,7 @@ class MayorAgent extends EventEmitter {
|
|
|
1775
1775
|
const typeLabel = type.charAt(0).toUpperCase() + type.slice(1);
|
|
1776
1776
|
return `${typeLabel}: ${words}${input.split(/\s+/).length > 10 ? "..." : ""}`;
|
|
1777
1777
|
}
|
|
1778
|
-
suggestApproach(type,
|
|
1778
|
+
suggestApproach(type, _complexity) {
|
|
1779
1779
|
const approaches = {
|
|
1780
1780
|
feature: "Design-first approach with incremental implementation",
|
|
1781
1781
|
bugfix: "Reproduce, isolate, fix, and verify",
|
|
@@ -2439,7 +2439,7 @@ class AutoExecutor extends EventEmitter {
|
|
|
2439
2439
|
/**
|
|
2440
2440
|
* Detect which MCP tools are needed
|
|
2441
2441
|
*/
|
|
2442
|
-
async detectMcpRequirement(input,
|
|
2442
|
+
async detectMcpRequirement(input, _intent) {
|
|
2443
2443
|
const normalized = input.toLowerCase();
|
|
2444
2444
|
const tools = [];
|
|
2445
2445
|
if (normalized.includes("file") || normalized.includes("directory") || normalized.includes("folder")) {
|
|
@@ -2820,7 +2820,7 @@ class CliInterceptor extends EventEmitter {
|
|
|
2820
2820
|
/**
|
|
2821
2821
|
* Show intent message to user
|
|
2822
2822
|
*/
|
|
2823
|
-
showIntentMessage(
|
|
2823
|
+
showIntentMessage(_input) {
|
|
2824
2824
|
console.log("\n\u{1F9E0} Analyzing your request...");
|
|
2825
2825
|
console.log(" System will automatically handle: skills, agents, MCP tools\n");
|
|
2826
2826
|
}
|
package/dist/chunks/cli.mjs
CHANGED
|
@@ -243,7 +243,7 @@ class EmailChecker {
|
|
|
243
243
|
tls: this.config.tls,
|
|
244
244
|
tlsOptions: { rejectUnauthorized: false }
|
|
245
245
|
});
|
|
246
|
-
} catch (
|
|
246
|
+
} catch (_error) {
|
|
247
247
|
throw new Error("imap package is not installed. Install it with: pnpm add imap @types/imap");
|
|
248
248
|
}
|
|
249
249
|
this.setupEventHandlers();
|
|
@@ -297,7 +297,7 @@ class EmailChecker {
|
|
|
297
297
|
try {
|
|
298
298
|
await this.connect();
|
|
299
299
|
return new Promise((resolve, reject) => {
|
|
300
|
-
this.imap.openBox("INBOX", false, (err,
|
|
300
|
+
this.imap.openBox("INBOX", false, (err, _box) => {
|
|
301
301
|
if (err) {
|
|
302
302
|
reject(err);
|
|
303
303
|
return;
|
|
@@ -317,7 +317,7 @@ class EmailChecker {
|
|
|
317
317
|
markSeen: true
|
|
318
318
|
// Mark as read after fetching
|
|
319
319
|
});
|
|
320
|
-
fetch.on("message", (msg,
|
|
320
|
+
fetch.on("message", (msg, _seqno) => {
|
|
321
321
|
msg.on("body", (stream) => {
|
|
322
322
|
let simpleParserFn;
|
|
323
323
|
try {
|
|
@@ -341,7 +341,7 @@ class EmailChecker {
|
|
|
341
341
|
});
|
|
342
342
|
});
|
|
343
343
|
});
|
|
344
|
-
msg.once("attributes", (
|
|
344
|
+
msg.once("attributes", (_attrs) => {
|
|
345
345
|
});
|
|
346
346
|
});
|
|
347
347
|
fetch.once("error", (fetchErr) => {
|
|
@@ -783,7 +783,7 @@ class ResultSender {
|
|
|
783
783
|
pass: this.config.password
|
|
784
784
|
}
|
|
785
785
|
});
|
|
786
|
-
} catch (
|
|
786
|
+
} catch (_error) {
|
|
787
787
|
throw new Error("nodemailer package is not installed. Install it with: pnpm add nodemailer @types/nodemailer");
|
|
788
788
|
}
|
|
789
789
|
}
|
|
@@ -1261,7 +1261,7 @@ class WSLogStreamer extends EventEmitter {
|
|
|
1261
1261
|
* Connect using fetch with Server-Sent Events fallback
|
|
1262
1262
|
* This is needed for Node.js environments without native WebSocket
|
|
1263
1263
|
*/
|
|
1264
|
-
async connectWithFetch(
|
|
1264
|
+
async connectWithFetch(_url) {
|
|
1265
1265
|
this.debugLog("Creating simulated WebSocket connection");
|
|
1266
1266
|
this.ws = {
|
|
1267
1267
|
readyState: WebSocket.OPEN,
|
|
@@ -5,7 +5,7 @@ import 'node:fs';
|
|
|
5
5
|
import 'node:os';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
|
|
8
|
-
const { cyan:
|
|
8
|
+
const { cyan: _cyan, yellow: yellow$1, gray: _gray, green: green$1, red: _red, blue: _blue$1, bold: _bold, dim: _dim$1 } = ansis;
|
|
9
9
|
class AgentBrowserSession {
|
|
10
10
|
options;
|
|
11
11
|
isRunning = false;
|
|
@@ -238,7 +238,7 @@ class AgentBrowserSession {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
const { cyan, yellow, gray, green, red, blue, bold, dim } = ansis;
|
|
241
|
+
const { cyan, yellow, gray, green, red, blue: _blue, bold, dim: _dim } = ansis;
|
|
242
242
|
function agentBrowserHelp(_options) {
|
|
243
243
|
console.log(`
|
|
244
244
|
${bold(cyan("Agent Browser"))} - ${gray("Zero-config browser automation for AI agents")}
|
package/dist/chunks/config.mjs
CHANGED
|
@@ -130,6 +130,18 @@ function configureApi(apiConfig) {
|
|
|
130
130
|
}
|
|
131
131
|
return apiConfig;
|
|
132
132
|
}
|
|
133
|
+
function configureHooks(hooks) {
|
|
134
|
+
let settings = getDefaultSettings();
|
|
135
|
+
const existingSettings = readJsonConfig(SETTINGS_FILE);
|
|
136
|
+
if (existingSettings) {
|
|
137
|
+
settings = existingSettings;
|
|
138
|
+
}
|
|
139
|
+
settings.hooks = {
|
|
140
|
+
...settings.hooks || {},
|
|
141
|
+
...hooks
|
|
142
|
+
};
|
|
143
|
+
writeJsonConfig(SETTINGS_FILE, settings);
|
|
144
|
+
}
|
|
133
145
|
function mergeConfigs(sourceFile, targetFile) {
|
|
134
146
|
if (!exists(sourceFile))
|
|
135
147
|
return;
|
|
@@ -289,7 +301,10 @@ function applyAiLanguageDirective(aiOutputLang) {
|
|
|
289
301
|
} else {
|
|
290
302
|
directive = `Always respond in ${aiOutputLang}`;
|
|
291
303
|
}
|
|
292
|
-
|
|
304
|
+
const frontmatter = "---\nscope: user\n---";
|
|
305
|
+
writeFileAtomic(claudeFile, `${frontmatter}
|
|
306
|
+
|
|
307
|
+
${directive}`);
|
|
293
308
|
}
|
|
294
309
|
function switchToOfficialLogin() {
|
|
295
310
|
try {
|
|
@@ -353,6 +368,7 @@ const config = {
|
|
|
353
368
|
applyAiLanguageDirective: applyAiLanguageDirective,
|
|
354
369
|
backupExistingConfig: backupExistingConfig,
|
|
355
370
|
configureApi: configureApi,
|
|
371
|
+
configureHooks: configureHooks,
|
|
356
372
|
copyConfigFiles: copyConfigFiles,
|
|
357
373
|
ensureClaudeDir: ensureClaudeDir,
|
|
358
374
|
getExistingApiConfig: getExistingApiConfig,
|
package/dist/chunks/doctor.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { resolve, join, dirname } from 'pathe';
|
|
|
6
6
|
import { getApiProviderPresets } from './api-providers.mjs';
|
|
7
7
|
import { SETTINGS_FILE, CLAUDE_DIR } from './constants.mjs';
|
|
8
8
|
import { i18n } from './index2.mjs';
|
|
9
|
-
import { g as getPermissionManager } from '../shared/ccjk.
|
|
9
|
+
import { g as getPermissionManager } from '../shared/ccjk.h7_W-wTs.mjs';
|
|
10
10
|
import { e as commandExists } from './platform.mjs';
|
|
11
11
|
import { P as ProviderHealthMonitor } from '../shared/ccjk.J8YiPsOw.mjs';
|
|
12
12
|
import { platform, userInfo, homedir } from 'node:os';
|
|
@@ -595,7 +595,7 @@ async function checkSettings() {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
return { name: "settings.json", status: "ok", message: "Valid configuration" };
|
|
598
|
-
} catch (
|
|
598
|
+
} catch (_error) {
|
|
599
599
|
return {
|
|
600
600
|
name: "settings.json",
|
|
601
601
|
status: "error",
|
|
@@ -811,7 +811,7 @@ async function fixSettingsFile() {
|
|
|
811
811
|
copyFileSync(SETTINGS_FILE, backupPath);
|
|
812
812
|
console.log(ansis.green(`\u2714 ${isZh ? "\u5DF2\u5907\u4EFD\u65E7\u8BBE\u7F6E" : "Backed up settings"}: ${backupPath}`));
|
|
813
813
|
}
|
|
814
|
-
} catch (
|
|
814
|
+
} catch (_error) {
|
|
815
815
|
console.log(ansis.yellow(`\u26A0\uFE0F ${isZh ? "\u5907\u4EFD\u5931\u8D25\uFF0C\u7EE7\u7EED..." : "Backup failed, continuing..."}`));
|
|
816
816
|
}
|
|
817
817
|
console.log("");
|