ccjk 1.3.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.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +455 -0
  3. package/README.ko.md +455 -0
  4. package/README.md +550 -0
  5. package/README.zh-CN.md +488 -0
  6. package/bin/ccjk.mjs +2 -0
  7. package/dist/chunks/api-providers.mjs +89 -0
  8. package/dist/chunks/claude-code-config-manager.mjs +733 -0
  9. package/dist/chunks/claude-code-incremental-manager.mjs +603 -0
  10. package/dist/chunks/codex-config-switch.mjs +427 -0
  11. package/dist/chunks/codex-provider-manager.mjs +232 -0
  12. package/dist/chunks/codex-uninstaller.mjs +404 -0
  13. package/dist/chunks/commands.mjs +120 -0
  14. package/dist/chunks/features.mjs +642 -0
  15. package/dist/chunks/simple-config.mjs +10445 -0
  16. package/dist/cli.d.mts +1 -0
  17. package/dist/cli.d.ts +1 -0
  18. package/dist/cli.mjs +5972 -0
  19. package/dist/i18n/locales/en/api.json +63 -0
  20. package/dist/i18n/locales/en/ccjk.json +276 -0
  21. package/dist/i18n/locales/en/ccr.json +65 -0
  22. package/dist/i18n/locales/en/cli.json +57 -0
  23. package/dist/i18n/locales/en/codex.json +124 -0
  24. package/dist/i18n/locales/en/cometix.json +29 -0
  25. package/dist/i18n/locales/en/common.json +20 -0
  26. package/dist/i18n/locales/en/configuration.json +77 -0
  27. package/dist/i18n/locales/en/errors.json +26 -0
  28. package/dist/i18n/locales/en/installation.json +80 -0
  29. package/dist/i18n/locales/en/interview.json +104 -0
  30. package/dist/i18n/locales/en/language.json +19 -0
  31. package/dist/i18n/locales/en/mcp.json +38 -0
  32. package/dist/i18n/locales/en/menu.json +51 -0
  33. package/dist/i18n/locales/en/multi-config.json +79 -0
  34. package/dist/i18n/locales/en/shencha.json +14 -0
  35. package/dist/i18n/locales/en/team.json +7 -0
  36. package/dist/i18n/locales/en/tools.json +42 -0
  37. package/dist/i18n/locales/en/uninstall.json +56 -0
  38. package/dist/i18n/locales/en/updater.json +25 -0
  39. package/dist/i18n/locales/en/workflow.json +25 -0
  40. package/dist/i18n/locales/zh-CN/api.json +63 -0
  41. package/dist/i18n/locales/zh-CN/ccjk.json +276 -0
  42. package/dist/i18n/locales/zh-CN/ccr.json +65 -0
  43. package/dist/i18n/locales/zh-CN/cli.json +57 -0
  44. package/dist/i18n/locales/zh-CN/codex.json +124 -0
  45. package/dist/i18n/locales/zh-CN/cometix.json +29 -0
  46. package/dist/i18n/locales/zh-CN/common.json +20 -0
  47. package/dist/i18n/locales/zh-CN/configuration.json +77 -0
  48. package/dist/i18n/locales/zh-CN/errors.json +26 -0
  49. package/dist/i18n/locales/zh-CN/installation.json +80 -0
  50. package/dist/i18n/locales/zh-CN/interview.json +104 -0
  51. package/dist/i18n/locales/zh-CN/language.json +19 -0
  52. package/dist/i18n/locales/zh-CN/mcp.json +38 -0
  53. package/dist/i18n/locales/zh-CN/menu.json +51 -0
  54. package/dist/i18n/locales/zh-CN/multi-config.json +79 -0
  55. package/dist/i18n/locales/zh-CN/shencha.json +14 -0
  56. package/dist/i18n/locales/zh-CN/team.json +7 -0
  57. package/dist/i18n/locales/zh-CN/tools.json +42 -0
  58. package/dist/i18n/locales/zh-CN/uninstall.json +56 -0
  59. package/dist/i18n/locales/zh-CN/updater.json +25 -0
  60. package/dist/i18n/locales/zh-CN/workflow.json +25 -0
  61. package/dist/index.d.mts +2644 -0
  62. package/dist/index.d.ts +2644 -0
  63. package/dist/index.mjs +1706 -0
  64. package/package.json +157 -0
  65. package/templates/CLAUDE.md +219 -0
  66. package/templates/claude-code/CLAUDE.md +250 -0
  67. package/templates/claude-code/common/settings.json +38 -0
  68. package/templates/claude-code/en/workflow/bmad/commands/bmad-init.md +165 -0
  69. package/templates/claude-code/en/workflow/common/agents/get-current-datetime.md +29 -0
  70. package/templates/claude-code/en/workflow/common/agents/init-architect.md +114 -0
  71. package/templates/claude-code/en/workflow/common/commands/init-project.md +53 -0
  72. package/templates/claude-code/en/workflow/plan/agents/planner.md +116 -0
  73. package/templates/claude-code/en/workflow/plan/agents/ui-ux-designer.md +91 -0
  74. package/templates/claude-code/en/workflow/plan/commands/feat.md +105 -0
  75. package/templates/claude-code/zh-CN/workflow/bmad/commands/bmad-init.md +172 -0
  76. package/templates/claude-code/zh-CN/workflow/common/agents/get-current-datetime.md +29 -0
  77. package/templates/claude-code/zh-CN/workflow/common/agents/init-architect.md +114 -0
  78. package/templates/claude-code/zh-CN/workflow/common/commands/init-project.md +53 -0
  79. package/templates/claude-code/zh-CN/workflow/plan/agents/planner.md +116 -0
  80. package/templates/claude-code/zh-CN/workflow/plan/agents/ui-ux-designer.md +91 -0
  81. package/templates/claude-code/zh-CN/workflow/plan/commands/feat.md +105 -0
  82. package/templates/codex/common/config.toml +0 -0
  83. package/templates/common/output-styles/en/casual-friendly.md +97 -0
  84. package/templates/common/output-styles/en/engineer-professional.md +88 -0
  85. package/templates/common/output-styles/en/expert-concise.md +93 -0
  86. package/templates/common/output-styles/en/laowang-engineer.md +127 -0
  87. package/templates/common/output-styles/en/nekomata-engineer.md +120 -0
  88. package/templates/common/output-styles/en/ojousama-engineer.md +121 -0
  89. package/templates/common/output-styles/en/teaching-mode.md +102 -0
  90. package/templates/common/output-styles/en/technical-precise.md +101 -0
  91. package/templates/common/output-styles/zh-CN/engineer-professional.md +89 -0
  92. package/templates/common/output-styles/zh-CN/laowang-engineer.md +127 -0
  93. package/templates/common/output-styles/zh-CN/nekomata-engineer.md +120 -0
  94. package/templates/common/output-styles/zh-CN/ojousama-engineer.md +121 -0
  95. package/templates/common/workflow/git/en/git-cleanBranches.md +102 -0
  96. package/templates/common/workflow/git/en/git-commit.md +205 -0
  97. package/templates/common/workflow/git/en/git-rollback.md +90 -0
  98. package/templates/common/workflow/git/en/git-worktree.md +276 -0
  99. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +102 -0
  100. package/templates/common/workflow/git/zh-CN/git-commit.md +205 -0
  101. package/templates/common/workflow/git/zh-CN/git-rollback.md +90 -0
  102. package/templates/common/workflow/git/zh-CN/git-worktree.md +276 -0
  103. package/templates/common/workflow/interview/en/interview.md +212 -0
  104. package/templates/common/workflow/interview/zh-CN/interview.md +212 -0
  105. package/templates/common/workflow/sixStep/en/workflow.md +251 -0
  106. package/templates/common/workflow/sixStep/zh-CN/workflow.md +215 -0
  107. package/templates/industry/devops/en/ci-cd-pipeline.md +410 -0
  108. package/templates/industry/web-dev/en/api-design.md +299 -0
  109. package/templates/industry/web-dev/en/react-nextjs-setup.md +236 -0
@@ -0,0 +1,2644 @@
1
+ import * as ansis from 'ansis';
2
+
3
+ declare const CLAUDE_DIR: string;
4
+ declare const SETTINGS_FILE: string;
5
+ declare const CLAUDE_MD_FILE: string;
6
+ declare const ClAUDE_CONFIG_FILE: string;
7
+ declare const CLAUDE_VSC_CONFIG_FILE: string;
8
+ declare const CODEX_DIR: string;
9
+ declare const CODEX_CONFIG_FILE: string;
10
+ declare const CODEX_AUTH_FILE: string;
11
+ declare const CODEX_AGENTS_FILE: string;
12
+ declare const CODEX_PROMPTS_DIR: string;
13
+ declare const AIDER_DIR: string;
14
+ declare const AIDER_CONFIG_FILE: string;
15
+ declare const AIDER_ENV_FILE: string;
16
+ declare const CONTINUE_DIR: string;
17
+ declare const CONTINUE_CONFIG_FILE: string;
18
+ declare const CLINE_DIR: string;
19
+ declare const CLINE_CONFIG_FILE: string;
20
+ declare const CURSOR_DIR: string;
21
+ declare const CURSOR_CONFIG_FILE: string;
22
+ declare const CCJK_CONFIG_DIR: string;
23
+ declare const CCJK_CONFIG_FILE: string;
24
+ declare const CCJK_PLUGINS_DIR: string;
25
+ declare const CCJK_SKILLS_DIR: string;
26
+ declare const CCJK_GROUPS_DIR: string;
27
+ declare const LEGACY_ZCF_CONFIG_DIR: string;
28
+ declare const LEGACY_ZCF_CONFIG_FILE: string;
29
+ declare const LEGACY_ZCF_CONFIG_FILES: string[];
30
+ /** @deprecated Use CCJK_CONFIG_DIR instead */
31
+ declare const ZCF_CONFIG_DIR: string;
32
+ /** @deprecated Use CCJK_CONFIG_FILE instead */
33
+ declare const ZCF_CONFIG_FILE: string;
34
+ declare const CODE_TOOL_TYPES: readonly ["claude-code", "codex", "aider", "continue", "cline", "cursor"];
35
+ type CodeToolType = (typeof CODE_TOOL_TYPES)[number];
36
+ declare const DEFAULT_CODE_TOOL_TYPE: CodeToolType;
37
+ declare const CODE_TOOL_BANNERS: Record<CodeToolType, string>;
38
+ declare const CODE_TOOL_ALIASES: Record<string, CodeToolType>;
39
+ declare const CODE_TOOL_INFO: Record<CodeToolType, {
40
+ name: string;
41
+ description: string;
42
+ website: string;
43
+ installCmd: string;
44
+ configFormat: 'json' | 'toml' | 'yaml';
45
+ category: 'cli' | 'extension' | 'editor';
46
+ }>;
47
+ declare function isCodeToolType(value: any): value is CodeToolType;
48
+ declare const API_DEFAULT_URL = "https://api.anthropic.com";
49
+ declare const API_ENV_KEY = "ANTHROPIC_API_KEY";
50
+ declare function resolveCodeToolType(value: unknown): CodeToolType;
51
+ declare const SUPPORTED_LANGS: readonly ["zh-CN", "en"];
52
+ type SupportedLang = (typeof SUPPORTED_LANGS)[number];
53
+ declare const LANG_LABELS: {
54
+ readonly 'zh-CN': "简体中文";
55
+ readonly en: "English";
56
+ };
57
+ declare const AI_OUTPUT_LANGUAGES: {
58
+ readonly 'zh-CN': {
59
+ readonly directive: "Always respond in Chinese-simplified";
60
+ };
61
+ readonly en: {
62
+ readonly directive: "Always respond in English";
63
+ };
64
+ readonly custom: {
65
+ readonly directive: "";
66
+ };
67
+ };
68
+ type AiOutputLanguage = keyof typeof AI_OUTPUT_LANGUAGES;
69
+ declare function getAiOutputLanguageLabel(lang: AiOutputLanguage): string;
70
+
71
+ interface InitOptions {
72
+ configLang?: SupportedLang;
73
+ aiOutputLang?: AiOutputLanguage | string;
74
+ force?: boolean;
75
+ skipBanner?: boolean;
76
+ skipPrompt?: boolean;
77
+ codeType?: CodeToolType | string;
78
+ configAction?: 'new' | 'backup' | 'merge' | 'docs-only' | 'skip';
79
+ apiType?: 'auth_token' | 'api_key' | 'ccr_proxy' | 'skip';
80
+ apiKey?: string;
81
+ apiUrl?: string;
82
+ apiModel?: string;
83
+ apiHaikuModel?: string;
84
+ apiSonnetModel?: string;
85
+ apiOpusModel?: string;
86
+ provider?: string;
87
+ mcpServices?: string[] | string | boolean;
88
+ workflows?: string[] | string | boolean;
89
+ outputStyles?: string[] | string | boolean;
90
+ defaultOutputStyle?: string;
91
+ allLang?: string;
92
+ installCometixLine?: string | boolean;
93
+ apiConfigs?: string;
94
+ apiConfigsFile?: string;
95
+ }
96
+ declare function init(options?: InitOptions): Promise<void>;
97
+
98
+ /**
99
+ * Skill category types
100
+ */
101
+ type SkillCategory = 'git' | 'dev' | 'seo' | 'devops' | 'testing' | 'docs' | 'review' | 'custom';
102
+ /**
103
+ * Skill definition interface
104
+ */
105
+ interface CcjkSkill {
106
+ /** Unique skill identifier */
107
+ id: string;
108
+ /** Localized skill name */
109
+ name: Record<SupportedLang, string>;
110
+ /** Localized skill description */
111
+ description: Record<SupportedLang, string>;
112
+ /** Skill category */
113
+ category: SkillCategory;
114
+ /** Command triggers (e.g., /ts-debug, /py-test) */
115
+ triggers: string[];
116
+ /** Skill template content (markdown) */
117
+ template: string;
118
+ /** Associated agent IDs */
119
+ agents?: string[];
120
+ /** Whether skill is enabled */
121
+ enabled: boolean;
122
+ /** Skill version */
123
+ version: string;
124
+ /** Author information */
125
+ author?: string;
126
+ /** Tags for search/filtering */
127
+ tags?: string[];
128
+ }
129
+ /**
130
+ * Batch skill creation options
131
+ */
132
+ interface BatchSkillOptions {
133
+ /** Language-specific skills */
134
+ lang?: 'typescript' | 'python' | 'rust' | 'go' | 'java' | 'ruby';
135
+ /** Site-type specific skills */
136
+ site?: 'ecommerce' | 'saas' | 'blog' | 'api' | 'dashboard';
137
+ /** SEO skills */
138
+ seo?: boolean;
139
+ /** DevOps skills */
140
+ devops?: boolean;
141
+ /** Custom category */
142
+ customCategory?: string;
143
+ /** Output directory */
144
+ outputDir?: string;
145
+ }
146
+ /**
147
+ * Batch skill template definition
148
+ */
149
+ interface BatchSkillTemplate {
150
+ category: SkillCategory;
151
+ skills: Array<{
152
+ id: string;
153
+ name: Record<SupportedLang, string>;
154
+ description: Record<SupportedLang, string>;
155
+ triggers: string[];
156
+ templateFile: string;
157
+ agents?: string[];
158
+ tags?: string[];
159
+ }>;
160
+ }
161
+ /**
162
+ * Skill installation result
163
+ */
164
+ interface SkillInstallResult {
165
+ skillId: string;
166
+ success: boolean;
167
+ path?: string;
168
+ error?: string;
169
+ }
170
+ /**
171
+ * Skill registry state
172
+ */
173
+ interface SkillRegistry {
174
+ skills: Map<string, CcjkSkill>;
175
+ categories: Map<SkillCategory, string[]>;
176
+ lastUpdated: Date;
177
+ }
178
+ /**
179
+ * Skill search options
180
+ */
181
+ interface SkillSearchOptions {
182
+ query?: string;
183
+ category?: SkillCategory;
184
+ tags?: string[];
185
+ enabled?: boolean;
186
+ limit?: number;
187
+ }
188
+ /**
189
+ * Skill export format
190
+ */
191
+ interface SkillExport {
192
+ version: string;
193
+ exportedAt: string;
194
+ skills: CcjkSkill[];
195
+ }
196
+
197
+ /**
198
+ * Plugin metadata
199
+ */
200
+ interface PluginMetadata {
201
+ /** Plugin unique name */
202
+ name: string;
203
+ /** Plugin version (semver) */
204
+ version: string;
205
+ /** Plugin description */
206
+ description: string;
207
+ /** Plugin author */
208
+ author?: string;
209
+ /** Plugin homepage */
210
+ homepage?: string;
211
+ /** Plugin license */
212
+ license?: string;
213
+ /** Minimum CCJK version required */
214
+ minCcjkVersion?: string;
215
+ /** Plugin keywords for discovery */
216
+ keywords?: string[];
217
+ }
218
+ /**
219
+ * Workflow extension provided by plugin
220
+ */
221
+ interface WorkflowExtension {
222
+ id: string;
223
+ name: Record<SupportedLang, string>;
224
+ description?: Record<SupportedLang, string>;
225
+ category: string;
226
+ commands: string[];
227
+ agents?: Array<{
228
+ id: string;
229
+ filename: string;
230
+ required: boolean;
231
+ }>;
232
+ /** Template content or path relative to plugin */
233
+ templates: Record<SupportedLang, string>;
234
+ }
235
+ /**
236
+ * Agent extension provided by plugin
237
+ */
238
+ interface AgentExtension {
239
+ id: string;
240
+ name: string;
241
+ description: string;
242
+ model: 'opus' | 'sonnet' | 'haiku' | 'inherit';
243
+ /** Agent definition content (markdown) */
244
+ definition: string;
245
+ }
246
+ /**
247
+ * MCP service extension provided by plugin
248
+ */
249
+ interface McpServiceExtension {
250
+ id: string;
251
+ name: Record<SupportedLang, string>;
252
+ description?: Record<SupportedLang, string>;
253
+ requiresApiKey: boolean;
254
+ apiKeyEnvVar?: string;
255
+ config: {
256
+ type: 'stdio' | 'http';
257
+ command?: string;
258
+ args?: string[];
259
+ url?: string;
260
+ env?: Record<string, string>;
261
+ };
262
+ }
263
+ /**
264
+ * Output style extension provided by plugin
265
+ */
266
+ interface OutputStyleExtension {
267
+ id: string;
268
+ name: Record<SupportedLang, string>;
269
+ description?: Record<SupportedLang, string>;
270
+ /** Style template content (markdown) */
271
+ template: string;
272
+ }
273
+ /**
274
+ * Command extension provided by plugin
275
+ */
276
+ interface CommandExtension {
277
+ name: string;
278
+ description: string;
279
+ aliases?: string[];
280
+ options?: Array<{
281
+ name: string;
282
+ description: string;
283
+ type: 'string' | 'boolean' | 'number';
284
+ required?: boolean;
285
+ default?: any;
286
+ }>;
287
+ /** Handler function as string (will be evaluated) */
288
+ handler: string;
289
+ }
290
+ /**
291
+ * Plugin context passed to lifecycle hooks
292
+ */
293
+ interface PluginContext {
294
+ /** CCJK version */
295
+ ccjkVersion: string;
296
+ /** Plugin config directory */
297
+ configDir: string;
298
+ /** i18n instance */
299
+ i18n: any;
300
+ /** Logger instance */
301
+ logger: PluginLogger;
302
+ /** Plugin storage */
303
+ storage: PluginStorage;
304
+ }
305
+ /**
306
+ * Plugin logger interface
307
+ */
308
+ interface PluginLogger {
309
+ info: (message: string) => void;
310
+ warn: (message: string) => void;
311
+ error: (message: string) => void;
312
+ debug: (message: string) => void;
313
+ }
314
+ /**
315
+ * Plugin storage interface
316
+ */
317
+ interface PluginStorage {
318
+ get: <T>(key: string) => T | undefined;
319
+ set: <T>(key: string, value: T) => void;
320
+ delete: (key: string) => void;
321
+ clear: () => void;
322
+ }
323
+ /**
324
+ * Main plugin interface
325
+ */
326
+ interface CcjkPlugin {
327
+ /** Plugin metadata */
328
+ metadata: PluginMetadata;
329
+ /** Lifecycle: Called when plugin is loaded */
330
+ onLoad?: (context: PluginContext) => Promise<void>;
331
+ /** Lifecycle: Called when plugin is unloaded */
332
+ onUnload?: () => Promise<void>;
333
+ /** Lifecycle: Called when CCJK starts */
334
+ onStart?: (context: PluginContext) => Promise<void>;
335
+ /** Extension points */
336
+ workflows?: WorkflowExtension[];
337
+ agents?: AgentExtension[];
338
+ mcpServices?: McpServiceExtension[];
339
+ outputStyles?: OutputStyleExtension[];
340
+ commands?: CommandExtension[];
341
+ skills?: CcjkSkill[];
342
+ /** Configuration schema (JSON Schema) */
343
+ configSchema?: Record<string, any>;
344
+ }
345
+ /**
346
+ * Loaded plugin with runtime state
347
+ */
348
+ interface LoadedPlugin {
349
+ plugin: CcjkPlugin;
350
+ path: string;
351
+ enabled: boolean;
352
+ loadedAt: Date;
353
+ error?: string;
354
+ }
355
+ /**
356
+ * Plugin registry entry
357
+ */
358
+ interface PluginInfo {
359
+ name: string;
360
+ version: string;
361
+ description: string;
362
+ enabled: boolean;
363
+ path: string;
364
+ author?: string;
365
+ }
366
+ /**
367
+ * Plugin configuration
368
+ */
369
+ interface PluginConfig {
370
+ /** List of enabled plugin names */
371
+ enabled: string[];
372
+ /** List of disabled plugin names */
373
+ disabled: string[];
374
+ /** Per-plugin settings */
375
+ settings: Record<string, Record<string, any>>;
376
+ }
377
+ /**
378
+ * Plugin discovery result
379
+ */
380
+ interface PluginDiscoveryResult {
381
+ name: string;
382
+ path: string;
383
+ metadata: PluginMetadata;
384
+ valid: boolean;
385
+ error?: string;
386
+ }
387
+
388
+ /**
389
+ * Ensure plugins directory exists
390
+ */
391
+ declare function ensurePluginsDir(): void;
392
+ /**
393
+ * Read plugin configuration
394
+ */
395
+ declare function readPluginConfig(): PluginConfig;
396
+ /**
397
+ * Write plugin configuration
398
+ */
399
+ declare function writePluginConfig(config: PluginConfig): void;
400
+ /**
401
+ * Discover plugins in the plugins directory
402
+ */
403
+ declare function discoverPlugins(): Promise<PluginDiscoveryResult[]>;
404
+ /**
405
+ * Load a plugin
406
+ */
407
+ declare function loadPlugin(pathOrName: string): Promise<LoadedPlugin | null>;
408
+ /**
409
+ * Unload a plugin
410
+ */
411
+ declare function unloadPlugin(name: string): Promise<boolean>;
412
+ /**
413
+ * Get all loaded plugins
414
+ */
415
+ declare function getLoadedPlugins(): LoadedPlugin[];
416
+ /**
417
+ * Get plugin info
418
+ */
419
+ declare function getPluginInfo(name: string): PluginInfo | null;
420
+ /**
421
+ * List all plugins (loaded and discovered)
422
+ */
423
+ declare function listPlugins(): Promise<PluginInfo[]>;
424
+ /**
425
+ * Enable a plugin
426
+ */
427
+ declare function enablePlugin(name: string): Promise<boolean>;
428
+ /**
429
+ * Disable a plugin
430
+ */
431
+ declare function disablePlugin(name: string): Promise<boolean>;
432
+ /**
433
+ * Get all workflows from plugins
434
+ */
435
+ declare function getPluginWorkflows(): any[];
436
+ /**
437
+ * Get all agents from plugins
438
+ */
439
+ declare function getPluginAgents(): any[];
440
+ /**
441
+ * Get all MCP services from plugins
442
+ */
443
+ declare function getPluginMcpServices(): any[];
444
+ /**
445
+ * Get all output styles from plugins
446
+ */
447
+ declare function getPluginOutputStyles(): any[];
448
+ /**
449
+ * Get all skills from plugins
450
+ */
451
+ declare function getPluginSkills(): any[];
452
+ /**
453
+ * Initialize all enabled plugins
454
+ */
455
+ declare function initializePlugins(): Promise<void>;
456
+
457
+ /**
458
+ * Project context for LLM analysis
459
+ */
460
+ interface ProjectContext$1 {
461
+ /** Project root path */
462
+ rootPath: string;
463
+ /** Project name */
464
+ projectName?: string;
465
+ /** Root directory */
466
+ rootDir?: string;
467
+ /** Detected language/framework */
468
+ framework?: string;
469
+ /** Detected frameworks */
470
+ frameworks?: string[];
471
+ /** Detected languages */
472
+ languages?: string[];
473
+ /** Package manager */
474
+ packageManager?: 'npm' | 'yarn' | 'pnpm' | 'bun';
475
+ /** Source directories */
476
+ sourceDirs: string[];
477
+ /** Test directories */
478
+ testDirs: string[];
479
+ /** Configuration files */
480
+ configFiles: string[];
481
+ /** File structure */
482
+ fileStructure?: string[];
483
+ /** Git information */
484
+ git?: {
485
+ branch: string;
486
+ lastCommit: string;
487
+ uncommittedChanges: number;
488
+ };
489
+ }
490
+ /**
491
+ * Scan target discovered by LLM
492
+ */
493
+ interface ScanTarget {
494
+ /** Target type */
495
+ type: 'file' | 'directory' | 'function' | 'class' | 'module' | 'api' | 'config';
496
+ /** Target path */
497
+ path: string;
498
+ /** Reason for scanning */
499
+ reason: string;
500
+ /** Priority (1-10, 10 being highest) */
501
+ priority: number;
502
+ /** Estimated complexity */
503
+ complexity: 'low' | 'medium' | 'high';
504
+ /** Tags for categorization */
505
+ tags: string[];
506
+ }
507
+ /**
508
+ * Scan strategy determined by LLM
509
+ */
510
+ interface ScanStrategy {
511
+ /** Strategy type */
512
+ type: 'security' | 'performance' | 'quality' | 'accessibility' | 'comprehensive';
513
+ /** Specific checks to perform */
514
+ checks: string[];
515
+ /** Depth of analysis */
516
+ depth: 'surface' | 'moderate' | 'deep';
517
+ /** Context to include */
518
+ contextFiles: string[];
519
+ /** LLM model to use */
520
+ model: 'opus' | 'sonnet' | 'haiku';
521
+ /** Focus areas */
522
+ focusAreas?: string[];
523
+ }
524
+ /**
525
+ * Scan result from LLM analysis
526
+ */
527
+ interface ScanResult {
528
+ /** Target that was scanned */
529
+ target: ScanTarget;
530
+ /** Strategy used */
531
+ strategy: ScanStrategy;
532
+ /** Timestamp */
533
+ timestamp: Date;
534
+ /** Scanned at timestamp */
535
+ scannedAt?: Date;
536
+ /** Duration in milliseconds */
537
+ duration: number;
538
+ /** Issues found */
539
+ issues: Issue[];
540
+ /** Metrics collected */
541
+ metrics: Record<string, number>;
542
+ /** LLM reasoning/notes */
543
+ notes: string;
544
+ }
545
+ /**
546
+ * Issue found during scan
547
+ */
548
+ interface Issue {
549
+ /** Issue unique ID */
550
+ id: string;
551
+ /** Issue title */
552
+ title: string;
553
+ /** Detailed description */
554
+ description: string;
555
+ /** Severity level */
556
+ severity: 'critical' | 'high' | 'medium' | 'low' | 'info';
557
+ /** Issue category */
558
+ category: 'security' | 'performance' | 'quality' | 'style' | 'accessibility' | 'logic';
559
+ /** Issue type */
560
+ type?: string;
561
+ /** File path */
562
+ file: string;
563
+ /** Line number (if applicable) */
564
+ line?: number;
565
+ /** Column number (if applicable) */
566
+ column?: number;
567
+ /** Code snippet */
568
+ snippet?: string;
569
+ /** Location info */
570
+ location?: {
571
+ file?: string;
572
+ startLine?: number;
573
+ endLine?: number;
574
+ column?: number;
575
+ snippet?: string;
576
+ } | string;
577
+ /** Suggested fix */
578
+ suggestedFix?: string;
579
+ /** Suggestion text */
580
+ suggestion?: string;
581
+ /** Whether auto-fix is safe */
582
+ autoFixable: boolean;
583
+ /** Related issues */
584
+ relatedIssues?: string[];
585
+ /** Confidence score (0-1) */
586
+ confidence: number;
587
+ }
588
+ /**
589
+ * Evaluated issue with LLM decision
590
+ */
591
+ interface EvaluatedIssue extends Issue {
592
+ /** LLM evaluation reasoning */
593
+ evaluation: string;
594
+ /** Reasoning explanation */
595
+ reasoning?: string;
596
+ /** Actual priority (may differ from severity) */
597
+ priority: number;
598
+ /** Adjusted severity after evaluation */
599
+ adjustedSeverity?: 'critical' | 'high' | 'medium' | 'low' | 'info';
600
+ /** Whether this is a real issue */
601
+ isRealIssue?: boolean;
602
+ /** Risks associated */
603
+ risks?: string[];
604
+ /** Related patterns */
605
+ relatedPatterns?: string[];
606
+ /** Recommended action */
607
+ action: 'fix-now' | 'fix-later' | 'monitor' | 'ignore';
608
+ /** Effort estimate */
609
+ effort: 'trivial' | 'small' | 'medium' | 'large';
610
+ }
611
+ /**
612
+ * Fix decision from LLM
613
+ */
614
+ interface FixDecision {
615
+ /** Whether to auto-fix */
616
+ shouldFix: boolean;
617
+ /** Whether can auto-fix */
618
+ canAutoFix?: boolean;
619
+ /** Whether requires review */
620
+ requiresReview?: boolean;
621
+ /** Risk level */
622
+ riskLevel?: 'none' | 'low' | 'medium' | 'high';
623
+ /** Reasoning */
624
+ reason: string;
625
+ /** Reasoning (alias) */
626
+ reasoning?: string;
627
+ /** Risk assessment */
628
+ risk: 'none' | 'low' | 'medium' | 'high';
629
+ /** Prerequisites before fixing */
630
+ prerequisites: string[];
631
+ /** Post-fix verification steps */
632
+ verificationSteps: string[];
633
+ /** Conditions for safe auto-fix */
634
+ conditions?: string[];
635
+ /** Alternative approaches */
636
+ alternatives?: string[];
637
+ }
638
+ /**
639
+ * Fix plan generated by LLM
640
+ */
641
+ interface FixPlan {
642
+ /** Issue being fixed */
643
+ issueId: string;
644
+ /** Approach description */
645
+ approach: string;
646
+ /** Files to modify */
647
+ filesToModify: string[];
648
+ /** Expected changes description */
649
+ expectedChanges: string;
650
+ /** Rollback strategy */
651
+ rollbackStrategy: string;
652
+ /** Rollback plan */
653
+ rollbackPlan?: string;
654
+ /** Tests to run after fix */
655
+ testsToRun: string[];
656
+ /** Steps to execute */
657
+ steps?: Array<string | {
658
+ action: string;
659
+ description?: string;
660
+ order?: number;
661
+ target?: string;
662
+ changes?: string;
663
+ }>;
664
+ /** Validations to run */
665
+ validations?: string[];
666
+ /** Side effects */
667
+ sideEffects?: string[];
668
+ /** Test strategy */
669
+ testStrategy?: string;
670
+ /** Estimated duration in minutes */
671
+ estimatedDuration?: number;
672
+ }
673
+ /**
674
+ * Generated fix from LLM
675
+ */
676
+ interface GeneratedFix {
677
+ /** Fix ID */
678
+ id?: string;
679
+ /** Issue ID */
680
+ issueId?: string;
681
+ /** Plan ID */
682
+ planId?: string;
683
+ /** Plan used */
684
+ plan: FixPlan;
685
+ /** File changes */
686
+ changes: FileChange[];
687
+ /** Commit message */
688
+ commitMessage: string;
689
+ /** Timestamp */
690
+ generatedAt: Date;
691
+ /** File path */
692
+ filePath?: string;
693
+ /** Fixed code */
694
+ fixedCode?: string;
695
+ /** Imports needed */
696
+ imports?: string[];
697
+ /** Warnings */
698
+ warnings?: string[];
699
+ /** Approach used */
700
+ approach?: string;
701
+ /** Description */
702
+ description?: string;
703
+ /** Pros */
704
+ pros?: string[];
705
+ }
706
+ /**
707
+ * File change in a fix
708
+ */
709
+ interface FileChange {
710
+ /** File path */
711
+ path: string;
712
+ /** File reference */
713
+ file?: string;
714
+ /** Change type */
715
+ type: 'modify' | 'create' | 'delete' | 'rename';
716
+ /** Original content (for modify/delete) */
717
+ originalContent?: string;
718
+ /** New content (for modify/create) */
719
+ newContent?: string;
720
+ /** New path (for rename) */
721
+ newPath?: string;
722
+ /** Diff (unified format) */
723
+ diff?: string;
724
+ /** Start line */
725
+ startLine?: number;
726
+ /** End line */
727
+ endLine?: number;
728
+ /** Explanation */
729
+ explanation?: string;
730
+ /** Before content */
731
+ before?: string;
732
+ /** After content */
733
+ after?: string;
734
+ }
735
+ /**
736
+ * Fix application result
737
+ */
738
+ interface FixResult {
739
+ /** Fix that was applied */
740
+ fix: GeneratedFix;
741
+ /** Fix ID */
742
+ fixId?: string;
743
+ /** Success status */
744
+ success: boolean;
745
+ /** Error message if failed */
746
+ error?: string;
747
+ /** Original content before fix */
748
+ originalContent?: string;
749
+ /** New content after fix */
750
+ newContent?: string;
751
+ /** Applied changes */
752
+ appliedChanges: FileChange[];
753
+ /** Failed changes */
754
+ failedChanges: Array<{
755
+ change: FileChange;
756
+ error: string;
757
+ }>;
758
+ /** Backup paths */
759
+ backupPaths: string[];
760
+ /** Timestamp */
761
+ appliedAt: Date;
762
+ /** Duration in ms */
763
+ duration?: number;
764
+ /** Changes applied count */
765
+ changesApplied?: number;
766
+ }
767
+ /**
768
+ * Verification result from LLM
769
+ */
770
+ interface VerifyResult {
771
+ /** Fix ID that was verified */
772
+ fixId?: string;
773
+ /** Fix that was verified */
774
+ fix?: GeneratedFix;
775
+ /** Overall success */
776
+ success?: boolean;
777
+ /** Is the fix correct */
778
+ isCorrect?: boolean;
779
+ /** Issue resolved */
780
+ issueResolved?: boolean;
781
+ /** Syntax valid */
782
+ syntaxValid?: boolean;
783
+ /** Functionality preserved */
784
+ functionalityPreserved?: boolean;
785
+ /** Logic errors found */
786
+ logicErrors?: string[];
787
+ /** Edge cases handled */
788
+ edgeCasesHandled?: boolean;
789
+ /** Style consistent */
790
+ styleConsistent?: boolean;
791
+ /** Code correctness verified */
792
+ codeCorrect?: boolean;
793
+ /** No regressions detected */
794
+ noRegressions?: boolean;
795
+ /** No new issues introduced */
796
+ noNewIssues?: boolean;
797
+ /** Confidence score (0-1) */
798
+ confidence?: number;
799
+ /** Reasoning */
800
+ reasoning?: string;
801
+ /** Verification notes */
802
+ notes?: string;
803
+ /** Suggestions */
804
+ suggestions?: string[];
805
+ /** Recommendations */
806
+ recommendations?: string[];
807
+ /** Verified timestamp */
808
+ verifiedAt?: Date;
809
+ }
810
+ /**
811
+ * Regression found during verification
812
+ */
813
+ interface Regression {
814
+ /** Type of regression */
815
+ type: 'functional' | 'performance' | 'breaking-change';
816
+ /** Description */
817
+ description: string;
818
+ /** Affected files */
819
+ affectedFiles: string[];
820
+ /** Severity */
821
+ severity: 'critical' | 'high' | 'medium' | 'low';
822
+ /** File path */
823
+ file?: string;
824
+ /** Location */
825
+ location?: string;
826
+ /** Impact description */
827
+ impact?: string;
828
+ /** Suggestion for fix */
829
+ suggestion?: string;
830
+ }
831
+ /**
832
+ * New issue introduced by fix
833
+ */
834
+ interface NewIssue extends Issue {
835
+ /** The fix that introduced this issue */
836
+ introducedByFix: string;
837
+ }
838
+ /**
839
+ * Execution plan for async audit
840
+ */
841
+ interface ExecutionPlan {
842
+ /** Plan ID */
843
+ id: string;
844
+ /** Creation timestamp */
845
+ createdAt: Date;
846
+ /** Targets to scan */
847
+ targets: ScanTarget[];
848
+ /** Execution order */
849
+ order: string[];
850
+ /** Parallel execution groups */
851
+ parallelGroups: string[][];
852
+ /** Estimated duration */
853
+ estimatedDuration: number;
854
+ /** Total estimated minutes */
855
+ totalEstimatedMinutes?: number;
856
+ /** Priority queue */
857
+ priorityQueue: Array<{
858
+ targetId: string;
859
+ priority: number;
860
+ }>;
861
+ /** Execution phases */
862
+ phases?: Array<{
863
+ name: string;
864
+ description?: string;
865
+ targets: string[];
866
+ issueIds?: string[];
867
+ parallel?: boolean;
868
+ estimatedMinutes?: number;
869
+ }>;
870
+ /** Recommendations */
871
+ recommendations?: string[];
872
+ /** Issues to process */
873
+ issues?: string[];
874
+ }
875
+ /**
876
+ * ShenCha configuration
877
+ */
878
+ interface ShenChaConfig {
879
+ /** Schedule configuration */
880
+ schedule: {
881
+ intervalHours: number;
882
+ totalDurationHours: number;
883
+ startTime?: string;
884
+ };
885
+ /** LLM configuration */
886
+ llm: {
887
+ baseUrl: string;
888
+ apiKey?: string;
889
+ models: {
890
+ scanning: string;
891
+ analysis: string;
892
+ fixing: string;
893
+ };
894
+ maxTokens?: number;
895
+ temperature?: number;
896
+ };
897
+ /** Scanner configuration */
898
+ scanners: {
899
+ page?: {
900
+ enabled: boolean;
901
+ criticalPages?: string[];
902
+ };
903
+ api?: {
904
+ enabled: boolean;
905
+ endpoints?: string[];
906
+ };
907
+ errorLog?: {
908
+ enabled: boolean;
909
+ lookbackHours?: number;
910
+ };
911
+ userBehavior?: {
912
+ enabled: boolean;
913
+ database?: string;
914
+ };
915
+ };
916
+ /** Fixer configuration */
917
+ fixer: {
918
+ enabled: boolean;
919
+ autoCommit: boolean;
920
+ safetyChecks: {
921
+ requireTypeCheck: boolean;
922
+ requireLintPass: boolean;
923
+ requireTestPass: boolean;
924
+ maxFilesPerFix: number;
925
+ maxLineChanges: number;
926
+ requireReview: string[];
927
+ };
928
+ };
929
+ /** Reporter configuration */
930
+ reporter: {
931
+ outputDir: string;
932
+ formats: Array<'markdown' | 'json' | 'html'>;
933
+ webhooks?: Array<{
934
+ url: string;
935
+ events: string[];
936
+ }>;
937
+ };
938
+ }
939
+ /**
940
+ * Audit cycle status
941
+ */
942
+ interface AuditCycleStatus {
943
+ /** Cycle number */
944
+ cycleNumber: number;
945
+ /** Total cycles planned */
946
+ totalCycles: number;
947
+ /** Current status */
948
+ status: 'pending' | 'scanning' | 'analyzing' | 'fixing' | 'verifying' | 'completed' | 'failed';
949
+ /** Start time */
950
+ startedAt?: Date;
951
+ /** End time */
952
+ completedAt?: Date;
953
+ /** Issues found this cycle */
954
+ issuesFound: number;
955
+ /** Issues fixed this cycle */
956
+ issuesFixed: number;
957
+ /** Current target being processed */
958
+ currentTarget?: string;
959
+ /** Progress percentage */
960
+ progress: number;
961
+ }
962
+ /**
963
+ * Audit cycle
964
+ */
965
+ interface AuditCycle {
966
+ /** Cycle ID */
967
+ id: string;
968
+ /** Start time */
969
+ startedAt: Date;
970
+ /** Completion time */
971
+ completedAt?: Date;
972
+ /** Current status */
973
+ status: 'pending' | 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
974
+ /** Current phase */
975
+ currentPhase?: string;
976
+ /** Pause reason if paused */
977
+ pauseReason?: string;
978
+ /** Error message if failed */
979
+ error?: string;
980
+ /** Project context */
981
+ context: ProjectContext$1;
982
+ /** Scan results */
983
+ scanResults: ScanResult[];
984
+ /** Evaluated issues */
985
+ evaluatedIssues: EvaluatedIssue[];
986
+ /** Fix results */
987
+ fixResults: Array<{
988
+ issue: EvaluatedIssue;
989
+ plan: FixPlan;
990
+ fix: GeneratedFix;
991
+ result: FixResult;
992
+ }>;
993
+ /** Generated report */
994
+ report: AuditReport | null;
995
+ }
996
+ /**
997
+ * Audit report
998
+ */
999
+ interface AuditReport {
1000
+ /** Report ID */
1001
+ id: string;
1002
+ /** Cycle ID */
1003
+ cycleId?: string;
1004
+ /** Cycle number */
1005
+ cycleNumber: number;
1006
+ /** Generation timestamp */
1007
+ generatedAt: Date;
1008
+ /** Duration */
1009
+ duration: number;
1010
+ /** Summary */
1011
+ summary: {
1012
+ totalIssues: number;
1013
+ fixedIssues: number;
1014
+ pendingIssues: number;
1015
+ pendingReview?: number;
1016
+ failedFixes?: number;
1017
+ bySeverity?: Record<string, number>;
1018
+ byCategory?: Record<string, number>;
1019
+ byType?: Record<string, number>;
1020
+ healthScore?: number;
1021
+ scores: {
1022
+ security: number;
1023
+ performance: number;
1024
+ quality: number;
1025
+ };
1026
+ };
1027
+ /** Issues by category */
1028
+ issuesByCategory: Record<string, Issue[]>;
1029
+ /** Issues list */
1030
+ issues?: EvaluatedIssue[];
1031
+ /** Fixes applied */
1032
+ fixesApplied: FixResult[];
1033
+ /** Fixes summary */
1034
+ fixes?: Array<{
1035
+ issueId: string;
1036
+ success: boolean;
1037
+ error?: string;
1038
+ }>;
1039
+ /** Recommendations */
1040
+ recommendations: string[];
1041
+ /** Next steps */
1042
+ nextSteps: string[];
1043
+ }
1044
+
1045
+ /**
1046
+ * Initialize skills directory
1047
+ */
1048
+ declare function ensureSkillsDir(): void;
1049
+ /**
1050
+ * Get the skills registry
1051
+ */
1052
+ declare function getRegistry$1(): SkillRegistry;
1053
+ /**
1054
+ * Refresh registry from disk
1055
+ */
1056
+ declare function refreshRegistry$1(): void;
1057
+ /**
1058
+ * Get all skills
1059
+ */
1060
+ declare function getAllSkills(): CcjkSkill[];
1061
+ /**
1062
+ * Get skill by ID
1063
+ */
1064
+ declare function getSkill(id: string): CcjkSkill | undefined;
1065
+ /**
1066
+ * Search skills
1067
+ */
1068
+ declare function searchSkills(options: SkillSearchOptions): CcjkSkill[];
1069
+ /**
1070
+ * Add a skill
1071
+ */
1072
+ declare function addSkill(skill: CcjkSkill): SkillInstallResult;
1073
+ /**
1074
+ * Remove a skill
1075
+ */
1076
+ declare function removeSkill(id: string): boolean;
1077
+ /**
1078
+ * Enable/disable a skill
1079
+ */
1080
+ declare function setSkillEnabled(id: string, enabled: boolean): boolean;
1081
+ /**
1082
+ * Export skills to JSON
1083
+ */
1084
+ declare function exportSkills(skillIds?: string[]): SkillExport;
1085
+ /**
1086
+ * Import skills from JSON
1087
+ */
1088
+ declare function importSkills(data: SkillExport): SkillInstallResult[];
1089
+ /**
1090
+ * Create skills from batch template
1091
+ */
1092
+ declare function createBatchSkills(options: BatchSkillOptions): SkillInstallResult[];
1093
+ /**
1094
+ * Get available batch categories
1095
+ */
1096
+ declare function getBatchCategories(): string[];
1097
+
1098
+ /**
1099
+ * Subagent group category
1100
+ */
1101
+ type GroupCategory = 'language' | 'site-type' | 'seo' | 'devops' | 'testing' | 'custom';
1102
+ /**
1103
+ * Agent definition within a group
1104
+ */
1105
+ interface AgentDefinition {
1106
+ /** Agent unique ID */
1107
+ id: string;
1108
+ /** Agent name */
1109
+ name: string;
1110
+ /** Agent description */
1111
+ description: string;
1112
+ /** Model to use */
1113
+ model: 'opus' | 'sonnet' | 'haiku' | 'inherit';
1114
+ /** Agent definition file content (markdown with YAML frontmatter) */
1115
+ definition: string;
1116
+ /** Whether agent is required in the group */
1117
+ required: boolean;
1118
+ /** Agent specialization tags */
1119
+ tags?: string[];
1120
+ }
1121
+ /**
1122
+ * Subagent group definition
1123
+ */
1124
+ interface SubagentGroup {
1125
+ /** Group unique ID */
1126
+ id: string;
1127
+ /** Localized group name */
1128
+ name: Record<SupportedLang, string>;
1129
+ /** Localized group description */
1130
+ description: Record<SupportedLang, string>;
1131
+ /** Group category */
1132
+ category: GroupCategory;
1133
+ /** Agents in this group */
1134
+ agents: AgentDefinition[];
1135
+ /** Associated skill IDs */
1136
+ skills: string[];
1137
+ /** Whether group is enabled by default */
1138
+ defaultEnabled: boolean;
1139
+ /** Group version */
1140
+ version: string;
1141
+ /** Group author */
1142
+ author?: string;
1143
+ /** Group icon (emoji or unicode) */
1144
+ icon?: string;
1145
+ }
1146
+ /**
1147
+ * Predefined language-specific groups
1148
+ */
1149
+ type LanguageGroupId = 'typescript-dev' | 'python-dev' | 'rust-dev' | 'go-dev' | 'java-dev' | 'ruby-dev';
1150
+ /**
1151
+ * Predefined site-type groups
1152
+ */
1153
+ type SiteTypeGroupId = 'ecommerce' | 'saas' | 'blog-cms' | 'api-service' | 'dashboard' | 'mobile-app';
1154
+ /**
1155
+ * Predefined specialty groups
1156
+ */
1157
+ type SpecialtyGroupId = 'seo-team' | 'security-team' | 'performance-team' | 'testing-team' | 'devops-team';
1158
+ /**
1159
+ * All predefined group IDs
1160
+ */
1161
+ type PredefinedGroupId = LanguageGroupId | SiteTypeGroupId | SpecialtyGroupId;
1162
+ /**
1163
+ * Group installation result
1164
+ */
1165
+ interface GroupInstallResult {
1166
+ groupId: string;
1167
+ success: boolean;
1168
+ installedAgents: string[];
1169
+ installedSkills: string[];
1170
+ errors?: string[];
1171
+ }
1172
+ /**
1173
+ * Group registry state
1174
+ */
1175
+ interface GroupRegistry {
1176
+ groups: Map<string, SubagentGroup>;
1177
+ enabledGroups: Set<string>;
1178
+ lastUpdated: Date;
1179
+ }
1180
+ /**
1181
+ * Group search options
1182
+ */
1183
+ interface GroupSearchOptions {
1184
+ query?: string;
1185
+ category?: GroupCategory;
1186
+ enabled?: boolean;
1187
+ limit?: number;
1188
+ }
1189
+ /**
1190
+ * Group export format
1191
+ */
1192
+ interface GroupExport {
1193
+ version: string;
1194
+ exportedAt: string;
1195
+ groups: SubagentGroup[];
1196
+ }
1197
+ /**
1198
+ * Agent template for creating new agents in a group
1199
+ */
1200
+ interface AgentTemplate {
1201
+ category: GroupCategory;
1202
+ name: string;
1203
+ modelDefault: 'opus' | 'sonnet' | 'haiku';
1204
+ responsibilities: string[];
1205
+ allowedActions: string[];
1206
+ forbiddenActions: string[];
1207
+ technologies: string[];
1208
+ }
1209
+
1210
+ /**
1211
+ * Ensure groups directory exists
1212
+ */
1213
+ declare function ensureGroupsDir(): void;
1214
+ /**
1215
+ * Get the groups registry
1216
+ */
1217
+ declare function getRegistry(): GroupRegistry;
1218
+ /**
1219
+ * Refresh registry from disk
1220
+ */
1221
+ declare function refreshRegistry(): void;
1222
+ /**
1223
+ * Get all groups
1224
+ */
1225
+ declare function getAllGroups(): SubagentGroup[];
1226
+ /**
1227
+ * Get group by ID
1228
+ */
1229
+ declare function getGroup(id: string): SubagentGroup | undefined;
1230
+ /**
1231
+ * Check if group is enabled
1232
+ */
1233
+ declare function isGroupEnabled(id: string): boolean;
1234
+ /**
1235
+ * Search groups
1236
+ */
1237
+ declare function searchGroups(options: GroupSearchOptions): SubagentGroup[];
1238
+ /**
1239
+ * Enable a group
1240
+ */
1241
+ declare function enableGroup(id: string): boolean;
1242
+ /**
1243
+ * Disable a group
1244
+ */
1245
+ declare function disableGroup(id: string): boolean;
1246
+ /**
1247
+ * Add a custom group
1248
+ */
1249
+ declare function addGroup(group: SubagentGroup): GroupInstallResult;
1250
+ /**
1251
+ * Remove a group
1252
+ */
1253
+ declare function removeGroup(id: string): boolean;
1254
+ /**
1255
+ * Export groups
1256
+ */
1257
+ declare function exportGroups(groupIds?: string[]): GroupExport;
1258
+ /**
1259
+ * Import groups
1260
+ */
1261
+ declare function importGroups(data: GroupExport): GroupInstallResult[];
1262
+ /**
1263
+ * Get all enabled agents from all enabled groups
1264
+ */
1265
+ declare function getEnabledAgents(): AgentDefinition[];
1266
+ /**
1267
+ * Get all enabled skills from all enabled groups
1268
+ */
1269
+ declare function getEnabledSkillIds(): string[];
1270
+
1271
+ declare function getPlatform(): 'windows' | 'macos' | 'linux';
1272
+ declare function commandExists(command: string): Promise<boolean>;
1273
+ /**
1274
+ * Get recommended install methods for a code tool based on current platform
1275
+ * Returns methods in priority order (most recommended first)
1276
+ */
1277
+ type CodeType = 'claude-code' | 'codex';
1278
+ type InstallMethod$1 = 'npm' | 'homebrew' | 'curl' | 'powershell' | 'cmd' | 'npm-global' | 'native';
1279
+
1280
+ interface McpService {
1281
+ id: string;
1282
+ name: string;
1283
+ description: string;
1284
+ requiresApiKey: boolean;
1285
+ apiKeyPrompt?: string;
1286
+ apiKeyPlaceholder?: string;
1287
+ apiKeyEnvVar?: string;
1288
+ config: McpServerConfig;
1289
+ }
1290
+ interface McpServerConfig {
1291
+ type: 'stdio' | 'sse';
1292
+ command?: string;
1293
+ args?: string[];
1294
+ url?: string;
1295
+ env?: Record<string, string>;
1296
+ startup_timeout_ms?: number;
1297
+ }
1298
+ interface ClaudeConfiguration {
1299
+ mcpServers: Record<string, McpServerConfig>;
1300
+ hasCompletedOnboarding?: boolean;
1301
+ customApiKeyResponses?: {
1302
+ approved: string[];
1303
+ rejected: string[];
1304
+ };
1305
+ env?: Record<string, string>;
1306
+ primaryApiKey?: string;
1307
+ installMethod?: InstallMethod$1;
1308
+ }
1309
+
1310
+ /**
1311
+ * CCJK API Router Types
1312
+ * Unified type definitions for API routing modes
1313
+ */
1314
+ /**
1315
+ * API Routing Mode
1316
+ */
1317
+ type ApiRoutingMode = 'official' | 'simple' | 'ccr';
1318
+ /**
1319
+ * API Configuration Result
1320
+ */
1321
+ interface ApiConfigResult {
1322
+ success: boolean;
1323
+ mode: ApiRoutingMode;
1324
+ provider?: string;
1325
+ message?: string;
1326
+ error?: string;
1327
+ }
1328
+
1329
+ /**
1330
+ * Display current API configuration status
1331
+ */
1332
+ declare function displayCurrentStatus(lang?: 'en' | 'zh-CN'): void;
1333
+ /**
1334
+ * Interactive API configuration wizard
1335
+ */
1336
+ declare function runConfigWizard(lang?: 'en' | 'zh-CN'): Promise<ApiConfigResult>;
1337
+
1338
+ /**
1339
+ * Detected project information
1340
+ */
1341
+ interface ProjectInfo {
1342
+ name: string;
1343
+ type: ProjectType;
1344
+ packageManager: PackageManager;
1345
+ frameworks: Framework[];
1346
+ buildTools: BuildTool[];
1347
+ testFrameworks: TestFramework[];
1348
+ cicd: CICDSystem[];
1349
+ languages: Language[];
1350
+ hasTypeScript: boolean;
1351
+ hasDocker: boolean;
1352
+ hasMonorepo: boolean;
1353
+ rootDir: string;
1354
+ }
1355
+ /**
1356
+ * Project type classification
1357
+ */
1358
+ type ProjectType = 'frontend' | 'backend' | 'fullstack' | 'library' | 'cli' | 'mobile' | 'desktop' | 'unknown';
1359
+ /**
1360
+ * Package managers
1361
+ */
1362
+ type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'unknown';
1363
+ /**
1364
+ * Frameworks
1365
+ */
1366
+ type Framework = 'react' | 'vue' | 'angular' | 'svelte' | 'nextjs' | 'nuxt' | 'remix' | 'astro' | 'express' | 'fastify' | 'nestjs' | 'koa' | 'hono' | 'django' | 'flask' | 'fastapi' | 'rails' | 'laravel' | 'spring' | 'electron' | 'tauri' | 'react-native' | 'flutter' | 'unknown';
1367
+ /**
1368
+ * Build tools
1369
+ */
1370
+ type BuildTool = 'vite' | 'webpack' | 'rollup' | 'esbuild' | 'swc' | 'turbopack' | 'parcel' | 'tsup' | 'unbuild' | 'unknown';
1371
+ /**
1372
+ * Test frameworks
1373
+ */
1374
+ type TestFramework = 'jest' | 'vitest' | 'mocha' | 'cypress' | 'playwright' | 'pytest' | 'rspec' | 'junit' | 'unknown';
1375
+ /**
1376
+ * CI/CD systems
1377
+ */
1378
+ type CICDSystem = 'github-actions' | 'gitlab-ci' | 'jenkins' | 'circleci' | 'travis' | 'azure-pipelines' | 'unknown';
1379
+ /**
1380
+ * Languages
1381
+ */
1382
+ type Language = 'typescript' | 'javascript' | 'python' | 'ruby' | 'go' | 'rust' | 'java' | 'kotlin' | 'php' | 'csharp' | 'swift' | 'dart';
1383
+ /**
1384
+ * Configuration suggestions
1385
+ */
1386
+ interface ConfigSuggestions {
1387
+ workflows: string[];
1388
+ mcpServices: string[];
1389
+ agents: string[];
1390
+ skills: string[];
1391
+ subagentGroups: string[];
1392
+ outputStyle: string;
1393
+ }
1394
+ /**
1395
+ * Detect package manager
1396
+ */
1397
+ declare function detectPackageManager(dir: string): PackageManager;
1398
+ /**
1399
+ * Detect frameworks from dependencies
1400
+ */
1401
+ declare function detectFrameworks(dir: string): Framework[];
1402
+ /**
1403
+ * Detect build tools
1404
+ */
1405
+ declare function detectBuildTools(dir: string): BuildTool[];
1406
+ /**
1407
+ * Detect test frameworks
1408
+ */
1409
+ declare function detectTestFrameworks(dir: string): TestFramework[];
1410
+ /**
1411
+ * Detect CI/CD systems
1412
+ */
1413
+ declare function detectCICDSystems(dir: string): CICDSystem[];
1414
+ /**
1415
+ * Detect programming languages
1416
+ */
1417
+ declare function detectLanguages(dir: string): Language[];
1418
+ /**
1419
+ * Determine project type
1420
+ */
1421
+ declare function determineProjectType(info: Partial<ProjectInfo>): ProjectType;
1422
+ /**
1423
+ * Detect full project information
1424
+ */
1425
+ declare function detectProject(dir?: string): ProjectInfo;
1426
+ /**
1427
+ * Generate configuration suggestions based on project
1428
+ */
1429
+ declare function generateSuggestions(project: ProjectInfo): ConfigSuggestions;
1430
+ /**
1431
+ * Get a human-readable project summary
1432
+ */
1433
+ declare function getProjectSummary(project: ProjectInfo): string;
1434
+
1435
+ declare const COLORS: {
1436
+ primary: ansis.Ansis;
1437
+ secondary: ansis.Ansis;
1438
+ accent: ansis.Ansis;
1439
+ warning: ansis.Ansis;
1440
+ error: ansis.Ansis;
1441
+ success: ansis.Ansis;
1442
+ muted: ansis.Ansis;
1443
+ bold: ansis.Ansis;
1444
+ };
1445
+ declare function displayBanner(subtitle?: string): void;
1446
+ declare function displayBannerWithInfo(subtitle?: string): void;
1447
+ declare function renderProgressBar(progress: number, width?: number): string;
1448
+ type BoxStyle = 'single' | 'double' | 'rounded' | 'heavy';
1449
+ declare function boxify(content: string, style?: BoxStyle, title?: string): string;
1450
+ declare function sectionDivider(title?: string, width?: number): string;
1451
+ declare const STATUS: {
1452
+ success: (text: string) => string;
1453
+ error: (text: string) => string;
1454
+ warning: (text: string) => string;
1455
+ info: (text: string) => string;
1456
+ pending: (text: string) => string;
1457
+ inProgress: (text: string) => string;
1458
+ };
1459
+ declare function menuItem(key: string, label: string, description?: string): string;
1460
+
1461
+ declare function getMcpConfigPath(): string;
1462
+ declare function readMcpConfig(): ClaudeConfiguration | null;
1463
+ declare function writeMcpConfig(config: ClaudeConfiguration): void;
1464
+ declare function backupMcpConfig(): string | null;
1465
+ declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
1466
+ declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
1467
+ declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
1468
+ declare function addCompletedOnboarding(): void;
1469
+ /**
1470
+ * Ensures that an API key is in the approved list and not in the rejected list
1471
+ * @param config - Claude configuration object
1472
+ * @param apiKey - The API key to manage
1473
+ * @returns Updated configuration with API key properly approved
1474
+ */
1475
+ declare function ensureApiKeyApproved(config: ClaudeConfiguration, apiKey: string): ClaudeConfiguration;
1476
+ /**
1477
+ * Removes an API key from the rejected list
1478
+ * @param config - Claude configuration object
1479
+ * @param apiKey - The API key to remove from rejected list
1480
+ * @returns Updated configuration with API key removed from rejected list
1481
+ */
1482
+ declare function removeApiKeyFromRejected(config: ClaudeConfiguration, apiKey: string): ClaudeConfiguration;
1483
+ /**
1484
+ * Manages API key approval status by reading config, updating it, and writing it back
1485
+ * @param apiKey - The API key to ensure is approved (e.g., 'sk-ccjk-x-ccr')
1486
+ */
1487
+ declare function manageApiKeyApproval(apiKey: string): void;
1488
+ /**
1489
+ * Sets the primaryApiKey field in ~/.claude/config.json (VSCode extension config)
1490
+ * This is required for Claude Code 2.0 to properly recognize third-party API configurations
1491
+ * and prevent redirecting to official login page
1492
+ */
1493
+ declare function setPrimaryApiKey(): void;
1494
+
1495
+ /**
1496
+ * Aider configuration
1497
+ */
1498
+ interface AiderConfig {
1499
+ model?: string;
1500
+ editFormat?: 'diff' | 'whole' | 'udiff';
1501
+ apiKey?: string;
1502
+ apiBase?: string;
1503
+ autoCommits?: boolean;
1504
+ dirtyCommits?: boolean;
1505
+ darkMode?: boolean;
1506
+ prettyOutput?: boolean;
1507
+ showDiffs?: boolean;
1508
+ mapTokens?: number;
1509
+ maxChatHistory?: number;
1510
+ cachePrompts?: boolean;
1511
+ }
1512
+ /**
1513
+ * Check if Aider is installed
1514
+ */
1515
+ declare function isAiderInstalled(): Promise<boolean>;
1516
+ /**
1517
+ * Get Aider version
1518
+ */
1519
+ declare function getAiderVersion(): Promise<string | null>;
1520
+ /**
1521
+ * Install Aider
1522
+ */
1523
+ declare function installAider(): Promise<{
1524
+ success: boolean;
1525
+ message: string;
1526
+ }>;
1527
+ /**
1528
+ * Ensure Aider directory exists
1529
+ */
1530
+ declare function ensureAiderDir(): void;
1531
+ /**
1532
+ * Read Aider configuration
1533
+ */
1534
+ declare function readAiderConfig(): AiderConfig;
1535
+ /**
1536
+ * Write Aider configuration
1537
+ */
1538
+ declare function writeAiderConfig(config: AiderConfig): void;
1539
+ /**
1540
+ * Configure Aider API
1541
+ */
1542
+ declare function configureAiderApi(apiKey: string, apiBase?: string): void;
1543
+ /**
1544
+ * Get Aider model presets
1545
+ */
1546
+ declare function getAiderModelPresets(): Record<string, {
1547
+ model: string;
1548
+ description: string;
1549
+ }>;
1550
+ /**
1551
+ * Run Aider with options
1552
+ */
1553
+ declare function runAider(options: {
1554
+ files?: string[];
1555
+ message?: string;
1556
+ model?: string;
1557
+ autoCommit?: boolean;
1558
+ }): Promise<{
1559
+ success: boolean;
1560
+ output: string;
1561
+ }>;
1562
+
1563
+ declare function configureCodexMcp(options?: CodexFullInitOptions): Promise<void>;
1564
+
1565
+ /**
1566
+ * Apply platform-specific command transformation for Codex MCP services
1567
+ * Handles Windows cmd /c wrapper for commands like npx, uvx, etc.
1568
+ */
1569
+ declare function applyCodexPlatformCommand(config: CodexMcpService): void;
1570
+
1571
+ interface CodexProvider {
1572
+ id: string;
1573
+ name: string;
1574
+ baseUrl: string;
1575
+ wireApi: string;
1576
+ tempEnvKey: string;
1577
+ requiresOpenaiAuth: boolean;
1578
+ model?: string;
1579
+ }
1580
+ interface CodexMcpService {
1581
+ id: string;
1582
+ command: string;
1583
+ args: string[];
1584
+ env?: Record<string, string>;
1585
+ startup_timeout_sec?: number;
1586
+ extraFields?: Record<string, any>;
1587
+ }
1588
+ interface CodexConfigData {
1589
+ model: string | null;
1590
+ modelProvider: string | null;
1591
+ providers: CodexProvider[];
1592
+ mcpServices: CodexMcpService[];
1593
+ managed: boolean;
1594
+ otherConfig?: string[];
1595
+ modelProviderCommented?: boolean;
1596
+ }
1597
+ interface CodexVersionInfo {
1598
+ installed: boolean;
1599
+ currentVersion: string | null;
1600
+ latestVersion: string | null;
1601
+ needsUpdate: boolean;
1602
+ }
1603
+ declare function createBackupDirectory(timestamp: string): string;
1604
+ declare function backupCodexFiles(): string | null;
1605
+ /**
1606
+ * Backup complete Codex directory with all configuration files
1607
+ * This provides the same comprehensive backup functionality as Claude Code
1608
+ *
1609
+ * Note: This is an alias for backupCodexFiles() to maintain API consistency
1610
+ * while following DRY principles (Don't Repeat Yourself)
1611
+ */
1612
+ declare function backupCodexComplete(): string | null;
1613
+ declare function backupCodexConfig(): string | null;
1614
+ declare function backupCodexAgents(): string | null;
1615
+ declare function backupCodexPrompts(): string | null;
1616
+ declare function getBackupMessage(path: string | null): string;
1617
+ /**
1618
+ * Check if the Codex config needs env_key to temp_env_key migration
1619
+ * @returns true if migration is needed, false otherwise
1620
+ */
1621
+ declare function needsEnvKeyMigration(): boolean;
1622
+ /**
1623
+ * Migrate env_key to temp_env_key in Codex config file
1624
+ * This performs an in-place migration of the TOML config file
1625
+ *
1626
+ * For provider sections that already have temp_env_key, the env_key line is removed.
1627
+ * For provider sections that only have env_key, it is converted to temp_env_key.
1628
+ * This prevents duplicate keys in TOML which would cause parse errors.
1629
+ *
1630
+ * @returns true if migration was performed, false otherwise
1631
+ */
1632
+ declare function migrateEnvKeyToTempEnvKey(): boolean;
1633
+ /**
1634
+ * Migrate env_key to temp_env_key in TOML content
1635
+ * Handles mixed state where both env_key and temp_env_key may exist in the same section
1636
+ *
1637
+ * @param content - The TOML content to migrate
1638
+ * @returns The migrated content
1639
+ */
1640
+ declare function migrateEnvKeyInContent(content: string): string;
1641
+ /**
1642
+ * Ensure env_key migration is performed if needed
1643
+ * This should be called before any Codex config modification operation
1644
+ */
1645
+ declare function ensureEnvKeyMigration(): void;
1646
+ declare function parseCodexConfig(content: string): CodexConfigData;
1647
+ declare function readCodexConfig(): CodexConfigData | null;
1648
+ declare function renderCodexConfig(data: CodexConfigData): string;
1649
+ declare function writeCodexConfig(data: CodexConfigData): void;
1650
+ declare function writeAuthFile(newEntries: Record<string, string>): void;
1651
+ declare function isCodexInstalled$1(): Promise<boolean>;
1652
+ declare function getCodexVersion(): Promise<string | null>;
1653
+ declare function checkCodexUpdate(): Promise<CodexVersionInfo>;
1654
+ declare function installCodexCli(skipMethodSelection?: boolean): Promise<void>;
1655
+ declare function runCodexWorkflowImport(): Promise<void>;
1656
+ /**
1657
+ * Run Codex workflow import with language selection (AI output language + system prompt + workflow)
1658
+ * Reuses Claude Code's language selection functionality
1659
+ */
1660
+ interface CodexWorkflowLanguageOptions {
1661
+ aiOutputLang?: AiOutputLanguage | string;
1662
+ skipPrompt?: boolean;
1663
+ }
1664
+ declare function runCodexWorkflowImportWithLanguageSelection(options?: CodexFullInitOptions): Promise<AiOutputLanguage | string>;
1665
+ declare function runCodexSystemPromptSelection(skipPrompt?: boolean): Promise<void>;
1666
+ declare function runCodexWorkflowSelection(options?: CodexFullInitOptions): Promise<void>;
1667
+ declare function configureCodexApi(options?: CodexFullInitOptions): Promise<void>;
1668
+
1669
+ interface CodexFullInitOptions extends CodexWorkflowLanguageOptions {
1670
+ workflows?: string[];
1671
+ mcpServices?: string[] | false;
1672
+ apiMode?: 'official' | 'custom' | 'skip';
1673
+ customApiConfig?: {
1674
+ type: 'auth_token' | 'api_key';
1675
+ token?: string;
1676
+ baseUrl?: string;
1677
+ model?: string;
1678
+ };
1679
+ }
1680
+ declare function runCodexFullInit(options?: CodexFullInitOptions): Promise<AiOutputLanguage | string>;
1681
+ declare function runCodexUpdate(force?: boolean, skipPrompt?: boolean): Promise<boolean>;
1682
+ declare function runCodexUninstall(): Promise<void>;
1683
+ /**
1684
+ * Get current active Codex provider
1685
+ * @returns Current provider ID or null if not set
1686
+ */
1687
+ declare function getCurrentCodexProvider(): Promise<string | null>;
1688
+ /**
1689
+ * List all available Codex providers
1690
+ * @returns Array of available providers
1691
+ */
1692
+ declare function listCodexProviders(): Promise<CodexProvider[]>;
1693
+ /**
1694
+ * Switch to a different Codex provider
1695
+ * @param providerId - ID of the provider to switch to
1696
+ * @returns True if switch was successful, false otherwise
1697
+ */
1698
+ declare function switchCodexProvider(providerId: string): Promise<boolean>;
1699
+ /**
1700
+ * Switch to official login mode (comment out model_provider, set OPENAI_API_KEY to null)
1701
+ * @returns True if switch was successful, false otherwise
1702
+ */
1703
+ declare function switchToOfficialLogin$1(): Promise<boolean>;
1704
+ /**
1705
+ * Switch to a specific provider (uncomment model_provider, set environment variable in auth.json)
1706
+ * @param providerId - ID of the provider to switch to
1707
+ * @returns True if switch was successful, false otherwise
1708
+ */
1709
+ declare function switchToProvider(providerId: string): Promise<boolean>;
1710
+
1711
+ interface ConfigManagementMode {
1712
+ mode: 'initial' | 'management';
1713
+ hasProviders: boolean;
1714
+ providerCount: number;
1715
+ currentProvider?: string | null;
1716
+ providers?: CodexProvider[];
1717
+ isUnmanaged?: boolean;
1718
+ error?: string;
1719
+ }
1720
+ /**
1721
+ * Detect the current configuration state and determine appropriate management mode
1722
+ * @returns Configuration management mode information
1723
+ */
1724
+ declare function detectConfigManagementMode(): ConfigManagementMode;
1725
+ /**
1726
+ * Determine if configuration should show management options
1727
+ * @param config - The codex configuration data
1728
+ * @returns Whether to show management mode
1729
+ */
1730
+ declare function shouldShowManagementMode(config: CodexConfigData | null): boolean;
1731
+ /**
1732
+ * Get available management actions based on current configuration
1733
+ * @param config - The codex configuration data
1734
+ * @returns Array of available management actions
1735
+ */
1736
+ declare function getAvailableManagementActions(config: CodexConfigData): string[];
1737
+
1738
+ /**
1739
+ * Configure incremental management interface for existing Codex configurations
1740
+ */
1741
+ declare function configureIncrementalManagement(): Promise<void>;
1742
+
1743
+ interface ProviderOperationResult {
1744
+ success: boolean;
1745
+ backupPath?: string;
1746
+ error?: string;
1747
+ addedProvider?: CodexProvider;
1748
+ updatedProvider?: CodexProvider;
1749
+ deletedProviders?: string[];
1750
+ remainingProviders?: CodexProvider[];
1751
+ newDefaultProvider?: string;
1752
+ }
1753
+ interface ProviderUpdateData {
1754
+ name?: string;
1755
+ baseUrl?: string;
1756
+ wireApi?: 'responses' | 'chat';
1757
+ apiKey?: string;
1758
+ model?: string;
1759
+ }
1760
+ /**
1761
+ * Add a new provider to existing configuration
1762
+ * @param provider - The new provider to add
1763
+ * @param apiKey - The API key for the provider
1764
+ * @param allowOverwrite - Whether to allow overwriting existing provider
1765
+ * @returns Operation result
1766
+ */
1767
+ declare function addProviderToExisting(provider: CodexProvider, apiKey: string, allowOverwrite?: boolean): Promise<ProviderOperationResult>;
1768
+ /**
1769
+ * Edit an existing provider configuration
1770
+ * @param providerId - ID of the provider to edit
1771
+ * @param updates - Updates to apply to the provider
1772
+ * @returns Operation result
1773
+ */
1774
+ declare function editExistingProvider(providerId: string, updates: ProviderUpdateData): Promise<ProviderOperationResult>;
1775
+ /**
1776
+ * Delete selected providers from configuration
1777
+ * @param providerIds - Array of provider IDs to delete
1778
+ * @returns Operation result
1779
+ */
1780
+ declare function deleteProviders(providerIds: string[]): Promise<ProviderOperationResult>;
1781
+ /**
1782
+ * Validate provider data before operations
1783
+ * @param provider - Provider data to validate
1784
+ * @returns Validation result
1785
+ */
1786
+ declare function validateProviderData(provider: Partial<CodexProvider>): {
1787
+ valid: boolean;
1788
+ errors: string[];
1789
+ };
1790
+
1791
+ type CodexUninstallItem = 'config' | 'auth' | 'system-prompt' | 'workflow' | 'cli-package' | 'api-config' | 'mcp-config' | 'backups';
1792
+ interface CodexUninstallResult {
1793
+ success: boolean;
1794
+ removed: string[];
1795
+ removedConfigs: string[];
1796
+ errors: string[];
1797
+ warnings: string[];
1798
+ }
1799
+ /**
1800
+ * Codex Uninstaller - Handles removal of Codex configurations and tools
1801
+ */
1802
+ declare class CodexUninstaller {
1803
+ private _lang;
1804
+ private conflictResolution;
1805
+ private readonly CODEX_BACKUP_DIR;
1806
+ constructor(lang?: SupportedLang);
1807
+ /**
1808
+ * Remove config file (config.toml)
1809
+ */
1810
+ removeConfig(): Promise<CodexUninstallResult>;
1811
+ /**
1812
+ * Remove auth file (auth.json)
1813
+ */
1814
+ removeAuth(): Promise<CodexUninstallResult>;
1815
+ /**
1816
+ * Remove system prompt file (AGENTS.md)
1817
+ */
1818
+ removeSystemPrompt(): Promise<CodexUninstallResult>;
1819
+ /**
1820
+ * Remove workflow directory (prompts/)
1821
+ */
1822
+ removeWorkflow(): Promise<CodexUninstallResult>;
1823
+ /**
1824
+ * Uninstall Codex CLI package
1825
+ */
1826
+ uninstallCliPackage(): Promise<CodexUninstallResult>;
1827
+ /**
1828
+ * Remove API configuration from config.toml
1829
+ */
1830
+ removeApiConfig(): Promise<CodexUninstallResult>;
1831
+ /**
1832
+ * Remove backup directory (~/.codex/backup/)
1833
+ */
1834
+ removeBackups(): Promise<CodexUninstallResult>;
1835
+ /**
1836
+ * Remove MCP configuration from config.toml
1837
+ */
1838
+ removeMcpConfig(): Promise<CodexUninstallResult>;
1839
+ /**
1840
+ * Complete uninstall - remove all directories and packages
1841
+ */
1842
+ completeUninstall(): Promise<CodexUninstallResult>;
1843
+ /**
1844
+ * Custom uninstall with conflict resolution
1845
+ */
1846
+ customUninstall(selectedItems: CodexUninstallItem[]): Promise<CodexUninstallResult[]>;
1847
+ /**
1848
+ * Resolve conflicts between uninstall items
1849
+ */
1850
+ private resolveConflicts;
1851
+ /**
1852
+ * Execute uninstall for a specific item
1853
+ */
1854
+ private executeUninstallItem;
1855
+ }
1856
+
1857
+ /**
1858
+ * Continue model configuration
1859
+ */
1860
+ interface ContinueModel {
1861
+ title: string;
1862
+ provider: string;
1863
+ model: string;
1864
+ apiBase?: string;
1865
+ apiKey?: string;
1866
+ }
1867
+ /**
1868
+ * Continue MCP server configuration
1869
+ */
1870
+ interface ContinueMcpServer {
1871
+ command: string;
1872
+ args?: string[];
1873
+ env?: Record<string, string>;
1874
+ }
1875
+ /**
1876
+ * Continue configuration
1877
+ */
1878
+ interface ContinueConfig {
1879
+ models?: ContinueModel[];
1880
+ tabAutocompleteModel?: ContinueModel;
1881
+ embeddingsProvider?: {
1882
+ provider: string;
1883
+ model?: string;
1884
+ apiBase?: string;
1885
+ };
1886
+ reranker?: {
1887
+ name: string;
1888
+ params?: Record<string, any>;
1889
+ };
1890
+ contextProviders?: Array<{
1891
+ name: string;
1892
+ params?: Record<string, any>;
1893
+ }>;
1894
+ slashCommands?: Array<{
1895
+ name: string;
1896
+ description: string;
1897
+ }>;
1898
+ customCommands?: Array<{
1899
+ name: string;
1900
+ description: string;
1901
+ prompt: string;
1902
+ }>;
1903
+ experimental?: {
1904
+ modelContextProtocolServers?: ContinueMcpServer[];
1905
+ promptPath?: string;
1906
+ };
1907
+ allowAnonymousTelemetry?: boolean;
1908
+ }
1909
+ /**
1910
+ * Ensure Continue directory exists
1911
+ */
1912
+ declare function ensureContinueDir(): void;
1913
+ /**
1914
+ * Check if Continue is configured
1915
+ */
1916
+ declare function isContinueConfigured(): boolean;
1917
+ /**
1918
+ * Read Continue configuration
1919
+ */
1920
+ declare function readContinueConfig(): ContinueConfig;
1921
+ /**
1922
+ * Write Continue configuration
1923
+ */
1924
+ declare function writeContinueConfig(config: ContinueConfig): void;
1925
+ /**
1926
+ * Add a model to Continue
1927
+ */
1928
+ declare function addContinueModel(model: ContinueModel): void;
1929
+ /**
1930
+ * Remove a model from Continue
1931
+ */
1932
+ declare function removeContinueModel(title: string): boolean;
1933
+ /**
1934
+ * Get Continue provider presets
1935
+ */
1936
+ declare function getContinueProviderPresets(): Record<string, ContinueModel>;
1937
+ /**
1938
+ * Configure Continue API key
1939
+ */
1940
+ declare function configureContinueApi(provider: string, apiKey: string, apiBase?: string): void;
1941
+ /**
1942
+ * Add MCP server to Continue
1943
+ */
1944
+ declare function addContinueMcpServer(_name: string, server: ContinueMcpServer): void;
1945
+ /**
1946
+ * Add custom command to Continue
1947
+ */
1948
+ declare function addContinueCustomCommand(name: string, description: string, prompt: string): void;
1949
+ /**
1950
+ * Enable context provider
1951
+ */
1952
+ declare function enableContinueContextProvider(name: string, params?: Record<string, any>): void;
1953
+ /**
1954
+ * Sync CCJK skills to Continue custom commands
1955
+ */
1956
+ declare function syncSkillsToContinue(skills: Array<{
1957
+ id: string;
1958
+ name: string;
1959
+ description: string;
1960
+ template: string;
1961
+ }>): void;
1962
+
1963
+ /**
1964
+ * Tool installation status
1965
+ */
1966
+ interface ToolStatus {
1967
+ tool: CodeToolType;
1968
+ installed: boolean;
1969
+ version?: string;
1970
+ configExists: boolean;
1971
+ configPath: string;
1972
+ lastChecked: Date;
1973
+ }
1974
+ /**
1975
+ * Tool installation result
1976
+ */
1977
+ interface ToolInstallResult {
1978
+ tool: CodeToolType;
1979
+ success: boolean;
1980
+ message: string;
1981
+ version?: string;
1982
+ }
1983
+ /**
1984
+ * Get tool config path
1985
+ */
1986
+ declare function getToolConfigPath(tool: CodeToolType): string;
1987
+ /**
1988
+ * Get tool directory
1989
+ */
1990
+ declare function getToolDir(tool: CodeToolType): string;
1991
+ /**
1992
+ * Check if a tool is installed
1993
+ */
1994
+ declare function isToolInstalled(tool: CodeToolType): Promise<boolean>;
1995
+ /**
1996
+ * Get tool version
1997
+ */
1998
+ declare function getToolVersion(tool: CodeToolType): Promise<string | null>;
1999
+ /**
2000
+ * Get status of a tool
2001
+ */
2002
+ declare function getToolStatus(tool: CodeToolType): Promise<ToolStatus>;
2003
+ /**
2004
+ * Get status of all tools
2005
+ */
2006
+ declare function getAllToolsStatus(): Promise<ToolStatus[]>;
2007
+ /**
2008
+ * Get installed tools
2009
+ */
2010
+ declare function getInstalledTools(): Promise<CodeToolType[]>;
2011
+ /**
2012
+ * Install a tool
2013
+ */
2014
+ declare function installTool(tool: CodeToolType): Promise<ToolInstallResult>;
2015
+ /**
2016
+ * Get tool info
2017
+ */
2018
+ declare function getToolInfo(tool: CodeToolType): {
2019
+ name: string;
2020
+ description: string;
2021
+ website: string;
2022
+ installCmd: string;
2023
+ configFormat: "json" | "toml" | "yaml";
2024
+ category: "cli" | "extension" | "editor";
2025
+ };
2026
+ /**
2027
+ * Get all tools info
2028
+ */
2029
+ declare function getAllToolsInfo(): Record<"claude-code" | "codex" | "aider" | "continue" | "cline" | "cursor", {
2030
+ name: string;
2031
+ description: string;
2032
+ website: string;
2033
+ installCmd: string;
2034
+ configFormat: "json" | "toml" | "yaml";
2035
+ category: "cli" | "extension" | "editor";
2036
+ }>;
2037
+ /**
2038
+ * Get tools by category
2039
+ */
2040
+ declare function getToolsByCategory(category: 'cli' | 'extension' | 'editor'): CodeToolType[];
2041
+ /**
2042
+ * Format tool status for display
2043
+ */
2044
+ declare function formatToolStatus(status: ToolStatus): string;
2045
+ /**
2046
+ * Get recommended tools based on project type
2047
+ */
2048
+ declare function getRecommendedTools(projectType: string): CodeToolType[];
2049
+
2050
+ /**
2051
+ * API configuration for Claude Code
2052
+ */
2053
+ interface ApiConfig {
2054
+ url: string;
2055
+ key: string;
2056
+ authType?: 'auth_token' | 'api_key';
2057
+ }
2058
+ /**
2059
+ * Installation method types for code tools
2060
+ */
2061
+ type InstallMethod = 'npm' | 'homebrew' | 'curl' | 'powershell' | 'cmd';
2062
+
2063
+ declare function ensureClaudeDir(): void;
2064
+ declare function backupExistingConfig(): string | null;
2065
+ declare function copyConfigFiles(onlyMd?: boolean): void;
2066
+ declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
2067
+ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
2068
+ /**
2069
+ * Update custom model configuration using environment variables
2070
+ * @param primaryModel - Primary model name for general tasks
2071
+ * @param haikuModel - Default Haiku model (optional)
2072
+ * @param sonnetModel - Default Sonnet model (optional)
2073
+ * @param opusModel - Default Opus model (optional)
2074
+ */
2075
+ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string): void;
2076
+ /**
2077
+ * Update the default model configuration in settings.json
2078
+ * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
2079
+ * Note: 'custom' model type is handled differently - it should use environment variables instead
2080
+ */
2081
+ declare function updateDefaultModel(model: 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom'): void;
2082
+ /**
2083
+ * Merge settings.json intelligently
2084
+ * Preserves user's environment variables and custom configurations
2085
+ */
2086
+ declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
2087
+ /**
2088
+ * Get existing model configuration from settings.json
2089
+ */
2090
+ declare function getExistingModelConfig(): 'opus' | 'sonnet' | 'sonnet[1m]' | 'default' | 'custom' | null;
2091
+ /**
2092
+ * Get existing API configuration from settings.json
2093
+ */
2094
+ declare function getExistingApiConfig(): ApiConfig | null;
2095
+ declare function applyAiLanguageDirective(aiOutputLang: AiOutputLanguage | string): void;
2096
+ /**
2097
+ * Switch to official login mode - remove all third-party API configurations
2098
+ * Removes: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY from settings.json
2099
+ * Removes: primaryApiKey from ~/.claude/config.json
2100
+ */
2101
+ declare function switchToOfficialLogin(): boolean;
2102
+ /**
2103
+ * Prompt user for API configuration action when existing config is found
2104
+ * Returns the user's choice for how to handle existing configuration
2105
+ */
2106
+ declare function promptApiConfigurationAction(): Promise<'modify-partial' | 'modify-all' | 'keep-existing' | null>;
2107
+
2108
+ /**
2109
+ * Config file location
2110
+ */
2111
+ interface ConfigLocation {
2112
+ path: string;
2113
+ type: 'global' | 'legacy' | 'project' | 'custom';
2114
+ exists: boolean;
2115
+ size?: number;
2116
+ modifiedAt?: Date;
2117
+ content?: any;
2118
+ }
2119
+ /**
2120
+ * Config difference
2121
+ */
2122
+ interface ConfigDiff {
2123
+ key: string;
2124
+ files: string[];
2125
+ values: Record<string, any>;
2126
+ conflicting: boolean;
2127
+ }
2128
+ /**
2129
+ * Consolidated config result
2130
+ */
2131
+ interface ConsolidatedConfig {
2132
+ success: boolean;
2133
+ config: any;
2134
+ mergedFrom: string[];
2135
+ conflicts: ConfigDiff[];
2136
+ backupPaths: string[];
2137
+ }
2138
+ /**
2139
+ * Detect all config files
2140
+ */
2141
+ declare function detectAllConfigs(projectDir?: string): ConfigLocation[];
2142
+ /**
2143
+ * Compare configs and find differences
2144
+ */
2145
+ declare function compareConfigs(configs: ConfigLocation[]): ConfigDiff[];
2146
+ /**
2147
+ * Consolidate configs into a single file
2148
+ */
2149
+ declare function consolidateConfigs(configs: ConfigLocation[], strategy?: 'merge' | 'newest' | 'interactive'): ConsolidatedConfig;
2150
+ /**
2151
+ * Write consolidated config to primary location
2152
+ */
2153
+ declare function writeConsolidatedConfig(config: any): boolean;
2154
+ /**
2155
+ * Remove redundant config files (after consolidation)
2156
+ */
2157
+ declare function removeRedundantConfigs(configs: ConfigLocation[], keepPath?: string): string[];
2158
+ /**
2159
+ * Display config scan results
2160
+ */
2161
+ declare function displayConfigScan(configs: ConfigLocation[]): void;
2162
+
2163
+ /**
2164
+ * Check result
2165
+ */
2166
+ interface CheckResult {
2167
+ name: string;
2168
+ status: 'pass' | 'warn' | 'fail' | 'info';
2169
+ message: string;
2170
+ details?: string;
2171
+ fixable?: boolean;
2172
+ fixCommand?: string;
2173
+ }
2174
+ /**
2175
+ * Health report
2176
+ */
2177
+ interface HealthReport {
2178
+ timestamp: Date;
2179
+ score: number;
2180
+ checks: CheckResult[];
2181
+ recommendations: string[];
2182
+ }
2183
+ /**
2184
+ * Run full health check
2185
+ */
2186
+ declare function runHealthCheck(): Promise<HealthReport>;
2187
+ /**
2188
+ * Display health report
2189
+ */
2190
+ declare function displayHealthReport(report: HealthReport): void;
2191
+ /**
2192
+ * Run doctor command
2193
+ */
2194
+ declare function runDoctor(fix?: boolean): Promise<void>;
2195
+
2196
+ declare function isClaudeCodeInstalled(): Promise<boolean>;
2197
+ /**
2198
+ * Install Claude Code with method selection support
2199
+ * @param skipMethodSelection - If true, use default npm installation
2200
+ */
2201
+ declare function installClaudeCode(skipMethodSelection?: boolean): Promise<void>;
2202
+ /**
2203
+ * Check if Codex is installed
2204
+ */
2205
+ declare function isCodexInstalled(): Promise<boolean>;
2206
+ /**
2207
+ * Install Codex with method selection support
2208
+ * @param skipMethodSelection - If true, use default npm installation
2209
+ */
2210
+ declare function installCodex(skipMethodSelection?: boolean): Promise<void>;
2211
+ /**
2212
+ * Check if local Claude Code installation exists
2213
+ */
2214
+ declare function isLocalClaudeCodeInstalled(): Promise<boolean>;
2215
+ /**
2216
+ * Get installation status for both global and local Claude Code
2217
+ */
2218
+ interface InstallationStatus {
2219
+ hasGlobal: boolean;
2220
+ hasLocal: boolean;
2221
+ localPath: string;
2222
+ }
2223
+ declare function getInstallationStatus(): Promise<InstallationStatus>;
2224
+ /**
2225
+ * Remove local Claude Code installation
2226
+ */
2227
+ declare function removeLocalClaudeCode(): Promise<void>;
2228
+ /**
2229
+ * Uninstall code tool based on install method
2230
+ * @param codeType - Type of code tool to uninstall
2231
+ * @returns true if uninstalled successfully
2232
+ */
2233
+ declare function uninstallCodeTool(codeType: CodeType): Promise<boolean>;
2234
+ /**
2235
+ * Set installMethod in both ~/.claude.json and ccjk-config
2236
+ * This ensures Claude Code knows it was installed via npm for proper auto-updates
2237
+ */
2238
+ declare function setInstallMethod(method: InstallMethod, codeType?: CodeType): Promise<void>;
2239
+ /**
2240
+ * Detect installed version of a code tool
2241
+ * Returns version string or null if not installed
2242
+ */
2243
+ declare function detectInstalledVersion(codeType: CodeType): Promise<string | null>;
2244
+ /**
2245
+ * Select installation method interactively
2246
+ */
2247
+ declare function selectInstallMethod(codeType: CodeType, excludeMethods?: InstallMethod[]): Promise<InstallMethod | null>;
2248
+ /**
2249
+ * Execute installation using specified method
2250
+ */
2251
+ declare function executeInstallMethod(method: InstallMethod, codeType: CodeType): Promise<boolean>;
2252
+ /**
2253
+ * Handle installation failure with retry options
2254
+ */
2255
+ declare function handleInstallFailure(codeType: CodeType, failedMethods: InstallMethod[]): Promise<boolean>;
2256
+ /**
2257
+ * Installation verification result
2258
+ */
2259
+ interface VerificationResult {
2260
+ success: boolean;
2261
+ commandPath: string | null;
2262
+ version: string | null;
2263
+ needsSymlink: boolean;
2264
+ symlinkCreated: boolean;
2265
+ error?: string;
2266
+ }
2267
+ /**
2268
+ * Verify installation by checking command availability and version
2269
+ * If command is not in PATH but found in Homebrew paths, attempt to create symlink
2270
+ */
2271
+ declare function verifyInstallation(codeType: CodeType): Promise<VerificationResult>;
2272
+ /**
2273
+ * Symlink creation result
2274
+ */
2275
+ interface SymlinkResult {
2276
+ success: boolean;
2277
+ symlinkPath: string | null;
2278
+ error?: string;
2279
+ }
2280
+ /**
2281
+ * Create symlink in Homebrew bin directory for commands installed via npm
2282
+ * This handles the case where npm global packages are installed to
2283
+ * /opt/homebrew/Cellar/node/{version}/bin/ but that path is not in the user's PATH
2284
+ */
2285
+ declare function createHomebrewSymlink(command: string, sourcePath: string): Promise<SymlinkResult>;
2286
+ /**
2287
+ * Display verification result to user with appropriate messages
2288
+ */
2289
+ declare function displayVerificationResult(result: VerificationResult, codeType: CodeType): void;
2290
+
2291
+ /**
2292
+ * Knowledge base entry
2293
+ */
2294
+ interface KnowledgeEntry {
2295
+ id: string;
2296
+ type: 'claude-md' | 'agent' | 'skill' | 'workflow' | 'project-info';
2297
+ name: string;
2298
+ path: string;
2299
+ content: string;
2300
+ hash: string;
2301
+ createdAt: string;
2302
+ updatedAt: string;
2303
+ projectRoot?: string;
2304
+ }
2305
+ /**
2306
+ * Knowledge base
2307
+ */
2308
+ interface KnowledgeBase {
2309
+ version: string;
2310
+ lastSync: string;
2311
+ entries: KnowledgeEntry[];
2312
+ projectContexts: ProjectContext[];
2313
+ }
2314
+ /**
2315
+ * Project context for knowledge
2316
+ */
2317
+ interface ProjectContext {
2318
+ rootDir: string;
2319
+ name: string;
2320
+ type: string;
2321
+ frameworks: string[];
2322
+ lastScanned: string;
2323
+ claudeMdHash?: string;
2324
+ agentsCount: number;
2325
+ skillsCount: number;
2326
+ }
2327
+ /**
2328
+ * Onboarding result
2329
+ */
2330
+ interface OnboardingResult {
2331
+ success: boolean;
2332
+ projectDetected: boolean;
2333
+ claudeMdFound: boolean;
2334
+ claudeMdUpdated: boolean;
2335
+ agentsFound: number;
2336
+ skillsFound: number;
2337
+ knowledgeEntriesCreated: number;
2338
+ recommendations: string[];
2339
+ }
2340
+ /**
2341
+ * Load knowledge base
2342
+ */
2343
+ declare function loadKnowledgeBase(): KnowledgeBase;
2344
+ /**
2345
+ * Save knowledge base
2346
+ */
2347
+ declare function saveKnowledgeBase(kb: KnowledgeBase): void;
2348
+ /**
2349
+ * Run onboarding process
2350
+ */
2351
+ declare function runOnboarding(projectDir?: string): Promise<OnboardingResult>;
2352
+ /**
2353
+ * Quick sync - update knowledge base without prompts
2354
+ */
2355
+ declare function quickSync(projectDir?: string): Promise<void>;
2356
+ /**
2357
+ * Get knowledge for current project
2358
+ */
2359
+ declare function getProjectKnowledge(projectDir?: string): KnowledgeEntry[];
2360
+ /**
2361
+ * Export knowledge for a project
2362
+ */
2363
+ declare function exportProjectKnowledge(projectDir?: string): string;
2364
+
2365
+ /**
2366
+ * Clean up and deduplicate permissions array
2367
+ * Removes invalid and redundant permissions based on template
2368
+ */
2369
+ /**
2370
+ * Clean up permissions array by removing invalid and redundant entries
2371
+ * @param templatePermissions - Permissions from template (source of truth)
2372
+ * @param userPermissions - User's existing permissions
2373
+ * @returns Cleaned permissions array
2374
+ */
2375
+ declare function cleanupPermissions(templatePermissions: string[], userPermissions: string[]): string[];
2376
+ /**
2377
+ * Merge and clean permissions arrays
2378
+ * Combines template and user permissions while removing invalid/redundant entries
2379
+ * @param templatePermissions - Permissions from template
2380
+ * @param userPermissions - User's existing permissions
2381
+ * @returns Merged and cleaned permissions array
2382
+ */
2383
+ declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
2384
+
2385
+ /**
2386
+ * Permission types
2387
+ */
2388
+ type PermissionType = 'file-read' | 'file-write' | 'file-delete' | 'git-operations' | 'npm-commands' | 'node-execution' | 'system-commands' | 'network-access' | 'mcp-server';
2389
+ /**
2390
+ * Permission set
2391
+ */
2392
+ interface PermissionSet {
2393
+ allowed: PermissionType[];
2394
+ denied: PermissionType[];
2395
+ trustedDirectories: string[];
2396
+ autoApprovePatterns: string[];
2397
+ }
2398
+ /**
2399
+ * Permission template
2400
+ */
2401
+ interface PermissionTemplate {
2402
+ id: string;
2403
+ name: string;
2404
+ description: string;
2405
+ permissions: PermissionSet;
2406
+ }
2407
+ /**
2408
+ * Predefined permission templates
2409
+ */
2410
+ declare const PERMISSION_TEMPLATES: PermissionTemplate[];
2411
+ /**
2412
+ * Read current permissions
2413
+ */
2414
+ declare function readPermissions(): PermissionSet;
2415
+ /**
2416
+ * Write permissions
2417
+ */
2418
+ declare function writePermissions(permissions: PermissionSet): boolean;
2419
+ /**
2420
+ * Apply a permission template
2421
+ */
2422
+ declare function applyTemplate(templateId: string): boolean;
2423
+ /**
2424
+ * Trust a directory
2425
+ */
2426
+ declare function trustDirectory(path: string): boolean;
2427
+ /**
2428
+ * Untrust a directory
2429
+ */
2430
+ declare function untrustDirectory(path: string): boolean;
2431
+ /**
2432
+ * Check if a permission is allowed
2433
+ */
2434
+ declare function isPermissionAllowed(permission: PermissionType): boolean;
2435
+ /**
2436
+ * Check if a directory is trusted
2437
+ */
2438
+ declare function isDirectoryTrusted(path: string): boolean;
2439
+ /**
2440
+ * Add auto-approve pattern
2441
+ */
2442
+ declare function addAutoApprovePattern(pattern: string): boolean;
2443
+ /**
2444
+ * Remove auto-approve pattern
2445
+ */
2446
+ declare function removeAutoApprovePattern(pattern: string): boolean;
2447
+ /**
2448
+ * Reset permissions to default
2449
+ */
2450
+ declare function resetPermissions(): boolean;
2451
+ /**
2452
+ * Export permissions to JSON
2453
+ */
2454
+ declare function exportPermissions(): string;
2455
+ /**
2456
+ * Import permissions from JSON
2457
+ */
2458
+ declare function importPermissions(json: string): boolean;
2459
+ /**
2460
+ * Get current template ID (if matching)
2461
+ */
2462
+ declare function getCurrentTemplateId(): string | null;
2463
+ /**
2464
+ * Display permissions dashboard
2465
+ */
2466
+ declare function displayPermissions(): void;
2467
+
2468
+ declare function importRecommendedEnv(): Promise<void>;
2469
+ declare function importRecommendedPermissions(): Promise<void>;
2470
+ declare function openSettingsJson(): Promise<void>;
2471
+
2472
+ /**
2473
+ * Menu item definition
2474
+ */
2475
+ interface MenuItem {
2476
+ /** Single key shortcut */
2477
+ key: string;
2478
+ /** Display label */
2479
+ label: string;
2480
+ /** Optional description */
2481
+ description?: string;
2482
+ /** Icon/emoji */
2483
+ icon?: string;
2484
+ /** Action to execute */
2485
+ action: () => Promise<MenuResult>;
2486
+ /** Condition for visibility */
2487
+ visible?: () => boolean;
2488
+ /** Whether this is a highlighted/recommended option */
2489
+ highlight?: boolean;
2490
+ /** Whether this item is disabled */
2491
+ disabled?: boolean;
2492
+ }
2493
+ /**
2494
+ * Menu section
2495
+ */
2496
+ interface MenuSection {
2497
+ /** Section title */
2498
+ title: string;
2499
+ /** Items in this section */
2500
+ items: MenuItem[];
2501
+ /** Section icon */
2502
+ icon?: string;
2503
+ }
2504
+ /**
2505
+ * Menu result
2506
+ */
2507
+ interface MenuResult {
2508
+ /** Action taken */
2509
+ action: 'continue' | 'back' | 'exit' | 'switch';
2510
+ /** Optional data */
2511
+ data?: any;
2512
+ }
2513
+ /**
2514
+ * Menu builder options
2515
+ */
2516
+ interface MenuBuilderOptions {
2517
+ /** Menu title */
2518
+ title: string;
2519
+ /** Menu subtitle */
2520
+ subtitle?: string;
2521
+ /** Show back option */
2522
+ showBack?: boolean;
2523
+ /** Show exit option */
2524
+ showExit?: boolean;
2525
+ /** Breadcrumb path */
2526
+ breadcrumb?: string[];
2527
+ /** Box style */
2528
+ boxStyle?: 'single' | 'double' | 'rounded' | 'heavy';
2529
+ }
2530
+ /**
2531
+ * Menu builder for creating interactive menus
2532
+ */
2533
+ declare class MenuBuilder {
2534
+ private sections;
2535
+ private options;
2536
+ constructor(options: MenuBuilderOptions);
2537
+ /**
2538
+ * Add a section to the menu
2539
+ */
2540
+ addSection(title: string, icon?: string): MenuBuilder;
2541
+ /**
2542
+ * Add an item to the current section
2543
+ */
2544
+ addItem(item: MenuItem): MenuBuilder;
2545
+ /**
2546
+ * Add a separator
2547
+ */
2548
+ addSeparator(): MenuBuilder;
2549
+ /**
2550
+ * Render the menu to string
2551
+ */
2552
+ render(): string;
2553
+ /**
2554
+ * Display menu and handle input
2555
+ */
2556
+ show(): Promise<MenuResult>;
2557
+ /**
2558
+ * Run menu loop until exit or back
2559
+ */
2560
+ loop(): Promise<MenuResult>;
2561
+ }
2562
+ /**
2563
+ * Quick menu helper
2564
+ */
2565
+ declare function showQuickMenu(title: string, items: Array<{
2566
+ key: string;
2567
+ label: string;
2568
+ action: () => Promise<void>;
2569
+ }>): Promise<void>;
2570
+ /**
2571
+ * Confirmation prompt helper
2572
+ */
2573
+ declare function confirm(message: string, defaultValue?: boolean): Promise<boolean>;
2574
+ /**
2575
+ * Display status message
2576
+ */
2577
+ declare function showStatus(type: keyof typeof STATUS, message: string): void;
2578
+
2579
+ /**
2580
+ * Version information
2581
+ */
2582
+ interface VersionInfo {
2583
+ current: string;
2584
+ latest: string;
2585
+ updateAvailable: boolean;
2586
+ releaseUrl?: string;
2587
+ }
2588
+ /**
2589
+ * Upgrade result
2590
+ */
2591
+ interface UpgradeResult {
2592
+ success: boolean;
2593
+ previousVersion?: string;
2594
+ newVersion?: string;
2595
+ error?: string;
2596
+ }
2597
+ /**
2598
+ * Plugin version info
2599
+ */
2600
+ interface PluginVersionInfo {
2601
+ name: string;
2602
+ current: string;
2603
+ latest?: string;
2604
+ updateAvailable: boolean;
2605
+ }
2606
+ /**
2607
+ * Check Claude Code version
2608
+ */
2609
+ declare function checkClaudeCodeVersion(): Promise<VersionInfo>;
2610
+ /**
2611
+ * Check CCJK version
2612
+ */
2613
+ declare function checkCcjkVersion(): Promise<VersionInfo>;
2614
+ /**
2615
+ * Check all plugin versions
2616
+ */
2617
+ declare function checkPluginVersions(): Promise<PluginVersionInfo[]>;
2618
+ /**
2619
+ * Upgrade Claude Code
2620
+ */
2621
+ declare function upgradeClaudeCode(): Promise<UpgradeResult>;
2622
+ /**
2623
+ * Upgrade CCJK
2624
+ */
2625
+ declare function upgradeCcjk(): Promise<UpgradeResult>;
2626
+ /**
2627
+ * Upgrade a specific plugin
2628
+ */
2629
+ declare function upgradePlugin(_pluginId: string): Promise<UpgradeResult>;
2630
+ /**
2631
+ * Upgrade all plugins
2632
+ */
2633
+ declare function upgradeAllPlugins(): Promise<UpgradeResult[]>;
2634
+ /**
2635
+ * Check all versions and display summary
2636
+ */
2637
+ declare function checkAllVersions(): Promise<void>;
2638
+ /**
2639
+ * Upgrade everything
2640
+ */
2641
+ declare function upgradeAll(): Promise<void>;
2642
+
2643
+ export { AIDER_CONFIG_FILE, AIDER_DIR, AIDER_ENV_FILE, AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CCJK_CONFIG_DIR, CCJK_CONFIG_FILE, CCJK_GROUPS_DIR, CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CLINE_CONFIG_FILE, CLINE_DIR, CODEX_AGENTS_FILE, CODEX_AUTH_FILE, CODEX_CONFIG_FILE, CODEX_DIR, CODEX_PROMPTS_DIR, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_INFO, CODE_TOOL_TYPES, COLORS, CONTINUE_CONFIG_FILE, CONTINUE_DIR, CURSOR_CONFIG_FILE, CURSOR_DIR, ClAUDE_CONFIG_FILE, CodexUninstaller, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_DIR, LEGACY_ZCF_CONFIG_FILE, LEGACY_ZCF_CONFIG_FILES, MenuBuilder, PERMISSION_TEMPLATES, SETTINGS_FILE, STATUS, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, addAutoApprovePattern, addCompletedOnboarding, addContinueCustomCommand, addContinueMcpServer, addContinueModel, addGroup, addProviderToExisting, addSkill, applyAiLanguageDirective, applyCodexPlatformCommand, applyTemplate, backupCodexAgents, backupCodexComplete, backupCodexConfig, backupCodexFiles, backupCodexPrompts, backupExistingConfig, backupMcpConfig, boxify, buildMcpServerConfig, checkAllVersions, checkCcjkVersion, checkClaudeCodeVersion, checkCodexUpdate, checkPluginVersions, cleanupPermissions, switchToOfficialLogin$1 as codexSwitchToOfficialLogin, commandExists, compareConfigs, configureAiderApi, configureApi, configureCodexApi, configureCodexMcp, configureContinueApi, configureIncrementalManagement, confirm, consolidateConfigs, copyConfigFiles, createBackupDirectory, createBatchSkills, createHomebrewSymlink, deleteProviders, detectAllConfigs, detectBuildTools, detectCICDSystems, detectConfigManagementMode, detectFrameworks, detectInstalledVersion, detectLanguages, detectPackageManager, detectProject, detectTestFrameworks, determineProjectType, disableGroup, disablePlugin, discoverPlugins, displayBanner, displayBannerWithInfo, displayConfigScan, displayCurrentStatus, displayHealthReport, displayPermissions, displayVerificationResult, editExistingProvider, enableContinueContextProvider, enableGroup, enablePlugin, ensureAiderDir, ensureApiKeyApproved, ensureClaudeDir, ensureContinueDir, ensureEnvKeyMigration, ensureGroupsDir, ensurePluginsDir, ensureSkillsDir, executeInstallMethod, exportGroups, exportPermissions, exportProjectKnowledge, exportSkills, fixWindowsMcpConfig, formatToolStatus, generateSuggestions, getAiOutputLanguageLabel, getAiderModelPresets, getAiderVersion, getAllGroups, getAllSkills, getAllToolsInfo, getAllToolsStatus, getAvailableManagementActions, getBackupMessage, getBatchCategories, getCodexVersion, getContinueProviderPresets, getCurrentCodexProvider, getCurrentTemplateId, getEnabledAgents, getEnabledSkillIds, getExistingApiConfig, getExistingModelConfig, getGroup, getRegistry as getGroupRegistry, getInstallationStatus, getInstalledTools, getLoadedPlugins, getMcpConfigPath, getPlatform, getPluginAgents, getPluginInfo, getPluginMcpServices, getPluginOutputStyles, getPluginSkills, getPluginWorkflows, getProjectKnowledge, getProjectSummary, getRecommendedTools, getSkill, getRegistry$1 as getSkillRegistry, getToolConfigPath, getToolDir, getToolInfo, getToolStatus, getToolVersion, getToolsByCategory, handleInstallFailure, importGroups, importPermissions, importRecommendedEnv, importRecommendedPermissions, importSkills, init, initializePlugins, installAider, installClaudeCode, installCodex, installCodexCli, installTool, isAiderInstalled, isClaudeCodeInstalled, isCodeToolType, isCodexInstalled$1 as isCodexCliInstalled, isCodexInstalled, isContinueConfigured, isDirectoryTrusted, isGroupEnabled, isLocalClaudeCodeInstalled, isPermissionAllowed, isToolInstalled, listCodexProviders, listPlugins, loadKnowledgeBase, loadPlugin, manageApiKeyApproval, menuItem, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, migrateEnvKeyInContent, migrateEnvKeyToTempEnvKey, needsEnvKeyMigration, openSettingsJson, parseCodexConfig, promptApiConfigurationAction, quickSync, readAiderConfig, readCodexConfig, readContinueConfig, readMcpConfig, readPermissions, readPluginConfig, refreshRegistry as refreshGroupRegistry, refreshRegistry$1 as refreshSkillRegistry, removeApiKeyFromRejected, removeAutoApprovePattern, removeContinueModel, removeGroup, removeLocalClaudeCode, removeRedundantConfigs, removeSkill, renderCodexConfig, renderProgressBar, resetPermissions, resolveCodeToolType, runAider, runCodexFullInit, runCodexSystemPromptSelection, runCodexUninstall, runCodexUpdate, runCodexWorkflowImport, runCodexWorkflowImportWithLanguageSelection, runCodexWorkflowSelection, runConfigWizard, runDoctor, runHealthCheck, runOnboarding, saveKnowledgeBase, searchGroups, searchSkills, sectionDivider, selectInstallMethod, setInstallMethod, setPrimaryApiKey, setSkillEnabled, shouldShowManagementMode, showQuickMenu, showStatus, switchCodexProvider, switchToOfficialLogin, switchToProvider, syncSkillsToContinue, trustDirectory, uninstallCodeTool, unloadPlugin, untrustDirectory, updateCustomModel, updateDefaultModel, upgradeAll, upgradeAllPlugins, upgradeCcjk, upgradeClaudeCode, upgradePlugin, validateProviderData, verifyInstallation, writeAiderConfig, writeAuthFile, writeCodexConfig, writeConsolidatedConfig, writeContinueConfig, writeMcpConfig, writePermissions, writePluginConfig };
2644
+ export type { AgentDefinition, AgentExtension, AgentTemplate, AiOutputLanguage, AiderConfig, ApiConfig, AuditCycle, AuditCycleStatus, AuditReport, BatchSkillOptions, BatchSkillTemplate, BoxStyle, BuildTool, CICDSystem, CcjkPlugin, CcjkSkill, CheckResult, ClaudeConfiguration, CodeToolType, CodexConfigData, CodexFullInitOptions, CodexProvider, CodexUninstallItem, CodexUninstallResult, CodexVersionInfo, CommandExtension, ConfigDiff, ConfigLocation, ConfigManagementMode, ConfigSuggestions, ConsolidatedConfig, ContinueConfig, ContinueMcpServer, ContinueModel, EvaluatedIssue, ExecutionPlan, FileChange, FixDecision, FixPlan, FixResult, Framework, GeneratedFix, GroupCategory, GroupExport, GroupInstallResult, GroupRegistry, GroupSearchOptions, HealthReport, InstallationStatus, Issue, KnowledgeBase, KnowledgeEntry, Language, LanguageGroupId, LoadedPlugin, McpServerConfig, McpService, McpServiceExtension, MenuBuilderOptions, MenuItem, MenuResult, MenuSection, NewIssue, OnboardingResult, OutputStyleExtension, PackageManager, PermissionSet, PermissionTemplate, PermissionType, PluginConfig, PluginContext, PluginDiscoveryResult, PluginInfo, PluginLogger, PluginMetadata, PluginStorage, PluginVersionInfo, PredefinedGroupId, ProjectContext, ProjectInfo, ProjectType, ProviderOperationResult, ProviderUpdateData, Regression, ScanResult, ScanStrategy, ScanTarget, ShenChaConfig, SiteTypeGroupId, SkillCategory, SkillExport, SkillInstallResult, SkillRegistry, SkillSearchOptions, SpecialtyGroupId, SubagentGroup, SupportedLang, TestFramework, ToolInstallResult, ToolStatus, UpgradeResult, VerificationResult, VerifyResult, VersionInfo, WorkflowExtension };