-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
187 lines (187 loc) · 5.87 KB
/
package.json
File metadata and controls
187 lines (187 loc) · 5.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{
"name": "hello-code-translate",
"displayName": "代码沉浸式翻译",
"icon": "assets/icon.png",
"description": "在代码旁直接显示译文的 VS Code 插件",
"version": "0.0.5",
"publisher": "AK-103U",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/AK-103U/hello-code-translate"
},
"engines": {
"vscode": "^1.80.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onStartupFinished"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "hello-code-translate.start",
"category": "Hello-Code-Translate / 代码沉浸式翻译",
"title": "开启翻译",
"icon": {
"light": "assets/eye-closed.svg",
"dark": "assets/eye-closed.svg"
}
},
{
"command": "hello-code-translate.stop",
"category": "Hello-Code-Translate / 代码沉浸式翻译",
"title": "停止翻译",
"icon": {
"light": "assets/eye-open.svg",
"dark": "assets/eye-open.svg"
}
},
{
"command": "hello-code-translate.toggle",
"category": "Hello-Code-Translate / 代码沉浸式翻译",
"title": "切换翻译状态"
},
{
"command": "hello-code-translate.reset",
"category": "Hello-Code-Translate / 代码沉浸式翻译",
"title": "清空翻译缓存"
},
{
"command": "hello-code-translate.switchTranslationMode",
"category": "Hello-Code-Translate / 代码沉浸式翻译",
"title": "切换翻译模式"
},
{
"command": "hello-code-translate.openSettingsJson",
"category": "Hello-Code-Translate / 代码沉浸式翻译",
"title": "打开用户配置 JSON"
}
],
"menus": {
"editor/title": [
{
"command": "hello-code-translate.start",
"when": "!helloCodeTranslate.activeEditorEnabled",
"group": "navigation@10"
},
{
"command": "hello-code-translate.stop",
"when": "helloCodeTranslate.activeEditorEnabled",
"group": "navigation@10"
}
]
},
"keybindings": [
{
"command": "hello-code-translate.toggle",
"key": "ctrl+alt+t",
"mac": "ctrl+cmd+t"
}
],
"configuration": {
"title": "代码沉浸式翻译",
"properties": {
"hello-code-translate.provider": {
"type": "string",
"default": "google-translate",
"enum": [
"google-translate",
"openai",
"deepseek",
"gemini",
"custom",
"bedrock"
],
"enumDescriptions": [
"Google 翻译(免费,无需 API Key)",
"OpenAI(需要 API Key)",
"DeepSeek(需要 API Key)",
"Gemini(需要 API Key)",
"自定义 OpenAI 兼容接口(需要 API Key、API 地址和模型名)",
"AWS Bedrock(需要 AWS 凭证、区域和模型 ID)"
],
"description": "翻译服务提供方。",
"order": 0
},
"hello-code-translate.apiKey": {
"type": "string",
"default": "",
"description": "所选翻译服务的 API Key。",
"order": 1
},
"hello-code-translate.baseURL": {
"type": "string",
"default": "",
"description": "自定义 API 地址(Base URL,仅用于 custom 提供方,或覆盖预设地址)。",
"order": 2
},
"hello-code-translate.model": {
"type": "string",
"default": "",
"description": "模型名称(仅用于 custom 提供方,或覆盖预设模型)。",
"order": 3
},
"hello-code-translate.awsRegion": {
"type": "string",
"default": "",
"description": "Bedrock 使用的 AWS 区域(例如 `us-east-1`)。",
"order": 4
},
"hello-code-translate.awsProfile": {
"type": "string",
"default": "",
"description": "Bedrock SSO 使用的 AWS 配置名称(Profile,留空则使用默认凭证链)。",
"order": 5
},
"hello-code-translate.awsBedrockModelId": {
"type": "string",
"default": "",
"description": "AWS Bedrock 的模型 ID 或推理配置文件 ID。",
"order": 6
},
"hello-code-translate.translationMode": {
"type": "string",
"default": "natural",
"enum": [
"natural",
"code-tokens"
],
"enumDescriptions": [
"使用当前配置的翻译服务进行整行自然翻译",
"针对主流编程语言执行代码词法翻译,结合本地词法规则与远程翻译"
],
"description": "翻译模式。`code-tokens` 会保留标点和代码结构,并翻译主流编程语言中的关键字、API 名称以及拆分后的标识符。",
"order": 7
}
}
}
},
"scripts": {
"compile": "pnpm run check-types && node esbuild.js",
"compile:production": "pnpm run check-types && node esbuild.js --production",
"check-types": "tsc --noEmit",
"lint": "eslint src",
"test": "node --import tsx --test src/test/*.test.ts",
"vscode:prepublish": "pnpm run compile:production",
"package": "vsce package --no-dependencies",
"publish": "vsce publish --no-dependencies"
},
"devDependencies": {
"@types/node": "18.x",
"@types/vscode": "^1.80.0",
"@vscode/vsce": "^3.7.1",
"esbuild": "^0.25.0",
"eslint": "^9.0.0",
"tsx": "^4.21.0",
"typescript": "^5.1.3",
"typescript-eslint": "^8.0.0"
},
"dependencies": {
"@aws-sdk/client-bedrock-runtime": "^3.1025.0",
"@aws-sdk/credential-providers": "^3.1025.0"
}
}