aico-cli 0.1.1 → 0.1.2
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/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { J as readAicoConfig, K as updateAicoConfig, N as getTranslation, k as AI_OUTPUT_LANGUAGES, O as inquirer, P as addNumbersToChoices, Q as version, q as backupExistingConfig, r as copyConfigFiles, x as applyAiLanguageDirective, R as configureAiPersonality, C as CLAUDE_DIR, I as I18N, T as readCcrConfig, U as isCcrInstalled, V as installCcr, W as configureCcrFeature, X as handleExitPromptError, Y as handleGeneralError, Z as readAicoConfigAsync, _ as COMETIX_COMMANDS, $ as COMETIX_COMMAND_NAME, a0 as installCometixLine, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, a1 as isWindows, z as readMcpConfig, G as fixWindowsMcpConfig, B as writeMcpConfig, a2 as selectMcpServices, D as backupMcpConfig, M as MCP_SERVICES, F as buildMcpServerConfig, a3 as EscapeKeyPressed, E as mergeMcpServers, a4 as displayBanner, a5 as selectAndInstallWorkflows, a6 as displayBannerWithInfo, i as init, a7 as executeWithEscapeSupport, a8 as checkAndUpdateTools } from './shared/aico-cli.
|
|
4
|
+
import { J as readAicoConfig, K as updateAicoConfig, N as getTranslation, k as AI_OUTPUT_LANGUAGES, O as inquirer, P as addNumbersToChoices, Q as version, q as backupExistingConfig, r as copyConfigFiles, x as applyAiLanguageDirective, R as configureAiPersonality, C as CLAUDE_DIR, I as I18N, T as readCcrConfig, U as isCcrInstalled, V as installCcr, W as configureCcrFeature, X as handleExitPromptError, Y as handleGeneralError, Z as readAicoConfigAsync, _ as COMETIX_COMMANDS, $ as COMETIX_COMMAND_NAME, a0 as installCometixLine, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, a1 as isWindows, z as readMcpConfig, G as fixWindowsMcpConfig, B as writeMcpConfig, a2 as selectMcpServices, D as backupMcpConfig, M as MCP_SERVICES, F as buildMcpServerConfig, a3 as EscapeKeyPressed, E as mergeMcpServers, a4 as displayBanner, a5 as selectAndInstallWorkflows, a6 as displayBannerWithInfo, i as init, a7 as executeWithEscapeSupport, a8 as checkAndUpdateTools } from './shared/aico-cli.BM5W68Yb.mjs';
|
|
5
5
|
import inquirer$1 from 'inquirer';
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
7
7
|
import { x } from 'tinyexec';
|
|
@@ -906,45 +906,44 @@ async function showMainMenu() {
|
|
|
906
906
|
},
|
|
907
907
|
"2": {
|
|
908
908
|
key: "2",
|
|
909
|
-
labelKey: "
|
|
910
|
-
processor: () =>
|
|
909
|
+
labelKey: "configureCCR",
|
|
910
|
+
processor: () => configureCCR(scriptLang),
|
|
911
911
|
section: "\u57FA\u7840\u914D\u7F6E"
|
|
912
912
|
},
|
|
913
913
|
"3": {
|
|
914
914
|
key: "3",
|
|
915
|
-
labelKey: "
|
|
916
|
-
processor: () =>
|
|
915
|
+
labelKey: "startCodeEditor",
|
|
916
|
+
processor: () => startClaudeCodeEditor(scriptLang),
|
|
917
917
|
section: "\u57FA\u7840\u914D\u7F6E"
|
|
918
918
|
},
|
|
919
|
-
// 个性化配置 - 放在后面
|
|
920
919
|
"4": {
|
|
921
920
|
key: "4",
|
|
922
|
-
labelKey: "
|
|
923
|
-
processor: () =>
|
|
924
|
-
section: "\
|
|
921
|
+
labelKey: "updateVersion",
|
|
922
|
+
processor: () => updateAicoCli(),
|
|
923
|
+
section: "\u57FA\u7840\u914D\u7F6E"
|
|
925
924
|
},
|
|
926
925
|
"5": {
|
|
927
926
|
key: "5",
|
|
928
|
-
labelKey: "
|
|
929
|
-
processor: () =>
|
|
927
|
+
labelKey: "configureMcp",
|
|
928
|
+
processor: () => configureMcpFeature(scriptLang),
|
|
930
929
|
section: "\u4E2A\u6027\u5316\u914D\u7F6E"
|
|
931
930
|
},
|
|
932
931
|
"6": {
|
|
933
932
|
key: "6",
|
|
934
|
-
labelKey: "
|
|
935
|
-
processor: () =>
|
|
933
|
+
labelKey: "configureAiMemory",
|
|
934
|
+
processor: () => configureAiMemoryFeature(scriptLang),
|
|
936
935
|
section: "\u4E2A\u6027\u5316\u914D\u7F6E"
|
|
937
936
|
},
|
|
938
937
|
"7": {
|
|
939
938
|
key: "7",
|
|
940
|
-
labelKey: "
|
|
941
|
-
processor: () =>
|
|
939
|
+
labelKey: "configureEnvPermission",
|
|
940
|
+
processor: () => configureEnvPermissionFeature(scriptLang),
|
|
942
941
|
section: "\u4E2A\u6027\u5316\u914D\u7F6E"
|
|
943
942
|
},
|
|
944
943
|
"8": {
|
|
945
944
|
key: "8",
|
|
946
|
-
labelKey: "
|
|
947
|
-
processor: () =>
|
|
945
|
+
labelKey: "importWorkflow",
|
|
946
|
+
processor: () => update({ skipBanner: true }),
|
|
948
947
|
section: "\u4E2A\u6027\u5316\u914D\u7F6E"
|
|
949
948
|
},
|
|
950
949
|
"9": {
|
package/dist/index.d.mts
CHANGED
|
@@ -87,7 +87,7 @@ interface InitOptions {
|
|
|
87
87
|
skipBanner?: boolean;
|
|
88
88
|
skipPrompt?: boolean;
|
|
89
89
|
configAction?: 'new' | 'backup' | 'merge' | 'docs-only' | 'skip';
|
|
90
|
-
apiType?: 'auth_token' | '
|
|
90
|
+
apiType?: 'auth_token' | 'ccr_proxy' | 'skip';
|
|
91
91
|
apiKey?: string;
|
|
92
92
|
apiUrl?: string;
|
|
93
93
|
mcpServices?: string[] | string | boolean;
|
|
@@ -110,7 +110,6 @@ declare function installClaudeCode(lang: SupportedLang): Promise<void>;
|
|
|
110
110
|
interface ApiConfig {
|
|
111
111
|
url: string;
|
|
112
112
|
key: string;
|
|
113
|
-
authType?: 'auth_token' | 'api_key';
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
declare function ensureClaudeDir(): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ interface InitOptions {
|
|
|
87
87
|
skipBanner?: boolean;
|
|
88
88
|
skipPrompt?: boolean;
|
|
89
89
|
configAction?: 'new' | 'backup' | 'merge' | 'docs-only' | 'skip';
|
|
90
|
-
apiType?: 'auth_token' | '
|
|
90
|
+
apiType?: 'auth_token' | 'ccr_proxy' | 'skip';
|
|
91
91
|
apiKey?: string;
|
|
92
92
|
apiUrl?: string;
|
|
93
93
|
mcpServices?: string[] | string | boolean;
|
|
@@ -110,7 +110,6 @@ declare function installClaudeCode(lang: SupportedLang): Promise<void>;
|
|
|
110
110
|
interface ApiConfig {
|
|
111
111
|
url: string;
|
|
112
112
|
key: string;
|
|
113
|
-
authType?: 'auth_token' | 'api_key';
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
declare function ensureClaudeDir(): void;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AICO_CONFIG_FILE, k as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, j as LANG_LABELS, L as LEGACY_AICO_CONFIG_FILE, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, H as addCompletedOnboarding, x as applyAiLanguageDirective, q as backupExistingConfig, D as backupMcpConfig, F as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, s as configureApi, r as copyConfigFiles, p as ensureClaudeDir, G as fixWindowsMcpConfig, w as getExistingApiConfig, y as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, n as installClaudeCode, l as isClaudeCodeInstalled, m as mergeAndCleanPermissions, t as mergeConfigs, E as mergeMcpServers, v as mergeSettingsFile, o as openSettingsJson, z as readMcpConfig, u as updateDefaultModel, B as writeMcpConfig } from './shared/aico-cli.
|
|
1
|
+
export { A as AICO_CONFIG_FILE, k as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, j as LANG_LABELS, L as LEGACY_AICO_CONFIG_FILE, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, H as addCompletedOnboarding, x as applyAiLanguageDirective, q as backupExistingConfig, D as backupMcpConfig, F as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, s as configureApi, r as copyConfigFiles, p as ensureClaudeDir, G as fixWindowsMcpConfig, w as getExistingApiConfig, y as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, n as installClaudeCode, l as isClaudeCodeInstalled, m as mergeAndCleanPermissions, t as mergeConfigs, E as mergeMcpServers, v as mergeSettingsFile, o as openSettingsJson, z as readMcpConfig, u as updateDefaultModel, B as writeMcpConfig } from './shared/aico-cli.BM5W68Yb.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
4
|
import 'node:fs';
|
|
@@ -14,7 +14,7 @@ import ora from 'ora';
|
|
|
14
14
|
import { exec } from 'tinyexec';
|
|
15
15
|
import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
|
|
16
16
|
|
|
17
|
-
const version = "0.1.
|
|
17
|
+
const version = "0.1.2";
|
|
18
18
|
|
|
19
19
|
const common$1 = {
|
|
20
20
|
// Basic
|
|
@@ -71,45 +71,39 @@ const installation$1 = {
|
|
|
71
71
|
|
|
72
72
|
const api$1 = {
|
|
73
73
|
// Basic API configuration
|
|
74
|
-
configureApi: "\
|
|
75
|
-
useAuthToken: "\u4F7F\u7528 Auth Token
|
|
74
|
+
configureApi: "\u914D\u7F6E API",
|
|
75
|
+
useAuthToken: "\u4F7F\u7528 Auth Token",
|
|
76
76
|
authTokenDesc: "\u9002\u7528\u4E8E\u901A\u8FC7 OAuth \u6216\u6D4F\u89C8\u5668\u767B\u5F55\u83B7\u53D6\u7684\u4EE4\u724C",
|
|
77
|
-
useApiKey: "\u4F7F\u7528 API Key (\u5BC6\u94A5\u8BA4\u8BC1)",
|
|
78
|
-
apiKeyDesc: "\u9002\u7528\u4E8E\u4ECE Anthropic Console \u83B7\u53D6\u7684 API \u5BC6\u94A5",
|
|
79
77
|
useCcrProxy: "\u4F7F\u7528 CCR \u4EE3\u7406",
|
|
80
78
|
ccrProxyDesc: "\u901A\u8FC7 Claude Code Router \u4F7F\u7528\u591A\u4E2A AI \u6A21\u578B",
|
|
81
79
|
skipApi: "\u8DF3\u8FC7\uFF08\u7A0D\u540E\u624B\u52A8\u914D\u7F6E\uFF09",
|
|
82
80
|
enterApiUrl: "\u8BF7\u8F93\u5165 API URL",
|
|
83
81
|
enterAuthToken: "\u8BF7\u8F93\u5165 Auth Token",
|
|
84
|
-
enterApiKey: "\u8BF7\u8F93\u5165 API Key",
|
|
85
82
|
apiConfigSuccess: "API \u914D\u7F6E\u5B8C\u6210",
|
|
86
83
|
// API modification
|
|
87
84
|
existingApiConfig: "\u68C0\u6D4B\u5230\u5DF2\u6709 API \u914D\u7F6E\uFF1A",
|
|
88
85
|
apiConfigUrl: "URL",
|
|
89
|
-
apiConfigKey: "
|
|
90
|
-
apiConfigAuthType: "\u8BA4\u8BC1\u7C7B\u578B",
|
|
86
|
+
apiConfigKey: "Auth Token",
|
|
91
87
|
selectApiAction: "\u8BF7\u9009\u62E9API\u5904\u7406\u64CD\u4F5C",
|
|
92
88
|
keepExistingConfig: "\u4FDD\u7559\u73B0\u6709\u914D\u7F6E",
|
|
93
89
|
modifyAllConfig: "\u4FEE\u6539\u5168\u90E8\u914D\u7F6E",
|
|
94
90
|
modifyPartialConfig: "\u4FEE\u6539\u90E8\u5206\u914D\u7F6E",
|
|
95
91
|
selectModifyItems: "\u8BF7\u9009\u62E9\u8981\u4FEE\u6539\u7684\u9879",
|
|
96
92
|
modifyApiUrl: "\u4FEE\u6539 API URL",
|
|
97
|
-
modifyApiKey: "\u4FEE\u6539
|
|
98
|
-
modifyAuthType: "\u4FEE\u6539\u8BA4\u8BC1\u7C7B\u578B",
|
|
93
|
+
modifyApiKey: "\u4FEE\u6539 Auth Token",
|
|
99
94
|
continueModification: "\u662F\u5426\u7EE7\u7EED\u4FEE\u6539\u5176\u4ED6\u914D\u7F6E\uFF1F",
|
|
100
95
|
modificationSaved: "\u914D\u7F6E\u5DF2\u4FDD\u5B58",
|
|
101
96
|
enterNewApiUrl: "\u8BF7\u8F93\u5165\u65B0\u7684 API URL\uFF08\u5F53\u524D\uFF1A{url}\uFF09",
|
|
102
|
-
enterNewApiKey: "\u8BF7\u8F93\u5165\u65B0\u7684
|
|
103
|
-
selectNewAuthType: "\u9009\u62E9\u65B0\u7684\u8BA4\u8BC1\u7C7B\u578B\uFF08\u5F53\u524D\uFF1A{type}\uFF09",
|
|
97
|
+
enterNewApiKey: "\u8BF7\u8F93\u5165\u65B0\u7684 Auth Token\uFF08\u5F53\u524D\uFF1A{key}\uFF09",
|
|
104
98
|
// API validation
|
|
105
99
|
apiKeyValidation: {
|
|
106
|
-
empty: "
|
|
100
|
+
empty: "Auth Token \u4E0D\u80FD\u4E3A\u7A7A",
|
|
107
101
|
example: "\u793A\u4F8B\u683C\u5F0F: sk-abcdef123456_789xyz"
|
|
108
102
|
},
|
|
109
103
|
urlRequired: "URL \u4E3A\u5FC5\u586B\u9879",
|
|
110
104
|
invalidUrl: "\u65E0\u6548\u7684 URL",
|
|
111
|
-
keyRequired: "\
|
|
112
|
-
invalidKeyFormat: "\u65E0\u6548\u7684\
|
|
105
|
+
keyRequired: "Auth Token \u4E3A\u5FC5\u586B\u9879",
|
|
106
|
+
invalidKeyFormat: "\u65E0\u6548\u7684 Auth Token \u683C\u5F0F"
|
|
113
107
|
};
|
|
114
108
|
|
|
115
109
|
const configuration$1 = {
|
|
@@ -195,7 +189,7 @@ const menu$1 = {
|
|
|
195
189
|
otherTools: "\u5176\u4ED6\u5DE5\u5177"
|
|
196
190
|
},
|
|
197
191
|
menuOptions: {
|
|
198
|
-
fullInit: "\
|
|
192
|
+
fullInit: "\u542F\u52A8\u516C\u53F8\u914D\u7F6E",
|
|
199
193
|
importWorkflow: "\u5BFC\u5165\u5DE5\u4F5C\u6D41",
|
|
200
194
|
configureApiOrCcr: "\u914D\u7F6E API \u6216 CCR \u4EE3\u7406",
|
|
201
195
|
configureApi: "\u914D\u7F6E API",
|
|
@@ -203,15 +197,15 @@ const menu$1 = {
|
|
|
203
197
|
configureModel: "\u914D\u7F6E\u9ED8\u8BA4\u6A21\u578B",
|
|
204
198
|
configureAiMemory: "\u914D\u7F6E\u5168\u5C40\u8BB0\u5FC6",
|
|
205
199
|
configureEnvPermission: "\u5BFC\u5165\u63A8\u8350\u73AF\u5883\u53D8\u91CF\u548C\u6743\u9650\u914D\u7F6E",
|
|
206
|
-
startCodeEditor: "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91",
|
|
200
|
+
startCodeEditor: "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668",
|
|
207
201
|
updateVersion: "\u66F4\u65B0\u7248\u672C",
|
|
208
|
-
configureCCR: "\
|
|
202
|
+
configureCCR: "\u542F\u52A8\u4E2A\u4EBA\u914D\u7F6E",
|
|
209
203
|
configureCCUsage: "Claude Code \u7528\u91CF\u5206\u6790",
|
|
210
|
-
configureCCometixLine: "\u914D\u7F6E
|
|
204
|
+
configureCCometixLine: "\u914D\u7F6E\u4EE3\u7801\u7F16\u8F91\u5668\u7684\u72B6\u6001\u680F",
|
|
211
205
|
exit: "\u9000\u51FA"
|
|
212
206
|
},
|
|
213
207
|
menuDescriptions: {
|
|
214
|
-
fullInit: "\
|
|
208
|
+
fullInit: "\u4E00\u952E\u4F7F\u7528\u5B8C\u6574\u7684\u516C\u53F8\u914D\u7F6E\u670D\u52A1",
|
|
215
209
|
importWorkflow: "\u4EC5\u5BFC\u5165/\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173\u6587\u4EF6",
|
|
216
210
|
configureApiOrCcr: "\u914D\u7F6E API URL\u3001\u8BA4\u8BC1\u4FE1\u606F\u6216 CCR \u4EE3\u7406",
|
|
217
211
|
configureApi: "\u914D\u7F6E API URL \u548C\u8BA4\u8BC1\u4FE1\u606F",
|
|
@@ -219,11 +213,11 @@ const menu$1 = {
|
|
|
219
213
|
configureModel: "\u8BBE\u7F6E\u9ED8\u8BA4\u6A21\u578B\uFF08opus/sonnet\uFF09",
|
|
220
214
|
configureAiMemory: "\u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00\u548C\u89D2\u8272\u98CE\u683C",
|
|
221
215
|
configureEnvPermission: "\u5BFC\u5165\u9690\u79C1\u4FDD\u62A4\u73AF\u5883\u53D8\u91CF\u548C\u7CFB\u7EDF\u6743\u9650\u914D\u7F6E",
|
|
222
|
-
startCodeEditor: "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\u8FDB\u884C\u4EE3\u7801\u5F00\u53D1",
|
|
223
|
-
updateVersion: "\u66F4\u65B0
|
|
224
|
-
configureCCR: "\u914D\u7F6E
|
|
216
|
+
startCodeEditor: "\u4E00\u952E\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\u8FDB\u884C\u4EE3\u7801\u5F00\u53D1",
|
|
217
|
+
updateVersion: "\u66F4\u65B0 \u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382 \u5230\u6700\u65B0\u7248\u672C",
|
|
218
|
+
configureCCR: "\u4E00\u952E\u914D\u7F6E\u4E2A\u4EBA\u672C\u5730\u6A21\u578B\u914D\u7F6E\u670D\u52A1",
|
|
225
219
|
configureCCUsage: "\u5206\u6790 Claude Code \u4F7F\u7528\u60C5\u51B5\u548C\u7EDF\u8BA1\u4FE1\u606F",
|
|
226
|
-
configureCCometixLine: "\
|
|
220
|
+
configureCCometixLine: "\u5BF9\u4EE3\u7801\u7F16\u8F91\u5668\u72B6\u6001\u680F\u8FDB\u884C\u914D\u7F6E",
|
|
227
221
|
exit: "\u9000\u51FA\u7A0B\u5E8F"
|
|
228
222
|
}
|
|
229
223
|
};
|
|
@@ -330,7 +324,6 @@ const errors$1 = {
|
|
|
330
324
|
failedToBackupConfig: "\u5907\u4EFD\u914D\u7F6E\u6587\u4EF6\u5931\u8D25\uFF1A",
|
|
331
325
|
invalidEnvConfig: "\u65E0\u6548\u7684 env \u914D\u7F6E\uFF1A\u671F\u671B\u5BF9\u8C61",
|
|
332
326
|
invalidApiUrl: "\u65E0\u6548\u7684 ANTHROPIC_BASE_URL\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
|
|
333
|
-
invalidApiKey: "\u65E0\u6548\u7684 ANTHROPIC_API_KEY\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
|
|
334
327
|
invalidAuthToken: "\u65E0\u6548\u7684 ANTHROPIC_AUTH_TOKEN\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
|
|
335
328
|
invalidPermissionsConfig: "\u65E0\u6548\u7684\u6743\u9650\u914D\u7F6E\uFF1A\u671F\u671B\u5BF9\u8C61",
|
|
336
329
|
invalidPermissionsAllow: "\u65E0\u6548\u7684 permissions.allow\uFF1A\u671F\u671B\u6570\u7EC4",
|
|
@@ -366,7 +359,7 @@ const ccrMessages$1 = {
|
|
|
366
359
|
ccrInstallFailed: "\u5B89\u88C5 Claude Code Router \u5931\u8D25",
|
|
367
360
|
ccrAlreadyInstalled: "Claude Code Router \u5DF2\u5B89\u88C5",
|
|
368
361
|
// Configuration
|
|
369
|
-
configureCcr: "\
|
|
362
|
+
configureCcr: "\u542F\u52A8\u672C\u5730\u4E2A\u4EBA\u914D\u7F6E",
|
|
370
363
|
useCcrProxy: "\u4F7F\u7528 CCR \u4EE3\u7406",
|
|
371
364
|
ccrProxyDesc: "\u901A\u8FC7 Claude Code Router \u8FDE\u63A5\u591A\u4E2A AI \u6A21\u578B",
|
|
372
365
|
fetchingPresets: "\u6B63\u5728\u83B7\u53D6\u63D0\u4F9B\u5546\u9884\u8BBE...",
|
|
@@ -399,9 +392,9 @@ const ccrMessages$1 = {
|
|
|
399
392
|
ccrRestartFailed: "CCR \u670D\u52A1\u91CD\u542F\u5931\u8D25",
|
|
400
393
|
// Configuration tips
|
|
401
394
|
configTips: "\u914D\u7F6E\u63D0\u793A",
|
|
402
|
-
useClaudeCommand: "\
|
|
403
|
-
advancedConfigTip: "\
|
|
404
|
-
manualConfigTip: "\u624B\u52A8\u4FEE\u6539\u914D\u7F6E\u6587\u4EF6\u540E\uFF0C\u8BF7\u6267\u884C ccr restart \u4F7F\u914D\u7F6E\u751F\u6548",
|
|
395
|
+
useClaudeCommand: "\u73B0\u5728\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\u4F7F\u7528\u7684\u662F\u672C\u5730\u6A21\u578B",
|
|
396
|
+
advancedConfigTip: "\u672C\u5730\u6A21\u578B\u7BA1\u7406\u5730\u5740\uFF1Ahttp://127.0.0.1:3456/ui",
|
|
397
|
+
manualConfigTip: "\u624B\u52A8\u4FEE\u6539\u914D\u7F6E\u6587\u4EF6\u540E\uFF0C\u8BF7\u5728\u7EC8\u7AEF\u547D\u4EE4\u884C\u6267\u884C ccr restart \u4F7F\u914D\u7F6E\u751F\u6548",
|
|
405
398
|
// CCR Menu
|
|
406
399
|
ccrMenuTitle: "CCR - Claude Code Router \u7BA1\u7406",
|
|
407
400
|
ccrMenuOptions: {
|
|
@@ -437,8 +430,8 @@ const ccrMessages$1 = {
|
|
|
437
430
|
ccrNotConfigured: "CCR \u5C1A\u672A\u914D\u7F6E\u3002\u8BF7\u5148\u521D\u59CB\u5316 CCR\u3002",
|
|
438
431
|
pleaseInitFirst: "\u8BF7\u9009\u62E9\u9009\u9879 1 \u6765\u521D\u59CB\u5316 CCR\u3002",
|
|
439
432
|
// UI API Key messages
|
|
440
|
-
ccrUiApiKey: "
|
|
441
|
-
ccrUiApiKeyHint: "\
|
|
433
|
+
ccrUiApiKey: "API\u5BC6\u94A5",
|
|
434
|
+
ccrUiApiKeyHint: "\u5728\u754C\u9762\u8F93\u5165 API \u5BC6\u94A5\u8FDB\u884C\u767B\u5F55"
|
|
442
435
|
};
|
|
443
436
|
|
|
444
437
|
const cometixMessages$1 = {
|
|
@@ -547,45 +540,39 @@ const installation = {
|
|
|
547
540
|
|
|
548
541
|
const api = {
|
|
549
542
|
// Basic API configuration
|
|
550
|
-
configureApi: "
|
|
551
|
-
useAuthToken: "Use Auth Token
|
|
543
|
+
configureApi: "Configure API",
|
|
544
|
+
useAuthToken: "Use Auth Token",
|
|
552
545
|
authTokenDesc: "For tokens obtained via OAuth or browser login",
|
|
553
|
-
useApiKey: "Use API Key (Key authentication)",
|
|
554
|
-
apiKeyDesc: "For API keys from Anthropic Console",
|
|
555
546
|
useCcrProxy: "Use CCR Proxy",
|
|
556
547
|
ccrProxyDesc: "Use multiple AI models via Claude Code Router",
|
|
557
548
|
skipApi: "Skip (configure manually later)",
|
|
558
549
|
enterApiUrl: "Enter API URL",
|
|
559
550
|
enterAuthToken: "Enter Auth Token",
|
|
560
|
-
enterApiKey: "Enter API Key",
|
|
561
551
|
apiConfigSuccess: "API configured",
|
|
562
552
|
// API modification
|
|
563
553
|
existingApiConfig: "Existing API configuration detected:",
|
|
564
554
|
apiConfigUrl: "URL",
|
|
565
|
-
apiConfigKey: "
|
|
566
|
-
apiConfigAuthType: "Auth Type",
|
|
555
|
+
apiConfigKey: "Auth Token",
|
|
567
556
|
selectApiAction: "Select API processing operation",
|
|
568
557
|
keepExistingConfig: "Keep existing configuration",
|
|
569
558
|
modifyAllConfig: "Modify all configuration",
|
|
570
559
|
modifyPartialConfig: "Modify partial configuration",
|
|
571
560
|
selectModifyItems: "Select items to modify",
|
|
572
561
|
modifyApiUrl: "Modify API URL",
|
|
573
|
-
modifyApiKey: "Modify
|
|
574
|
-
modifyAuthType: "Modify auth type",
|
|
562
|
+
modifyApiKey: "Modify Auth Token",
|
|
575
563
|
continueModification: "Continue modifying other configurations?",
|
|
576
564
|
modificationSaved: "Configuration saved",
|
|
577
565
|
enterNewApiUrl: "Enter new API URL (current: {url})",
|
|
578
|
-
enterNewApiKey: "Enter new
|
|
579
|
-
selectNewAuthType: "Select new auth type (current: {type})",
|
|
566
|
+
enterNewApiKey: "Enter new Auth Token (current: {key})",
|
|
580
567
|
// API validation
|
|
581
568
|
apiKeyValidation: {
|
|
582
|
-
empty: "
|
|
569
|
+
empty: "Auth Token cannot be empty",
|
|
583
570
|
example: "Example format: sk-abcdef123456_789xyz"
|
|
584
571
|
},
|
|
585
572
|
urlRequired: "URL is required",
|
|
586
573
|
invalidUrl: "Invalid URL",
|
|
587
|
-
keyRequired: "
|
|
588
|
-
invalidKeyFormat: "Invalid
|
|
574
|
+
keyRequired: "Auth Token is required",
|
|
575
|
+
invalidKeyFormat: "Invalid Auth Token format"
|
|
589
576
|
};
|
|
590
577
|
|
|
591
578
|
const configuration = {
|
|
@@ -806,7 +793,6 @@ const errors = {
|
|
|
806
793
|
failedToBackupConfig: "Failed to backup config file:",
|
|
807
794
|
invalidEnvConfig: "Invalid env configuration: expected object",
|
|
808
795
|
invalidApiUrl: "Invalid ANTHROPIC_BASE_URL: expected string",
|
|
809
|
-
invalidApiKey: "Invalid ANTHROPIC_API_KEY: expected string",
|
|
810
796
|
invalidAuthToken: "Invalid ANTHROPIC_AUTH_TOKEN: expected string",
|
|
811
797
|
invalidPermissionsConfig: "Invalid permissions configuration: expected object",
|
|
812
798
|
invalidPermissionsAllow: "Invalid permissions.allow: expected array",
|
|
@@ -1736,13 +1722,10 @@ function configureApi(apiConfig) {
|
|
|
1736
1722
|
if (!settings.env) {
|
|
1737
1723
|
settings.env = {};
|
|
1738
1724
|
}
|
|
1739
|
-
if (apiConfig.
|
|
1740
|
-
settings.env.ANTHROPIC_API_KEY = apiConfig.key;
|
|
1741
|
-
delete settings.env.ANTHROPIC_AUTH_TOKEN;
|
|
1742
|
-
} else if (apiConfig.authType === "auth_token") {
|
|
1725
|
+
if (apiConfig.key) {
|
|
1743
1726
|
settings.env.ANTHROPIC_AUTH_TOKEN = apiConfig.key;
|
|
1744
|
-
delete settings.env.ANTHROPIC_API_KEY;
|
|
1745
1727
|
}
|
|
1728
|
+
delete settings.env.ANTHROPIC_API_KEY;
|
|
1746
1729
|
if (apiConfig.url) {
|
|
1747
1730
|
settings.env.ANTHROPIC_BASE_URL = apiConfig.url;
|
|
1748
1731
|
}
|
|
@@ -1822,23 +1805,14 @@ function getExistingApiConfig() {
|
|
|
1822
1805
|
if (!settings || !settings.env) {
|
|
1823
1806
|
return null;
|
|
1824
1807
|
}
|
|
1825
|
-
const {
|
|
1826
|
-
if (!ANTHROPIC_BASE_URL && !
|
|
1808
|
+
const { ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL } = settings.env;
|
|
1809
|
+
if (!ANTHROPIC_BASE_URL && !ANTHROPIC_AUTH_TOKEN) {
|
|
1827
1810
|
return null;
|
|
1828
1811
|
}
|
|
1829
|
-
|
|
1830
|
-
let key;
|
|
1831
|
-
if (ANTHROPIC_AUTH_TOKEN) {
|
|
1832
|
-
authType = "auth_token";
|
|
1833
|
-
key = ANTHROPIC_AUTH_TOKEN;
|
|
1834
|
-
} else if (ANTHROPIC_API_KEY) {
|
|
1835
|
-
authType = "api_key";
|
|
1836
|
-
key = ANTHROPIC_API_KEY;
|
|
1837
|
-
}
|
|
1812
|
+
const key = ANTHROPIC_AUTH_TOKEN;
|
|
1838
1813
|
return {
|
|
1839
1814
|
url: ANTHROPIC_BASE_URL || "",
|
|
1840
|
-
key: key || ""
|
|
1841
|
-
authType
|
|
1815
|
+
key: key || ""
|
|
1842
1816
|
};
|
|
1843
1817
|
}
|
|
1844
1818
|
function applyAiLanguageDirective(aiOutputLang) {
|
|
@@ -2048,7 +2022,7 @@ async function configureCcrProxy(ccrConfig) {
|
|
|
2048
2022
|
settings.env = {};
|
|
2049
2023
|
}
|
|
2050
2024
|
settings.env.ANTHROPIC_BASE_URL = `http://${host}:${port}`;
|
|
2051
|
-
settings.env.
|
|
2025
|
+
settings.env.ANTHROPIC_AUTH_TOKEN = apiKey;
|
|
2052
2026
|
writeJsonConfig(SETTINGS_FILE, settings);
|
|
2053
2027
|
}
|
|
2054
2028
|
async function selectCcrPreset(scriptLang) {
|
|
@@ -5499,7 +5473,13 @@ async function selectMcpServices(scriptLang) {
|
|
|
5499
5473
|
type: "checkbox",
|
|
5500
5474
|
name: "services",
|
|
5501
5475
|
message: `${i18n.mcp.selectMcpServices}${i18n.common.multiSelectHint}`,
|
|
5502
|
-
choices
|
|
5476
|
+
choices: choices.map((choice) => ({
|
|
5477
|
+
...choice,
|
|
5478
|
+
checked: true
|
|
5479
|
+
//Default built choices with All option
|
|
5480
|
+
}))
|
|
5481
|
+
// Build choices without ALL option
|
|
5482
|
+
//choices,
|
|
5503
5483
|
});
|
|
5504
5484
|
return services;
|
|
5505
5485
|
} catch (error) {
|
|
@@ -5811,8 +5791,7 @@ async function init(options = {}) {
|
|
|
5811
5791
|
} else {
|
|
5812
5792
|
apiConfig = {
|
|
5813
5793
|
url: "http://11.0.166.20:13456",
|
|
5814
|
-
key: "sk-4730d06849b5fea00f551bd60a0902e1"
|
|
5815
|
-
authType: "auth_token"
|
|
5794
|
+
key: "sk-4730d06849b5fea00f551bd60a0902e1"
|
|
5816
5795
|
};
|
|
5817
5796
|
console.log(ansis.green(`\u2714 \u4F7F\u7528\u9884\u914D\u7F6EAPI\u4FE1\u606F`));
|
|
5818
5797
|
}
|
package/package.json
CHANGED
|
@@ -49,8 +49,8 @@ description: '专业AI编程助手,提供结构化六阶段开发工作流(
|
|
|
49
49
|
|
|
50
50
|
# MCP 服务
|
|
51
51
|
|
|
52
|
-
1. 如果用户输入的存在图片,调用`intention-coding
|
|
53
|
-
2. 如果用户让搜索某个网址的内容,调用`exa`去获取 URL
|
|
52
|
+
1. 如果用户输入的存在图片,调用`intention-coding`中的图片内容理解智能体取识别图片的内容。
|
|
53
|
+
2. 如果用户让搜索某个网址的内容,调用`exa`去获取 爬取 URL 里的内容
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|