zcf 2.5.2 → 2.6.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.
- package/README.md +47 -10
- package/dist/cli.mjs +13 -8
- package/dist/index.d.mts +222 -345
- package/dist/index.d.ts +222 -345
- package/dist/index.mjs +2 -1
- package/dist/shared/{zcf.CEsHvLRM.mjs → zcf.BjaE63-h.mjs} +833 -401
- package/package.json +1 -1
- package/templates/en/workflow/bmad/commands/bmad-init.md +103 -0
- package/templates/en/{commands → workflow/sixStep/commands}/workflow.md +1 -1
- package/templates/zh-CN/workflow/bmad/commands/bmad-init.md +109 -0
- package/templates/zh-CN/{commands → workflow/sixStep/commands}/workflow.md +1 -1
- /package/templates/en/{mcp.md → memory/mcp.md} +0 -0
- /package/templates/en/{personality.md → memory/personality.md} +0 -0
- /package/templates/en/{rules.md → memory/rules.md} +0 -0
- /package/templates/en/{technical-guides.md → memory/technical-guides.md} +0 -0
- /package/templates/en/{agents → workflow/plan/agents}/planner.md +0 -0
- /package/templates/en/{agents → workflow/plan/agents}/ui-ux-designer.md +0 -0
- /package/templates/en/{commands → workflow/plan/commands}/feat.md +0 -0
- /package/templates/zh-CN/{mcp.md → memory/mcp.md} +0 -0
- /package/templates/zh-CN/{personality.md → memory/personality.md} +0 -0
- /package/templates/zh-CN/{rules.md → memory/rules.md} +0 -0
- /package/templates/zh-CN/{technical-guides.md → memory/technical-guides.md} +0 -0
- /package/templates/zh-CN/{agents → workflow/plan/agents}/planner.md +0 -0
- /package/templates/zh-CN/{agents → workflow/plan/agents}/ui-ux-designer.md +0 -0
- /package/templates/zh-CN/{commands → workflow/plan/commands}/feat.md +0 -0
|
@@ -5,16 +5,631 @@ import { join, dirname } from 'pathe';
|
|
|
5
5
|
import dayjs from 'dayjs';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { exec } from 'tinyexec';
|
|
8
|
+
import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
|
|
8
9
|
import { homedir, platform } from 'node:os';
|
|
9
10
|
|
|
10
|
-
const version = "2.
|
|
11
|
+
const version = "2.6.1";
|
|
11
12
|
const homepage = "https://github.com/UfoMiao/zcf";
|
|
12
13
|
|
|
14
|
+
const common$1 = {
|
|
15
|
+
// Basic
|
|
16
|
+
multiSelectHint: "\uFF08\u7A7A\u683C\u9009\u62E9\uFF0Ca\u5168\u9009\uFF0Ci\u53CD\u9009\uFF0C\u56DE\u8F66\u786E\u8BA4\uFF09",
|
|
17
|
+
yes: "\u662F",
|
|
18
|
+
no: "\u5426",
|
|
19
|
+
skip: "\u8DF3\u8FC7",
|
|
20
|
+
cancelled: "\u64CD\u4F5C\u5DF2\u53D6\u6D88",
|
|
21
|
+
error: "\u9519\u8BEF",
|
|
22
|
+
complete: "\u{1F389} \u914D\u7F6E\u5B8C\u6210\uFF01\u4F7F\u7528 'claude' \u547D\u4EE4\u5F00\u59CB\u4F53\u9A8C\u3002",
|
|
23
|
+
none: "\u65E0",
|
|
24
|
+
notConfigured: "\u672A\u914D\u7F6E",
|
|
25
|
+
spaceToSelectReturn: "- \u7A7A\u683C\u9009\u62E9\uFF0C\u56DE\u8F66\u63D0\u4EA4",
|
|
26
|
+
enterChoice: "\u8BF7\u8F93\u5165\u9009\u9879\uFF0C\u56DE\u8F66\u786E\u8BA4",
|
|
27
|
+
invalidChoice: "\u65E0\u6548\u9009\u62E9\u3002\u8BF7\u8F93\u5165\u6709\u6548\u9009\u9879\u3002",
|
|
28
|
+
goodbye: "\u{1F44B} \u611F\u8C22\u4F7F\u7528 ZCF\uFF01\u518D\u89C1\uFF01",
|
|
29
|
+
returnToMenu: "\u8FD4\u56DE\u4E3B\u83DC\u5355\uFF1F"
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const language$1 = {
|
|
33
|
+
selectScriptLang: "\u9009\u62E9ZCF\u663E\u793A\u8BED\u8A00",
|
|
34
|
+
selectConfigLang: "\u9009\u62E9 Claude Code \u914D\u7F6E\u8BED\u8A00",
|
|
35
|
+
selectAiOutputLang: "\u9009\u62E9 AI \u8F93\u51FA\u8BED\u8A00",
|
|
36
|
+
aiOutputLangHint: "AI \u5C06\u4F7F\u7528\u6B64\u8BED\u8A00\u56DE\u590D\u4F60\u7684\u95EE\u9898",
|
|
37
|
+
enterCustomLanguage: "\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u8BED\u8A00\uFF08\u4F8B\u5982\uFF1AJapanese, French \u7B49\uFF09",
|
|
38
|
+
languageChanged: "\u8BED\u8A00\u5DF2\u66F4\u6539",
|
|
39
|
+
configLangHint: {
|
|
40
|
+
"zh-CN": "\u4FBF\u4E8E\u4E2D\u6587\u7528\u6237\u81EA\u5B9A\u4E49",
|
|
41
|
+
en: "\u63A8\u8350\uFF0Ctoken \u6D88\u8017\u66F4\u4F4E"
|
|
42
|
+
},
|
|
43
|
+
updateConfigLangPrompt: "\u9009\u62E9\u914D\u7F6E\u8BED\u8A00",
|
|
44
|
+
updateConfigLangChoice: {
|
|
45
|
+
"zh-CN": "\u4E2D\u6587\u7248\u914D\u7F6E",
|
|
46
|
+
en: "\u82F1\u6587\u7248\u914D\u7F6E"
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const installation$1 = {
|
|
51
|
+
installPrompt: "\u68C0\u6D4B\u5230 Claude Code \u672A\u5B89\u88C5\uFF0C\u662F\u5426\u81EA\u52A8\u5B89\u88C5\uFF1F",
|
|
52
|
+
installing: "\u6B63\u5728\u5B89\u88C5 Claude Code...",
|
|
53
|
+
installSuccess: "Claude Code \u5B89\u88C5\u6210\u529F",
|
|
54
|
+
installFailed: "Claude Code \u5B89\u88C5\u5931\u8D25",
|
|
55
|
+
npmNotFound: "npm \u672A\u5B89\u88C5\u3002\u8BF7\u5148\u5B89\u88C5 Node.js \u548C npm\u3002",
|
|
56
|
+
// Termux specific
|
|
57
|
+
termuxDetected: "\u68C0\u6D4B\u5230 Termux \u73AF\u5883",
|
|
58
|
+
termuxInstallHint: "\u5728 Termux \u4E2D\uFF0C\u8BF7\u5148\u8FD0\u884C: pkg install nodejs \u6216 pkg install nodejs-lts",
|
|
59
|
+
termuxPathInfo: "\u4F7F\u7528 Termux \u8DEF\u5F84: {path}",
|
|
60
|
+
termuxEnvironmentInfo: "Termux \u73AF\u5883\u901A\u8FC7 pkg \u7BA1\u7406\u5668\u63D0\u4F9B Node.js \u548C npm",
|
|
61
|
+
// Windows specific
|
|
62
|
+
windowsDetected: "\u68C0\u6D4B\u5230 Windows \u7CFB\u7EDF\uFF0C\u5C06\u81EA\u52A8\u914D\u7F6E\u517C\u5BB9\u683C\u5F0F"
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const api$1 = {
|
|
66
|
+
// Basic API configuration
|
|
67
|
+
configureApi: "\u9009\u62E9 API \u8BA4\u8BC1\u65B9\u5F0F",
|
|
68
|
+
useAuthToken: "\u4F7F\u7528 Auth Token (OAuth \u8BA4\u8BC1)",
|
|
69
|
+
authTokenDesc: "\u9002\u7528\u4E8E\u901A\u8FC7 OAuth \u6216\u6D4F\u89C8\u5668\u767B\u5F55\u83B7\u53D6\u7684\u4EE4\u724C",
|
|
70
|
+
useApiKey: "\u4F7F\u7528 API Key (\u5BC6\u94A5\u8BA4\u8BC1)",
|
|
71
|
+
apiKeyDesc: "\u9002\u7528\u4E8E\u4ECE Anthropic Console \u83B7\u53D6\u7684 API \u5BC6\u94A5",
|
|
72
|
+
skipApi: "\u8DF3\u8FC7\uFF08\u7A0D\u540E\u624B\u52A8\u914D\u7F6E\uFF09",
|
|
73
|
+
enterApiUrl: "\u8BF7\u8F93\u5165 API URL",
|
|
74
|
+
enterAuthToken: "\u8BF7\u8F93\u5165 Auth Token",
|
|
75
|
+
enterApiKey: "\u8BF7\u8F93\u5165 API Key",
|
|
76
|
+
apiConfigSuccess: "API \u914D\u7F6E\u5B8C\u6210",
|
|
77
|
+
// API modification
|
|
78
|
+
existingApiConfig: "\u68C0\u6D4B\u5230\u5DF2\u6709 API \u914D\u7F6E\uFF1A",
|
|
79
|
+
apiConfigUrl: "URL",
|
|
80
|
+
apiConfigKey: "Key",
|
|
81
|
+
apiConfigAuthType: "\u8BA4\u8BC1\u7C7B\u578B",
|
|
82
|
+
selectApiAction: "\u8BF7\u9009\u62E9API\u5904\u7406\u64CD\u4F5C",
|
|
83
|
+
keepExistingConfig: "\u4FDD\u7559\u73B0\u6709\u914D\u7F6E",
|
|
84
|
+
modifyAllConfig: "\u4FEE\u6539\u5168\u90E8\u914D\u7F6E",
|
|
85
|
+
modifyPartialConfig: "\u4FEE\u6539\u90E8\u5206\u914D\u7F6E",
|
|
86
|
+
selectModifyItems: "\u8BF7\u9009\u62E9\u8981\u4FEE\u6539\u7684\u9879",
|
|
87
|
+
modifyApiUrl: "\u4FEE\u6539 API URL",
|
|
88
|
+
modifyApiKey: "\u4FEE\u6539 API Key",
|
|
89
|
+
modifyAuthType: "\u4FEE\u6539\u8BA4\u8BC1\u7C7B\u578B",
|
|
90
|
+
continueModification: "\u662F\u5426\u7EE7\u7EED\u4FEE\u6539\u5176\u4ED6\u914D\u7F6E\uFF1F",
|
|
91
|
+
modificationSaved: "\u914D\u7F6E\u5DF2\u4FDD\u5B58",
|
|
92
|
+
enterNewApiUrl: "\u8BF7\u8F93\u5165\u65B0\u7684 API URL\uFF08\u5F53\u524D\uFF1A{url}\uFF09",
|
|
93
|
+
enterNewApiKey: "\u8BF7\u8F93\u5165\u65B0\u7684 API Key\uFF08\u5F53\u524D\uFF1A{key}\uFF09",
|
|
94
|
+
selectNewAuthType: "\u9009\u62E9\u65B0\u7684\u8BA4\u8BC1\u7C7B\u578B\uFF08\u5F53\u524D\uFF1A{type}\uFF09",
|
|
95
|
+
// API validation
|
|
96
|
+
apiKeyValidation: {
|
|
97
|
+
empty: "API Key \u4E0D\u80FD\u4E3A\u7A7A",
|
|
98
|
+
example: "\u793A\u4F8B\u683C\u5F0F: sk-abcdef123456_789xyz"
|
|
99
|
+
},
|
|
100
|
+
urlRequired: "URL \u4E3A\u5FC5\u586B\u9879",
|
|
101
|
+
invalidUrl: "\u65E0\u6548\u7684 URL",
|
|
102
|
+
keyRequired: "\u5BC6\u94A5\u4E3A\u5FC5\u586B\u9879",
|
|
103
|
+
invalidKeyFormat: "\u65E0\u6548\u7684\u5BC6\u94A5\u683C\u5F0F"
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const configuration$1 = {
|
|
107
|
+
existingConfig: "\u68C0\u6D4B\u5230\u5DF2\u6709\u914D\u7F6E\u6587\u4EF6\uFF0C\u5982\u4F55\u5904\u7406\uFF1F",
|
|
108
|
+
backupAndOverwrite: "\u5907\u4EFD\u5E76\u8986\u76D6\u5168\u90E8",
|
|
109
|
+
updateDocsOnly: "\u4EC5\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173md\u5E76\u5907\u4EFD\u65E7\u914D\u7F6E",
|
|
110
|
+
mergeConfig: "\u5408\u5E76\u914D\u7F6E",
|
|
111
|
+
backupSuccess: "\u5DF2\u5907\u4EFD\u6240\u6709\u914D\u7F6E\u6587\u4EF6\u5230",
|
|
112
|
+
copying: "\u6B63\u5728\u590D\u5236\u914D\u7F6E\u6587\u4EF6...",
|
|
113
|
+
configSuccess: "\u914D\u7F6E\u6587\u4EF6\u5DF2\u590D\u5236\u5230",
|
|
114
|
+
noExistingConfig: "\u672A\u627E\u5230\u73B0\u6709\u914D\u7F6E\u3002\u8BF7\u5148\u8FD0\u884C `zcf`\u3002",
|
|
115
|
+
updatingPrompts: "\u6B63\u5728\u66F4\u65B0 Claude Code \u8BB0\u5FC6\u6587\u6863...",
|
|
116
|
+
// Model configuration
|
|
117
|
+
selectDefaultModel: "\u9009\u62E9\u9ED8\u8BA4\u6A21\u578B",
|
|
118
|
+
modelConfigSuccess: "\u9ED8\u8BA4\u6A21\u578B\u5DF2\u914D\u7F6E",
|
|
119
|
+
// AI memory configuration
|
|
120
|
+
selectMemoryOption: "\u9009\u62E9\u914D\u7F6E\u9009\u9879",
|
|
121
|
+
configureAiLanguage: "\u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00",
|
|
122
|
+
configureAiPersonality: "\u914D\u7F6E AI \u4E2A\u6027\u98CE\u683C",
|
|
123
|
+
aiLanguageConfigured: "AI \u8F93\u51FA\u8BED\u8A00\u5DF2\u914D\u7F6E",
|
|
124
|
+
// AI personality
|
|
125
|
+
selectAiPersonality: "\u9009\u62E9 AI \u4E2A\u6027\u98CE\u683C",
|
|
126
|
+
customPersonalityHint: "\u5B9A\u4E49\u4F60\u81EA\u5DF1\u7684\u4E2A\u6027",
|
|
127
|
+
enterCustomPersonality: "\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u4E2A\u6027\u63CF\u8FF0",
|
|
128
|
+
personalityConfigured: "AI \u4E2A\u6027\u5DF2\u914D\u7F6E",
|
|
129
|
+
existingPersonality: "\u68C0\u6D4B\u5230\u5DF2\u6709 AI \u4E2A\u6027\u914D\u7F6E",
|
|
130
|
+
currentPersonality: "\u5F53\u524D\u4E2A\u6027",
|
|
131
|
+
modifyPersonality: "\u662F\u5426\u4FEE\u6539 AI \u4E2A\u6027\u914D\u7F6E\uFF1F",
|
|
132
|
+
keepPersonality: "\u4FDD\u6301\u5F53\u524D\u4E2A\u6027\u914D\u7F6E",
|
|
133
|
+
directiveCannotBeEmpty: "\u6307\u4EE4\u4E0D\u80FD\u4E3A\u7A7A",
|
|
134
|
+
languageRequired: "\u8BED\u8A00\u4E3A\u5FC5\u586B\u9879",
|
|
135
|
+
// Cache
|
|
136
|
+
confirmClearCache: "\u786E\u8BA4\u6E05\u9664\u6240\u6709 ZCF \u504F\u597D\u7F13\u5B58\uFF1F",
|
|
137
|
+
cacheCleared: "ZCF \u7F13\u5B58\u5DF2\u6E05\u9664",
|
|
138
|
+
noCacheFound: "\u672A\u627E\u5230\u7F13\u5B58\u6587\u4EF6",
|
|
139
|
+
// Environment and permissions
|
|
140
|
+
selectEnvPermissionOption: "\u8BF7\u9009\u62E9\u914D\u7F6E\u9009\u9879",
|
|
141
|
+
importRecommendedEnv: "\u5BFC\u5165 ZCF \u63A8\u8350\u73AF\u5883\u53D8\u91CF",
|
|
142
|
+
importRecommendedEnvDesc: "\u9690\u79C1\u4FDD\u62A4\u53D8\u91CF\u7B49",
|
|
143
|
+
importRecommendedPermissions: "\u5BFC\u5165 ZCF \u63A8\u8350\u6743\u9650\u914D\u7F6E",
|
|
144
|
+
importRecommendedPermissionsDesc: "\u51E0\u4E4E\u5168\u90E8\u6743\u9650\uFF0C\u51CF\u5C11\u9891\u7E41\u8BF7\u6C42\u6743\u9650\uFF0C\u5371\u9669\u64CD\u4F5C\u7531\u89C4\u5219\u9650\u5236",
|
|
145
|
+
openSettingsJson: "\u6253\u5F00 settings.json \u624B\u52A8\u914D\u7F6E",
|
|
146
|
+
openSettingsJsonDesc: "\u9AD8\u7EA7\u7528\u6237\u81EA\u5B9A\u4E49",
|
|
147
|
+
envImportSuccess: "\u73AF\u5883\u53D8\u91CF\u5DF2\u5BFC\u5165",
|
|
148
|
+
permissionsImportSuccess: "\u6743\u9650\u914D\u7F6E\u5DF2\u5BFC\u5165",
|
|
149
|
+
openingSettingsJson: "\u6B63\u5728\u6253\u5F00 settings.json..."
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const mcp$1 = {
|
|
153
|
+
configureMcp: "\u662F\u5426\u914D\u7F6E MCP \u670D\u52A1\uFF1F",
|
|
154
|
+
selectMcpServices: "\u9009\u62E9\u8981\u5B89\u88C5\u7684 MCP \u670D\u52A1",
|
|
155
|
+
allServices: "\u5168\u90E8\u5B89\u88C5",
|
|
156
|
+
mcpServiceInstalled: "\u5DF2\u9009\u62E9\u7684 MCP \u670D\u52A1",
|
|
157
|
+
enterExaApiKey: "\u8BF7\u8F93\u5165 Exa API Key\uFF08\u53EF\u4ECE https://dashboard.exa.ai/api-keys \u83B7\u53D6\uFF09",
|
|
158
|
+
skipMcp: "\u8DF3\u8FC7 MCP \u914D\u7F6E",
|
|
159
|
+
mcpConfigSuccess: "MCP \u670D\u52A1\u5DF2\u914D\u7F6E",
|
|
160
|
+
mcpBackupSuccess: "\u5DF2\u5907\u4EFD\u539F\u6709 MCP \u914D\u7F6E",
|
|
161
|
+
fixWindowsMcp: "\u4FEE\u590D Windows MCP \u914D\u7F6E",
|
|
162
|
+
fixWindowsMcpDesc: "\u4FEE\u590D Windows \u5E73\u53F0 MCP \u547D\u4EE4\u914D\u7F6E\u95EE\u9898",
|
|
163
|
+
windowsMcpFixed: "Windows MCP \u914D\u7F6E\u5DF2\u4FEE\u590D",
|
|
164
|
+
configureMcpServices: "\u914D\u7F6E MCP \u670D\u52A1",
|
|
165
|
+
selectMcpOption: "\u9009\u62E9 MCP \u914D\u7F6E\u9009\u9879"
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const menu$1 = {
|
|
169
|
+
selectFunction: "\u8BF7\u9009\u62E9\u529F\u80FD",
|
|
170
|
+
menuOptions: {
|
|
171
|
+
fullInit: "\u5B8C\u6574\u521D\u59CB\u5316",
|
|
172
|
+
importWorkflow: "\u5BFC\u5165\u5DE5\u4F5C\u6D41",
|
|
173
|
+
configureApi: "\u914D\u7F6E API",
|
|
174
|
+
configureMcp: "\u914D\u7F6E MCP",
|
|
175
|
+
configureModel: "\u914D\u7F6E\u9ED8\u8BA4\u6A21\u578B",
|
|
176
|
+
configureAiMemory: "\u914D\u7F6E Claude \u5168\u5C40\u8BB0\u5FC6",
|
|
177
|
+
configureEnvPermission: "\u5BFC\u5165\u63A8\u8350\u73AF\u5883\u53D8\u91CF\u548C\u6743\u9650\u914D\u7F6E",
|
|
178
|
+
installBmad: "\u5B89\u88C5 BMad Method",
|
|
179
|
+
clearCache: "\u6E05\u9664\u504F\u597D\u7F13\u5B58",
|
|
180
|
+
changeLanguage: "\u66F4\u6539\u663E\u793A\u8BED\u8A00 / Select display language",
|
|
181
|
+
exit: "\u9000\u51FA"
|
|
182
|
+
},
|
|
183
|
+
menuDescriptions: {
|
|
184
|
+
fullInit: "\u5B89\u88C5 Claude Code + \u5BFC\u5165\u5DE5\u4F5C\u6D41 + \u914D\u7F6E API + \u914D\u7F6E MCP \u670D\u52A1",
|
|
185
|
+
importWorkflow: "\u4EC5\u5BFC\u5165/\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173\u6587\u4EF6",
|
|
186
|
+
configureApi: "\u914D\u7F6E API URL \u548C\u8BA4\u8BC1\u4FE1\u606F",
|
|
187
|
+
configureMcp: "\u914D\u7F6E MCP \u670D\u52A1\uFF08\u542B Windows \u4FEE\u590D\uFF09",
|
|
188
|
+
configureModel: "\u8BBE\u7F6E\u9ED8\u8BA4\u6A21\u578B\uFF08opus/sonnet\uFF09",
|
|
189
|
+
configureAiMemory: "\u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00\u548C\u89D2\u8272\u98CE\u683C",
|
|
190
|
+
configureEnvPermission: "\u5BFC\u5165\u9690\u79C1\u4FDD\u62A4\u73AF\u5883\u53D8\u91CF\u548C\u7CFB\u7EDF\u6743\u9650\u914D\u7F6E",
|
|
191
|
+
installBmad: "AI \u9A71\u52A8\u7684\u5F00\u53D1\u65B9\u6CD5\u8BBA\u6846\u67B6",
|
|
192
|
+
clearCache: "\u6E05\u9664\u504F\u597D\u8BED\u8A00\u7B49\u7F13\u5B58",
|
|
193
|
+
changeLanguage: "\u66F4\u6539 ZCF \u754C\u9762\u8BED\u8A00"
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const workflow$1 = {
|
|
198
|
+
selectWorkflowType: "\u9009\u62E9\u8981\u5B89\u88C5\u7684\u5DE5\u4F5C\u6D41\u7C7B\u578B",
|
|
199
|
+
workflowOption: {
|
|
200
|
+
featPlanUx: "\u529F\u80FD\u89C4\u5212\u548C UX \u8BBE\u8BA1 (feat + planner + ui-ux-designer)",
|
|
201
|
+
sixStepsWorkflow: "\u516D\u6B65\u5DE5\u4F5C\u6D41 (workflow)",
|
|
202
|
+
bmadWorkflow: "BMAD-Method \u6269\u5C55\u5B89\u88C5\u5668 (\u652F\u6301\u654F\u6377\u5F00\u53D1\u5DE5\u4F5C\u6D41)"
|
|
203
|
+
},
|
|
204
|
+
// BMAD workflow
|
|
205
|
+
bmadInitPrompt: "\u2728 \u8BF7\u5728\u9879\u76EE\u4E2D\u8FD0\u884C /bmad-init \u547D\u4EE4\u6765\u521D\u59CB\u5316\u6216\u66F4\u65B0 BMAD-Method \u6269\u5C55",
|
|
206
|
+
bmadInstallSuccess: "\u6210\u529F\u5B89\u88C5 BMAD-Method \u5B89\u88C5\u5668",
|
|
207
|
+
// General workflow installation
|
|
208
|
+
installingWorkflow: "\u6B63\u5728\u5B89\u88C5\u5DE5\u4F5C\u6D41",
|
|
209
|
+
installedCommand: "\u5DF2\u5B89\u88C5\u547D\u4EE4",
|
|
210
|
+
installedAgent: "\u5DF2\u5B89\u88C5\u4EE3\u7406",
|
|
211
|
+
failedToInstallCommand: "\u5B89\u88C5\u547D\u4EE4\u5931\u8D25",
|
|
212
|
+
failedToInstallAgent: "\u5B89\u88C5\u4EE3\u7406\u5931\u8D25",
|
|
213
|
+
workflowInstallSuccess: "\u5DE5\u4F5C\u6D41\u5B89\u88C5\u6210\u529F",
|
|
214
|
+
workflowInstallError: "\u5DE5\u4F5C\u6D41\u5B89\u88C5\u51FA\u9519",
|
|
215
|
+
cleaningOldFiles: "\u6E05\u7406\u65E7\u7248\u672C\u6587\u4EF6",
|
|
216
|
+
removedOldFile: "\u5DF2\u5220\u9664\u65E7\u6587\u4EF6"
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const cli$1 = {
|
|
220
|
+
runFullInit: "\u76F4\u63A5\u8FD0\u884C\u5B8C\u6574\u521D\u59CB\u5316",
|
|
221
|
+
forceOverwrite: "\u5F3A\u5236\u8986\u76D6\u73B0\u6709\u914D\u7F6E",
|
|
222
|
+
initClaudeConfig: "\u521D\u59CB\u5316 Claude Code \u914D\u7F6E",
|
|
223
|
+
updatePromptsOnly: "\u4EC5\u66F4\u65B0 Claude Code \u63D0\u793A"
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const bmad$1 = {
|
|
227
|
+
// BMad CLI command
|
|
228
|
+
description: "\u5B89\u88C5 BMad Method \u7528\u4E8E AI \u9A71\u52A8\u7684\u5F00\u53D1",
|
|
229
|
+
directoryOption: "\u5B89\u88C5\u7684\u76EE\u6807\u76EE\u5F55",
|
|
230
|
+
forceOption: "\u5F3A\u5236\u91CD\u65B0\u5B89\u88C5\uFF0C\u5373\u4F7F\u5DF2\u5B58\u5728",
|
|
231
|
+
versionOption: "\u8981\u5B89\u88C5\u7684\u7279\u5B9A BMad \u7248\u672C",
|
|
232
|
+
// Installation messages
|
|
233
|
+
checkingExisting: "\u6B63\u5728\u68C0\u67E5\u73B0\u6709 BMad \u5B89\u88C5...",
|
|
234
|
+
alreadyInstalled: "BMad \u5DF2\u5B89\u88C5\uFF08\u7248\u672C\uFF1A{version}\uFF09",
|
|
235
|
+
existingAction: "\u9009\u62E9\u64CD\u4F5C\uFF1A",
|
|
236
|
+
actionUpdate: "\u66F4\u65B0\u5230\u6700\u65B0\u7248\u672C",
|
|
237
|
+
actionReinstall: "\u91CD\u65B0\u5B89\u88C5",
|
|
238
|
+
actionSkip: "\u8DF3\u8FC7\u5B89\u88C5",
|
|
239
|
+
installationSkipped: "\u5DF2\u8DF3\u8FC7 BMad \u5B89\u88C5",
|
|
240
|
+
installing: "\u6B63\u5728\u5B89\u88C5 BMad Method...",
|
|
241
|
+
installSuccess: "\u2705 BMad Method \u5B89\u88C5\u6210\u529F\uFF01",
|
|
242
|
+
installFailed: "\u274C BMad Method \u5B89\u88C5\u5931\u8D25",
|
|
243
|
+
installError: "\u274C BMad \u5B89\u88C5\u9519\u8BEF",
|
|
244
|
+
nextSteps: "\u4E0B\u4E00\u6B65\uFF1A\u8FDB\u5165 {directory} \u76EE\u5F55\u5F00\u59CB\u4F7F\u7528 BMad",
|
|
245
|
+
// BMad workflow messages
|
|
246
|
+
installingBmadWorkflow: "\u6B63\u5728\u5B89\u88C5 BMAD \u5DE5\u4F5C\u6D41...",
|
|
247
|
+
bmadWorkflowInstalled: "BMAD \u5DE5\u4F5C\u6D41\u5DF2\u5B89\u88C5",
|
|
248
|
+
bmadWorkflowFailed: "\u5B89\u88C5 BMAD \u5DE5\u4F5C\u6D41\u5931\u8D25",
|
|
249
|
+
// BMad agent messages
|
|
250
|
+
installingAgent: "\u6B63\u5728\u5B89\u88C5 {agent} \u4EE3\u7406...",
|
|
251
|
+
agentInstalled: "{agent} \u4EE3\u7406\u5DF2\u5B89\u88C5",
|
|
252
|
+
agentFailed: "\u5B89\u88C5 {agent} \u4EE3\u7406\u5931\u8D25",
|
|
253
|
+
// BMad user prompts
|
|
254
|
+
selectBmadOption: "\u9009\u62E9 BMAD \u9009\u9879",
|
|
255
|
+
confirmInstallBmad: "\u786E\u8BA4\u5B89\u88C5 BMAD \u5DE5\u4F5C\u6D41\uFF1F",
|
|
256
|
+
bmadInstallComplete: "BMAD \u5B89\u88C5\u5B8C\u6210",
|
|
257
|
+
// BMad log messages
|
|
258
|
+
checkingBmadDependencies: "\u68C0\u67E5 BMAD \u4F9D\u8D56...",
|
|
259
|
+
bmadDependenciesMet: "BMAD \u4F9D\u8D56\u6EE1\u8DB3",
|
|
260
|
+
bmadDependenciesMissing: "\u7F3A\u5C11 BMAD \u4F9D\u8D56\uFF1A{deps}",
|
|
261
|
+
// BMad commands
|
|
262
|
+
runningBmadCommand: "\u6267\u884C BMAD \u547D\u4EE4\uFF1A{command}",
|
|
263
|
+
bmadCommandSuccess: "BMAD \u547D\u4EE4\u6267\u884C\u6210\u529F",
|
|
264
|
+
bmadCommandFailed: "BMAD \u547D\u4EE4\u6267\u884C\u5931\u8D25\uFF1A{error}",
|
|
265
|
+
// BMad configuration
|
|
266
|
+
configuringBmad: "\u914D\u7F6E BMAD \u8BBE\u7F6E...",
|
|
267
|
+
bmadConfigured: "BMAD \u5DF2\u914D\u7F6E",
|
|
268
|
+
bmadConfigFailed: "BMAD \u914D\u7F6E\u5931\u8D25"
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
const errors$1 = {
|
|
272
|
+
// General errors
|
|
273
|
+
failedToSetOnboarding: "\u8BBE\u7F6E\u5165\u95E8\u5B8C\u6210\u6807\u5FD7\u5931\u8D25\uFF1A",
|
|
274
|
+
failedToWriteMcpConfig: "\u5199\u5165 MCP \u914D\u7F6E\u5931\u8D25\uFF1A",
|
|
275
|
+
templateDirNotFound: "\u6A21\u677F\u76EE\u5F55\u672A\u627E\u5230\uFF1A",
|
|
276
|
+
failedToReadTemplateSettings: "\u8BFB\u53D6\u6A21\u677F settings.json \u5931\u8D25\uFF1A",
|
|
277
|
+
failedToMergeSettings: "\u5408\u5E76 settings.json \u5931\u8D25\uFF1A",
|
|
278
|
+
preservingExistingSettings: "\u7531\u4E8E\u5408\u5E76\u9519\u8BEF\uFF0C\u4FDD\u7559\u73B0\u6709\u7684 settings.json",
|
|
279
|
+
// File system errors
|
|
280
|
+
failedToReadFile: "\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
281
|
+
failedToWriteFile: "\u5199\u5165\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
282
|
+
failedToCopyFile: "\u590D\u5236\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
283
|
+
failedToRemoveFile: "\u5220\u9664\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
284
|
+
failedToReadDirectory: "\u8BFB\u53D6\u76EE\u5F55\u5931\u8D25\uFF1A",
|
|
285
|
+
failedToGetStats: "\u83B7\u53D6\u6587\u4EF6\u72B6\u6001\u5931\u8D25\uFF1A",
|
|
286
|
+
sourceDirNotExist: "\u6E90\u76EE\u5F55\u4E0D\u5B58\u5728\uFF1A",
|
|
287
|
+
memoryDirNotFound: "\u8BB0\u5FC6\u76EE\u5F55\u672A\u627E\u5230\uFF1A",
|
|
288
|
+
// JSON config errors
|
|
289
|
+
invalidConfiguration: "\u914D\u7F6E\u65E0\u6548\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u503C",
|
|
290
|
+
failedToParseJson: "\u89E3\u6790 JSON \u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
291
|
+
failedToBackupConfig: "\u5907\u4EFD\u914D\u7F6E\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
292
|
+
invalidEnvConfig: "\u65E0\u6548\u7684 env \u914D\u7F6E\uFF1A\u671F\u671B\u5BF9\u8C61",
|
|
293
|
+
invalidApiUrl: "\u65E0\u6548\u7684 ANTHROPIC_BASE_URL\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
|
|
294
|
+
invalidApiKey: "\u65E0\u6548\u7684 ANTHROPIC_API_KEY\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
|
|
295
|
+
invalidAuthToken: "\u65E0\u6548\u7684 ANTHROPIC_AUTH_TOKEN\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
|
|
296
|
+
invalidPermissionsConfig: "\u65E0\u6548\u7684\u6743\u9650\u914D\u7F6E\uFF1A\u671F\u671B\u5BF9\u8C61",
|
|
297
|
+
invalidPermissionsAllow: "\u65E0\u6548\u7684 permissions.allow\uFF1A\u671F\u671B\u6570\u7EC4",
|
|
298
|
+
// MCP errors
|
|
299
|
+
failedToAddOnboardingFlag: "\u6DFB\u52A0 hasCompletedOnboarding \u6807\u5FD7\u5931\u8D25\uFF1A",
|
|
300
|
+
// AI personality errors
|
|
301
|
+
failedToApplyPersonality: "\u5E94\u7528\u4E2A\u6027\u6307\u4EE4\u5931\u8D25\uFF1A"
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const zhCN = {
|
|
305
|
+
...common$1,
|
|
306
|
+
...language$1,
|
|
307
|
+
...installation$1,
|
|
308
|
+
...api$1,
|
|
309
|
+
...configuration$1,
|
|
310
|
+
...mcp$1,
|
|
311
|
+
...menu$1,
|
|
312
|
+
...workflow$1,
|
|
313
|
+
...cli$1,
|
|
314
|
+
...bmad$1,
|
|
315
|
+
...errors$1
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
const common = {
|
|
319
|
+
// Basic
|
|
320
|
+
multiSelectHint: " (Space to select, a to select all, i to invert, Enter to confirm)",
|
|
321
|
+
yes: "Yes",
|
|
322
|
+
no: "No",
|
|
323
|
+
skip: "Skip",
|
|
324
|
+
cancelled: "Operation cancelled",
|
|
325
|
+
error: "Error",
|
|
326
|
+
complete: "\u{1F389} Setup complete! Use 'claude' command to start.",
|
|
327
|
+
none: "None",
|
|
328
|
+
notConfigured: "Not configured",
|
|
329
|
+
spaceToSelectReturn: "- Space to select. Return to submit",
|
|
330
|
+
enterChoice: "Enter your choice, and press enter",
|
|
331
|
+
invalidChoice: "Invalid choice. Please enter a valid option.",
|
|
332
|
+
goodbye: "\u{1F44B} Thanks for using ZCF! Goodbye!",
|
|
333
|
+
returnToMenu: "Return to main menu?"
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
const language = {
|
|
337
|
+
selectScriptLang: "Select ZCF display language",
|
|
338
|
+
selectConfigLang: "Select Claude Code configuration language",
|
|
339
|
+
selectAiOutputLang: "Select AI output language",
|
|
340
|
+
aiOutputLangHint: "AI will respond to you in this language",
|
|
341
|
+
enterCustomLanguage: "Enter custom language (e.g., Japanese, French, etc.)",
|
|
342
|
+
languageChanged: "Language changed",
|
|
343
|
+
configLangHint: {
|
|
344
|
+
"zh-CN": "easier for Chinese users to customize",
|
|
345
|
+
en: "recommended, lower token consumption"
|
|
346
|
+
},
|
|
347
|
+
updateConfigLangPrompt: "Select configuration language",
|
|
348
|
+
updateConfigLangChoice: {
|
|
349
|
+
"zh-CN": "Chinese configuration",
|
|
350
|
+
en: "English configuration"
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
const installation = {
|
|
355
|
+
installPrompt: "Claude Code not found. Install automatically?",
|
|
356
|
+
installing: "Installing Claude Code...",
|
|
357
|
+
installSuccess: "Claude Code installed successfully",
|
|
358
|
+
installFailed: "Failed to install Claude Code",
|
|
359
|
+
npmNotFound: "npm is not installed. Please install Node.js and npm first.",
|
|
360
|
+
// Termux specific
|
|
361
|
+
termuxDetected: "Termux environment detected",
|
|
362
|
+
termuxInstallHint: "In Termux, please run first: pkg install nodejs or pkg install nodejs-lts",
|
|
363
|
+
termuxPathInfo: "Using Termux path: {path}",
|
|
364
|
+
termuxEnvironmentInfo: "Termux environment provides Node.js and npm through pkg manager",
|
|
365
|
+
// Windows specific
|
|
366
|
+
windowsDetected: "Windows detected, will configure compatible format"
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
const api = {
|
|
370
|
+
// Basic API configuration
|
|
371
|
+
configureApi: "Select API authentication method",
|
|
372
|
+
useAuthToken: "Use Auth Token (OAuth authentication)",
|
|
373
|
+
authTokenDesc: "For tokens obtained via OAuth or browser login",
|
|
374
|
+
useApiKey: "Use API Key (Key authentication)",
|
|
375
|
+
apiKeyDesc: "For API keys from Anthropic Console",
|
|
376
|
+
skipApi: "Skip (configure manually later)",
|
|
377
|
+
enterApiUrl: "Enter API URL",
|
|
378
|
+
enterAuthToken: "Enter Auth Token",
|
|
379
|
+
enterApiKey: "Enter API Key",
|
|
380
|
+
apiConfigSuccess: "API configured",
|
|
381
|
+
// API modification
|
|
382
|
+
existingApiConfig: "Existing API configuration detected:",
|
|
383
|
+
apiConfigUrl: "URL",
|
|
384
|
+
apiConfigKey: "Key",
|
|
385
|
+
apiConfigAuthType: "Auth Type",
|
|
386
|
+
selectApiAction: "Select API processing operation",
|
|
387
|
+
keepExistingConfig: "Keep existing configuration",
|
|
388
|
+
modifyAllConfig: "Modify all configuration",
|
|
389
|
+
modifyPartialConfig: "Modify partial configuration",
|
|
390
|
+
selectModifyItems: "Select items to modify",
|
|
391
|
+
modifyApiUrl: "Modify API URL",
|
|
392
|
+
modifyApiKey: "Modify API Key",
|
|
393
|
+
modifyAuthType: "Modify auth type",
|
|
394
|
+
continueModification: "Continue modifying other configurations?",
|
|
395
|
+
modificationSaved: "Configuration saved",
|
|
396
|
+
enterNewApiUrl: "Enter new API URL (current: {url})",
|
|
397
|
+
enterNewApiKey: "Enter new API Key (current: {key})",
|
|
398
|
+
selectNewAuthType: "Select new auth type (current: {type})",
|
|
399
|
+
// API validation
|
|
400
|
+
apiKeyValidation: {
|
|
401
|
+
empty: "API Key cannot be empty",
|
|
402
|
+
example: "Example format: sk-abcdef123456_789xyz"
|
|
403
|
+
},
|
|
404
|
+
urlRequired: "URL is required",
|
|
405
|
+
invalidUrl: "Invalid URL",
|
|
406
|
+
keyRequired: "Key is required",
|
|
407
|
+
invalidKeyFormat: "Invalid key format"
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
const configuration = {
|
|
411
|
+
existingConfig: "Existing config detected. How to proceed?",
|
|
412
|
+
backupAndOverwrite: "Backup and overwrite all",
|
|
413
|
+
updateDocsOnly: "Update workflow-related md files only with backup",
|
|
414
|
+
mergeConfig: "Merge config",
|
|
415
|
+
backupSuccess: "All config files backed up to",
|
|
416
|
+
copying: "Copying configuration files...",
|
|
417
|
+
configSuccess: "Config files copied to",
|
|
418
|
+
noExistingConfig: "No existing configuration found. Please run `zcf` first.",
|
|
419
|
+
updatingPrompts: "Updating Claude Code memory documents...",
|
|
420
|
+
// Model configuration
|
|
421
|
+
selectDefaultModel: "Select default model",
|
|
422
|
+
modelConfigSuccess: "Default model configured",
|
|
423
|
+
// AI memory configuration
|
|
424
|
+
selectMemoryOption: "Select configuration option",
|
|
425
|
+
configureAiLanguage: "Configure AI output language",
|
|
426
|
+
configureAiPersonality: "Configure AI personality",
|
|
427
|
+
aiLanguageConfigured: "AI output language configured",
|
|
428
|
+
// AI personality
|
|
429
|
+
selectAiPersonality: "Select AI personality",
|
|
430
|
+
customPersonalityHint: "Define your own personality",
|
|
431
|
+
enterCustomPersonality: "Enter custom personality description",
|
|
432
|
+
personalityConfigured: "AI personality configured",
|
|
433
|
+
existingPersonality: "Existing AI personality configuration",
|
|
434
|
+
currentPersonality: "Current personality",
|
|
435
|
+
modifyPersonality: "Modify AI personality?",
|
|
436
|
+
keepPersonality: "Keeping existing personality",
|
|
437
|
+
directiveCannotBeEmpty: "Directive cannot be empty",
|
|
438
|
+
languageRequired: "Language is required",
|
|
439
|
+
// Cache
|
|
440
|
+
confirmClearCache: "Confirm clear all ZCF preference cache?",
|
|
441
|
+
cacheCleared: "ZCF cache cleared",
|
|
442
|
+
noCacheFound: "No cache file found",
|
|
443
|
+
// Environment and permissions
|
|
444
|
+
selectEnvPermissionOption: "Select configuration option",
|
|
445
|
+
importRecommendedEnv: "Import ZCF recommended environment variables",
|
|
446
|
+
importRecommendedEnvDesc: "Privacy protection variables, etc.",
|
|
447
|
+
importRecommendedPermissions: "Import ZCF recommended permissions",
|
|
448
|
+
importRecommendedPermissionsDesc: "Almost all permissions, reduce frequent permission requests, dangerous ops limited by rules",
|
|
449
|
+
openSettingsJson: "Open settings.json for manual configuration",
|
|
450
|
+
openSettingsJsonDesc: "Advanced user customization",
|
|
451
|
+
envImportSuccess: "Environment variables imported",
|
|
452
|
+
permissionsImportSuccess: "Permissions imported",
|
|
453
|
+
openingSettingsJson: "Opening settings.json..."
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
const mcp = {
|
|
457
|
+
configureMcp: "Configure MCP services?",
|
|
458
|
+
selectMcpServices: "Select MCP services to install",
|
|
459
|
+
allServices: "Install all",
|
|
460
|
+
mcpServiceInstalled: "Selected MCP services",
|
|
461
|
+
enterExaApiKey: "Enter Exa API Key (get from https://dashboard.exa.ai/api-keys)",
|
|
462
|
+
skipMcp: "Skip MCP configuration",
|
|
463
|
+
mcpConfigSuccess: "MCP services configured",
|
|
464
|
+
mcpBackupSuccess: "Original MCP config backed up",
|
|
465
|
+
fixWindowsMcp: "Fix Windows MCP Configuration",
|
|
466
|
+
fixWindowsMcpDesc: "Fix Windows platform MCP command configuration issues",
|
|
467
|
+
windowsMcpFixed: "Windows MCP configuration fixed",
|
|
468
|
+
configureMcpServices: "Configure MCP Services",
|
|
469
|
+
selectMcpOption: "Select MCP configuration option"
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
const menu = {
|
|
473
|
+
selectFunction: "Select function",
|
|
474
|
+
menuOptions: {
|
|
475
|
+
fullInit: "Full initialization",
|
|
476
|
+
importWorkflow: "Import workflow",
|
|
477
|
+
configureApi: "Configure API",
|
|
478
|
+
configureMcp: "Configure MCP",
|
|
479
|
+
configureModel: "Configure default model",
|
|
480
|
+
configureAiMemory: "Configure Claude global memory",
|
|
481
|
+
configureEnvPermission: "Import recommended environment variables and permissions",
|
|
482
|
+
installBmad: "Install BMad Method",
|
|
483
|
+
clearCache: "Clear preference cache",
|
|
484
|
+
changeLanguage: "Select display language / \u66F4\u6539\u663E\u793A\u8BED\u8A00",
|
|
485
|
+
exit: "Exit"
|
|
486
|
+
},
|
|
487
|
+
menuDescriptions: {
|
|
488
|
+
fullInit: "Install Claude Code + Import workflow + Configure API + Configure MCP services",
|
|
489
|
+
importWorkflow: "Import/update workflow-related files only",
|
|
490
|
+
configureApi: "Configure API URL and authentication",
|
|
491
|
+
configureMcp: "Configure MCP services (includes Windows fix)",
|
|
492
|
+
configureModel: "Set default model (opus/sonnet)",
|
|
493
|
+
configureAiMemory: "Configure AI output language and personality",
|
|
494
|
+
configureEnvPermission: "Import privacy protection environment variables and system permissions",
|
|
495
|
+
installBmad: "AI-driven development methodology framework",
|
|
496
|
+
clearCache: "Clear preference language and other caches",
|
|
497
|
+
changeLanguage: "Change ZCF interface language"
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
const workflow = {
|
|
502
|
+
selectWorkflowType: "Select workflow type to install",
|
|
503
|
+
workflowOption: {
|
|
504
|
+
featPlanUx: "Feature Planning and UX Design (feat + planner + ui-ux-designer)",
|
|
505
|
+
sixStepsWorkflow: "Six Steps Workflow (workflow)",
|
|
506
|
+
bmadWorkflow: "BMAD-Method Extension Installer (Agile Development Workflow)"
|
|
507
|
+
},
|
|
508
|
+
// BMAD workflow
|
|
509
|
+
bmadInitPrompt: "\u2728 Please run /bmad-init command in your project to initialize or update BMAD-Method extension",
|
|
510
|
+
bmadInstallSuccess: "Successfully installed BMAD-Method installer",
|
|
511
|
+
// General workflow installation
|
|
512
|
+
installingWorkflow: "Installing workflow",
|
|
513
|
+
installedCommand: "Installed command",
|
|
514
|
+
installedAgent: "Installed agent",
|
|
515
|
+
failedToInstallCommand: "Failed to install command",
|
|
516
|
+
failedToInstallAgent: "Failed to install agent",
|
|
517
|
+
workflowInstallSuccess: "workflow installed successfully",
|
|
518
|
+
workflowInstallError: "workflow installation had errors",
|
|
519
|
+
cleaningOldFiles: "Cleaning up old version files",
|
|
520
|
+
removedOldFile: "Removed old file"
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
const cli = {
|
|
524
|
+
runFullInit: "Run full initialization directly",
|
|
525
|
+
forceOverwrite: "Force overwrite existing configuration",
|
|
526
|
+
initClaudeConfig: "Initialize Claude Code configuration",
|
|
527
|
+
updatePromptsOnly: "Update Claude Code prompts only"
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
const bmad = {
|
|
531
|
+
// BMad CLI command
|
|
532
|
+
description: "Install BMad Method for AI-driven development",
|
|
533
|
+
directoryOption: "Target directory for installation",
|
|
534
|
+
forceOption: "Force reinstall even if already exists",
|
|
535
|
+
versionOption: "Specific BMad version to install",
|
|
536
|
+
// Installation messages
|
|
537
|
+
checkingExisting: "Checking for existing BMad installation...",
|
|
538
|
+
alreadyInstalled: "BMad is already installed (version: {version})",
|
|
539
|
+
existingAction: "Choose an action:",
|
|
540
|
+
actionUpdate: "Update to latest version",
|
|
541
|
+
actionReinstall: "Reinstall",
|
|
542
|
+
actionSkip: "Skip installation",
|
|
543
|
+
installationSkipped: "BMad installation skipped",
|
|
544
|
+
installing: "Installing BMad Method...",
|
|
545
|
+
installSuccess: "\u2705 BMad Method installed successfully!",
|
|
546
|
+
installFailed: "\u274C BMad Method installation failed",
|
|
547
|
+
installError: "\u274C BMad installation error",
|
|
548
|
+
nextSteps: "Next steps: Navigate to {directory} to start using BMad",
|
|
549
|
+
// BMad workflow messages
|
|
550
|
+
installingBmadWorkflow: "Installing BMAD workflow...",
|
|
551
|
+
bmadWorkflowInstalled: "BMAD workflow installed",
|
|
552
|
+
bmadWorkflowFailed: "Failed to install BMAD workflow",
|
|
553
|
+
// BMad agent messages
|
|
554
|
+
installingAgent: "Installing {agent} agent...",
|
|
555
|
+
agentInstalled: "{agent} agent installed",
|
|
556
|
+
agentFailed: "Failed to install {agent} agent",
|
|
557
|
+
// BMad user prompts
|
|
558
|
+
selectBmadOption: "Select BMAD option",
|
|
559
|
+
confirmInstallBmad: "Confirm install BMAD workflow?",
|
|
560
|
+
bmadInstallComplete: "BMAD installation complete",
|
|
561
|
+
// BMad log messages
|
|
562
|
+
checkingBmadDependencies: "Checking BMAD dependencies...",
|
|
563
|
+
bmadDependenciesMet: "BMAD dependencies met",
|
|
564
|
+
bmadDependenciesMissing: "Missing BMAD dependencies: {deps}",
|
|
565
|
+
// BMad commands
|
|
566
|
+
runningBmadCommand: "Running BMAD command: {command}",
|
|
567
|
+
bmadCommandSuccess: "BMAD command executed successfully",
|
|
568
|
+
bmadCommandFailed: "BMAD command failed: {error}",
|
|
569
|
+
// BMad configuration
|
|
570
|
+
configuringBmad: "Configuring BMAD settings...",
|
|
571
|
+
bmadConfigured: "BMAD configured",
|
|
572
|
+
bmadConfigFailed: "BMAD configuration failed"
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
const errors = {
|
|
576
|
+
// General errors
|
|
577
|
+
failedToSetOnboarding: "Failed to set onboarding completion flag:",
|
|
578
|
+
failedToWriteMcpConfig: "Failed to write MCP config:",
|
|
579
|
+
templateDirNotFound: "Template directory not found:",
|
|
580
|
+
failedToReadTemplateSettings: "Failed to read template settings.json:",
|
|
581
|
+
failedToMergeSettings: "Failed to merge settings.json:",
|
|
582
|
+
preservingExistingSettings: "Preserving existing settings.json due to merge error",
|
|
583
|
+
// File system errors
|
|
584
|
+
failedToReadFile: "Failed to read file:",
|
|
585
|
+
failedToWriteFile: "Failed to write file:",
|
|
586
|
+
failedToCopyFile: "Failed to copy file:",
|
|
587
|
+
failedToRemoveFile: "Failed to remove file:",
|
|
588
|
+
failedToReadDirectory: "Failed to read directory:",
|
|
589
|
+
failedToGetStats: "Failed to get stats for:",
|
|
590
|
+
sourceDirNotExist: "Source directory does not exist:",
|
|
591
|
+
memoryDirNotFound: "Memory directory not found:",
|
|
592
|
+
// JSON config errors
|
|
593
|
+
invalidConfiguration: "Invalid configuration, using default value",
|
|
594
|
+
failedToParseJson: "Failed to parse JSON file:",
|
|
595
|
+
failedToBackupConfig: "Failed to backup config file:",
|
|
596
|
+
invalidEnvConfig: "Invalid env configuration: expected object",
|
|
597
|
+
invalidApiUrl: "Invalid ANTHROPIC_BASE_URL: expected string",
|
|
598
|
+
invalidApiKey: "Invalid ANTHROPIC_API_KEY: expected string",
|
|
599
|
+
invalidAuthToken: "Invalid ANTHROPIC_AUTH_TOKEN: expected string",
|
|
600
|
+
invalidPermissionsConfig: "Invalid permissions configuration: expected object",
|
|
601
|
+
invalidPermissionsAllow: "Invalid permissions.allow: expected array",
|
|
602
|
+
// MCP errors
|
|
603
|
+
failedToAddOnboardingFlag: "Failed to add hasCompletedOnboarding flag:",
|
|
604
|
+
// AI personality errors
|
|
605
|
+
failedToApplyPersonality: "Failed to apply personality directive:"
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
const en = {
|
|
609
|
+
...common,
|
|
610
|
+
...language,
|
|
611
|
+
...installation,
|
|
612
|
+
...api,
|
|
613
|
+
...configuration,
|
|
614
|
+
...mcp,
|
|
615
|
+
...menu,
|
|
616
|
+
...workflow,
|
|
617
|
+
...cli,
|
|
618
|
+
...bmad,
|
|
619
|
+
...errors
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
const translations = {
|
|
623
|
+
"zh-CN": zhCN,
|
|
624
|
+
en
|
|
625
|
+
};
|
|
626
|
+
|
|
13
627
|
const CLAUDE_DIR = join(homedir(), ".claude");
|
|
14
628
|
const SETTINGS_FILE = join(CLAUDE_DIR, "settings.json");
|
|
15
629
|
const CLAUDE_MD_FILE = join(CLAUDE_DIR, "CLAUDE.md");
|
|
16
630
|
const ClAUDE_CONFIG_FILE = join(homedir(), ".claude.json");
|
|
17
|
-
const
|
|
631
|
+
const LEGACY_ZCF_CONFIG_FILE = join(homedir(), ".zcf.json");
|
|
632
|
+
const ZCF_CONFIG_FILE = join(CLAUDE_DIR, ".zcf-config.json");
|
|
18
633
|
const SUPPORTED_LANGS = ["zh-CN", "en"];
|
|
19
634
|
const LANG_LABELS = {
|
|
20
635
|
"zh-CN": "\u7B80\u4F53\u4E2D\u6587",
|
|
@@ -25,388 +640,7 @@ const AI_OUTPUT_LANGUAGES = {
|
|
|
25
640
|
en: { label: "English", directive: "Always respond in English" },
|
|
26
641
|
custom: { label: "Custom", directive: "" }
|
|
27
642
|
};
|
|
28
|
-
const I18N =
|
|
29
|
-
"zh-CN": {
|
|
30
|
-
selectScriptLang: "\u9009\u62E9ZCF\u663E\u793A\u8BED\u8A00",
|
|
31
|
-
selectConfigLang: "\u9009\u62E9 Claude Code \u914D\u7F6E\u8BED\u8A00",
|
|
32
|
-
selectAiOutputLang: "\u9009\u62E9 AI \u8F93\u51FA\u8BED\u8A00",
|
|
33
|
-
aiOutputLangHint: "AI \u5C06\u4F7F\u7528\u6B64\u8BED\u8A00\u56DE\u590D\u4F60\u7684\u95EE\u9898",
|
|
34
|
-
enterCustomLanguage: "\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u8BED\u8A00\uFF08\u4F8B\u5982\uFF1AJapanese, French \u7B49\uFF09",
|
|
35
|
-
configLangHint: {
|
|
36
|
-
"zh-CN": "\u4FBF\u4E8E\u4E2D\u6587\u7528\u6237\u81EA\u5B9A\u4E49",
|
|
37
|
-
en: "\u63A8\u8350\uFF0Ctoken \u6D88\u8017\u66F4\u4F4E"
|
|
38
|
-
},
|
|
39
|
-
installPrompt: "\u68C0\u6D4B\u5230 Claude Code \u672A\u5B89\u88C5\uFF0C\u662F\u5426\u81EA\u52A8\u5B89\u88C5\uFF1F",
|
|
40
|
-
installing: "\u6B63\u5728\u5B89\u88C5 Claude Code...",
|
|
41
|
-
installSuccess: "Claude Code \u5B89\u88C5\u6210\u529F",
|
|
42
|
-
installFailed: "Claude Code \u5B89\u88C5\u5931\u8D25",
|
|
43
|
-
npmNotFound: "npm \u672A\u5B89\u88C5\u3002\u8BF7\u5148\u5B89\u88C5 Node.js \u548C npm\u3002",
|
|
44
|
-
termuxDetected: "\u68C0\u6D4B\u5230 Termux \u73AF\u5883",
|
|
45
|
-
termuxInstallHint: "\u5728 Termux \u4E2D\uFF0C\u8BF7\u5148\u8FD0\u884C: pkg install nodejs \u6216 pkg install nodejs-lts",
|
|
46
|
-
termuxPathInfo: "\u4F7F\u7528 Termux \u8DEF\u5F84: {path}",
|
|
47
|
-
termuxEnvironmentInfo: "Termux \u73AF\u5883\u901A\u8FC7 pkg \u7BA1\u7406\u5668\u63D0\u4F9B Node.js \u548C npm",
|
|
48
|
-
configureApi: "\u9009\u62E9 API \u8BA4\u8BC1\u65B9\u5F0F",
|
|
49
|
-
useAuthToken: "\u4F7F\u7528 Auth Token (OAuth \u8BA4\u8BC1)",
|
|
50
|
-
authTokenDesc: "\u9002\u7528\u4E8E\u901A\u8FC7 OAuth \u6216\u6D4F\u89C8\u5668\u767B\u5F55\u83B7\u53D6\u7684\u4EE4\u724C",
|
|
51
|
-
useApiKey: "\u4F7F\u7528 API Key (\u5BC6\u94A5\u8BA4\u8BC1)",
|
|
52
|
-
apiKeyDesc: "\u9002\u7528\u4E8E\u4ECE Anthropic Console \u83B7\u53D6\u7684 API \u5BC6\u94A5",
|
|
53
|
-
skipApi: "\u8DF3\u8FC7\uFF08\u7A0D\u540E\u624B\u52A8\u914D\u7F6E\uFF09",
|
|
54
|
-
enterApiUrl: "\u8BF7\u8F93\u5165 API URL",
|
|
55
|
-
enterAuthToken: "\u8BF7\u8F93\u5165 Auth Token",
|
|
56
|
-
enterApiKey: "\u8BF7\u8F93\u5165 API Key",
|
|
57
|
-
// API modification related
|
|
58
|
-
existingApiConfig: "\u68C0\u6D4B\u5230\u5DF2\u6709 API \u914D\u7F6E\uFF1A",
|
|
59
|
-
apiConfigUrl: "URL",
|
|
60
|
-
apiConfigKey: "Key",
|
|
61
|
-
apiConfigAuthType: "\u8BA4\u8BC1\u7C7B\u578B",
|
|
62
|
-
selectApiAction: "\u8BF7\u9009\u62E9API\u5904\u7406\u64CD\u4F5C",
|
|
63
|
-
keepExistingConfig: "\u4FDD\u7559\u73B0\u6709\u914D\u7F6E",
|
|
64
|
-
modifyAllConfig: "\u4FEE\u6539\u5168\u90E8\u914D\u7F6E",
|
|
65
|
-
modifyPartialConfig: "\u4FEE\u6539\u90E8\u5206\u914D\u7F6E",
|
|
66
|
-
selectModifyItems: "\u8BF7\u9009\u62E9\u8981\u4FEE\u6539\u7684\u9879",
|
|
67
|
-
modifyApiUrl: "\u4FEE\u6539 API URL",
|
|
68
|
-
modifyApiKey: "\u4FEE\u6539 API Key",
|
|
69
|
-
modifyAuthType: "\u4FEE\u6539\u8BA4\u8BC1\u7C7B\u578B",
|
|
70
|
-
continueModification: "\u662F\u5426\u7EE7\u7EED\u4FEE\u6539\u5176\u4ED6\u914D\u7F6E\uFF1F",
|
|
71
|
-
modificationSaved: "\u914D\u7F6E\u5DF2\u4FDD\u5B58",
|
|
72
|
-
enterNewApiUrl: "\u8BF7\u8F93\u5165\u65B0\u7684 API URL\uFF08\u5F53\u524D\uFF1A{url}\uFF09",
|
|
73
|
-
enterNewApiKey: "\u8BF7\u8F93\u5165\u65B0\u7684 API Key\uFF08\u5F53\u524D\uFF1A{key}\uFF09",
|
|
74
|
-
selectNewAuthType: "\u9009\u62E9\u65B0\u7684\u8BA4\u8BC1\u7C7B\u578B\uFF08\u5F53\u524D\uFF1A{type}\uFF09",
|
|
75
|
-
existingConfig: "\u68C0\u6D4B\u5230\u5DF2\u6709\u914D\u7F6E\u6587\u4EF6\uFF0C\u5982\u4F55\u5904\u7406\uFF1F",
|
|
76
|
-
backupAndOverwrite: "\u5907\u4EFD\u5E76\u8986\u76D6\u5168\u90E8",
|
|
77
|
-
updateDocsOnly: "\u4EC5\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173md\u5E76\u5907\u4EFD\u65E7\u914D\u7F6E",
|
|
78
|
-
mergeConfig: "\u5408\u5E76\u914D\u7F6E",
|
|
79
|
-
skip: "\u8DF3\u8FC7",
|
|
80
|
-
backupSuccess: "\u5DF2\u5907\u4EFD\u6240\u6709\u914D\u7F6E\u6587\u4EF6\u5230",
|
|
81
|
-
copying: "\u6B63\u5728\u590D\u5236\u914D\u7F6E\u6587\u4EF6...",
|
|
82
|
-
configSuccess: "\u914D\u7F6E\u6587\u4EF6\u5DF2\u590D\u5236\u5230",
|
|
83
|
-
apiConfigSuccess: "API \u914D\u7F6E\u5B8C\u6210",
|
|
84
|
-
mcpConfigSuccess: "MCP \u670D\u52A1\u5DF2\u914D\u7F6E",
|
|
85
|
-
selectMcpServices: "\u9009\u62E9\u8981\u5B89\u88C5\u7684 MCP \u670D\u52A1\uFF08\u7A7A\u683C\u9009\u62E9\uFF0Ca\u5168\u9009\uFF0Ci\u53CD\u9009\uFF0C\u56DE\u8F66\u786E\u8BA4\uFF09",
|
|
86
|
-
allServices: "\u5168\u90E8\u5B89\u88C5",
|
|
87
|
-
mcpServiceInstalled: "\u5DF2\u9009\u62E9\u7684 MCP \u670D\u52A1",
|
|
88
|
-
enterExaApiKey: "\u8BF7\u8F93\u5165 Exa API Key\uFF08\u53EF\u4ECE https://dashboard.exa.ai/api-keys \u83B7\u53D6\uFF09",
|
|
89
|
-
skipMcp: "\u8DF3\u8FC7 MCP \u914D\u7F6E",
|
|
90
|
-
configureMcp: "\u662F\u5426\u914D\u7F6E MCP \u670D\u52A1\uFF1F",
|
|
91
|
-
mcpBackupSuccess: "\u5DF2\u5907\u4EFD\u539F\u6709 MCP \u914D\u7F6E",
|
|
92
|
-
complete: "\u{1F389} \u914D\u7F6E\u5B8C\u6210\uFF01\u4F7F\u7528 'claude' \u547D\u4EE4\u5F00\u59CB\u4F53\u9A8C\u3002",
|
|
93
|
-
error: "\u9519\u8BEF",
|
|
94
|
-
yes: "\u662F",
|
|
95
|
-
no: "\u5426",
|
|
96
|
-
cancelled: "\u64CD\u4F5C\u5DF2\u53D6\u6D88",
|
|
97
|
-
apiKeyValidation: {
|
|
98
|
-
empty: "API Key \u4E0D\u80FD\u4E3A\u7A7A",
|
|
99
|
-
example: "\u793A\u4F8B\u683C\u5F0F: sk-abcdef123456_789xyz"
|
|
100
|
-
},
|
|
101
|
-
noExistingConfig: "\u672A\u627E\u5230\u73B0\u6709\u914D\u7F6E\u3002\u8BF7\u5148\u8FD0\u884C `zcf`\u3002",
|
|
102
|
-
updatingPrompts: "\u6B63\u5728\u66F4\u65B0 Claude Code Prompt \u6587\u6863...",
|
|
103
|
-
updateConfigLangPrompt: "\u9009\u62E9\u914D\u7F6E\u8BED\u8A00",
|
|
104
|
-
updateConfigLangChoice: {
|
|
105
|
-
"zh-CN": "\u4E2D\u6587\u7248\u914D\u7F6E",
|
|
106
|
-
en: "\u82F1\u6587\u7248\u914D\u7F6E"
|
|
107
|
-
},
|
|
108
|
-
// Menu related
|
|
109
|
-
selectFunction: "\u8BF7\u9009\u62E9\u529F\u80FD",
|
|
110
|
-
enterChoice: "\u8BF7\u8F93\u5165\u9009\u9879\uFF0C\u56DE\u8F66\u786E\u8BA4",
|
|
111
|
-
menuOptions: {
|
|
112
|
-
fullInit: "\u5B8C\u6574\u521D\u59CB\u5316",
|
|
113
|
-
importWorkflow: "\u5BFC\u5165\u5DE5\u4F5C\u6D41",
|
|
114
|
-
configureApi: "\u914D\u7F6E API",
|
|
115
|
-
configureMcp: "\u914D\u7F6E MCP",
|
|
116
|
-
configureModel: "\u914D\u7F6E\u9ED8\u8BA4\u6A21\u578B",
|
|
117
|
-
configureAiMemory: "\u914D\u7F6E Claude \u5168\u5C40\u8BB0\u5FC6",
|
|
118
|
-
configureEnvPermission: "\u5BFC\u5165\u63A8\u8350\u73AF\u5883\u53D8\u91CF\u548C\u6743\u9650\u914D\u7F6E",
|
|
119
|
-
clearCache: "\u6E05\u9664\u504F\u597D\u7F13\u5B58",
|
|
120
|
-
changeLanguage: "\u66F4\u6539\u663E\u793A\u8BED\u8A00 / Select display language",
|
|
121
|
-
exit: "\u9000\u51FA"
|
|
122
|
-
},
|
|
123
|
-
menuDescriptions: {
|
|
124
|
-
fullInit: "\u5B89\u88C5 Claude Code + \u5BFC\u5165\u5DE5\u4F5C\u6D41 + \u914D\u7F6E API + \u914D\u7F6E MCP \u670D\u52A1",
|
|
125
|
-
importWorkflow: "\u4EC5\u5BFC\u5165/\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173\u6587\u4EF6",
|
|
126
|
-
configureApi: "\u914D\u7F6E API URL \u548C\u8BA4\u8BC1\u4FE1\u606F",
|
|
127
|
-
configureMcp: "\u914D\u7F6E MCP \u670D\u52A1\uFF08\u542B Windows \u4FEE\u590D\uFF09",
|
|
128
|
-
configureModel: "\u8BBE\u7F6E\u9ED8\u8BA4\u6A21\u578B\uFF08opus/sonnet\uFF09",
|
|
129
|
-
configureAiMemory: "\u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00\u548C\u89D2\u8272\u98CE\u683C",
|
|
130
|
-
configureEnvPermission: "\u5BFC\u5165\u9690\u79C1\u4FDD\u62A4\u73AF\u5883\u53D8\u91CF\u548C\u7CFB\u7EDF\u6743\u9650\u914D\u7F6E",
|
|
131
|
-
clearCache: "\u6E05\u9664\u504F\u597D\u8BED\u8A00\u7B49\u7F13\u5B58",
|
|
132
|
-
changeLanguage: "\u66F4\u6539 ZCF \u754C\u9762\u8BED\u8A00"
|
|
133
|
-
},
|
|
134
|
-
returnToMenu: "\u8FD4\u56DE\u4E3B\u83DC\u5355\uFF1F",
|
|
135
|
-
goodbye: "\u{1F44B} \u611F\u8C22\u4F7F\u7528 ZCF\uFF01\u518D\u89C1\uFF01",
|
|
136
|
-
// Model config
|
|
137
|
-
selectDefaultModel: "\u9009\u62E9\u9ED8\u8BA4\u6A21\u578B",
|
|
138
|
-
modelConfigSuccess: "\u9ED8\u8BA4\u6A21\u578B\u5DF2\u914D\u7F6E",
|
|
139
|
-
// AI memory config
|
|
140
|
-
selectMemoryOption: "\u9009\u62E9\u914D\u7F6E\u9009\u9879",
|
|
141
|
-
configureAiLanguage: "\u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00",
|
|
142
|
-
configureAiPersonality: "\u914D\u7F6E AI \u4E2A\u6027\u98CE\u683C",
|
|
143
|
-
aiLanguageConfigured: "AI \u8F93\u51FA\u8BED\u8A00\u5DF2\u914D\u7F6E",
|
|
144
|
-
// AI personality
|
|
145
|
-
selectAiPersonality: "\u9009\u62E9 AI \u4E2A\u6027\u98CE\u683C",
|
|
146
|
-
customPersonalityHint: "\u5B9A\u4E49\u4F60\u81EA\u5DF1\u7684\u4E2A\u6027",
|
|
147
|
-
enterCustomPersonality: "\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u4E2A\u6027\u63CF\u8FF0",
|
|
148
|
-
personalityConfigured: "AI \u4E2A\u6027\u5DF2\u914D\u7F6E",
|
|
149
|
-
existingPersonality: "\u68C0\u6D4B\u5230\u5DF2\u6709 AI \u4E2A\u6027\u914D\u7F6E",
|
|
150
|
-
currentPersonality: "\u5F53\u524D\u4E2A\u6027",
|
|
151
|
-
modifyPersonality: "\u662F\u5426\u4FEE\u6539 AI \u4E2A\u6027\u914D\u7F6E\uFF1F",
|
|
152
|
-
keepPersonality: "\u4FDD\u6301\u5F53\u524D\u4E2A\u6027\u914D\u7F6E",
|
|
153
|
-
// Cache
|
|
154
|
-
confirmClearCache: "\u786E\u8BA4\u6E05\u9664\u6240\u6709 ZCF \u504F\u597D\u7F13\u5B58\uFF1F",
|
|
155
|
-
cacheCleared: "ZCF \u7F13\u5B58\u5DF2\u6E05\u9664",
|
|
156
|
-
noCacheFound: "\u672A\u627E\u5230\u7F13\u5B58\u6587\u4EF6",
|
|
157
|
-
// Language
|
|
158
|
-
languageChanged: "\u8BED\u8A00\u5DF2\u66F4\u6539",
|
|
159
|
-
// Windows MCP
|
|
160
|
-
fixWindowsMcp: "\u4FEE\u590D Windows MCP \u914D\u7F6E",
|
|
161
|
-
fixWindowsMcpDesc: "\u4FEE\u590D Windows \u5E73\u53F0 MCP \u547D\u4EE4\u914D\u7F6E\u95EE\u9898",
|
|
162
|
-
windowsMcpFixed: "Windows MCP \u914D\u7F6E\u5DF2\u4FEE\u590D",
|
|
163
|
-
configureMcpServices: "\u914D\u7F6E MCP \u670D\u52A1",
|
|
164
|
-
selectMcpOption: "\u9009\u62E9 MCP \u914D\u7F6E\u9009\u9879",
|
|
165
|
-
// Validation messages
|
|
166
|
-
invalidChoice: "\u65E0\u6548\u9009\u62E9\u3002\u8BF7\u8F93\u5165\u6709\u6548\u9009\u9879\u3002",
|
|
167
|
-
urlRequired: "URL \u4E3A\u5FC5\u586B\u9879",
|
|
168
|
-
invalidUrl: "\u65E0\u6548\u7684 URL",
|
|
169
|
-
keyRequired: "\u5BC6\u94A5\u4E3A\u5FC5\u586B\u9879",
|
|
170
|
-
invalidKeyFormat: "\u65E0\u6548\u7684\u5BC6\u94A5\u683C\u5F0F",
|
|
171
|
-
directiveCannotBeEmpty: "\u6307\u4EE4\u4E0D\u80FD\u4E3A\u7A7A",
|
|
172
|
-
languageRequired: "\u8BED\u8A00\u4E3A\u5FC5\u586B\u9879",
|
|
173
|
-
// Error messages
|
|
174
|
-
failedToSetOnboarding: "\u8BBE\u7F6E\u5165\u95E8\u5B8C\u6210\u6807\u5FD7\u5931\u8D25\uFF1A",
|
|
175
|
-
failedToWriteMcpConfig: "\u5199\u5165 MCP \u914D\u7F6E\u5931\u8D25\uFF1A",
|
|
176
|
-
templateDirNotFound: "\u6A21\u677F\u76EE\u5F55\u672A\u627E\u5230\uFF1A",
|
|
177
|
-
failedToReadTemplateSettings: "\u8BFB\u53D6\u6A21\u677F settings.json \u5931\u8D25\uFF1A",
|
|
178
|
-
failedToMergeSettings: "\u5408\u5E76 settings.json \u5931\u8D25\uFF1A",
|
|
179
|
-
preservingExistingSettings: "\u7531\u4E8E\u5408\u5E76\u9519\u8BEF\uFF0C\u4FDD\u7559\u73B0\u6709\u7684 settings.json",
|
|
180
|
-
// File system errors
|
|
181
|
-
failedToReadFile: "\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
182
|
-
failedToWriteFile: "\u5199\u5165\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
183
|
-
failedToCopyFile: "\u590D\u5236\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
184
|
-
failedToReadDirectory: "\u8BFB\u53D6\u76EE\u5F55\u5931\u8D25\uFF1A",
|
|
185
|
-
failedToGetStats: "\u83B7\u53D6\u6587\u4EF6\u72B6\u6001\u5931\u8D25\uFF1A",
|
|
186
|
-
sourceDirNotExist: "\u6E90\u76EE\u5F55\u4E0D\u5B58\u5728\uFF1A",
|
|
187
|
-
// JSON config errors
|
|
188
|
-
invalidConfiguration: "\u914D\u7F6E\u65E0\u6548\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u503C",
|
|
189
|
-
failedToParseJson: "\u89E3\u6790 JSON \u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
190
|
-
failedToBackupConfig: "\u5907\u4EFD\u914D\u7F6E\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
191
|
-
// MCP errors
|
|
192
|
-
failedToAddOnboardingFlag: "\u6DFB\u52A0 hasCompletedOnboarding \u6807\u5FD7\u5931\u8D25\uFF1A",
|
|
193
|
-
// AI personality errors
|
|
194
|
-
failedToApplyPersonality: "\u5E94\u7528\u4E2A\u6027\u6307\u4EE4\u5931\u8D25\uFF1A",
|
|
195
|
-
// Status messages
|
|
196
|
-
notConfigured: "\u672A\u914D\u7F6E",
|
|
197
|
-
none: "\u65E0",
|
|
198
|
-
// CLI options
|
|
199
|
-
runFullInit: "\u76F4\u63A5\u8FD0\u884C\u5B8C\u6574\u521D\u59CB\u5316",
|
|
200
|
-
forceOverwrite: "\u5F3A\u5236\u8986\u76D6\u73B0\u6709\u914D\u7F6E",
|
|
201
|
-
initClaudeConfig: "\u521D\u59CB\u5316 Claude Code \u914D\u7F6E",
|
|
202
|
-
updatePromptsOnly: "\u4EC5\u66F4\u65B0 Claude Code \u63D0\u793A",
|
|
203
|
-
// Environment variables and permissions
|
|
204
|
-
selectEnvPermissionOption: "\u8BF7\u9009\u62E9\u914D\u7F6E\u9009\u9879",
|
|
205
|
-
importRecommendedEnv: "\u5BFC\u5165 ZCF \u63A8\u8350\u73AF\u5883\u53D8\u91CF",
|
|
206
|
-
importRecommendedEnvDesc: "\u9690\u79C1\u4FDD\u62A4\u53D8\u91CF\u7B49",
|
|
207
|
-
importRecommendedPermissions: "\u5BFC\u5165 ZCF \u63A8\u8350\u6743\u9650\u914D\u7F6E",
|
|
208
|
-
importRecommendedPermissionsDesc: "\u51E0\u4E4E\u5168\u90E8\u6743\u9650\uFF0C\u51CF\u5C11\u9891\u7E41\u8BF7\u6C42\u6743\u9650\uFF0C\u5371\u9669\u64CD\u4F5C\u7531\u89C4\u5219\u9650\u5236",
|
|
209
|
-
openSettingsJson: "\u6253\u5F00 settings.json \u624B\u52A8\u914D\u7F6E",
|
|
210
|
-
openSettingsJsonDesc: "\u9AD8\u7EA7\u7528\u6237\u81EA\u5B9A\u4E49",
|
|
211
|
-
envImportSuccess: "\u73AF\u5883\u53D8\u91CF\u5DF2\u5BFC\u5165",
|
|
212
|
-
permissionsImportSuccess: "\u6743\u9650\u914D\u7F6E\u5DF2\u5BFC\u5165",
|
|
213
|
-
openingSettingsJson: "\u6B63\u5728\u6253\u5F00 settings.json...",
|
|
214
|
-
// Misc
|
|
215
|
-
spaceToSelectReturn: "- \u7A7A\u683C\u9009\u62E9\uFF0C\u56DE\u8F66\u63D0\u4EA4",
|
|
216
|
-
// Windows detection
|
|
217
|
-
windowsDetected: "\u68C0\u6D4B\u5230 Windows \u7CFB\u7EDF\uFF0C\u5C06\u81EA\u52A8\u914D\u7F6E\u517C\u5BB9\u683C\u5F0F"
|
|
218
|
-
},
|
|
219
|
-
en: {
|
|
220
|
-
selectScriptLang: "Select ZCF display language",
|
|
221
|
-
selectConfigLang: "Select Claude Code configuration language",
|
|
222
|
-
selectAiOutputLang: "Select AI output language",
|
|
223
|
-
aiOutputLangHint: "AI will respond to you in this language",
|
|
224
|
-
enterCustomLanguage: "Enter custom language (e.g., Japanese, French, etc.)",
|
|
225
|
-
configLangHint: {
|
|
226
|
-
"zh-CN": "easier for Chinese users to customize",
|
|
227
|
-
en: "recommended, lower token consumption"
|
|
228
|
-
},
|
|
229
|
-
installPrompt: "Claude Code not found. Install automatically?",
|
|
230
|
-
installing: "Installing Claude Code...",
|
|
231
|
-
installSuccess: "Claude Code installed successfully",
|
|
232
|
-
installFailed: "Failed to install Claude Code",
|
|
233
|
-
npmNotFound: "npm is not installed. Please install Node.js and npm first.",
|
|
234
|
-
termuxDetected: "Termux environment detected",
|
|
235
|
-
termuxInstallHint: "In Termux, please run first: pkg install nodejs or pkg install nodejs-lts",
|
|
236
|
-
termuxPathInfo: "Using Termux path: {path}",
|
|
237
|
-
termuxEnvironmentInfo: "Termux environment provides Node.js and npm through pkg manager",
|
|
238
|
-
configureApi: "Select API authentication method",
|
|
239
|
-
useAuthToken: "Use Auth Token (OAuth authentication)",
|
|
240
|
-
authTokenDesc: "For tokens obtained via OAuth or browser login",
|
|
241
|
-
useApiKey: "Use API Key (Key authentication)",
|
|
242
|
-
apiKeyDesc: "For API keys from Anthropic Console",
|
|
243
|
-
skipApi: "Skip (configure manually later)",
|
|
244
|
-
enterApiUrl: "Enter API URL",
|
|
245
|
-
enterAuthToken: "Enter Auth Token",
|
|
246
|
-
enterApiKey: "Enter API Key",
|
|
247
|
-
// API modification related
|
|
248
|
-
existingApiConfig: "Existing API configuration detected:",
|
|
249
|
-
apiConfigUrl: "URL",
|
|
250
|
-
apiConfigKey: "Key",
|
|
251
|
-
apiConfigAuthType: "Auth Type",
|
|
252
|
-
selectApiAction: "Select API processing operation",
|
|
253
|
-
keepExistingConfig: "Keep existing configuration",
|
|
254
|
-
modifyAllConfig: "Modify all configuration",
|
|
255
|
-
modifyPartialConfig: "Modify partial configuration",
|
|
256
|
-
selectModifyItems: "Select items to modify",
|
|
257
|
-
modifyApiUrl: "Modify API URL",
|
|
258
|
-
modifyApiKey: "Modify API Key",
|
|
259
|
-
modifyAuthType: "Modify auth type",
|
|
260
|
-
continueModification: "Continue modifying other configurations?",
|
|
261
|
-
modificationSaved: "Configuration saved",
|
|
262
|
-
enterNewApiUrl: "Enter new API URL (current: {url})",
|
|
263
|
-
enterNewApiKey: "Enter new API Key (current: {key})",
|
|
264
|
-
selectNewAuthType: "Select new auth type (current: {type})",
|
|
265
|
-
existingConfig: "Existing config detected. How to proceed?",
|
|
266
|
-
backupAndOverwrite: "Backup and overwrite all",
|
|
267
|
-
updateDocsOnly: "Update workflow-related md files only with backup",
|
|
268
|
-
mergeConfig: "Merge config",
|
|
269
|
-
skip: "Skip",
|
|
270
|
-
backupSuccess: "All config files backed up to",
|
|
271
|
-
copying: "Copying configuration files...",
|
|
272
|
-
configSuccess: "Config files copied to",
|
|
273
|
-
apiConfigSuccess: "API configured",
|
|
274
|
-
mcpConfigSuccess: "MCP services configured",
|
|
275
|
-
selectMcpServices: "Select MCP services to install (space to select, a to select all, i to deselect, enter to confirm)",
|
|
276
|
-
allServices: "Install all",
|
|
277
|
-
mcpServiceInstalled: "Selected MCP services",
|
|
278
|
-
enterExaApiKey: "Enter Exa API Key (get from https://dashboard.exa.ai/api-keys)",
|
|
279
|
-
skipMcp: "Skip MCP configuration",
|
|
280
|
-
configureMcp: "Configure MCP services?",
|
|
281
|
-
mcpBackupSuccess: "Original MCP config backed up",
|
|
282
|
-
complete: "\u{1F389} Setup complete! Use 'claude' command to start.",
|
|
283
|
-
error: "Error",
|
|
284
|
-
yes: "Yes",
|
|
285
|
-
no: "No",
|
|
286
|
-
cancelled: "Operation cancelled",
|
|
287
|
-
apiKeyValidation: {
|
|
288
|
-
empty: "API Key cannot be empty",
|
|
289
|
-
example: "Example format: sk-abcdef123456_789xyz"
|
|
290
|
-
},
|
|
291
|
-
noExistingConfig: "No existing configuration found. Please run `zcf` first.",
|
|
292
|
-
updatingPrompts: "Updating Claude Code prompt documents...",
|
|
293
|
-
updateConfigLangPrompt: "Select configuration language",
|
|
294
|
-
updateConfigLangChoice: {
|
|
295
|
-
"zh-CN": "Chinese configuration",
|
|
296
|
-
en: "English configuration"
|
|
297
|
-
},
|
|
298
|
-
// Menu related
|
|
299
|
-
selectFunction: "Select function",
|
|
300
|
-
enterChoice: "Enter your choice, and press enter",
|
|
301
|
-
menuOptions: {
|
|
302
|
-
fullInit: "Full initialization",
|
|
303
|
-
importWorkflow: "Import workflow",
|
|
304
|
-
configureApi: "Configure API",
|
|
305
|
-
configureMcp: "Configure MCP",
|
|
306
|
-
configureModel: "Configure default model",
|
|
307
|
-
configureAiMemory: "Configure Claude global memory",
|
|
308
|
-
configureEnvPermission: "Import recommended environment variables and permissions",
|
|
309
|
-
clearCache: "Clear preference cache",
|
|
310
|
-
changeLanguage: "Select display language / \u66F4\u6539\u663E\u793A\u8BED\u8A00",
|
|
311
|
-
exit: "Exit"
|
|
312
|
-
},
|
|
313
|
-
menuDescriptions: {
|
|
314
|
-
fullInit: "Install Claude Code + Import workflow + Configure API + Configure MCP services",
|
|
315
|
-
importWorkflow: "Import/update workflow-related files only",
|
|
316
|
-
configureApi: "Configure API URL and authentication",
|
|
317
|
-
configureMcp: "Configure MCP services (includes Windows fix)",
|
|
318
|
-
configureModel: "Set default model (opus/sonnet)",
|
|
319
|
-
configureAiMemory: "Configure AI output language and personality",
|
|
320
|
-
configureEnvPermission: "Import privacy protection environment variables and system permissions",
|
|
321
|
-
clearCache: "Clear preference language and other caches",
|
|
322
|
-
changeLanguage: "Change ZCF interface language"
|
|
323
|
-
},
|
|
324
|
-
returnToMenu: "Return to main menu?",
|
|
325
|
-
goodbye: "\u{1F44B} Thanks for using ZCF! Goodbye!",
|
|
326
|
-
// Model config
|
|
327
|
-
selectDefaultModel: "Select default model",
|
|
328
|
-
modelConfigSuccess: "Default model configured",
|
|
329
|
-
// AI memory config
|
|
330
|
-
selectMemoryOption: "Select configuration option",
|
|
331
|
-
configureAiLanguage: "Configure AI output language",
|
|
332
|
-
configureAiPersonality: "Configure AI personality",
|
|
333
|
-
aiLanguageConfigured: "AI output language configured",
|
|
334
|
-
// AI personality
|
|
335
|
-
selectAiPersonality: "Select AI personality",
|
|
336
|
-
customPersonalityHint: "Define your own personality",
|
|
337
|
-
enterCustomPersonality: "Enter custom personality description",
|
|
338
|
-
personalityConfigured: "AI personality configured",
|
|
339
|
-
existingPersonality: "Existing AI personality configuration",
|
|
340
|
-
currentPersonality: "Current personality",
|
|
341
|
-
modifyPersonality: "Modify AI personality?",
|
|
342
|
-
keepPersonality: "Keeping existing personality",
|
|
343
|
-
// Cache
|
|
344
|
-
confirmClearCache: "Confirm clear all ZCF preference cache?",
|
|
345
|
-
cacheCleared: "ZCF cache cleared",
|
|
346
|
-
noCacheFound: "No cache file found",
|
|
347
|
-
// Language
|
|
348
|
-
languageChanged: "Language changed",
|
|
349
|
-
// Windows MCP
|
|
350
|
-
fixWindowsMcp: "Fix Windows MCP Configuration",
|
|
351
|
-
fixWindowsMcpDesc: "Fix Windows platform MCP command configuration issues",
|
|
352
|
-
windowsMcpFixed: "Windows MCP configuration fixed",
|
|
353
|
-
configureMcpServices: "Configure MCP Services",
|
|
354
|
-
selectMcpOption: "Select MCP configuration option",
|
|
355
|
-
// Validation messages
|
|
356
|
-
invalidChoice: "Invalid choice. Please enter a valid option.",
|
|
357
|
-
urlRequired: "URL is required",
|
|
358
|
-
invalidUrl: "Invalid URL",
|
|
359
|
-
keyRequired: "Key is required",
|
|
360
|
-
invalidKeyFormat: "Invalid key format",
|
|
361
|
-
directiveCannotBeEmpty: "Directive cannot be empty",
|
|
362
|
-
languageRequired: "Language is required",
|
|
363
|
-
// Error messages
|
|
364
|
-
failedToSetOnboarding: "Failed to set onboarding completion flag:",
|
|
365
|
-
failedToWriteMcpConfig: "Failed to write MCP config:",
|
|
366
|
-
templateDirNotFound: "Template directory not found:",
|
|
367
|
-
failedToReadTemplateSettings: "Failed to read template settings.json:",
|
|
368
|
-
failedToMergeSettings: "Failed to merge settings.json:",
|
|
369
|
-
preservingExistingSettings: "Preserving existing settings.json due to merge error",
|
|
370
|
-
// File system errors
|
|
371
|
-
failedToReadFile: "Failed to read file:",
|
|
372
|
-
failedToWriteFile: "Failed to write file:",
|
|
373
|
-
failedToCopyFile: "Failed to copy file:",
|
|
374
|
-
failedToReadDirectory: "Failed to read directory:",
|
|
375
|
-
failedToGetStats: "Failed to get stats for:",
|
|
376
|
-
sourceDirNotExist: "Source directory does not exist:",
|
|
377
|
-
// JSON config errors
|
|
378
|
-
invalidConfiguration: "Invalid configuration, using default value",
|
|
379
|
-
failedToParseJson: "Failed to parse JSON file:",
|
|
380
|
-
failedToBackupConfig: "Failed to backup config file:",
|
|
381
|
-
// MCP errors
|
|
382
|
-
failedToAddOnboardingFlag: "Failed to add hasCompletedOnboarding flag:",
|
|
383
|
-
// AI personality errors
|
|
384
|
-
failedToApplyPersonality: "Failed to apply personality directive:",
|
|
385
|
-
// Status messages
|
|
386
|
-
notConfigured: "Not configured",
|
|
387
|
-
none: "None",
|
|
388
|
-
// CLI options
|
|
389
|
-
runFullInit: "Run full initialization directly",
|
|
390
|
-
forceOverwrite: "Force overwrite existing configuration",
|
|
391
|
-
initClaudeConfig: "Initialize Claude Code configuration",
|
|
392
|
-
updatePromptsOnly: "Update Claude Code prompts only",
|
|
393
|
-
// Environment variables and permissions
|
|
394
|
-
selectEnvPermissionOption: "Select configuration option",
|
|
395
|
-
importRecommendedEnv: "Import ZCF recommended environment variables",
|
|
396
|
-
importRecommendedEnvDesc: "Privacy protection variables, etc.",
|
|
397
|
-
importRecommendedPermissions: "Import ZCF recommended permissions",
|
|
398
|
-
importRecommendedPermissionsDesc: "Almost all permissions, reduce frequent permission requests, dangerous ops limited by rules",
|
|
399
|
-
openSettingsJson: "Open settings.json for manual configuration",
|
|
400
|
-
openSettingsJsonDesc: "Advanced user customization",
|
|
401
|
-
envImportSuccess: "Environment variables imported",
|
|
402
|
-
permissionsImportSuccess: "Permissions imported",
|
|
403
|
-
openingSettingsJson: "Opening settings.json...",
|
|
404
|
-
// Misc
|
|
405
|
-
spaceToSelectReturn: "- Space to select. Return to submit",
|
|
406
|
-
// Windows detection
|
|
407
|
-
windowsDetected: "Windows detected, will configure compatible format"
|
|
408
|
-
}
|
|
409
|
-
};
|
|
643
|
+
const I18N = translations;
|
|
410
644
|
const MCP_SERVICES = [
|
|
411
645
|
{
|
|
412
646
|
id: "context7",
|
|
@@ -630,7 +864,14 @@ function backupJsonConfig(path, backupDir) {
|
|
|
630
864
|
}
|
|
631
865
|
|
|
632
866
|
function readZcfConfig() {
|
|
633
|
-
|
|
867
|
+
let config = readJsonConfig(ZCF_CONFIG_FILE);
|
|
868
|
+
if (!config && existsSync(LEGACY_ZCF_CONFIG_FILE)) {
|
|
869
|
+
config = readJsonConfig(LEGACY_ZCF_CONFIG_FILE);
|
|
870
|
+
}
|
|
871
|
+
return config;
|
|
872
|
+
}
|
|
873
|
+
async function readZcfConfigAsync() {
|
|
874
|
+
return readZcfConfig();
|
|
634
875
|
}
|
|
635
876
|
function writeZcfConfig(config) {
|
|
636
877
|
try {
|
|
@@ -928,21 +1169,9 @@ function copyConfigFiles(lang, onlyMd = false) {
|
|
|
928
1169
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
929
1170
|
const distDir = dirname(dirname(currentFilePath));
|
|
930
1171
|
const rootDir = dirname(distDir);
|
|
931
|
-
const sourceDir = join(rootDir, "templates", lang);
|
|
932
1172
|
const baseTemplateDir = join(rootDir, "templates");
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
936
|
-
if (onlyMd) {
|
|
937
|
-
const mdFilter = (path, stats) => {
|
|
938
|
-
return stats.isDirectory() || path.endsWith(".md");
|
|
939
|
-
};
|
|
940
|
-
copyDir(sourceDir, CLAUDE_DIR, { filter: mdFilter });
|
|
941
|
-
} else {
|
|
942
|
-
const filter = (path) => {
|
|
943
|
-
return !path.endsWith("settings.json");
|
|
944
|
-
};
|
|
945
|
-
copyDir(sourceDir, CLAUDE_DIR, { filter });
|
|
1173
|
+
copyClaudeMemoryFiles(lang, rootDir);
|
|
1174
|
+
if (!onlyMd) {
|
|
946
1175
|
const baseSettingsPath = join(baseTemplateDir, "settings.json");
|
|
947
1176
|
const destSettingsPath = join(CLAUDE_DIR, "settings.json");
|
|
948
1177
|
if (exists(baseSettingsPath)) {
|
|
@@ -955,6 +1184,21 @@ function copyConfigFiles(lang, onlyMd = false) {
|
|
|
955
1184
|
copyFile(claudeMdSource, claudeMdDest);
|
|
956
1185
|
}
|
|
957
1186
|
}
|
|
1187
|
+
function copyClaudeMemoryFiles(lang, rootDir) {
|
|
1188
|
+
const memorySourceDir = join(rootDir, "templates", lang, "memory");
|
|
1189
|
+
if (!exists(memorySourceDir)) {
|
|
1190
|
+
const i18n = I18N[lang];
|
|
1191
|
+
throw new Error(`${i18n.memoryDirNotFound || "Memory directory not found:"} ${memorySourceDir}`);
|
|
1192
|
+
}
|
|
1193
|
+
const files = readDir(memorySourceDir);
|
|
1194
|
+
files?.forEach((file) => {
|
|
1195
|
+
if (file.endsWith(".md")) {
|
|
1196
|
+
const sourcePath = join(memorySourceDir, file);
|
|
1197
|
+
const destPath = join(CLAUDE_DIR, file);
|
|
1198
|
+
copyFile(sourcePath, destPath);
|
|
1199
|
+
}
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
958
1202
|
function getDefaultSettings() {
|
|
959
1203
|
try {
|
|
960
1204
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
@@ -1531,7 +1775,7 @@ async function selectMcpServices(scriptLang) {
|
|
|
1531
1775
|
const { services } = await inquirer.prompt({
|
|
1532
1776
|
type: "checkbox",
|
|
1533
1777
|
name: "services",
|
|
1534
|
-
message: i18n.selectMcpServices
|
|
1778
|
+
message: `${i18n.selectMcpServices}${i18n.multiSelectHint}`,
|
|
1535
1779
|
choices
|
|
1536
1780
|
});
|
|
1537
1781
|
if (services === void 0) {
|
|
@@ -1541,6 +1785,192 @@ async function selectMcpServices(scriptLang) {
|
|
|
1541
1785
|
return services;
|
|
1542
1786
|
}
|
|
1543
1787
|
|
|
1788
|
+
const WORKFLOW_CONFIGS = [
|
|
1789
|
+
{
|
|
1790
|
+
id: "sixStepsWorkflow",
|
|
1791
|
+
nameKey: "workflowOption.sixStepsWorkflow",
|
|
1792
|
+
descriptionKey: "workflowDescription.sixStepsWorkflow",
|
|
1793
|
+
defaultSelected: true,
|
|
1794
|
+
order: 1,
|
|
1795
|
+
commands: ["workflow.md"],
|
|
1796
|
+
agents: [],
|
|
1797
|
+
autoInstallAgents: false,
|
|
1798
|
+
category: "sixStep",
|
|
1799
|
+
outputDir: "workflow"
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
id: "featPlanUx",
|
|
1803
|
+
nameKey: "workflowOption.featPlanUx",
|
|
1804
|
+
descriptionKey: "workflowDescription.featPlanUx",
|
|
1805
|
+
defaultSelected: true,
|
|
1806
|
+
order: 2,
|
|
1807
|
+
commands: ["feat.md"],
|
|
1808
|
+
agents: [
|
|
1809
|
+
{ id: "planner", filename: "planner.md", required: true },
|
|
1810
|
+
{ id: "ui-ux-designer", filename: "ui-ux-designer.md", required: true }
|
|
1811
|
+
],
|
|
1812
|
+
autoInstallAgents: true,
|
|
1813
|
+
category: "plan",
|
|
1814
|
+
outputDir: "feat"
|
|
1815
|
+
},
|
|
1816
|
+
{
|
|
1817
|
+
id: "bmadWorkflow",
|
|
1818
|
+
nameKey: "workflowOption.bmadWorkflow",
|
|
1819
|
+
descriptionKey: "workflowDescription.bmadWorkflow",
|
|
1820
|
+
defaultSelected: true,
|
|
1821
|
+
order: 3,
|
|
1822
|
+
commands: ["bmad-init.md"],
|
|
1823
|
+
agents: [],
|
|
1824
|
+
autoInstallAgents: false,
|
|
1825
|
+
category: "bmad",
|
|
1826
|
+
outputDir: "bmad"
|
|
1827
|
+
}
|
|
1828
|
+
];
|
|
1829
|
+
function getWorkflowConfig(workflowId) {
|
|
1830
|
+
return WORKFLOW_CONFIGS.find((config) => config.id === workflowId);
|
|
1831
|
+
}
|
|
1832
|
+
function getOrderedWorkflows() {
|
|
1833
|
+
return [...WORKFLOW_CONFIGS].sort((a, b) => a.order - b.order);
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
function getRootDir() {
|
|
1837
|
+
const currentFilePath = fileURLToPath(import.meta.url);
|
|
1838
|
+
const distDir = dirname(dirname(currentFilePath));
|
|
1839
|
+
return dirname(distDir);
|
|
1840
|
+
}
|
|
1841
|
+
async function selectAndInstallWorkflows(configLang, scriptLang) {
|
|
1842
|
+
const i18n = I18N[scriptLang];
|
|
1843
|
+
const workflows = getOrderedWorkflows();
|
|
1844
|
+
const choices = workflows.map((workflow) => {
|
|
1845
|
+
const nameKey = workflow.id;
|
|
1846
|
+
const name = i18n.workflowOption[nameKey] || workflow.id;
|
|
1847
|
+
return {
|
|
1848
|
+
name,
|
|
1849
|
+
value: workflow.id,
|
|
1850
|
+
checked: workflow.defaultSelected
|
|
1851
|
+
};
|
|
1852
|
+
});
|
|
1853
|
+
const { selectedWorkflows } = await inquirer.prompt({
|
|
1854
|
+
type: "checkbox",
|
|
1855
|
+
name: "selectedWorkflows",
|
|
1856
|
+
message: `${i18n.selectWorkflowType}${i18n.multiSelectHint}`,
|
|
1857
|
+
choices
|
|
1858
|
+
});
|
|
1859
|
+
if (!selectedWorkflows || selectedWorkflows.length === 0) {
|
|
1860
|
+
console.log(ansis.yellow(i18n.cancelled));
|
|
1861
|
+
return;
|
|
1862
|
+
}
|
|
1863
|
+
await cleanupOldVersionFiles(scriptLang);
|
|
1864
|
+
for (const workflowId of selectedWorkflows) {
|
|
1865
|
+
const config = getWorkflowConfig(workflowId);
|
|
1866
|
+
if (config) {
|
|
1867
|
+
await installWorkflowWithDependencies(config, configLang, scriptLang);
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
async function installWorkflowWithDependencies(config, configLang, scriptLang) {
|
|
1872
|
+
const rootDir = getRootDir();
|
|
1873
|
+
const i18n = I18N[scriptLang];
|
|
1874
|
+
const result = {
|
|
1875
|
+
workflow: config.id,
|
|
1876
|
+
success: true,
|
|
1877
|
+
installedCommands: [],
|
|
1878
|
+
installedAgents: [],
|
|
1879
|
+
errors: []
|
|
1880
|
+
};
|
|
1881
|
+
const workflowName = i18n.workflowOption[config.id] || config.id;
|
|
1882
|
+
console.log(ansis.cyan(`
|
|
1883
|
+
\u{1F4E6} ${i18n.installingWorkflow}: ${workflowName}...`));
|
|
1884
|
+
const commandsDir = join(CLAUDE_DIR, "commands", "zcf");
|
|
1885
|
+
if (!existsSync(commandsDir)) {
|
|
1886
|
+
await mkdir(commandsDir, { recursive: true });
|
|
1887
|
+
}
|
|
1888
|
+
for (const commandFile of config.commands) {
|
|
1889
|
+
const commandSource = join(rootDir, "templates", configLang, "workflow", config.category, "commands", commandFile);
|
|
1890
|
+
const destFileName = commandFile;
|
|
1891
|
+
const commandDest = join(commandsDir, destFileName);
|
|
1892
|
+
if (existsSync(commandSource)) {
|
|
1893
|
+
try {
|
|
1894
|
+
await copyFile$1(commandSource, commandDest);
|
|
1895
|
+
result.installedCommands.push(destFileName);
|
|
1896
|
+
console.log(ansis.gray(` \u2714 ${i18n.installedCommand}: zcf/${destFileName}`));
|
|
1897
|
+
} catch (error) {
|
|
1898
|
+
const errorMsg = `${i18n.failedToInstallCommand} ${commandFile}: ${error}`;
|
|
1899
|
+
result.errors?.push(errorMsg);
|
|
1900
|
+
console.error(ansis.red(` \u2717 ${errorMsg}`));
|
|
1901
|
+
result.success = false;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
if (config.autoInstallAgents && config.agents.length > 0) {
|
|
1906
|
+
const agentsCategoryDir = join(CLAUDE_DIR, "agents", "zcf", config.category);
|
|
1907
|
+
if (!existsSync(agentsCategoryDir)) {
|
|
1908
|
+
await mkdir(agentsCategoryDir, { recursive: true });
|
|
1909
|
+
}
|
|
1910
|
+
for (const agent of config.agents) {
|
|
1911
|
+
const agentSource = join(rootDir, "templates", configLang, "workflow", config.category, "agents", agent.filename);
|
|
1912
|
+
const agentDest = join(agentsCategoryDir, agent.filename);
|
|
1913
|
+
if (existsSync(agentSource)) {
|
|
1914
|
+
try {
|
|
1915
|
+
await copyFile$1(agentSource, agentDest);
|
|
1916
|
+
result.installedAgents.push(agent.filename);
|
|
1917
|
+
console.log(ansis.gray(` \u2714 ${i18n.installedAgent}: zcf/${config.category}/${agent.filename}`));
|
|
1918
|
+
} catch (error) {
|
|
1919
|
+
const errorMsg = `${i18n.failedToInstallAgent} ${agent.filename}: ${error}`;
|
|
1920
|
+
result.errors?.push(errorMsg);
|
|
1921
|
+
console.error(ansis.red(` \u2717 ${errorMsg}`));
|
|
1922
|
+
if (agent.required) {
|
|
1923
|
+
result.success = false;
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
if (result.success) {
|
|
1930
|
+
console.log(ansis.green(`\u2714 ${workflowName} ${i18n.workflowInstallSuccess}`));
|
|
1931
|
+
if (config.id === "bmadWorkflow") {
|
|
1932
|
+
console.log(ansis.cyan(`
|
|
1933
|
+
${i18n.bmadInitPrompt}`));
|
|
1934
|
+
}
|
|
1935
|
+
} else {
|
|
1936
|
+
console.log(ansis.red(`\u2717 ${workflowName} ${i18n.workflowInstallError}`));
|
|
1937
|
+
}
|
|
1938
|
+
return result;
|
|
1939
|
+
}
|
|
1940
|
+
async function cleanupOldVersionFiles(scriptLang) {
|
|
1941
|
+
const i18n = I18N[scriptLang];
|
|
1942
|
+
console.log(ansis.cyan(`
|
|
1943
|
+
\u{1F9F9} ${i18n.cleaningOldFiles || "Cleaning up old version files"}...`));
|
|
1944
|
+
const oldCommandFiles = [
|
|
1945
|
+
join(CLAUDE_DIR, "commands", "workflow.md"),
|
|
1946
|
+
join(CLAUDE_DIR, "commands", "feat.md")
|
|
1947
|
+
];
|
|
1948
|
+
const oldAgentFiles = [
|
|
1949
|
+
join(CLAUDE_DIR, "agents", "planner.md"),
|
|
1950
|
+
join(CLAUDE_DIR, "agents", "ui-ux-designer.md")
|
|
1951
|
+
];
|
|
1952
|
+
for (const file of oldCommandFiles) {
|
|
1953
|
+
if (existsSync(file)) {
|
|
1954
|
+
try {
|
|
1955
|
+
await rm(file, { force: true });
|
|
1956
|
+
console.log(ansis.gray(` \u2714 ${i18n.removedOldFile || "Removed old file"}: ${file.replace(CLAUDE_DIR, "~/.claude")}`));
|
|
1957
|
+
} catch (error) {
|
|
1958
|
+
console.error(ansis.yellow(` \u26A0 ${i18n.failedToRemoveFile || "Failed to remove"}: ${file.replace(CLAUDE_DIR, "~/.claude")}`));
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
for (const file of oldAgentFiles) {
|
|
1963
|
+
if (existsSync(file)) {
|
|
1964
|
+
try {
|
|
1965
|
+
await rm(file, { force: true });
|
|
1966
|
+
console.log(ansis.gray(` \u2714 ${i18n.removedOldFile || "Removed old file"}: ${file.replace(CLAUDE_DIR, "~/.claude")}`));
|
|
1967
|
+
} catch (error) {
|
|
1968
|
+
console.error(ansis.yellow(` \u26A0 ${i18n.failedToRemoveFile || "Failed to remove"}: ${file.replace(CLAUDE_DIR, "~/.claude")}`));
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1544
1974
|
async function init(options = {}) {
|
|
1545
1975
|
try {
|
|
1546
1976
|
if (!options.skipBanner) {
|
|
@@ -1692,8 +2122,10 @@ async function init(options = {}) {
|
|
|
1692
2122
|
}
|
|
1693
2123
|
if (action === "docs-only") {
|
|
1694
2124
|
copyConfigFiles(configLang, true);
|
|
2125
|
+
await selectAndInstallWorkflows(configLang, scriptLang);
|
|
1695
2126
|
} else if (["backup", "merge", "new"].includes(action)) {
|
|
1696
2127
|
copyConfigFiles(configLang, false);
|
|
2128
|
+
await selectAndInstallWorkflows(configLang, scriptLang);
|
|
1697
2129
|
}
|
|
1698
2130
|
applyAiLanguageDirective(aiOutputLang);
|
|
1699
2131
|
await configureAiPersonality(scriptLang);
|
|
@@ -1862,4 +2294,4 @@ async function openSettingsJson() {
|
|
|
1862
2294
|
}
|
|
1863
2295
|
}
|
|
1864
2296
|
|
|
1865
|
-
export { AI_OUTPUT_LANGUAGES as A,
|
|
2297
|
+
export { handleGeneralError as $, AI_OUTPUT_LANGUAGES as A, backupMcpConfig as B, CLAUDE_DIR as C, mergeMcpServers as D, buildMcpServerConfig as E, fixWindowsMcpConfig as F, addCompletedOnboarding as G, updateZcfConfig as H, I18N as I, readZcfConfig as J, resolveAiOutputLanguage as K, LEGACY_ZCF_CONFIG_FILE as L, MCP_SERVICES as M, configureAiPersonality as N, isWindows as O, selectMcpServices as P, formatApiKeyDisplay as Q, modifyApiConfigPartially as R, SETTINGS_FILE as S, validateApiKey as T, displayBanner as U, selectScriptLanguage as V, updatePromptOnly as W, selectAndInstallWorkflows as X, version as Y, ZCF_CONFIG_FILE as Z, handleExitPromptError as _, importRecommendedEnv as a, displayBannerWithInfo as a0, readZcfConfigAsync as a1, importRecommendedPermissions as b, commandExists as c, cleanupPermissions as d, CLAUDE_MD_FILE as e, ClAUDE_CONFIG_FILE as f, getPlatform as g, SUPPORTED_LANGS as h, init as i, LANG_LABELS as j, isClaudeCodeInstalled as k, installClaudeCode as l, mergeAndCleanPermissions as m, ensureClaudeDir as n, openSettingsJson as o, backupExistingConfig as p, copyConfigFiles as q, configureApi as r, mergeConfigs as s, mergeSettingsFile as t, updateDefaultModel as u, getExistingApiConfig as v, applyAiLanguageDirective as w, getMcpConfigPath as x, readMcpConfig as y, writeMcpConfig as z };
|