ccjk 9.3.14 → 9.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import consola from 'consola';
2
2
  import process__default, { cwd } from 'node:process';
3
- import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.DKM8a98N.mjs';
3
+ import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.CcFAyU1D.mjs';
4
4
  import { join, dirname } from 'pathe';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { existsSync, readdirSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
@@ -9,7 +9,7 @@ import { ccjkMcp } from './ccjk-mcp.mjs';
9
9
  import { ccjkAgents } from './ccjk-agents.mjs';
10
10
  import { ccjkHooks } from './ccjk-hooks.mjs';
11
11
  import { fileURLToPath } from 'node:url';
12
- import { a as analyzeProject } from '../shared/ccjk.DKM8a98N.mjs';
12
+ import { a as analyzeProject } from '../shared/ccjk.CcFAyU1D.mjs';
13
13
  import { hash } from 'ohash';
14
14
  import { a as extractString } from '../shared/ccjk.AqnXPAzw.mjs';
15
15
  import 'node:process';
@@ -976,12 +976,63 @@ class CloudSetupOrchestrator {
976
976
  return this.getLocalRecommendations(analysis);
977
977
  }
978
978
  }
979
+ /**
980
+ * Check if a dependency exists in the analysis
981
+ * Handles both Map<string, DependencyInfo> and DependencyNode[] formats
982
+ */
983
+ hasDependency(analysis, name, isDev = false) {
984
+ const deps = analysis.dependencies;
985
+ if (!deps) return false;
986
+ if (isDev && deps.dev instanceof Map) {
987
+ return deps.dev.has(name);
988
+ }
989
+ if (!isDev && deps.direct instanceof Map) {
990
+ return deps.direct.has(name);
991
+ }
992
+ if (Array.isArray(deps.direct)) {
993
+ const nodeList = deps.direct;
994
+ return nodeList.some((d) => d.name === name && (isDev ? d.isDev : !d.isDev));
995
+ }
996
+ return false;
997
+ }
998
+ /**
999
+ * Check if a framework is detected in the analysis
1000
+ */
1001
+ hasFramework(analysis, name) {
1002
+ if (!analysis.frameworks) return false;
1003
+ if (Array.isArray(analysis.frameworks) && analysis.frameworks.length > 0) {
1004
+ const first = analysis.frameworks[0];
1005
+ if (typeof first === "object" && "name" in first) {
1006
+ return analysis.frameworks.some((f) => f.name?.toLowerCase() === name.toLowerCase());
1007
+ }
1008
+ if (typeof first === "string") {
1009
+ return analysis.frameworks.includes(name);
1010
+ }
1011
+ }
1012
+ return false;
1013
+ }
1014
+ /**
1015
+ * Check if a language is detected in the analysis
1016
+ */
1017
+ hasLanguage(analysis, name) {
1018
+ if (!analysis.languages) return false;
1019
+ if (Array.isArray(analysis.languages) && analysis.languages.length > 0) {
1020
+ const first = analysis.languages[0];
1021
+ if (typeof first === "object" && "language" in first) {
1022
+ return analysis.languages.some((l) => l.language?.toLowerCase() === name.toLowerCase());
1023
+ }
1024
+ if (typeof first === "string") {
1025
+ return analysis.languages.includes(name);
1026
+ }
1027
+ }
1028
+ return false;
1029
+ }
979
1030
  /**
980
1031
  * Get local fallback recommendations
981
1032
  */
982
1033
  getLocalRecommendations(analysis) {
983
1034
  const recommendations = [];
984
- if (analysis.devDependencies?.typescript) {
1035
+ if (this.hasDependency(analysis, "typescript", true) || this.hasLanguage(analysis, "typescript")) {
985
1036
  recommendations.push({
986
1037
  id: "ts-best-practices",
987
1038
  name: { en: "TypeScript Best Practices", "zh-CN": "TypeScript \u6700\u4F73\u5B9E\u8DF5" },
@@ -991,7 +1042,7 @@ class CloudSetupOrchestrator {
991
1042
  tags: ["typescript", "type-checking"]
992
1043
  });
993
1044
  }
994
- if (analysis.dependencies?.react) {
1045
+ if (this.hasDependency(analysis, "react") || this.hasFramework(analysis, "react")) {
995
1046
  recommendations.push({
996
1047
  id: "react-design-patterns",
997
1048
  name: { en: "React Design Patterns", "zh-CN": "React \u8BBE\u8BA1\u6A21\u5F0F" },
@@ -1001,7 +1052,7 @@ class CloudSetupOrchestrator {
1001
1052
  tags: ["react", "hooks", "frontend"]
1002
1053
  });
1003
1054
  }
1004
- if (analysis.dependencies?.next) {
1055
+ if (this.hasDependency(analysis, "next") || this.hasFramework(analysis, "next") || this.hasFramework(analysis, "nextjs")) {
1005
1056
  recommendations.push({
1006
1057
  id: "nextjs-optimization",
1007
1058
  name: { en: "Next.js Optimization", "zh-CN": "Next.js \u4F18\u5316" },
@@ -1011,7 +1062,17 @@ class CloudSetupOrchestrator {
1011
1062
  tags: ["nextjs", "ssr", "performance"]
1012
1063
  });
1013
1064
  }
1014
- if (analysis.dependencies?.express || analysis.dependencies?.fastify) {
1065
+ if (this.hasDependency(analysis, "vue") || this.hasFramework(analysis, "vue")) {
1066
+ recommendations.push({
1067
+ id: "vue-design-patterns",
1068
+ name: { en: "Vue Design Patterns", "zh-CN": "Vue \u8BBE\u8BA1\u6A21\u5F0F" },
1069
+ description: { en: "Vue 3 Composition API patterns", "zh-CN": "Vue 3 \u7EC4\u5408\u5F0F API \u6A21\u5F0F" },
1070
+ category: "workflow",
1071
+ relevanceScore: 0.95,
1072
+ tags: ["vue", "composition-api", "frontend"]
1073
+ });
1074
+ }
1075
+ if (this.hasDependency(analysis, "express") || this.hasDependency(analysis, "fastify") || this.hasFramework(analysis, "express")) {
1015
1076
  recommendations.push({
1016
1077
  id: "nodejs-workflow",
1017
1078
  name: { en: "Node.js Workflow", "zh-CN": "Node.js \u5DE5\u4F5C\u6D41" },
@@ -1021,15 +1082,36 @@ class CloudSetupOrchestrator {
1021
1082
  tags: ["nodejs", "backend"]
1022
1083
  });
1023
1084
  }
1085
+ if (this.hasDependency(analysis, "@nestjs/core") || this.hasFramework(analysis, "nest") || this.hasFramework(analysis, "nestjs")) {
1086
+ recommendations.push({
1087
+ id: "nestjs-workflow",
1088
+ name: { en: "NestJS Workflow", "zh-CN": "NestJS \u5DE5\u4F5C\u6D41" },
1089
+ description: { en: "NestJS backend development", "zh-CN": "NestJS \u540E\u7AEF\u5F00\u53D1" },
1090
+ category: "workflow",
1091
+ relevanceScore: 0.92,
1092
+ tags: ["nestjs", "backend", "typescript"]
1093
+ });
1094
+ }
1095
+ if (this.hasLanguage(analysis, "python")) {
1096
+ recommendations.push({
1097
+ id: "python-workflow",
1098
+ name: { en: "Python Workflow", "zh-CN": "Python \u5DE5\u4F5C\u6D41" },
1099
+ description: { en: "Python development best practices", "zh-CN": "Python \u5F00\u53D1\u6700\u4F73\u5B9E\u8DF5" },
1100
+ category: "workflow",
1101
+ relevanceScore: 0.88,
1102
+ tags: ["python", "backend"]
1103
+ });
1104
+ }
1024
1105
  return {
1025
1106
  skills: recommendations.filter((r) => r.category === "workflow"),
1026
- mcpServices: [],
1027
- agents: [],
1028
- hooks: [],
1107
+ mcpServices: recommendations.filter((r) => r.category === "mcp"),
1108
+ agents: recommendations.filter((r) => r.category === "agent"),
1109
+ hooks: recommendations.filter((r) => r.category === "tool"),
1029
1110
  confidence: 0.7,
1030
- fingerprint: analysis.fingerprint || "",
1111
+ // Local fallback has lower confidence
1112
+ fingerprint: "",
1031
1113
  insights: {
1032
- insights: [i18n.t("cloud-setup:localFallbackUsed")],
1114
+ insights: [],
1033
1115
  productivityImprovements: [],
1034
1116
  nextRecommendations: []
1035
1117
  }
@@ -1,5 +1,5 @@
1
1
  import { consola } from 'consola';
2
- import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.DKM8a98N.mjs';
2
+ import { P as ProjectAnalyzer, g as getTemplatesClient } from '../shared/ccjk.CcFAyU1D.mjs';
3
3
  import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
4
4
  import process__default from 'node:process';
5
5
  import { join, dirname } from 'pathe';
@@ -4,7 +4,7 @@ import { join } from 'node:path';
4
4
  import { cwd } from 'node:process';
5
5
  import ansis from 'ansis';
6
6
  import { ensureI18nInitialized, i18n } from './index.mjs';
7
- import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.DKM8a98N.mjs';
7
+ import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.CcFAyU1D.mjs';
8
8
  import { b as backupMcpConfig, r as readMcpConfig, m as mergeMcpServers, w as writeMcpConfig } from './claude-config.mjs';
9
9
  import { e as commandExists } from './platform.mjs';
10
10
  import { CLAUDE_DIR } from './constants.mjs';
@@ -2,7 +2,7 @@ import { i18n } from './index.mjs';
2
2
  import { consola } from 'consola';
3
3
  import ansis from 'ansis';
4
4
  import { cwd } from 'node:process';
5
- import { P as ProjectAnalyzer } from '../shared/ccjk.DKM8a98N.mjs';
5
+ import { P as ProjectAnalyzer } from '../shared/ccjk.CcFAyU1D.mjs';
6
6
  import { performance } from 'node:perf_hooks';
7
7
  import { promises } from 'node:fs';
8
8
  import { join } from 'pathe';
@@ -279,6 +279,8 @@ class SetupOrchestrator {
279
279
  result.totalFailed = phases.reduce((sum, p) => sum + p.failed, 0);
280
280
  result.errors = phases.flatMap((p) => p.errors);
281
281
  result.success = result.totalFailed === 0 || !options.rollbackOnError;
282
+ } else {
283
+ result.success = true;
282
284
  }
283
285
  if (options.report && !options.dryRun) {
284
286
  const reportPath = await this.generateReport(result);
@@ -1,12 +1,13 @@
1
- import { promises } from 'node:fs';
1
+ import { readFileSync, promises } from 'node:fs';
2
2
  import { homedir } from 'node:os';
3
- import { join } from 'node:path';
3
+ import { dirname, join } from 'node:path';
4
4
  import ansis from 'ansis';
5
5
  import consola from 'consola';
6
6
  import inquirer from 'inquirer';
7
7
  import { i18n } from './index.mjs';
8
- import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.DKM8a98N.mjs';
8
+ import { a as analyzeProject, g as getTemplatesClient } from '../shared/ccjk.CcFAyU1D.mjs';
9
9
  import { ofetch } from 'ofetch';
10
+ import { fileURLToPath } from 'node:url';
10
11
  import { g as getSkillParser } from '../shared/ccjk.Bdhyg3X-.mjs';
11
12
 
12
13
  class CloudClientError extends Error {
@@ -63,6 +64,14 @@ class CloudClientError extends Error {
63
64
  }
64
65
  }
65
66
 
67
+ const __dirname$1 = dirname(fileURLToPath(import.meta.url));
68
+ let CCJK_VERSION = "9.0.0";
69
+ try {
70
+ const packageJson = JSON.parse(readFileSync(join(__dirname$1, "../../package.json"), "utf-8"));
71
+ CCJK_VERSION = packageJson.version;
72
+ } catch {
73
+ }
74
+ const API_PREFIX = "/api/v1";
66
75
  class CloudClient {
67
76
  fetch;
68
77
  config;
@@ -78,7 +87,7 @@ class CloudClient {
78
87
  baseURL: this.config.baseURL,
79
88
  timeout: this.config.timeout,
80
89
  headers: {
81
- "User-Agent": `CCJK/${this.config.version || "8.0.0"}`,
90
+ "User-Agent": `CCJK/${this.config.version || CCJK_VERSION}`,
82
91
  ...this.config.apiKey && { Authorization: `Bearer ${this.config.apiKey}` }
83
92
  },
84
93
  retry: this.config.enableRetry ? this.config.maxRetries : 0,
@@ -145,7 +154,7 @@ class CloudClient {
145
154
  /**
146
155
  * Analyze project and get recommendations
147
156
  *
148
- * POST /v1/analyze
157
+ * POST /api/v1/analysis/projects
149
158
  *
150
159
  * @param request - Project analysis request
151
160
  * @returns Project analysis response with recommendations
@@ -153,7 +162,7 @@ class CloudClient {
153
162
  async analyzeProject(request) {
154
163
  try {
155
164
  consola.debug("Analyzing project:", request.projectRoot);
156
- const response = await this.fetch("/api/v8/analysis/projects", {
165
+ const response = await this.fetch(`${API_PREFIX}/analysis/projects`, {
157
166
  method: "POST",
158
167
  body: request
159
168
  });
@@ -166,7 +175,7 @@ class CloudClient {
166
175
  /**
167
176
  * Get a single template by ID
168
177
  *
169
- * GET /v1/templates/:id
178
+ * GET /api/v1/templates/:id
170
179
  *
171
180
  * @param id - Template identifier
172
181
  * @param language - Language for translations (optional)
@@ -175,7 +184,7 @@ class CloudClient {
175
184
  async getTemplate(id, language) {
176
185
  try {
177
186
  consola.debug("Fetching template:", id);
178
- const response = await this.fetch(`/v1/templates/${encodeURIComponent(id)}`, {
187
+ const response = await this.fetch(`${API_PREFIX}/templates/${encodeURIComponent(id)}`, {
179
188
  method: "GET",
180
189
  params: language ? { language } : void 0
181
190
  });
@@ -188,7 +197,7 @@ class CloudClient {
188
197
  /**
189
198
  * Get multiple templates in batch
190
199
  *
191
- * POST /v1/templates/batch
200
+ * POST /api/v1/templates/batch
192
201
  *
193
202
  * @param request - Batch template request
194
203
  * @returns Batch template response
@@ -196,7 +205,7 @@ class CloudClient {
196
205
  async getBatchTemplates(request) {
197
206
  try {
198
207
  consola.debug("Fetching batch templates:", request.ids.length);
199
- const response = await this.fetch("/api/v8/templates/batch", {
208
+ const response = await this.fetch(`${API_PREFIX}/templates/batch`, {
200
209
  method: "POST",
201
210
  body: request
202
211
  });
@@ -209,7 +218,7 @@ class CloudClient {
209
218
  /**
210
219
  * Report usage metrics
211
220
  *
212
- * POST /v1/report
221
+ * POST /api/v1/telemetry/installation
213
222
  *
214
223
  * @param report - Usage report payload
215
224
  * @returns Usage report response
@@ -217,7 +226,7 @@ class CloudClient {
217
226
  async reportUsage(report) {
218
227
  try {
219
228
  consola.debug("Reporting usage:", report.metricType);
220
- const response = await this.fetch("/api/v8/telemetry/installation", {
229
+ const response = await this.fetch(`${API_PREFIX}/telemetry/installation`, {
221
230
  method: "POST",
222
231
  body: report
223
232
  });
@@ -235,14 +244,14 @@ class CloudClient {
235
244
  /**
236
245
  * Check API health status
237
246
  *
238
- * GET /v1/health
247
+ * GET /api/v1/health
239
248
  *
240
249
  * @returns Health check response
241
250
  */
242
251
  async healthCheck() {
243
252
  try {
244
253
  consola.debug("Checking API health");
245
- const response = await this.fetch("/api/v8/health", {
254
+ const response = await this.fetch(`${API_PREFIX}/health`, {
246
255
  method: "GET"
247
256
  });
248
257
  consola.debug(`API health: ${response.status}`);
@@ -263,7 +272,7 @@ class CloudClient {
263
272
  baseURL: this.config.baseURL,
264
273
  timeout: this.config.timeout,
265
274
  headers: {
266
- "User-Agent": `CCJK/${this.config.version || "8.0.0"}`,
275
+ "User-Agent": `CCJK/${this.config.version || CCJK_VERSION}`,
267
276
  ...this.config.apiKey && { Authorization: `Bearer ${this.config.apiKey}` }
268
277
  },
269
278
  retry: this.config.enableRetry ? this.config.maxRetries : 0,
@@ -282,7 +291,7 @@ function createCloudClient(config) {
282
291
  return new CloudClient({
283
292
  baseURL: "https://api.claudehome.cn",
284
293
  timeout: 1e4,
285
- version: "8.0.0",
294
+ version: CCJK_VERSION,
286
295
  enableCache: true,
287
296
  enableRetry: true,
288
297
  maxRetries: 3,
@@ -50,7 +50,7 @@ import './claude-code-config-manager.mjs';
50
50
  import './config-switch.mjs';
51
51
  import './ccjk-agents.mjs';
52
52
  import 'consola';
53
- import '../shared/ccjk.DKM8a98N.mjs';
53
+ import '../shared/ccjk.CcFAyU1D.mjs';
54
54
  import 'fs-extra';
55
55
  import 'fs';
56
56
  import 'path';
@@ -1,4 +1,4 @@
1
- const version = "9.3.14";
1
+ const version = "9.3.16";
2
2
  const homepage = "https://github.com/miounet11/ccjk";
3
3
 
4
4
  export { homepage, version };
@@ -4902,6 +4902,11 @@ function calculateOverallConfidence(languages, frameworks) {
4902
4902
  const logger$1 = consola.withTag("dependency-resolver");
4903
4903
  async function analyzeDependencies(analysis, config) {
4904
4904
  logger$1.info("Analyzing project dependencies");
4905
+ if (config.analyzeTransitiveDeps) {
4906
+ logger$1.warn(
4907
+ 'Transitive dependency analysis requested but not fully implemented. The "all" field will only contain direct dependencies. See dependency-resolver.ts for details.'
4908
+ );
4909
+ }
4905
4910
  const projectPath = analysis.rootPath;
4906
4911
  const packageManager = analysis.packageManager;
4907
4912
  analysis.languages;
@@ -5135,7 +5140,7 @@ async function analyzeRustDependencies(projectPath) {
5135
5140
  if (!deps2) return [];
5136
5141
  return Object.entries(deps2).map(([name, version]) => ({
5137
5142
  name,
5138
- version: typeof version === "string" ? version : version.version || "latest",
5143
+ version: typeof version === "string" ? version : version?.version || "latest",
5139
5144
  type: isDev ? "dev" : "runtime",
5140
5145
  isDev,
5141
5146
  isPeer: false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "9.3.14",
4
+ "version": "9.3.16",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "CCJK v9.0.0 - Revolutionary AI Development Platform with Enterprise Security, Streaming Cloud Sync, CRDT Conflict Resolution, and Unified V3 Architecture",
7
7
  "author": {