ccjk 9.7.0 → 9.8.1
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/boost.mjs +243 -5
- package/dist/chunks/ccr.mjs +3 -1
- package/dist/chunks/check-updates.mjs +3 -1
- package/dist/chunks/claude-config.mjs +1 -1
- package/dist/chunks/codex.mjs +1 -1
- package/dist/chunks/features.mjs +3 -1
- package/dist/chunks/hook-installer.mjs +44 -0
- package/dist/chunks/init.mjs +1 -1
- package/dist/chunks/installer2.mjs +1 -1
- package/dist/chunks/menu.mjs +4 -4
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/platform.mjs +1 -1
- package/dist/chunks/quick-setup.mjs +23 -2
- package/dist/chunks/simple-config.mjs +1 -1
- package/dist/{shared/ccjk.q1koQxEE.mjs → chunks/smart-defaults.mjs} +77 -79
- package/dist/chunks/status.mjs +204 -102
- package/dist/chunks/uninstall.mjs +3 -1
- package/dist/chunks/version-checker.mjs +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/shared/{ccjk.CSkyCZIM.mjs → ccjk.Bndhan7G.mjs} +4 -242
- package/dist/shared/ccjk.CeE8RLG2.mjs +62 -0
- package/dist/shared/ccjk.DKojSRzw.mjs +266 -0
- package/package.json +1 -1
package/dist/chunks/boost.mjs
CHANGED
|
@@ -1,15 +1,253 @@
|
|
|
1
1
|
import ansis from 'ansis';
|
|
2
|
-
import {
|
|
3
|
-
import 'node:
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import process__default from 'node:process';
|
|
4
|
+
import { join } from 'pathe';
|
|
5
|
+
import { SETTINGS_FILE } from './constants.mjs';
|
|
6
|
+
import { r as runHealthCheck } from '../shared/ccjk.Bndhan7G.mjs';
|
|
7
7
|
import 'node:os';
|
|
8
8
|
import './index.mjs';
|
|
9
9
|
import 'node:url';
|
|
10
10
|
import 'i18next';
|
|
11
11
|
import 'i18next-fs-backend';
|
|
12
12
|
|
|
13
|
+
function analyzeProject(root) {
|
|
14
|
+
const cwd = process__default.cwd();
|
|
15
|
+
const profile = {
|
|
16
|
+
language: "unknown",
|
|
17
|
+
frameworks: [],
|
|
18
|
+
packageManager: "unknown",
|
|
19
|
+
hasCI: false,
|
|
20
|
+
hasDocker: false,
|
|
21
|
+
hasMCP: false,
|
|
22
|
+
hasClaudeMd: false,
|
|
23
|
+
isMonorepo: false,
|
|
24
|
+
tags: []
|
|
25
|
+
};
|
|
26
|
+
const pkgPath = join(cwd, "package.json");
|
|
27
|
+
let pkg = null;
|
|
28
|
+
if (existsSync(pkgPath)) {
|
|
29
|
+
try {
|
|
30
|
+
pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
31
|
+
profile.projectName = pkg?.name;
|
|
32
|
+
} catch {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
profile.language = detectLanguage(cwd, pkg);
|
|
36
|
+
profile.packageManager = detectPackageManager(cwd);
|
|
37
|
+
profile.frameworks = detectFrameworks(cwd, pkg);
|
|
38
|
+
profile.testFramework = detectTestFramework(cwd, pkg);
|
|
39
|
+
profile.buildTool = detectBuildTool(cwd, pkg);
|
|
40
|
+
profile.hasCI = existsSync(join(cwd, ".github/workflows")) || existsSync(join(cwd, ".gitlab-ci.yml")) || existsSync(join(cwd, ".circleci")) || existsSync(join(cwd, "Jenkinsfile"));
|
|
41
|
+
profile.hasDocker = existsSync(join(cwd, "Dockerfile")) || existsSync(join(cwd, "docker-compose.yml")) || existsSync(join(cwd, "docker-compose.yaml"));
|
|
42
|
+
profile.hasMCP = checkMcpConfigured();
|
|
43
|
+
profile.hasClaudeMd = existsSync(join(cwd, "CLAUDE.md"));
|
|
44
|
+
profile.isMonorepo = existsSync(join(cwd, "pnpm-workspace.yaml")) || existsSync(join(cwd, "lerna.json")) || pkg?.workspaces != null;
|
|
45
|
+
profile.tags = generateTags(profile);
|
|
46
|
+
return profile;
|
|
47
|
+
}
|
|
48
|
+
function detectLanguage(cwd, pkg) {
|
|
49
|
+
if (existsSync(join(cwd, "tsconfig.json")) || pkg?.devDependencies?.typescript) return "typescript";
|
|
50
|
+
if (existsSync(join(cwd, "pyproject.toml")) || existsSync(join(cwd, "setup.py"))) return "python";
|
|
51
|
+
if (existsSync(join(cwd, "go.mod"))) return "go";
|
|
52
|
+
if (existsSync(join(cwd, "Cargo.toml"))) return "rust";
|
|
53
|
+
if (existsSync(join(cwd, "Gemfile"))) return "ruby";
|
|
54
|
+
if (existsSync(join(cwd, "pom.xml")) || existsSync(join(cwd, "build.gradle"))) return "java";
|
|
55
|
+
if (existsSync(join(cwd, "Package.swift"))) return "swift";
|
|
56
|
+
if (pkg) return "javascript";
|
|
57
|
+
return "unknown";
|
|
58
|
+
}
|
|
59
|
+
function detectPackageManager(cwd) {
|
|
60
|
+
if (existsSync(join(cwd, "pnpm-lock.yaml")) || existsSync(join(cwd, "pnpm-workspace.yaml"))) return "pnpm";
|
|
61
|
+
if (existsSync(join(cwd, "yarn.lock"))) return "yarn";
|
|
62
|
+
if (existsSync(join(cwd, "bun.lockb")) || existsSync(join(cwd, "bun.lock"))) return "bun";
|
|
63
|
+
if (existsSync(join(cwd, "package-lock.json"))) return "npm";
|
|
64
|
+
return "unknown";
|
|
65
|
+
}
|
|
66
|
+
function detectFrameworks(_cwd, pkg) {
|
|
67
|
+
const frameworks = [];
|
|
68
|
+
const allDeps = { ...pkg?.dependencies, ...pkg?.devDependencies };
|
|
69
|
+
if (allDeps?.react || allDeps?.["react-dom"]) frameworks.push("react");
|
|
70
|
+
if (allDeps?.vue) frameworks.push("vue");
|
|
71
|
+
if (allDeps?.svelte) frameworks.push("svelte");
|
|
72
|
+
if (allDeps?.angular || allDeps?.["@angular/core"]) frameworks.push("angular");
|
|
73
|
+
if (allDeps?.next) frameworks.push("nextjs");
|
|
74
|
+
if (allDeps?.nuxt) frameworks.push("nuxt");
|
|
75
|
+
if (allDeps?.astro) frameworks.push("astro");
|
|
76
|
+
if (allDeps?.express) frameworks.push("express");
|
|
77
|
+
if (allDeps?.fastify) frameworks.push("fastify");
|
|
78
|
+
if (allDeps?.koa) frameworks.push("koa");
|
|
79
|
+
if (allDeps?.hono) frameworks.push("hono");
|
|
80
|
+
if (allDeps?.["@nestjs/core"]) frameworks.push("nestjs");
|
|
81
|
+
if (allDeps?.electron) frameworks.push("electron");
|
|
82
|
+
if (allDeps?.["@tauri-apps/api"]) frameworks.push("tauri");
|
|
83
|
+
if (allDeps?.["react-native"]) frameworks.push("react-native");
|
|
84
|
+
if (allDeps?.cac || allDeps?.commander || allDeps?.yargs) frameworks.push("cli");
|
|
85
|
+
return frameworks;
|
|
86
|
+
}
|
|
87
|
+
function detectTestFramework(cwd, pkg) {
|
|
88
|
+
const allDeps = { ...pkg?.dependencies, ...pkg?.devDependencies };
|
|
89
|
+
if (allDeps?.vitest || existsSync(join(cwd, "vitest.config.ts"))) return "vitest";
|
|
90
|
+
if (allDeps?.jest || existsSync(join(cwd, "jest.config.js"))) return "jest";
|
|
91
|
+
if (allDeps?.mocha) return "mocha";
|
|
92
|
+
if (allDeps?.playwright || allDeps?.["@playwright/test"]) return "playwright";
|
|
93
|
+
if (allDeps?.cypress) return "cypress";
|
|
94
|
+
if (existsSync(join(cwd, "pytest.ini")) || existsSync(join(cwd, "conftest.py"))) return "pytest";
|
|
95
|
+
return void 0;
|
|
96
|
+
}
|
|
97
|
+
function detectBuildTool(cwd, pkg) {
|
|
98
|
+
const allDeps = { ...pkg?.dependencies, ...pkg?.devDependencies };
|
|
99
|
+
if (allDeps?.vite || existsSync(join(cwd, "vite.config.ts"))) return "vite";
|
|
100
|
+
if (allDeps?.webpack) return "webpack";
|
|
101
|
+
if (allDeps?.esbuild) return "esbuild";
|
|
102
|
+
if (allDeps?.unbuild) return "unbuild";
|
|
103
|
+
if (allDeps?.rollup) return "rollup";
|
|
104
|
+
if (allDeps?.turbo || existsSync(join(cwd, "turbo.json"))) return "turbo";
|
|
105
|
+
return void 0;
|
|
106
|
+
}
|
|
107
|
+
function checkMcpConfigured() {
|
|
108
|
+
try {
|
|
109
|
+
if (!existsSync(SETTINGS_FILE)) return false;
|
|
110
|
+
const settings = JSON.parse(readFileSync(SETTINGS_FILE, "utf-8"));
|
|
111
|
+
return Object.keys(settings.mcpServers || {}).length > 0;
|
|
112
|
+
} catch {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function generateTags(profile) {
|
|
117
|
+
const tags = [];
|
|
118
|
+
tags.push(profile.language);
|
|
119
|
+
tags.push(...profile.frameworks);
|
|
120
|
+
if (profile.testFramework) tags.push(profile.testFramework);
|
|
121
|
+
if (profile.buildTool) tags.push(profile.buildTool);
|
|
122
|
+
if (profile.packageManager !== "unknown") tags.push(profile.packageManager);
|
|
123
|
+
if (profile.hasCI) tags.push("ci");
|
|
124
|
+
if (profile.hasDocker) tags.push("docker");
|
|
125
|
+
if (profile.isMonorepo) tags.push("monorepo");
|
|
126
|
+
if (profile.frameworks.some((f) => ["react", "vue", "svelte", "angular"].includes(f))) tags.push("frontend");
|
|
127
|
+
if (profile.frameworks.some((f) => ["express", "fastify", "koa", "nestjs", "hono"].includes(f))) tags.push("backend");
|
|
128
|
+
if (profile.frameworks.some((f) => ["nextjs", "nuxt", "astro"].includes(f))) tags.push("fullstack");
|
|
129
|
+
if (profile.frameworks.includes("cli")) tags.push("cli-tool");
|
|
130
|
+
return [...new Set(tags)];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const SKILL_RULES = [
|
|
134
|
+
{
|
|
135
|
+
tags: ["typescript", "javascript", "python", "go", "rust", "ruby", "java"],
|
|
136
|
+
skill: { id: "git-commit", name: "Smart Git Commit", description: "AI-powered conventional commit messages", reason: "Every project needs good commits", category: "git" }
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
tags: ["typescript", "javascript", "python", "go", "rust"],
|
|
140
|
+
skill: { id: "code-review", name: "Code Review", description: "Two-phase deep code review", reason: "Catch bugs before they ship", category: "review" }
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
tags: ["react", "vue", "svelte", "angular", "frontend"],
|
|
144
|
+
skill: { id: "component-gen", name: "Component Generator", description: "Generate UI components with tests", reason: "Frontend framework detected", category: "dev" }
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
tags: ["express", "fastify", "koa", "nestjs", "hono", "backend"],
|
|
148
|
+
skill: { id: "api-design", name: "API Design", description: "Design RESTful/GraphQL APIs", reason: "Backend framework detected", category: "dev" }
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
tags: ["backend", "fullstack"],
|
|
152
|
+
skill: { id: "security-audit", name: "Security Audit", description: "Check for common vulnerabilities", reason: "Server-side code needs security review", category: "review" }
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
tags: ["vitest", "jest", "pytest", "mocha"],
|
|
156
|
+
skill: { id: "tdd-workflow", name: "TDD Workflow", description: "Test-driven development cycle", reason: "Test framework detected", category: "testing" }
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
tags: ["playwright", "cypress"],
|
|
160
|
+
skill: { id: "e2e-helper", name: "E2E Test Helper", description: "Generate end-to-end tests", reason: "E2E framework detected", category: "testing" }
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
tags: ["docker"],
|
|
164
|
+
skill: { id: "docker-optimize", name: "Docker Optimizer", description: "Optimize Dockerfile", reason: "Docker detected", category: "devops" }
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
tags: ["ci"],
|
|
168
|
+
skill: { id: "ci-pipeline", name: "CI Pipeline", description: "Optimize CI/CD pipeline", reason: "CI configuration detected", category: "devops" }
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
tags: ["cli-tool", "cli"],
|
|
172
|
+
skill: { id: "cli-ux", name: "CLI UX Design", description: "Better CLI interfaces", reason: "CLI tool detected", category: "dev" }
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
tags: ["monorepo"],
|
|
176
|
+
skill: { id: "monorepo-manage", name: "Monorepo Manager", description: "Manage packages and releases", reason: "Monorepo detected", category: "dev" }
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
tags: ["typescript", "javascript", "python"],
|
|
180
|
+
skill: { id: "doc-gen", name: "Documentation Generator", description: "Generate API docs and README", reason: "Good docs improve maintainability", category: "docs" }
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
tags: ["react", "vue", "nextjs", "nuxt", "frontend"],
|
|
184
|
+
skill: { id: "perf-audit", name: "Performance Audit", description: "Bundle size and Core Web Vitals", reason: "Frontend performance matters", category: "review" }
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
tags: ["nextjs", "nuxt", "astro", "fullstack"],
|
|
188
|
+
skill: { id: "fullstack-debug", name: "Fullstack Debugger", description: "Debug across client/server boundary", reason: "Fullstack framework detected", category: "debug" }
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
const MCP_RULES = [
|
|
192
|
+
{
|
|
193
|
+
tags: ["typescript", "javascript", "python", "go", "rust", "ruby", "java"],
|
|
194
|
+
mcp: { id: "context7", name: "Context7", description: "Up-to-date library docs", reason: "Essential for accurate API usage" }
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
tags: ["playwright", "frontend", "fullstack"],
|
|
198
|
+
mcp: { id: "playwright", name: "Playwright MCP", description: "Browser automation", reason: "Frontend/E2E project detected" }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
tags: ["backend", "fullstack", "express", "fastify", "nestjs"],
|
|
202
|
+
mcp: { id: "sqlite", name: "SQLite MCP", description: "Local database", reason: "Backend project detected" }
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
tags: ["typescript", "javascript", "python", "go", "rust"],
|
|
206
|
+
mcp: { id: "mcp-search", name: "Web Search", description: "Search for docs and solutions", reason: "Quick access to online resources" }
|
|
207
|
+
}
|
|
208
|
+
];
|
|
209
|
+
function matchSkills(profile) {
|
|
210
|
+
const results = [];
|
|
211
|
+
const seen = /* @__PURE__ */ new Set();
|
|
212
|
+
for (const rule of SKILL_RULES) {
|
|
213
|
+
if (seen.has(rule.skill.id)) continue;
|
|
214
|
+
const matchingTags = rule.tags.filter((t) => profile.tags.includes(t));
|
|
215
|
+
if (matchingTags.length === 0) continue;
|
|
216
|
+
const matchScore = Math.min(100, Math.round(matchingTags.length / rule.tags.length * 100) + 20);
|
|
217
|
+
results.push({ ...rule.skill, matchScore });
|
|
218
|
+
seen.add(rule.skill.id);
|
|
219
|
+
}
|
|
220
|
+
results.sort((a, b) => b.matchScore - a.matchScore);
|
|
221
|
+
return results;
|
|
222
|
+
}
|
|
223
|
+
function matchMcpServices(profile) {
|
|
224
|
+
const results = [];
|
|
225
|
+
const seen = /* @__PURE__ */ new Set();
|
|
226
|
+
for (const rule of MCP_RULES) {
|
|
227
|
+
if (seen.has(rule.mcp.id)) continue;
|
|
228
|
+
const matchingTags = rule.tags.filter((t) => profile.tags.includes(t));
|
|
229
|
+
if (matchingTags.length === 0) continue;
|
|
230
|
+
const matchScore = Math.min(100, Math.round(matchingTags.length / rule.tags.length * 100) + 20);
|
|
231
|
+
results.push({ ...rule.mcp, matchScore });
|
|
232
|
+
seen.add(rule.mcp.id);
|
|
233
|
+
}
|
|
234
|
+
results.sort((a, b) => b.matchScore - a.matchScore);
|
|
235
|
+
return results;
|
|
236
|
+
}
|
|
237
|
+
function getRecommendations(profile) {
|
|
238
|
+
const skills = matchSkills(profile);
|
|
239
|
+
const mcpServices = matchMcpServices(profile);
|
|
240
|
+
const parts = [];
|
|
241
|
+
if (profile.language !== "unknown") parts.push(profile.language);
|
|
242
|
+
parts.push(...profile.frameworks.slice(0, 3));
|
|
243
|
+
const stackDesc = parts.join(" + ") || "your project";
|
|
244
|
+
return {
|
|
245
|
+
skills,
|
|
246
|
+
mcpServices,
|
|
247
|
+
summary: `Found ${skills.length} skills and ${mcpServices.length} MCP services for ${stackDesc}`
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
|
|
13
251
|
async function executeRecommendation(rec) {
|
|
14
252
|
if (!rec.command) {
|
|
15
253
|
return { success: false, message: "No command available" };
|
package/dist/chunks/ccr.mjs
CHANGED
|
@@ -20,10 +20,12 @@ import 'node:crypto';
|
|
|
20
20
|
import 'node:fs/promises';
|
|
21
21
|
import './json-config.mjs';
|
|
22
22
|
import 'dayjs';
|
|
23
|
-
import '../shared/ccjk.
|
|
23
|
+
import '../shared/ccjk.CeE8RLG2.mjs';
|
|
24
|
+
import './smart-defaults.mjs';
|
|
24
25
|
import 'node:child_process';
|
|
25
26
|
import './platform.mjs';
|
|
26
27
|
import 'tinyexec';
|
|
28
|
+
import '../shared/ccjk.DKojSRzw.mjs';
|
|
27
29
|
import './features.mjs';
|
|
28
30
|
import './codex.mjs';
|
|
29
31
|
import 'ora';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
2
|
import ansis from 'ansis';
|
|
3
3
|
import { ensureI18nInitialized, i18n } from './index.mjs';
|
|
4
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
4
|
+
import { r as resolveCodeType } from '../shared/ccjk.CeE8RLG2.mjs';
|
|
5
5
|
import { checkAndUpdateTools } from './auto-updater.mjs';
|
|
6
6
|
import { d as runCodexUpdate } from './codex.mjs';
|
|
7
7
|
import 'node:fs';
|
|
@@ -9,10 +9,12 @@ import 'node:url';
|
|
|
9
9
|
import 'i18next';
|
|
10
10
|
import 'i18next-fs-backend';
|
|
11
11
|
import 'pathe';
|
|
12
|
+
import './smart-defaults.mjs';
|
|
12
13
|
import 'node:child_process';
|
|
13
14
|
import 'node:os';
|
|
14
15
|
import './platform.mjs';
|
|
15
16
|
import 'tinyexec';
|
|
17
|
+
import '../shared/ccjk.DKojSRzw.mjs';
|
|
16
18
|
import './constants.mjs';
|
|
17
19
|
import './ccjk-config.mjs';
|
|
18
20
|
import 'smol-toml';
|
|
@@ -3,7 +3,7 @@ import { join } from 'pathe';
|
|
|
3
3
|
import { CLAUDE_VSC_CONFIG_FILE, CLAUDE_DIR, ClAUDE_CONFIG_FILE } from './constants.mjs';
|
|
4
4
|
import { ensureI18nInitialized, i18n } from './index.mjs';
|
|
5
5
|
import { readJsonConfig, writeJsonConfig, backupJsonConfig } from './json-config.mjs';
|
|
6
|
-
import { i as isWindows,
|
|
6
|
+
import { i as isWindows, b as getMcpCommand } from './platform.mjs';
|
|
7
7
|
|
|
8
8
|
function mergeArraysUnique(arr1, arr2) {
|
|
9
9
|
const combined = [...arr1 || [], ...arr2 || []];
|
package/dist/chunks/codex.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { updateZcfConfig, readZcfConfig, readDefaultTomlConfig, updateTomlConfig
|
|
|
14
14
|
import { d as applyAiLanguageDirective } from './config.mjs';
|
|
15
15
|
import { exists, readFile, ensureDir, writeFileAtomic, writeFile, copyFile, copyDir } from './fs-operations.mjs';
|
|
16
16
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
17
|
-
import { i as isWindows,
|
|
17
|
+
import { i as isWindows, b as getMcpCommand, g as getSystemRoot, w as wrapCommandWithSudo, n as normalizeTomlPath } from './platform.mjs';
|
|
18
18
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
19
19
|
import { resolveAiOutputLanguage } from './prompts.mjs';
|
|
20
20
|
import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
|
package/dist/chunks/features.mjs
CHANGED
|
@@ -37,7 +37,9 @@ import '../shared/ccjk.Br91zBIG.mjs';
|
|
|
37
37
|
import './auto-updater.mjs';
|
|
38
38
|
import './version-checker.mjs';
|
|
39
39
|
import 'node:path';
|
|
40
|
-
import '../shared/ccjk.
|
|
40
|
+
import '../shared/ccjk.CeE8RLG2.mjs';
|
|
41
|
+
import './smart-defaults.mjs';
|
|
42
|
+
import '../shared/ccjk.DKojSRzw.mjs';
|
|
41
43
|
import '../shared/ccjk.DvIrK0wz.mjs';
|
|
42
44
|
import './installer2.mjs';
|
|
43
45
|
import '../shared/ccjk.DE91nClQ.mjs';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { resolve } from 'pathe';
|
|
3
|
+
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
4
|
+
import 'dayjs';
|
|
5
|
+
import './fs-operations.mjs';
|
|
6
|
+
import 'node:crypto';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
|
|
9
|
+
async function installRecommendedHooks(hookIds) {
|
|
10
|
+
if (!hookIds.length) return 0;
|
|
11
|
+
const templatesPath = resolve(
|
|
12
|
+
import.meta.dirname ?? new URL(".", import.meta.url).pathname,
|
|
13
|
+
"../data/hook-templates.json"
|
|
14
|
+
);
|
|
15
|
+
const raw = await readFile(templatesPath, "utf-8");
|
|
16
|
+
const allTemplates = JSON.parse(raw);
|
|
17
|
+
const selected = allTemplates.filter((t) => hookIds.includes(t.id));
|
|
18
|
+
if (!selected.length) return 0;
|
|
19
|
+
const settings = readJsonConfig("settings") ?? {};
|
|
20
|
+
const hooks = settings.hooks ?? {};
|
|
21
|
+
let added = 0;
|
|
22
|
+
for (const tpl of selected) {
|
|
23
|
+
const event = tpl.event;
|
|
24
|
+
const existing = hooks[event] ?? [];
|
|
25
|
+
const alreadyExists = existing.some((h) => h.command === tpl.command);
|
|
26
|
+
if (alreadyExists) continue;
|
|
27
|
+
const entry = {
|
|
28
|
+
type: "command",
|
|
29
|
+
command: tpl.command
|
|
30
|
+
};
|
|
31
|
+
if (tpl.timeout) {
|
|
32
|
+
entry.timeout = tpl.timeout;
|
|
33
|
+
}
|
|
34
|
+
hooks[event] = [...existing, entry];
|
|
35
|
+
added++;
|
|
36
|
+
}
|
|
37
|
+
if (added > 0) {
|
|
38
|
+
settings.hooks = hooks;
|
|
39
|
+
writeJsonConfig("settings", settings);
|
|
40
|
+
}
|
|
41
|
+
return added;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { installRecommendedHooks };
|
package/dist/chunks/init.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { promisify } from 'node:util';
|
|
|
15
15
|
import { updateCcr } from './auto-updater.mjs';
|
|
16
16
|
import { w as wrapCommandWithSudo, i as isWindows, a as isTermux } from './platform.mjs';
|
|
17
17
|
import { c as addCompletedOnboarding, s as setPrimaryApiKey, b as backupMcpConfig, a as buildMcpServerConfig, r as readMcpConfig, e as replaceMcpServers, f as fixWindowsMcpConfig, w as writeMcpConfig, g as syncMcpPermissions } from './claude-config.mjs';
|
|
18
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
18
|
+
import { r as resolveCodeType } from '../shared/ccjk.CeE8RLG2.mjs';
|
|
19
19
|
import { exists } from './fs-operations.mjs';
|
|
20
20
|
import { readJsonConfig, writeJsonConfig } from './json-config.mjs';
|
|
21
21
|
import { p as promptApiConfigurationAction, e as ensureClaudeDir, g as getExistingApiConfig, s as switchToOfficialLogin, b as backupExistingConfig, a as copyConfigFiles, d as applyAiLanguageDirective, f as configureApi } from './config.mjs';
|
|
@@ -9,7 +9,7 @@ import { exec } from 'tinyexec';
|
|
|
9
9
|
import { ensureI18nInitialized, i18n } from './index.mjs';
|
|
10
10
|
import { updateClaudeCode } from './auto-updater.mjs';
|
|
11
11
|
import { exists } from './fs-operations.mjs';
|
|
12
|
-
import { f as findCommandPath,
|
|
12
|
+
import { f as findCommandPath, d as getPlatform, e as getHomebrewCommandPaths, a as isTermux, h as getTermuxPrefix, j as isWSL, k as getWSLInfo, w as wrapCommandWithSudo, c as commandExists, l as getRecommendedInstallMethods } from './platform.mjs';
|
|
13
13
|
import 'node:url';
|
|
14
14
|
import 'i18next';
|
|
15
15
|
import 'i18next-fs-backend';
|
package/dist/chunks/menu.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { CODE_TOOL_BANNERS, CLAUDE_DIR, isCodeToolType, DEFAULT_CODE_TOOL_TYPE }
|
|
|
7
7
|
import { ensureI18nInitialized, i18n } from './index.mjs';
|
|
8
8
|
import { d as displayBannerWithInfo } from '../shared/ccjk.Br91zBIG.mjs';
|
|
9
9
|
import { updateZcfConfig, readZcfConfig } from './ccjk-config.mjs';
|
|
10
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
10
|
+
import { r as resolveCodeType } from '../shared/ccjk.CeE8RLG2.mjs';
|
|
11
11
|
import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DvIrK0wz.mjs';
|
|
12
12
|
import { changeScriptLanguageFeature, configureMcpFeature, configureEnvPermissionFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureApiFeature } from './features.mjs';
|
|
13
13
|
import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
|
|
@@ -427,9 +427,9 @@ async function showSimplifiedMenu() {
|
|
|
427
427
|
return void 0;
|
|
428
428
|
}
|
|
429
429
|
case "b": {
|
|
430
|
-
const {
|
|
431
|
-
await
|
|
432
|
-
|
|
430
|
+
const { statusCommand } = await import('./status.mjs');
|
|
431
|
+
await statusCommand();
|
|
432
|
+
await inquirer.prompt({ type: "input", name: "_", message: isZh ? "\u6309\u56DE\u8F66\u8FD4\u56DE\u83DC\u5355..." : "Press Enter to return..." });
|
|
433
433
|
return void 0;
|
|
434
434
|
}
|
|
435
435
|
// ------------ CCJK ------------
|
package/dist/chunks/package.mjs
CHANGED
package/dist/chunks/platform.mjs
CHANGED
|
@@ -388,4 +388,4 @@ const platform = {
|
|
|
388
388
|
wrapCommandWithSudo: wrapCommandWithSudo
|
|
389
389
|
};
|
|
390
390
|
|
|
391
|
-
export { isTermux as a,
|
|
391
|
+
export { isTermux as a, getMcpCommand as b, commandExists as c, getPlatform as d, getHomebrewCommandPaths as e, findCommandPath as f, getSystemRoot as g, getTermuxPrefix as h, isWindows as i, isWSL as j, getWSLInfo as k, getRecommendedInstallMethods as l, findRealCommandPath as m, normalizeTomlPath as n, platform as p, shouldUseSudoForGlobalInstall as s, wrapCommandWithSudo as w };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ansis from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { version } from './package.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { detectSmartDefaults } from './smart-defaults.mjs';
|
|
5
5
|
import { i18n } from './index.mjs';
|
|
6
6
|
import { updateZcfConfig } from './ccjk-config.mjs';
|
|
7
7
|
import { i as init } from './init.mjs';
|
|
@@ -12,11 +12,12 @@ import 'pathe';
|
|
|
12
12
|
import './platform.mjs';
|
|
13
13
|
import 'node:process';
|
|
14
14
|
import 'tinyexec';
|
|
15
|
-
import '
|
|
15
|
+
import '../shared/ccjk.DKojSRzw.mjs';
|
|
16
16
|
import 'node:url';
|
|
17
17
|
import 'i18next';
|
|
18
18
|
import 'i18next-fs-backend';
|
|
19
19
|
import 'smol-toml';
|
|
20
|
+
import './constants.mjs';
|
|
20
21
|
import './fs-operations.mjs';
|
|
21
22
|
import 'node:crypto';
|
|
22
23
|
import 'node:fs/promises';
|
|
@@ -38,6 +39,7 @@ import 'node:util';
|
|
|
38
39
|
import './auto-updater.mjs';
|
|
39
40
|
import './version-checker.mjs';
|
|
40
41
|
import 'node:path';
|
|
42
|
+
import '../shared/ccjk.CeE8RLG2.mjs';
|
|
41
43
|
import '../shared/ccjk.DvIrK0wz.mjs';
|
|
42
44
|
import './installer2.mjs';
|
|
43
45
|
import '../shared/ccjk.DE91nClQ.mjs';
|
|
@@ -64,6 +66,9 @@ function displaySuccess(result, defaults) {
|
|
|
64
66
|
console.log(` \u2022 Skills: ${ansis.green(defaults.skills.length)} enabled`);
|
|
65
67
|
console.log(` \u2022 Agents: ${ansis.green(defaults.agents.length)} ready`);
|
|
66
68
|
console.log(` \u2022 Provider: ${ansis.green(defaults.apiProvider || "anthropic")}`);
|
|
69
|
+
if (defaults.recommendedHooks.length > 0) {
|
|
70
|
+
console.log(` \u2022 Hooks: ${ansis.green(defaults.recommendedHooks.join(", "))}`);
|
|
71
|
+
}
|
|
67
72
|
console.log("");
|
|
68
73
|
console.log(ansis.bold.green("\u23F1\uFE0F ") + ansis.white(`Completed in ${result.duration}s`));
|
|
69
74
|
console.log("");
|
|
@@ -264,6 +269,14 @@ async function quickSetup(options = {}) {
|
|
|
264
269
|
result.steps.detection = true;
|
|
265
270
|
console.log(` ${ansis.gray("Platform:")} ${ansis.green(defaults.platform)}`);
|
|
266
271
|
console.log(` ${ansis.gray("Code Tool:")} ${ansis.green(defaults.codeToolType || "claude-code")}`);
|
|
272
|
+
if (defaults.projectContext) {
|
|
273
|
+
const ctx = defaults.projectContext;
|
|
274
|
+
const parts = [ctx.language, ctx.framework !== "none" ? ctx.framework : null, ctx.testRunner !== "none" ? ctx.testRunner : null, ctx.packageManager !== "none" ? ctx.packageManager : null].filter(Boolean);
|
|
275
|
+
console.log(` ${ansis.gray("Project:")} ${ansis.green(parts.join(" + "))}`);
|
|
276
|
+
if (ctx.runtime.isHeadless) console.log(` ${ansis.gray("Runtime:")} ${ansis.yellow("headless server")}`);
|
|
277
|
+
if (ctx.runtime.isContainer) console.log(` ${ansis.gray("Runtime:")} ${ansis.yellow("container")}`);
|
|
278
|
+
if (ctx.runtime.isCI) console.log(` ${ansis.gray("Runtime:")} ${ansis.yellow("CI/CD")}`);
|
|
279
|
+
}
|
|
267
280
|
console.log("");
|
|
268
281
|
displayStep(2, 4, "Configuring API key...");
|
|
269
282
|
let apiKey;
|
|
@@ -362,6 +375,14 @@ async function quickSetup(options = {}) {
|
|
|
362
375
|
}
|
|
363
376
|
result.steps.installation = true;
|
|
364
377
|
result.steps.validation = true;
|
|
378
|
+
try {
|
|
379
|
+
const { installRecommendedHooks } = await import('./hook-installer.mjs');
|
|
380
|
+
const hooksAdded = await installRecommendedHooks(defaults.recommendedHooks);
|
|
381
|
+
if (hooksAdded > 0) {
|
|
382
|
+
console.log(` ${ansis.green("\u2713")} Installed ${ansis.cyan(String(hooksAdded))} recommended hooks`);
|
|
383
|
+
}
|
|
384
|
+
} catch {
|
|
385
|
+
}
|
|
365
386
|
result.duration = Math.round((Date.now() - startTime) / 1e3);
|
|
366
387
|
result.success = true;
|
|
367
388
|
displaySuccess(result, defaults);
|
|
@@ -5,7 +5,7 @@ import { exec } from 'tinyexec';
|
|
|
5
5
|
import { SETTINGS_FILE, CLAUDE_DIR } from './constants.mjs';
|
|
6
6
|
import { ensureDir, writeFileAtomic } from './fs-operations.mjs';
|
|
7
7
|
import { m as mergeAndCleanPermissions } from './config.mjs';
|
|
8
|
-
import {
|
|
8
|
+
import { d as getPlatform } from './platform.mjs';
|
|
9
9
|
import 'node:os';
|
|
10
10
|
import './index.mjs';
|
|
11
11
|
import 'node:process';
|