-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpackage.json
334 lines (334 loc) · 10.3 KB
/
package.json
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
{
"name": "revision",
"displayName": "ReVision",
"description": "An AI tool to revise your writing in various styles and translate your text.",
"version": "0.0.6",
"publisher": "XiaodiYan",
"repository": "https://github.com/yanxiaodi/vs-code-revision",
"engines": {
"vscode": "^1.76.0"
},
"categories": [
"Other"
],
"keywords": [
"translate",
"revise",
"rewrite",
"openai",
"grammarly",
"revision",
"chatgpt"
],
"icon": "assets/icon.png",
"activationEvents": [
"*"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "revision.reviseInsert",
"title": "Revise & Insert"
},
{
"command": "revision.translateInsert",
"title": "Translate & Insert"
}
],
"keybindings": [
{
"command": "revision.reviseInsert",
"key": "shift+alt+r",
"mac": "shift+alt+r",
"when": "editorTextFocus"
},
{
"command": "revision.translateInsert",
"key": "ctrl+shift+t",
"mac": "cmd+shift+t",
"when": "editorTextFocus"
}
],
"configuration": {
"title": "ReVision",
"properties": {
"revision.api": {
"type": "string",
"default": "openai",
"enum": [
"openai",
"azure-openai"
],
"enumDescriptions": [
"OpenAI API.",
"Azure OpenAI API."
],
"description": "Specify the api to revise the text."
},
"revision.openAIApiKey": {
"type": "string",
"default": "",
"description": "The API key of OpenAI."
},
"revision.openAIModelName": {
"type": "string",
"default": "",
"description": "The model name of OpenAI."
},
"revision.azureOpenAIApiKey": {
"type": "string",
"default": "",
"description": "The API key of Azure OpenAI."
},
"revision.azureOpenAIDeploymentName": {
"type": "string",
"default": "",
"description": "The deployment name of Azure OpenAI."
},
"revision.azureOpenAIEndpoint": {
"type": "string",
"default": "",
"description": "The endpoint of Azure OpenAI."
},
"revision.revisionPromptType": {
"type": "string",
"default": "default",
"enum": [
"default",
"custom"
],
"enumDescriptions": [
"Use the default prompt for revision.",
"Use a custom prompt for revision."
]
},
"revision.revisionCustomPrompt": {
"type": "string",
"default": "Revise this into better sentences and paragraphs in ${sourceLanguage} using a ${writingStyle} tone:\n\n${text}\n\n",
"description": "The custom prompt to revise the text. You need to include ${text} in the prompt. Supported variables: ${text}, ${writingStyle}, ${sourceLanguage}."
},
"revision.translationPromptType": {
"type": "string",
"default": "default",
"enum": [
"default",
"custom"
],
"enumDescriptions": [
"Use the default prompt for translation.",
"Use a custom prompt for translation."
]
},
"revision.translationCustomPrompt": {
"type": "string",
"default": "Translate this from ${sourceLanguage} to ${targetLanguage}:\n\n${text}\n\n",
"description": "The custom prompt to translate the text. You need to include ${text} and ${targetLanguage} in the prompt. Supported variables: ${text}, ${sourceLanguage}, ${targetLanguage}."
},
"revision.writingStyle": {
"type": "string",
"default": "professional",
"enum": [
"professional",
"formal",
"casual",
"humorous",
"sarcastic",
"informative",
"empathetic",
"authoritative",
"poetic",
"other"
],
"enumDescriptions": [
"A professional tone that is appropriate for business documents, such as proposals, reports, and presentations.",
"A formal tone that is appropriate for documents that require a high level of formality, such as legal documents, academic papers, and business correspondence.",
"A casual tone that is appropriate for documents that are meant to be read by friends, family, or colleagues.",
"A humorous tone that is fun and playful.",
"A sarcastic tone that is characterized by its use of irony and sarcasm, often used to express displeasure or frustration.",
"An informative tone that focuses on presenting factual information in a clear and concise manner.",
"An empathetic tone that is used to express understanding and compassion towards the reader, often used in customer service or support contexts.",
"An authoritative tone that is used to convey expertise and authority on a particular subject, often used in instructional or educational contexts.",
"A poetic tone that is appropriate for poems, song lyrics, and other works of art.",
"A custom tone that is not one of the above."
],
"description": "Specify the writing style to revise the text."
},
"revision.otherWritingStyle": {
"type": "string",
"default": "neutral",
"description": "If the writing style is set to 'other', specify the writing style here, e.g., narrative, neutral, conversational, etc."
},
"revision.maxTokens": {
"type": "number",
"default": "1500",
"description": "OpenAI API has a limit of 4097 tokens shared between prompt and completion. So please set this value to be less than 2000 to avoid errors."
},
"revision.sourceLanguage": {
"type": "string",
"default": "English",
"enum": [
"English",
"Chinese (Simplified)",
"Chinese (Traditional)",
"Spanish",
"French",
"German",
"Italian",
"Portuguese",
"Dutch",
"Russian",
"Arabic",
"Japanese",
"Korean",
"Indonesian",
"Thai",
"Turkish",
"Vietnamese",
"Polish",
"Swedish",
"Norwegian",
"Danish",
"Finnish",
"Greek",
"Czech",
"Slovak",
"Romanian",
"Hungarian",
"Bulgarian",
"Hebrew",
"Hindi",
"Bengali",
"Urdu",
"Punjabi",
"Tamil",
"Telugu",
"Marathi",
"Gujarati",
"Kannada",
"Malayalam",
"Oriya",
"Assamese",
"Persian",
"Swahili",
"Yoruba",
"Igbo",
"Zulu",
"Xhosa"
],
"description": "The source language to be revised or translated."
},
"revision.targetLanguage": {
"type": "string",
"default": "Chinese (Simplified)",
"enum": [
"English",
"Chinese (Simplified)",
"Chinese (Traditional)",
"Spanish",
"French",
"German",
"Italian",
"Portuguese",
"Dutch",
"Russian",
"Arabic",
"Japanese",
"Korean",
"Indonesian",
"Thai",
"Turkish",
"Vietnamese",
"Polish",
"Swedish",
"Norwegian",
"Danish",
"Finnish",
"Greek",
"Czech",
"Slovak",
"Romanian",
"Hungarian",
"Bulgarian",
"Hebrew",
"Hindi",
"Bengali",
"Urdu",
"Punjabi",
"Tamil",
"Telugu",
"Marathi",
"Gujarati",
"Kannada",
"Malayalam",
"Oriya",
"Assamese",
"Persian",
"Swahili",
"Yoruba",
"Igbo",
"Zulu",
"Xhosa"
],
"description": "The target language to be translated."
},
"revision.reviseAction": {
"type": "string",
"default": "insert",
"enum": [
"insert",
"copy to clipboard"
],
"enumDescriptions": [
"Insert the revised text into the editor.",
"Copy the revised text to the clipboard."
],
"description": "Specify the action to perform after revising the text."
},
"revision.translateAction": {
"type": "string",
"default": "insert",
"enum": [
"insert",
"copy to clipboard"
],
"enumDescriptions": [
"Insert the translated text into the editor.",
"Copy the translated text to the clipboard."
],
"description": "Specify the action to perform after translating the text."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run esbuild-base -- --minify",
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node",
"esbuild": "npm run esbuild-base -- --sourcemap",
"esbuild-watch": "npm run esbuild-base -- --sourcemap --watch",
"compile": "tsc -p ./",
"lint": "eslint src --ext ts",
"test": "vscode-test",
"deploy": "vsce publish --yarn"
},
"devDependencies": {
"@types/mocha": "^10.0.6",
"@types/node": "18.x",
"@types/sinon": "^17.0.3",
"@types/vscode": "^1.76.0",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vscode/test-cli": "^0.0.6",
"@vscode/test-electron": "^2.3.9",
"@vscode/vsce": "^2.20.1",
"esbuild": "^0.20.1",
"eslint": "^8.56.0",
"mocha": "^10.2.0",
"sinon": "^17.0.1",
"typescript": "^5.3.3"
},
"dependencies": {
"@azure/openai": "^1.0.0-beta.11",
"openai": "^4.28.0"
}
}