ccjk 16.0.7 → 16.3.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.
- package/README.md +72 -316
- package/dist/chunks/claude-code-config-manager.mjs +28 -7
- package/dist/chunks/claude-code-incremental-manager.mjs +2 -2
- package/dist/chunks/codex-config-switch.mjs +3 -3
- package/dist/chunks/codex-presets.mjs +98 -0
- package/dist/chunks/codex-provider-manager.mjs +4 -4
- package/dist/chunks/codex-runtime.mjs +246 -0
- package/dist/chunks/codex-uninstaller.mjs +2 -2
- package/dist/chunks/commands.mjs +1 -1
- package/dist/chunks/features.mjs +12 -12
- package/dist/chunks/simple-config.mjs +485 -130
- package/dist/cli.mjs +1730 -760
- package/dist/i18n/locales/en/clean.json +24 -0
- package/dist/i18n/locales/en/codex.json +24 -1
- package/dist/i18n/locales/en/configuration.json +20 -12
- package/dist/i18n/locales/en/hub.json +30 -0
- package/dist/i18n/locales/en/menu.json +30 -0
- package/dist/i18n/locales/en/workflow.json +13 -1
- package/dist/i18n/locales/zh-CN/clean.json +24 -0
- package/dist/i18n/locales/zh-CN/codex.json +24 -1
- package/dist/i18n/locales/zh-CN/configuration.json +20 -12
- package/dist/i18n/locales/zh-CN/hub.json +30 -0
- package/dist/i18n/locales/zh-CN/menu.json +30 -0
- package/dist/i18n/locales/zh-CN/workflow.json +13 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{ccjk.BSLlI-JL.mjs → ccjk.TC1_-qhV.mjs} +1 -1
- package/package.json +1 -1
- package/templates/common/output-styles/en/agents-md-baseline.md +28 -0
- package/templates/common/output-styles/en/plan-first.md +30 -0
- package/templates/common/output-styles/en/surgical-diff.md +27 -0
- package/templates/common/output-styles/en/verify-and-ship.md +31 -0
- package/templates/common/output-styles/zh-CN/agents-md-baseline.md +28 -0
- package/templates/common/output-styles/zh-CN/plan-first.md +30 -0
- package/templates/common/output-styles/zh-CN/surgical-diff.md +27 -0
- package/templates/common/output-styles/zh-CN/verify-and-ship.md +31 -0
- package/templates/common/workflow/bmad/en/bmad-init.md +275 -0
- package/templates/common/workflow/bmad/zh-CN/bmad-init.md +275 -0
- package/templates/common/workflow/codeReview/en/code-review.md +34 -0
- package/templates/common/workflow/codeReview/zh-CN/code-review.md +34 -0
- package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +628 -0
- package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +628 -0
- package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +187 -0
- package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +191 -0
- package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +249 -0
- package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +277 -0
- package/templates/common/workflow/essential/en/agents/get-current-datetime.md +29 -0
- package/templates/common/workflow/essential/en/agents/init-architect.md +115 -0
- package/templates/common/workflow/essential/en/agents/planner.md +116 -0
- package/templates/common/workflow/essential/en/agents/teamagent.md +102 -0
- package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +91 -0
- package/templates/common/workflow/essential/en/feat.md +92 -0
- package/templates/common/workflow/essential/en/init-project.md +53 -0
- package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +29 -0
- package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +115 -0
- package/templates/common/workflow/essential/zh-CN/agents/planner.md +116 -0
- package/templates/common/workflow/essential/zh-CN/agents/teamagent.md +102 -0
- package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +91 -0
- package/templates/common/workflow/essential/zh-CN/feat.md +315 -0
- package/templates/common/workflow/essential/zh-CN/init-project.md +53 -0
- package/templates/common/workflow/interview/en/interview.md +67 -0
- package/templates/common/workflow/interview/zh-CN/interview.md +67 -0
- package/templates/common/workflow/linearMethod/en/linear-method.md +651 -0
- package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +750 -0
- package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +516 -0
- package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +810 -0
- package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +364 -0
- package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +364 -0
|
@@ -18,7 +18,7 @@ import i18next from 'i18next';
|
|
|
18
18
|
import Backend from 'i18next-fs-backend';
|
|
19
19
|
import { edit, stringify, parse, initSync } from '@rainbowatcher/toml-edit-js';
|
|
20
20
|
|
|
21
|
-
const version = "16.0
|
|
21
|
+
const version = "16.3.0";
|
|
22
22
|
const homepage = "https://github.com/miounet11/ccjk#readme";
|
|
23
23
|
|
|
24
24
|
const i18n = i18next.createInstance();
|
|
@@ -39,7 +39,9 @@ const NAMESPACES = [
|
|
|
39
39
|
"uninstall",
|
|
40
40
|
"updater",
|
|
41
41
|
"workflow",
|
|
42
|
-
"codex"
|
|
42
|
+
"codex",
|
|
43
|
+
"clean",
|
|
44
|
+
"hub"
|
|
43
45
|
];
|
|
44
46
|
function ensureI18nInitialized() {
|
|
45
47
|
if (!i18n.isInitialized) {
|
|
@@ -382,14 +384,21 @@ function getOrderedWorkflows() {
|
|
|
382
384
|
|
|
383
385
|
const CLAUDE_DIR = join(homedir(), ".claude");
|
|
384
386
|
const SETTINGS_FILE = join(CLAUDE_DIR, "settings.json");
|
|
385
|
-
const CLAVUE_DIR = join(homedir(), ".clavue");
|
|
386
|
-
const CLAVUE_SETTINGS_FILE = join(CLAVUE_DIR, "settings.json");
|
|
387
|
-
const CLAVUE_CONFIG_FILE = join(CLAVUE_DIR, ".clavue.json");
|
|
388
|
-
const
|
|
387
|
+
const CLAVUE_DIR$1 = join(homedir(), ".clavue");
|
|
388
|
+
const CLAVUE_SETTINGS_FILE = join(CLAVUE_DIR$1, "settings.json");
|
|
389
|
+
const CLAVUE_CONFIG_FILE = join(CLAVUE_DIR$1, ".clavue.json");
|
|
390
|
+
const CLAVUE_CREDENTIALS_FILE = join(CLAVUE_DIR$1, ".credentials.json");
|
|
391
|
+
const CLAVUE_MD_FILE = join(CLAVUE_DIR$1, "clavue.md");
|
|
389
392
|
const CLAUDE_MD_FILE = join(CLAUDE_DIR, "CLAUDE.md");
|
|
390
393
|
const ClAUDE_CONFIG_FILE = join(homedir(), ".claude.json");
|
|
391
394
|
const CLAUDE_VSC_CONFIG_FILE = join(CLAUDE_DIR, "config.json");
|
|
392
|
-
|
|
395
|
+
function resolveCodexHome() {
|
|
396
|
+
const fromEnv = process.env?.CODEX_HOME?.trim();
|
|
397
|
+
if (fromEnv)
|
|
398
|
+
return fromEnv;
|
|
399
|
+
return join(homedir(), ".codex");
|
|
400
|
+
}
|
|
401
|
+
const CODEX_DIR = resolveCodexHome();
|
|
393
402
|
const CODEX_CONFIG_FILE = join(CODEX_DIR, "config.toml");
|
|
394
403
|
const CODEX_AUTH_FILE = join(CODEX_DIR, "auth.json");
|
|
395
404
|
const CODEX_AGENTS_FILE = join(CODEX_DIR, "AGENTS.md");
|
|
@@ -406,7 +415,7 @@ const DEFAULT_CODE_TOOL_TYPE = "clavue";
|
|
|
406
415
|
const CODE_TOOL_BANNERS = {
|
|
407
416
|
"clavue": "for Clavue",
|
|
408
417
|
"claude-code": "for Claude Code",
|
|
409
|
-
"codex": "for Codex",
|
|
418
|
+
"codex": "for Codex (CLI / App / IDE)",
|
|
410
419
|
"grok": "for Grok CLI"
|
|
411
420
|
};
|
|
412
421
|
function settingsFileForTool(tool) {
|
|
@@ -468,7 +477,8 @@ const constants = {
|
|
|
468
477
|
CLAUDE_MD_FILE: CLAUDE_MD_FILE,
|
|
469
478
|
CLAUDE_VSC_CONFIG_FILE: CLAUDE_VSC_CONFIG_FILE,
|
|
470
479
|
CLAVUE_CONFIG_FILE: CLAVUE_CONFIG_FILE,
|
|
471
|
-
|
|
480
|
+
CLAVUE_CREDENTIALS_FILE: CLAVUE_CREDENTIALS_FILE,
|
|
481
|
+
CLAVUE_DIR: CLAVUE_DIR$1,
|
|
472
482
|
CLAVUE_MD_FILE: CLAVUE_MD_FILE,
|
|
473
483
|
CLAVUE_SETTINGS_FILE: CLAVUE_SETTINGS_FILE,
|
|
474
484
|
CODEX_AGENTS_FILE: CODEX_AGENTS_FILE,
|
|
@@ -488,6 +498,7 @@ const constants = {
|
|
|
488
498
|
getAiOutputLanguageLabel: getAiOutputLanguageLabel,
|
|
489
499
|
isCodeToolType: isCodeToolType,
|
|
490
500
|
resolveCodeToolType: resolveCodeToolType,
|
|
501
|
+
resolveCodexHome: resolveCodexHome,
|
|
491
502
|
settingsFileForTool: settingsFileForTool
|
|
492
503
|
};
|
|
493
504
|
|
|
@@ -1599,9 +1610,9 @@ function resolveClaudeFamilySettingsTarget(codeTool) {
|
|
|
1599
1610
|
if (resolvedTool === "clavue") {
|
|
1600
1611
|
return {
|
|
1601
1612
|
codeTool: "clavue",
|
|
1602
|
-
configDir: CLAVUE_DIR,
|
|
1613
|
+
configDir: CLAVUE_DIR$1,
|
|
1603
1614
|
settingsFile: CLAVUE_SETTINGS_FILE,
|
|
1604
|
-
instructionsFile: join(CLAVUE_DIR, "clavue.md"),
|
|
1615
|
+
instructionsFile: join(CLAVUE_DIR$1, "clavue.md"),
|
|
1605
1616
|
runtimeConfigFile: CLAVUE_CONFIG_FILE,
|
|
1606
1617
|
runtimeBackupDirName: "backups",
|
|
1607
1618
|
displayName: "Clavue",
|
|
@@ -2065,7 +2076,11 @@ const MODEL_ENV_KEYS = [
|
|
|
2065
2076
|
"ANTHROPIC_DEFAULT_SONNET_MODEL",
|
|
2066
2077
|
"ANTHROPIC_DEFAULT_OPUS_MODEL",
|
|
2067
2078
|
// Deprecated but still cleaned to avoid stale values
|
|
2068
|
-
"ANTHROPIC_SMALL_FAST_MODEL"
|
|
2079
|
+
"ANTHROPIC_SMALL_FAST_MODEL",
|
|
2080
|
+
// Clavue 9.x composite model routing env keys
|
|
2081
|
+
"ANTHROPIC_CUSTOM_MODEL_OPTION",
|
|
2082
|
+
"CLAUDE_CODE_SUBAGENT_MODEL",
|
|
2083
|
+
"CLAVUE_API_DIALECT"
|
|
2069
2084
|
];
|
|
2070
2085
|
function clearModelEnv(env) {
|
|
2071
2086
|
for (const key of MODEL_ENV_KEYS) {
|
|
@@ -2073,6 +2088,150 @@ function clearModelEnv(env) {
|
|
|
2073
2088
|
}
|
|
2074
2089
|
}
|
|
2075
2090
|
|
|
2091
|
+
const CLAVUE_DIR = join(homedir(), ".clavue");
|
|
2092
|
+
const CLAVUE_JSON = join(CLAVUE_DIR, ".clavue.json");
|
|
2093
|
+
const CREDENTIALS_JSON = join(CLAVUE_DIR, ".credentials.json");
|
|
2094
|
+
function createModelRouting(models) {
|
|
2095
|
+
const primary = models.primaryModel || "";
|
|
2096
|
+
const haiku = models.haikuModel || primary;
|
|
2097
|
+
const sonnet = models.sonnetModel || primary;
|
|
2098
|
+
const opus = models.opusModel || primary;
|
|
2099
|
+
return {
|
|
2100
|
+
primaryModel: primary,
|
|
2101
|
+
subagentModel: sonnet,
|
|
2102
|
+
smallFastModel: haiku,
|
|
2103
|
+
planModel: opus,
|
|
2104
|
+
exploreModel: sonnet,
|
|
2105
|
+
generalModel: sonnet,
|
|
2106
|
+
teamModel: sonnet,
|
|
2107
|
+
guideModel: opus,
|
|
2108
|
+
reviewModel: ""
|
|
2109
|
+
};
|
|
2110
|
+
}
|
|
2111
|
+
function readJsonFile(path, fallback) {
|
|
2112
|
+
if (!existsSync(path)) return fallback;
|
|
2113
|
+
try {
|
|
2114
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
2115
|
+
} catch {
|
|
2116
|
+
return fallback;
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
function writeJsonFile(path, data) {
|
|
2120
|
+
ensureDir(CLAVUE_DIR);
|
|
2121
|
+
writeFileSync(path, JSON.stringify(data, null, 2));
|
|
2122
|
+
}
|
|
2123
|
+
function readClavueJson() {
|
|
2124
|
+
return readJsonFile(CLAVUE_JSON, {});
|
|
2125
|
+
}
|
|
2126
|
+
function writeClavueJson(data) {
|
|
2127
|
+
writeJsonFile(CLAVUE_JSON, data);
|
|
2128
|
+
}
|
|
2129
|
+
function readCredentials() {
|
|
2130
|
+
return readJsonFile(CREDENTIALS_JSON, { providerProfiles: {} });
|
|
2131
|
+
}
|
|
2132
|
+
function writeCredentials(data) {
|
|
2133
|
+
writeJsonFile(CREDENTIALS_JSON, data);
|
|
2134
|
+
}
|
|
2135
|
+
function listProviderProfiles() {
|
|
2136
|
+
return readClavueJson().clavueProviderProfiles || [];
|
|
2137
|
+
}
|
|
2138
|
+
function getActiveProviderProfileId() {
|
|
2139
|
+
return readClavueJson().activeProviderProfileId;
|
|
2140
|
+
}
|
|
2141
|
+
function getProviderProfile(id) {
|
|
2142
|
+
return listProviderProfiles().find((p) => p.id === id);
|
|
2143
|
+
}
|
|
2144
|
+
function saveProviderProfile(profile) {
|
|
2145
|
+
const clavueJson = readClavueJson();
|
|
2146
|
+
const profiles = clavueJson.clavueProviderProfiles || [];
|
|
2147
|
+
const now = Date.now();
|
|
2148
|
+
const existingIdx = profiles.findIndex((p) => p.id === profile.id);
|
|
2149
|
+
const existing = existingIdx >= 0 ? profiles[existingIdx] : void 0;
|
|
2150
|
+
const fullProfile = {
|
|
2151
|
+
id: profile.id,
|
|
2152
|
+
name: profile.name || profile.id,
|
|
2153
|
+
providerId: profile.providerId || "custom",
|
|
2154
|
+
baseUrl: profile.baseUrl,
|
|
2155
|
+
authType: profile.authType,
|
|
2156
|
+
modelRouting: profile.modelRouting || createModelRouting({}),
|
|
2157
|
+
provenance: existing?.provenance || { kind: "manual" },
|
|
2158
|
+
createdAt: existing?.createdAt || now,
|
|
2159
|
+
updatedAt: now
|
|
2160
|
+
};
|
|
2161
|
+
if (profile.modelMode !== void 0) {
|
|
2162
|
+
fullProfile.modelMode = profile.modelMode;
|
|
2163
|
+
} else if (existing?.modelMode) {
|
|
2164
|
+
fullProfile.modelMode = existing.modelMode;
|
|
2165
|
+
}
|
|
2166
|
+
if (profile.apiDialectMode !== void 0) {
|
|
2167
|
+
fullProfile.apiDialectMode = profile.apiDialectMode;
|
|
2168
|
+
} else if (existing?.apiDialectMode) {
|
|
2169
|
+
fullProfile.apiDialectMode = existing.apiDialectMode;
|
|
2170
|
+
}
|
|
2171
|
+
if (existingIdx >= 0) {
|
|
2172
|
+
profiles[existingIdx] = fullProfile;
|
|
2173
|
+
} else {
|
|
2174
|
+
profiles.push(fullProfile);
|
|
2175
|
+
}
|
|
2176
|
+
clavueJson.clavueProviderProfiles = profiles;
|
|
2177
|
+
if (profile.setAsActive !== false) {
|
|
2178
|
+
clavueJson.activeProviderProfileId = profile.id;
|
|
2179
|
+
}
|
|
2180
|
+
writeClavueJson(clavueJson);
|
|
2181
|
+
if (profile.apiKey) {
|
|
2182
|
+
const credentials = readCredentials();
|
|
2183
|
+
credentials.providerProfiles[profile.id] = {
|
|
2184
|
+
credential: profile.apiKey,
|
|
2185
|
+
authType: profile.authType
|
|
2186
|
+
};
|
|
2187
|
+
writeCredentials(credentials);
|
|
2188
|
+
}
|
|
2189
|
+
return fullProfile;
|
|
2190
|
+
}
|
|
2191
|
+
function deleteProviderProfile(id) {
|
|
2192
|
+
const clavueJson = readClavueJson();
|
|
2193
|
+
const profiles = clavueJson.clavueProviderProfiles || [];
|
|
2194
|
+
const idx = profiles.findIndex((p) => p.id === id);
|
|
2195
|
+
if (idx < 0) return false;
|
|
2196
|
+
profiles.splice(idx, 1);
|
|
2197
|
+
clavueJson.clavueProviderProfiles = profiles;
|
|
2198
|
+
if (clavueJson.activeProviderProfileId === id) {
|
|
2199
|
+
clavueJson.activeProviderProfileId = profiles.length > 0 ? profiles[0].id : void 0;
|
|
2200
|
+
}
|
|
2201
|
+
writeClavueJson(clavueJson);
|
|
2202
|
+
const credentials = readCredentials();
|
|
2203
|
+
delete credentials.providerProfiles[id];
|
|
2204
|
+
writeCredentials(credentials);
|
|
2205
|
+
return true;
|
|
2206
|
+
}
|
|
2207
|
+
function setActiveProviderProfile(id) {
|
|
2208
|
+
const profiles = listProviderProfiles();
|
|
2209
|
+
if (!profiles.find((p) => p.id === id)) return false;
|
|
2210
|
+
const clavueJson = readClavueJson();
|
|
2211
|
+
clavueJson.activeProviderProfileId = id;
|
|
2212
|
+
writeClavueJson(clavueJson);
|
|
2213
|
+
return true;
|
|
2214
|
+
}
|
|
2215
|
+
function generateProfileId(name) {
|
|
2216
|
+
return name.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
const clavueProviderProfile = {
|
|
2220
|
+
__proto__: null,
|
|
2221
|
+
createModelRouting: createModelRouting,
|
|
2222
|
+
deleteProviderProfile: deleteProviderProfile,
|
|
2223
|
+
generateProfileId: generateProfileId,
|
|
2224
|
+
getActiveProviderProfileId: getActiveProviderProfileId,
|
|
2225
|
+
getProviderProfile: getProviderProfile,
|
|
2226
|
+
listProviderProfiles: listProviderProfiles,
|
|
2227
|
+
readClavueJson: readClavueJson,
|
|
2228
|
+
readCredentials: readCredentials,
|
|
2229
|
+
saveProviderProfile: saveProviderProfile,
|
|
2230
|
+
setActiveProviderProfile: setActiveProviderProfile,
|
|
2231
|
+
writeClavueJson: writeClavueJson,
|
|
2232
|
+
writeCredentials: writeCredentials
|
|
2233
|
+
};
|
|
2234
|
+
|
|
2076
2235
|
function cleanupPermissions(templatePermissions, userPermissions) {
|
|
2077
2236
|
const templateSet = new Set(templatePermissions);
|
|
2078
2237
|
const cleanedPermissions = userPermissions.filter((permission) => {
|
|
@@ -2183,6 +2342,20 @@ function configureApi(apiConfig, codeTool) {
|
|
|
2183
2342
|
} catch (error) {
|
|
2184
2343
|
console.error("Failed to set onboarding flag", error);
|
|
2185
2344
|
}
|
|
2345
|
+
if (target.codeTool === "clavue" && apiConfig.url && apiConfig.key) {
|
|
2346
|
+
try {
|
|
2347
|
+
const profileId = generateProfileId("ccjk-default");
|
|
2348
|
+
saveProviderProfile({
|
|
2349
|
+
id: profileId,
|
|
2350
|
+
name: "ccjk-default",
|
|
2351
|
+
baseUrl: apiConfig.url,
|
|
2352
|
+
authType: apiConfig.authType || "api_key",
|
|
2353
|
+
apiKey: apiConfig.key,
|
|
2354
|
+
setAsActive: true
|
|
2355
|
+
});
|
|
2356
|
+
} catch {
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2186
2359
|
return apiConfig;
|
|
2187
2360
|
}
|
|
2188
2361
|
function mergeConfigs(sourceFile, targetFile) {
|
|
@@ -2217,6 +2390,37 @@ function updateCustomModel(primaryModel, haikuModel, sonnetModel, opusModel, cod
|
|
|
2217
2390
|
settings.env.ANTHROPIC_DEFAULT_OPUS_MODEL = opusModel.trim();
|
|
2218
2391
|
normalizeClaudeFamilySettings(settings, { codeTool: target.codeTool });
|
|
2219
2392
|
writeJsonConfig(target.settingsFile, settings);
|
|
2393
|
+
if (target.codeTool === "clavue") {
|
|
2394
|
+
updateClavueProviderModelRouting(primaryModel, haikuModel, sonnetModel, opusModel);
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
function updateClavueProviderModelRouting(primaryModel, haikuModel, sonnetModel, opusModel) {
|
|
2398
|
+
try {
|
|
2399
|
+
const activeId = getActiveProviderProfileId();
|
|
2400
|
+
const profiles = listProviderProfiles();
|
|
2401
|
+
const existingProfile = activeId ? profiles.find((p) => p.id === activeId) : profiles[0];
|
|
2402
|
+
const modelRouting = createModelRouting({
|
|
2403
|
+
primaryModel: primaryModel?.trim() || existingProfile?.modelRouting?.primaryModel || "",
|
|
2404
|
+
haikuModel: haikuModel?.trim() || existingProfile?.modelRouting?.smallFastModel || "",
|
|
2405
|
+
sonnetModel: sonnetModel?.trim() || existingProfile?.modelRouting?.subagentModel || "",
|
|
2406
|
+
opusModel: opusModel?.trim() || existingProfile?.modelRouting?.planModel || ""
|
|
2407
|
+
});
|
|
2408
|
+
if (existingProfile) {
|
|
2409
|
+
saveProviderProfile({
|
|
2410
|
+
id: existingProfile.id,
|
|
2411
|
+
name: existingProfile.name,
|
|
2412
|
+
baseUrl: existingProfile.baseUrl,
|
|
2413
|
+
authType: existingProfile.authType,
|
|
2414
|
+
apiKey: "",
|
|
2415
|
+
// credential already stored, don't overwrite
|
|
2416
|
+
modelRouting,
|
|
2417
|
+
modelMode: existingProfile.modelMode,
|
|
2418
|
+
apiDialectMode: existingProfile.apiDialectMode,
|
|
2419
|
+
setAsActive: true
|
|
2420
|
+
});
|
|
2421
|
+
}
|
|
2422
|
+
} catch {
|
|
2423
|
+
}
|
|
2220
2424
|
}
|
|
2221
2425
|
function updateDefaultModel(model, codeTool) {
|
|
2222
2426
|
const target = resolveClaudeFamilySettingsTarget(codeTool);
|
|
@@ -2354,6 +2558,15 @@ function switchToOfficialLogin$1(codeTool) {
|
|
|
2354
2558
|
writeJsonConfig(CLAUDE_VSC_CONFIG_FILE, vscConfig);
|
|
2355
2559
|
}
|
|
2356
2560
|
}
|
|
2561
|
+
if (target.codeTool === "clavue") {
|
|
2562
|
+
try {
|
|
2563
|
+
const clavueJson = readClavueJson();
|
|
2564
|
+
clavueJson.clavueProviderProfiles = [];
|
|
2565
|
+
clavueJson.activeProviderProfileId = void 0;
|
|
2566
|
+
writeClavueJson(clavueJson);
|
|
2567
|
+
} catch {
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2357
2570
|
console.log(i18n.t("api:officialLoginConfigured"));
|
|
2358
2571
|
return true;
|
|
2359
2572
|
} catch (error) {
|
|
@@ -3615,6 +3828,11 @@ function addNumbersToChoices(choices, startFrom = 1, format = (n) => `${n}. `) {
|
|
|
3615
3828
|
});
|
|
3616
3829
|
}
|
|
3617
3830
|
|
|
3831
|
+
const promptHelpers = {
|
|
3832
|
+
__proto__: null,
|
|
3833
|
+
addNumbersToChoices: addNumbersToChoices
|
|
3834
|
+
};
|
|
3835
|
+
|
|
3618
3836
|
async function selectAiOutputLanguage(defaultLang) {
|
|
3619
3837
|
ensureI18nInitialized();
|
|
3620
3838
|
console.log(ansis.dim(`
|
|
@@ -4074,16 +4292,38 @@ function upsertCodexMcpService(serviceId, service) {
|
|
|
4074
4292
|
}
|
|
4075
4293
|
writeFile(CODEX_CONFIG_FILE, content);
|
|
4076
4294
|
}
|
|
4295
|
+
function buildMcpServiceSectionRegex(serviceId) {
|
|
4296
|
+
return new RegExp(
|
|
4297
|
+
`\\n?\\[mcp_servers\\.${escapeRegex(serviceId)}(?:\\.[^\\]]+)?\\][\\s\\S]*?(?=\\n\\[|$)`,
|
|
4298
|
+
"g"
|
|
4299
|
+
);
|
|
4300
|
+
}
|
|
4077
4301
|
function deleteCodexMcpService(serviceId) {
|
|
4078
4302
|
if (!exists(CODEX_CONFIG_FILE)) {
|
|
4079
4303
|
return;
|
|
4080
4304
|
}
|
|
4081
4305
|
const content = readFile(CODEX_CONFIG_FILE) || "";
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4306
|
+
const updatedContent = content.replace(buildMcpServiceSectionRegex(serviceId), "");
|
|
4307
|
+
writeFile(CODEX_CONFIG_FILE, updatedContent);
|
|
4308
|
+
}
|
|
4309
|
+
function listCodexMcpServiceIds() {
|
|
4310
|
+
if (!exists(CODEX_CONFIG_FILE))
|
|
4311
|
+
return [];
|
|
4312
|
+
const content = readFile(CODEX_CONFIG_FILE) || "";
|
|
4313
|
+
const ids = /* @__PURE__ */ new Set();
|
|
4314
|
+
const sectionRegex = /^\[mcp_servers\.([^\]]+)\]/gm;
|
|
4315
|
+
for (const match of content.matchAll(sectionRegex)) {
|
|
4316
|
+
const rootId = match[1].split(".")[0];
|
|
4317
|
+
if (rootId)
|
|
4318
|
+
ids.add(rootId);
|
|
4319
|
+
}
|
|
4320
|
+
return Array.from(ids);
|
|
4321
|
+
}
|
|
4322
|
+
function deleteAllCodexMcpServices() {
|
|
4323
|
+
if (!exists(CODEX_CONFIG_FILE))
|
|
4324
|
+
return;
|
|
4325
|
+
const content = readFile(CODEX_CONFIG_FILE) || "";
|
|
4326
|
+
const updatedContent = content.replace(/\n?\[mcp_servers\.[^\]]+\][\s\S]*?(?=\n\[|$)/g, "").replace(/\n?#\s*---\s*MCP servers added by CCJK\s*---\s*/gi, "");
|
|
4087
4327
|
writeFile(CODEX_CONFIG_FILE, updatedContent);
|
|
4088
4328
|
}
|
|
4089
4329
|
function batchUpdateCodexMcpServices(services, options = {}) {
|
|
@@ -4141,8 +4381,10 @@ function formatTomlString(value) {
|
|
|
4141
4381
|
const codexTomlUpdater = {
|
|
4142
4382
|
__proto__: null,
|
|
4143
4383
|
batchUpdateCodexMcpServices: batchUpdateCodexMcpServices,
|
|
4384
|
+
deleteAllCodexMcpServices: deleteAllCodexMcpServices,
|
|
4144
4385
|
deleteCodexMcpService: deleteCodexMcpService,
|
|
4145
4386
|
deleteCodexProvider: deleteCodexProvider,
|
|
4387
|
+
listCodexMcpServiceIds: listCodexMcpServiceIds,
|
|
4146
4388
|
updateCodexApiFields: updateCodexApiFields,
|
|
4147
4389
|
updateTopLevelTomlField: updateTopLevelTomlField,
|
|
4148
4390
|
upsertCodexMcpService: upsertCodexMcpService,
|
|
@@ -4397,6 +4639,102 @@ async function configureCodexMcp(options) {
|
|
|
4397
4639
|
console.log(ansis.green(i18n.t("codex:mcpConfigured")));
|
|
4398
4640
|
}
|
|
4399
4641
|
|
|
4642
|
+
const CODEX_WORKFLOW_GROUP_PREFIX = "::codexWorkflowGroup:";
|
|
4643
|
+
const CODEX_WORKFLOW_CONFIG_BASE = [
|
|
4644
|
+
{
|
|
4645
|
+
id: "commonTools",
|
|
4646
|
+
order: 1,
|
|
4647
|
+
defaultSelected: true,
|
|
4648
|
+
category: "essential",
|
|
4649
|
+
type: "group",
|
|
4650
|
+
files: ["init-project.md", "agents/init-architect.md", "agents/get-current-datetime.md"]
|
|
4651
|
+
},
|
|
4652
|
+
{
|
|
4653
|
+
id: "featPlanUx",
|
|
4654
|
+
order: 2,
|
|
4655
|
+
defaultSelected: true,
|
|
4656
|
+
category: "essential",
|
|
4657
|
+
type: "group",
|
|
4658
|
+
files: ["feat.md", "agents/planner.md", "agents/ui-ux-designer.md"]
|
|
4659
|
+
},
|
|
4660
|
+
{
|
|
4661
|
+
id: "sixStepsWorkflow",
|
|
4662
|
+
order: 3,
|
|
4663
|
+
defaultSelected: true,
|
|
4664
|
+
category: "sixStep",
|
|
4665
|
+
type: "single",
|
|
4666
|
+
files: ["workflow.md"]
|
|
4667
|
+
},
|
|
4668
|
+
{
|
|
4669
|
+
id: "specFirstTDD",
|
|
4670
|
+
order: 4,
|
|
4671
|
+
defaultSelected: true,
|
|
4672
|
+
category: "specFirstTDD",
|
|
4673
|
+
type: "single",
|
|
4674
|
+
files: ["spec-first-tdd.md"]
|
|
4675
|
+
},
|
|
4676
|
+
{
|
|
4677
|
+
id: "codeReview",
|
|
4678
|
+
order: 5,
|
|
4679
|
+
defaultSelected: true,
|
|
4680
|
+
category: "codeReview",
|
|
4681
|
+
type: "single",
|
|
4682
|
+
files: ["code-review.md"]
|
|
4683
|
+
},
|
|
4684
|
+
{
|
|
4685
|
+
id: "refactoringMaster",
|
|
4686
|
+
order: 6,
|
|
4687
|
+
defaultSelected: false,
|
|
4688
|
+
category: "refactoringMaster",
|
|
4689
|
+
type: "single",
|
|
4690
|
+
files: ["refactoring-master.md"]
|
|
4691
|
+
},
|
|
4692
|
+
{
|
|
4693
|
+
id: "gitWorkflow",
|
|
4694
|
+
order: 7,
|
|
4695
|
+
defaultSelected: true,
|
|
4696
|
+
category: "git",
|
|
4697
|
+
type: "group",
|
|
4698
|
+
files: ["git-commit.md", "git-rollback.md", "git-cleanBranches.md", "git-worktree.md"]
|
|
4699
|
+
},
|
|
4700
|
+
{
|
|
4701
|
+
id: "continuousDelivery",
|
|
4702
|
+
order: 8,
|
|
4703
|
+
defaultSelected: false,
|
|
4704
|
+
category: "continuousDelivery",
|
|
4705
|
+
type: "single",
|
|
4706
|
+
files: ["continuous-delivery.md"]
|
|
4707
|
+
},
|
|
4708
|
+
{
|
|
4709
|
+
id: "bmadWorkflow",
|
|
4710
|
+
order: 9,
|
|
4711
|
+
defaultSelected: false,
|
|
4712
|
+
category: "bmad",
|
|
4713
|
+
type: "single",
|
|
4714
|
+
files: ["bmad-init.md"]
|
|
4715
|
+
}
|
|
4716
|
+
];
|
|
4717
|
+
function getCodexWorkflowGroupSentinel(workflowId) {
|
|
4718
|
+
return `${CODEX_WORKFLOW_GROUP_PREFIX}${workflowId}`;
|
|
4719
|
+
}
|
|
4720
|
+
function isCodexWorkflowGroupSentinel(path) {
|
|
4721
|
+
return path.startsWith(CODEX_WORKFLOW_GROUP_PREFIX);
|
|
4722
|
+
}
|
|
4723
|
+
function getCodexWorkflowIdFromSentinel(path) {
|
|
4724
|
+
if (!isCodexWorkflowGroupSentinel(path))
|
|
4725
|
+
return void 0;
|
|
4726
|
+
return path.slice(CODEX_WORKFLOW_GROUP_PREFIX.length);
|
|
4727
|
+
}
|
|
4728
|
+
function getCodexWorkflowOptions() {
|
|
4729
|
+
ensureI18nInitialized();
|
|
4730
|
+
return CODEX_WORKFLOW_CONFIG_BASE.map((config) => ({
|
|
4731
|
+
id: config.id,
|
|
4732
|
+
order: config.order,
|
|
4733
|
+
defaultSelected: config.defaultSelected,
|
|
4734
|
+
name: i18n.t(`workflow:workflowOption.${config.id}`)
|
|
4735
|
+
})).sort((a, b) => a.order - b.order);
|
|
4736
|
+
}
|
|
4737
|
+
|
|
4400
4738
|
let cachedSkipPromptBackup = null;
|
|
4401
4739
|
function getRootDir$1() {
|
|
4402
4740
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
@@ -5085,13 +5423,30 @@ async function runCodexWorkflowImportWithLanguageSelection(options) {
|
|
|
5085
5423
|
skipPrompt
|
|
5086
5424
|
);
|
|
5087
5425
|
updateCcjkConfig({ aiOutputLang });
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5426
|
+
const presetAutoApply = options?.setupPreset === "clean" || options?.setupPreset === "optimized";
|
|
5427
|
+
await runCodexSystemPromptSelection({
|
|
5428
|
+
skipPrompt: skipPrompt || presetAutoApply,
|
|
5429
|
+
forcedStyle: options?.systemPromptStyle,
|
|
5430
|
+
skipEntirely: options?.skipAgentsLanguageDirective && options?.systemPromptStyle === "none"
|
|
5431
|
+
});
|
|
5432
|
+
if (!options?.skipAgentsLanguageDirective)
|
|
5433
|
+
ensureCodexAgentsLanguageDirective(aiOutputLang);
|
|
5434
|
+
if (!options?.skipWorkflowInstall) {
|
|
5435
|
+
await runCodexWorkflowSelection({
|
|
5436
|
+
...options,
|
|
5437
|
+
skipPrompt: skipPrompt || presetAutoApply
|
|
5438
|
+
});
|
|
5439
|
+
console.log(ansis.green(i18n.t("codex:workflowInstall")));
|
|
5440
|
+
} else {
|
|
5441
|
+
console.log(ansis.gray(i18n.t("codex:preset.clean.skippedWorkflows")));
|
|
5442
|
+
}
|
|
5092
5443
|
return aiOutputLang;
|
|
5093
5444
|
}
|
|
5094
|
-
async function runCodexSystemPromptSelection(
|
|
5445
|
+
async function runCodexSystemPromptSelection(options = {}) {
|
|
5446
|
+
const resolved = typeof options === "boolean" ? { skipPrompt: options } : options;
|
|
5447
|
+
const { skipPrompt = false, forcedStyle, skipEntirely = false } = resolved;
|
|
5448
|
+
if (skipEntirely)
|
|
5449
|
+
return;
|
|
5095
5450
|
ensureI18nInitialized();
|
|
5096
5451
|
const rootDir = getRootDir$1();
|
|
5097
5452
|
const ccjkConfig$1 = readCcjkConfig();
|
|
@@ -5111,48 +5466,14 @@ async function runCodexSystemPromptSelection(skipPrompt = false) {
|
|
|
5111
5466
|
systemPromptSrc = join(rootDir, "templates", "common", "output-styles", "zh-CN");
|
|
5112
5467
|
if (!exists(systemPromptSrc))
|
|
5113
5468
|
return;
|
|
5114
|
-
const
|
|
5115
|
-
|
|
5116
|
-
id: "linus-mode",
|
|
5117
|
-
name: i18n.t("configuration:outputStyles.linus-mode.name"),
|
|
5118
|
-
description: i18n.t("configuration:outputStyles.linus-mode.description")
|
|
5119
|
-
},
|
|
5120
|
-
{
|
|
5121
|
-
id: "uncle-bob-mode",
|
|
5122
|
-
name: i18n.t("configuration:outputStyles.uncle-bob-mode.name"),
|
|
5123
|
-
description: i18n.t("configuration:outputStyles.uncle-bob-mode.description")
|
|
5124
|
-
},
|
|
5125
|
-
{
|
|
5126
|
-
id: "dhh-mode",
|
|
5127
|
-
name: i18n.t("configuration:outputStyles.dhh-mode.name"),
|
|
5128
|
-
description: i18n.t("configuration:outputStyles.dhh-mode.description")
|
|
5129
|
-
},
|
|
5130
|
-
{
|
|
5131
|
-
id: "carmack-mode",
|
|
5132
|
-
name: i18n.t("configuration:outputStyles.carmack-mode.name"),
|
|
5133
|
-
description: i18n.t("configuration:outputStyles.carmack-mode.description")
|
|
5134
|
-
},
|
|
5135
|
-
{
|
|
5136
|
-
id: "jobs-mode",
|
|
5137
|
-
name: i18n.t("configuration:outputStyles.jobs-mode.name"),
|
|
5138
|
-
description: i18n.t("configuration:outputStyles.jobs-mode.description")
|
|
5139
|
-
},
|
|
5140
|
-
{
|
|
5141
|
-
id: "evan-you-mode",
|
|
5142
|
-
name: i18n.t("configuration:outputStyles.evan-you-mode.name"),
|
|
5143
|
-
description: i18n.t("configuration:outputStyles.evan-you-mode.description")
|
|
5144
|
-
}
|
|
5145
|
-
].filter((style) => exists(join(systemPromptSrc, `${style.id}.md`)));
|
|
5146
|
-
if (availablePrompts.length === 0)
|
|
5147
|
-
return;
|
|
5469
|
+
const { getCodexAgentsStylePrompts } = await Promise.resolve().then(function () { return outputStyles; });
|
|
5470
|
+
const availablePrompts = getCodexAgentsStylePrompts(systemPromptSrc);
|
|
5148
5471
|
const { resolveSystemPromptStyle } = await Promise.resolve().then(function () { return prompts; });
|
|
5149
|
-
const systemPrompt = await resolveSystemPromptStyle(
|
|
5472
|
+
const systemPrompt = forcedStyle !== void 0 ? forcedStyle : await resolveSystemPromptStyle(
|
|
5150
5473
|
availablePrompts,
|
|
5151
5474
|
void 0,
|
|
5152
|
-
// No command line option for this function
|
|
5153
5475
|
tomlConfig,
|
|
5154
5476
|
skipPrompt
|
|
5155
|
-
// Pass skipPrompt flag
|
|
5156
5477
|
);
|
|
5157
5478
|
if (!systemPrompt || systemPrompt === "none") {
|
|
5158
5479
|
try {
|
|
@@ -5189,6 +5510,8 @@ async function runCodexSystemPromptSelection(skipPrompt = false) {
|
|
|
5189
5510
|
}
|
|
5190
5511
|
async function runCodexWorkflowSelection(options) {
|
|
5191
5512
|
ensureI18nInitialized();
|
|
5513
|
+
if (options?.skipWorkflowInstall)
|
|
5514
|
+
return;
|
|
5192
5515
|
const { skipPrompt = false, workflows: presetWorkflows = [] } = options ?? {};
|
|
5193
5516
|
const rootDir = getRootDir$1();
|
|
5194
5517
|
const ccjkConfig = readCcjkConfig();
|
|
@@ -5234,8 +5557,7 @@ async function runCodexWorkflowSelection(options) {
|
|
|
5234
5557
|
choices: addNumbersToChoices(allWorkflows.map((workflow) => ({
|
|
5235
5558
|
name: workflow.name,
|
|
5236
5559
|
value: workflow.path,
|
|
5237
|
-
checked:
|
|
5238
|
-
// Default all selected
|
|
5560
|
+
checked: workflow.defaultSelected
|
|
5239
5561
|
})))
|
|
5240
5562
|
}]);
|
|
5241
5563
|
if (!workflows || workflows.length === 0)
|
|
@@ -5253,53 +5575,46 @@ async function runCodexWorkflowSelection(options) {
|
|
|
5253
5575
|
writeFile(targetPath, content);
|
|
5254
5576
|
}
|
|
5255
5577
|
}
|
|
5256
|
-
const GIT_GROUP_SENTINEL = "::gitGroup";
|
|
5257
5578
|
function getAllWorkflowFiles(workflowSrc, preferredLang) {
|
|
5579
|
+
const optionNames = new Map(getCodexWorkflowOptions().map((option) => [option.id, option.name]));
|
|
5258
5580
|
const workflows = [];
|
|
5259
|
-
const
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
}
|
|
5266
|
-
const gitPromptsDir = join(workflowSrc, "git", preferredLang);
|
|
5267
|
-
if (exists(gitPromptsDir)) {
|
|
5581
|
+
for (const config of CODEX_WORKFLOW_CONFIG_BASE.sort((a, b) => a.order - b.order)) {
|
|
5582
|
+
const resolvedFiles = resolveCodexWorkflowFiles(workflowSrc, preferredLang, config);
|
|
5583
|
+
if (resolvedFiles.length === 0)
|
|
5584
|
+
continue;
|
|
5585
|
+
const name = optionNames.get(config.id) || config.id;
|
|
5586
|
+
const path = config.type === "group" ? getCodexWorkflowGroupSentinel(config.id) : resolvedFiles[0];
|
|
5268
5587
|
workflows.push({
|
|
5269
|
-
name
|
|
5270
|
-
|
|
5271
|
-
|
|
5588
|
+
name,
|
|
5589
|
+
path,
|
|
5590
|
+
defaultSelected: config.defaultSelected
|
|
5272
5591
|
});
|
|
5273
5592
|
}
|
|
5274
5593
|
return workflows;
|
|
5275
5594
|
}
|
|
5595
|
+
function resolveCodexWorkflowFiles(workflowSrc, preferredLang, config) {
|
|
5596
|
+
const resolved = [];
|
|
5597
|
+
for (const file of config.files) {
|
|
5598
|
+
const full = join(workflowSrc, config.category, preferredLang, file);
|
|
5599
|
+
if (exists(full))
|
|
5600
|
+
resolved.push(full);
|
|
5601
|
+
}
|
|
5602
|
+
return resolved;
|
|
5603
|
+
}
|
|
5276
5604
|
function expandSelectedWorkflowPaths(paths, workflowSrc, preferredLang) {
|
|
5277
5605
|
const expanded = [];
|
|
5278
5606
|
for (const p of paths) {
|
|
5279
|
-
if (p
|
|
5280
|
-
|
|
5607
|
+
if (isCodexWorkflowGroupSentinel(p)) {
|
|
5608
|
+
const workflowId = getCodexWorkflowIdFromSentinel(p);
|
|
5609
|
+
const config = CODEX_WORKFLOW_CONFIG_BASE.find((item) => item.id === workflowId);
|
|
5610
|
+
if (config)
|
|
5611
|
+
expanded.push(...resolveCodexWorkflowFiles(workflowSrc, preferredLang, config));
|
|
5281
5612
|
} else {
|
|
5282
5613
|
expanded.push(p);
|
|
5283
5614
|
}
|
|
5284
5615
|
}
|
|
5285
5616
|
return expanded;
|
|
5286
5617
|
}
|
|
5287
|
-
function getGitPromptFiles(workflowSrc, preferredLang) {
|
|
5288
|
-
const gitPromptsDir = join(workflowSrc, "git", preferredLang);
|
|
5289
|
-
const files = [
|
|
5290
|
-
"git-commit.md",
|
|
5291
|
-
"git-rollback.md",
|
|
5292
|
-
"git-cleanBranches.md",
|
|
5293
|
-
"git-worktree.md"
|
|
5294
|
-
];
|
|
5295
|
-
const resolved = [];
|
|
5296
|
-
for (const f of files) {
|
|
5297
|
-
const full = join(gitPromptsDir, f);
|
|
5298
|
-
if (exists(full))
|
|
5299
|
-
resolved.push(full);
|
|
5300
|
-
}
|
|
5301
|
-
return resolved;
|
|
5302
|
-
}
|
|
5303
5618
|
function toProvidersList(providers) {
|
|
5304
5619
|
return providers.map((provider) => ({ name: provider.name || provider.id, value: provider.id }));
|
|
5305
5620
|
}
|
|
@@ -5594,10 +5909,33 @@ async function configureCodexApi(options) {
|
|
|
5594
5909
|
}
|
|
5595
5910
|
async function runCodexFullInit(options) {
|
|
5596
5911
|
ensureI18nInitialized();
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5912
|
+
let resolvedOptions = { ...options };
|
|
5913
|
+
if (!resolvedOptions.skipPrompt && !resolvedOptions.setupPreset) {
|
|
5914
|
+
const { applyCodexSetupPreset, promptCodexSetupPreset } = await import('./codex-presets.mjs');
|
|
5915
|
+
const preset = await promptCodexSetupPreset();
|
|
5916
|
+
if (!preset) {
|
|
5917
|
+
console.log(ansis.yellow(i18n.t("common:cancelled")));
|
|
5918
|
+
return resolvedOptions.aiOutputLang || "en";
|
|
5919
|
+
}
|
|
5920
|
+
resolvedOptions = {
|
|
5921
|
+
...resolvedOptions,
|
|
5922
|
+
...applyCodexSetupPreset(preset, resolvedOptions)
|
|
5923
|
+
};
|
|
5924
|
+
if (preset !== "custom") {
|
|
5925
|
+
const presetName = i18n.t(`codex:preset.${preset}.name`);
|
|
5926
|
+
console.log(ansis.gray(`\u2714 ${i18n.t("codex:preset.applied", { preset: presetName })}`));
|
|
5927
|
+
}
|
|
5928
|
+
} else if (resolvedOptions.setupPreset && resolvedOptions.setupPreset !== "custom") {
|
|
5929
|
+
const { applyCodexSetupPreset } = await import('./codex-presets.mjs');
|
|
5930
|
+
resolvedOptions = {
|
|
5931
|
+
...resolvedOptions,
|
|
5932
|
+
...applyCodexSetupPreset(resolvedOptions.setupPreset, resolvedOptions)
|
|
5933
|
+
};
|
|
5934
|
+
}
|
|
5935
|
+
await installCodexCli(resolvedOptions.skipPrompt || false);
|
|
5936
|
+
const aiOutputLang = await runCodexWorkflowImportWithLanguageSelection(resolvedOptions);
|
|
5937
|
+
await configureCodexApi(resolvedOptions);
|
|
5938
|
+
await configureCodexMcp(resolvedOptions);
|
|
5601
5939
|
return aiOutputLang;
|
|
5602
5940
|
}
|
|
5603
5941
|
function ensureCodexAgentsLanguageDirective(aiOutputLang) {
|
|
@@ -6066,38 +6404,50 @@ async function installCometixLine() {
|
|
|
6066
6404
|
}
|
|
6067
6405
|
}
|
|
6068
6406
|
|
|
6407
|
+
const CODEX_AGENTS_STYLE_CONFIGS = [
|
|
6408
|
+
{ id: "agents-md-baseline", filename: "agents-md-baseline.md", order: 1 },
|
|
6409
|
+
{ id: "plan-first", filename: "plan-first.md", order: 2 },
|
|
6410
|
+
{ id: "verify-and-ship", filename: "verify-and-ship.md", order: 3 },
|
|
6411
|
+
{ id: "surgical-diff", filename: "surgical-diff.md", order: 4 },
|
|
6412
|
+
{ id: "engineer-professional", filename: "engineer-professional.md", order: 5 }
|
|
6413
|
+
];
|
|
6414
|
+
const CUSTOM_OUTPUT_STYLE_CONFIGS = [
|
|
6415
|
+
...CODEX_AGENTS_STYLE_CONFIGS
|
|
6416
|
+
];
|
|
6417
|
+
function buildStylePrompts(configs, templateDir, i18nPrefix) {
|
|
6418
|
+
ensureI18nInitialized();
|
|
6419
|
+
return configs.filter((style) => exists(join(templateDir, style.filename))).sort((a, b) => a.order - b.order).map((style) => ({
|
|
6420
|
+
id: style.id,
|
|
6421
|
+
name: i18n.t(`${i18nPrefix}.${style.id}.name`),
|
|
6422
|
+
description: i18n.t(`${i18nPrefix}.${style.id}.description`)
|
|
6423
|
+
}));
|
|
6424
|
+
}
|
|
6425
|
+
function getCodexAgentsStylePrompts(templateDir) {
|
|
6426
|
+
return buildStylePrompts(CODEX_AGENTS_STYLE_CONFIGS, templateDir, "configuration:codexAgentsStyles");
|
|
6427
|
+
}
|
|
6428
|
+
function getCustomOutputStyleIds() {
|
|
6429
|
+
return CUSTOM_OUTPUT_STYLE_CONFIGS.map((style) => style.id);
|
|
6430
|
+
}
|
|
6431
|
+
const BUILTIN_OUTPUT_STYLE_IDS = ["default", "explanatory", "learning", "none"];
|
|
6432
|
+
function getAllValidOutputStyleIds() {
|
|
6433
|
+
return [...getCustomOutputStyleIds(), ...BUILTIN_OUTPUT_STYLE_IDS];
|
|
6434
|
+
}
|
|
6435
|
+
|
|
6436
|
+
const outputStyles = {
|
|
6437
|
+
__proto__: null,
|
|
6438
|
+
CODEX_AGENTS_STYLE_CONFIGS: CODEX_AGENTS_STYLE_CONFIGS,
|
|
6439
|
+
CUSTOM_OUTPUT_STYLE_CONFIGS: CUSTOM_OUTPUT_STYLE_CONFIGS,
|
|
6440
|
+
getAllValidOutputStyleIds: getAllValidOutputStyleIds,
|
|
6441
|
+
getCodexAgentsStylePrompts: getCodexAgentsStylePrompts,
|
|
6442
|
+
getCustomOutputStyleIds: getCustomOutputStyleIds
|
|
6443
|
+
};
|
|
6444
|
+
|
|
6069
6445
|
const OUTPUT_STYLES = [
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
id: "linus-mode",
|
|
6073
|
-
isCustom: true,
|
|
6074
|
-
filePath: "linus-mode.md"
|
|
6075
|
-
},
|
|
6076
|
-
{
|
|
6077
|
-
id: "uncle-bob-mode",
|
|
6078
|
-
isCustom: true,
|
|
6079
|
-
filePath: "uncle-bob-mode.md"
|
|
6080
|
-
},
|
|
6081
|
-
{
|
|
6082
|
-
id: "dhh-mode",
|
|
6083
|
-
isCustom: true,
|
|
6084
|
-
filePath: "dhh-mode.md"
|
|
6085
|
-
},
|
|
6086
|
-
{
|
|
6087
|
-
id: "carmack-mode",
|
|
6088
|
-
isCustom: true,
|
|
6089
|
-
filePath: "carmack-mode.md"
|
|
6090
|
-
},
|
|
6091
|
-
{
|
|
6092
|
-
id: "jobs-mode",
|
|
6093
|
-
isCustom: true,
|
|
6094
|
-
filePath: "jobs-mode.md"
|
|
6095
|
-
},
|
|
6096
|
-
{
|
|
6097
|
-
id: "evan-you-mode",
|
|
6446
|
+
...CUSTOM_OUTPUT_STYLE_CONFIGS.map((style) => ({
|
|
6447
|
+
id: style.id,
|
|
6098
6448
|
isCustom: true,
|
|
6099
|
-
filePath:
|
|
6100
|
-
},
|
|
6449
|
+
filePath: style.filename
|
|
6450
|
+
})),
|
|
6101
6451
|
// Built-in styles (no template files)
|
|
6102
6452
|
{
|
|
6103
6453
|
id: "default",
|
|
@@ -7576,7 +7926,8 @@ async function validateSkipPromptOptions(options) {
|
|
|
7576
7926
|
if (options.outputStyles === "skip") {
|
|
7577
7927
|
options.outputStyles = false;
|
|
7578
7928
|
} else if (options.outputStyles === "all") {
|
|
7579
|
-
|
|
7929
|
+
const { getCustomOutputStyleIds } = await Promise.resolve().then(function () { return outputStyles; });
|
|
7930
|
+
options.outputStyles = getCustomOutputStyleIds();
|
|
7580
7931
|
} else {
|
|
7581
7932
|
options.outputStyles = options.outputStyles.split(",").map((s) => s.trim());
|
|
7582
7933
|
}
|
|
@@ -7643,7 +7994,8 @@ async function validateSkipPromptOptions(options) {
|
|
|
7643
7994
|
}
|
|
7644
7995
|
}
|
|
7645
7996
|
if (Array.isArray(options.outputStyles)) {
|
|
7646
|
-
const
|
|
7997
|
+
const { getAllValidOutputStyleIds } = await Promise.resolve().then(function () { return outputStyles; });
|
|
7998
|
+
const validStyles = getAllValidOutputStyleIds();
|
|
7647
7999
|
for (const style of options.outputStyles) {
|
|
7648
8000
|
if (!validStyles.includes(style)) {
|
|
7649
8001
|
throw new Error(i18n.t("errors:invalidOutputStyle", { style, validStyles: validStyles.join(", ") }));
|
|
@@ -7651,7 +8003,8 @@ async function validateSkipPromptOptions(options) {
|
|
|
7651
8003
|
}
|
|
7652
8004
|
}
|
|
7653
8005
|
if (options.defaultOutputStyle) {
|
|
7654
|
-
const
|
|
8006
|
+
const { getAllValidOutputStyleIds } = await Promise.resolve().then(function () { return outputStyles; });
|
|
8007
|
+
const validStyles = getAllValidOutputStyleIds();
|
|
7655
8008
|
if (!validStyles.includes(options.defaultOutputStyle)) {
|
|
7656
8009
|
throw new Error(i18n.t("errors:invalidDefaultOutputStyle", { style: options.defaultOutputStyle, validStyles: validStyles.join(", ") }));
|
|
7657
8010
|
}
|
|
@@ -7864,6 +8217,8 @@ async function init(options = {}) {
|
|
|
7864
8217
|
codeToolType
|
|
7865
8218
|
});
|
|
7866
8219
|
console.log(ansis.green(i18n.t("codex:setupComplete")));
|
|
8220
|
+
const { printCodexReloadHint } = await import('./codex-runtime.mjs');
|
|
8221
|
+
printCodexReloadHint();
|
|
7867
8222
|
return;
|
|
7868
8223
|
}
|
|
7869
8224
|
const aiOutputLang = await resolveAiOutputLanguage(i18n.language, options.aiOutputLang, ccjkConfig, options.skipPrompt);
|
|
@@ -8609,4 +8964,4 @@ async function openSettingsJson(codeTool) {
|
|
|
8609
8964
|
}
|
|
8610
8965
|
}
|
|
8611
8966
|
|
|
8612
|
-
export {
|
|
8967
|
+
export { init as $, AI_OUTPUT_LANGUAGES as A, backupMcpConfig as B, CCJK_CONFIG_DIR as C, DEFAULT_CODE_TOOL_TYPE as D, buildMcpServerConfig as E, cleanupPermissions as F, commandExists as G, configureApi as H, copyConfigFiles as I, createHomebrewSymlink as J, detectInstalledVersion as K, LANG_LABELS as L, displayVerificationResult as M, ensureApiKeyApproved as N, ensureClaudeDir as O, executeInstallMethod as P, fixWindowsMcpConfig as Q, getAiOutputLanguageLabel as R, SETTINGS_FILE as S, getExistingApiConfig as T, getExistingModelConfig as U, getInstallationStatus as V, getMcpConfigPath as W, getPlatform as X, handleInstallFailure as Y, importRecommendedEnv as Z, importRecommendedPermissions as _, API_DEFAULT_URL as a, setupCcrConfiguration as a$, installClaudeCode as a0, installCodex as a1, isClaudeCodeInstalled as a2, isCodeToolType as a3, isCodexInstalled as a4, isLocalClaudeCodeInstalled as a5, manageApiKeyApproval as a6, mergeAndCleanPermissions as a7, mergeConfigs as a8, mergeMcpServers as a9, parseToml as aA, readFile as aB, ensureDir as aC, readDefaultTomlConfig as aD, createDefaultTomlConfig as aE, readJsonConfig as aF, writeTomlConfig as aG, clearModelEnv as aH, normalizeClaudeFamilySettings as aI, copyFile as aJ, detectConfigManagementMode as aK, readCodexConfig as aL, backupCodexComplete as aM, writeAuthFile as aN, CODEX_WORKFLOW_CONFIG_BASE as aO, updateCcjkConfig as aP, changeLanguage as aQ, applyRecommendedPermissionTier as aR, getPermissionTierLabel as aS, readCcjkConfig as aT, configureOutputStyle as aU, isClaudeFamilyCodeTool as aV, isWindows as aW, selectMcpServices as aX, getMcpServices as aY, isCcrInstalled as aZ, installCcr as a_, mergeSettingsFile as aa, openSettingsJson as ab, promptApiConfigurationAction as ac, readMcpConfig as ad, removeApiKeyFromRejected as ae, removeLocalClaudeCode as af, resolveCodeToolType as ag, resolveCodexHome as ah, selectInstallMethod as ai, setInstallMethod as aj, setPrimaryApiKey as ak, settingsFileForTool as al, switchToOfficialLogin$1 as am, uninstallCodeTool as an, updateCustomModel as ao, updateDefaultModel as ap, verifyInstallation as aq, writeMcpConfig as ar, ensureI18nInitialized as as, getActiveCodeTool as at, i18n as au, addNumbersToChoices as av, validateApiKey as aw, promptBoolean as ax, resolveClaudeFamilySettingsTarget as ay, exists as az, API_ENV_KEY as b, modifyApiConfigPartially as b0, formatApiKeyDisplay as b1, readCcrConfig as b2, configureCcrFeature as b3, handleExitPromptError as b4, handleGeneralError as b5, MCP_SERVICE_CONFIGS as b6, getBackupMessage as b7, deleteAllCodexMcpServices as b8, readDir as b9, getProviderProfile as bA, readCredentials as bB, readCcjkConfigAsync as bC, initI18n as bD, selectScriptLanguage as bE, index as bF, fsOperations as bG, jsonConfig as bH, claudeConfig as bI, clavueProviderProfile as bJ, config$1 as bK, config as bL, promptHelpers as bM, prompts as bN, codexProfileV2 as bO, codexTomlUpdater as bP, codex as bQ, installer as bR, isDirectory as ba, deleteCodexMcpService as bb, listCodexMcpServiceIds as bc, displayBanner as bd, runCodexUpdate as be, version as bf, resolveAiOutputLanguage as bg, updatePromptOnly as bh, selectAndInstallWorkflows as bi, checkClaudeCodeVersionAndPrompt as bj, runCodexWorkflowImportWithLanguageSelection as bk, runCodexFullInit as bl, manageCodexMcp as bm, configureCodexApi as bn, checkAndUpdateTools as bo, resolveCodeType as bp, writeJsonConfig as bq, STARTUP_CODE_TOOL_CHOICES as br, displayBannerWithInfo as bs, runCodexUninstall as bt, switchCodexProvider as bu, listCodexProviders as bv, switchToOfficialLogin as bw, switchToProvider as bx, listProviderProfiles as by, getActiveProviderProfileId as bz, CCJK_CONFIG_FILE as c, CLAUDE_DIR as d, CLAUDE_MD_FILE as e, CLAUDE_VSC_CONFIG_FILE as f, CLAVUE_CONFIG_FILE as g, CLAVUE_CREDENTIALS_FILE as h, CLAVUE_DIR$1 as i, CLAVUE_MD_FILE as j, CLAVUE_SETTINGS_FILE as k, CODEX_AGENTS_FILE as l, CODEX_AUTH_FILE as m, CODEX_CONFIG_FILE as n, CODEX_DIR as o, CODEX_PROMPTS_DIR as p, CODE_TOOL_ALIASES as q, CODE_TOOL_BANNERS as r, CODE_TOOL_TYPES as s, ClAUDE_CONFIG_FILE as t, LEGACY_CCJK_CONFIG_FILES as u, SUPPORTED_LANGS as v, activeSettingsFile as w, addCompletedOnboarding as x, applyAiLanguageDirective as y, backupExistingConfig as z };
|