ccjk 2.6.1 → 2.6.2

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.
@@ -47,14 +47,20 @@ function generateHookScript(shellType) {
47
47
  return `
48
48
  # CCJK Context Compression Hook - DO NOT EDIT THIS BLOCK
49
49
  # This hook enables transparent context compression for claude commands
50
- # Native slash commands (/plugin, /doctor, etc.) are passed through directly
50
+ # Native slash commands are handled by CCJK plugin system
51
51
  claude() {
52
52
  # Find the real claude command path (bypass this function)
53
53
  local real_claude
54
54
  real_claude=$(command -v claude 2>/dev/null)
55
55
 
56
- # If first arg starts with '/', it's a native slash command - pass through directly
57
- # Examples: /plugin, /doctor, /config, /permissions, /allowed-tools, etc.
56
+ # Handle /plugin command - use CCJK's plugin marketplace
57
+ if [[ "$1" == "/plugin" ]]; then
58
+ shift # Remove /plugin
59
+ ${ccjkPath} plugin "$@"
60
+ return $?
61
+ fi
62
+
63
+ # Other native slash commands (/doctor, /config, etc.) - pass through directly
58
64
  if [[ "$1" == /* ]]; then
59
65
  "$real_claude" "$@"
60
66
  return $?
@@ -78,12 +84,19 @@ claude() {
78
84
  return `
79
85
  # CCJK Context Compression Hook - DO NOT EDIT THIS BLOCK
80
86
  # This hook enables transparent context compression for claude commands
81
- # Native slash commands (/plugin, /doctor, etc.) are passed through directly
87
+ # Native slash commands are handled by CCJK plugin system
82
88
  function claude
83
89
  # Find the real claude command path
84
90
  set real_claude (command -v claude 2>/dev/null)
85
91
 
86
- # If first arg starts with '/', it's a native slash command - pass through directly
92
+ # Handle /plugin command - use CCJK's plugin marketplace
93
+ if test "$argv[1]" = "/plugin"
94
+ set -e argv[1] # Remove /plugin
95
+ ${ccjkPath} plugin $argv
96
+ return $status
97
+ end
98
+
99
+ # Other native slash commands (/doctor, /config, etc.) - pass through directly
87
100
  if string match -q '/*' -- $argv[1]
88
101
  $real_claude $argv
89
102
  return $status
@@ -20,6 +20,7 @@ import { join } from 'pathe';
20
20
  import { i18n, ensureI18nInitialized } from './index2.mjs';
21
21
  import { writeFileAtomic } from './fs-operations.mjs';
22
22
  import '../shared/ccjk.B-lZxV2u.mjs';
23
+ import '../shared/ccjk.B2Aos9HI.mjs';
23
24
  import { r as readCodexConfig, b as backupCodexComplete, w as writeCodexConfig, a as writeAuthFile, d as detectConfigManagementMode } from './codex.mjs';
24
25
  import inquirer from 'inquirer';
25
26
  import { readJsonConfig } from './json-config.mjs';
@@ -6,336 +6,17 @@ import inquirer from 'inquirer';
6
6
  import ora from 'ora';
7
7
  import { join, basename } from 'pathe';
8
8
  import { CCJK_CONFIG_DIR } from './constants.mjs';
9
+ import { h as detectProject, j as getProjectSummary, i as generateSuggestions } from '../shared/ccjk.B2Aos9HI.mjs';
9
10
  import { b as boxify, C as COLORS, S as STATUS } from '../shared/ccjk.BhKlRJ0h.mjs';
10
11
  import { writeFileAtomic } from './fs-operations.mjs';
11
-
12
- function readPackageJson(dir) {
13
- const pkgPath = join(dir, "package.json");
14
- if (!existsSync(pkgPath))
15
- return null;
16
- try {
17
- return JSON.parse(readFileSync(pkgPath, "utf-8"));
18
- } catch {
19
- return null;
20
- }
21
- }
22
- function detectPackageManager(dir) {
23
- if (existsSync(join(dir, "bun.lockb")))
24
- return "bun";
25
- if (existsSync(join(dir, "pnpm-lock.yaml")))
26
- return "pnpm";
27
- if (existsSync(join(dir, "yarn.lock")))
28
- return "yarn";
29
- if (existsSync(join(dir, "package-lock.json")))
30
- return "npm";
31
- const pkg = readPackageJson(dir);
32
- if (pkg?.packageManager) {
33
- if (pkg.packageManager.startsWith("pnpm"))
34
- return "pnpm";
35
- if (pkg.packageManager.startsWith("yarn"))
36
- return "yarn";
37
- if (pkg.packageManager.startsWith("bun"))
38
- return "bun";
39
- }
40
- return "unknown";
41
- }
42
- function detectFrameworks(dir) {
43
- const frameworks = [];
44
- const pkg = readPackageJson(dir);
45
- if (!pkg)
46
- return frameworks;
47
- const allDeps = {
48
- ...pkg.dependencies,
49
- ...pkg.devDependencies
50
- };
51
- if (allDeps.react)
52
- frameworks.push("react");
53
- if (allDeps.vue)
54
- frameworks.push("vue");
55
- if (allDeps["@angular/core"])
56
- frameworks.push("angular");
57
- if (allDeps.svelte)
58
- frameworks.push("svelte");
59
- if (allDeps.next)
60
- frameworks.push("nextjs");
61
- if (allDeps.nuxt)
62
- frameworks.push("nuxt");
63
- if (allDeps["@remix-run/react"])
64
- frameworks.push("remix");
65
- if (allDeps.astro)
66
- frameworks.push("astro");
67
- if (allDeps.express)
68
- frameworks.push("express");
69
- if (allDeps.fastify)
70
- frameworks.push("fastify");
71
- if (allDeps["@nestjs/core"])
72
- frameworks.push("nestjs");
73
- if (allDeps.koa)
74
- frameworks.push("koa");
75
- if (allDeps.hono)
76
- frameworks.push("hono");
77
- if (allDeps.electron)
78
- frameworks.push("electron");
79
- if (allDeps["@tauri-apps/api"])
80
- frameworks.push("tauri");
81
- if (allDeps["react-native"])
82
- frameworks.push("react-native");
83
- if (existsSync(join(dir, "requirements.txt")) || existsSync(join(dir, "pyproject.toml"))) {
84
- const reqPath = join(dir, "requirements.txt");
85
- if (existsSync(reqPath)) {
86
- const reqs = readFileSync(reqPath, "utf-8").toLowerCase();
87
- if (reqs.includes("django"))
88
- frameworks.push("django");
89
- if (reqs.includes("flask"))
90
- frameworks.push("flask");
91
- if (reqs.includes("fastapi"))
92
- frameworks.push("fastapi");
93
- }
94
- }
95
- if (existsSync(join(dir, "Gemfile"))) {
96
- const gemfile = readFileSync(join(dir, "Gemfile"), "utf-8").toLowerCase();
97
- if (gemfile.includes("rails"))
98
- frameworks.push("rails");
99
- }
100
- if (existsSync(join(dir, "composer.json"))) {
101
- try {
102
- const composer = JSON.parse(readFileSync(join(dir, "composer.json"), "utf-8"));
103
- if (composer.require?.["laravel/framework"])
104
- frameworks.push("laravel");
105
- } catch {
106
- }
107
- }
108
- return frameworks;
109
- }
110
- function detectBuildTools(dir) {
111
- const tools = [];
112
- const pkg = readPackageJson(dir);
113
- if (existsSync(join(dir, "vite.config.ts")) || existsSync(join(dir, "vite.config.js")))
114
- tools.push("vite");
115
- if (existsSync(join(dir, "webpack.config.js")) || existsSync(join(dir, "webpack.config.ts")))
116
- tools.push("webpack");
117
- if (existsSync(join(dir, "rollup.config.js")) || existsSync(join(dir, "rollup.config.ts")))
118
- tools.push("rollup");
119
- if (existsSync(join(dir, "tsup.config.ts")) || existsSync(join(dir, "tsup.config.js")))
120
- tools.push("tsup");
121
- if (pkg) {
122
- const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
123
- if (allDeps.esbuild)
124
- tools.push("esbuild");
125
- if (allDeps["@swc/core"])
126
- tools.push("swc");
127
- if (allDeps.turbo)
128
- tools.push("turbopack");
129
- if (allDeps.parcel)
130
- tools.push("parcel");
131
- if (allDeps.unbuild)
132
- tools.push("unbuild");
133
- }
134
- return tools;
135
- }
136
- function detectTestFrameworks(dir) {
137
- const frameworks = [];
138
- const pkg = readPackageJson(dir);
139
- if (existsSync(join(dir, "vitest.config.ts")) || existsSync(join(dir, "vitest.config.js")))
140
- frameworks.push("vitest");
141
- if (existsSync(join(dir, "jest.config.js")) || existsSync(join(dir, "jest.config.ts")))
142
- frameworks.push("jest");
143
- if (existsSync(join(dir, "cypress.config.ts")) || existsSync(join(dir, "cypress.config.js")))
144
- frameworks.push("cypress");
145
- if (existsSync(join(dir, "playwright.config.ts")))
146
- frameworks.push("playwright");
147
- if (existsSync(join(dir, "pytest.ini")) || existsSync(join(dir, "conftest.py")))
148
- frameworks.push("pytest");
149
- if (pkg) {
150
- const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
151
- if (allDeps.vitest && !frameworks.includes("vitest"))
152
- frameworks.push("vitest");
153
- if (allDeps.jest && !frameworks.includes("jest"))
154
- frameworks.push("jest");
155
- if (allDeps.mocha)
156
- frameworks.push("mocha");
157
- if (allDeps.cypress && !frameworks.includes("cypress"))
158
- frameworks.push("cypress");
159
- if (allDeps["@playwright/test"] && !frameworks.includes("playwright"))
160
- frameworks.push("playwright");
161
- }
162
- return frameworks;
163
- }
164
- function detectCICDSystems(dir) {
165
- const systems = [];
166
- if (existsSync(join(dir, ".github", "workflows")))
167
- systems.push("github-actions");
168
- if (existsSync(join(dir, ".gitlab-ci.yml")))
169
- systems.push("gitlab-ci");
170
- if (existsSync(join(dir, "Jenkinsfile")))
171
- systems.push("jenkins");
172
- if (existsSync(join(dir, ".circleci")))
173
- systems.push("circleci");
174
- if (existsSync(join(dir, ".travis.yml")))
175
- systems.push("travis");
176
- if (existsSync(join(dir, "azure-pipelines.yml")))
177
- systems.push("azure-pipelines");
178
- return systems;
179
- }
180
- function detectLanguages(dir) {
181
- const languages = [];
182
- if (existsSync(join(dir, "tsconfig.json")))
183
- languages.push("typescript");
184
- if (existsSync(join(dir, "package.json"))) {
185
- if (!languages.includes("typescript"))
186
- languages.push("javascript");
187
- }
188
- if (existsSync(join(dir, "requirements.txt")) || existsSync(join(dir, "pyproject.toml")) || existsSync(join(dir, "setup.py")))
189
- languages.push("python");
190
- if (existsSync(join(dir, "Gemfile")))
191
- languages.push("ruby");
192
- if (existsSync(join(dir, "go.mod")))
193
- languages.push("go");
194
- if (existsSync(join(dir, "Cargo.toml")))
195
- languages.push("rust");
196
- if (existsSync(join(dir, "pom.xml")) || existsSync(join(dir, "build.gradle"))) {
197
- languages.push("java");
198
- if (existsSync(join(dir, "build.gradle.kts")))
199
- languages.push("kotlin");
200
- }
201
- if (existsSync(join(dir, "composer.json")))
202
- languages.push("php");
203
- if (existsSync(join(dir, "Package.swift")))
204
- languages.push("swift");
205
- if (existsSync(join(dir, "pubspec.yaml")))
206
- languages.push("dart");
207
- return languages;
208
- }
209
- function determineProjectType(info) {
210
- const frameworks = info.frameworks || [];
211
- if (frameworks.includes("react-native") || frameworks.includes("flutter"))
212
- return "mobile";
213
- if (frameworks.includes("electron") || frameworks.includes("tauri"))
214
- return "desktop";
215
- const pkg = info.rootDir ? readPackageJson(info.rootDir) : null;
216
- if (pkg?.bin)
217
- return "cli";
218
- if (pkg?.main || pkg?.exports) {
219
- const hasAppFramework = frameworks.some(
220
- (f) => ["react", "vue", "angular", "svelte", "nextjs", "nuxt", "express", "fastify", "nestjs"].includes(f)
221
- );
222
- if (!hasAppFramework)
223
- return "library";
224
- }
225
- const frontendFrameworks = ["react", "vue", "angular", "svelte"];
226
- const backendFrameworks = ["express", "fastify", "nestjs", "koa", "hono", "django", "flask", "fastapi", "rails", "laravel"];
227
- const metaFrameworks = ["nextjs", "nuxt", "remix", "astro"];
228
- const hasFrontend = frameworks.some((f) => frontendFrameworks.includes(f));
229
- const hasBackend = frameworks.some((f) => backendFrameworks.includes(f));
230
- const hasMeta = frameworks.some((f) => metaFrameworks.includes(f));
231
- if (hasMeta)
232
- return "fullstack";
233
- if (hasFrontend && hasBackend)
234
- return "fullstack";
235
- if (hasFrontend)
236
- return "frontend";
237
- if (hasBackend)
238
- return "backend";
239
- return "unknown";
240
- }
241
- function detectProject(dir = process__default.cwd()) {
242
- const pkg = readPackageJson(dir);
243
- const frameworks = detectFrameworks(dir);
244
- const languages = detectLanguages(dir);
245
- const info = {
246
- name: pkg?.name || "unknown",
247
- type: "unknown",
248
- packageManager: detectPackageManager(dir),
249
- frameworks,
250
- buildTools: detectBuildTools(dir),
251
- testFrameworks: detectTestFrameworks(dir),
252
- cicd: detectCICDSystems(dir),
253
- languages,
254
- hasTypeScript: existsSync(join(dir, "tsconfig.json")),
255
- hasDocker: existsSync(join(dir, "Dockerfile")) || existsSync(join(dir, "docker-compose.yml")),
256
- hasMonorepo: existsSync(join(dir, "pnpm-workspace.yaml")) || existsSync(join(dir, "lerna.json")) || pkg?.workspaces != null,
257
- rootDir: dir
258
- };
259
- info.type = determineProjectType(info);
260
- return info;
261
- }
262
- function generateSuggestions(project) {
263
- const suggestions = {
264
- workflows: ["git"],
265
- mcpServices: [],
266
- agents: [],
267
- skills: [],
268
- subagentGroups: [],
269
- outputStyle: "technical-precise"
270
- };
271
- if (project.hasTypeScript || project.languages.includes("typescript")) {
272
- suggestions.subagentGroups.push("typescript-dev");
273
- suggestions.skills.push("ts-debug", "ts-refactor", "ts-test");
274
- }
275
- if (project.languages.includes("python")) {
276
- suggestions.subagentGroups.push("python-dev");
277
- suggestions.skills.push("py-debug", "py-refactor", "py-test");
278
- }
279
- if (project.frameworks.includes("nextjs") || project.frameworks.includes("nuxt")) {
280
- suggestions.workflows.push("frontend", "testing");
281
- suggestions.agents.push("ccjk-performance-expert");
282
- }
283
- if (project.frameworks.includes("express") || project.frameworks.includes("fastify") || project.frameworks.includes("nestjs")) {
284
- suggestions.workflows.push("backend", "testing");
285
- suggestions.agents.push("ccjk-security-expert");
286
- }
287
- if (project.hasDocker || project.cicd.length > 0) {
288
- suggestions.workflows.push("devops");
289
- suggestions.subagentGroups.push("devops-team");
290
- suggestions.skills.push("devops-docker", "devops-ci");
291
- }
292
- if (project.testFrameworks.length > 0) {
293
- suggestions.workflows.push("testing");
294
- suggestions.agents.push("ccjk-testing-specialist");
295
- }
296
- if (project.hasMonorepo) {
297
- suggestions.agents.push("ccjk-code-reviewer");
298
- }
299
- if (project.type === "frontend" || project.type === "fullstack") {
300
- suggestions.subagentGroups.push("seo-team");
301
- suggestions.skills.push("seo-meta", "seo-schema");
302
- }
303
- suggestions.subagentGroups.push("security-team");
304
- suggestions.workflows = [...new Set(suggestions.workflows)];
305
- suggestions.agents = [...new Set(suggestions.agents)];
306
- suggestions.skills = [...new Set(suggestions.skills)];
307
- suggestions.subagentGroups = [...new Set(suggestions.subagentGroups)];
308
- return suggestions;
309
- }
310
- function getProjectSummary(project) {
311
- const parts = [];
312
- parts.push(`Project: ${project.name}`);
313
- parts.push(`Type: ${project.type}`);
314
- if (project.languages.length > 0) {
315
- parts.push(`Languages: ${project.languages.join(", ")}`);
316
- }
317
- if (project.frameworks.length > 0) {
318
- parts.push(`Frameworks: ${project.frameworks.join(", ")}`);
319
- }
320
- if (project.buildTools.length > 0) {
321
- parts.push(`Build: ${project.buildTools.join(", ")}`);
322
- }
323
- if (project.testFrameworks.length > 0) {
324
- parts.push(`Testing: ${project.testFrameworks.join(", ")}`);
325
- }
326
- parts.push(`Package Manager: ${project.packageManager}`);
327
- const features = [];
328
- if (project.hasTypeScript)
329
- features.push("TypeScript");
330
- if (project.hasDocker)
331
- features.push("Docker");
332
- if (project.hasMonorepo)
333
- features.push("Monorepo");
334
- if (features.length > 0) {
335
- parts.push(`Features: ${features.join(", ")}`);
336
- }
337
- return parts.join("\n");
338
- }
12
+ import 'node:os';
13
+ import './index2.mjs';
14
+ import 'node:url';
15
+ import 'i18next';
16
+ import 'i18next-fs-backend';
17
+ import './package.mjs';
18
+ import 'node:crypto';
19
+ import 'node:fs/promises';
339
20
 
340
21
  const KNOWLEDGE_BASE_FILE = join(CCJK_CONFIG_DIR, "knowledge-base.json");
341
22
  function simpleHash(content) {
@@ -698,14 +379,4 @@ function exportProjectKnowledge(projectDir = process__default.cwd()) {
698
379
  return JSON.stringify(entries, null, 2);
699
380
  }
700
381
 
701
- const onboarding = {
702
- __proto__: null,
703
- exportProjectKnowledge: exportProjectKnowledge,
704
- getProjectKnowledge: getProjectKnowledge,
705
- loadKnowledgeBase: loadKnowledgeBase,
706
- quickSync: quickSync,
707
- runOnboarding: runOnboarding,
708
- saveKnowledgeBase: saveKnowledgeBase
709
- };
710
-
711
- export { detectFrameworks as a, detectBuildTools as b, detectTestFrameworks as c, detectPackageManager as d, detectCICDSystems as e, detectLanguages as f, determineProjectType as g, detectProject as h, generateSuggestions as i, getProjectSummary as j, getProjectKnowledge as k, loadKnowledgeBase as l, exportProjectKnowledge as m, onboarding as o, quickSync as q, runOnboarding as r, saveKnowledgeBase as s };
382
+ export { exportProjectKnowledge, getProjectKnowledge, loadKnowledgeBase, quickSync, runOnboarding, saveKnowledgeBase };
@@ -1,4 +1,4 @@
1
- const version = "2.6.1";
1
+ const version = "2.6.2";
2
2
  const homepage = "https://github.com/miounet11/ccjk";
3
3
 
4
4
  export { homepage, version };