ccjk 13.3.22 → 13.4.0

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 (35) hide show
  1. package/dist/chunks/auto-bootstrap.mjs +2 -2
  2. package/dist/chunks/auto-fix.mjs +52 -1
  3. package/dist/chunks/ccjk-agents.mjs +1 -1
  4. package/dist/chunks/ccjk-all.mjs +5 -5
  5. package/dist/chunks/ccjk-hooks.mjs +4 -3
  6. package/dist/chunks/ccjk-mcp.mjs +1 -1
  7. package/dist/chunks/ccjk-setup.mjs +3 -3
  8. package/dist/chunks/ccjk-skills.mjs +3 -2
  9. package/dist/chunks/ccr.mjs +1 -1
  10. package/dist/chunks/claude-code-config-manager.mjs +76 -25
  11. package/dist/chunks/claude-code-incremental-manager.mjs +7 -15
  12. package/dist/chunks/config2.mjs +33 -16
  13. package/dist/chunks/config3.mjs +2 -6
  14. package/dist/chunks/constants.mjs +2 -2
  15. package/dist/chunks/doctor.mjs +1 -1
  16. package/dist/chunks/init.mjs +2 -16
  17. package/dist/chunks/mcp.mjs +2 -2
  18. package/dist/chunks/menu-hierarchical.mjs +1 -1
  19. package/dist/chunks/notification.mjs +5 -5
  20. package/dist/chunks/onboarding-wizard.mjs +1 -1
  21. package/dist/chunks/package.mjs +1 -1
  22. package/dist/chunks/plugin.mjs +2 -2
  23. package/dist/chunks/quick-provider.mjs +6 -1
  24. package/dist/chunks/remote.mjs +2 -2
  25. package/dist/chunks/skills-sync.mjs +3 -3
  26. package/dist/chunks/slash-commands.mjs +1 -1
  27. package/dist/chunks/status.mjs +26 -0
  28. package/dist/index.d.mts +174 -59
  29. package/dist/index.d.ts +174 -59
  30. package/dist/index.mjs +9 -345
  31. package/dist/shared/{ccjk.eIn-g1yI.mjs → ccjk.BBizCO6_.mjs} +3 -2
  32. package/dist/shared/{ccjk.CLUL0pAV.mjs → ccjk.BNVSnyu0.mjs} +4 -3
  33. package/dist/shared/{ccjk.BtB1e5jm.mjs → ccjk.D0g2ABGg.mjs} +3 -3
  34. package/dist/shared/{ccjk.DRfdq6yl.mjs → ccjk.DypYla6I.mjs} +2 -1
  35. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import a from './index2.mjs';
2
2
  import { i as inquirer } from './index3.mjs';
3
3
  import { i18n } from './index5.mjs';
4
- import { m as maskToken, a as isValidTokenFormat, c as generateDeviceToken, d as decryptToken, e as encryptToken, f as getDeviceInfo, i as isDeviceBound, g as getBindingStatus, u as unbindDevice, b as bindDevice, s as sendNotification } from '../shared/ccjk.eIn-g1yI.mjs';
4
+ import { m as maskToken, a as isValidTokenFormat, c as generateDeviceToken, d as decryptToken, e as encryptToken, f as getDeviceInfo, i as isDeviceBound, g as getBindingStatus, u as unbindDevice, b as bindDevice, s as sendNotification } from '../shared/ccjk.BBizCO6_.mjs';
5
5
  import { exec } from 'node:child_process';
6
6
  import * as fs from 'node:fs';
7
7
  import fs__default from 'node:fs';
@@ -14,6 +14,7 @@ import { promisify } from 'node:util';
14
14
  import { writeFileAtomic } from './fs-operations.mjs';
15
15
  import { p as parse } from '../shared/ccjk.BBtCGd_g.mjs';
16
16
  import { stringify } from './index6.mjs';
17
+ import { CLOUD_ENDPOINTS } from './constants.mjs';
17
18
  import '../shared/ccjk.BAGoDD49.mjs';
18
19
  import 'node:readline';
19
20
  import 'stream';
@@ -28,8 +29,7 @@ import 'buffer';
28
29
  import 'string_decoder';
29
30
  import 'node:url';
30
31
  import '../shared/ccjk.bQ7Dh1g4.mjs';
31
- import '../shared/ccjk.BtB1e5jm.mjs';
32
- import './constants.mjs';
32
+ import '../shared/ccjk.D0g2ABGg.mjs';
33
33
  import '../shared/ccjk.D6ycHbak.mjs';
34
34
  import 'node:buffer';
35
35
  import 'node:fs/promises';
@@ -344,7 +344,7 @@ const DEFAULT_NOTIFICATION_CONFIG = {
344
344
  deviceToken: "",
345
345
  threshold: 10,
346
346
  // 10 minutes
347
- cloudEndpoint: "https://api.claudehome.cn",
347
+ cloudEndpoint: `${CLOUD_ENDPOINTS.REMOTE.BASE_URL}/api/v1`,
348
348
  channels: {},
349
349
  quietHours: {
350
350
  enabled: false,
@@ -667,7 +667,7 @@ async function disableNotifications() {
667
667
  await updateNotificationConfig({ enabled: false });
668
668
  }
669
669
 
670
- const DEFAULT_CLOUD_ENDPOINT = "https://api.claudehome.cn";
670
+ const DEFAULT_CLOUD_ENDPOINT = `${CLOUD_ENDPOINTS.REMOTE.BASE_URL}/api/v1`;
671
671
  const REQUEST_TIMEOUT = 3e4;
672
672
  const POLL_TIMEOUT = 6e4;
673
673
  class CloudClient {
@@ -79,7 +79,7 @@ async function runOnboardingWizard(options = {}) {
79
79
  console.log(a.bold(`${isZh ? "\u6B65\u9AA4 2/3" : "Step 2/3"}: ${isZh ? "API \u914D\u7F6E" : "API Configuration"}${step2Done ? a.green(" \u2714") : ""}`));
80
80
  if (!step2Done) {
81
81
  try {
82
- const { getExistingApiConfig } = await import('./config2.mjs').then(function (n) { return n.k; });
82
+ const { getExistingApiConfig } = await import('./config2.mjs').then(function (n) { return n.j; });
83
83
  const existing = getExistingApiConfig();
84
84
  if (existing?.key || existing?.url) {
85
85
  console.log(a.green(` \u2714 ${isZh ? "\u5DF2\u914D\u7F6E" : "Already configured"}`));
@@ -1,3 +1,3 @@
1
- const version = "13.3.22";
1
+ const version = "13.4.0";
2
2
 
3
3
  export { version };
@@ -2,7 +2,7 @@ import process__default from 'node:process';
2
2
  import a from './index2.mjs';
3
3
  import { Buffer } from 'node:buffer';
4
4
  import { existsSync, mkdirSync, readFileSync, unlinkSync, readdirSync, statSync, rmSync } from 'node:fs';
5
- import { CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR } from './constants.mjs';
5
+ import { CLOUD_ENDPOINTS, CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR } from './constants.mjs';
6
6
  import { i18n } from './index5.mjs';
7
7
  import { writeFileAtomic } from './fs-operations.mjs';
8
8
  import { homedir } from 'node:os';
@@ -318,7 +318,7 @@ class LocalPluginCache {
318
318
  }
319
319
  }
320
320
 
321
- const DEFAULT_CLOUD_API_URL = "https://api.claudehome.cn/api/v1/skills";
321
+ const DEFAULT_CLOUD_API_URL = `${CLOUD_ENDPOINTS.MAIN.BASE_URL}${CLOUD_ENDPOINTS.MAIN.API_VERSION}/skills`;
322
322
  const REQUEST_TIMEOUT = 3e4;
323
323
  const MAX_RETRY_ATTEMPTS = 3;
324
324
  const RETRY_DELAY = 1e3;
@@ -2,6 +2,7 @@ import a from './index2.mjs';
2
2
  import { i as inquirer } from './index3.mjs';
3
3
  import ora from './index7.mjs';
4
4
  import { c as createApiClient } from '../shared/ccjk.D6ycHbak.mjs';
5
+ import { CLOUD_ENDPOINTS } from './constants.mjs';
5
6
  import '../shared/ccjk.BAGoDD49.mjs';
6
7
  import 'node:readline';
7
8
  import 'stream';
@@ -19,8 +20,12 @@ import 'node:crypto';
19
20
  import 'buffer';
20
21
  import 'string_decoder';
21
22
  import '../shared/ccjk.DeWpAShp.mjs';
23
+ import './index5.mjs';
24
+ import 'node:fs';
25
+ import 'node:url';
26
+ import '../shared/ccjk.bQ7Dh1g4.mjs';
22
27
 
23
- const CLOUD_API_BASE_URL = "https://api.claudehome.cn/v1";
28
+ const CLOUD_API_BASE_URL = `${CLOUD_ENDPOINTS.MAIN.BASE_URL}${CLOUD_ENDPOINTS.MAIN.API_VERSION}`;
24
29
  const REQUEST_TIMEOUT = 1e4;
25
30
  const BUILTIN_PROVIDERS = {
26
31
  302: {
@@ -5,7 +5,7 @@ import { join } from 'node:path';
5
5
  import { i as inquirer } from './index3.mjs';
6
6
  import ora from './index7.mjs';
7
7
  import { i18n } from './index5.mjs';
8
- import { i as isDeviceBound, g as getBindingStatus, b as bindDevice } from '../shared/ccjk.eIn-g1yI.mjs';
8
+ import { i as isDeviceBound, g as getBindingStatus, b as bindDevice } from '../shared/ccjk.BBizCO6_.mjs';
9
9
  import { l as logger } from '../shared/ccjk.BJMRY2Ra.mjs';
10
10
  import 'node:readline';
11
11
  import '../shared/ccjk.BAGoDD49.mjs';
@@ -24,7 +24,7 @@ import 'string_decoder';
24
24
  import '../shared/ccjk.DeWpAShp.mjs';
25
25
  import 'node:url';
26
26
  import '../shared/ccjk.bQ7Dh1g4.mjs';
27
- import '../shared/ccjk.BtB1e5jm.mjs';
27
+ import '../shared/ccjk.D0g2ABGg.mjs';
28
28
  import './constants.mjs';
29
29
  import '../shared/ccjk.D6ycHbak.mjs';
30
30
  import './fs-operations.mjs';
@@ -4,8 +4,8 @@ import { getTranslation } from './index5.mjs';
4
4
  import { createHash } from 'node:crypto';
5
5
  import { existsSync, readdirSync, readFileSync, mkdirSync } from 'node:fs';
6
6
  import process__default from 'node:process';
7
- import { a as createGateway } from '../shared/ccjk.BtB1e5jm.mjs';
8
- import { CCJK_SKILLS_DIR, CCJK_CONFIG_DIR } from './constants.mjs';
7
+ import { a as createGateway } from '../shared/ccjk.D0g2ABGg.mjs';
8
+ import { CCJK_SKILLS_DIR, CCJK_CONFIG_DIR, CLOUD_ENDPOINTS } from './constants.mjs';
9
9
  import { writeFileAtomic } from './fs-operations.mjs';
10
10
  import { readFile, stat } from 'node:fs/promises';
11
11
  import { g as getDefaultExportFromCjs } from '../shared/ccjk.BAGoDD49.mjs';
@@ -5625,7 +5625,7 @@ function extractMetadata(data, filePath) {
5625
5625
  return metadata;
5626
5626
  }
5627
5627
 
5628
- process__default.env.CCJK_CLOUD_API_URL || "https://api.claudehome.cn/api/v1";
5628
+ process__default.env.CCJK_CLOUD_API_URL || `${CLOUD_ENDPOINTS.MAIN.BASE_URL}${CLOUD_ENDPOINTS.MAIN.API_VERSION}`;
5629
5629
  const SYNC_STATE_FILE = join(CCJK_CONFIG_DIR, "skills-sync-state.json");
5630
5630
  const DEFAULT_TIMEOUT = 3e4;
5631
5631
  function loadSyncState() {
@@ -122,7 +122,7 @@ function getSlashCommands() {
122
122
  descriptionZh: "\u521B\u5EFA\u914D\u7F6E\u5907\u4EFD",
123
123
  category: "system",
124
124
  handler: async () => {
125
- const { backupExistingConfig } = await import('./config2.mjs').then(function (n) { return n.k; });
125
+ const { backupExistingConfig } = await import('./config2.mjs').then(function (n) { return n.j; });
126
126
  const backupPath = backupExistingConfig();
127
127
  if (backupPath) {
128
128
  console.log(a.green(`\u2705 Backup created: ${backupPath}`));
@@ -207,6 +207,32 @@ function renderClaudeCodeSection(defaults) {
207
207
  lines.push(` ${label("Features:".padEnd(14))} ${val(features.join(", "))}`);
208
208
  }
209
209
  }
210
+ try {
211
+ const settingsPath = join(homedir(), ".claude", "settings.json");
212
+ if (existsSync(settingsPath)) {
213
+ const data = JSON.parse(readFileSync(settingsPath, "utf-8"));
214
+ const env = data.env || {};
215
+ const haiku = env.ANTHROPIC_DEFAULT_HAIKU_MODEL;
216
+ const sonnet = env.ANTHROPIC_DEFAULT_SONNET_MODEL;
217
+ const opus = env.ANTHROPIC_DEFAULT_OPUS_MODEL;
218
+ const hasAdaptive = Boolean(haiku || sonnet || opus);
219
+ if (data.model && hasAdaptive) {
220
+ lines.push(` ${label("Model:".padEnd(14))} ${a.red(data.model)} ${a.red("(overrides adaptive routing!)")}`);
221
+ lines.push(` ${label("".padEnd(14))} ${a.yellow("Run: ccjk boost --fix-model")}`);
222
+ } else if (hasAdaptive) {
223
+ lines.push(` ${label("Routing:".padEnd(14))} ${a.green("adaptive")}`);
224
+ if (haiku)
225
+ lines.push(` ${label(" Quick:".padEnd(14))} ${val(haiku)}`);
226
+ if (sonnet)
227
+ lines.push(` ${label(" Standard:".padEnd(14))} ${val(sonnet)}`);
228
+ if (opus)
229
+ lines.push(` ${label(" Complex:".padEnd(14))} ${val(opus)}`);
230
+ } else if (data.model) {
231
+ lines.push(` ${label("Model:".padEnd(14))} ${val(data.model)}`);
232
+ }
233
+ }
234
+ } catch {
235
+ }
210
236
  return lines;
211
237
  }
212
238
  function renderCompressionMetricsSection(projectHash) {
package/dist/index.d.mts CHANGED
@@ -219,7 +219,7 @@ declare function batchAnalyze(projectPaths: string[], config?: Partial<DetectorC
219
219
  /**
220
220
  * MCP Server Configuration
221
221
  */
222
- interface McpServerConfig {
222
+ interface McpServerConfig$1 {
223
223
  type?: 'stdio' | 'http' | 'websocket';
224
224
  command?: string;
225
225
  args?: string[];
@@ -267,7 +267,7 @@ interface WorkflowConfig {
267
267
  /**
268
268
  * Union type for all config types
269
269
  */
270
- type RecommendationConfig = McpServerConfig | SkillConfig | AgentConfig | HookConfig | WorkflowConfig;
270
+ type RecommendationConfig = McpServerConfig$1 | SkillConfig | AgentConfig | HookConfig | WorkflowConfig;
271
271
  /**
272
272
  * Allowed template parameter default values
273
273
  */
@@ -929,59 +929,6 @@ declare class CachedCloudClient {
929
929
  getClient(): CloudClient;
930
930
  }
931
931
 
932
- type HookType = 'pre-commit' | 'post-commit' | 'pre-push' | 'post-push' | 'pre-test' | 'post-test' | 'pre-build' | 'post-build' | 'pre-install' | 'post-install' | 'pre-start' | 'post-start' | 'custom';
933
- type HookCategory = 'pre-commit' | 'post-test' | 'lifecycle' | 'custom';
934
- interface HookTrigger {
935
- matcher: string;
936
- condition?: string;
937
- parameters?: Record<string, any>;
938
- }
939
- interface HookAction {
940
- command: string;
941
- args?: string[];
942
- workingDirectory?: string;
943
- environment?: Record<string, string>;
944
- timeout?: number;
945
- }
946
- interface HookMetadata {
947
- version?: string;
948
- author?: string;
949
- tags?: string[];
950
- projectTypes?: string[];
951
- created?: string;
952
- updated?: string;
953
- ccjkVersion?: string;
954
- }
955
- interface HookTemplate {
956
- name: string;
957
- description: string;
958
- type: HookType;
959
- category: HookCategory;
960
- projectTypes: string[];
961
- trigger: HookTrigger;
962
- action: HookAction;
963
- enabled: boolean;
964
- priority: number;
965
- metadata?: HookMetadata;
966
- }
967
-
968
- /**
969
- * Get hook recommendations from cloud service
970
- */
971
- declare function getCloudRecommendedHooks(projectInfo: ProjectAnalysis, options?: {
972
- includeCommunity?: boolean;
973
- includePremium?: boolean;
974
- limit?: number;
975
- }): Promise<HookTemplate[]>;
976
- /**
977
- * Submit hook usage analytics
978
- */
979
- declare function submitHookAnalytics(hookName: string, projectInfo: ProjectAnalysis, result: 'installed' | 'skipped' | 'error'): Promise<void>;
980
- /**
981
- * Get popular hooks from community
982
- */
983
- declare function getCommunityHooks(limit?: number, category?: string): Promise<HookTemplate[]>;
984
-
985
932
  /**
986
933
  * Agent Template Loader
987
934
  *
@@ -3812,6 +3759,161 @@ declare const AI_OUTPUT_LANGUAGES: {
3812
3759
  };
3813
3760
  type AiOutputLanguage = keyof typeof AI_OUTPUT_LANGUAGES;
3814
3761
 
3762
+ /**
3763
+ * Claude Code settings.json configuration types
3764
+ * Supports Claude Code CLI 2.0-2.1 configuration schema
3765
+ */
3766
+ /**
3767
+ * StatusLine configuration for Claude Code
3768
+ */
3769
+ interface StatusLineConfig {
3770
+ type: 'command';
3771
+ command: string;
3772
+ padding?: number;
3773
+ }
3774
+ /**
3775
+ * Thinking configuration for Claude Code CLI 2.0+
3776
+ */
3777
+ interface ThinkingConfig {
3778
+ /** Enable extended thinking mode */
3779
+ enabled?: boolean;
3780
+ /** Budget tokens for thinking (default: 10240) */
3781
+ budgetTokens?: number;
3782
+ }
3783
+ /**
3784
+ * File suggestion configuration for Claude Code CLI 2.0+
3785
+ */
3786
+ interface FileSuggestionConfig {
3787
+ /** Command to run for file suggestions (e.g., 'git', 'grep') */
3788
+ command?: string;
3789
+ }
3790
+ /**
3791
+ * Claude Code CLI 2.0-2.1 settings.json configuration
3792
+ * Extends the legacy configuration with new fields
3793
+ */
3794
+ interface ClaudeSettings {
3795
+ /** Model configuration: built-in aliases or a full Claude model name. */
3796
+ model?: string;
3797
+ /** Environment variables for API configuration */
3798
+ env?: {
3799
+ ANTHROPIC_API_KEY?: string;
3800
+ ANTHROPIC_AUTH_TOKEN?: string;
3801
+ ANTHROPIC_BASE_URL?: string;
3802
+ ANTHROPIC_MODEL?: string;
3803
+ ANTHROPIC_SMALL_FAST_MODEL?: string;
3804
+ ANTHROPIC_DEFAULT_HAIKU_MODEL?: string;
3805
+ ANTHROPIC_DEFAULT_SONNET_MODEL?: string;
3806
+ ANTHROPIC_DEFAULT_OPUS_MODEL?: string;
3807
+ [key: string]: string | undefined;
3808
+ };
3809
+ /** Permissions configuration */
3810
+ permissions?: {
3811
+ allow?: string[];
3812
+ deny?: string[];
3813
+ };
3814
+ /** Chat configuration */
3815
+ chat?: {
3816
+ alwaysApprove?: string[];
3817
+ };
3818
+ /** Experimental features configuration */
3819
+ experimental?: {
3820
+ [key: string]: any;
3821
+ };
3822
+ /** Status line configuration */
3823
+ statusLine?: StatusLineConfig;
3824
+ /** Output style for AI responses (legacy CCJK field) */
3825
+ outputStyle?: string;
3826
+ /** Response language for AI (e.g., "japanese", "chinese", "english") */
3827
+ language?: string;
3828
+ /** Custom directory for storing plans */
3829
+ plansDirectory?: string;
3830
+ /** Enable auto mode for MCP tool search */
3831
+ toolSearchAutoMode?: boolean;
3832
+ /** Show duration for each turn in conversation */
3833
+ showTurnDuration?: boolean;
3834
+ /** Respect .gitignore file for file operations */
3835
+ respectGitignore?: boolean;
3836
+ /** MCP auto-enable threshold configuration */
3837
+ auto?: {
3838
+ /** Number of uses before auto-enabling an MCP server (default: 5) */
3839
+ mcp?: number;
3840
+ };
3841
+ /** Default agent for Claude Code CLI 2.0+ */
3842
+ agent?: string;
3843
+ /** Extended thinking configuration */
3844
+ thinking?: ThinkingConfig;
3845
+ /** File suggestion configuration */
3846
+ fileSuggestion?: FileSuggestionConfig;
3847
+ /** Allow unsandboxed commands (dangerous) */
3848
+ allowUnsandboxedCommands?: boolean;
3849
+ /** List of disallowed tools */
3850
+ disallowedTools?: string[];
3851
+ /** Attribution string for responses */
3852
+ attribution?: string;
3853
+ /** Index configuration for context management */
3854
+ index?: {
3855
+ /** Maximum number of files to index */
3856
+ maxFiles?: number;
3857
+ /** Maximum file size to index (in bytes) */
3858
+ maxFileSize?: number;
3859
+ };
3860
+ /** Allow/deny browser automation */
3861
+ allowBrowser?: boolean;
3862
+ /** Session configuration */
3863
+ session?: {
3864
+ /** Auto-naming pattern for sessions */
3865
+ autoNaming?: 'branch' | 'timestamp' | 'prompt' | 'off';
3866
+ /** Session persistence directory */
3867
+ directory?: string;
3868
+ /** Auto-save interval in seconds */
3869
+ autoSaveInterval?: number;
3870
+ };
3871
+ /** Background tasks configuration */
3872
+ backgroundTasks?: {
3873
+ /** Maximum concurrent background tasks */
3874
+ maxConcurrent?: number;
3875
+ /** Storage directory for task data */
3876
+ storageDir?: string;
3877
+ /** Default task timeout in milliseconds */
3878
+ defaultTimeout?: number;
3879
+ };
3880
+ /** Teleport configuration for remote sessions */
3881
+ teleport?: {
3882
+ /** Enable teleport feature */
3883
+ enabled?: boolean;
3884
+ /** Custom endpoint for teleport service */
3885
+ endpoint?: string;
3886
+ /** API key for remote service */
3887
+ apiKey?: string;
3888
+ /** Session expiration in days */
3889
+ expirationDays?: number;
3890
+ };
3891
+ /** Output format configuration */
3892
+ output?: {
3893
+ /** Format for responses */
3894
+ format?: 'text' | 'markdown' | 'json';
3895
+ /** Include timestamps */
3896
+ timestamps?: boolean;
3897
+ /** Include source attribution */
3898
+ attribution?: boolean;
3899
+ };
3900
+ /** Hooks configuration for lifecycle events */
3901
+ hooks?: Record<string, unknown[]>;
3902
+ /** MCP servers configuration (legacy field, now in config.json) */
3903
+ mcpServers?: Record<string, McpServerConfig>;
3904
+ /** Additional unknown fields for forward compatibility */
3905
+ [key: string]: any;
3906
+ }
3907
+ /**
3908
+ * MCP server configuration (shared between settings.json and config.json)
3909
+ */
3910
+ interface McpServerConfig {
3911
+ type: 'stdio' | 'sse';
3912
+ command?: string;
3913
+ args?: string[];
3914
+ url?: string;
3915
+ env?: Record<string, string>;
3916
+ }
3815
3917
  /**
3816
3918
  * API configuration for Claude Code
3817
3919
  */
@@ -3831,6 +3933,17 @@ declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
3831
3933
  */
3832
3934
  declare function configureHooks(hooks: Record<string, unknown[]>): void;
3833
3935
  declare function mergeConfigs(sourceFile: string, targetFile: string): void;
3936
+ interface ModelConfigOverride {
3937
+ primaryModel?: string;
3938
+ haikuModel?: string;
3939
+ sonnetModel?: string;
3940
+ opusModel?: string;
3941
+ }
3942
+ /**
3943
+ * Hard-overwrite all model-related settings in memory.
3944
+ * This keeps profile apply/edit behavior deterministic and removes stale model state.
3945
+ */
3946
+ declare function overwriteModelSettings(settings: ClaudeSettings, { primaryModel, haikuModel, sonnetModel, opusModel, }: ModelConfigOverride, mode?: 'reset' | 'override'): ClaudeSettings;
3834
3947
  /**
3835
3948
  * Update custom model configuration using settings.model plus family-specific env overrides
3836
3949
  * @param primaryModel - Primary model name for general tasks
@@ -3882,6 +3995,7 @@ declare function switchToOfficialLogin(): boolean;
3882
3995
  declare function promptApiConfigurationAction(): Promise<'modify-partial' | 'modify-all' | 'keep-existing' | null>;
3883
3996
 
3884
3997
  type config_ApiConfig = ApiConfig;
3998
+ type config_ModelConfigOverride = ModelConfigOverride;
3885
3999
  declare const config_applyAiLanguageDirective: typeof applyAiLanguageDirective;
3886
4000
  declare const config_backupExistingConfig: typeof backupExistingConfig;
3887
4001
  declare const config_configureApi: typeof configureApi;
@@ -3893,13 +4007,14 @@ declare const config_getExistingCustomModelConfig: typeof getExistingCustomModel
3893
4007
  declare const config_getExistingModelConfig: typeof getExistingModelConfig;
3894
4008
  declare const config_mergeConfigs: typeof mergeConfigs;
3895
4009
  declare const config_mergeSettingsFile: typeof mergeSettingsFile;
4010
+ declare const config_overwriteModelSettings: typeof overwriteModelSettings;
3896
4011
  declare const config_promptApiConfigurationAction: typeof promptApiConfigurationAction;
3897
4012
  declare const config_switchToOfficialLogin: typeof switchToOfficialLogin;
3898
4013
  declare const config_updateCustomModel: typeof updateCustomModel;
3899
4014
  declare const config_updateDefaultModel: typeof updateDefaultModel;
3900
4015
  declare namespace config {
3901
- export { config_applyAiLanguageDirective as applyAiLanguageDirective, config_backupExistingConfig as backupExistingConfig, config_configureApi as configureApi, config_configureHooks as configureHooks, config_copyConfigFiles as copyConfigFiles, config_ensureClaudeDir as ensureClaudeDir, config_getExistingApiConfig as getExistingApiConfig, config_getExistingCustomModelConfig as getExistingCustomModelConfig, config_getExistingModelConfig as getExistingModelConfig, config_mergeConfigs as mergeConfigs, config_mergeSettingsFile as mergeSettingsFile, config_promptApiConfigurationAction as promptApiConfigurationAction, config_switchToOfficialLogin as switchToOfficialLogin, config_updateCustomModel as updateCustomModel, config_updateDefaultModel as updateDefaultModel };
3902
- export type { config_ApiConfig as ApiConfig };
4016
+ export { config_applyAiLanguageDirective as applyAiLanguageDirective, config_backupExistingConfig as backupExistingConfig, config_configureApi as configureApi, config_configureHooks as configureHooks, config_copyConfigFiles as copyConfigFiles, config_ensureClaudeDir as ensureClaudeDir, config_getExistingApiConfig as getExistingApiConfig, config_getExistingCustomModelConfig as getExistingCustomModelConfig, config_getExistingModelConfig as getExistingModelConfig, config_mergeConfigs as mergeConfigs, config_mergeSettingsFile as mergeSettingsFile, config_overwriteModelSettings as overwriteModelSettings, config_promptApiConfigurationAction as promptApiConfigurationAction, config_switchToOfficialLogin as switchToOfficialLogin, config_updateCustomModel as updateCustomModel, config_updateDefaultModel as updateDefaultModel };
4017
+ export type { config_ApiConfig as ApiConfig, config_ModelConfigOverride as ModelConfigOverride };
3903
4018
  }
3904
4019
 
3905
4020
  /**
@@ -5397,5 +5512,5 @@ declare function assertDefined<T>(value: T | null | undefined, message?: string)
5397
5512
  */
5398
5513
  declare function assert(condition: boolean, message?: string): asserts condition;
5399
5514
 
5400
- export { AiderTool, BaseCodeTool, BaseError, CachedCloudClient, ClaudeCodeTool, ClineTool, CloudCache, CloudClient, CloudClientError, CloudError, CloudErrorCode, CloudErrorFactory, CodexTool, ConfigManager, ConfigValidator, ConfigurationError, ContinueTool, CursorTool, FallbackCloudClient, InternalError, Logger, Mutex, NotFoundError, ProjectAnalyzer, RatingsApiError, RatingsApiErrorCode, RetryableCloudClient, Semaphore, TelemetryReporter, TemplatesClient, TimeoutError, ToolFactory, ToolRegistry, UnauthorizedError, ValidationError, analyzeDependencies, analyzeProject, index$6 as array, assert, assertDefined, index$5 as async, batchAnalyze, batchProcessFiles, camelCase, canInstallMore, capitalize, chunk, index$4 as command, commandExists$1 as commandExists, config, convertBatchTemplateResponse, convertConfig, convertParameterDefault, convertProjectAnalysisResponse, convertRecommendation, convertTemplate, convertTemplateParameter, copyFile, countLines, createCloudClient, createCompleteCloudClient, createConfigManager, createLogger, createRating, createTemplatesClient, createTool, createValidator, debounce, deepClone, deepMerge, deleteDir, deleteFile, detectProject, detectProjectType, difference, ensureDir, index$3 as error, executeCommand, executeCommandStream, exists, extractDisplayName, extractString, flatten, flatten$1 as flattenArray, formatError, formatErrorForLogging, index$2 as fs, generateCompactWelcome, generateRecommendations, generateWelcome, get, getArchitecture, getCacheDir, getCapabilitiesByType, getCapability, getCloudMcpRecommendations, getCloudRecommendations, getCloudRecommendedHooks, getCloudSkillRecommendations, getCommandPath, getCommandVersion, getCommunityHooks, getConfigDir, getDataDir, getDisabledSkills, getEnabledSkills, getErrorMessage, getFileInfo, getFileSize, getHomeDir, getPlatform, getPlatformInfo, getQuotaUsagePercentage, getRecommendations, getRegistry, getRetryDelay, getSkillRatings, getTelemetry, getTempDir, getTemplatesClient, getUserQuota, getUserSkills, handleCloudError, has, i18nHelpers, initializeTelemetry, installSkill, intersection, isArray, isAuthError, isBoolean, isDefined, isDirectory, isDuplicateRatingError, isEmail, isFile, isLargeFile, isLinux, isMacOS, isNumber, isObject, isRateLimitError, isRecommendationConfig, isRetryableError, isRetryableErrorCode, isSkillInstalled, isSkillNotFoundError, isString, isTelemetryEventData, isTemplateParameterValue, isURL, isUnauthorizedError, isUnix, isWindows, kebabCase, listDirs, listFiles, logger, logger$2 as loggerUtils, moveFile, normalizeRecommendation, normalizeRecommendations, index$1 as object, omit, parallelLimit, partition, pascalCase, pick, platform, processLargeFile, processLineByLine, ratingsApi, readFile, readJSON, retry, retryUtils, scanCapabilities, sequence, set, shuffle, skillsMarketplaceApi, sleep, slugify, snakeCase, sortByLastUsed, sortByUsage, stopTelemetry, streamJSON, streamWriteJSON, index as string, submitHookAnalytics, telemetryUtils, template, throttle, timeout, trackEvent, truncate, tryCatch, tryCatchAsync, unflatten, uninstallSkill, union, unique, updateSkill, userSkillsApi, validateBatchTemplateRequest, validateProjectAnalysisRequest, validateUsageReport, validation, validators, waitFor, withRetry, wrapError, writeFile, writeJSON };
5401
- export type { AgentConfig, AnalysisCompletedData, AnalysisMetadata, AuthRequestOptions, BatchTelemetryData, BatchTemplateRequest, BatchTemplateResponse$1 as BatchTemplateResponse, BuildSystem, CacheEntry, Capability, CapabilityScanResult, CapabilityStatus, CapabilityType, ChunkProcessorOptions, CloudErrorMetadata, CreateRatingData, CreateRatingResponse, DependencyAnalysis, DependencyConflict, DependencyNode, DependencyType, DetectorConfig, ErrorOccurredData, ExecutionResult, FileInfo, FrameworkDetectionResult, GetSkillRatingsParams, GetSkillRatingsResponse, HealthCheckResponse, HookConfig, IChatTool, ICodeGenTool, ICodeTool, IFileEditTool, InstallStatus, InstallationCommands, InstallationPlan, LanguageDetection, McpServerConfig, MetricType, MultilingualString, PackageManager, ProjectAnalysis, ProjectAnalysisRequest, ProjectAnalysisResponse, RatingSortOption, RawBatchTemplateResponse, RawProjectAnalysisResponse, RawRecommendation, RawTemplate, Recommendation, RecommendationAcceptedData, RecommendationConfig, RecommendationShownData, SkillConfig, StreamProcessorOptions, TelemetryEventData, TemplateDownloadData, TemplateParameter, TemplateParameterValue, TemplateResponse, TemplateType$1 as TemplateType, ToolCapabilities, ToolConfig, ToolMetadata, UsageReport, UsageReportResponse, WelcomeOptions, WorkflowConfig };
5515
+ export { AiderTool, BaseCodeTool, BaseError, CachedCloudClient, ClaudeCodeTool, ClineTool, CloudCache, CloudClient, CloudClientError, CloudError, CloudErrorCode, CloudErrorFactory, CodexTool, ConfigManager, ConfigValidator, ConfigurationError, ContinueTool, CursorTool, FallbackCloudClient, InternalError, Logger, Mutex, NotFoundError, ProjectAnalyzer, RatingsApiError, RatingsApiErrorCode, RetryableCloudClient, Semaphore, TelemetryReporter, TemplatesClient, TimeoutError, ToolFactory, ToolRegistry, UnauthorizedError, ValidationError, analyzeDependencies, analyzeProject, index$6 as array, assert, assertDefined, index$5 as async, batchAnalyze, batchProcessFiles, camelCase, canInstallMore, capitalize, chunk, index$4 as command, commandExists$1 as commandExists, config, convertBatchTemplateResponse, convertConfig, convertParameterDefault, convertProjectAnalysisResponse, convertRecommendation, convertTemplate, convertTemplateParameter, copyFile, countLines, createCloudClient, createCompleteCloudClient, createConfigManager, createLogger, createRating, createTemplatesClient, createTool, createValidator, debounce, deepClone, deepMerge, deleteDir, deleteFile, detectProject, detectProjectType, difference, ensureDir, index$3 as error, executeCommand, executeCommandStream, exists, extractDisplayName, extractString, flatten, flatten$1 as flattenArray, formatError, formatErrorForLogging, index$2 as fs, generateCompactWelcome, generateRecommendations, generateWelcome, get, getArchitecture, getCacheDir, getCapabilitiesByType, getCapability, getCloudMcpRecommendations, getCloudRecommendations, getCloudSkillRecommendations, getCommandPath, getCommandVersion, getConfigDir, getDataDir, getDisabledSkills, getEnabledSkills, getErrorMessage, getFileInfo, getFileSize, getHomeDir, getPlatform, getPlatformInfo, getQuotaUsagePercentage, getRecommendations, getRegistry, getRetryDelay, getSkillRatings, getTelemetry, getTempDir, getTemplatesClient, getUserQuota, getUserSkills, handleCloudError, has, i18nHelpers, initializeTelemetry, installSkill, intersection, isArray, isAuthError, isBoolean, isDefined, isDirectory, isDuplicateRatingError, isEmail, isFile, isLargeFile, isLinux, isMacOS, isNumber, isObject, isRateLimitError, isRecommendationConfig, isRetryableError, isRetryableErrorCode, isSkillInstalled, isSkillNotFoundError, isString, isTelemetryEventData, isTemplateParameterValue, isURL, isUnauthorizedError, isUnix, isWindows, kebabCase, listDirs, listFiles, logger, logger$2 as loggerUtils, moveFile, normalizeRecommendation, normalizeRecommendations, index$1 as object, omit, parallelLimit, partition, pascalCase, pick, platform, processLargeFile, processLineByLine, ratingsApi, readFile, readJSON, retry, retryUtils, scanCapabilities, sequence, set, shuffle, skillsMarketplaceApi, sleep, slugify, snakeCase, sortByLastUsed, sortByUsage, stopTelemetry, streamJSON, streamWriteJSON, index as string, telemetryUtils, template, throttle, timeout, trackEvent, truncate, tryCatch, tryCatchAsync, unflatten, uninstallSkill, union, unique, updateSkill, userSkillsApi, validateBatchTemplateRequest, validateProjectAnalysisRequest, validateUsageReport, validation, validators, waitFor, withRetry, wrapError, writeFile, writeJSON };
5516
+ export type { AgentConfig, AnalysisCompletedData, AnalysisMetadata, AuthRequestOptions, BatchTelemetryData, BatchTemplateRequest, BatchTemplateResponse$1 as BatchTemplateResponse, BuildSystem, CacheEntry, Capability, CapabilityScanResult, CapabilityStatus, CapabilityType, ChunkProcessorOptions, CloudErrorMetadata, CreateRatingData, CreateRatingResponse, DependencyAnalysis, DependencyConflict, DependencyNode, DependencyType, DetectorConfig, ErrorOccurredData, ExecutionResult, FileInfo, FrameworkDetectionResult, GetSkillRatingsParams, GetSkillRatingsResponse, HealthCheckResponse, HookConfig, IChatTool, ICodeGenTool, ICodeTool, IFileEditTool, InstallStatus, InstallationCommands, InstallationPlan, LanguageDetection, McpServerConfig$1 as McpServerConfig, MetricType, MultilingualString, PackageManager, ProjectAnalysis, ProjectAnalysisRequest, ProjectAnalysisResponse, RatingSortOption, RawBatchTemplateResponse, RawProjectAnalysisResponse, RawRecommendation, RawTemplate, Recommendation, RecommendationAcceptedData, RecommendationConfig, RecommendationShownData, SkillConfig, StreamProcessorOptions, TelemetryEventData, TemplateDownloadData, TemplateParameter, TemplateParameterValue, TemplateResponse, TemplateType$1 as TemplateType, ToolCapabilities, ToolConfig, ToolMetadata, UsageReport, UsageReportResponse, WelcomeOptions, WorkflowConfig };