ccjk 8.2.0 → 8.2.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.
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url';
6
6
  import { existsSync, readdirSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
7
7
  import { homedir } from 'node:os';
8
8
  import { c as createCloudClient } from '../shared/ccjk.DR7dAWAm.mjs';
9
+ import { e as extractString, a as extractDisplayName } from '../shared/ccjk.C2jHOZVP.mjs';
9
10
  import { i18n } from './index.mjs';
10
11
  import 'fs-extra';
11
12
  import 'fs';
@@ -28,8 +29,8 @@ async function getCloudRecommendations(analysis) {
28
29
  dependencies: analysis.dependencies?.direct.map((d) => d.name) || []
29
30
  });
30
31
  return (response.recommendations || []).map((rec) => ({
31
- name: rec.name || rec.id || "Unknown Agent",
32
- description: rec.description || "No description available",
32
+ name: extractString(rec.name, rec.id || "Unknown Agent"),
33
+ description: extractString(rec.description, "No description available"),
33
34
  skills: rec.skills || [],
34
35
  mcpServers: rec.mcpServers || [],
35
36
  persona: rec.persona,
@@ -231,8 +232,10 @@ async function ccjkAgents(options = {}) {
231
232
  consola.info(`${isZh2 ? "\u627E\u5230" : "Found"} ${recommendations.length} ${isZh2 ? "\u4E2A\u63A8\u8350\u4EE3\u7406" : "recommended agent(s)"}:`);
232
233
  consola.log("");
233
234
  recommendations.forEach((agent, index) => {
234
- consola.log(` ${index + 1}. ${agent.name}`);
235
- consola.log(` ${agent.description}`);
235
+ const displayName = extractDisplayName(agent.name, isZh2);
236
+ const displayDesc = extractDisplayName(agent.description, isZh2, "No description available");
237
+ consola.log(` ${index + 1}. ${displayName}`);
238
+ consola.log(` ${displayDesc}`);
236
239
  if (agent.skills && agent.skills.length > 0) {
237
240
  consola.log(` ${isZh2 ? "\u6280\u80FD" : "Skills"}: ${agent.skills.join(", ")}`);
238
241
  }
@@ -326,18 +329,21 @@ async function listAgents() {
326
329
  }
327
330
  async function createAgent(recommendation, options) {
328
331
  try {
332
+ const isZh2 = i18n.language === "zh-CN";
333
+ const agentName = extractString(recommendation.name, recommendation.id || "unknown-agent");
334
+ const agentDescription = extractString(recommendation.description, "No description available");
329
335
  const agentDef = {
330
- id: recommendation.name.toLowerCase().replace(/\s+/g, "-"),
336
+ id: agentName.toLowerCase().replace(/\s+/g, "-"),
331
337
  name: {
332
- en: recommendation.name,
333
- "zh-CN": recommendation.name
338
+ en: agentName,
339
+ "zh-CN": agentName
334
340
  },
335
341
  description: {
336
- en: recommendation.description,
337
- "zh-CN": recommendation.description
342
+ en: agentDescription,
343
+ "zh-CN": agentDescription
338
344
  },
339
- persona: recommendation.persona || recommendation.name,
340
- instructions: recommendation.description,
345
+ persona: recommendation.persona || agentName,
346
+ instructions: agentDescription,
341
347
  skills: (recommendation.skills || []).map((skill) => ({
342
348
  pluginId: "local-agent",
343
349
  skillId: skill
@@ -349,19 +355,20 @@ async function createAgent(recommendation, options) {
349
355
  };
350
356
  const validation = validateAgentDefinition(agentDef);
351
357
  if (!validation.valid) {
352
- consola.error(`${isZh ? "\u9A8C\u8BC1\u5931\u8D25" : "Validation failed"}: ${recommendation.name}`, validation.errors);
358
+ consola.error(`${isZh2 ? "\u9A8C\u8BC1\u5931\u8D25" : "Validation failed"}: ${agentName}`, validation.errors);
353
359
  return null;
354
360
  }
355
361
  if (options.dryRun) {
356
- consola.info(`[DRY RUN] ${isZh ? "\u5C06\u521B\u5EFA\u4EE3\u7406" : "Would create agent"}: ${recommendation.name}`);
357
- return recommendation.name;
362
+ consola.info(`[DRY RUN] ${isZh2 ? "\u5C06\u521B\u5EFA\u4EE3\u7406" : "Would create agent"}: ${agentName}`);
363
+ return agentName;
358
364
  }
359
365
  await writeAgentFile(agentDef);
360
366
  await registerAgent(agentDef);
361
- return recommendation.name;
367
+ return agentName;
362
368
  } catch (error) {
363
369
  const isZh2 = i18n.language === "zh-CN";
364
- consola.error(`${isZh2 ? "\u521B\u5EFA\u5931\u8D25" : "Failed to create"}: ${recommendation.name}`, error);
370
+ const errorName = extractString(recommendation.name, "unknown");
371
+ consola.error(`${isZh2 ? "\u521B\u5EFA\u5931\u8D25" : "Failed to create"}: ${errorName}`, error);
365
372
  return null;
366
373
  }
367
374
  }
@@ -10,6 +10,7 @@ import { ccjkAgents } from './ccjk-agents.mjs';
10
10
  import { ccjkHooks } from './ccjk-hooks.mjs';
11
11
  import { fileURLToPath } from 'node:url';
12
12
  import { a as analyzeProject } from '../shared/ccjk.CsujU3aC.mjs';
13
+ import { e as extractString } from '../shared/ccjk.C2jHOZVP.mjs';
13
14
  import 'node:process';
14
15
  import 'i18next';
15
16
  import 'i18next-fs-backend';
@@ -291,8 +292,9 @@ class CloudSetupOrchestrator {
291
292
  console.log(` ${ansis.bold(i18n.t("cloud-setup:skills"))} (${recommendations.skills.length}):`);
292
293
  for (const skill of recommendations.skills) {
293
294
  const confidence = options.showConfidence ? ` [${Math.round(skill.relevanceScore * 100)}%]` : "";
294
- const skillName = skill.name?.[i18n.language] || skill.name?.en || skill.id;
295
- const reason = options.showRecommendationReason && skill.description ? ` - ${skill.description[i18n.language] || skill.description.en || ""}` : "";
295
+ const skillName = extractString(skill.name, skill.id, i18n.language);
296
+ const skillDesc = extractString(skill.description, "", i18n.language);
297
+ const reason = options.showRecommendationReason && skillDesc ? ` - ${skillDesc}` : "";
296
298
  console.log(` ${ansis.green("\u2713")} ${skillName}${ansis.dim(confidence)}${ansis.dim(reason)}`);
297
299
  }
298
300
  }
@@ -301,8 +303,9 @@ class CloudSetupOrchestrator {
301
303
  ${ansis.bold(i18n.t("cloud-setup:mcpServices"))} (${recommendations.mcpServices.length}):`);
302
304
  for (const service of recommendations.mcpServices) {
303
305
  const confidence = options.showConfidence ? ` [${Math.round(service.relevanceScore * 100)}%]` : "";
304
- const serviceName = service.name?.[i18n.language] || service.name?.en || service.id;
305
- const reason = options.showRecommendationReason && service.description ? ` - ${service.description[i18n.language] || service.description.en || ""}` : "";
306
+ const serviceName = extractString(service.name, service.id, i18n.language);
307
+ const serviceDesc = extractString(service.description, "", i18n.language);
308
+ const reason = options.showRecommendationReason && serviceDesc ? ` - ${serviceDesc}` : "";
306
309
  console.log(` ${ansis.green("\u2713")} ${serviceName}${ansis.dim(confidence)}${ansis.dim(reason)}`);
307
310
  }
308
311
  }
@@ -311,8 +314,9 @@ class CloudSetupOrchestrator {
311
314
  ${ansis.bold(i18n.t("cloud-setup:agents"))} (${recommendations.agents.length}):`);
312
315
  for (const agent of recommendations.agents) {
313
316
  const confidence = options.showConfidence ? ` [${Math.round(agent.relevanceScore * 100)}%]` : "";
314
- const agentName = agent.name?.[i18n.language] || agent.name?.en || agent.id;
315
- const reason = options.showRecommendationReason && agent.description ? ` - ${agent.description[i18n.language] || agent.description.en || ""}` : "";
317
+ const agentName = extractString(agent.name, agent.id, i18n.language);
318
+ const agentDesc = extractString(agent.description, "", i18n.language);
319
+ const reason = options.showRecommendationReason && agentDesc ? ` - ${agentDesc}` : "";
316
320
  console.log(` ${ansis.green("\u2713")} ${agentName}${ansis.dim(confidence)}${ansis.dim(reason)}`);
317
321
  }
318
322
  }
@@ -321,8 +325,9 @@ class CloudSetupOrchestrator {
321
325
  ${ansis.bold(i18n.t("cloud-setup:hooks"))} (${recommendations.hooks.length}):`);
322
326
  for (const hook of recommendations.hooks) {
323
327
  const confidence = options.showConfidence ? ` [${Math.round(hook.relevanceScore * 100)}%]` : "";
324
- const hookName = hook.name?.[i18n.language] || hook.name?.en || hook.id;
325
- const reason = options.showRecommendationReason && hook.description ? ` - ${hook.description[i18n.language] || hook.description.en || ""}` : "";
328
+ const hookName = extractString(hook.name, hook.id, i18n.language);
329
+ const hookDesc = extractString(hook.description, "", i18n.language);
330
+ const reason = options.showRecommendationReason && hookDesc ? ` - ${hookDesc}` : "";
326
331
  console.log(` ${ansis.green("\u2713")} ${hookName}${ansis.dim(confidence)}${ansis.dim(reason)}`);
327
332
  }
328
333
  }
@@ -35,6 +35,7 @@ import './fs-operations.mjs';
35
35
  import 'node:fs/promises';
36
36
  import './platform.mjs';
37
37
  import 'tinyexec';
38
+ import '../shared/ccjk.C2jHOZVP.mjs';
38
39
  import 'node:child_process';
39
40
  import 'node:util';
40
41
 
@@ -79,6 +79,7 @@ import 'ohash';
79
79
  import '../shared/ccjk.Bdhyg3X-.mjs';
80
80
  import './ccjk-mcp.mjs';
81
81
  import './ccjk-agents.mjs';
82
+ import '../shared/ccjk.C2jHOZVP.mjs';
82
83
  import './ccjk-hooks.mjs';
83
84
  import 'node:perf_hooks';
84
85
  import './ccjk-setup.mjs';
@@ -1,4 +1,4 @@
1
- const version = "8.2.0";
1
+ const version = "8.2.1";
2
2
  const homepage = "https://github.com/miounet11/ccjk";
3
3
 
4
4
  export { homepage, version };
package/dist/cli.mjs CHANGED
File without changes
package/dist/index.d.mts CHANGED
@@ -1046,6 +1046,8 @@ declare namespace index$4 {
1046
1046
  export type { index$4_CommandOptions as CommandOptions, index$4_CommandResult as CommandResult };
1047
1047
  }
1048
1048
 
1049
+ declare const SUPPORTED_LANGS: readonly ["zh-CN", "en"];
1050
+ type SupportedLang = (typeof SUPPORTED_LANGS)[number];
1049
1051
  declare const AI_OUTPUT_LANGUAGES: {
1050
1052
  readonly 'zh-CN': {
1051
1053
  readonly directive: "Always respond in Chinese-simplified";
@@ -2513,5 +2515,85 @@ declare function assertDefined<T>(value: T | null | undefined, message?: string)
2513
2515
  */
2514
2516
  declare function assert(condition: boolean, message?: string): asserts condition;
2515
2517
 
2516
- export { AiderTool, BaseCodeTool, BaseError, ClaudeCodeTool, ClineTool, CodexTool, ConfigManager, ConfigValidator, ConfigurationError, ContinueTool, CursorTool, InternalError, Logger, Mutex, NotFoundError, Semaphore, TimeoutError, ToolFactory, ToolRegistry, UnauthorizedError, ValidationError, index$6 as array, assert, assertDefined, index$5 as async, batchProcessFiles, camelCase, capitalize, chunk, index$4 as command, commandExists$1 as commandExists, config, copyFile, countLines, createConfigManager, createLogger, createTool, createValidator, debounce, deepClone, deepMerge, deleteDir, deleteFile, difference, ensureDir, index$3 as error, executeCommand, executeCommandStream, exists, flatten, flatten$1 as flattenArray, formatError, index$2 as fs, get, getArchitecture, getCacheDir, getCommandPath, getCommandVersion, getConfigDir, getDataDir, getErrorMessage, getFileInfo, getFileSize, getHomeDir, getPlatform, getPlatformInfo, getRegistry, getTempDir, has, intersection, isArray, isBoolean, isDefined, isDirectory, isEmail, isFile, isLargeFile, isLinux, isMacOS, isNumber, isObject, isString, isURL, isUnix, isWindows, kebabCase, listDirs, listFiles, logger, logger$2 as loggerUtils, moveFile, index$1 as object, omit, parallelLimit, partition, pascalCase, pick, platform, processLargeFile, processLineByLine, readFile, readJSON, retry, sequence, set, shuffle, sleep, slugify, snakeCase, streamJSON, streamWriteJSON, index as string, template, throttle, timeout, truncate, tryCatch, tryCatchAsync, unflatten, union, unique, validation, validators, waitFor, wrapError, writeFile, writeJSON };
2517
- export type { ChunkProcessorOptions, ExecutionResult, FileInfo, IChatTool, ICodeGenTool, ICodeTool, IFileEditTool, InstallStatus, StreamProcessorOptions, ToolCapabilities, ToolConfig, ToolMetadata };
2518
+ /**
2519
+ * I18n Helper Utilities
2520
+ *
2521
+ * Provides helper functions for handling multilingual data from cloud API
2522
+ * @module utils/i18n-helpers
2523
+ */
2524
+
2525
+ /**
2526
+ * Multilingual string type - can be a plain string or an object with language keys
2527
+ */
2528
+ type MultilingualString = string | Record<string, string> | undefined;
2529
+ /**
2530
+ * Extract a string value from a multilingual object or plain string
2531
+ *
2532
+ * Handles various formats returned by cloud API:
2533
+ * - Plain string: "Hello"
2534
+ * - Multilingual object: { en: "Hello", "zh-CN": "你好" }
2535
+ * - Nested object (edge case): { en: { text: "Hello" } }
2536
+ *
2537
+ * @param val - The value to extract string from
2538
+ * @param fallback - Fallback value if extraction fails
2539
+ * @param preferredLang - Preferred language (defaults to 'en')
2540
+ * @returns Extracted string value
2541
+ *
2542
+ * @example
2543
+ * ```typescript
2544
+ * extractString("Hello", "default") // "Hello"
2545
+ * extractString({ en: "Hello", "zh-CN": "你好" }, "default") // "Hello"
2546
+ * extractString({ en: "Hello", "zh-CN": "你好" }, "default", "zh-CN") // "你好"
2547
+ * extractString(undefined, "default") // "default"
2548
+ * ```
2549
+ */
2550
+ declare function extractString(val: MultilingualString, fallback: string, preferredLang?: SupportedLang): string;
2551
+ /**
2552
+ * Extract display name with language preference
2553
+ *
2554
+ * Similar to extractString but optimized for display purposes
2555
+ * with automatic language detection from i18n context
2556
+ *
2557
+ * @param val - The value to extract string from
2558
+ * @param isZh - Whether to prefer Chinese
2559
+ * @param fallback - Fallback value (defaults to 'Unknown')
2560
+ * @returns Extracted display name
2561
+ */
2562
+ declare function extractDisplayName(val: MultilingualString, isZh?: boolean, fallback?: string): string;
2563
+ /**
2564
+ * Normalize a recommendation object from cloud API
2565
+ *
2566
+ * Ensures all string fields are properly extracted from multilingual objects
2567
+ *
2568
+ * @param rec - Raw recommendation from cloud API
2569
+ * @param preferredLang - Preferred language
2570
+ * @returns Normalized recommendation with string fields
2571
+ */
2572
+ declare function normalizeRecommendation<T extends Record<string, any>>(rec: T, preferredLang?: SupportedLang): T & {
2573
+ name: string;
2574
+ description: string;
2575
+ };
2576
+ /**
2577
+ * Batch normalize recommendations
2578
+ *
2579
+ * @param recommendations - Array of raw recommendations
2580
+ * @param preferredLang - Preferred language
2581
+ * @returns Array of normalized recommendations
2582
+ */
2583
+ declare function normalizeRecommendations<T extends Record<string, any>>(recommendations: T[], preferredLang?: SupportedLang): Array<T & {
2584
+ name: string;
2585
+ description: string;
2586
+ }>;
2587
+
2588
+ type i18nHelpers_MultilingualString = MultilingualString;
2589
+ declare const i18nHelpers_extractDisplayName: typeof extractDisplayName;
2590
+ declare const i18nHelpers_extractString: typeof extractString;
2591
+ declare const i18nHelpers_normalizeRecommendation: typeof normalizeRecommendation;
2592
+ declare const i18nHelpers_normalizeRecommendations: typeof normalizeRecommendations;
2593
+ declare namespace i18nHelpers {
2594
+ export { i18nHelpers_extractDisplayName as extractDisplayName, i18nHelpers_extractString as extractString, i18nHelpers_normalizeRecommendation as normalizeRecommendation, i18nHelpers_normalizeRecommendations as normalizeRecommendations };
2595
+ export type { i18nHelpers_MultilingualString as MultilingualString };
2596
+ }
2597
+
2598
+ export { AiderTool, BaseCodeTool, BaseError, ClaudeCodeTool, ClineTool, CodexTool, ConfigManager, ConfigValidator, ConfigurationError, ContinueTool, CursorTool, InternalError, Logger, Mutex, NotFoundError, Semaphore, TimeoutError, ToolFactory, ToolRegistry, UnauthorizedError, ValidationError, index$6 as array, assert, assertDefined, index$5 as async, batchProcessFiles, camelCase, capitalize, chunk, index$4 as command, commandExists$1 as commandExists, config, copyFile, countLines, createConfigManager, createLogger, createTool, createValidator, debounce, deepClone, deepMerge, deleteDir, deleteFile, difference, ensureDir, index$3 as error, executeCommand, executeCommandStream, exists, extractDisplayName, extractString, flatten, flatten$1 as flattenArray, formatError, index$2 as fs, get, getArchitecture, getCacheDir, getCommandPath, getCommandVersion, getConfigDir, getDataDir, getErrorMessage, getFileInfo, getFileSize, getHomeDir, getPlatform, getPlatformInfo, getRegistry, getTempDir, has, i18nHelpers, intersection, isArray, isBoolean, isDefined, isDirectory, isEmail, isFile, isLargeFile, isLinux, isMacOS, isNumber, isObject, isString, isURL, isUnix, isWindows, kebabCase, listDirs, listFiles, logger, logger$2 as loggerUtils, moveFile, normalizeRecommendation, normalizeRecommendations, index$1 as object, omit, parallelLimit, partition, pascalCase, pick, platform, processLargeFile, processLineByLine, readFile, readJSON, retry, sequence, set, shuffle, sleep, slugify, snakeCase, streamJSON, streamWriteJSON, index as string, template, throttle, timeout, truncate, tryCatch, tryCatchAsync, unflatten, union, unique, validation, validators, waitFor, wrapError, writeFile, writeJSON };
2599
+ export type { ChunkProcessorOptions, ExecutionResult, FileInfo, IChatTool, ICodeGenTool, ICodeTool, IFileEditTool, InstallStatus, MultilingualString, StreamProcessorOptions, ToolCapabilities, ToolConfig, ToolMetadata };
package/dist/index.d.ts CHANGED
@@ -1046,6 +1046,8 @@ declare namespace index$4 {
1046
1046
  export type { index$4_CommandOptions as CommandOptions, index$4_CommandResult as CommandResult };
1047
1047
  }
1048
1048
 
1049
+ declare const SUPPORTED_LANGS: readonly ["zh-CN", "en"];
1050
+ type SupportedLang = (typeof SUPPORTED_LANGS)[number];
1049
1051
  declare const AI_OUTPUT_LANGUAGES: {
1050
1052
  readonly 'zh-CN': {
1051
1053
  readonly directive: "Always respond in Chinese-simplified";
@@ -2513,5 +2515,85 @@ declare function assertDefined<T>(value: T | null | undefined, message?: string)
2513
2515
  */
2514
2516
  declare function assert(condition: boolean, message?: string): asserts condition;
2515
2517
 
2516
- export { AiderTool, BaseCodeTool, BaseError, ClaudeCodeTool, ClineTool, CodexTool, ConfigManager, ConfigValidator, ConfigurationError, ContinueTool, CursorTool, InternalError, Logger, Mutex, NotFoundError, Semaphore, TimeoutError, ToolFactory, ToolRegistry, UnauthorizedError, ValidationError, index$6 as array, assert, assertDefined, index$5 as async, batchProcessFiles, camelCase, capitalize, chunk, index$4 as command, commandExists$1 as commandExists, config, copyFile, countLines, createConfigManager, createLogger, createTool, createValidator, debounce, deepClone, deepMerge, deleteDir, deleteFile, difference, ensureDir, index$3 as error, executeCommand, executeCommandStream, exists, flatten, flatten$1 as flattenArray, formatError, index$2 as fs, get, getArchitecture, getCacheDir, getCommandPath, getCommandVersion, getConfigDir, getDataDir, getErrorMessage, getFileInfo, getFileSize, getHomeDir, getPlatform, getPlatformInfo, getRegistry, getTempDir, has, intersection, isArray, isBoolean, isDefined, isDirectory, isEmail, isFile, isLargeFile, isLinux, isMacOS, isNumber, isObject, isString, isURL, isUnix, isWindows, kebabCase, listDirs, listFiles, logger, logger$2 as loggerUtils, moveFile, index$1 as object, omit, parallelLimit, partition, pascalCase, pick, platform, processLargeFile, processLineByLine, readFile, readJSON, retry, sequence, set, shuffle, sleep, slugify, snakeCase, streamJSON, streamWriteJSON, index as string, template, throttle, timeout, truncate, tryCatch, tryCatchAsync, unflatten, union, unique, validation, validators, waitFor, wrapError, writeFile, writeJSON };
2517
- export type { ChunkProcessorOptions, ExecutionResult, FileInfo, IChatTool, ICodeGenTool, ICodeTool, IFileEditTool, InstallStatus, StreamProcessorOptions, ToolCapabilities, ToolConfig, ToolMetadata };
2518
+ /**
2519
+ * I18n Helper Utilities
2520
+ *
2521
+ * Provides helper functions for handling multilingual data from cloud API
2522
+ * @module utils/i18n-helpers
2523
+ */
2524
+
2525
+ /**
2526
+ * Multilingual string type - can be a plain string or an object with language keys
2527
+ */
2528
+ type MultilingualString = string | Record<string, string> | undefined;
2529
+ /**
2530
+ * Extract a string value from a multilingual object or plain string
2531
+ *
2532
+ * Handles various formats returned by cloud API:
2533
+ * - Plain string: "Hello"
2534
+ * - Multilingual object: { en: "Hello", "zh-CN": "你好" }
2535
+ * - Nested object (edge case): { en: { text: "Hello" } }
2536
+ *
2537
+ * @param val - The value to extract string from
2538
+ * @param fallback - Fallback value if extraction fails
2539
+ * @param preferredLang - Preferred language (defaults to 'en')
2540
+ * @returns Extracted string value
2541
+ *
2542
+ * @example
2543
+ * ```typescript
2544
+ * extractString("Hello", "default") // "Hello"
2545
+ * extractString({ en: "Hello", "zh-CN": "你好" }, "default") // "Hello"
2546
+ * extractString({ en: "Hello", "zh-CN": "你好" }, "default", "zh-CN") // "你好"
2547
+ * extractString(undefined, "default") // "default"
2548
+ * ```
2549
+ */
2550
+ declare function extractString(val: MultilingualString, fallback: string, preferredLang?: SupportedLang): string;
2551
+ /**
2552
+ * Extract display name with language preference
2553
+ *
2554
+ * Similar to extractString but optimized for display purposes
2555
+ * with automatic language detection from i18n context
2556
+ *
2557
+ * @param val - The value to extract string from
2558
+ * @param isZh - Whether to prefer Chinese
2559
+ * @param fallback - Fallback value (defaults to 'Unknown')
2560
+ * @returns Extracted display name
2561
+ */
2562
+ declare function extractDisplayName(val: MultilingualString, isZh?: boolean, fallback?: string): string;
2563
+ /**
2564
+ * Normalize a recommendation object from cloud API
2565
+ *
2566
+ * Ensures all string fields are properly extracted from multilingual objects
2567
+ *
2568
+ * @param rec - Raw recommendation from cloud API
2569
+ * @param preferredLang - Preferred language
2570
+ * @returns Normalized recommendation with string fields
2571
+ */
2572
+ declare function normalizeRecommendation<T extends Record<string, any>>(rec: T, preferredLang?: SupportedLang): T & {
2573
+ name: string;
2574
+ description: string;
2575
+ };
2576
+ /**
2577
+ * Batch normalize recommendations
2578
+ *
2579
+ * @param recommendations - Array of raw recommendations
2580
+ * @param preferredLang - Preferred language
2581
+ * @returns Array of normalized recommendations
2582
+ */
2583
+ declare function normalizeRecommendations<T extends Record<string, any>>(recommendations: T[], preferredLang?: SupportedLang): Array<T & {
2584
+ name: string;
2585
+ description: string;
2586
+ }>;
2587
+
2588
+ type i18nHelpers_MultilingualString = MultilingualString;
2589
+ declare const i18nHelpers_extractDisplayName: typeof extractDisplayName;
2590
+ declare const i18nHelpers_extractString: typeof extractString;
2591
+ declare const i18nHelpers_normalizeRecommendation: typeof normalizeRecommendation;
2592
+ declare const i18nHelpers_normalizeRecommendations: typeof normalizeRecommendations;
2593
+ declare namespace i18nHelpers {
2594
+ export { i18nHelpers_extractDisplayName as extractDisplayName, i18nHelpers_extractString as extractString, i18nHelpers_normalizeRecommendation as normalizeRecommendation, i18nHelpers_normalizeRecommendations as normalizeRecommendations };
2595
+ export type { i18nHelpers_MultilingualString as MultilingualString };
2596
+ }
2597
+
2598
+ export { AiderTool, BaseCodeTool, BaseError, ClaudeCodeTool, ClineTool, CodexTool, ConfigManager, ConfigValidator, ConfigurationError, ContinueTool, CursorTool, InternalError, Logger, Mutex, NotFoundError, Semaphore, TimeoutError, ToolFactory, ToolRegistry, UnauthorizedError, ValidationError, index$6 as array, assert, assertDefined, index$5 as async, batchProcessFiles, camelCase, capitalize, chunk, index$4 as command, commandExists$1 as commandExists, config, copyFile, countLines, createConfigManager, createLogger, createTool, createValidator, debounce, deepClone, deepMerge, deleteDir, deleteFile, difference, ensureDir, index$3 as error, executeCommand, executeCommandStream, exists, extractDisplayName, extractString, flatten, flatten$1 as flattenArray, formatError, index$2 as fs, get, getArchitecture, getCacheDir, getCommandPath, getCommandVersion, getConfigDir, getDataDir, getErrorMessage, getFileInfo, getFileSize, getHomeDir, getPlatform, getPlatformInfo, getRegistry, getTempDir, has, i18nHelpers, intersection, isArray, isBoolean, isDefined, isDirectory, isEmail, isFile, isLargeFile, isLinux, isMacOS, isNumber, isObject, isString, isURL, isUnix, isWindows, kebabCase, listDirs, listFiles, logger, logger$2 as loggerUtils, moveFile, normalizeRecommendation, normalizeRecommendations, index$1 as object, omit, parallelLimit, partition, pascalCase, pick, platform, processLargeFile, processLineByLine, readFile, readJSON, retry, sequence, set, shuffle, sleep, slugify, snakeCase, streamJSON, streamWriteJSON, index as string, template, throttle, timeout, truncate, tryCatch, tryCatchAsync, unflatten, union, unique, validation, validators, waitFor, wrapError, writeFile, writeJSON };
2599
+ export type { ChunkProcessorOptions, ExecutionResult, FileInfo, IChatTool, ICodeGenTool, ICodeTool, IFileEditTool, InstallStatus, MultilingualString, StreamProcessorOptions, ToolCapabilities, ToolConfig, ToolMetadata };
package/dist/index.mjs CHANGED
@@ -8,6 +8,7 @@ import ansis from 'ansis';
8
8
  export { p as platform } from './chunks/platform.mjs';
9
9
  import { Transform } from 'node:stream';
10
10
  import { pipeline } from 'node:stream/promises';
11
+ export { a as extractDisplayName, e as extractString, i as i18nHelpers, n as normalizeRecommendation, b as normalizeRecommendations } from './shared/ccjk.C2jHOZVP.mjs';
11
12
  import 'node:url';
12
13
  import 'dayjs';
13
14
  import 'inquirer';
@@ -0,0 +1,52 @@
1
+ function extractString(val, fallback, preferredLang = "en") {
2
+ if (val === void 0 || val === null) {
3
+ return fallback;
4
+ }
5
+ if (typeof val === "string") {
6
+ return val || fallback;
7
+ }
8
+ if (typeof val === "object") {
9
+ const preferred = val[preferredLang];
10
+ if (typeof preferred === "string" && preferred) {
11
+ return preferred;
12
+ }
13
+ const en = val.en || val["en-US"];
14
+ if (typeof en === "string" && en) {
15
+ return en;
16
+ }
17
+ const zhCN = val["zh-CN"] || val.zh || val["zh-Hans"];
18
+ if (typeof zhCN === "string" && zhCN) {
19
+ return zhCN;
20
+ }
21
+ const values = Object.values(val);
22
+ for (const v of values) {
23
+ if (typeof v === "string" && v) {
24
+ return v;
25
+ }
26
+ }
27
+ }
28
+ return fallback;
29
+ }
30
+ function extractDisplayName(val, isZh = false, fallback = "Unknown") {
31
+ return extractString(val, fallback, isZh ? "zh-CN" : "en");
32
+ }
33
+ function normalizeRecommendation(rec, preferredLang = "en") {
34
+ return {
35
+ ...rec,
36
+ name: extractString(rec.name, rec.id || "Unknown", preferredLang),
37
+ description: extractString(rec.description, "No description available", preferredLang)
38
+ };
39
+ }
40
+ function normalizeRecommendations(recommendations, preferredLang = "en") {
41
+ return recommendations.map((rec) => normalizeRecommendation(rec, preferredLang));
42
+ }
43
+
44
+ const i18nHelpers = {
45
+ __proto__: null,
46
+ extractDisplayName: extractDisplayName,
47
+ extractString: extractString,
48
+ normalizeRecommendation: normalizeRecommendation,
49
+ normalizeRecommendations: normalizeRecommendations
50
+ };
51
+
52
+ export { extractDisplayName as a, normalizeRecommendations as b, extractString as e, i18nHelpers as i, normalizeRecommendation as n };
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "8.2.0",
5
- "packageManager": "pnpm@10.17.1",
4
+ "version": "8.2.1",
6
5
  "description": "Ultimate AI Development Tool - Code Tool Abstraction Layer with 83% Token Savings - Now with Cloud Sync, Hot-Reload Skills, Multi-Agent Orchestration, and Full Claude Code CLI 2.1+ Compatibility",
7
6
  "author": {
8
7
  "name": "CCJK Team",
@@ -74,56 +73,6 @@
74
73
  "engines": {
75
74
  "node": ">=20"
76
75
  },
77
- "scripts": {
78
- "dev": "tsx ./src/cli.ts",
79
- "build": "unbuild",
80
- "start": "node bin/ccjk.mjs",
81
- "typecheck": "tsc --noEmit",
82
- "prepublishOnly": "node scripts/validate-prepublish.mjs && pnpm build",
83
- "lint": "eslint",
84
- "lint:fix": "eslint --fix",
85
- "test": "vitest",
86
- "test:ui": "vitest --ui",
87
- "test:coverage": "vitest run --coverage",
88
- "test:run": "vitest run",
89
- "test:watch": "vitest watch",
90
- "test:v2": "vitest --config vitest.config.v2.ts",
91
- "test:v2:ui": "vitest --config vitest.config.v2.ts --ui",
92
- "test:v2:coverage": "vitest run --config vitest.config.v2.ts --coverage",
93
- "test:v2:run": "vitest run --config vitest.config.v2.ts",
94
- "test:v2:watch": "vitest watch --config vitest.config.v2.ts",
95
- "prepare": "husky",
96
- "format": "prettier --write src/**/*.ts",
97
- "prepublish:fix": "node scripts/fix-package-catalog.mjs",
98
- "cleanup": "node scripts/cleanup.js",
99
- "cleanup:auto": "node scripts/cleanup.js --auto",
100
- "cleanup:dry": "node scripts/cleanup.js --dry-run",
101
- "clean": "rm -rf dist coverage .turbo *.tsbuildinfo",
102
- "v2:setup": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh",
103
- "v2:setup:skip-tests": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh --skip-tests",
104
- "v2:services:up": "docker-compose -f docker-compose.dev.yml up -d",
105
- "v2:services:down": "docker-compose -f docker-compose.dev.yml down",
106
- "v2:services:restart": "docker-compose -f docker-compose.dev.yml restart",
107
- "v2:services:logs": "docker-compose -f docker-compose.dev.yml logs -f",
108
- "v2:services:status": "docker-compose -f docker-compose.dev.yml ps",
109
- "v2:db:reset": "docker-compose -f docker-compose.dev.yml down postgres && docker volume rm ccjk-public_postgres_data && docker-compose -f docker-compose.dev.yml up -d postgres",
110
- "v2:db:migrate": "echo 'Database migration script - to be implemented'",
111
- "v2:db:seed": "echo 'Database seeding script - to be implemented'",
112
- "v2:cache:clear": "docker exec ccjk-redis-dev redis-cli FLUSHALL",
113
- "v2:search:reindex": "curl -X DELETE http://localhost:9200/ccjk_dev* && echo 'Elasticsearch indexes cleared'",
114
- "v2:health": "chmod +x scripts/health-check.sh && ./scripts/health-check.sh",
115
- "v2:dev": "concurrently \"pnpm v2:services:up\" \"pnpm dev\"",
116
- "v2:test:integration": "NODE_ENV=test pnpm test -- --config vitest.integration.config.ts",
117
- "v2:test:e2e": "NODE_ENV=test pnpm test -- --config vitest.e2e.config.ts",
118
- "v2:monitoring:up": "docker-compose -f docker-compose.dev.yml --profile monitoring up -d",
119
- "v2:tracing:up": "docker-compose -f docker-compose.dev.yml --profile tracing up -d",
120
- "v2:clean": "pnpm clean && docker-compose -f docker-compose.dev.yml down -v && docker system prune -f",
121
- "benchmark": "tsx src/v2/__tests__/benchmarks.ts",
122
- "benchmark:save": "tsx src/v2/__tests__/benchmarks.ts && echo 'Results saved to .ccjk/benchmark-results.json'",
123
- "benchmark:detailed": "tsx src/v2/__tests__/benchmarks.ts --detailed",
124
- "benchmark:server": "npx http-server docs/v2 -p 8080 -o dashboard.html",
125
- "benchmark:open": "open docs/v2/dashboard.html || xdg-open docs/v2/dashboard.html || start docs/v2/dashboard.html"
126
- },
127
76
  "dependencies": {
128
77
  "@anthropic-ai/sdk": "^0.52.0",
129
78
  "ansis": "^4.1.0",
@@ -173,5 +122,53 @@
173
122
  "typescript": "^5.9.2",
174
123
  "unbuild": "^3.6.1",
175
124
  "vitest": "^3.2.4"
125
+ },
126
+ "scripts": {
127
+ "dev": "tsx ./src/cli.ts",
128
+ "build": "unbuild",
129
+ "start": "node bin/ccjk.mjs",
130
+ "typecheck": "tsc --noEmit",
131
+ "lint": "eslint",
132
+ "lint:fix": "eslint --fix",
133
+ "test": "vitest",
134
+ "test:ui": "vitest --ui",
135
+ "test:coverage": "vitest run --coverage",
136
+ "test:run": "vitest run",
137
+ "test:watch": "vitest watch",
138
+ "test:v2": "vitest --config vitest.config.v2.ts",
139
+ "test:v2:ui": "vitest --config vitest.config.v2.ts --ui",
140
+ "test:v2:coverage": "vitest run --config vitest.config.v2.ts --coverage",
141
+ "test:v2:run": "vitest run --config vitest.config.v2.ts",
142
+ "test:v2:watch": "vitest watch --config vitest.config.v2.ts",
143
+ "format": "prettier --write src/**/*.ts",
144
+ "prepublish:fix": "node scripts/fix-package-catalog.mjs",
145
+ "cleanup": "node scripts/cleanup.js",
146
+ "cleanup:auto": "node scripts/cleanup.js --auto",
147
+ "cleanup:dry": "node scripts/cleanup.js --dry-run",
148
+ "clean": "rm -rf dist coverage .turbo *.tsbuildinfo",
149
+ "v2:setup": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh",
150
+ "v2:setup:skip-tests": "chmod +x scripts/v2-dev-setup.sh && ./scripts/v2-dev-setup.sh --skip-tests",
151
+ "v2:services:up": "docker-compose -f docker-compose.dev.yml up -d",
152
+ "v2:services:down": "docker-compose -f docker-compose.dev.yml down",
153
+ "v2:services:restart": "docker-compose -f docker-compose.dev.yml restart",
154
+ "v2:services:logs": "docker-compose -f docker-compose.dev.yml logs -f",
155
+ "v2:services:status": "docker-compose -f docker-compose.dev.yml ps",
156
+ "v2:db:reset": "docker-compose -f docker-compose.dev.yml down postgres && docker volume rm ccjk-public_postgres_data && docker-compose -f docker-compose.dev.yml up -d postgres",
157
+ "v2:db:migrate": "echo 'Database migration script - to be implemented'",
158
+ "v2:db:seed": "echo 'Database seeding script - to be implemented'",
159
+ "v2:cache:clear": "docker exec ccjk-redis-dev redis-cli FLUSHALL",
160
+ "v2:search:reindex": "curl -X DELETE http://localhost:9200/ccjk_dev* && echo 'Elasticsearch indexes cleared'",
161
+ "v2:health": "chmod +x scripts/health-check.sh && ./scripts/health-check.sh",
162
+ "v2:dev": "concurrently \"pnpm v2:services:up\" \"pnpm dev\"",
163
+ "v2:test:integration": "NODE_ENV=test pnpm test -- --config vitest.integration.config.ts",
164
+ "v2:test:e2e": "NODE_ENV=test pnpm test -- --config vitest.e2e.config.ts",
165
+ "v2:monitoring:up": "docker-compose -f docker-compose.dev.yml --profile monitoring up -d",
166
+ "v2:tracing:up": "docker-compose -f docker-compose.dev.yml --profile tracing up -d",
167
+ "v2:clean": "pnpm clean && docker-compose -f docker-compose.dev.yml down -v && docker system prune -f",
168
+ "benchmark": "tsx src/v2/__tests__/benchmarks.ts",
169
+ "benchmark:save": "tsx src/v2/__tests__/benchmarks.ts && echo 'Results saved to .ccjk/benchmark-results.json'",
170
+ "benchmark:detailed": "tsx src/v2/__tests__/benchmarks.ts --detailed",
171
+ "benchmark:server": "npx http-server docs/v2 -p 8080 -o dashboard.html",
172
+ "benchmark:open": "open docs/v2/dashboard.html || xdg-open docs/v2/dashboard.html || start docs/v2/dashboard.html"
176
173
  }
177
174
  }