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
|
@@ -2,20 +2,21 @@ import { execSync } from 'node:child_process';
|
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
4
|
import { join } from 'pathe';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import { d as getPlatform } from './platform.mjs';
|
|
6
|
+
import { s as scanProject } from '../shared/ccjk.DKojSRzw.mjs';
|
|
7
|
+
import 'node:process';
|
|
8
|
+
import 'tinyexec';
|
|
9
9
|
|
|
10
10
|
class SmartDefaultsDetector {
|
|
11
11
|
/**
|
|
12
12
|
* Detect environment and generate smart defaults
|
|
13
13
|
*/
|
|
14
|
-
async detect() {
|
|
14
|
+
async detect(cwd) {
|
|
15
15
|
const platform = getPlatform();
|
|
16
16
|
const apiKey = this.detectApiKey();
|
|
17
17
|
const apiProvider = this.detectApiProvider(apiKey);
|
|
18
18
|
const ccVersion = this.detectClaudeCodeVersion();
|
|
19
|
+
const projectContext = scanProject(cwd);
|
|
19
20
|
return {
|
|
20
21
|
// Environment detection
|
|
21
22
|
platform,
|
|
@@ -23,18 +24,18 @@ class SmartDefaultsDetector {
|
|
|
23
24
|
// API configuration
|
|
24
25
|
apiKey,
|
|
25
26
|
apiProvider,
|
|
26
|
-
// Recommended MCP services based on platform
|
|
27
|
-
mcpServices: this.getRecommendedMcpServices(platform),
|
|
28
|
-
// Essential skills (
|
|
29
|
-
skills: [
|
|
27
|
+
// Recommended MCP services based on platform + project
|
|
28
|
+
mcpServices: this.getRecommendedMcpServices(platform, projectContext),
|
|
29
|
+
// Essential skills — reduced in CI/container (non-interactive)
|
|
30
|
+
skills: projectContext.runtime.isCI || projectContext.runtime.isContainer ? ["ccjk:git-commit"] : [
|
|
30
31
|
"ccjk:git-commit",
|
|
31
32
|
"ccjk:feat",
|
|
32
33
|
"ccjk:workflow",
|
|
33
34
|
"ccjk:init-project",
|
|
34
35
|
"ccjk:git-worktree"
|
|
35
36
|
],
|
|
36
|
-
// Core agents (
|
|
37
|
-
agents: [
|
|
37
|
+
// Core agents — skip in CI/container (non-interactive)
|
|
38
|
+
agents: projectContext.runtime.isCI || projectContext.runtime.isContainer ? [] : [
|
|
38
39
|
"typescript-cli-architect",
|
|
39
40
|
"ccjk-testing-specialist"
|
|
40
41
|
],
|
|
@@ -43,7 +44,7 @@ class SmartDefaultsDetector {
|
|
|
43
44
|
// Workflow preferences
|
|
44
45
|
workflows: {
|
|
45
46
|
outputStyle: "engineer-professional",
|
|
46
|
-
gitWorkflow: "conventional-commits",
|
|
47
|
+
gitWorkflow: projectContext.usesConventionalCommits ? "conventional-commits" : "conventional-commits",
|
|
47
48
|
sixStepWorkflow: true
|
|
48
49
|
},
|
|
49
50
|
// Tool integrations
|
|
@@ -54,7 +55,13 @@ class SmartDefaultsDetector {
|
|
|
54
55
|
},
|
|
55
56
|
// Claude Code native features
|
|
56
57
|
claudeCodeVersion: ccVersion,
|
|
57
|
-
nativeFeatures: this.detectNativeFeatures(ccVersion)
|
|
58
|
+
nativeFeatures: this.detectNativeFeatures(ccVersion),
|
|
59
|
+
// Project context
|
|
60
|
+
projectContext,
|
|
61
|
+
// Recommended hooks based on project toolchain
|
|
62
|
+
recommendedHooks: this.getRecommendedHooks(projectContext),
|
|
63
|
+
// SSH session flag for quick-setup notice
|
|
64
|
+
sshDetected: projectContext.runtime.isSSH || void 0
|
|
58
65
|
};
|
|
59
66
|
}
|
|
60
67
|
/**
|
|
@@ -200,20 +207,67 @@ class SmartDefaultsDetector {
|
|
|
200
207
|
return ccusagePaths.some((path) => existsSync(path));
|
|
201
208
|
}
|
|
202
209
|
/**
|
|
203
|
-
* Get recommended MCP services based on environment
|
|
210
|
+
* Get recommended MCP services based on environment + project context
|
|
204
211
|
*/
|
|
205
|
-
getRecommendedMcpServices(platform) {
|
|
212
|
+
getRecommendedMcpServices(platform, project) {
|
|
213
|
+
const runtime = project?.runtime;
|
|
214
|
+
if (runtime?.isCI) {
|
|
215
|
+
return ["context7", "mcp-deepwiki"];
|
|
216
|
+
}
|
|
217
|
+
if (runtime?.isContainer) {
|
|
218
|
+
return ["context7", "mcp-deepwiki"];
|
|
219
|
+
}
|
|
206
220
|
const core = ["context7", "mcp-deepwiki", "open-websearch"];
|
|
207
|
-
|
|
208
|
-
|
|
221
|
+
const extras = [];
|
|
222
|
+
const hasBrowser = runtime?.hasBrowser ?? (platform === "darwin" || platform === "win32");
|
|
223
|
+
if (hasBrowser) {
|
|
224
|
+
extras.push("Playwright");
|
|
225
|
+
}
|
|
226
|
+
extras.push("sqlite");
|
|
227
|
+
if (project && ["typescript", "java", "csharp"].includes(project.language)) {
|
|
228
|
+
if (!runtime?.isHeadless) {
|
|
229
|
+
extras.push("serena");
|
|
230
|
+
}
|
|
209
231
|
}
|
|
210
|
-
|
|
211
|
-
|
|
232
|
+
return [...core, ...extras];
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Get recommended hook template IDs based on project toolchain
|
|
236
|
+
*/
|
|
237
|
+
getRecommendedHooks(project) {
|
|
238
|
+
const runtime = project.runtime;
|
|
239
|
+
if (runtime.isCI) {
|
|
240
|
+
const hooks2 = [];
|
|
241
|
+
if (project.linter !== "none") hooks2.push("pre-commit-lint-check");
|
|
242
|
+
if (project.testRunner !== "none") hooks2.push("test-before-commit");
|
|
243
|
+
return hooks2;
|
|
212
244
|
}
|
|
213
|
-
if (
|
|
214
|
-
|
|
245
|
+
if (runtime.isContainer) {
|
|
246
|
+
const hooks2 = [];
|
|
247
|
+
if (project.linter !== "none") hooks2.push("pre-commit-lint-check");
|
|
248
|
+
if (project.testRunner !== "none") hooks2.push("test-before-commit");
|
|
249
|
+
return hooks2;
|
|
215
250
|
}
|
|
216
|
-
|
|
251
|
+
const hooks = [];
|
|
252
|
+
if (!runtime.isHeadless) {
|
|
253
|
+
hooks.push("block-dev-server");
|
|
254
|
+
}
|
|
255
|
+
hooks.push("git-push-confirm");
|
|
256
|
+
const jsLangs = ["typescript", "javascript"];
|
|
257
|
+
if (jsLangs.includes(project.language)) {
|
|
258
|
+
hooks.push("warn-console-log");
|
|
259
|
+
}
|
|
260
|
+
hooks.push("block-unwanted-docs");
|
|
261
|
+
if (project.testRunner !== "none") {
|
|
262
|
+
hooks.push("test-before-commit");
|
|
263
|
+
}
|
|
264
|
+
if (project.formatter !== "none") {
|
|
265
|
+
hooks.push("auto-format-on-save");
|
|
266
|
+
}
|
|
267
|
+
if (project.linter !== "none") {
|
|
268
|
+
hooks.push("pre-commit-lint-check");
|
|
269
|
+
}
|
|
270
|
+
return hooks;
|
|
217
271
|
}
|
|
218
272
|
/**
|
|
219
273
|
* Get recommended skills based on user type
|
|
@@ -273,60 +327,4 @@ function detectCodeToolType() {
|
|
|
273
327
|
return SmartDefaultsDetector.detectCodeToolType();
|
|
274
328
|
}
|
|
275
329
|
|
|
276
|
-
|
|
277
|
-
cc: "claude-code",
|
|
278
|
-
cx: "codex"
|
|
279
|
-
};
|
|
280
|
-
async function resolveCodeType(codeTypeParam) {
|
|
281
|
-
if (codeTypeParam) {
|
|
282
|
-
const normalizedParam = codeTypeParam.toLowerCase().trim();
|
|
283
|
-
if (normalizedParam in CODE_TYPE_ABBREVIATIONS) {
|
|
284
|
-
return CODE_TYPE_ABBREVIATIONS[normalizedParam];
|
|
285
|
-
}
|
|
286
|
-
if (isValidCodeType(normalizedParam)) {
|
|
287
|
-
return normalizedParam;
|
|
288
|
-
}
|
|
289
|
-
const validAbbreviations = Object.keys(CODE_TYPE_ABBREVIATIONS);
|
|
290
|
-
const validFullTypes = Object.values(CODE_TYPE_ABBREVIATIONS);
|
|
291
|
-
const validOptions = [...validAbbreviations, ...validFullTypes].join(", ");
|
|
292
|
-
let defaultValue = DEFAULT_CODE_TOOL_TYPE;
|
|
293
|
-
try {
|
|
294
|
-
const config = await readZcfConfigAsync();
|
|
295
|
-
if (config?.codeToolType && isValidCodeType(config.codeToolType)) {
|
|
296
|
-
defaultValue = config.codeToolType;
|
|
297
|
-
}
|
|
298
|
-
} catch {
|
|
299
|
-
}
|
|
300
|
-
throw new Error(
|
|
301
|
-
i18n.t("errors:invalidCodeType", { value: codeTypeParam, validOptions, defaultValue })
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
try {
|
|
305
|
-
const freshDetected = detectCodeToolType();
|
|
306
|
-
if (isValidCodeType(freshDetected)) {
|
|
307
|
-
try {
|
|
308
|
-
const config = await readZcfConfigAsync();
|
|
309
|
-
if (config && config.codeToolType !== freshDetected) {
|
|
310
|
-
config.codeToolType = freshDetected;
|
|
311
|
-
await saveZcfConfig(config);
|
|
312
|
-
}
|
|
313
|
-
} catch {
|
|
314
|
-
}
|
|
315
|
-
return freshDetected;
|
|
316
|
-
}
|
|
317
|
-
} catch {
|
|
318
|
-
}
|
|
319
|
-
try {
|
|
320
|
-
const config = await readZcfConfigAsync();
|
|
321
|
-
if (config?.codeToolType && isValidCodeType(config.codeToolType)) {
|
|
322
|
-
return config.codeToolType;
|
|
323
|
-
}
|
|
324
|
-
} catch {
|
|
325
|
-
}
|
|
326
|
-
return DEFAULT_CODE_TOOL_TYPE;
|
|
327
|
-
}
|
|
328
|
-
function isValidCodeType(value) {
|
|
329
|
-
return ["claude-code", "codex"].includes(value);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export { detectSmartDefaults as d, resolveCodeType as r };
|
|
330
|
+
export { SmartDefaultsDetector, detectCodeToolType, detectSmartDefaults };
|
package/dist/chunks/status.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import process__default from 'node:process';
|
|
1
4
|
import ansis from 'ansis';
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
5
|
+
import { join } from 'pathe';
|
|
6
|
+
import { s as scanProject } from '../shared/ccjk.DKojSRzw.mjs';
|
|
7
|
+
import { r as runHealthCheck } from '../shared/ccjk.Bndhan7G.mjs';
|
|
8
|
+
import 'node:child_process';
|
|
6
9
|
import './constants.mjs';
|
|
7
|
-
import 'node:os';
|
|
8
10
|
import './index.mjs';
|
|
9
11
|
import 'node:url';
|
|
10
12
|
import 'i18next';
|
|
@@ -23,18 +25,19 @@ const STATUS_ICONS = {
|
|
|
23
25
|
warn: ansis.yellow("\u26A0"),
|
|
24
26
|
fail: ansis.red("\u2717")
|
|
25
27
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
const INSTALLED = ansis.green("\u2713");
|
|
29
|
+
const MISSING = ansis.gray("\u2212");
|
|
30
|
+
function label(text) {
|
|
31
|
+
return ansis.gray(text);
|
|
28
32
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return [top, ...lines.map(pad), bot].join("\n");
|
|
33
|
+
function val(text) {
|
|
34
|
+
return ansis.white(text);
|
|
35
|
+
}
|
|
36
|
+
function heading(text) {
|
|
37
|
+
return ansis.cyan.bold(text);
|
|
38
|
+
}
|
|
39
|
+
function divider() {
|
|
40
|
+
return ansis.gray("\u2500".repeat(44));
|
|
38
41
|
}
|
|
39
42
|
function renderScoreBar(score) {
|
|
40
43
|
const filled = Math.round(score / 5);
|
|
@@ -48,112 +51,211 @@ function renderScoreBar(score) {
|
|
|
48
51
|
bar += ansis.gray("\u2591".repeat(empty));
|
|
49
52
|
return bar;
|
|
50
53
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
54
|
+
function loadInstalledSettings() {
|
|
55
|
+
const settingsPath = join(homedir(), ".claude", "settings.json");
|
|
56
|
+
try {
|
|
57
|
+
if (!existsSync(settingsPath)) return { mcpServers: {}, hooks: {} };
|
|
58
|
+
const data = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
59
|
+
return {
|
|
60
|
+
mcpServers: data.mcpServers || {},
|
|
61
|
+
hooks: data.hooks || {}
|
|
62
|
+
};
|
|
63
|
+
} catch {
|
|
64
|
+
return { mcpServers: {}, hooks: {} };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function loadSmartDefaults() {
|
|
68
|
+
try {
|
|
69
|
+
const { detectSmartDefaults } = await import('./smart-defaults.mjs');
|
|
70
|
+
return await detectSmartDefaults();
|
|
71
|
+
} catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function renderProjectSection(ctx) {
|
|
53
76
|
const lines = [];
|
|
54
|
-
lines.push("");
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
77
|
+
lines.push(heading("Project"));
|
|
78
|
+
const fields = [
|
|
79
|
+
["Language", ctx.language],
|
|
80
|
+
["Framework", ctx.framework],
|
|
81
|
+
["Test Runner", ctx.testRunner],
|
|
82
|
+
["Pkg Manager", ctx.packageManager],
|
|
83
|
+
["Linter", ctx.linter],
|
|
84
|
+
["Formatter", ctx.formatter],
|
|
85
|
+
["Database", ctx.database === "none" ? "none" : ctx.database]
|
|
86
|
+
];
|
|
87
|
+
for (const [k, v] of fields) {
|
|
88
|
+
const display = v === "none" || v === "unknown" ? ansis.gray(v) : val(v);
|
|
89
|
+
lines.push(` ${label(`${k}:`.padEnd(14))} ${display}`);
|
|
90
|
+
}
|
|
91
|
+
const flags = [];
|
|
92
|
+
if (ctx.isMonorepo) flags.push("monorepo");
|
|
93
|
+
if (ctx.hasDocker) flags.push("docker");
|
|
94
|
+
if (ctx.hasCI) flags.push("CI");
|
|
95
|
+
if (ctx.hasGitHooks) flags.push("git-hooks");
|
|
96
|
+
if (ctx.usesConventionalCommits) flags.push("conventional-commits");
|
|
97
|
+
if (flags.length > 0) {
|
|
98
|
+
lines.push(` ${label("Flags:".padEnd(14))} ${val(flags.join(", "))}`);
|
|
66
99
|
}
|
|
67
100
|
return lines;
|
|
68
101
|
}
|
|
69
|
-
function
|
|
102
|
+
function renderRuntimeSection(ctx) {
|
|
70
103
|
const lines = [];
|
|
71
|
-
lines.push("");
|
|
72
|
-
|
|
73
|
-
lines.push("");
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
104
|
+
lines.push(heading("Runtime"));
|
|
105
|
+
const rt = ctx.runtime;
|
|
106
|
+
lines.push(` ${label("Platform:".padEnd(14))} ${val(process__default.platform)} ${ansis.gray(`(${process__default.arch})`)}`);
|
|
107
|
+
const envFlags = [];
|
|
108
|
+
if (rt.isContainer) envFlags.push("container");
|
|
109
|
+
if (rt.isHeadless) envFlags.push("headless");
|
|
110
|
+
if (rt.isSSH) envFlags.push("SSH");
|
|
111
|
+
if (rt.isCI) envFlags.push("CI");
|
|
112
|
+
if (rt.isWSL) envFlags.push("WSL");
|
|
113
|
+
if (envFlags.length > 0) {
|
|
114
|
+
lines.push(` ${label("Environment:".padEnd(14))} ${val(envFlags.join(", "))}`);
|
|
115
|
+
} else {
|
|
116
|
+
lines.push(` ${label("Environment:".padEnd(14))} ${ansis.gray("standard")}`);
|
|
79
117
|
}
|
|
118
|
+
lines.push(` ${label("Browser:".padEnd(14))} ${rt.hasBrowser ? ansis.green("available") : ansis.gray("unavailable")}`);
|
|
80
119
|
return lines;
|
|
81
120
|
}
|
|
82
|
-
function
|
|
83
|
-
if (recs.length === 0)
|
|
84
|
-
return [];
|
|
121
|
+
function renderMcpSection(recommended, installed) {
|
|
85
122
|
const lines = [];
|
|
86
|
-
lines.push("");
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
lines.push(`${icon} ${rec.description}`);
|
|
92
|
-
if (rec.command) {
|
|
93
|
-
lines.push(` ${ansis.cyan(rec.command)}`);
|
|
94
|
-
}
|
|
123
|
+
lines.push(heading("MCP Services"));
|
|
124
|
+
const installedNames = Object.keys(installed);
|
|
125
|
+
if (recommended.length === 0 && installedNames.length === 0) {
|
|
126
|
+
lines.push(` ${ansis.gray("No MCP services detected")}`);
|
|
127
|
+
return lines;
|
|
95
128
|
}
|
|
96
|
-
|
|
97
|
-
|
|
129
|
+
const shown = /* @__PURE__ */ new Set();
|
|
130
|
+
for (const svc of recommended) {
|
|
131
|
+
const isInstalled = installedNames.some(
|
|
132
|
+
(name) => name.toLowerCase().includes(svc.toLowerCase()) || svc.toLowerCase().includes(name.toLowerCase())
|
|
133
|
+
);
|
|
134
|
+
const icon = isInstalled ? INSTALLED : MISSING;
|
|
135
|
+
lines.push(` ${icon} ${isInstalled ? val(svc) : ansis.gray(svc)}`);
|
|
136
|
+
shown.add(svc.toLowerCase());
|
|
137
|
+
}
|
|
138
|
+
for (const name of installedNames) {
|
|
139
|
+
if (!shown.has(name.toLowerCase()) && !recommended.some((r) => r.toLowerCase() === name.toLowerCase())) {
|
|
140
|
+
lines.push(` ${INSTALLED} ${val(name)} ${ansis.gray("(extra)")}`);
|
|
141
|
+
}
|
|
98
142
|
}
|
|
99
143
|
return lines;
|
|
100
144
|
}
|
|
101
|
-
function
|
|
102
|
-
const { skills, mcpServices } = getRecommendations(profile);
|
|
103
|
-
if (skills.length === 0 && mcpServices.length === 0)
|
|
104
|
-
return [];
|
|
145
|
+
function renderHooksSection(recommended, installed) {
|
|
105
146
|
const lines = [];
|
|
106
|
-
lines.push("");
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (
|
|
110
|
-
lines.push(
|
|
111
|
-
|
|
112
|
-
|
|
147
|
+
lines.push(heading("Hooks"));
|
|
148
|
+
const installedEvents = Object.keys(installed);
|
|
149
|
+
const hasAnyHooks = installedEvents.length > 0;
|
|
150
|
+
if (recommended.length === 0 && !hasAnyHooks) {
|
|
151
|
+
lines.push(` ${ansis.gray("No hooks detected")}`);
|
|
152
|
+
return lines;
|
|
153
|
+
}
|
|
154
|
+
for (const hookId of recommended) {
|
|
155
|
+
const isInstalled = hasAnyHooks;
|
|
156
|
+
const icon = isInstalled ? INSTALLED : MISSING;
|
|
157
|
+
lines.push(` ${icon} ${isInstalled ? val(hookId) : ansis.gray(hookId)}`);
|
|
158
|
+
}
|
|
159
|
+
if (hasAnyHooks) {
|
|
160
|
+
const totalHookCount = installedEvents.reduce((sum, event) => {
|
|
161
|
+
const eventHooks = installed[event];
|
|
162
|
+
return sum + (Array.isArray(eventHooks) ? eventHooks.length : 0);
|
|
163
|
+
}, 0);
|
|
164
|
+
if (totalHookCount > 0) {
|
|
165
|
+
lines.push(` ${ansis.gray(`${totalHookCount} hook(s) across ${installedEvents.length} event(s)`)}`);
|
|
113
166
|
}
|
|
114
|
-
lines.push(` ${ansis.cyan("ccjk ccjk:skills --dry-run")}`);
|
|
115
167
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
168
|
+
return lines;
|
|
169
|
+
}
|
|
170
|
+
function renderClaudeCodeSection(defaults) {
|
|
171
|
+
const lines = [];
|
|
172
|
+
lines.push(heading("Claude Code"));
|
|
173
|
+
const version = defaults?.claudeCodeVersion;
|
|
174
|
+
lines.push(` ${label("Version:".padEnd(14))} ${version ? val(version) : ansis.gray("not detected")}`);
|
|
175
|
+
if (defaults?.nativeFeatures) {
|
|
176
|
+
const nf = defaults.nativeFeatures;
|
|
177
|
+
const features = [];
|
|
178
|
+
if (nf.hooks) features.push("hooks");
|
|
179
|
+
if (nf.memory) features.push("memory");
|
|
180
|
+
if (nf.subagents) features.push("subagents");
|
|
181
|
+
if (nf.toolSearch) features.push("tool-search");
|
|
182
|
+
if (features.length > 0) {
|
|
183
|
+
lines.push(` ${label("Features:".padEnd(14))} ${val(features.join(", "))}`);
|
|
184
|
+
}
|
|
119
185
|
}
|
|
120
186
|
return lines;
|
|
121
187
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
188
|
+
function renderHealthSection(report, compact) {
|
|
189
|
+
const lines = [];
|
|
190
|
+
lines.push(heading("Brain Dashboard"));
|
|
191
|
+
const gradeColor = GRADE_COLORS[report.grade] || ((s) => s);
|
|
192
|
+
const scoreBar = renderScoreBar(report.totalScore);
|
|
193
|
+
lines.push(` ${label("Score:".padEnd(14))} ${scoreBar} ${gradeColor(report.grade)} ${ansis.gray(`(${report.totalScore}/100)`)}`);
|
|
194
|
+
if (!compact) {
|
|
195
|
+
lines.push("");
|
|
196
|
+
for (const r of report.results) {
|
|
197
|
+
const icon = STATUS_ICONS[r.status];
|
|
198
|
+
const scoreText = ansis.gray(`${r.score}/${r.weight}`);
|
|
199
|
+
lines.push(` ${icon} ${r.name.padEnd(18)} ${scoreText.padEnd(10)} ${ansis.gray(r.message)}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (report.recommendations.length > 0) {
|
|
203
|
+
lines.push("");
|
|
204
|
+
lines.push(ansis.yellow.bold(" Recommendations:"));
|
|
205
|
+
for (const rec of report.recommendations.slice(0, 3)) {
|
|
206
|
+
const priority = rec.priority === "high" ? ansis.red("!") : rec.priority === "medium" ? ansis.yellow("\u2022") : ansis.gray("\xB7");
|
|
207
|
+
lines.push(` ${priority} ${rec.title}`);
|
|
208
|
+
if (rec.command) {
|
|
209
|
+
lines.push(` ${ansis.gray("\u2192")} ${ansis.cyan(rec.command)}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return lines;
|
|
132
214
|
}
|
|
133
|
-
async function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
215
|
+
async function statusCommand(options = {}) {
|
|
216
|
+
try {
|
|
217
|
+
const [ctx, defaults, installed, health] = await Promise.all([
|
|
218
|
+
scanProject(),
|
|
219
|
+
loadSmartDefaults(),
|
|
220
|
+
Promise.resolve(loadInstalledSettings()),
|
|
221
|
+
runHealthCheck()
|
|
222
|
+
]);
|
|
223
|
+
if (options.json) {
|
|
224
|
+
console.log(JSON.stringify({
|
|
225
|
+
project: ctx,
|
|
226
|
+
smartDefaults: defaults,
|
|
227
|
+
installed,
|
|
228
|
+
health
|
|
229
|
+
}, null, 2));
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const sections = [];
|
|
233
|
+
sections.push(renderProjectSection(ctx));
|
|
234
|
+
sections.push(renderRuntimeSection(ctx));
|
|
235
|
+
if (defaults) {
|
|
236
|
+
sections.push(renderMcpSection(defaults.mcpServices, installed.mcpServers));
|
|
237
|
+
sections.push(renderHooksSection(defaults.recommendedHooks, installed.hooks));
|
|
238
|
+
sections.push(renderClaudeCodeSection(defaults));
|
|
239
|
+
} else {
|
|
240
|
+
sections.push(renderMcpSection([], installed.mcpServers));
|
|
241
|
+
sections.push(renderHooksSection([], installed.hooks));
|
|
242
|
+
sections.push(renderClaudeCodeSection(null));
|
|
243
|
+
}
|
|
244
|
+
sections.push(renderHealthSection(health, options.compact || false));
|
|
245
|
+
console.log();
|
|
246
|
+
for (let i = 0; i < sections.length; i++) {
|
|
247
|
+
console.log(sections[i].join("\n"));
|
|
248
|
+
if (i < sections.length - 1) {
|
|
249
|
+
console.log();
|
|
250
|
+
console.log(divider());
|
|
251
|
+
console.log();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
console.log();
|
|
255
|
+
} catch (error) {
|
|
256
|
+
console.error(ansis.red("Error running status command:"), error);
|
|
257
|
+
process__default.exit(1);
|
|
147
258
|
}
|
|
148
|
-
const allLines = [
|
|
149
|
-
...renderHeader(report, profile),
|
|
150
|
-
...renderSetupStatus(report.results),
|
|
151
|
-
...renderRecommendations(report.recommendations),
|
|
152
|
-
...renderProjectRecs(profile),
|
|
153
|
-
...renderQuickActions(),
|
|
154
|
-
""
|
|
155
|
-
];
|
|
156
|
-
console.log(renderBox(allLines));
|
|
157
259
|
}
|
|
158
260
|
|
|
159
|
-
export {
|
|
261
|
+
export { statusCommand };
|
|
@@ -3,7 +3,7 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import { ZCF_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, isCodeToolType } from './constants.mjs';
|
|
4
4
|
import { i18n, ensureI18nInitialized } from './index.mjs';
|
|
5
5
|
import { readZcfConfig } from './ccjk-config.mjs';
|
|
6
|
-
import { r as resolveCodeType } from '../shared/ccjk.
|
|
6
|
+
import { r as resolveCodeType } from '../shared/ccjk.CeE8RLG2.mjs';
|
|
7
7
|
import { h as handleExitPromptError, a as handleGeneralError } from '../shared/ccjk.DvIrK0wz.mjs';
|
|
8
8
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
9
9
|
import { p as promptBoolean } from '../shared/ccjk.DHbrGcgg.mjs';
|
|
@@ -21,8 +21,10 @@ import 'smol-toml';
|
|
|
21
21
|
import './fs-operations.mjs';
|
|
22
22
|
import 'node:crypto';
|
|
23
23
|
import 'node:fs/promises';
|
|
24
|
+
import './smart-defaults.mjs';
|
|
24
25
|
import 'node:child_process';
|
|
25
26
|
import './platform.mjs';
|
|
27
|
+
import '../shared/ccjk.DKojSRzw.mjs';
|
|
26
28
|
import 'inquirer-toggle';
|
|
27
29
|
import 'dayjs';
|
|
28
30
|
import 'trash';
|
|
@@ -4,7 +4,7 @@ import * as path from 'node:path';
|
|
|
4
4
|
import process__default from 'node:process';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import * as semver from 'semver';
|
|
7
|
-
import {
|
|
7
|
+
import { d as getPlatform, f as findCommandPath, e as getHomebrewCommandPaths } from './platform.mjs';
|
|
8
8
|
import 'node:os';
|
|
9
9
|
import 'pathe';
|
|
10
10
|
import 'tinyexec';
|
package/dist/cli.mjs
CHANGED
|
@@ -1258,9 +1258,9 @@ ${ansis.yellow("By Status:")}`);
|
|
|
1258
1258
|
{ flags: "--compact", description: "Compact output" }
|
|
1259
1259
|
],
|
|
1260
1260
|
loader: async () => {
|
|
1261
|
-
const {
|
|
1261
|
+
const { statusCommand } = await import('./chunks/status.mjs');
|
|
1262
1262
|
return async (options) => {
|
|
1263
|
-
await
|
|
1263
|
+
await statusCommand({
|
|
1264
1264
|
json: options.json,
|
|
1265
1265
|
compact: options.compact
|
|
1266
1266
|
});
|