-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpackage.json
More file actions
500 lines (500 loc) · 22.3 KB
/
package.json
File metadata and controls
500 lines (500 loc) · 22.3 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
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
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
{
"name": "calva-backseat-driver",
"displayName": "Calva Backseat Driver",
"description": "Make Copilot an Interactive Programmer, tools for VS Code Copilot. Can also be run as an MCP server",
"version": "0.0.35",
"publisher": "betterthantomorrow",
"author": {
"name": "Better Than Tomorrow",
"email": "pez@pezius.com"
},
"icon": "assets/extension-icon-128x128.png",
"repository": {
"type": "git",
"url": "https://github.com/BetterThanTomorrow/calva-backseat-driver.git"
},
"engines": {
"vscode": ">=1.96.2",
"node": ">=20.18.0"
},
"enabledApiProposals": [
"extensionRuntime"
],
"categories": [
"Programming Languages",
"AI",
"Other"
],
"keywords": [
"clojure",
"clojurescript",
"mcp",
"model-context-protocol",
"ai"
],
"activationEvents": [
"onLanguage:clojure"
],
"main": "out/extension.js",
"contributes": {
"configuration": {
"title": "Calva Backseat Driver",
"properties": {
"calva-backseat-driver.enableMcpReplEvaluation": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable the REPL evaluation tool through MCP.\n\n **⚠️ SECURITY WARNING**: _When enabled and you have also started the MCP server, any network client with access to the MCP server can execute arbitrary code in your REPL environment._ That said, Copilot and other compliant MCP clients will default to a low-trust mode with confirmation before any evaluation.",
"scope": "resource"
},
"calva-backseat-driver.autoStartMCPServer": {
"type": "boolean",
"default": false,
"markdownDescription": "Automatically start the MCP server when the extension is activated.",
"scope": "resource"
},
"calva-backseat-driver.mcpSocketServerPort": {
"type": "number",
"default": 1664,
"markdownDescription": "Port to start the socket server on. Use `0` to let the server choose a high available port.",
"scope": "resource"
},
"calva-backseat-driver.editor.fuzzyLineTargetingPadding": {
"type": "number",
"default": 2,
"minimum": 0,
"markdownDescription": "Number of lines to search above and below when locating a target line by its text content to decide if the edit should be carried out or not. **Trade-offs**: Higher values tolerate line number shifts but may match incorrect lines if similar code exists nearby. Large errors by the agent may indicate it has stale file content, and you may not want it to edit the file if so.",
"scope": "resource"
},
"calva-backseat-driver.editor.lineContextResponsePadding": {
"type": "number",
"default": 10,
"minimum": 0,
"markdownDescription": "Number of lines above and below the target line to show the agent in error responses when an edit operation fails. **Trade-offs**: Larger values provide more context for the agent's retry but may consume more tokens. Or it may not, depending on how the agent uses the information (e.g. if the context contains what it needs, it may be able to avoid a full file reread).",
"scope": "resource"
},
"calva-backseat-driver.evaluation.maxLength": {
"type": "number",
"default": 25,
"minimum": 0,
"markdownDescription": "Maximum number of items to display in collections when pretty-printing REPL evaluation results. Use `0` to disable length limiting. **Purpose**: Prevents large collections from overwhelming the agent's context window.",
"scope": "resource"
},
"calva-backseat-driver.evaluation.maxDepth": {
"type": "number",
"default": 7,
"minimum": 0,
"markdownDescription": "Maximum nesting depth when pretty-printing REPL evaluation results. Deeper structures are replaced with `##`. Use `0` to disable depth limiting. **Purpose**: Prevents deeply nested structures from overwhelming the agent's context window.",
"scope": "resource"
},
"calva-backseat-driver.provideBdSkill": {
"type": "boolean",
"default": true,
"markdownDescription": "Provide the Backseat Driver skill to agents",
"scope": "resource"
},
"calva-backseat-driver.provideEditSkill": {
"type": "boolean",
"default": true,
"markdownDescription": "Provide the Clojure structural editing skill to agents",
"scope": "resource"
}
}
},
"commands": [
{
"command": "calva-backseat-driver.startMcpServer",
"category": "Calva Backseat Driver",
"enablement": "!:calva-backseat-driver/started?",
"title": "Start the MCP socket server"
},
{
"command": "calva-backseat-driver.stopMcpServer",
"category": "Calva Backseat Driver",
"enablement": ":calva-backseat-driver/started?",
"title": "Stop the MCP socket server"
},
{
"command": "calva-backseat-driver.openLogFile",
"category": "Calva Backseat Driver",
"title": "Open log file"
}
],
"keybindings": [],
"chatSkills": [
{
"path": "./assets/skills/backseat-driver/SKILL.md",
"when": "config.calva-backseat-driver.provideBdSkill"
},
{
"path": "./assets/skills/editing-clojure-files/SKILL.md",
"when": "config.calva-backseat-driver.provideEditSkill"
}
],
"chatInstructions": [
{
"path": "./assets/instructions/editing-clojure-files.instructions.md"
},
{
"path": "./assets/instructions/backseat-driver.instructions.md"
},
{
"path": "./assets/skills/backseat-driver/SKILL.md",
"when": "config.calva-backseat-driver.provideBdSkill"
},
{
"path": "./assets/skills/editing-clojure-files/SKILL.md",
"when": "config.calva-backseat-driver.provideEditSkill"
}
],
"languageModelTools": [
{
"name": "clojure_evaluate_code",
"tags": [
"clojure",
"repl",
"needs-connected-repl",
"interactive-programming",
"repl-driven-development"
],
"toolReferenceName": "clojure-eval",
"displayName": "Evaluate Clojure Code",
"modelDescription": "**Evaluate Clojure Code** using Calva's REPL connection. \"Use the REPL\" means this tool. In a Joyride context use `joyride_evaluate_code` instead of this tool.\n\nResult may include `otherWhosSinceLast` — other evaluators active since your last call. If evaluation results contain image data, it will be automatically extracted and returned as viewable images.\n\nUse `description` instead of line comments in the code you are evaluating, for explaining the purpose of the evaluation, or to help yourself think.\n\nIndent code properly before evaluation (agents often get maps misaligned).\n\nAlways load the `backseat-driver` skill when using this tool.",
"userDescription": "Evaluate Clojure or ClojureScript code in the connected REPL.",
"canBeReferencedInPrompt": true,
"icon": "$(terminal-bash)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Code to evaluate"
},
"namespace": {
"type": "string",
"description": "Fully qualified namespace in which to evaluate the code. E.g. if calling functions in a file you are reading, **it is probably the namespace of that file that should be provided**. If it is the first time you use a namespace, start with evaluating its ns-form in the `user` or `cljs.user` namespace (as appropriate)."
},
"replSessionKey": {
"type": "string",
"description": "The Calva REPL session to evaluate the code via. Use the `list_sessions` tool to discover available sessions."
},
"who": {
"type": "string",
"description": "A short, stable kebab-case slug identifying you as an evaluator. Think about what the session is about and what your role is in it, then sluggify that role and use it for `who`. Reuse the same slug across all evaluations in a session."
},
"description": {
"type": "string",
"description": "Succinct human-readable note explaining what you are evaluating and why. Shows up in the repl output tool's log, and is also in the human's output view. Use this *instead* of line comments in the code you are evaluating."
},
"maxImages": {
"type": "number",
"description": "Maximum number of images to return from image data found in the result. Defaults to 10. Images beyond this cap are replaced with <<image-N-capped>> markers in the text but not returned as image content. Avoid settings this above 20, because Copilot has a hard cap of 20 images."
}
},
"required": [
"code",
"namespace",
"replSessionKey",
"who"
]
}
},
{
"name": "clojure_list_sessions",
"tags": [
"clojure",
"repl",
"sessions",
"discovery"
],
"toolReferenceName": "list-sessions",
"displayName": "List REPL Sessions",
"modelDescription": "**List REPL Sessions** returns information about all available REPL sessions. Use this tool to discover which session keys are available for evaluation. Each session includes the session key, project root, and file glob patterns it handles. The session serving the user's active file is marked with `isActiveSession: true`.",
"userDescription": "List available REPL sessions and their details.",
"canBeReferencedInPrompt": true,
"icon": "$(list-unordered)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {},
"required": []
}
},
{
"name": "clojure_symbol_info",
"tags": [
"clojure",
"documentation",
"needs-connected-repl",
"argument-list",
"return-values",
"side-effects"
],
"toolReferenceName": "clojure-symbol",
"displayName": "Clojure Symbol Info",
"modelDescription": "**Clojure Symbol Info** gets you detailed information about a Clojure symbol from the connected REPL. For ClojureDocs examples and see-alsos, use `clojuredocs_info` instead.",
"userDescription": "**Clojure Symbol Info** looks up documentation for a Clojure symbol.",
"canBeReferencedInPrompt": true,
"icon": "$(tag)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {
"clojureSymbol": {
"type": "string",
"description": "The symbol to look up info for"
},
"namespace": {
"type": "string",
"description": "Fully qualified namespace in which to evaluate the code. E.g. if calling functions in a file you are reading, it is probably the namespace of that file that should be provided."
},
"replSessionKey": {
"type": "string",
"description": "The Calva REPL session to evaluate the code in. Use the `list_sessions` tool to discover available sessions."
}
},
"required": [
"clojureSymbol",
"namespace",
"replSessionKey"
]
}
},
{
"name": "clojuredocs_info",
"tags": [
"clojure",
"clojure-core",
"needs-connected-repl",
"examples",
"see-also",
"documentation"
],
"toolReferenceName": "clojuredocs",
"displayName": "clojuredocs.org Lookup",
"modelDescription": "**clojuredocs Lookup** looks up information, examples, see alsos, and more about a Clojure Core symbol from clojuredocs.org. For runtime symbol info from a connected REPL, use `clojure_symbol_info` instead.",
"userDescription": "Get examples and usage from clojuredocs.org",
"canBeReferencedInPrompt": true,
"icon": "$(globe)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {
"clojureSymbol": {
"type": "string",
"description": "The symbol to look up on clojuredocs.org"
}
},
"required": [
"clojureSymbol"
]
}
},
{
"name": "clojure_repl_output_log",
"tags": [
"clojure",
"repl",
"evaluation-results",
"stdout",
"stderr"
],
"toolReferenceName": "calva-output",
"displayName": "Calva REPL Output Log",
"modelDescription": "**Calva REPL Output** queries the REPL output log backed by Datascript. Each message is an entity with attributes: `:output/line` (monotonic integer), `:output/category` (`\"evaluationResults\"`, `\"evaluatedCode\"`, `\"evaluationOutput\"`, `\"evaluationErrorOutput\"`, `\"otherOutput\"`, `\"otherErrorOutput\"`), `:output/text`, `:output/who`, `:output/timestamp` (epoch ms), `:output/ns`, `:output/repl-session-key`.\n\n`query`: a Datalog query as EDN string. `inputs` (optional): a JSON array of values for `:in` clause parameters (after `$`, which is supplied automatically). Use `(pull ?e [*])` for all attributes, or `(pull ?e [:output/line :output/text])` for specific ones.\n\nAll messages since line 42: `query: [:find [(pull ?e [*]) ...] :in $ ?since :where [?e :output/line ?l] [(> ?l ?since)]]`, `inputs: [42]`\n\nAlways load the `backseat-driver` skill when using this tool — it has more query examples and usage guidance.",
"userDescription": "Query Calva's REPL output log with Datalog",
"canBeReferencedInPrompt": true,
"icon": "$(list-ordered)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "A Datalog query as an EDN string to run against the REPL output log. The database is passed automatically as the first `:in` argument. Prefer `pull` expressions to select only needed attributes."
},
"inputs": {
"type": "array",
"items": {},
"description": "A JSON array of values for parameterized queries. These are passed as additional `:in` arguments after `$`. Example: for `:in $ ?who ?since`, pass `[\"copilot\", 42]`."
},
"maxImages": {
"type": "number",
"description": "Maximum number of images to return from image data found in the result. Defaults to 0 (no images). Pass a positive number to include images. Images beyond this cap are replaced with <<image-N-capped>> markers in the text but not returned as image content."
}
},
"required": [
"query"
]
}
},
{
"name": "clojure_balance_brackets",
"tags": [
"clojure",
"parinfer",
"brackets",
"balance",
"structural-editing"
],
"toolReferenceName": "balance-brackets",
"displayName": "Bracket Balancer",
"modelDescription": "The **Bracket Balancer** AUTHORITATIVELY balances brackets in Clojure code. Always follow these steps when using it:\n\n1. Pass the COMPLETE text you want to balance without any modifications\n2. Use the EXACT output from this tool to replace the ENTIRE text you provided.\n\nAlways load the `editing-clojure-files` skill when using this tool.",
"userDescription": "Balance brackets in Clojure code",
"canBeReferencedInPrompt": true,
"icon": "$(bracket-error)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The COMPLETE text of the file needing bracket balancing. Do not modify this text in any way before passing it to the tool."
}
},
"required": [
"text"
]
}
},
{
"name": "clojure_edit_files",
"tags": [
"clojure",
"code-editing",
"structural-editing",
"batch-editing"
],
"toolReferenceName": "clojure-edit-files",
"displayName": "Edit Clojure Files",
"modelDescription": "**Edit Clojure Files** — perform structural editing across one or more Clojure files. Supports replace, insert, append, and create operations. Supports multiple edits across one or more files in a single call. Returns per-file diagnostics.\n\nAlways load the `editing-clojure-files` skill when using this tool.\n\nEdit types:\n- **replace**: Replace an existing top-level form identified by line number and target text\n- **insert**: Insert a new top-level form at a position identified by line number and target text\n- **append**: Append a top-level form at the end of a file\n- **create**: Create a new file with content\n\nConstraints:\n- At most one `create` per file\n- At most one `append` per file",
"userDescription": "Structural editing of Clojure files",
"canBeReferencedInPrompt": true,
"icon": "$(files)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {
"edits": {
"type": "array",
"description": "Array of edit operations to apply. Each edit specifies a file and operation type.",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"replace",
"insert",
"append",
"create"
],
"description": "The edit operation type"
},
"filePath": {
"type": "string",
"description": "Absolute path to the target file"
},
"line": {
"type": "integer",
"description": "1-based line number for targeting (required for replace/insert)"
},
"targetLineText": {
"type": "string",
"description": "Text content of the target line for verification (required for replace/insert)"
},
"newForm": {
"type": "string",
"description": "The new form content (required for replace/insert)"
},
"code": {
"type": "string",
"description": "Code to append (required for append)"
},
"content": {
"type": "string",
"description": "Full file content (required for create)"
}
},
"required": [
"type",
"filePath"
]
}
}
},
"required": [
"edits"
]
}
},
{
"name": "clojure_load_file",
"tags": [
"clojure",
"repl",
"load-file",
"needs-connected-repl"
],
"toolReferenceName": "clojure-load-file",
"displayName": "Load Clojure File",
"modelDescription": "**Load Clojure File** — loads and evaluates an entire Clojure file. Returns the string result of the last evaluated form.",
"userDescription": "Load and evaluate a Clojure file in the connected REPL.",
"canBeReferencedInPrompt": true,
"icon": "$(file-code)",
"when": ":calva-mcp-extension/activated?",
"inputSchema": {
"type": "object",
"properties": {
"filePath": {
"type": "string",
"description": "The absolute or workspace-relative path to the Clojure file to load and evaluate"
},
"replSessionKey": {
"type": "string",
"description": "The REPL session to load the file in (e.g. 'clj', 'cljs'). Without this, Calva uses its default session routing."
},
"who": {
"type": "string",
"description": "A short, stable kebab-case slug identifying you as an evaluator. Think about what the session is about and what your role is in it, then sluggify that role and use it for `who`. Reuse the same slug across all evaluations in a session."
}
},
"required": [
"filePath",
"replSessionKey",
"who"
]
}
}
]
},
"scripts": {
"clean": "rimraf .cpcache .shadow-cljs/ out/ dist/",
"preclean": "npm install",
"watch": "clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,\"1.5.1\"},cider/cider-nrepl {:mvn/version,\"0.58.0\"}}}' -M -m nrepl.cmdline --middleware \"[cider.nrepl/cider-middleware shadow.cljs.devtools.server.nrepl/middleware]\"",
"test": "node out/extension-tests.js",
"pretest": "npm run compile",
"prewatch": "npm run clean",
"compile": "npx shadow-cljs compile :extension :test-compile :stdio-wrapper",
"precompile": "npm run clean",
"release-test": "node out/extension-tests.js",
"release": "npx shadow-cljs release :extension :test-compile :stdio-wrapper",
"package": "npx vsce package --githubBranch master",
"vscode:prepublish": "npm run clean && npm run release"
},
"dependencies": {
"@vscode/codicons": "^0.0.45",
"parinfer": "^3.13.1"
},
"devDependencies": {
"@types/node": "^25.5.0",
"@vscode/test-electron": "~2.5.2",
"@vscode/vsce": "^3.7.1",
"ovsx": "~0.10.9",
"rimraf": "^6.1.3",
"shadow-cljs": "^3.4.4"
},
"extensionDependencies": [
"betterthantomorrow.calva"
]
}