-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
307 lines (307 loc) · 11.8 KB
/
Copy pathpackage.json
File metadata and controls
307 lines (307 loc) · 11.8 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
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
{
"name": "tablet",
"displayName": "tablet",
"description": "Bring your own endpoint tab completion and next edit prediction",
"version": "0.1.0",
"publisher": "v3xlabs",
"license": "GPL-3.0-only",
"private": true,
"engines": {
"vscode": "^1.126.0"
},
"categories": [
"Programming Languages",
"Machine Learning"
],
"main": "./dist/extension.js",
"activationEvents": [
"onStartupFinished"
],
"enabledApiProposals": [
"inlineCompletionsAdditions"
],
"contributes": {
"commands": [
{
"command": "tablet.addConfiguration",
"title": "Add a configuration",
"category": "tablet"
},
{
"command": "tablet.selectConfiguration",
"title": "Select configuration",
"category": "tablet"
},
{
"command": "tablet.removeConfiguration",
"title": "Remove a configuration",
"category": "tablet"
},
{
"command": "tablet.clearConfigurationOverride",
"title": "Use the configuration from settings",
"category": "tablet"
},
{
"command": "tablet.toggleEnabled",
"title": "Toggle automatic suggestions",
"category": "tablet"
},
{
"command": "tablet.trigger",
"title": "Suggest now",
"category": "tablet"
},
{
"command": "tablet.storeKey",
"title": "Store a named key",
"category": "tablet"
},
{
"command": "tablet.forgetKey",
"title": "Forget a named key",
"category": "tablet"
},
{
"command": "tablet.showLog",
"title": "Show log",
"category": "tablet"
}
],
"keybindings": [
{
"command": "tablet.trigger",
"key": "ctrl+alt+\\",
"mac": "cmd+alt+\\",
"when": "editorTextFocus && !editorReadonly"
}
],
"configuration": {
"title": "tablet",
"properties": {
"tablet.enabled": {
"type": "boolean",
"default": true,
"markdownDescription": "Master switch for automatic suggestions. Manual triggers still work when this is off."
},
"tablet.activeConfiguration": {
"type": "string",
"default": "",
"markdownDescription": "Name of the configuration to use, from `#tablet.configurations#`. Left empty with exactly one configuration defined, that one is used. Switching from the status bar overrides this for the session without writing to settings."
},
"tablet.languages": {
"type": "object",
"default": {
"*": true
},
"additionalProperties": {
"type": "boolean"
},
"markdownDescription": "Language identifier to enabled, with `*` as the fallback."
},
"tablet.proseLanguages": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"markdown",
"plaintext",
"text",
"quarto",
"rmarkdown",
"rst",
"asciidoc",
"org",
"latex",
"tex"
],
"markdownDescription": "Language identifiers treated as prose. In a prose document a `next-edit` configuration asks with a smaller window, a small token budget, no formatter offer, and no cross file lookup, so the answer is a few words or one precise edit instead of a rewritten paragraph."
},
"tablet.debounceMs": {
"type": "number",
"default": 150,
"markdownDescription": "Idle time before an automatic request starts."
},
"tablet.requestTimeoutMs": {
"type": "number",
"default": 10000,
"markdownDescription": "Abort deadline for one request. A 7B next-edit model on a busy server routinely needs several seconds."
},
"tablet.log": {
"type": "string",
"enum": [
"off",
"error",
"debug"
],
"default": "error",
"markdownDescription": "Output channel verbosity. Assembled prompts are printed at `debug` only. An api key is never printed."
},
"tablet.ringBuffer": {
"type": "object",
"default": {
"chunks": 16,
"chunkLines": 16,
"scopeLines": 1024
},
"properties": {
"chunks": {
"type": "number",
"description": "How many cross file chunks to hold."
},
"chunkLines": {
"type": "number",
"description": "Lines per chunk."
},
"scopeLines": {
"type": "number",
"description": "How far above and below the cursor to pick chunks from."
}
},
"additionalProperties": false,
"markdownDescription": "Bounds for the cross file context ring."
},
"tablet.configurations": {
"type": "object",
"default": {},
"markdownDescription": "Named configurations. Each one holds an endpoint, a key, a model, and a prompt format. Exactly one is active at a time.",
"additionalProperties": {
"type": "object",
"required": [
"endpoint",
"model",
"format"
],
"properties": {
"endpoint": {
"type": "string",
"description": "Base url of an OpenAI compatible server, for example http://127.0.0.1:8080/v1. The request goes to {endpoint}/completions."
},
"apiKey": {
"type": "string",
"default": "",
"markdownDescription": "A literal key, `os.environ/NAME` to read the environment, or `secretstorage/NAME` to read a key stored by the `tablet.setApiKey` command."
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"markdownDescription": "Extra request headers. Each value resolves the same three ways as `apiKey`."
},
"model": {
"type": "string",
"description": "Model name sent to the server."
},
"format": {
"type": "string",
"enum": [
"fim",
"next-edit"
],
"markdownDescription": "`fim` completes at the cursor. `next-edit` rewrites a window of code and can propose an edit away from the cursor."
},
"template": {
"type": "string",
"markdownDescription": "The whole prompt, with `{{placeholder}}` substitutions. For `fim`: `prefix`, `suffix`, `path`, `repo`, `context`. For `next-edit`: `path`, `file`, `context`, `changes`, `original`, `current`, `prefill`, `start`, `end`. Left unset, the default for the format is used."
},
"chunkTemplate": {
"type": "string",
"markdownDescription": "Rendered once per cross file chunk and joined, substituted into `{{context}}`. Placeholders: `path`, `text`."
},
"changeTemplate": {
"type": "string",
"markdownDescription": "Rendered once per recent change and joined, substituted into `{{changes}}`. Placeholders: `path`, `before`, `after`. Used by `next-edit` only."
},
"cursorMarker": {
"type": "string",
"markdownDescription": "Inserted at the cursor inside `{{current}}`. Used by `next-edit` only."
},
"stop": {
"type": "array",
"items": {
"type": "string"
},
"description": "Stop strings sent with the request."
},
"maxTokens": {
"type": "number",
"description": "Generation cap for one request."
},
"temperature": {
"type": "number",
"description": "Sampling temperature. Above zero is needed for several distinct samples."
},
"prefixLines": {
"type": "number",
"description": "Lines before the cursor sent as prefix. Used by fim."
},
"suffixLines": {
"type": "number",
"description": "Lines after the cursor sent as suffix. Used by fim."
},
"windowLines": {
"type": "number",
"description": "Lines of the window the model rewrites. Used by next-edit."
},
"contextLines": {
"type": "number",
"description": "Lines of the target file sent around the window. Used by next-edit."
},
"crossFileCandidates": {
"type": "number",
"markdownDescription": "How many other files to ask about when the local window comes back unchanged. Zero disables cross file suggestions. Used by `next-edit` only."
},
"extraBody": {
"type": "object",
"markdownDescription": "Merged into the request body verbatim. Ask for several samples here: `{\"n_cmpl\": 3}` on llama.cpp, `{\"n\": 3}` on most other servers."
},
"diagnosticTemplate": {
"type": "string",
"markdownDescription": "Rendered once when the file has errors or warnings, substituted into `{{diagnostics}}`. Placeholders: `path`, `text`. Used by `next-edit` only."
},
"formatMarker": {
"type": "string",
"markdownDescription": "What the model may reply with, alone, to ask for the document formatter instead of proposing an edit. Substituted into `{{formatMarker}}` in the template, so the instruction and the marker never drift apart. Set it to an empty string to drop the instruction and stop looking for it. Used by `next-edit` only."
},
"formatTemplate": {
"type": "string",
"markdownDescription": "The instruction telling the model it may ask for the formatter, substituted into `{{format}}`. Placeholder: `marker`. Rendered as nothing when `formatMarker` is empty. Used by `next-edit` only."
},
"contextFiles": {
"type": "number",
"markdownDescription": "How many recently touched files to show the model a window of, taken around the identifier your last change removed. This is what lets a rename in one file be recognised when you move to another. Zero turns it off. Used by `next-edit` only."
}
},
"additionalProperties": false
}
},
"tablet.idleTriggerMs": {
"type": "number",
"default": 400,
"markdownDescription": "How long the cursor has to rest before tablet asks for a suggestion, in milliseconds. The editor only asks by itself when the document changes, so this is what makes resting on the line you are about to fix produce a suggestion. Zero turns it off."
}
}
}
},
"scripts": {
"build": "node esbuild.mjs --production",
"watch": "node esbuild.mjs --watch",
"check": "tsc --noEmit && eslint . && vitest run",
"test": "vitest run",
"bench:generate": "jiti bench/generate.ts",
"bench": "jiti bench/run.ts"
},
"devDependencies": {
"@types/node": "^26.3.0",
"@types/vscode": "1.125.0",
"esbuild": "^0.28.2",
"eslint": "^10.9.1",
"eslint-plugin-v3xlabs": "^1.8.1",
"jiti": "^2.7.0",
"typescript": "^6.0.3",
"vitest": "^4.1.11"
},
"packageManager": "pnpm@11.22.0"
}