forked from yshl/maxima-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
465 lines (465 loc) · 16.1 KB
/
package.json
File metadata and controls
465 lines (465 loc) · 16.1 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
{
"name": "maxima-notebook",
"displayName": "Maxima Notebook",
"description": "VS Code extension for Maxima: notebooks, debugger, language server, and AI integration",
"version": "0.3.0",
"engines": {
"vscode": "^1.99.0"
},
"categories": [
"Programming Languages",
"Debuggers",
"Notebooks"
],
"keywords": [
"maxima",
"computer algebra",
"CAS",
"notebook",
"mathematics",
"debugger",
"language server"
],
"publisher": "cmsd2",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/cmsd2/maxima-notebook.git"
},
"bugs": {
"url": "https://github.com/cmsd2/maxima-notebook/issues"
},
"homepage": "https://github.com/cmsd2/maxima-notebook#readme",
"icon": "icon.png",
"extensionPack": [
"oijaz.unicode-latex"
],
"main": "./out/extension.js",
"activationEvents": [
"onNotebook:maxima-notebook",
"onNotebook:maxima-notebook-compat"
],
"scripts": {
"compile": "node esbuild.mjs",
"watch": "node esbuild.mjs --watch",
"package": "node esbuild.mjs --production",
"vscode:prepublish": "npm run package",
"lint": "tsc --noEmit"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.0",
"@vscode/python-extension": "^1.0.6",
"katex": "^0.16.45",
"markdown-it": "^14.1.1",
"plotly.js-dist-min": "^3.5.0",
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
"@types/katex": "^0.16.8",
"@types/markdown-it": "^14.1.2",
"@types/node": "^20.0.0",
"@types/plotly.js": "^3.0.10",
"@types/vscode": "^1.82.0",
"@types/vscode-notebook-renderer": "^1.72.4",
"esbuild": "^0.21.0",
"typescript": "^5.5.0",
"vscode-notebook-renderer": "^0.0.1-security"
},
"contributes": {
"notebooks": [
{
"type": "maxima-notebook",
"displayName": "Maxima Notebook",
"selector": [
{
"filenamePattern": "*.macnb"
}
],
"priority": "default"
},
{
"type": "maxima-notebook-compat",
"displayName": "Maxima Notebook",
"selector": [
{
"filenamePattern": "*.ipynb"
}
],
"priority": "option"
}
],
"languages": [
{
"id": "maxima",
"aliases": [
"Maxima",
"maxima"
],
"extensions": [
".mac",
".max",
".wxm"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "maxima",
"scopeName": "source.maxima",
"path": "./syntaxes/maxima.tmLanguage.json"
}
],
"commands": [
{
"command": "maxima.runFile",
"title": "Maxima: Run File",
"icon": "$(play)"
},
{
"command": "maxima.notebook.restartKernel",
"title": "Maxima: Restart Kernel",
"icon": "$(debug-restart)"
},
{
"command": "maxima.notebook.interruptKernel",
"title": "Maxima: Interrupt Kernel",
"icon": "$(debug-stop)"
},
{
"command": "maxima.notebook.new",
"title": "Maxima Notebook",
"shortTitle": "Maxima Notebook"
},
{
"command": "maxima.notebook.debugNotebook",
"title": "Maxima: Debug Notebook",
"icon": "$(debug-alt)"
},
{
"command": "maxima.notebook.debugFromCell",
"title": "Maxima: Debug From This Cell",
"icon": "$(debug-alt)"
},
{
"command": "maxima.downloadTools",
"title": "Maxima: Download/Update Tools"
},
{
"command": "maxima.searchDocs",
"title": "Maxima: Search Documentation",
"icon": "$(search)"
},
{
"command": "maxima.restartLsp",
"title": "Maxima: Restart Language Server"
},
{
"command": "maxima.notebook.exportHtml",
"title": "Maxima: Export Notebook to HTML",
"icon": "$(export)"
},
{
"command": "maxima.notebook.exportPdf",
"title": "Maxima: Export Notebook to PDF",
"icon": "$(export)"
}
],
"menus": {
"editor/title/run": [
{
"command": "maxima.runFile",
"when": "editorLangId == maxima",
"group": "navigation"
}
],
"editor/context": [
{
"command": "maxima.runFile",
"when": "editorLangId == maxima",
"group": "1_run"
}
],
"notebook/toolbar": [
{
"command": "maxima.notebook.restartKernel",
"when": "notebookType == 'maxima-notebook' || notebookType == 'maxima-notebook-compat'",
"group": "navigation"
},
{
"command": "maxima.notebook.debugNotebook",
"when": "notebookType == 'maxima-notebook' || notebookType == 'maxima-notebook-compat'",
"group": "navigation"
},
{
"command": "maxima.notebook.exportHtml",
"when": "notebookType == 'maxima-notebook' || notebookType == 'maxima-notebook-compat'",
"group": "export"
},
{
"command": "maxima.notebook.exportPdf",
"when": "notebookType == 'maxima-notebook' || notebookType == 'maxima-notebook-compat'",
"group": "export"
}
],
"notebook/cell/title": [
{
"command": "maxima.notebook.debugFromCell",
"when": "notebookType == 'maxima-notebook' || notebookType == 'maxima-notebook-compat'",
"group": "2_debug"
}
],
"file/newFile": [
{
"command": "maxima.notebook.new",
"group": "notebook"
}
],
"commandPalette": [
{
"command": "maxima.runFile",
"when": "editorLangId == maxima"
},
{
"command": "maxima.notebook.debugNotebook",
"when": "notebookType == 'maxima-notebook' || notebookType == 'maxima-notebook-compat'"
},
{
"command": "maxima.notebook.debugFromCell",
"when": "notebookType == 'maxima-notebook' || notebookType == 'maxima-notebook-compat'"
}
]
},
"configuration": {
"title": "Maxima",
"properties": {
"maxima.lsp.enabled": {
"type": "boolean",
"default": true,
"description": "Enable the Maxima language server (maxima-lsp) for completions, hover, diagnostics, and more."
},
"maxima.lsp.path": {
"type": "string",
"default": "",
"description": "Absolute path to the maxima-lsp binary. If empty, searches PATH."
},
"maxima.dap.path": {
"type": "string",
"default": "",
"description": "Absolute path to the maxima-dap binary. If empty, searches PATH."
},
"maxima.maximaPath": {
"type": "string",
"default": "",
"description": "Absolute path to the maxima binary. Used by the debugger. If empty, searches PATH."
},
"maxima.notebook.mcpPath": {
"type": "string",
"default": "",
"description": "Path to aximar-mcp binary. If empty, searches PATH."
},
"maxima.notebook.evalTimeout": {
"type": "number",
"default": 60,
"description": "Cell evaluation timeout in seconds."
}
}
},
"notebookRenderer": [
{
"id": "maxima-notebook-renderer",
"displayName": "Maxima Notebook Renderer",
"entrypoint": "./out/renderers/maxima/index.js",
"mimeTypes": [
"application/x-maxima-latex",
"application/x-maxima-plotly",
"application/x-maxima-output"
],
"requiresMessaging": "never"
}
],
"languageModelTools": [
{
"name": "maxima_notebook_get_cells",
"displayName": "Get Maxima Notebook Cells",
"modelDescription": "Get all cells from the active Maxima notebook with their source code, cell type (code/markdown), execution order, and outputs including text, LaTeX math, plot indicators, and errors. Use this to understand what the user has in their notebook. Note: in Maxima the comma operator is `ev()` not a statement separator — `a, b` means `ev(a, b)`. Use $ or ; to separate statements.",
"inputSchema": {
"type": "object",
"properties": {},
"additionalProperties": false
}
},
{
"name": "maxima_notebook_run_cell",
"displayName": "Run Maxima Notebook Cell",
"modelDescription": "Execute a specific code cell in the active Maxima notebook by its zero-based index. The output appears in the notebook UI and is also returned. Use this to run existing cells or cells you just added.",
"inputSchema": {
"type": "object",
"properties": {
"cellIndex": {
"type": "number",
"description": "Zero-based index of the cell to execute"
}
},
"required": [
"cellIndex"
],
"additionalProperties": false
}
},
{
"name": "maxima_notebook_add_cell",
"displayName": "Add Maxima Notebook Cell",
"modelDescription": "Add a new cell to the active Maxima notebook. Defaults to a code cell. Set kind to \"markdown\" for documentation/notes. The cell is added but not executed — use maxima_notebook_run_cell to execute code cells after adding. Maxima syntax tips: (1) Statements ending with `;` display their result (last one renders as LaTeX), `$` suppresses output. Use `print(expr)` for explicit text or `tex(expr)` for rendered LaTeX. (2) The comma operator is NOT a statement separator — `a, b` means `ev(a, b)`. To sequence expressions use separate statements with `$` or `;`, or a `block()`. (3) Prefer Unicode Greek letters (π, α, β, θ, etc.) over % forms (%pi, %alpha) — they are translated automatically. (4) For plots, prefer `plot2d`/`plot3d` over `draw2d`/`draw3d` — plot functions produce inline SVG visible in the notebook, while draw outputs to gnuplot and won't be captured. (5) For markdown cells: content is stored verbatim, use real newlines not \\n literals, and single backslashes for LaTeX (e.g. `\\sin`, `\\varphi`). (6) Symbolic constants like %pi, %e stay symbolic even in float expressions — `cos(2*%pi*0.73)` remains unevaluated. Wrap in `float()` to force numeric evaluation when building numeric lists.",
"inputSchema": {
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "The content for the new cell (Maxima code or markdown text)"
},
"afterIndex": {
"type": "number",
"description": "Insert after this cell index (0-based). If omitted, appends at the end."
},
"kind": {
"type": "string",
"enum": [
"code",
"markdown"
],
"description": "Cell type: \"code\" (default) for Maxima code, \"markdown\" for rich text."
}
},
"required": [
"source"
],
"additionalProperties": false
}
},
{
"name": "maxima_debug_variables",
"displayName": "Get Debug Variables",
"modelDescription": "Get variables from the current stack frame of an active Maxima debug session. Returns scope names (Arguments, Locals) with variable names, values, and types. Only works when execution is paused at a breakpoint.",
"inputSchema": {
"type": "object",
"properties": {},
"additionalProperties": false
}
},
{
"name": "maxima_debug_evaluate",
"displayName": "Evaluate Debug Expression",
"modelDescription": "Evaluate a Maxima expression in the context of the current debug breakpoint. The expression is evaluated in the Maxima debugger's REPL context with access to local variables and arguments. Only works when execution is paused at a breakpoint.",
"inputSchema": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "Maxima expression to evaluate at the current breakpoint"
}
},
"required": [
"expression"
],
"additionalProperties": false
}
},
{
"name": "maxima_debug_callstack",
"displayName": "Get Debug Call Stack",
"modelDescription": "Get the current call stack from an active Maxima debug session. Returns frame names, source file paths, and line numbers. Only works when execution is paused at a breakpoint.",
"inputSchema": {
"type": "object",
"properties": {},
"additionalProperties": false
}
}
],
"mcpServerDefinitionProviders": [
{
"id": "maxima.mcpServer",
"label": "Maxima MCP Server"
}
],
"breakpoints": [
{
"language": "maxima"
}
],
"debuggers": [
{
"type": "maxima",
"languages": [
"maxima"
],
"label": "Maxima Debug",
"configurationAttributes": {
"launch": {
"required": [
"program"
],
"properties": {
"program": {
"type": "string",
"description": "Absolute path to the .mac file to debug.",
"default": "${file}"
},
"evaluate": {
"type": "string",
"description": "Expression to evaluate after loading the program (e.g. \"main()\").",
"default": ""
},
"stopOnEntry": {
"type": "boolean",
"description": "Stop on the first statement.",
"default": false
},
"maximaPath": {
"type": "string",
"description": "Path to the maxima binary. Overrides maxima.maximaPath setting.",
"default": ""
},
"evalTimeout": {
"type": "number",
"description": "Evaluation timeout in seconds. If an expression takes longer, Maxima is interrupted. Set to 0 to disable. Default: 60.",
"default": 60
}
}
}
},
"initialConfigurations": [
{
"type": "maxima",
"request": "launch",
"name": "Debug Maxima File",
"program": "${file}",
"evaluate": ""
}
],
"configurationSnippets": [
{
"label": "Maxima: Debug File",
"description": "Load a .mac file and debug it.",
"body": {
"type": "maxima",
"request": "launch",
"name": "Debug ${1:file}",
"program": "^\"\\${file}\"",
"evaluate": "${2:main()}"
}
}
]
}
]
},
"configurationDefaults": {
"[maxima]": {
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "Maxima syntax rules: (1) Statements end with `;` (display result) or `$` (suppress output). In notebooks the last expression's result is automatically rendered as LaTeX, so you don't need `tex()` for that — use `print(expr)` only for intermediate output. (2) The comma operator is NOT a statement separator — `a, b` means `ev(a, b)`. To sequence expressions use separate statements with `$` or `;`, or wrap in `block()`. (3) Prefer Unicode Greek letters (π, α, β, θ) over %pi, %alpha etc. — they are translated automatically. (4) For plots, prefer `plot2d`/`plot3d` over `draw2d`/`draw3d` — plot functions produce inline SVG in notebooks, while draw outputs to gnuplot and won't be captured. (5) Assignment uses `:` not `=`. The `=` operator creates equations. (6) Function definition uses `:=` e.g. `f(x) := x^2;`. (7) Symbolic constants like %pi, %e stay symbolic even in float expressions — `cos(2*%pi*0.73)` stays unevaluated. Wrap in `float()` to force numeric evaluation when building numeric lists."
}
]
}
}
}