-
Notifications
You must be signed in to change notification settings - Fork 6
/
package.json
479 lines (479 loc) · 23.4 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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
{
"name": "gptutor",
"displayName": "GPTutor (🤖‚🤖)",
"repository": {
"type": "git",
"url": "https://github.com/GPTutor/gptutor-extension"
},
"description": "A VS Code extension for AI Pair Programming and Smart Contract Development.",
"publisher": "gptutor",
"version": "1.1.0",
"engines": {
"vscode": "^1.75.0"
},
"categories": [
"Other"
],
"icon": "out/resources/extensionIcon.png",
"activationEvents": [
"onView:gptutor.chatView"
],
"main": "out/extension.js",
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./ && copyfiles -u 1 \"src/resources/**/*\" out && copyfiles -u 1 \"src/media/**/*\" out",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js",
"publish": "npm run compile && vsce package && vsce publish",
"package": "vsce package"
},
"contributes": {
"configuration": {
"title": "GPTutor",
"properties": {
"GPTutor.openaiApiKey": {
"type": "string",
"default": "",
"description": "OpenAI API Key"
},
"GPTutor.openaiTemperature": {
"type": "number",
"default": 0.8,
"description": "Temperature is a parameter that controls the “creativity” or randomness of the text generated by GPT-3. A higher temperature (e.g., 0.7) results in more diverse and creative output, while a lower temperature (e.g., 0.2) makes the output more deterministic and focused.\nIn practice, temperature affects the probability distribution over the possible tokens at each step of the generation process. A temperature of 0 would make the model completely deterministic, always choosing the most likely token."
},
"GPTutor.openaiBasePath": {
"type": "string",
"default": "",
"description": "Override OpenAI base path, leave it blank for default"
},
"GPTutor.openaiModel": {
"type": "string",
"default": "gpt-3.5-turbo",
"enum": [
"gpt-3.5-turbo",
"gpt-4",
"gpt-3.5-turbo-0301",
"gpt-4-0314"
],
"enumDescriptions": [
"Default model, use by ChatGPT",
"GPT-4 can handle longer code and provide a superior response. Yet it is more expensive. You may need to apply for the access of GPT-4."
],
"description": "OpenAI Model Selection"
},
"GPTutor.outputLanguage": {
"type": "string",
"default": "English",
"enum": [
"Afrikaans",
"Albanian",
"Amharic",
"Arabic",
"Armenian",
"Assamese",
"Aymara",
"Azerbaijani",
"Bambara",
"Basque",
"Belarusian",
"Bengali",
"Bhojpuri",
"Bosnian",
"Bulgarian",
"Catalan",
"Cebuano",
"Chinese (Simplified)",
"Chinese (Traditional)",
"Corsican",
"Croatian",
"Czech",
"Danish",
"Dhivehi",
"Dogri",
"Dutch",
"English",
"Esperanto",
"Estonian",
"Ewe",
"Filipino (Tagalog)",
"Finnish",
"French",
"Frisian",
"Galician",
"Georgian",
"German",
"Greek",
"Guarani",
"Gujarati",
"Haitian Creole",
"Hausa",
"Hawaiian",
"Hebrew",
"Hindi",
"Hmong",
"Hungarian",
"Icelandic",
"Igbo",
"Ilocano",
"Indonesian",
"Irish",
"Italian",
"Japanese",
"Javanese",
"Kannada",
"Kazakh",
"Khmer",
"Kinyarwanda",
"Konkani",
"Korean",
"Krio",
"Kurdish",
"Kurdish (Sorani)",
"Kyrgyz",
"Lao",
"Latin",
"Latvian",
"Lingala",
"Lithuanian",
"Luganda",
"Luxembourgish",
"Macedonian",
"Maithili",
"Malagasy",
"Malay",
"Malayalam",
"Maltese",
"Maori",
"Marathi",
"Meiteilon (Manipuri)",
"Mizo",
"Mongolian",
"Myanmar (Burmese)",
"Nepali",
"Norwegian",
"Nyanja (Chichewa)",
"Odia (Oriya)",
"Oromo",
"Pashto",
"Persian",
"Polish",
"Portuguese (Portugal, Brazil)",
"Punjabi",
"Quechua",
"Romanian",
"Russian",
"Samoan",
"Sanskrit",
"Scots Gaelic",
"Sepedi",
"Serbian",
"Sesotho",
"Shona",
"Sindhi",
"Sinhala (Sinhalese)",
"Slovak",
"Slovenian",
"Somali",
"Spanish",
"Sundanese",
"Swahili",
"Swedish",
"Tagalog (Filipino)",
"Tajik",
"Tamil",
"Tatar",
"Telugu",
"Thai",
"Tigrinya",
"Tsonga",
"Turkish",
"Turkmen",
"Twi (Akan)",
"Ukrainian",
"Urdu",
"Uyghur",
"Uzbek",
"Vietnamese",
"Welsh",
"Xhosa",
"Yiddish",
"Yoruba",
"Zulu"
],
"description": "Output language, this value will replace the ${outputLanguage} value in prompt."
},
"GPTutor.instructionForSpecificLanguage": {
"type": "object",
"description": "instruction after the prompt when user choose specific language. This can help the generated content to be more localized.",
"default": {
"Chinese (Traditional)": "請使用繁體中文與臺灣地區用語,不要用簡體字與中國大陸地區的用詞。比方請用「程式碼」而不是「代码」。"
}
},
"GPTutor.prompts": {
"type": "object",
"description": "Prompts for GPTutor when you hover over a code block.",
"default": {
"global": {
"explain": {
"display_name": "🧑🏫 Explain",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "You are a Senior ${languageId} Developer \n I will provide some ${languageId} code, and it will be your job to explain the ${languageId} code I selected."
},
{
"role": "user",
"content": "Other context about the selected code is in the following triple backquote (```) \n```\n${codeContext}\n```\n. The ${languageId} code I selected is in the following triple backquote (```) \n```\n${selectedCode}\n```\n. You don't need to repeat the selected code again. Please focus on explain target ${languageId} code. Output in ${outputLanguage}."
}
]
},
"comment": {
"display_name": "📝 Comment",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "I want you to act as a professional ${languageId} Commenter. \n I will provide some code about ${languageId}, \n and it will be your job to add or rewrite comment on the provided ${languageId} code in ${outputLanguage}. You should only edit command, but keep the code the same."
},
{
"role": "user",
"content": "Here are some context of the code in the following triple backquote, don't output them: \n```\n${codeContext}\n```\n Here are the ${languageId} code I want you to add comment in the following triple backquote:\n```\n${selectedCode}\n```\n. Only return the code after modified. return the code with the triple backquote (```). Add or rewrite the comment in the given code in ${outputLanguage}."
}
]
},
"Review": {
"display_name": "🕵️ Review",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "You are a Senior ${languageId} Developer \n I will provide some ${languageId} code, and it will be your job to do code review on the ${languageId} code I selected."
},
{
"role": "user",
"content": "Here is the full code context in the following triple backquote if needed. \n```\n${codeContext}\n```\n.\n\nHere is the selected code in the triple backquote: \n```\n${selectedCode}\n```\n\nGiven the selected ${languageId} code, I want you to do the following:\n\n1. if there is a problem, such as bug or security concern, with the selected code, modify the selected ${languageId} code and return it with the triple backquote (```). Add or rewrite the comment in the code in ${outputLanguage}.\n\n2. Then, check again if there is a security concern with the original code, modified code, and the context. List each of the concern.\n\n3. Refine and Review this code again \n Please think carefully. And Review this code to be better. \n If it is already quite secure and efficient, then you don't need to output anything in this step. Please focus on the selected code, but you may reference the full code context for more information. \nOutput in ${outputLanguage}."
}
]
}
},
"specificLanguage": {
"move": {
"explain": {
"display_name": "🧑🏫 Explain",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "Move is an open source language for writing safe smart contracts. It's format is similar to Rust. You are a Senior ${languageId} Developer \n I will provide some ${languageId} code, and it will be your job to explain the ${languageId} code I selected."
},
{
"role": "user",
"content": "Other context about the selected code is in the following triple backquote (```) \n```\n${codeContext}\n```\n. The ${languageId} code I selected is in the following triple backquote (```) \n```\n${selectedCode}\n```\n. Please focus on explain target ${languageId} code. Output in ${outputLanguage}."
}
]
},
"comment": {
"display_name": "📝 Comment",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "Move is an open source language for writing safe smart contracts. It's format is similar to Rust. I want you to act as a professional ${languageId} Commenter. \n I will provide some code about ${languageId}, \n and it will be your job to add or rewrite comment on the provided ${languageId} code in ${outputLanguage}. You should only edit command, but keep the code the same."
},
{
"role": "user",
"content": "Here are some context of the code in the following triple backquote, don't output them: \n```\n${codeContext}\n```\n\n Here are the ${languageId} code I want you to add comment: \n```\n${selectedCode}\n```\n. Only return the code after modified. return the code in the triple backquote (```). Add or rewrite the comment in the given code in ${outputLanguage}, but keep the variable name the same."
}
]
},
"Review": {
"display_name": "🕵️ Review",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "Move is an open source language for writing safe smart contracts. It's format is similar to Rust. You are a Senior ${languageId} Developer \n I will provide some ${languageId} code, and it will be your job to do code review on the ${languageId} code I selected."
},
{
"role": "user",
"content": "Here is the full code context in the following triple backquote if needed. \n```\n${codeContext}\n```\n.\n\nHere is the selected code in the triple backquote: \n```\n${selectedCode}\n```\n\nGiven the selected ${languageId} code, I want you to do the following:\n\n1. if there is a problem, such as bug or security concern, with the selected code, modify the selected ${languageId} code and return it with the triple backquote (```). Add or rewrite the comment in the code in ${outputLanguage}.\n\n2. Then, check again if there is a security concern with the original code, modified code, and the context. List each of the concern.\n\n3. Refine and Review this code again \n Please think carefully. And Review this code to be better. \n If it is already quite secure and efficient, then you don't need to output anything in this step. Please focus on the selected code, but you may reference the full code context for more information. \nOutput in ${outputLanguage}."
}
]
}
}
}
}
},
"GPTutor.promptsForInputBox": {
"type": "object",
"default": {
"global": {
"default": {
"display_name": "🤖 Code Generate",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "You are a helpful assistant that generate the ${languageId} code according to user's instruction and the context.Your output code should be surrounded with triple backquote (```) and new line. Please make very very sure to generate code snippets in the correct ${languageId} format. You dont need to interact with user but just generate all code directly. Please follow this convention throughout our conversation."
},
{
"role": "user",
"content": "Instruction: ${user_input}"
}
]
},
"rewriter": {
"display_name": "🤖 Rewrite",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "You are a helpful assistant that rewrite the selected ${languageId} code with the user's instruction and according to the provided context. Make sure the rewrited code fit the context, instead of use undefined variable. Your output should be surrounded with triple backquote (```) and new line. Please follow this convention throughout our conversation.\nHere are some context about the code to help you rewrite, delimited by the following triple backquote (```): \n```\n${codeContext}\n```\n. If there is no selected code provided, ignore selected code and generate code directly according to instruction."
},
{
"role": "user",
"content": "Instruction: ${user_input}\nselected ${languageId} code: \n```\n${selectedCode}\n```\n"
}
]
},
"tailwind": {
"display_name": "🤖 Tailwind Rewrite",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "You are a helpful assistant that rewrite the html code with the user's instruction in Tailwind CSS class. Your output should be surrounded with triple backquote (```) and new line, such as: \n```\n<div>Hi</div>\n```\n. Make sure each HTML tag is start with < and end with >. Please make very very sure to generate code snippets in the correct HTML format. Please follow this convention throughout our conversation."
},
{
"role": "user",
"content": "Instruction: ${user_input}\n\nThe code:\n```\n${selectedCode}\n```\n"
}
]
}
},
"specificLanguage": {
"python": {
"fastAPI Master": {
"display_name": "🤖 FastAPI Master",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "user",
"content": "You are a master python coder in fastapi! Complete the ${languageId} fastAPI code below with the instruction text delimited by triple backquote (```). \n\n\n\n\n```\n${user_input}\n```\nOutput your explain and comment in ${outputLanguage} but the code and variable name should be in English."
}
]
}
},
"move": {
"CoinCreater": {
"display_name": "🪙 Coin Creator",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "system",
"content": "You are a helpful assistant that generate the move code according to user's instruction and the context. Your output code should be surrounded with triple backquote (```) and new line. Please make very very sure to generate code snippets in the correct move format (which is similar to Rust). You don't need to interact with user or ask further information but just generate code directly. Rewrite the move code below with the user's instruction: \n```move\n// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/// Example coin with a trusted manager responsible for minting/burning (e.g., a stablecoin)\n/// By convention, modules defining custom coin types use upper case names, in contrast to\n/// ordinary modules, which use camel case.\nmodule fungible_coin::managed {\n use std::option;\n use sui::coin::{Self, Coin, TreasuryCap};\n use sui::transfer;\n use sui::tx_context::{Self, TxContext};\n use sui::url;\n\n /// Name of the coin. By convention, this type has the same name as its parent module\n /// and has no fields. The full type of the coin defined by this module will be `COIN<MANAGED>`.\n struct MANAGED has drop {}\n\n /// Register the managed currency to acquire its `TreasuryCap`. Because\n /// this is a module initializer, it ensures the currency only gets\n /// registered once.\n fun init(witness: MANAGED, ctx: &mut TxContext) {\n // Get a treasury cap for the coin and give it to the transaction sender\n let decimals = 2;\n let symbol = b\"SYMBOL_OF_THE_COIN\";\n let name = b\"NAME_OF_THE_COIN\";\n let description = b\"DESCRIPTION_OF_THE_COIN\";\n let icon_url = option::some(url::new_unsafe_from_bytes(b\"https://blog.sui.io/content/images/2023/04/Sui_Droplet_Logo_Blue-3.png\"));\n \n let (treasury_cap, metadata) = coin::create_currency<MANAGED>(witness, decimals, symbol, name, description, icon_url, ctx);\n transfer::public_freeze_object(metadata);\n coin::mint_and_transfer(&mut treasury_cap, 100000, tx_context::sender(ctx), ctx);\n transfer::public_transfer(treasury_cap, tx_context::sender(ctx))\n \n }\n\n /// Manager can mint new coins\n public entry fun mint(\n treasury_cap: &mut TreasuryCap<MANAGED>, amount: u64, recipient: address, ctx: &mut TxContext\n ) {\n coin::mint_and_transfer(treasury_cap, amount, recipient, ctx)\n }\n\n /// Manager can burn coins\n public entry fun burn(treasury_cap: &mut TreasuryCap<MANAGED>, coin: Coin<MANAGED>) {\n coin::burn(treasury_cap, coin);\n }\n\n}\n// Publish it by running `sui client publish . --gas COIN_OBJECT_ID --gas-budget 300000000 --skip-dependency-verification`\n```\n"
},
{
"role": "user",
"content": "Instruction: ${user_input}"
}
]
}
},
"javascript": {
"default": {
"display_name": "🤖 React Helper",
"type": "chatgpt-prompt",
"prompt": [
{
"role": "user",
"content": "You are a react generator! \n\nHere are the code before the cursor delimited by triple backquote (```): \n```\n${codeBefore}\n```\n\n\nAnd here are the code after the cursor delimited by triple backquote (```): \n```\n${codeAfter}\n```\n\n\nHere is the code selected by the user delimited by triple backquote (```): \n```\n${selectedCode}\n```\n\n\nComplete the react code on the cursor or refactor the selected code with the instruction text delimited by triple backquote (```). \n\n\n\n\n```\n${user_input}\n```\nOutput your explain and comment in ${outputLanguage} but the code and variable name should be in English."
}
]
}
}
}
},
"description": "Prompts for GPTutor when you chat with it in the input box"
}
}
},
"commands": [
{
"command": "Initialize GPTutor",
"title": "GPTutor: init"
},
{
"command": "Set OpenAI API Key",
"title": "GPTutor: setKey"
},
{
"command": "Delete OpenAI API Key",
"title": "GPTutor: deleteKey"
},
{
"command": "Set Model",
"title": "GPTutor: setModel"
},
{
"command": "GPTutor Active",
"title": "GPTutor: active"
},
{
"command": "GPTutor Edit Prompts",
"title": "GPTutor: edit prompts"
},
{
"command": "GPTutor Reset Prompts Config",
"title": "GPTutor: reset prompts"
}
],
"menus": {
"editor/context": [],
"commandPalette": []
},
"viewsContainers": {
"activitybar": [
{
"id": "gptutor",
"title": "GPTutor",
"icon": "out/resources/icon.png"
}
]
},
"views": {
"gptutor": [
{
"type": "webview",
"id": "GPTutor.chatView",
"name": "GPTutor"
}
]
}
},
"devDependencies": {
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.1",
"@types/node": "16.x",
"@types/vscode": "^1.75.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"@vscode/test-cli": "^0.0.4",
"@vscode/test-electron": "^2.3.8",
"eslint": "^8.34.0",
"glob": "^8.1.0",
"mocha": "^10.2.0",
"typescript": "^4.9.5",
"vscode-extension-tester": "^5.7.1"
},
"dependencies": {
"axios": "^1.4.0",
"command-exists": "^1.2.9",
"copyfiles": "^2.4.1",
"openai": "^4.20.1",
"vscode-languageclient": "^6.1.4"
}
}