monacopilot 0.18.6 → 0.18.7
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 +1 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@ registerCompletion(monaco, editor, {
|
|
|
52
52
|
// in the `registerCompletion` function
|
|
53
53
|
// to handle completion requests from the editor
|
|
54
54
|
|
|
55
|
+
// Example using Express.js
|
|
55
56
|
import {Copilot} from 'monacopilot';
|
|
56
57
|
|
|
57
58
|
const copilot = new Copilot(OPENAI_API_KEY, {
|
|
@@ -59,7 +60,6 @@ const copilot = new Copilot(OPENAI_API_KEY, {
|
|
|
59
60
|
model: 'gpt-4o',
|
|
60
61
|
});
|
|
61
62
|
|
|
62
|
-
// Handle completion requests
|
|
63
63
|
app.post('/code-completion', async (req, res) => {
|
|
64
64
|
const {completion, error, raw} = await copilot.complete({body: req.body});
|
|
65
65
|
|
|
@@ -68,7 +68,6 @@ app.post('/code-completion', async (req, res) => {
|
|
|
68
68
|
calculateCost(raw.usage.input_tokens);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
// Handle any errors gracefully
|
|
72
71
|
if (error) {
|
|
73
72
|
return res.status(500).json({completion: null, error});
|
|
74
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monacopilot",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.7",
|
|
4
4
|
"description": "AI auto-completion plugin for Monaco Editor",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"module": "./build/index.mjs",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsup src/index.ts",
|
|
13
13
|
"dev": "tsup src/index.ts --watch",
|
|
14
|
-
"test": "vitest",
|
|
14
|
+
"test": "vitest run",
|
|
15
15
|
"dev:test-ui": "pnpm -C tests/ui dev",
|
|
16
16
|
"tsc": "tsc --noEmit",
|
|
17
17
|
"lint": "eslint . --ext .ts,.tsx --fix",
|