Scaffold Diagrammer VS Code extension: custom diagram editor with drag/drop shapes, labels, connectors and JSON save
This is a well-structured scaffold: a pure diagram model with thorough validation, a `CustomEditorProvider` with proper undo/redo, save, revert and backup through VS Code edit events, a nonce-protected CSP webview, the New Diagram command and a complete README. The visible unit tests for round-trip and malformed input are solid. However, no CI ran, the integration tests were never executed, and the diff is truncated so the webview canvas and several tests could not be reviewed. Backers should treat it as promising but unverified until someone builds it and tries it in VS Code.
Acceptance criteria · 4 of 8 met
- UNCLEAR`npm run compile`, `npm run lint` and `npm test` passThe scripts are defined sensibly in `package.json` and the builder reports 54 passing tests, but no CI ran to confirm this.
- YESUnit tests cover serialize/deserialize round-trip of the diagram model`diagram.test.ts` has 'round-trips a diagram through serialize/parse' and 'round-trips every node type', plus file-format shape checks.
- UNCLEARUnit tests cover adding/removing nodes and edges, including cascade delete of edges`removeNode` filters connected edges and the test file imports `removeNode`/`removeEdge`/`removeElement`, but the 'adding and removing' describe block is cut off by the truncation.
- UNCLEARUnit tests cover edge endpoints updating when a node moves (model level)`getEdgeEndpoints` derives endpoints from node geometry and `moveNode`/`getEdgeEndpoints` are imported in the tests, but the actual test is in the truncated section.
- YESUnit tests cover rejection or graceful handling of malformed JSONThe 'malformed input' suite asserts a `DiagramParseError` for 14 invalid inputs (bad syntax, wrong types, unknown type, duplicate ids, future version) and checks that dangling edges are dropped.
- PARTIALOpening a `.diagram.json` file opens the custom editor and renders existing nodes and edges`package.json` registers `diagrammer.diagramEditor` for `*.diagram.json` with default priority and `resolveCustomEditor` sends an `init` message; the webview renderer is truncated and the integration test asserting 3 nodes and 2 edges was never run.
- YESThe `Diagrammer: New Diagram` command is registered and creates a valid empty diagram fileThe command is contributed in `package.json` and registered in `extension.ts`; `newDiagram.ts` writes `serializeDiagram(createEmptyDiagram())` to a free `untitled[-N].diagram.json` and opens it with the custom editor.
- YESREADME documents features, file format and how to run the extension`README.md` has Features, File format (with a field table and loading rules), Running the extension and Development sections.
- No CI ran on this commit, and the VS Code integration tests (`npm run test:integration`) were never executed. The only evidence that compile/lint/test pass and that the editor actually opens and renders in VS Code is the builder's own report; someone should do a manual F5 check.
- The diff is truncated. `src/webview/main.ts` (the canvas, palette, drag/connect/delete/label interactions), the rest of `diagram.test.ts`, `webview.test.ts` and the `test-fixtures/workspace` files used by `runTest.ts` are not visible, so the interaction requirements and several tested behaviours could not be reviewed.
- `DiagramEditorProvider` applies the `diagram` from webview `edit` messages without re-validating it (no `validateDiagram` call on the host side). A buggy webview message could be written straight to disk on save.
- When a file failed to parse, `saveAs`/`backup` silently return without writing. VS Code will then treat the save as successful, and the backup id points at a file that was never written, so hot-exit restore of such a document would fail to read it.
- `@vscode/test-electron@3.1.0` declares `engines.node >=22`, but the README states Node 20.19+ is supported. The integration test script may not run on Node 20.
CI details
No CI checks ran on this commit.
Accepted by the backers and merged by the maintainer.
Ballots · 1
Automated review cost $0.43, counted as builder cost.
Motivation
The repository has no extension yet. This first commit creates a VS Code extension that lets users draw quick diagrams and save them as files in their workspace.
Scope
- Scaffold a TypeScript VS Code extension:
package.jsonwith a contributes section,tsconfig, a bundler (esbuild), lint,npm testusing@vscode/test-electronor a unit runner, and a README.
- Custom editor (
CustomEditorProvider) registered for*.diagram.json.- Assumption: the file format is JSON with
{ version, nodes: [{id, type, x, y, width, height, label}], edges: [{id, from, to, label?}] }.
- Assumption: the file format is JSON with
- Command
Diagrammer: New Diagramcreatesuntitled.diagram.jsonin the workspace and opens it. - Webview canvas rendered with plain SVG and TypeScript.
- Assumption: no third-party diagram library.
- Includes a palette with these shapes: rectangle, rounded rectangle, ellipse, diamond, text label and sticky note.
- Interactions:
- Drag a shape from the palette onto the canvas.
- Move a node by dragging it.
- Double-click a node or edge to edit its label.
- Create a connector by dragging from a node's handle to another node. The connector stays attached when either node moves.
- Select an element and press Delete to remove it. Deleting a node also removes its edges.
- Persistence: edits mark the document dirty,
Ctrl+Swrites the file, and undo/redo works via VS Code edit integration.
Acceptance criteria
npm run compile,npm run lintandnpm testpass.- Unit tests cover:
- Serialize/deserialize round-trip of the diagram model.
- Adding and removing nodes and edges, including the cascade delete of edges.
- Edge endpoints updating when a node moves (model level).
- Rejection or graceful handling of malformed JSON.
- Opening a
.diagram.jsonfile opens the custom editor and renders the existing nodes and edges. - The
Diagrammer: New Diagramcommand is registered and creates a valid empty diagram file. - The README documents the features, the file format and how to run the extension.
Out of scope
- AI and language-model integration.
- Export to PNG or SVG.
- Collaboration.
- Auto-layout.
- Themes beyond respecting VS Code colour variables.
- Marketplace publishing.
Model claude-opus-5-5 · ceiling $16.25 · started 1 month ago · finished 1 month ago
- Double-click (or `Enter`/`F2`) to edit a label. - `Delete`/`Backspace` to remove the selected item. - Colours taken from VS Code's theme. - Labels are always shown as plain text, so a label can't inject HTML. - **`src/protocol.ts`:** the messages passed between the extension and the canvas. - **`README.md`:** features, the file format, and how to build, run and test. ## Tests - `src/test/unit/diagram.test.ts`: saving and reloading gives back the same diagram, malformed and invalid input, adding and removing (including connected edges being removed with a node), connector ends following a moved node, and the geometry functions. - `src/test/unit/webview.test.ts`: loads the real canvas code into a simulated browser (`jsdom`). It checks that existing nodes, edges and labels are drawn, and that dropping a shape, moving, connecting, deleting, editing a label, updates from VS Code and the error screen all work. - `src/test/integration/` (needs a real VS Code via `@vscode/test-electron`, not run here): checks that the command is registered, that opening `sample.diagram.json` uses the custom editor and draws 3 nodes and 2 edges, that New Diagram creates a valid empty file without overwriting an existing one, and that a malformed file is left untouched after saving. ## Things to look at - **Manual check:** press F5 and try drag-and-drop from the palette, `Ctrl+Z` while the canvas has focus, and `Ctrl+S`. - **Integration tests:** run `npm run test:integration` (on Linux: `xvfb-run -a npm run test:integration`) somewhere that can download VS Code. - **Extra hook for tests:** `activate()` returns a small API (`onDidRender`), and the canvas sends a `rendered` message with node and edge counts. These exist only so the integration test can confirm the file was actually drawn. - **Rules I chose for unclear cases:** connectors are one-way (`from` → `to`) and drawn with an arrow. Connecting a node to itself, or adding a second connector between the same pair in the same direction, does nothing. Nodes can't be dragged to negative coordinates. - **Dependency versions:** TypeScript is pinned to `~5.9` because typescript-eslint doesn't support TypeScript 7 yet. ESLint 9 uses the newer flat config file. Development needs Node 20.19+ (because of mocha 12 and jsdom 29). - **Commit author:** the repo already had a git identity configured, but I committed as "nabled builder" <builder@nabled.dev>. 2026-10-03T17:29:06Z [claude] The Diagrammer extension is built and pushed to `nabled/feature-13-job-11`. `npm run compile`, `npm run lint` and `npm test` all pass here (54 tests). The VS Code end-to-end tests are written but haven't run, because this sandbox couldn't download VS Code (the download server was blocked). Nobody has used the editor in a real VS Code window yet. **What it does:** - **Opening files:** `*.diagram.json` files open in a canvas editor drawn with plain SVG. There's a palette with the six shapes: rectangle, rounded rectangle, ellipse, diamond, text label and sticky note. - **Editing:** - Drag a shape from the palette onto the canvas, or click it to add it. - Drag a node to move it; its connectors stay attached. - Double-click a node or connector to edit its label. - Drag from a node's handle onto another node to connect them. - Select an item and press `Delete` to remove it; deleting a node also removes its connectors. - **Saving and undo:** edits mark the file as modified, `Ctrl+S` saves, and undo/redo use VS Code's own history. - **Bad files:** a file that isn't valid JSON or doesn't match the format shows an error message instead of the canvas, and is never overwritten. - **`Diagrammer: New Diagram`:** creates `untitled.diagram.json` in the workspace, or `untitled-1.diagram.json` and so on if the name is taken, then opens it. **Tests:** - **Model:** saving and reloading gives back the same diagram, adding and removing nodes and edges (including the connected-edge removal), connector ends following a moved node, and rejection of malformed JSON. All required by the spec. - **Canvas:** the real canvas code runs in a simulated browser (`jsdom`). This checks that existing nodes and edges are drawn, and that dropping, moving, connecting, deleting and label editing work. It doesn't replace a check in real VS Code. **Before merging:** 1. Run `npm run test:integration` somewhere that can download VS Code (on Linux, wrap it in `xvfb-run -a`). 2. Press F5 and try a few things by hand, especially dragging from the palette, `Ctrl+Z` while the canvas has focus, and `Ctrl+S`. **Choices I made where the spec was silent:** - Connectors have a direction (from → to) and an arrow head. - Connecting a node to itself, or adding a second connector between the same pair in the same direction, does nothing. - Nodes can't be dragged to negative positions. - To let the end-to-end test confirm a file was actually drawn, the canvas reports how many nodes and edges it rendered, and the extension passes that on. It's only there for testing. - TypeScript is pinned to 5.9 because the lint tooling doesn't support TypeScript 7 yet, and working on the project needs Node 20.19 or newer. - The repo already had a git identity set up, but I committed as "nabled builder" anyway. The README covers the features, the file format, and how to build, run and test. 2026-10-03T17:29:07Z Changed files: added .gitignore +5 -0 added .vscode/launch.json +13 -0 added .vscode/tasks.json +25 -0 added .vscodeignore +12 -0 modified README.md +93 -2 added esbuild.js +64 -0 added eslint.config.mjs +24 -0 added media/diagram.css +207 -0 added package-lock.json +3339 -0 added package.json +67 -0 added src/diagramEditor.ts +290 -0 added src/extension.ts +18 -0 added src/model/diagram.ts +441 -0 added src/newDiagram.ts +50 -0 added src/protocol.ts +14 -0 added src/test/integration/runTest.ts +28 -0 added src/test/integration/suite/extension.test.ts +101 -0 added src/test/integration/suite/index.ts +22 -0 added src/test/unit/diagram.test.ts +296 -0 added src/test/unit/webview.test.ts +279 -0 added src/webview/main.ts +606 -0 added test-fixtures/workspace/broken.diagram.json +1 -0 added test-fixtures/workspace/sample.diagram.json +12 -0 added tsconfig.json +18 -0 2026-10-03T17:29:09Z Opened pull request https://github.com/nabledhq/diagrammerext/pull/1 2026-10-03T17:29:09Z Finished: success=true turns=30 tokens(in/out)=1271987/57905 list cost=$1.76
Show patch
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..64c3490
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+node_modules/
+dist/
+out/
+.vscode-test/
+*.vsix
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..3c25536
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,13 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Run Extension",
+ "type": "extensionHost",
+ "request": "launch",
+ "args": ["--extensionDevelopmentPath=${workspaceFolder}"],
+ "outFiles": ["${workspaceFolder}/dist/**/*.js"],
+ "preLaunchTask": "npm: compile"
+ }
+ ]
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..603164e
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,25 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "type": "npm",
+ "script": "compile",
+ "group": { "kind": "build", "isDefault": true },
+ "problemMatcher": "$tsc"
+ },
+ {
+ "type": "npm",
+ "script": "watch",
+ "isBackground": true,
+ "problemMatcher": {
+ "owner": "esbuild",
+ "pattern": { "regexp": "^✘ \\[ERROR\\] (.*)$", "message": 1 },
+ "background": {
+ "activeBegins": true,
+ "beginsPattern": "^\\[watch\\] build started",
+ "endsPattern": "^\\[watch\\] build finished"
+ }
+ }
+ }
+ ]
+}
diff --git a/.vscodeignore b/.vscodeignore
new file mode 100644
index 0000000..225e8db
--- /dev/null
+++ b/.vscodeignore
@@ -0,0 +1,12 @@
+.vscode/**
+.vscode-test/**
+src/**
+out/**
+node_modules/**
+.gitignore
+esbuild.js
+eslint.config.mjs
+tsconfig.json
+**/*.map
+**/*.ts
+test-fixtures/**
diff --git a/README.md b/README.md
index d3d3f41..cf993b5 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,93 @@
-# diagrammerext
-Diagrammer is a vscode extension that allows users and ai to create quick diagrams for coding
+# Diagrammer
+
+Diagrammer is a VS Code extension that allows users and AI to create quick diagrams for coding.
+Diagrams are stored as plain JSON (`*.diagram.json`) files right next to your code, so they can be
+reviewed, diffed and versioned like any other file.
+
+## Features
+
+- **Custom diagram editor** – any file ending in `.diagram.json` opens in a visual canvas
+ (use *Reopen Editor With… → Text Editor* to see the raw JSON).
+- **`Diagrammer: New Diagram` command** – creates `untitled.diagram.json` in the first workspace
+ folder (`untitled-1.diagram.json`, `untitled-2.diagram.json`, … if the name is taken) and opens
+ it. Without an open folder you are asked where to save the file.
+- **Shape palette** – rectangle, rounded rectangle, ellipse, diamond, text label and sticky note.
+ Drag a shape onto the canvas, or click it to drop it in the middle of the visible area.
+- **Move** – drag a node to move it. Connectors stay attached and re-route to the shape outline.
+- **Labels** – double-click a node or connector (or select it and press `Enter`/`F2`) to edit its
+ label. `Enter` saves, `Shift+Enter` inserts a line break, `Escape` cancels.
+- **Connectors** – hover a node to reveal its four handles, then drag from a handle onto another
+ node to connect them. Connectors are directed (`from` → `to`) and drawn with an arrow head.
+- **Delete** – click a node or connector to select it and press `Delete` (or `Backspace`).
+ Deleting a node also deletes every connector attached to it.
+- **VS Code integration** – edits mark the file dirty, `Ctrl+S`/`Cmd+S` saves, and
+ `Ctrl+Z`/`Ctrl+Y` (or `Cmd+Z`/`Cmd+Shift+Z`) undo and redo through VS Code's edit history. Hot
+ exit/backups, *Save As* and *Revert File* are supported. Colours follow the active VS Code theme.
+- **Safe with bad files** – a file that is not valid JSON or does not match the format below is
+ shown with an error message instead of the canvas and is never overwritten.
+
+## File format
+
+```json
+{
+ "version": 1,
+ "nodes": [
+ { "id": "node-1", "type": "rectangle", "x": 40, "y": 40, "width": 140, "height": 70, "label": "Client" },
+ { "id": "node-2", "type": "ellipse", "x": 300, "y": 40, "width": 140, "height": 80, "label": "API" }
+ ],
+ "edges": [
+ { "id": "edge-1", "from": "node-1", "to": "node-2", "label": "HTTP" }
+ ]
+}
+```
+
+| Field | Description |
+| --- | --- |
+| `version` | Format version. Currently always `1`; files with a newer version are rejected. |
+| `nodes[].id` | Unique, non-empty string. |
+| `nodes[].type` | One of `rectangle`, `roundedRectangle`, `ellipse`, `diamond`, `text`, `sticky`. |
+| `nodes[].x`, `nodes[].y` | Top-left corner in canvas pixels. |
+| `nodes[].width`, `nodes[].height` | Size in canvas pixels. |
+| `nodes[].label` | Text shown in the shape; may contain `\n` line breaks. |
+| `edges[].id` | Unique, non-empty string. |
+| `edges[].from`, `edges[].to` | Ids of the source and target nodes. |
+| `edges[].label` | Optional connector label (omitted when empty). |
+
+When loading, an empty file is treated as an empty diagram, unknown extra properties are ignored
+and edges whose `from`/`to` point to missing nodes are dropped. Anything else that does not match
+the format (invalid JSON, wrong types, unknown node types, duplicate ids) is reported as an error.
+
+## Running the extension
+
+Requirements: Node.js 20.19+ (or 22.13+) and VS Code 1.85+.
+
+```bash
+npm install
+npm run compile # type-check and bundle into dist/ with esbuild
+```
+
+Then open this folder in VS Code and press `F5` (*Run Extension*) to start an Extension
+Development Host. In it, run **Diagrammer: New Diagram** from the Command Palette or open any
+`*.diagram.json` file. `npm run watch` rebuilds automatically while you edit.
+
+## Development
+
+| Script | Purpose |
+| --- | --- |
+| `npm run compile` | Type-check (`tsc --noEmit`) and bundle the extension and webview with esbuild. |
+| `npm run watch` | Rebuild on change. |
+| `npm run lint` | Run ESLint (typescript-eslint) over `src/`. |
+| `npm test` | Compile and run the unit tests with Mocha (model + webview canvas in jsdom). |
+| `npm run test:integration` | Launch VS Code via `@vscode/test-electron` and run the end-to-end tests. Downloads VS Code on first run; on Linux CI wrap it in `xvfb-run -a`. |
+| `npm run package` | Production (minified) bundle. |
+
+Project layout:
+
+- `src/extension.ts` – activation; registers the editor and the command.
+- `src/diagramEditor.ts` – `CustomEditorProvider`, document model, save/revert/backup, undo/redo.
+- `src/newDiagram.ts` – the `Diagrammer: New Diagram` command.
+- `src/model/diagram.ts` – pure diagram model: parsing/validation, serialization, edits, geometry.
+ Shared by the extension host and the webview.
+- `src/webview/main.ts`, `media/diagram.css` – the SVG canvas (no third-party diagram library).
+- `src/protocol.ts` – messages exchanged between the extension host and the webview.
+- `src/test/unit` – Mocha unit tests; `src/test/integration` – VS Code integration tests.
diff --git a/esbuild.js b/esbuild.js
new file mode 100644
index 0000000..48aa465
--- /dev/null
+++ b/esbuild.js
@@ -0,0 +1,64 @@
+const esbuild = require('esbuild');
+
+const production = process.argv.includes('--production');
+const watch = process.argv.includes('--watch');
+
+/** @type {import('esbuild').Plugin} */
+const problemMatcherPlugin = {
+ name: 'esbuild-problem-matcher',
+ setup(build) {
+ build.onStart(() => console.log('[watch] build started'));
+ build.onEnd((result) => {
+ for (const { text, location } of result.errors) {
+ console.error(`✘ [ERROR] ${text}`);
+ if (location) {
+ console.error(` ${location.file}:${location.line}:${location.column}:`);
+ }
+ }
+ console.log('[watch] build finished');
+ });
+ },
+};
+
+const shared = {
+ bundle: true,
+ minify: production,
+ sourcemap: !production,
+ sourcesContent: false,
+ logLevel: watch ? 'silent' : 'warning',
+ plugins: watch ? [problemMatcherPlugin] : [],
+};
+
+async function main() {
+ const contexts = await Promise.all([
+ // Extension host bundle (Node.js, CommonJS; `vscode` is provided at runtime).
+ esbuild.context({
+ ...shared,
+ entryPoints: ['src/extension.ts'],
+ outfile: 'dist/extension.js',
+ platform: 'node',
+ format: 'cjs',
+ external: ['vscode'],
+ }),
+ // Webview bundle (browser, self-contained script).
+ esbuild.context({
+ ...shared,
+ entryPoints: ['src/webview/main.ts'],
+ outfile: 'dist/webview.js',
+ platform: 'browser',
+ format: 'iife',
+ target: 'es2022',
+ }),
+ ]);
+ if (watch) {
+ await Promise.all(contexts.map((ctx) => ctx.watch()));
+ } else {
+ await Promise.all(contexts.map((ctx) => ctx.rebuild()));
+ await Promise.all(contexts.map((ctx) => ctx.dispose()));
+ }
+}
+
+main().catch((e) => {
+ console.error(e);
+ process.exit(1);
+});
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 0000000..97f2870
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,24 @@
+import eslint from '@eslint/js';
+import tseslint from 'typescript-eslint';
+
+export default tseslint.config(
+ { ignores: ['dist/**', 'out/**', '.vscode-test/**', 'node_modules/**'] },
+ eslint.configs.recommended,
+ ...tseslint.configs.recommended,
+ {
+ files: ['src/**/*.ts'],
+ rules: {
+ curly: 'warn',
+ eqeqeq: 'warn',
+ 'no-throw-literal': 'warn',
+ '@typescript-eslint/naming-convention': [
+ 'warn',
+ { selector: 'import', format: ['camelCase', 'PascalCase'] },
+ ],
+ '@typescript-eslint/no-unused-vars': [
+ 'error',
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
+ ],
+ },
+ },
+);
diff --git a/media/diagram.css b/media/diagram.css
new file mode 100644
index 0000000..366d30d
--- /dev/null
+++ b/media/diagram.css
@@ -0,0 +1,207 @@
+html,
+body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+}
+
+body {
+ color: var(--vscode-editor-foreground);
+ background: var(--vscode-editor-background);
+ font-family: var(--vscode-font-family);
+ font-size: var(--vscode-font-size);
+}
+
+#app {
+ display: flex;
+ height: 100%;
+}
+
+#app[hidden],
+#error[hidden] {
+ display: none;
+}
+
+/* Palette ---------------------------------------------------------------- */
+
+#palette {
+ flex: 0 0 auto;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ padding: 8px;
+ border-right: 1px solid var(--vscode-panel-border, var(--vscode-widget-border, transparent));
+ background: var(--vscode-sideBar-background, var(--vscode-editor-background));
+ overflow-y: auto;
+}
+
+.palette-item {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 2px;
+ width: 76px;
+ padding: 6px 4px;
+ border: 1px solid transparent;
+ border-radius: 4px;
+ background: transparent;
+ color: var(--vscode-foreground);
+ font: inherit;
+ font-size: 11px;
+ cursor: grab;
+}
+
+.palette-item:hover {
+ background: var(--vscode-list-hoverBackground);
+}
+
+.palette-item:focus-visible {
+ outline: 1px solid var(--vscode-focusBorder);
+}
+
+.palette-text {
+ fill: var(--vscode-foreground);
+ font-size: 14px;
+}
+
+/* Canvas ----------------------------------------------------------------- */
+
+#canvas-container {
+ position: relative;
+ flex: 1 1 auto;
+ overflow: auto;
+ outline: none;
+}
+
+#canvas {
+ display: block;
+ user-select: none;
+}
+
+.shape {
+ fill: var(--vscode-editorWidget-background, var(--vscode-editor-background));
+ stroke: var(--vscode-editor-foreground);
+ stroke-width: 1.5;
+}
+
+.node {
+ cursor: move;
+}
+
+.node-text .shape {
+ fill: transparent;
+ stroke: transparent;
+}
+
+.node-text:hover .shape,
+.node-text.selected .shape {
+ stroke: var(--vscode-editorIndentGuide-background, var(--vscode-editor-foreground));
+ stroke-dasharray: 4 3;
+}
+
+.node-sticky .shape {
+ fill: #fff3a0;
+ stroke: #d4b800;
+}
+
+.node-sticky .sticky-fold {
+ fill: #e8d36a;
+ stroke: #d4b800;
+ stroke-width: 1;
+}
+
+.node-sticky .node-label {
+ fill: #333;
+}
+
+.node-label,
+.edge-label {
+ fill: var(--vscode-editor-foreground);
+ font-size: 13px;
+ pointer-events: none;
+}
+
+.node.selected .shape {
+ stroke: var(--vscode-focusBorder);
+ stroke-width: 2.5;
+}
+
+.node.connect-target .shape {
+ stroke: var(--vscode-focusBorder);
+ stroke-width: 3;
+ stroke-dasharray: 6 3;
+}
+
+.handle {
+ fill: var(--vscode-focusBorder);
+ stroke: var(--vscode-editor-background);
+ stroke-width: 1;
+ cursor: crosshair;
+ opacity: 0;
+}
+
+.node:hover .handle,
+.node.selected .handle {
+ opacity: 1;
+}
+
+.edge {
+ cursor: pointer;
+}
+
+.edge-line {
+ stroke: var(--vscode-editor-foreground);
+ stroke-width: 1.5;
+ fill: none;
+}
+
+.edge-hit {
+ stroke: transparent;
+ stroke-width: 12;
+}
+
+.edge.selected .edge-line {
+ stroke: var(--vscode-focusBorder);
+ stroke-width: 2.5;
+}
+
+.edge-preview {
+ stroke: var(--vscode-focusBorder);
+ stroke-dasharray: 5 4;
+ pointer-events: none;
+}
+
+.edge-label-bg {
+ fill: var(--vscode-editor-background);
+ pointer-events: none;
+}
+
+.arrowhead {
+ fill: var(--vscode-editor-foreground);
+}
+
+.label-editor {
+ position: absolute;
+ box-sizing: border-box;
+ min-height: 28px;
+ padding: 4px;
+ resize: none;
+ text-align: center;
+ color: var(--vscode-input-foreground);
+ background: var(--vscode-input-background);
+ border: 1px solid var(--vscode-focusBorder);
+ font-family: var(--vscode-font-family);
+ font-size: 13px;
+ z-index: 1;
+}
+
+/* Errors ----------------------------------------------------------------- */
+
+#error {
+ margin: 16px;
+ padding: 12px;
+ border: 1px solid var(--vscode-inputValidation-errorBorder, red);
+ background: var(--vscode-inputValidation-errorBackground, transparent);
+ white-space: pre-wrap;
+}
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..669a317
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,3339 @@
+{
+ "name": "diagrammer",
+ "version": "0.0.1",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "diagrammer",
+ "version": "0.0.1",
+ "license": "MIT",
+ "devDependencies": {
+ "@eslint/js": "^9.39.5",
+ "@types/jsdom": "^30.0.0",
+ "@types/mocha": "^10.0.10",
+ "@types/node": "^20.19.43",
+ "@types/vscode": "~1.85.0",
+ "@vscode/test-electron": "^3.1.0",
+ "esbuild": "^0.28.2",
+ "eslint": "^9.39.5",
+ "jsdom": "^29.1.1",
+ "mocha": "^12.0.3",
+ "typescript": "~5.9",
+ "typescript-eslint": "^8.71.0"
+ },
+ "engines": {
+ "vscode": "^1.85.0"
+ }
+ },
+ "node_modules/@asamuzakjp/css-color": {
+ "version": "5.1.11",
+ "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-5.1.11.tgz",
+ "integrity": "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@asamuzakjp/generational-cache": "^1.0.1",
+ "@csstools/css-calc": "^3.2.0",
+ "@csstools/css-color-parser": "^4.1.0",
+ "@csstools/css-parser-algorithms": "^4.0.0",
+ "@csstools/css-tokenizer": "^4.0.0"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ }
+ },
+ "node_modules/@asamuzakjp/dom-selector": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-7.1.1.tgz",
+ "integrity": "sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@asamuzakjp/generational-cache": "^1.0.1",
+ "@asamuzakjp/nwsapi": "^2.3.9",
+ "bidi-js": "^1.0.3",
+ "css-tree": "^3.2.1",
+ "is-potential-custom-element-name": "^1.0.1"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ }
+ },
+ "node_modules/@asamuzakjp/generational-cache": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@asamuzakjp/generational-cache/-/generational-cache-1.0.1.tgz",
+ "integrity": "sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ }
+ },
+ "node_modules/@asamuzakjp/nwsapi": {
+ "version": "2.3.9",
+ "resolved": "https://registry.npmjs.org/@asamuzakjp/nwsapi/-/nwsapi-2.3.9.tgz",
+ "integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@bramus/specificity": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/@bramus/specificity/-/specificity-2.4.2.tgz",
+ "integrity": "sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "css-tree": "^3.0.0"
+ },
+ "bin": {
+ "specificity": "bin/cli.js"
+ }
+ },
+ "node_modules/@csstools/color-helpers": {
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.1.2.tgz",
+ "integrity": "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT-0",
+ "engines": {
+ "node": ">=20.19.0"
+ }
+ },
+ "node_modules/@csstools/css-calc": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.3.tgz",
+ "integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "@csstools/css-parser-algorithms": "^4.0.2",
+ "@csstools/css-tokenizer": "^4.0.2"
+ }
+ },
+ "node_modules/@csstools/css-color-parser": {
+ "version": "4.2.6",
+ "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.2.6.tgz",
+ "integrity": "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@csstools/color-helpers": "^6.1.2",
+ "@csstools/css-calc": "^3.4.3"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "@csstools/css-parser-algorithms": "^4.0.2",
+ "@csstools/css-tokenizer": "^4.0.2"
+ }
+ },
+ "node_modules/@csstools/css-parser-algorithms": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz",
+ "integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "peerDependencies": {
+ "@csstools/css-tokenizer": "^4.0.2"
+ }
+ },
+ "node_modules/@csstools/css-syntax-patches-for-csstree": {
+ "version": "1.1.15",
+ "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz",
+ "integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT-0",
+ "peerDependencies": {
+ "css-tree": "^3.2.1"
+ },
+ "peerDependenciesMeta": {
+ "css-tree": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@csstools/css-tokenizer": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz",
+ "integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.19.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",
+ "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",
+ "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",
+ "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",
+ "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",
+ "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",
+ "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",
+ "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",
+ "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",
+ "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",
+ "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",
+ "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",
+ "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",
+ "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",
+ "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",
+ "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",
+ "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",
+ "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",
+ "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",
+ "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",
+ "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",
+ "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",
+ "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",
+ "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",
+ "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.10.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz",
+ "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "eslint-visitor-keys": "^3.4.3"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ }
+ },
+ "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.12.2",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
+ "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@eslint/config-array": {
+ "version": "0.21.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz",
+ "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/object-schema": "^2.1.7",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.5"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/config-helpers": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/core": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@types/json-schema": "^7.0.15"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/eslintrc": {
+ "version": "3.3.7",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.7.tgz",
+ "integrity": "sha512-F42g89Qd5oAWtp0k0nnSrjziAKza7w8SVT4mStc18LZMaRb4J1HQAHLCalEtDCxrTuksx7NU9qsmeLwpOfPqWw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^6.14.0",
+ "debug": "^4.3.2",
+ "espree": "^10.0.1",
+ "globals": "^14.0.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.3.2",
+ "minimatch": "^3.1.5",
+ "strip-json-comments": "^3.1.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@eslint/js": {
+ "version": "9.39.5",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.5.tgz",
+ "integrity": "sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ }
+ },
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0",
+ "levn": "^0.4.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@exodus/bytes": {
+ "version": "1.16.0",
+ "resolved": "https://registry.npmjs.org/@exodus/bytes/-/bytes-1.16.0.tgz",
+ "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ },
+ "peerDependencies": {
+ "@noble/hashes": "^1.8.0 || ^2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@noble/hashes": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@humanfs/core": {
+ "version": "0.19.2",
+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz",
+ "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@humanfs/types": "^0.15.0"
+ },
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/node": {
+ "version": "0.16.8",
+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz",
+ "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@humanfs/core": "^0.19.2",
+ "@humanfs/types": "^0.15.0",
+ "@humanwhocodes/retry": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/types": {
+ "version": "0.15.0",
+ "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz",
+ "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.22"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@humanwhocodes/retry": {
+ "version": "0.4.3",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
+ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/jsdom": {
+ "version": "30.0.0",
+ "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-30.0.0.tgz",
+ "integrity": "sha512-uAHGxujGE0cDaKGdK28zgDotFtNA7MKq5DXl8LrfdxdCI8VHcg15oJz+amHTChPNI5JpgEPQWc2xFdrw3em/nQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*",
+ "@types/tough-cookie": "*",
+ "parse5": "^8.0.0",
+ "undici-types": "^8.9.0"
+ }
+ },
+ "node_modules/@types/jsdom/node_modules/undici-types": {
+ "version": "8.11.2",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.11.2.tgz",
+ "integrity": "sha512-iMVNmWZ0leK/goS6eXMizSzmm9CDWtyphwbaCms3DNLqRxDL+mMoNVcZMTyyVgXP0N+Z8neAMzDoUOUJL8veKg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/json-schema": {
+ "version": "7.0.15",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
+ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/mocha": {
+ "version": "10.0.10",
+ "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz",
+ "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "20.19.43",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",
+ "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
+ },
+ "node_modules/@types/tough-cookie": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz",
+ "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/vscode": {
+ "version": "1.85.0",
+ "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.85.0.tgz",
+ "integrity": "sha512-CF/RBon/GXwdfmnjZj0WTUMZN5H6YITOfBCP4iEZlOtVQXuzw6t7Le7+cR+7JzdMrnlm7Mfp49Oj2TuSXIWo3g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@typescript-eslint/eslint-plugin": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.71.0.tgz",
+ "integrity": "sha512-pqcS9c1HxZTHt7End4nXqd0s5lJrrFzrgCkKFJrsbUnaL6M3+6oBFZaslg6Gjsl3argl2DDRFROnXARaZ2e4Nw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/regexpp": "^4.12.2",
+ "@typescript-eslint/scope-manager": "8.71.0",
+ "@typescript-eslint/type-utils": "8.71.0",
+ "@typescript-eslint/utils": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0",
+ "ignore": "^7.0.5",
+ "natural-compare": "^1.4.0",
+ "ts-api-utils": "^2.5.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/parser": "^8.71.0",
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
+ "version": "7.0.12",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.12.tgz",
+ "integrity": "sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/@typescript-eslint/parser": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.71.0.tgz",
+ "integrity": "sha512-CG4nPk1f2zc8yw4pALqHsFYH2hdo+h1T9daSp21+Hnxi9LOE3GT9hAfTKJCBXVNM2GmYs1eMEP615wPoeOgk3A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "8.71.0",
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0",
+ "debug": "^4.4.3"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/@typescript-eslint/project-service": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.0.tgz",
+ "integrity": "sha512-aABjw5rjBacYONVPaPiWOCjJu0vEF4a25iQuodlmQYL1trtLZ0X/y+2Vzl3BKI1odM4LnwLE1oUDXYp1wzx1TQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/tsconfig-utils": "^8.71.0",
+ "@typescript-eslint/types": "^8.71.0",
+ "debug": "^4.4.3"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/@typescript-eslint/scope-manager": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.0.tgz",
+ "integrity": "sha512-gWF0BhUcnjZxSpLE8ngS/59n2SB0J3YqRxvX1+2aoRJk9hNtHSLOV+TcarFiOr5ipXm3yc1QrI4c9YZc8zyCxw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/tsconfig-utils": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.0.tgz",
+ "integrity": "sha512-Z1UlWHADEK2Mlb9NpWfDeSjqoZ5EyrOv4R3eQpbkzqn/EwaIdOpXXupEA1+0ZIOSJSZZDBHG0BrQyN8zUG6Pwg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/@typescript-eslint/type-utils": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.71.0.tgz",
+ "integrity": "sha512-i8uO1qbdxeKgRnS5sCRt6On3/nfo2d2DwQe3Yvjx543zLy7r8ySqRuPPiIIXAhS03U0v5NfAFx+rUgxFzKKwNw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.0",
+ "@typescript-eslint/utils": "8.71.0",
+ "debug": "^4.4.3",
+ "ts-api-utils": "^2.5.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/@typescript-eslint/types": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.0.tgz",
+ "integrity": "sha512-cJ4OoxPGWvFnBTnSZyaU+qJzGTqPTGJY+gDchj6cRyLRdmIdt4rcsE4twj+zPfrNiWuVi38wijHzShL++Z9atQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.0.tgz",
+ "integrity": "sha512-PEEF4G5sLLWAS5BpPrUvms4ySZkiBQQZM4z+3ReI46axK5Vqr/vXBQatJQIZZOYdGyPUAKTtsrWzpqKuU+3DEw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/project-service": "8.71.0",
+ "@typescript-eslint/tsconfig-utils": "8.71.0",
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/visitor-keys": "8.71.0",
+ "debug": "^4.4.3",
+ "minimatch": "^10.2.2",
+ "semver": "^7.7.3",
+ "tinyglobby": "^0.2.15",
+ "ts-api-utils": "^2.5.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
+ "version": "5.0.12",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",
+ "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
+ "version": "10.2.6",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.8"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@typescript-eslint/utils": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.0.tgz",
+ "integrity": "sha512-pKR/tEMVrXZG23UFKUn5BQf3zfmfk7KQceI2cGzywZ5nxM5Eu3hEJU1utjWzydtzBbcJAQhHN8iPCxobHpPcZQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.9.1",
+ "@typescript-eslint/scope-manager": "8.71.0",
+ "@typescript-eslint/types": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.0.tgz",
+ "integrity": "sha512-8eQ9R218XORK+KLosnf4bu/QsUXvUyVwTbArg7/0NMB1Pu87OJKvj4nhFblkYE8gQV73mW1dx1ptlPCkwRGa7A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.71.0",
+ "eslint-visitor-keys": "^5.0.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
+ "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=24"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@vscode/test-electron": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-3.1.0.tgz",
+ "integrity": "sha512-CRqv5u+YYoseuNVJ6Tyo4k0sF0mx4qnKMihRB0PjsUF8Dc0WKtCXo6CNL6nWWm5esfFQsQA/pejMj4ZbpJVLTw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "http-proxy-agent": "^7.0.2",
+ "https-proxy-agent": "^7.0.5",
+ "jszip": "^3.10.1",
+ "ora": "^8.1.0",
+ "semver": "^7.6.2"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz",
+ "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "node_modules/agent-base": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "6.15.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz",
+ "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "6.4.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz",
+ "integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true,
+ "license": "Python-2.0"
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/bidi-js": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.1.0.tgz",
+ "integrity": "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "require-from-string": "^2.0.2"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "1.1.21",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz",
+ "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/browser-stdout": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",
+ "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "readdirp": "^5.0.0"
+ },
+ "engines": {
+ "node": ">= 20.19.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/cli-cursor": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+ "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "restore-cursor": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-spinners": {
+ "version": "2.9.2",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/core-util-is": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/css-tree": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz",
+ "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mdn-data": "2.27.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
+ }
+ },
+ "node_modules/data-urls": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-7.0.0.tgz",
+ "integrity": "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-mimetype": "^5.0.0",
+ "whatwg-url": "^16.0.0"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/decimal.js": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
+ "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/deep-is": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/diff": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz",
+ "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/emoji-regex": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/entities": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz",
+ "integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.28.2",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",
+ "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.28.2",
+ "@esbuild/android-arm": "0.28.2",
+ "@esbuild/android-arm64": "0.28.2",
+ "@esbuild/android-x64": "0.28.2",
+ "@esbuild/darwin-arm64": "0.28.2",
+ "@esbuild/darwin-x64": "0.28.2",
+ "@esbuild/freebsd-arm64": "0.28.2",
+ "@esbuild/freebsd-x64": "0.28.2",
+ "@esbuild/linux-arm": "0.28.2",
+ "@esbuild/linux-arm64": "0.28.2",
+ "@esbuild/linux-ia32": "0.28.2",
+ "@esbuild/linux-loong64": "0.28.2",
+ "@esbuild/linux-mips64el": "0.28.2",
+ "@esbuild/linux-ppc64": "0.28.2",
+ "@esbuild/linux-riscv64": "0.28.2",
+ "@esbuild/linux-s390x": "0.28.2",
+ "@esbuild/linux-x64": "0.28.2",
+ "@esbuild/netbsd-arm64": "0.28.2",
+ "@esbuild/netbsd-x64": "0.28.2",
+ "@esbuild/openbsd-arm64": "0.28.2",
+ "@esbuild/openbsd-x64": "0.28.2",
+ "@esbuild/openharmony-arm64": "0.28.2",
+ "@esbuild/sunos-x64": "0.28.2",
+ "@esbuild/win32-arm64": "0.28.2",
+ "@esbuild/win32-ia32": "0.28.2",
+ "@esbuild/win32-x64": "0.28.2"
+ }
+ },
+ "node_modules/escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/eslint": {
+ "version": "9.39.5",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.5.tgz",
+ "integrity": "sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==",
+ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.8.0",
+ "@eslint-community/regexpp": "^4.12.1",
+ "@eslint/config-array": "^0.21.2",
+ "@eslint/config-helpers": "^0.4.2",
+ "@eslint/core": "^0.17.0",
+ "@eslint/eslintrc": "^3.3.6",
+ "@eslint/js": "9.39.5",
+ "@eslint/plugin-kit": "^0.4.1",
+ "@humanfs/node": "^0.16.6",
+ "@humanwhocodes/module-importer": "^1.0.1",
+ "@humanwhocodes/retry": "^0.4.2",
+ "@types/estree": "^1.0.6",
+ "ajv": "^6.14.0",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.6",
+ "debug": "^4.3.2",
+ "escape-string-regexp": "^4.0.0",
+ "eslint-scope": "^8.4.0",
+ "eslint-visitor-keys": "^4.2.1",
+ "espree": "^10.4.0",
+ "esquery": "^1.5.0",
+ "esutils": "^2.0.2",
+ "fast-deep-equal": "^3.1.3",
+ "file-entry-cache": "^8.0.0",
+ "find-up": "^5.0.0",
+ "glob-parent": "^6.0.2",
+ "ignore": "^5.2.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "lodash.merge": "^4.6.2",
+ "minimatch": "^3.1.5",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.3"
+ },
+ "bin": {
+ "eslint": "bin/eslint.js"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ },
+ "peerDependencies": {
+ "jiti": "*"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-scope": {
+ "version": "8.4.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/espree": {
+ "version": "10.4.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "acorn": "^8.15.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^4.2.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/esquery": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",
+ "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "estraverse": "^5.1.0"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/file-entry-cache": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
+ "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "flat-cache": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=16.0.0"
+ }
+ },
+ "node_modules/find-up": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/find-up-simple": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz",
+ "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/flat-cache": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
+ "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "flatted": "^3.2.9",
+ "keyv": "^4.5.4"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/flatted": {
+ "version": "3.4.4",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz",
+ "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/get-east-asian-width": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.7.0.tgz",
+ "integrity": "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/glob": {
+ "version": "13.0.6",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
+ "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "minimatch": "^10.2.2",
+ "minipass": "^7.1.3",
+ "path-scurry": "^2.0.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/glob/node_modules/balanced-match": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/glob/node_modules/brace-expansion": {
+ "version": "5.0.12",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",
+ "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/glob/node_modules/minimatch": {
+ "version": "10.2.6",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.8"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/globals": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/html-encoding-sniffer": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-6.0.0.tgz",
+ "integrity": "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@exodus/bytes": "^1.6.0"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ }
+ },
+ "node_modules/http-proxy-agent": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
+ "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "agent-base": "^7.1.0",
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/https-proxy-agent": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "agent-base": "^7.1.2",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/ignore": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/immediate": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
+ "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/import-fresh": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.19"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-interactive": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
+ "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-path-inside": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz",
+ "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-potential-custom-element-name": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
+ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/is-unicode-supported": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
+ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/js-yaml": {
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/puzrin"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/nodeca"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/jsdom": {
+ "version": "29.1.1",
+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-29.1.1.tgz",
+ "integrity": "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@asamuzakjp/css-color": "^5.1.11",
+ "@asamuzakjp/dom-selector": "^7.1.1",
+ "@bramus/specificity": "^2.4.2",
+ "@csstools/css-syntax-patches-for-csstree": "^1.1.3",
+ "@exodus/bytes": "^1.15.0",
+ "css-tree": "^3.2.1",
+ "data-urls": "^7.0.0",
+ "decimal.js": "^10.6.0",
+ "html-encoding-sniffer": "^6.0.0",
+ "is-potential-custom-element-name": "^1.0.1",
+ "lru-cache": "^11.3.5",
+ "parse5": "^8.0.1",
+ "saxes": "^6.0.0",
+ "symbol-tree": "^3.2.4",
+ "tough-cookie": "^6.0.1",
+ "undici": "^7.25.0",
+ "w3c-xmlserializer": "^5.0.0",
+ "webidl-conversions": "^8.0.1",
+ "whatwg-mimetype": "^5.0.0",
+ "whatwg-url": "^16.0.1",
+ "xml-name-validator": "^5.0.0"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=24.0.0"
+ },
+ "peerDependencies": {
+ "canvas": "^3.0.0"
+ },
+ "peerDependenciesMeta": {
+ "canvas": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/json-buffer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/jszip": {
+ "version": "3.10.2",
+ "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.2.tgz",
+ "integrity": "sha512-3l+rb15IOWtUhU0H5MFqES/T6Kh7abYwjosBey/vD6hDt8zoEffkSC5Ws5SGtgVw3gBx2NEbhTeSW1+kWkpyTQ==",
+ "dev": true,
+ "license": "(MIT OR GPL-3.0-or-later)",
+ "dependencies": {
+ "lie": "~3.3.0",
+ "pako": "~1.0.2",
+ "readable-stream": "~2.3.6",
+ "setimmediate": "^1.0.5"
+ }
+ },
+ "node_modules/keyv": {
+ "version": "4.5.4",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "json-buffer": "3.0.1"
+ }
+ },
+ "node_modules/levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/lie": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
+ "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "immediate": "~3.0.5"
+ }
+ },
+ "node_modules/locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "p-locate": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lodash.merge": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/log-symbols": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
+ "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "is-unicode-supported": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/log-symbols/node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/log-symbols/node_modules/is-unicode-supported": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
+ "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lru-cache": {
+ "version": "11.5.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
+ "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/mdn-data": {
+ "version": "2.27.1",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz",
+ "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==",
+ "dev": true,
+ "license": "CC0-1.0"
+ },
+ "node_modules/mimic-function": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
+ "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/minipass": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
+ "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/mocha": {
+ "version": "12.0.3",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-12.0.3.tgz",
+ "integrity": "sha512-beammieDdiWdkjANWeWPpkxUROYGi5FN88fPOkLiticz7HTg3Y+Pho3EYE6SUdcuWnZ3h2WD8EXCA55JF4o6wg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "browser-stdout": "^1.3.1",
+ "chokidar": "^5.0.0",
+ "debug": "^4.3.5",
+ "diff": "^9.0.0",
+ "find-up-simple": "^1.0.1",
+ "glob": "^13.0.0",
+ "is-path-inside": "^4.0.0",
+ "is-unicode-supported": "^0.1.0",
+ "js-yaml": "^5.0.0",
+ "minimatch": "^10.2.2",
+ "ms": "^2.1.3",
+ "picocolors": "^1.1.1",
+ "serialize-javascript": "^7.1.1",
+ "strip-json-comments": "^5.0.3",
+ "supports-color": "^8.1.1",
+ "workerpool": "^10.0.0"
+ },
+ "bin": {
+ "mocha": "bin/mocha.js"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/mocha/node_modules/balanced-match": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/mocha/node_modules/brace-expansion": {
+ "version": "5.0.12",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz",
+ "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/mocha/node_modules/js-yaml": {
+ "version": "5.4.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.2.tgz",
+ "integrity": "sha512-m+aqu+LwO1O6sIopafj8HUVl5aawITwZQe/yHpMCKjaWBaA/d07B/QdMb3529REftiU+RMMHL3Vlsw3hON7vWg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/puzrin"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/nodeca"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.mjs"
+ }
+ },
+ "node_modules/mocha/node_modules/minimatch": {
+ "version": "10.2.6",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.8"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/mocha/node_modules/strip-json-comments": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz",
+ "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/mocha/node_modules/supports-color": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/onetime": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+ "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mimic-function": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/optionator": {
+ "version": "0.9.4",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
+ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.5"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/ora": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
+ "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "cli-cursor": "^5.0.0",
+ "cli-spinners": "^2.9.2",
+ "is-interactive": "^2.0.0",
+ "is-unicode-supported": "^2.0.0",
+ "log-symbols": "^6.0.0",
+ "stdin-discarder": "^0.2.2",
+ "string-width": "^7.2.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora/node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/ora/node_modules/is-unicode-supported": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "yocto-queue": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "p-limit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pako": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
+ "dev": true,
+ "license": "(MIT AND Zlib)"
+ },
+ "node_modules/parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/parse5": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz",
+ "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "entities": "^8.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-scurry": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
+ "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "lru-cache": "^11.0.0",
+ "minipass": "^7.1.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/process-nextick-args": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/punycode": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/readable-stream": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz",
+ "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20.19.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/restore-cursor": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+ "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "onetime": "^7.0.0",
+ "signal-exit": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/saxes": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",
+ "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "xmlchars": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=v12.22.7"
+ }
+ },
+ "node_modules/semver": {
+ "version": "7.8.5",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/serialize-javascript": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.2.tgz",
+ "integrity": "sha512-GL2BWwVa6JydKO6l/ljVgjAZF4QJ3S7dWDWi53s5GZT8PJzD2fNxi67HANQGKAqPrwEpL5ba7gUBGi0Ls/sEoQ==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=20.0.0"
+ }
+ },
+ "node_modules/setimmediate": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+ "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
+ "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stdin-discarder": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz",
+ "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "node_modules/string-width": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^10.3.0",
+ "get-east-asian-width": "^1.0.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/symbol-tree": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
+ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/tldts": {
+ "version": "7.4.16",
+ "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.4.16.tgz",
+ "integrity": "sha512-QwBER5KMR86IIjpIiO7H/Z3IMJPsZ1A6RKPAqzTTgOyUQUSt9FdnKcqhTaJmkY6HVrgouZHZR0ncK5QxvmnQeg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tldts-core": "^7.4.16"
+ },
+ "bin": {
+ "tldts": "bin/cli.js"
+ }
+ },
+ "node_modules/tldts-core": {
+ "version": "7.4.16",
+ "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.4.16.tgz",
+ "integrity": "sha512-MDolfaSJtlSK5Y0A1xl3277ekubZwobpBjugknDizI9O5Rm60a1m8k4ICK+MRsCDzPygT81mp3BBf5RKDlFRfA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tough-cookie": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.0.2.tgz",
+ "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "tldts": "^7.0.5"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/tr46": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-6.0.0.tgz",
+ "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "punycode": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/ts-api-utils": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz",
+ "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.12"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4"
+ }
+ },
+ "node_modules/type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "prelude-ls": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/typescript-eslint": {
+ "version": "8.71.0",
+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.71.0.tgz",
+ "integrity": "sha512-fBdHYiqQ14RW6mOMXD14Svn82ZsCYAoQSzGRzyEjR59S5A2Krh/l7fGTOQ7iCr8gGy/mHVXtEF7s5fgjEdV0Pw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/eslint-plugin": "8.71.0",
+ "@typescript-eslint/parser": "8.71.0",
+ "@typescript-eslint/typescript-estree": "8.71.0",
+ "@typescript-eslint/utils": "8.71.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.1.0"
+ }
+ },
+ "node_modules/undici": {
+ "version": "7.30.0",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.0.tgz",
+ "integrity": "sha512-dkrQXeHSaoamnItlYbmzG0wFYrM0ZwDxCIg0A7aKjTyyhh9svRzCNFEzV+Vm05/yehjCzjDZ31KXfGEjYSztDQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/w3c-xmlserializer": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz",
+ "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "xml-name-validator": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.1.tgz",
+ "integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/whatwg-mimetype": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz",
+ "integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/whatwg-url": {
+ "version": "16.0.1",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-16.0.1.tgz",
+ "integrity": "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@exodus/bytes": "^1.11.0",
+ "tr46": "^6.0.0",
+ "webidl-conversions": "^8.0.1"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ }
+ },
+ "node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/word-wrap": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
+ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/workerpool": {
+ "version": "10.0.3",
+ "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-10.0.3.tgz",
+ "integrity": "sha512-6z2Iis68Wqth93/G/wJP9u+R3O+d2XTlgWChGCwuT1qLbBsOYueGRZuJ++v3mtDP5KjYdy+WzvWC+VWETSVXJA==",
+ "dev": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/xml-name-validator": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz",
+ "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/xmlchars": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..35c43fd
--- /dev/null
+++ b/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "diagrammer",
+ "displayName": "Diagrammer",
+ "description": "Draw quick diagrams with shapes, labels and connectors, saved as .diagram.json files in your workspace.",
+ "version": "0.0.1",
+ "publisher": "nabled",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/nabledhq/diagrammerext"
+ },
+ "engines": {
+ "vscode": "^1.85.0"
+ },
+ "categories": [
+ "Visualization",
+ "Other"
+ ],
+ "main": "./dist/extension.js",
+ "activationEvents": [],
+ "contributes": {
+ "customEditors": [
+ {
+ "viewType": "diagrammer.diagramEditor",
+ "displayName": "Diagrammer",
+ "selector": [
+ {
+ "filenamePattern": "*.diagram.json"
+ }
+ ],
+ "priority": "default"
+ }
+ ],
+ "commands": [
+ {
+ "command": "diagrammer.newDiagram",
+ "title": "New Diagram",
+ "category": "Diagrammer"
+ }
+ ]
+ },
+ "scripts": {
+ "vscode:prepublish": "npm run package",
+ "compile": "npm run check-types && node esbuild.js",
+ "package": "npm run check-types && node esbuild.js --production",
+ "watch": "node esbuild.js --watch",
+ "check-types": "tsc -p . --noEmit",
+ "lint": "eslint src",
+ "compile-tests": "tsc -p . --outDir out",
+ "test": "npm run compile-tests && mocha \"out/test/unit/**/*.test.js\"",
+ "test:integration": "npm run compile && npm run compile-tests && node ./out/test/integration/runTest.js"
+ },
+ "devDependencies": {
+ "@eslint/js": "^9.39.5",
+ "@types/jsdom": "^30.0.0",
+ "@types/mocha": "^10.0.10",
+ "@types/node": "^20.19.43",
+ "@types/vscode": "~1.85.0",
+ "@vscode/test-electron": "^3.1.0",
+ "esbuild": "^0.28.2",
+ "eslint": "^9.39.5",
+ "jsdom": "^29.1.1",
+ "mocha": "^12.0.3",
+ "typescript": "~5.9",
+ "typescript-eslint": "^8.71.0"
+ }
+}
diff --git a/src/diagramEditor.ts b/src/diagramEditor.ts
new file mode 100644
index 0000000..5de5f34
--- /dev/null
+++ b/src/diagramEditor.ts
@@ -0,0 +1,290 @@
+import * as vscode from 'vscode';
+import { Diagram, DiagramParseError, parseDiagram, serializeDiagram } from './model/diagram';
+import type { HostToWebviewMessage, WebviewToHostMessage } from './protocol';
+
+export const DIAGRAM_EDITOR_VIEW_TYPE = 'diagrammer.diagramEditor';
+
+export interface RenderReport {
+ uri: vscode.Uri;
+ nodes: number;
+ edges: number;
+}
+
+/**
+ * In-memory model of an open `.diagram.json` file.
+ *
+ * Edits coming from the webview replace the whole (immutable) diagram; each one is reported to
+ * VS Code as a `CustomDocumentEditEvent` so dirty tracking, undo and redo use VS Code's own
+ * edit stack.
+ */
+export class DiagramDocument implements vscode.CustomDocument {
+ static async create(uri: vscode.Uri, backupId: string | undefined): Promise<DiagramDocument> {
+ const source = backupId ? vscode.Uri.parse(backupId) : uri;
+ const { diagram, error } = await readDiagram(source);
+ return new DiagramDocument(uri, diagram, error);
+ }
+
+ private readonly _onDidDispose = new vscode.EventEmitter<void>();
+ readonly onDidDispose = this._onDidDispose.event;
+
+ private readonly _onDidChange = new vscode.EventEmitter<vscode.CustomDocumentEditEvent<DiagramDocument>>();
+ readonly onDidChange = this._onDidChange.event;
+
+ /** Fired when the diagram changes for a reason other than a webview edit (undo, redo, revert). */
+ private readonly _onDidChangeContent = new vscode.EventEmitter<Diagram>();
+ readonly onDidChangeContent = this._onDidChangeContent.event;
+
+ private constructor(
+ readonly uri: vscode.Uri,
+ private _diagram: Diagram,
+ private _parseError: string | undefined,
+ ) {}
+
+ get diagram(): Diagram {
+ return this._diagram;
+ }
+
+ /** Set when the file on disk could not be parsed; the editor is read-only in that state. */
+ get parseError(): string | undefined {
+ return this._parseError;
+ }
+
+ applyEdit(label: string, diagram: Diagram): void {
+ if (this._parseError) {
+ return;
+ }
+ const before = this._diagram;
+ this._diagram = diagram;
+ this._onDidChange.fire({
+ document: this,
+ label,
+ undo: () => this.setDiagram(before),
+ redo: () => this.setDiagram(diagram),
+ });
+ }
+
+ async save(cancellation: vscode.CancellationToken): Promise<void> {
+ await this.saveAs(this.uri, cancellation);
+ }
+
+ async saveAs(target: vscode.Uri, cancellation: vscode.CancellationToken): Promise<void> {
+ if (this._parseError) {
+ // Never overwrite a file we could not understand with an empty diagram.
+ return;
+ }
+ if (cancellation.isCancellationRequested) {
+ return;
+ }
+ await vscode.workspace.fs.writeFile(target, new TextEncoder().encode(serializeDiagram(this._diagram)));
+ }
+
+ async revert(): Promise<void> {
+ const { diagram, error } = await readDiagram(this.uri);
+ this._parseError = error;
+ this.setDiagram(diagram);
+ }
+
+ async backup(destination: vscode.Uri, cancellation: vscode.CancellationToken): Promise<vscode.CustomDocumentBackup> {
+ await this.saveAs(destination, cancellation);
+ return {
+ id: destination.toString(),
+ delete: async () => {
+ try {
+ await vscode.workspace.fs.delete(destination);
+ } catch {
+ // The backup may already be gone.
+ }
+ },
+ };
+ }
+
+ dispose(): void {
+ this._onDidDispose.fire();
+ this._onDidDispose.dispose();
+ this._onDidChange.dispose();
+ this._onDidChangeContent.dispose();
+ }
+
+ private setDiagram(diagram: Diagram): void {
+ this._diagram = diagram;
+ this._onDidChangeContent.fire(diagram);
+ }
+}
+
+async function readDiagram(uri: vscode.Uri): Promise<{ diagram: Diagram; error?: string }> {
+ const bytes = await vscode.workspace.fs.readFile(uri);
+ const text = new TextDecoder().decode(bytes);
+ try {
+ return { diagram: parseDiagram(text) };
+ } catch (err) {
+ const message = err instanceof DiagramParseError ? err.message : String(err);
+ return { diagram: parseDiagram(''), error: message };
+ }
+}
+
+export class DiagramEditorProvider implements vscode.CustomEditorProvider<DiagramDocument> {
+ static register(context: vscode.ExtensionContext): DiagramEditorProvider {
+ const provider = new DiagramEditorProvider(context.extensionUri);
+ context.subscriptions.push(
+ vscode.window.registerCustomEditorProvider(DIAGRAM_EDITOR_VIEW_TYPE, provider, {
+ supportsMultipleEditorsPerDocument: true,
+ }),
+ provider._onDidChangeCustomDocument,
+ provider._onDidRender,
+ );
+ return provider;
+ }
+
+ private readonly _onDidChangeCustomDocument = new vscode.EventEmitter<
+ vscode.CustomDocumentEditEvent<DiagramDocument>
+ >();
+ readonly onDidChangeCustomDocument = this._onDidChangeCustomDocument.event;
+
+ private readonly _onDidRender = new vscode.EventEmitter<RenderReport>();
+ /** Fired whenever a webview finishes rendering a diagram. Used by integration tests. */
+ readonly onDidRender = this._onDidRender.event;
+
+ private readonly webviews = new Map<string, Set<vscode.WebviewPanel>>();
+
+ constructor(private readonly extensionUri: vscode.Uri) {}
+
+ async openCustomDocument(
+ uri: vscode.Uri,
+ openContext: vscode.CustomDocumentOpenContext,
+ _token: vscode.CancellationToken,
+ ): Promise<DiagramDocument> {
+ const document = await DiagramDocument.create(uri, openContext.backupId);
+ const subscriptions = [
+ document.onDidChange((e) => this._onDidChangeCustomDocument.fire(e)),
+ document.onDidChangeContent((diagram) => {
+ for (const panel of this.panelsFor(document)) {
+ this.postMessage(panel, document.parseError ? errorMessage(document) : { type: 'update', diagram });
+ }
+ }),
+ ];
+ document.onDidDispose(() => subscriptions.forEach((s) => s.dispose()));
+ return document;
+ }
+
+ async resolveCustomEditor(
+ document: DiagramDocument,
+ panel: vscode.WebviewPanel,
+ _token: vscode.CancellationToken,
+ ): Promise<void> {
+ const key = document.uri.toString();
+ let panels = this.webviews.get(key);
+ if (!panels) {
+ panels = new Set();
+ this.webviews.set(key, panels);
+ }
+ panels.add(panel);
+ panel.onDidDispose(() => {
+ panels.delete(panel);
+ if (panels.size === 0) {
+ this.webviews.delete(key);
+ }
+ });
+
+ panel.webview.options = {
+ enableScripts: true,
+ localResourceRoots: [
+ vscode.Uri.joinPath(this.extensionUri, 'dist'),
+ vscode.Uri.joinPath(this.extensionUri, 'media'),
+ ],
+ };
+ panel.webview.html = this.getHtml(panel.webview);
+
+ panel.webview.onDidReceiveMessage((message: WebviewToHostMessage) => {
+ switch (message.type) {
+ case 'ready':
+ this.postMessage(
+ panel,
+ document.parseError ? errorMessage(document) : { type: 'init', diagram: document.diagram },
+ );
+ break;
+ case 'edit':
+ document.applyEdit(message.label, message.diagram);
+ for (const other of this.panelsFor(document)) {
+ if (other !== panel) {
+ this.postMessage(other, { type: 'update', diagram: document.diagram });
+ }
+ }
+ break;
+ case 'rendered':
+ this._onDidRender.fire({ uri: document.uri, nodes: message.nodes, edges: message.edges });
+ break;
+ }
+ });
+ }
+
+ saveCustomDocument(document: DiagramDocument, cancellation: vscode.CancellationToken): Thenable<void> {
+ return document.save(cancellation);
+ }
+
+ saveCustomDocumentAs(
+ document: DiagramDocument,
+ destination: vscode.Uri,
+ cancellation: vscode.CancellationToken,
+ ): Thenable<void> {
+ return document.saveAs(destination, cancellation);
+ }
+
+ revertCustomDocument(document: DiagramDocument, _cancellation: vscode.CancellationToken): Thenable<void> {
+ return document.revert();
+ }
+
+ backupCustomDocument(
+ document: DiagramDocument,
+ context: vscode.CustomDocumentBackupContext,
+ cancellation: vscode.CancellationToken,
+ ): Thenable<vscode.CustomDocumentBackup> {
+ return document.backup(context.destination, cancellation);
+ }
+
+ private panelsFor(document: DiagramDocument): Iterable<vscode.WebviewPanel> {
+ return this.webviews.get(document.uri.toString()) ?? [];
+ }
+
+ private postMessage(panel: vscode.WebviewPanel, message: HostToWebviewMessage): void {
+ void panel.webview.postMessage(message);
+ }
+
+ private getHtml(webview: vscode.Webview): string {
+ const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this.extensionUri, 'dist', 'webview.js'));
+ const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(this.extensionUri, 'media', 'diagram.css'));
+ const nonce = getNonce();
+ return /* html */ `<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${webview.cspSource} data:; style-src ${webview.cspSource}; font-src ${webview.cspSource}; script-src 'nonce-${nonce}';">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link href="${styleUri}" rel="stylesheet">
+ <title>Diagram</title>
+</head>
+<body>
+ <div id="app">
+ <aside id="palette" aria-label="Shapes"></aside>
+ <div id="canvas-container" tabindex="0">
+ <svg id="canvas" xmlns="http://www.w3.org/2000/svg"></svg>
+ </div>
+ </div>
+ <div id="error" hidden></div>
+ <script nonce="${nonce}" src="${scriptUri}"></script>
+</body>
+</html>`;
+ }
+}
+
+function errorMessage(document: DiagramDocument): HostToWebviewMessage {
+ return { type: 'error', message: `Could not open ${document.uri.fsPath}: ${document.parseError}` };
+}
+
+function getNonce(): string {
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+ let result = '';
+ for (let i = 0; i < 32; i++) {
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
+ }
+ return result;
+}
diff --git a/src/extension.ts b/src/extension.ts
new file mode 100644
index 0000000..36f2c1b
--- /dev/null
+++ b/src/extension.ts
@@ -0,0 +1,18 @@
+import * as vscode from 'vscode';
+import { DiagramEditorProvider, RenderReport } from './diagramEditor';
+import { NEW_DIAGRAM_COMMAND, newDiagram } from './newDiagram';
+
+export interface DiagrammerApi {
+ /** Fired whenever a diagram webview finishes rendering. */
+ onDidRender: vscode.Event<RenderReport>;
+}
+
+export function activate(context: vscode.ExtensionContext): DiagrammerApi {
+ const provider = DiagramEditorProvider.register(context);
+ context.subscriptions.push(vscode.commands.registerCommand(NEW_DIAGRAM_COMMAND, newDiagram));
+ return { onDidRender: provider.onDidRender };
+}
+
+export function deactivate(): void {
+ // Nothing to clean up: everything is registered on the extension context.
+}
diff --git a/src/model/diagram.ts b/src/model/diagram.ts
new file mode 100644
index 0000000..7910064
--- /dev/null
+++ b/src/model/diagram.ts
@@ -0,0 +1,441 @@
+/**
+ * Pure, dependency-free diagram model shared by the extension host and the webview.
+ *
+ * All mutating operations return a new `Diagram` and never modify their input, which keeps
+ * undo/redo snapshots trivially safe.
+ */
+
+export const DIAGRAM_VERSION = 1;
+
+export const NODE_TYPES = ['rectangle', 'roundedRectangle', 'ellipse', 'diamond', 'text', 'sticky'] as const;
+
+export type NodeType = (typeof NODE_TYPES)[number];
+
+export interface DiagramNode {
+ id: string;
+ type: NodeType;
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ label: string;
+}
+
+export interface DiagramEdge {
+ id: string;
+ from: string;
+ to: string;
+ label?: string;
+}
+
+export interface Diagram {
+ version: number;
+ nodes: DiagramNode[];
+ edges: DiagramEdge[];
+}
+
+export interface Point {
+ x: number;
+ y: number;
+}
+
+export interface EdgeEndpoints {
+ start: Point;
+ end: Point;
+}
+
+export const DEFAULT_NODE_SIZES: Record<NodeType, { width: number; height: number; label: string }> = {
+ rectangle: { width: 140, height: 70, label: 'Rectangle' },
+ roundedRectangle: { width: 140, height: 70, label: 'Rounded' },
+ ellipse: { width: 140, height: 80, label: 'Ellipse' },
+ diamond: { width: 140, height: 100, label: 'Decision' },
+ text: { width: 120, height: 30, label: 'Text' },
+ sticky: { width: 150, height: 120, label: 'Note' },
+};
+
+export const MIN_NODE_SIZE = 10;
+
+export class DiagramParseError extends Error {
+ constructor(message: string) {
+ super(message);
+ this.name = 'DiagramParseError';
+ }
+}
+
+export function createEmptyDiagram(): Diagram {
+ return { version: DIAGRAM_VERSION, nodes: [], edges: [] };
+}
+
+export function isNodeType(value: unknown): value is NodeType {
+ return typeof value === 'string' && (NODE_TYPES as readonly string[]).includes(value);
+}
+
+// ---------------------------------------------------------------------------
+// Serialization
+// ---------------------------------------------------------------------------
+
+export function serializeDiagram(diagram: Diagram): string {
+ const normalized: Diagram = {
+ version: diagram.version,
+ nodes: diagram.nodes.map((n) => ({
+ id: n.id,
+ type: n.type,
+ x: n.x,
+ y: n.y,
+ width: n.width,
+ height: n.height,
+ label: n.label,
+ })),
+ edges: diagram.edges.map((e) => {
+ const edge: DiagramEdge = { id: e.id, from: e.from, to: e.to };
+ if (e.label !== undefined && e.label !== '') {
+ edge.label = e.label;
+ }
+ return edge;
+ }),
+ };
+ return JSON.stringify(normalized, null, 2) + '\n';
+}
+
+/**
+ * Parses and validates the textual content of a `.diagram.json` file.
+ *
+ * - An empty (or whitespace-only) document is treated as an empty diagram.
+ * - Syntactically invalid JSON or structurally invalid content throws a `DiagramParseError`.
+ * - Edges that reference unknown nodes are dropped rather than failing the whole file.
+ */
+export function parseDiagram(text: string): Diagram {
+ if (text.trim() === '') {
+ return createEmptyDiagram();
+ }
+ let raw: unknown;
+ try {
+ raw = JSON.parse(text);
+ } catch (err) {
+ throw new DiagramParseError(`Invalid JSON: ${err instanceof Error ? err.message : String(err)}`);
+ }
+ return validateDiagram(raw);
+}
+
+export function validateDiagram(raw: unknown): Diagram {
+ if (!isRecord(raw)) {
+ throw new DiagramParseError('Diagram must be a JSON object.');
+ }
+ const version = raw.version === undefined ? DIAGRAM_VERSION : raw.version;
+ if (typeof version !== 'number' || !Number.isInteger(version) || version < 1) {
+ throw new DiagramParseError('"version" must be a positive integer.');
+ }
+ if (version > DIAGRAM_VERSION) {
+ throw new DiagramParseError(
+ `Unsupported diagram version ${version}; this extension supports version ${DIAGRAM_VERSION}.`,
+ );
+ }
+ const rawNodes = raw.nodes === undefined ? [] : raw.nodes;
+ const rawEdges = raw.edges === undefined ? [] : raw.edges;
+ if (!Array.isArray(rawNodes)) {
+ throw new DiagramParseError('"nodes" must be an array.');
+ }
+ if (!Array.isArray(rawEdges)) {
+ throw new DiagramParseError('"edges" must be an array.');
+ }
+
+ const nodes: DiagramNode[] = [];
+ const nodeIds = new Set<string>();
+ rawNodes.forEach((rawNode, index) => {
+ const node = validateNode(rawNode, index);
+ if (nodeIds.has(node.id)) {
+ throw new DiagramParseError(`Duplicate node id "${node.id}".`);
+ }
+ nodeIds.add(node.id);
+ nodes.push(node);
+ });
+
+ const edges: DiagramEdge[] = [];
+ const edgeIds = new Set<string>();
+ rawEdges.forEach((rawEdge, index) => {
+ const edge = validateEdge(rawEdge, index);
+ if (edgeIds.has(edge.id)) {
+ throw new DiagramParseError(`Duplicate edge id "${edge.id}".`);
+ }
+ edgeIds.add(edge.id);
+ if (nodeIds.has(edge.from) && nodeIds.has(edge.to)) {
+ edges.push(edge);
+ }
+ });
+
+ return { version: DIAGRAM_VERSION, nodes, edges };
+}
+
+function validateNode(raw: unknown, index: number): DiagramNode {
+ const where = `nodes[${index}]`;
+ if (!isRecord(raw)) {
+ throw new DiagramParseError(`${where} must be an object.`);
+ }
+ const id = requireString(raw.id, `${where}.id`);
+ if (id === '') {
+ throw new DiagramParseError(`${where}.id must not be empty.`);
+ }
+ if (!isNodeType(raw.type)) {
+ throw new DiagramParseError(`${where}.type must be one of: ${NODE_TYPES.join(', ')}.`);
+ }
+ return {
+ id,
+ type: raw.type,
+ x: requireNumber(raw.x, `${where}.x`),
+ y: requireNumber(raw.y, `${where}.y`),
+ width: Math.max(MIN_NODE_SIZE, requireNumber(raw.width, `${where}.width`)),
+ height: Math.max(MIN_NODE_SIZE, requireNumber(raw.height, `${where}.height`)),
+ label: raw.label === undefined ? '' : requireString(raw.label, `${where}.label`),
+ };
+}
+
+function validateEdge(raw: unknown, index: number): DiagramEdge {
+ const where = `edges[${index}]`;
+ if (!isRecord(raw)) {
+ throw new DiagramParseError(`${where} must be an object.`);
+ }
+ const edge: DiagramEdge = {
+ id: requireString(raw.id, `${where}.id`),
+ from: requireString(raw.from, `${where}.from`),
+ to: requireString(raw.to, `${where}.to`),
+ };
+ if (edge.id === '') {
+ throw new DiagramParseError(`${where}.id must not be empty.`);
+ }
+ if (raw.label !== undefined) {
+ edge.label = requireString(raw.label, `${where}.label`);
+ }
+ return edge;
+}
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
+}
+
+function requireString(value: unknown, where: string): string {
+ if (typeof value !== 'string') {
+ throw new DiagramParseError(`${where} must be a string.`);
+ }
+ return value;
+}
+
+function requireNumber(value: unknown, where: string): number {
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
+ throw new DiagramParseError(`${where} must be a finite number.`);
+ }
+ return value;
+}
+
+// ---------------------------------------------------------------------------
+// Queries
+// ---------------------------------------------------------------------------
+
+export function findNode(diagram: Diagram, id: string): DiagramNode | undefined {
+ return diagram.nodes.find((n) => n.id === id);
+}
+
+export function findEdge(diagram: Diagram, id: string): DiagramEdge | undefined {
+ return diagram.edges.find((e) => e.id === id);
+}
+
+export function edgesForNode(diagram: Diagram, nodeId: string): DiagramEdge[] {
+ return diagram.edges.filter((e) => e.from === nodeId || e.to === nodeId);
+}
+
+/** Returns an id of the form `<prefix>-<n>` that is not used by any node or edge. */
+export function nextId(diagram: Diagram, prefix: string): string {
+ const used = new Set<string>([...diagram.nodes.map((n) => n.id), ...diagram.edges.map((e) => e.id)]);
+ let max = 0;
+ const pattern = new RegExp(`^${escapeRegExp(prefix)}-(\\d+)$`);
+ for (const id of used) {
+ const match = pattern.exec(id);
+ if (match) {
+ max = Math.max(max, Number(match[1]));
+ }
+ }
+ let candidate = max + 1;
+ while (used.has(`${prefix}-${candidate}`)) {
+ candidate++;
+ }
+ return `${prefix}-${candidate}`;
+}
+
+function escapeRegExp(value: string): string {
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+}
+
+// ---------------------------------------------------------------------------
+// Mutations (all return a new Diagram)
+// ---------------------------------------------------------------------------
+
+export interface NewNodeOptions {
+ id?: string;
+ width?: number;
+ height?: number;
+ label?: string;
+}
+
+/** Creates a node of the given type centred on `center`, using the default size for that type. */
+export function createNode(diagram: Diagram, type: NodeType, center: Point, options: NewNodeOptions = {}): DiagramNode {
+ const defaults = DEFAULT_NODE_SIZES[type];
+ const width = options.width ?? defaults.width;
+ const height = options.height ?? defaults.height;
+ return {
+ id: options.id ?? nextId(diagram, 'node'),
+ type,
+ x: Math.round(center.x - width / 2),
+ y: Math.round(center.y - height / 2),
+ width,
+ height,
+ label: options.label ?? defaults.label,
+ };
+}
+
+export function addNode(diagram: Diagram, node: DiagramNode): Diagram {
+ if (findNode(diagram, node.id) || findEdge(diagram, node.id)) {
+ throw new Error(`Id "${node.id}" is already in use.`);
+ }
+ return { ...diagram, nodes: [...diagram.nodes, { ...node }] };
+}
+
+/** Removes a node and every edge connected to it. Unknown ids are ignored. */
+export function removeNode(diagram: Diagram, nodeId: string): Diagram {
+ if (!findNode(diagram, nodeId)) {
+ return diagram;
+ }
+ return {
+ ...diagram,
+ nodes: diagram.nodes.filter((n) => n.id !== nodeId),
+ edges: diagram.edges.filter((e) => e.from !== nodeId && e.to !== nodeId),
+ };
+}
+
+export function moveNode(diagram: Diagram, nodeId: string, x: number, y: number): Diagram {
+ if (!findNode(diagram, nodeId)) {
+ return diagram;
+ }
+ return {
+ ...diagram,
+ nodes: diagram.nodes.map((n) => (n.id === nodeId ? { ...n, x, y } : n)),
+ };
+}
+
+/**
+ * Adds an edge between two existing nodes. Self-loops and duplicate connections
+ * (same from/to pair) are rejected by returning the diagram unchanged.
+ */
+export function addEdge(diagram: Diagram, from: string, to: string, options: { id?: string; label?: string } = {}): Diagram {
+ if (from === to || !findNode(diagram, from) || !findNode(diagram, to)) {
+ return diagram;
+ }
+ if (diagram.edges.some((e) => e.from === from && e.to === to)) {
+ return diagram;
+ }
+ const id = options.id ?? nextId(diagram, 'edge');
+ if (findNode(diagram, id) || findEdge(diagram, id)) {
+ throw new Error(`Id "${id}" is already in use.`);
+ }
+ const edge: DiagramEdge = { id, from, to };
+ if (options.label) {
+ edge.label = options.label;
+ }
+ return { ...diagram, edges: [...diagram.edges, edge] };
+}
+
+export function removeEdge(diagram: Diagram, edgeId: string): Diagram {
+ if (!findEdge(diagram, edgeId)) {
+ return diagram;
+ }
+ return { ...diagram, edges: diagram.edges.filter((e) => e.id !== edgeId) };
+}
+
+/** Removes a node (with its edges) or an edge, whichever the id refers to. */
+export function removeElement(diagram: Diagram, id: string): Diagram {
+ return findNode(diagram, id) ? removeNode(diagram, id) : removeEdge(diagram, id);
+}
+
+/** Sets the label of the node or edge with the given id. */
+export function setLabel(diagram: Diagram, id: string, label: string): Diagram {
+ if (findNode(diagram, id)) {
+ return { ...diagram, nodes: diagram.nodes.map((n) => (n.id === id ? { ...n, label } : n)) };
+ }
+ if (findEdge(diagram, id)) {
+ return {
+ ...diagram,
+ edges: diagram.edges.map((e) => {
+ if (e.id !== id) {
+ return e;
+ }
+ const { label: _old, ...rest } = e;
+ return label === '' ? rest : { ...rest, label };
+ }),
+ };
+ }
+ return diagram;
+}
+
+// ---------------------------------------------------------------------------
+// Geometry
+// ---------------------------------------------------------------------------
+
+export function nodeCenter(node: DiagramNode): Point {
+ return { x: node.x + node.width / 2, y: node.y + node.height / 2 };
+}
+
+/**
+ * Returns the point where a ray from the node's centre towards `toward` leaves the node's outline.
+ */
+export function boundaryPoint(node: DiagramNode, toward: Point): Point {
+ const c = nodeCenter(node);
+ const dx = toward.x - c.x;
+ const dy = toward.y - c.y;
+ if (dx === 0 && dy === 0) {
+ return c;
+ }
+ const a = node.width / 2;
+ const b = node.height / 2;
+ let t: number;
+ switch (node.type) {
+ case 'ellipse':
+ t = 1 / Math.sqrt((dx * dx) / (a * a) + (dy * dy) / (b * b));
+ break;
+ case 'diamond':
+ t = 1 / (Math.abs(dx) / a + Math.abs(dy) / b);
+ break;
+ default:
+ t = Math.min(dx === 0 ? Infinity : a / Math.abs(dx), dy === 0 ? Infinity : b / Math.abs(dy));
+ break;
+ }
+ return { x: c.x + dx * t, y: c.y + dy * t };
+}
+
+/**
+ * Computes where an edge should be drawn: from the outline of its source node to the outline of its
+ * target node, along the line joining their centres. Returns `undefined` if either node is missing.
+ * Because endpoints are derived from node geometry, they follow the nodes whenever they move.
+ */
+export function getEdgeEndpoints(diagram: Diagram, edge: DiagramEdge): EdgeEndpoints | undefined {
+ const from = findNode(diagram, edge.from);
+ const to = findNode(diagram, edge.to);
+ if (!from || !to) {
+ return undefined;
+ }
+ return {
+ start: boundaryPoint(from, nodeCenter(to)),
+ end: boundaryPoint(to, nodeCenter(from)),
+ };
+}
+
+/** Returns the node whose bounding box contains `point`, preferring the top-most (last drawn). */
+export function hitTestNode(diagram: Diagram, point: Point, excludeId?: string): DiagramNode | undefined {
+ for (let i = diagram.nodes.length - 1; i >= 0; i--) {
+ const n = diagram.nodes[i];
+ if (n.id === excludeId) {
+ continue;
+ }
+ if (point.x >= n.x && point.x <= n.x + n.width && point.y >= n.y && point.y <= n.y + n.height) {
+ return n;
+ }
+ }
+ return undefined;
+}
diff --git a/src/newDiagram.ts b/src/newDiagram.ts
new file mode 100644
index 0000000..5376627
--- /dev/null
+++ b/src/newDiagram.ts
@@ -0,0 +1,50 @@
+import * as vscode from 'vscode';
+import { createEmptyDiagram, serializeDiagram } from './model/diagram';
+import { DIAGRAM_EDITOR_VIEW_TYPE } from './diagramEditor';
+
+export const NEW_DIAGRAM_COMMAND = 'diagrammer.newDiagram';
+
+/**
+ * Creates `untitled.diagram.json` (or `untitled-N.diagram.json` if that name is taken) in the first
+ * workspace folder, writes an empty diagram into it and opens it in the diagram editor.
+ * Without an open workspace folder the user is asked where to save the file.
+ */
+export async function newDiagram(): Promise<vscode.Uri | undefined> {
+ const folder = vscode.workspace.workspaceFolders?.[0];
+ let target: vscode.Uri | undefined;
+ if (folder) {
+ target = await findFreeUri(folder.uri);
+ } else {
+ target = await vscode.window.showSaveDialog({
+ title: 'New Diagram',
+ saveLabel: 'Create Diagram',
+ filters: { Diagram: ['diagram.json'] },
+ });
+ }
+ if (!target) {
+ return undefined;
+ }
+
+ await vscode.workspace.fs.writeFile(target, new TextEncoder().encode(serializeDiagram(createEmptyDiagram())));
+ await vscode.commands.executeCommand('vscode.openWith', target, DIAGRAM_EDITOR_VIEW_TYPE);
+ return target;
+}
+
+async function findFreeUri(folder: vscode.Uri): Promise<vscode.Uri> {
+ for (let i = 0; ; i++) {
+ const name = i === 0 ? 'untitled.diagram.json' : `untitled-${i}.diagram.json`;
+ const candidate = vscode.Uri.joinPath(folder, name);
+ if (!(await exists(candidate))) {
+ return candidate;
+ }
+ }
+}
+
+async function exists(uri: vscode.Uri): Promise<boolean> {
+ try {
+ await vscode.workspace.fs.stat(uri);
+ return true;
+ } catch {
+ return false;
+ }
+}
diff --git a/src/protocol.ts b/src/protocol.ts
new file mode 100644
index 0000000..2369113
--- /dev/null
+++ b/src/protocol.ts
@@ -0,0 +1,14 @@
+import type { Diagram } from './model/diagram';
+
+/** Messages sent from the webview to the extension host. */
+export type WebviewToHostMessage =
+ | { type: 'ready' }
+ | { type: 'edit'; label: string; diagram: Diagram }
+ /** Reported after each full render with the number of node and edge elements drawn. */
+ | { type: 'rendered'; nodes: number; edges: number };
+
+/** Messages sent from the extension host to the webview. */
+export type HostToWebviewMessage =
+ | { type: 'init'; diagram: Diagram }
+ | { type: 'update'; diagram: Diagram }
+ | { type: 'error'; message: string };
diff --git a/src/test/integration/runTest.ts b/src/test/integration/runTest.ts
new file mode 100644
index 0000000..2c1036f
--- /dev/null
+++ b/src/test/integration/runTest.ts
@@ -0,0 +1,28 @@
+import * as fs from 'fs';
+import * as os from 'os';
+import * as path from 'path';
+import { runTests } from '@vscode/test-electron';
+
+async function main(): Promise<void> {
+ const root = path.resolve(__dirname, '../../../');
+ const extensionTestsPath = path.resolve(__dirname, './suite/index');
+
+ // Run against a throw-away copy of the fixture workspace so tests can create files freely.
+ const workspace = fs.mkdtempSync(path.join(os.tmpdir(), 'diagrammer-test-'));
+ fs.cpSync(path.join(root, 'test-fixtures', 'workspace'), workspace, { recursive: true });
+
+ try {
+ await runTests({
+ extensionDevelopmentPath: root,
+ extensionTestsPath,
+ launchArgs: [workspace, '--disable-extensions', '--disable-workspace-trust'],
+ });
+ } catch (err) {
+ console.error('Failed to run integration tests', err);
+ process.exitCode = 1;
+ } finally {
+ fs.rmSync(workspace, { recursive: true, force: true });
+ }
+}
+
+void main();
diff --git a/src/test/integration/suite/extension.test.ts b/src/test/integration/suite/extension.test.ts
new file mode 100644
index 0000000..245812c
--- /dev/null
+++ b/src/test/integration/suite/extension.test.ts
@@ -0,0 +1,101 @@
+import * as assert from 'assert';
+import * as vscode from 'vscode';
+import type { DiagrammerApi } from '../../../extension';
+import type { RenderReport } from '../../../diagramEditor';
+import { parseDiagram } from '../../../model/diagram';
+
+const VIEW_TYPE = 'diagrammer.diagramEditor';
+
+function workspaceUri(name: string): vscode.Uri {
+ const folder = vscode.workspace.workspaceFolders?.[0];
+ assert.ok(folder, 'tests must run with a workspace folder open');
+ return vscode.Uri.joinPath(folder.uri, name);
+}
+
+function activeCustomEditorInput(): vscode.TabInputCustom | undefined {
+ const input = vscode.window.tabGroups.activeTabGroup.activeTab?.input;
+ return input instanceof vscode.TabInputCustom ? input : undefined;
+}
+
+async function waitFor<T>(what: string, check: () => T | undefined, timeoutMs = 10000): Promise<T> {
+ const deadline = Date.now() + timeoutMs;
+ while (Date.now() < deadline) {
+ const value = check();
+ if (value !== undefined) {
+ return value;
+ }
+ await new Promise((r) => setTimeout(r, 50));
+ }
+ throw new Error(`Timed out waiting for ${what}`);
+}
+
+describe('Diagrammer extension', () => {
+ let api: DiagrammerApi;
+
+ before(async () => {
+ const extension = vscode.extensions.getExtension<DiagrammerApi>('nabled.diagrammer');
+ assert.ok(extension, 'extension should be installed');
+ api = await extension.activate();
+ });
+
+ afterEach(async () => {
+ await vscode.commands.executeCommand('workbench.action.closeAllEditors');
+ });
+
+ it('registers the Diagrammer: New Diagram command', async () => {
+ const commands = await vscode.commands.getCommands(true);
+ assert.ok(commands.includes('diagrammer.newDiagram'));
+ });
+
+ it('opens .diagram.json files in the custom editor and renders their nodes and edges', async () => {
+ const uri = workspaceUri('sample.diagram.json');
+ const rendered = new Promise<RenderReport>((resolve) => {
+ const sub = api.onDidRender((report) => {
+ if (report.uri.toString() === uri.toString()) {
+ sub.dispose();
+ resolve(report);
+ }
+ });
+ });
+
+ // Plain "open" uses the default editor for the file, which should be ours.
+ await vscode.commands.executeCommand('vscode.open', uri);
+
+ const input = await waitFor('custom editor tab', activeCustomEditorInput);
+ assert.strictEqual(input.viewType, VIEW_TYPE);
+ assert.strictEqual(input.uri.toString(), uri.toString());
+
+ const report = await rendered;
+ assert.strictEqual(report.nodes, 3);
+ assert.strictEqual(report.edges, 2);
+ });
+
+ it('New Diagram creates a valid empty diagram file and opens it', async () => {
+ const created = await vscode.commands.executeCommand<vscode.Uri>('diagrammer.newDiagram');
+ assert.ok(created);
+ assert.ok(created.path.endsWith('/untitled.diagram.json'), created.path);
+
+ const text = new TextDecoder().decode(await vscode.workspace.fs.readFile(created));
+ assert.deepStrictEqual(parseDiagram(text), { version: 1, nodes: [], edges: [] });
+ assert.deepStrictEqual(JSON.parse(text), { version: 1, nodes: [], edges: [] });
+
+ const input = await waitFor('custom editor tab', activeCustomEditorInput);
+ assert.strictEqual(input.viewType, VIEW_TYPE);
+ assert.strictEqual(input.uri.toString(), created.toString());
+
+ // A second invocation must not overwrite the first file.
+ const second = await vscode.commands.executeCommand<vscode.Uri>('diagrammer.newDiagram');
+ assert.ok(second?.path.endsWith('/untitled-1.diagram.json'), second?.path);
+ });
+
+ it('opens malformed files without throwing and leaves them untouched', async () => {
+ const uri = workspaceUri('broken.diagram.json');
+ const before = await vscode.workspace.fs.readFile(uri);
+ await vscode.commands.executeCommand('vscode.openWith', uri, VIEW_TYPE);
+ const input = await waitFor('custom editor tab', activeCustomEditorInput);
+ assert.strictEqual(input.uri.toString(), uri.toString());
+ await vscode.commands.executeCommand('workbench.action.files.save');
+ const after = await vscode.workspace.fs.readFile(uri);
+ assert.deepStrictEqual(Buffer.from(after), Buffer.from(before));
+ });
+});
diff --git a/src/test/integration/suite/index.ts b/src/test/integration/suite/index.ts
new file mode 100644
index 0000000..9bfe9fa
--- /dev/null
+++ b/src/test/integration/suite/index.ts
@@ -0,0 +1,22 @@
+import * as fs from 'fs';
+import * as path from 'path';
+import Mocha from 'mocha';
+
+export function run(): Promise<void> {
+ const mocha = new Mocha({ ui: 'bdd', color: true, timeout: 30000 });
+ const testsRoot = __dirname;
+ for (const file of fs.readdirSync(testsRoot)) {
+ if (file.endsWith('.test.js')) {
+ mocha.addFile(path.join(testsRoot, file));
+ }
+ }
+ return new Promise((resolve, reject) => {
+ mocha.run((failures) => {
+ if (failures > 0) {
+ reject(new Error(`${failures} integration test(s) failed.`));
+ } else {
+ resolve();
+ }
+ });
+ });
+}
diff --git a/src/test/unit/diagram.test.ts b/src/test/unit/diagram.test.ts
new file mode 100644
index 0000000..692e073
--- /dev/null
+++ b/src/test/unit/diagram.test.ts
@@ -0,0 +1,296 @@
+import * as assert from 'assert';
+import {
+ addEdge,
+ addNode,
+ boundaryPoint,
+ createEmptyDiagram,
+ createNode,
+ Diagram,
+ DiagramNode,
+ DiagramParseError,
+ edgesForNode,
+ getEdgeEndpoints,
+ hitTestNode,
+ moveNode,
+ nextId,
+ parseDiagram,
+ removeEdge,
+ removeElement,
+ removeNode,
+ serializeDiagram,
+ setLabel,
+} from '../../model/diagram';
+
+function node(id: string, x: number, y: number, overrides: Partial<DiagramNode> = {}): DiagramNode {
+ return { id, type: 'rectangle', x, y, width: 100, height: 50, label: id, ...overrides };
+}
+
+function sampleDiagram(): Diagram {
+ let d = createEmptyDiagram();
+ d = addNode(d, node('a', 0, 0));
+ d = addNode(d, node('b', 300, 0, { type: 'ellipse' }));
+ d = addNode(d, node('c', 0, 300, { type: 'diamond' }));
+ d = addEdge(d, 'a', 'b', { id: 'e1', label: 'calls' });
+ d = addEdge(d, 'b', 'c', { id: 'e2' });
+ d = addEdge(d, 'c', 'a', { id: 'e3' });
+ return d;
+}
+
+describe('diagram model', () => {
+ describe('serialization', () => {
+ it('round-trips a diagram through serialize/parse', () => {
+ const original = sampleDiagram();
+ const text = serializeDiagram(original);
+ const parsed = parseDiagram(text);
+ assert.deepStrictEqual(parsed, original);
+ assert.strictEqual(serializeDiagram(parsed), text);
+ });
+
+ it('round-trips every node type', () => {
+ let d = createEmptyDiagram();
+ const types = ['rectangle', 'roundedRectangle', 'ellipse', 'diamond', 'text', 'sticky'] as const;
+ types.forEach((type, i) => {
+ d = addNode(d, createNode(d, type, { x: 100 * i + 100, y: 100 }));
+ });
+ assert.deepStrictEqual(parseDiagram(serializeDiagram(d)), d);
+ assert.deepStrictEqual(
+ parseDiagram(serializeDiagram(d)).nodes.map((n) => n.type),
+ [...types],
+ );
+ });
+
+ it('serializes to the documented file format', () => {
+ const json = JSON.parse(serializeDiagram(sampleDiagram()));
+ assert.deepStrictEqual(Object.keys(json), ['version', 'nodes', 'edges']);
+ assert.strictEqual(json.version, 1);
+ assert.deepStrictEqual(Object.keys(json.nodes[0]).sort(), ['height', 'id', 'label', 'type', 'width', 'x', 'y']);
+ assert.deepStrictEqual(json.edges[0], { id: 'e1', from: 'a', to: 'b', label: 'calls' });
+ // Optional edge label is omitted when absent.
+ assert.deepStrictEqual(json.edges[1], { id: 'e2', from: 'b', to: 'c' });
+ });
+
+ it('serializes an empty diagram that parses back', () => {
+ const text = serializeDiagram(createEmptyDiagram());
+ assert.deepStrictEqual(JSON.parse(text), { version: 1, nodes: [], edges: [] });
+ assert.deepStrictEqual(parseDiagram(text), createEmptyDiagram());
+ });
+
+ it('treats an empty file as an empty diagram', () => {
+ assert.deepStrictEqual(parseDiagram(''), createEmptyDiagram());
+ assert.deepStrictEqual(parseDiagram(' \n'), createEmptyDiagram());
+ });
+
+ it('fills in missing optional fields', () => {
+ const d = parseDiagram('{"nodes":[{"id":"a","type":"text","x":1,"y":2,"width":30,"height":20}]}');
+ assert.strictEqual(d.version, 1);
+ assert.strictEqual(d.nodes[0].label, '');
+ assert.deepStrictEqual(d.edges, []);
+ });
+ });
+
+ describe('malformed input', () => {
+ const cases: [string, string][] = [
+ ['invalid JSON syntax', '{ "nodes": ['],
+ ['a non-object root', '[1, 2, 3]'],
+ ['a null root', 'null'],
+ ['nodes that are not an array', '{"version":1,"nodes":{},"edges":[]}'],
+ ['edges that are not an array', '{"version":1,"nodes":[],"edges":"x"}'],
+ ['an unsupported future version', '{"version":99,"nodes":[],"edges":[]}'],
+ ['a non-numeric version', '{"version":"1","nodes":[],"edges":[]}'],
+ ['an unknown node type', '{"version":1,"nodes":[{"id":"a","type":"hexagon","x":0,"y":0,"width":1,"height":1,"label":""}],"edges":[]}'],
+ ['a node with a missing coordinate', '{"version":1,"nodes":[{"id":"a","type":"rectangle","y":0,"width":10,"height":10,"label":""}],"edges":[]}'],
+ ['a node with a string coordinate', '{"version":1,"nodes":[{"id":"a","type":"rectangle","x":"0","y":0,"width":10,"height":10,"label":""}],"edges":[]}'],
+ ['a node without an id', '{"version":1,"nodes":[{"type":"rectangle","x":0,"y":0,"width":10,"height":10,"label":""}],"edges":[]}'],
+ ['a non-string label', '{"version":1,"nodes":[{"id":"a","type":"rectangle","x":0,"y":0,"width":10,"height":10,"label":5}],"edges":[]}'],
+ ['duplicate node ids', '{"version":1,"nodes":[{"id":"a","type":"rectangle","x":0,"y":0,"width":10,"height":10,"label":""},{"id":"a","type":"rectangle","x":0,"y":0,"width":10,"height":10,"label":""}],"edges":[]}'],
+ ['an edge without endpoints', '{"version":1,"nodes":[],"edges":[{"id":"e"}]}'],
+ ];
+ for (const [name, text] of cases) {
+ it(`rejects ${name} with a DiagramParseError`, () => {
+ assert.throws(() => parseDiagram(text), DiagramParseError);
+ });
+ }
+
+ it('drops edges that reference unknown nodes instead of failing', () => {
+ const d = parseDiagram(
+ JSON.stringify({
+ version: 1,
+ nodes: [node('a', 0, 0), node('b', 200, 0)],
+ edges: [
+ { id: 'ok', from: 'a', to: 'b' },
+ { id: 'dangling', from: 'a', to: 'missing' },
+ ],
+ }),
+ );
+ assert.deepStrictEqual(
+ d.edges.map((e) => e.id),
+ ['ok'],
+ );
+ });
+
+ it('ignores unknown extra properties', () => {
+ const d = parseDiagram(
+ JSON.stringify({ version: 1, extra: true, nodes: [{ ...node('a', 0, 0), color: 'red' }], edges: [] }),
+ );
+ assert.deepStrictEqual(d.nodes, [node('a', 0, 0)]);
+ });
+ });
+
+ describe('adding and removing', () => {
+ it('adds nodes without mutating the original diagram', () => {
+ const empty = createEmptyDiagram();
+ const d = addNode(empty, node('a', 0, 0));
+ assert.strictEqual(empty.nodes.length, 0);
+ assert.deepStrictEqual(d.nodes, [node('a', 0, 0)]);
+ });
+
+ it('rejects a node whose id is already used', () => {
+ const d = addNode(createEmptyDiagram(), node('a', 0, 0));
+ assert.throws(() => addNode(d, node('a', 10, 10)));
+ });
+
+ it('creates nodes with unique ids and default sizes centred on the drop point', () => {
+ let d = createEmptyDiagram();
+ const first = createNode(d, 'rectangle', { x: 200, y: 100 });
+ d = addNode(d, first);
+ const second = createNode(d, 'sticky', { x: 400, y: 100 });
+ d = addNode(d, second);
+ assert.notStrictEqual(first.id, second.id);
+ assert.strictEqual(first.x + first.width / 2, 200);
+ assert.strictEqual(first.y + first.height / 2, 100);
+ assert.ok(first.label.length > 0);
+ });
+
+ it('generates ids that do not collide with existing ones', () => {
+ let d = addNode(createEmptyDiagram(), node('node-1', 0, 0));
+ d = addNode(d, node('node-7', 0, 0));
+ assert.strictEqual(nextId(d, 'node'), 'node-8');
+ assert.strictEqual(nextId(d, 'edge'), 'edge-1');
+ });
+
+ it('adds edges between existing nodes', () => {
+ let d = addNode(addNode(createEmptyDiagram(), node('a', 0, 0)), node('b', 200, 0));
+ d = addEdge(d, 'a', 'b');
+ assert.strictEqual(d.edges.length, 1);
+ assert.strictEqual(d.edges[0].from, 'a');
+ assert.strictEqual(d.edges[0].to, 'b');
+ assert.strictEqual(d.edges[0].label, undefined);
+ });
+
+ it('ignores edges to unknown nodes, self-loops and duplicates', () => {
+ let d = addNode(addNode(createEmptyDiagram(), node('a', 0, 0)), node('b', 200, 0));
+ d = addEdge(d, 'a', 'b');
+ assert.strictEqual(addEdge(d, 'a', 'missing'), d);
+ assert.strictEqual(addEdge(d, 'a', 'a'), d);
+ assert.strictEqual(addEdge(d, 'a', 'b'), d);
+ assert.strictEqual(addEdge(d, 'b', 'a').edges.length, 2);
+ });
+
+ it('removes an edge without touching nodes', () => {
+ const d = removeEdge(sampleDiagram(), 'e1');
+ assert.deepStrictEqual(
+ d.edges.map((e) => e.id),
+ ['e2', 'e3'],
+ );
+ assert.strictEqual(d.nodes.length, 3);
+ });
+
+ it('cascades node deletion to every connected edge', () => {
+ const before = sampleDiagram();
+ const d = removeNode(before, 'b');
+ assert.deepStrictEqual(
+ d.nodes.map((n) => n.id),
+ ['a', 'c'],
+ );
+ // e1 (a->b) and e2 (b->c) both touch b; only e3 (c->a) survives.
+ assert.deepStrictEqual(
+ d.edges.map((e) => e.id),
+ ['e3'],
+ );
+ assert.deepStrictEqual(edgesForNode(d, 'b'), []);
+ // The original is untouched (needed for undo snapshots).
+ assert.strictEqual(before.nodes.length, 3);
+ assert.strictEqual(before.edges.length, 3);
+ });
+
+ it('removeElement deletes nodes (with edges) or edges by id', () => {
+ assert.strictEqual(removeElement(sampleDiagram(), 'a').edges.length, 1);
+ assert.strictEqual(removeElement(sampleDiagram(), 'e2').edges.length, 2);
+ assert.strictEqual(removeElement(sampleDiagram(), 'e2').nodes.length, 3);
+ });
+
+ it('returns the same diagram when removing unknown ids', () => {
+ const d = sampleDiagram();
+ assert.strictEqual(removeNode(d, 'nope'), d);
+ assert.strictEqual(removeEdge(d, 'nope'), d);
+ });
+ });
+
+ describe('labels', () => {
+ it('sets node and edge labels', () => {
+ let d = setLabel(sampleDiagram(), 'a', 'Start');
+ d = setLabel(d, 'e2', 'then');
+ assert.strictEqual(d.nodes[0].label, 'Start');
+ assert.strictEqual(d.edges[1].label, 'then');
+ });
+
+ it('clearing an edge label removes the property', () => {
+ const d = setLabel(sampleDiagram(), 'e1', '');
+ assert.strictEqual('label' in d.edges[0], false);
+ });
+ });
+
+ describe('moving nodes', () => {
+ it('updates the node position', () => {
+ const d = moveNode(sampleDiagram(), 'a', 40, 60);
+ assert.strictEqual(d.nodes[0].x, 40);
+ assert.strictEqual(d.nodes[0].y, 60);
+ });
+
+ it('keeps connected edge endpoints attached to the moved node', () => {
+ let d = createEmptyDiagram();
+ d = addNode(d, node('a', 0, 0)); // centre (50, 25)
+ d = addNode(d, node('b', 300, 0)); // centre (350, 25)
+ d = addEdge(d, 'a', 'b', { id: 'e' });
+
+ const before = getEdgeEndpoints(d, d.edges[0]);
+ assert.deepStrictEqual(before, { start: { x: 100, y: 25 }, end: { x: 300, y: 25 } });
+
+ // Move the target node below the source: the edge should now leave a's bottom side
+ // and enter b's top side.
+ d = moveNode(d, 'b', 0, 300); // centre (50, 325)
+ const afterTargetMove = getEdgeEndpoints(d, d.edges[0]);
+ assert.deepStrictEqual(afterTargetMove, { start: { x: 50, y: 50 }, end: { x: 50, y: 300 } });
+
+ // Move the source node too: both ends follow.
+ d = moveNode(d, 'a', 400, 300); // centre (450, 325)
+ const afterSourceMove = getEdgeEndpoints(d, d.edges[0]);
+ assert.deepStrictEqual(afterSourceMove, { start: { x: 400, y: 325 }, end: { x: 100, y: 325 } });
+ });
+
+ it('returns no endpoints when a node is missing', () => {
+ const d = sampleDiagram();
+ assert.strictEqual(getEdgeEndpoints(d, { id: 'x', from: 'a', to: 'missing' }), undefined);
+ });
+ });
+
+ describe('geometry', () => {
+ it('clips to the outline of ellipses and diamonds', () => {
+ const ellipse = node('e', 0, 0, { type: 'ellipse', width: 100, height: 50 });
+ const diamond = node('d', 0, 0, { type: 'diamond', width: 100, height: 50 });
+ assert.deepStrictEqual(boundaryPoint(ellipse, { x: 500, y: 25 }), { x: 100, y: 25 });
+ assert.deepStrictEqual(boundaryPoint(diamond, { x: 50, y: -500 }), { x: 50, y: 0 });
+ // Diagonal towards a corner of the diamond's bounding box hits the midpoint of the edge.
+ const p = boundaryPoint(diamond, { x: 150, y: 75 });
+ assert.ok(Math.abs(p.x - 75) < 1e-9 && Math.abs(p.y - 37.5) < 1e-9);
+ });
+
+ it('hit-tests the top-most node and supports exclusion', () => {
+ let d = addNode(createEmptyDiagram(), node('below', 0, 0));
+ d = addNode(d, node('above', 50, 0));
+ assert.strictEqual(hitTestNode(d, { x: 60, y: 10 })?.id, 'above');
+ assert.strictEqual(hitTestNode(d, { x: 60, y: 10 }, 'above')?.id, 'below');
+ assert.strictEqual(hitTestNode(d, { x: 500, y: 500 }), undefined);
+ });
+ });
+});
diff --git a/src/test/unit/webview.test.ts b/src/test/unit/webview.test.ts
new file mode 100644
index 0000000..b5c7949
--- /dev/null
+++ b/src/test/unit/webview.test.ts
@@ -0,0 +1,279 @@
+import * as assert from 'assert';
+import * as path from 'path';
+import { buildSync } from 'esbuild';
+import { JSDOM } from 'jsdom';
+import type { Diagram } from '../../model/diagram';
+import type { HostToWebviewMessage, WebviewToHostMessage } from '../../protocol';
+
+/**
+ * Exercises the real webview bundle inside jsdom: the host side is replaced by a fake
+ * `acquireVsCodeApi` that records posted messages.
+ */
+
+const webviewSource = buildSync({
+ entryPoints: [path.resolve(__dirname, '../../../src/webview/main.ts')],
+ bundle: true,
+ write: false,
+ format: 'iife',
+ platform: 'browser',
+ target: 'es2022',
+}).outputFiles[0].text;
+
+const HTML = `<!DOCTYPE html><html><body>
+<div id="app"><aside id="palette"></aside>
+<div id="canvas-container" tabindex="0"><svg id="canvas" xmlns="http://www.w3.org/2000/svg"></svg></div></div>
+<div id="error" hidden></div></body></html>`;
+
+const SAMPLE: Diagram = {
+ version: 1,
+ nodes: [
+ { id: 'node-1', type: 'rectangle', x: 0, y: 0, width: 100, height: 50, label: 'A' },
+ { id: 'node-2', type: 'ellipse', x: 300, y: 0, width: 100, height: 50, label: 'B' },
+ { id: 'node-3', type: 'diamond', x: 0, y: 300, width: 100, height: 50, label: 'C' },
+ ],
+ edges: [
+ { id: 'edge-1', from: 'node-1', to: 'node-2', label: 'calls' },
+ { id: 'edge-2', from: 'node-2', to: 'node-3' },
+ ],
+};
+
+interface Harness {
+ window: JSDOM['window'];
+ document: Document;
+ sent: WebviewToHostMessage[];
+ send(message: HostToWebviewMessage): void;
+ lastEdit(): Extract<WebviewToHostMessage, { type: 'edit' }>;
+ nodeEl(id: string): Element;
+ edgeLine(id: string): Element;
+ pointer(type: string, target: EventTarget, x: number, y: number): void;
+ container: HTMLElement;
+}
+
+function setup(initial: Diagram | null = SAMPLE): Harness {
+ const dom = new JSDOM(HTML, { runScripts: 'outside-only', pretendToBeVisual: true });
+ const { window } = dom;
+ const sent: WebviewToHostMessage[] = [];
+ const win = window as unknown as Record<string, unknown>;
+ win.acquireVsCodeApi = () => ({ postMessage: (m: WebviewToHostMessage) => sent.push(JSON.parse(JSON.stringify(m))) });
+ // jsdom has no SVG layout engine.
+ (window.SVGElement.prototype as unknown as Record<string, unknown>).getBBox = () => ({ x: 0, y: 0, width: 10, height: 10 });
+ window.eval(webviewSource);
+
+ const document = window.document;
+ const harness: Harness = {
+ window,
+ document,
+ sent,
+ container: document.getElementById('canvas-container') as HTMLElement,
+ send(message) {
+ window.dispatchEvent(new window.MessageEvent('message', { data: message }));
+ },
+ lastEdit() {
+ const edits = sent.filter((m) => m.type === 'edit');
+ assert.ok(edits.length > 0, 'expected an edit message');
+ return edits[edits.length - 1] as Extract<WebviewToHostMessage, { type: 'edit' }>;
+ },
+ nodeEl(id) {
+ const el = document.querySelector(`.node[data-id="${id}"]`);
+ assert.ok(el, `node ${id} should be rendered`);
+ return el;
+ },
+ edgeLine(id) {
+ const el = document.querySelector(`.edge[data-id="${id}"] .edge-line`);
+ assert.ok(el, `edge ${id} should be rendered`);
+ return el;
+ },
+ pointer(type, target, x, y) {
+ target.dispatchEvent(
+ new window.PointerEvent(type, { bubbles: true, cancelable: true, button: 0, clientX: x, clientY: y }),
+ );
+ },
+ };
+ if (initial) {
+ harness.send({ type: 'init', diagram: initial });
+ }
+ return harness;
+}
+
+describe('webview canvas', () => {
+ it('asks the host for the document when loaded', () => {
+ const h = setup(null);
+ assert.deepStrictEqual(h.sent, [{ type: 'ready' }]);
+ });
+
+ it('renders the palette with all six shapes', () => {
+ const h = setup();
+ const types = [...h.document.querySelectorAll<HTMLElement>('.palette-item')].map((b) => b.dataset.type);
+ assert.deepStrictEqual(types, ['rectangle', 'roundedRectangle', 'ellipse', 'diamond', 'text', 'sticky']);
+ });
+
+ it('renders existing nodes, edges and labels and reports the counts', () => {
+ const h = setup();
+ assert.strictEqual(h.document.querySelectorAll('.node').length, 3);
+ assert.strictEqual(h.document.querySelectorAll('.edge').length, 2);
+ assert.strictEqual(h.nodeEl('node-2').querySelector('ellipse') !== null, true);
+ assert.strictEqual(h.nodeEl('node-3').querySelector('polygon') !== null, true);
+ assert.strictEqual(h.nodeEl('node-1').querySelector('.node-label')?.textContent, 'A');
+ assert.strictEqual(h.document.querySelector('.edge[data-id="edge-1"] .edge-label')?.textContent, 'calls');
+ assert.deepStrictEqual(h.sent[h.sent.length - 1], { type: 'rendered', nodes: 3, edges: 2 });
+ });
+
+ it('renders labels as text, never as markup', () => {
+ const h = setup({
+ version: 1,
+ nodes: [{ id: 'x', type: 'text', x: 0, y: 0, width: 50, height: 20, label: '<img src=x onerror=alert(1)>' }],
+ edges: [],
+ });
+ assert.strictEqual(h.document.querySelector('img'), null);
+ assert.strictEqual(h.nodeEl('x').textContent, '<img src=x onerror=alert(1)>');
+ });
+
+ it('shows an error instead of the canvas for malformed documents', () => {
+ const h = setup(null);
+ h.send({ type: 'error', message: 'Invalid JSON' });
+ assert.strictEqual((h.document.getElementById('app') as HTMLElement).hidden, true);
+ assert.strictEqual(h.document.getElementById('error')?.textContent, 'Invalid JSON');
+ });
+
+ it('adds a shape dropped from the palette at the drop position', () => {
+ const h = setup();
+ const drop = new h.window.Event('drop', { bubbles: true, cancelable: true });
+ Object.defineProperty(drop, 'dataTransfer', {
+ value: { types: ['application/x-diagrammer-shape'], getData: () => 'sticky' },
+ });
+ Object.assign(drop, { clientX: 500, clientY: 400 });
+ h.container.dispatchEvent(drop);
+
+ const edit = h.lastEdit();
+ assert.strictEqual(edit.diagram.nodes.length, 4);
+ const added = edit.diagram.nodes[3];
+ assert.strictEqual(added.type, 'sticky');
+ assert.strictEqual(added.x + added.width / 2, 500);
+ assert.strictEqual(added.y + added.height / 2, 400);
+ assert.strictEqual(h.document.querySelectorAll('.node').length, 4);
+ });
+
+ it('moves a node by dragging and keeps its connectors attached', () => {
+ const h = setup();
+ const before = h.edgeLine('edge-1').getAttribute('x1');
+ h.pointer('pointerdown', h.nodeEl('node-1').querySelector('.shape') as Element, 50, 25);
+ h.pointer('pointermove', h.window, 90, 225);
+ h.pointer('pointerup', h.window, 90, 225);
+
+ const edit = h.lastEdit();
+ assert.strictEqual(edit.label, 'Move node');
+ const moved = edit.diagram.nodes.find((n) => n.id === 'node-1');
+ assert.deepStrictEqual({ x: moved?.x, y: moved?.y }, { x: 40, y: 200 });
+ assert.strictEqual(h.nodeEl('node-1').getAttribute('transform'), 'translate(40,200)');
+ assert.notStrictEqual(h.edgeLine('edge-1').getAttribute('x1'), before);
+ assert.strictEqual(edit.diagram.edges.length, 2);
+ });
+
+ it('does not report an edit for a simple click', () => {
+ const h = setup();
+ const count = h.sent.length;
+ h.pointer('pointerdown', h.nodeEl('node-1').querySelector('.shape') as Element, 50, 25);
+ h.pointer('pointerup', h.window, 50, 25);
+ assert.strictEqual(h.sent.length, count);
+ assert.ok(h.nodeEl('node-1').classList.contains('selected'));
+ });
+
+ it('creates a connector by dragging from a handle to another node', () => {
+ const h = setup();
+ const handle = h.nodeEl('node-1').querySelector('.handle') as Element;
+ h.pointer('pointerdown', handle, 50, 0);
+ h.pointer('pointermove', h.window, 40, 320);
+ assert.ok(h.document.querySelector('.edge-preview'), 'a preview line is drawn while connecting');
+ h.pointer('pointerup', h.window, 40, 320);
+
+ const edit = h.lastEdit();
+ assert.strictEqual(edit.label, 'Add connector');
+ assert.deepStrictEqual(
+ edit.diagram.edges.map((e) => [e.from, e.to]),
+ [
+ ['node-1', 'node-2'],
+ ['node-2', 'node-3'],
+ ['node-1', 'node-3'],
+ ],
+ );
+ assert.strictEqual(h.document.querySelectorAll('.edge').length, 3);
+ assert.strictEqual(h.document.querySelector('.edge-preview'), null);
+ });
+
+ it('does not create a connector when released over empty canvas', () => {
+ const h = setup();
+ const count = h.sent.length;
+ h.pointer('pointerdown', h.nodeEl('node-1').querySelector('.handle') as Element, 50, 0);
+ h.pointer('pointermove', h.window, 700, 700);
+ h.pointer('pointerup', h.window, 700, 700);
+ assert.strictEqual(h.sent.filter((m) => m.type === 'edit').length, 0);
+ assert.strictEqual(h.sent.length, count);
+ });
+
+ it('deletes the selected node together with its connectors', () => {
+ const h = setup();
+ h.pointer('pointerdown', h.nodeEl('node-2').querySelector('.shape') as Element, 350, 25);
+ h.pointer('pointerup', h.window, 350, 25);
+ h.container.dispatchEvent(new h.window.KeyboardEvent('keydown', { key: 'Delete', bubbles: true }));
+
+ const edit = h.lastEdit();
+ assert.deepStrictEqual(
+ edit.diagram.nodes.map((n) => n.id),
+ ['node-1', 'node-3'],
+ );
+ assert.deepStrictEqual(edit.diagram.edges, []);
+ assert.strictEqual(h.document.querySelectorAll('.edge').length, 0);
+ });
+
+ it('deletes a selected connector', () => {
+ const h = setup();
+ h.pointer('pointerdown', h.document.querySelector('.edge[data-id="edge-2"] .edge-hit') as Element, 0, 0);
+ h.container.dispatchEvent(new h.window.KeyboardEvent('keydown', { key: 'Delete', bubbles: true }));
+ const edit = h.lastEdit();
+ assert.deepStrictEqual(
+ edit.diagram.edges.map((e) => e.id),
+ ['edge-1'],
+ );
+ assert.strictEqual(edit.diagram.nodes.length, 3);
+ });
+
+ it('edits a node label on double-click', () => {
+ const h = setup();
+ h.nodeEl('node-1').dispatchEvent(new h.window.MouseEvent('dblclick', { bubbles: true }));
+ const editor = h.document.querySelector('textarea.label-editor') as HTMLTextAreaElement;
+ assert.ok(editor, 'label editor should open');
+ assert.strictEqual(editor.value, 'A');
+ editor.value = 'Renamed';
+ editor.dispatchEvent(new h.window.KeyboardEvent('keydown', { key: 'Enter', bubbles: true }));
+
+ const edit = h.lastEdit();
+ assert.strictEqual(edit.label, 'Edit label');
+ assert.strictEqual(edit.diagram.nodes[0].label, 'Renamed');
+ assert.strictEqual(h.document.querySelector('textarea.label-editor'), null);
+ assert.strictEqual(h.nodeEl('node-1').querySelector('.node-label')?.textContent, 'Renamed');
+ });
+
+ it('edits an edge label on double-click and cancels with Escape', () => {
+ const h = setup();
+ const edge = h.document.querySelector('.edge[data-id="edge-2"] .edge-hit') as Element;
+ edge.dispatchEvent(new h.window.MouseEvent('dblclick', { bubbles: true }));
+ let editor = h.document.querySelector('textarea.label-editor') as HTMLTextAreaElement;
+ editor.value = 'ignored';
+ editor.dispatchEvent(new h.window.KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
+ assert.strictEqual(h.sent.filter((m) => m.type === 'edit').length, 0);
+
+ edge.dispatchEvent(new h.window.MouseEvent('dblclick', { bubbles: true }));
+ editor = h.document.querySelector('textarea.label-editor') as HTMLTextAreaElement;
+ assert.strictEqual(editor.value, '');
+ editor.value = 'returns';
+ editor.dispatchEvent(new h.window.KeyboardEvent('keydown', { key: 'Enter', bubbles: true }));
+ assert.strictEqual(h.lastEdit().diagram.edges[1].label, 'returns');
+ });
+
+ it('replaces its state when the host sends an update (undo/redo)', () => {
+ const h = setup();
+ h.send({ type: 'update', diagram: { ...SAMPLE, nodes: SAMPLE.nodes.slice(0, 1), edges: [] } });
+ assert.strictEqual(h.document.querySelectorAll('.node').length, 1);
+ assert.strictEqual(h.document.querySelectorAll('.edge').length, 0);
+ });
+});
diff --git a/src/webview/main.ts b/src/webview/main.ts
new file mode 100644
index 0000000..b5867c6
--- /dev/null
+++ b/src/webview/main.ts
@@ -0,0 +1,606 @@
+import {
+ addEdge,
+ addNode,
+ createNode,
+ Diagram,
+ DiagramNode,
+ findEdge,
+ findNode,
+ getEdgeEndpoints,
+ hitTestNode,
+ isNodeType,
+ moveNode,
+ nodeCenter,
+ boundaryPoint,
+ NodeType,
+ Point,
+ removeElement,
+ setLabel,
+} from '../model/diagram';
+import type { HostToWebviewMessage, WebviewToHostMessage } from '../protocol';
+
+interface VsCodeApi {
+ postMessage(message: WebviewToHostMessage): void;
+}
+
+declare function acquireVsCodeApi(): VsCodeApi;
+
+const vscode = acquireVsCodeApi();
+
+const SVG_NS = 'http://www.w3.org/2000/svg';
+const SHAPE_MIME = 'application/x-diagrammer-shape';
+const CANVAS_MARGIN = 200;
+
+const PALETTE: { type: NodeType; title: string }[] = [
+ { type: 'rectangle', title: 'Rectangle' },
+ { type: 'roundedRectangle', title: 'Rounded rectangle' },
+ { type: 'ellipse', title: 'Ellipse' },
+ { type: 'diamond', title: 'Diamond' },
+ { type: 'text', title: 'Text label' },
+ { type: 'sticky', title: 'Sticky note' },
+];
+
+type Selection = { kind: 'node' | 'edge'; id: string } | undefined;
+
+type Interaction =
+ | { kind: 'none' }
+ | { kind: 'move'; nodeId: string; start: Point; origin: Point; moved: boolean }
+ | { kind: 'connect'; fromId: string; pointer: Point; targetId?: string };
+
+const app = document.getElementById('app') as HTMLDivElement;
+const palette = document.getElementById('palette') as HTMLElement;
+const container = document.getElementById('canvas-container') as HTMLDivElement;
+const svg = document.getElementById('canvas') as unknown as SVGSVGElement;
+const errorBox = document.getElementById('error') as HTMLDivElement;
+
+let diagram: Diagram | undefined;
+let selection: Selection;
+let interaction: Interaction = { kind: 'none' };
+let labelEditor: HTMLTextAreaElement | undefined;
+
+const edgeLayer = svgEl('g', { class: 'edges' });
+const nodeLayer = svgEl('g', { class: 'nodes' });
+const overlayLayer = svgEl('g', { class: 'overlay' });
+
+// ---------------------------------------------------------------------------
+// Setup
+// ---------------------------------------------------------------------------
+
+function init(): void {
+ const defs = svgEl('defs');
+ const marker = svgEl('marker', {
+ id: 'arrow',
+ viewBox: '0 0 10 10',
+ refX: '10',
+ refY: '5',
+ markerWidth: '8',
+ markerHeight: '8',
+ orient: 'auto-start-reverse',
+ });
+ marker.appendChild(svgEl('path', { d: 'M 0 0 L 10 5 L 0 10 z', class: 'arrowhead' }));
+ defs.appendChild(marker);
+ svg.append(defs, edgeLayer, nodeLayer, overlayLayer);
+
+ buildPalette();
+
+ container.addEventListener('dragover', (e) => {
+ if (e.dataTransfer?.types.includes(SHAPE_MIME)) {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'copy';
+ }
+ });
+ container.addEventListener('drop', (e) => {
+ const type = e.dataTransfer?.getData(SHAPE_MIME);
+ if (!isNodeType(type)) {
+ return;
+ }
+ e.preventDefault();
+ addShape(type, toCanvasPoint(e));
+ });
+
+ svg.addEventListener('pointerdown', onCanvasPointerDown);
+ svg.addEventListener('dblclick', onCanvasDoubleClick);
+ window.addEventListener('pointermove', onPointerMove);
+ window.addEventListener('pointerup', onPointerUp);
+ window.addEventListener('resize', () => updateCanvasSize());
+ container.addEventListener('keydown', onKeyDown);
+
+ window.addEventListener('message', (event: MessageEvent<HostToWebviewMessage>) => {
+ const message = event.data;
+ switch (message.type) {
+ case 'init':
+ case 'update':
+ cancelInteraction();
+ diagram = message.diagram;
+ if (selection && !findNode(diagram, selection.id) && !findEdge(diagram, selection.id)) {
+ selection = undefined;
+ }
+ showError(undefined);
+ render();
+ reportRendered();
+ break;
+ case 'error':
+ diagram = undefined;
+ showError(message.message);
+ break;
+ }
+ });
+
+ vscode.postMessage({ type: 'ready' });
+}
+
+function buildPalette(): void {
+ for (const item of PALETTE) {
+ const button = document.createElement('button');
+ button.className = 'palette-item';
+ button.type = 'button';
+ button.draggable = true;
+ button.title = `${item.title} (drag onto the canvas or click to add)`;
+ button.setAttribute('aria-label', item.title);
+ button.dataset.type = item.type;
+
+ const icon = svgEl('svg', { width: '40', height: '28', viewBox: '0 0 40 28' }) as SVGSVGElement;
+ icon.appendChild(paletteIcon(item.type));
+ const caption = document.createElement('span');
+ caption.textContent = item.title;
+ button.append(icon, caption);
+
+ button.addEventListener('dragstart', (e) => {
+ e.dataTransfer?.setData(SHAPE_MIME, item.type);
+ if (e.dataTransfer) {
+ e.dataTransfer.effectAllowed = 'copy';
+ }
+ });
+ button.addEventListener('click', () => {
+ const center = {
+ x: container.scrollLeft + container.clientWidth / 2,
+ y: container.scrollTop + container.clientHeight / 2,
+ };
+ addShape(item.type, center);
+ });
+ palette.appendChild(button);
+ }
+}
+
+function paletteIcon(type: NodeType): SVGElement {
+ const node: DiagramNode = { id: '', type, x: 4, y: 4, width: 32, height: 20, label: '' };
+ if (type === 'text') {
+ const text = svgEl('text', { x: '20', y: '19', class: 'palette-text', 'text-anchor': 'middle' });
+ text.textContent = 'Aa';
+ return text;
+ }
+ const g = svgEl('g', { class: `node-${type}` });
+ g.appendChild(shapeElement({ ...node, x: 0, y: 0 }));
+ g.setAttribute('transform', 'translate(4,4)');
+ return g;
+}
+
+// ---------------------------------------------------------------------------
+// Rendering
+// ---------------------------------------------------------------------------
+
+function render(): void {
+ edgeLayer.replaceChildren();
+ nodeLayer.replaceChildren();
+ overlayLayer.replaceChildren();
+ if (!diagram) {
+ return;
+ }
+ for (const edge of diagram.edges) {
+ const endpoints = getEdgeEndpoints(diagram, edge);
+ if (!endpoints) {
+ continue;
+ }
+ const { start, end } = endpoints;
+ const g = svgEl('g', { class: 'edge', 'data-id': edge.id });
+ if (selection?.kind === 'edge' && selection.id === edge.id) {
+ g.classList.add('selected');
+ }
+ const coords = { x1: `${start.x}`, y1: `${start.y}`, x2: `${end.x}`, y2: `${end.y}` };
+ g.appendChild(svgEl('line', { ...coords, class: 'edge-hit' }));
+ g.appendChild(svgEl('line', { ...coords, class: 'edge-line', 'marker-end': 'url(#arrow)' }));
+ edgeLayer.appendChild(g);
+ if (edge.label) {
+ const mid = { x: (start.x + end.x) / 2, y: (start.y + end.y) / 2 };
+ const bg = svgEl('rect', { class: 'edge-label-bg' });
+ const text = labelText(edge.label, mid, 'edge-label');
+ g.append(bg, text);
+ const box = text.getBBox();
+ setAttrs(bg, {
+ x: `${box.x - 4}`,
+ y: `${box.y - 2}`,
+ width: `${box.width + 8}`,
+ height: `${box.height + 4}`,
+ rx: '3',
+ });
+ }
+ }
+
+ for (const node of diagram.nodes) {
+ const g = svgEl('g', {
+ class: `node node-${node.type}`,
+ 'data-id': node.id,
+ transform: `translate(${node.x},${node.y})`,
+ });
+ if (selection?.kind === 'node' && selection.id === node.id) {
+ g.classList.add('selected');
+ }
+ if (interaction.kind === 'connect' && interaction.targetId === node.id) {
+ g.classList.add('connect-target');
+ }
+ g.appendChild(shapeElement({ ...node, x: 0, y: 0 }));
+ g.appendChild(labelText(node.label, { x: node.width / 2, y: node.height / 2 }, 'node-label'));
+ for (const handle of handlePositions(node)) {
+ g.appendChild(svgEl('circle', { class: 'handle', cx: `${handle.x}`, cy: `${handle.y}`, r: '5' }));
+ }
+ nodeLayer.appendChild(g);
+ }
+
+ if (interaction.kind === 'connect') {
+ const from = findNode(diagram, interaction.fromId);
+ if (from) {
+ const target = interaction.targetId ? findNode(diagram, interaction.targetId) : undefined;
+ const start = boundaryPoint(from, target ? nodeCenter(target) : interaction.pointer);
+ const end = target ? boundaryPoint(target, nodeCenter(from)) : interaction.pointer;
+ overlayLayer.appendChild(
+ svgEl('line', {
+ class: 'edge-line edge-preview',
+ x1: `${start.x}`,
+ y1: `${start.y}`,
+ x2: `${end.x}`,
+ y2: `${end.y}`,
+ 'marker-end': 'url(#arrow)',
+ }),
+ );
+ }
+ }
+
+ updateCanvasSize();
+}
+
+function shapeElement(node: DiagramNode): SVGElement {
+ const { width: w, height: h } = node;
+ switch (node.type) {
+ case 'ellipse':
+ return svgEl('ellipse', { class: 'shape', cx: `${w / 2}`, cy: `${h / 2}`, rx: `${w / 2}`, ry: `${h / 2}` });
+ case 'diamond':
+ return svgEl('polygon', {
+ class: 'shape',
+ points: `${w / 2},0 ${w},${h / 2} ${w / 2},${h} 0,${h / 2}`,
+ });
+ case 'roundedRectangle':
+ return svgEl('rect', { class: 'shape', width: `${w}`, height: `${h}`, rx: `${Math.min(14, h / 3)}` });
+ case 'sticky': {
+ const fold = Math.min(18, w / 4, h / 4);
+ const g = svgEl('g');
+ g.appendChild(
+ svgEl('path', {
+ class: 'shape',
+ d: `M0,0 H${w} V${h - fold} L${w - fold},${h} H0 Z`,
+ }),
+ );
+ g.appendChild(
+ svgEl('path', { class: 'sticky-fold', d: `M${w},${h - fold} H${w - fold} V${h} Z` }),
+ );
+ return g;
+ }
+ case 'text':
+ case 'rectangle':
+ default:
+ return svgEl('rect', { class: 'shape', width: `${w}`, height: `${h}` });
+ }
+}
+
+function labelText(label: string, center: Point, className: string): SVGTextElement {
+ const text = svgEl('text', {
+ class: className,
+ x: `${center.x}`,
+ y: `${center.y}`,
+ 'text-anchor': 'middle',
+ 'dominant-baseline': 'central',
+ }) as SVGTextElement;
+ const lines = label.split('\n');
+ const lineHeight = 1.2;
+ lines.forEach((line, i) => {
+ const tspan = svgEl('tspan', {
+ x: `${center.x}`,
+ dy: i === 0 ? `${(-(lines.length - 1) * lineHeight) / 2}em` : `${lineHeight}em`,
+ });
+ // textContent (never innerHTML) so labels cannot inject markup.
+ tspan.textContent = line === '' ? '\u00a0' : line;
+ text.appendChild(tspan);
+ });
+ return text;
+}
+
+function handlePositions(node: DiagramNode): Point[] {
+ const { width: w, height: h } = node;
+ return [
+ { x: w / 2, y: 0 },
+ { x: w, y: h / 2 },
+ { x: w / 2, y: h },
+ { x: 0, y: h / 2 },
+ ];
+}
+
+function updateCanvasSize(): void {
+ let maxX = 0;
+ let maxY = 0;
+ for (const n of diagram?.nodes ?? []) {
+ maxX = Math.max(maxX, n.x + n.width);
+ maxY = Math.max(maxY, n.y + n.height);
+ }
+ svg.setAttribute('width', `${Math.max(container.clientWidth, maxX + CANVAS_MARGIN)}`);
+ svg.setAttribute('height', `${Math.max(container.clientHeight, maxY + CANVAS_MARGIN)}`);
+}
+
+function reportRendered(): void {
+ vscode.postMessage({
+ type: 'rendered',
+ nodes: nodeLayer.querySelectorAll('.node').length,
+ edges: edgeLayer.querySelectorAll('.edge').length,
+ });
+}
+
+function showError(message: string | undefined): void {
+ errorBox.hidden = message === undefined;
+ app.hidden = message !== undefined;
+ errorBox.textContent = message ?? '';
+}
+
+// ---------------------------------------------------------------------------
+// Editing
+// ---------------------------------------------------------------------------
+
+function commit(label: string, next: Diagram): void {
+ if (next === diagram) {
+ return;
+ }
+ diagram = next;
+ render();
+ if (diagram) {
+ vscode.postMessage({ type: 'edit', label, diagram });
+ }
+}
+
+function addShape(type: NodeType, center: Point): void {
+ if (!diagram) {
+ return;
+ }
+ const node = createNode(diagram, type, center);
+ node.x = Math.max(0, node.x);
+ node.y = Math.max(0, node.y);
+ selection = { kind: 'node', id: node.id };
+ commit(`Add ${type}`, addNode(diagram, node));
+ container.focus();
+}
+
+function deleteSelection(): void {
+ if (!diagram || !selection) {
+ return;
+ }
+ const next = removeElement(diagram, selection.id);
+ const kind = selection.kind;
+ selection = undefined;
+ commit(kind === 'node' ? 'Delete node' : 'Delete connector', next);
+}
+
+function startLabelEdit(id: string): void {
+ if (!diagram) {
+ return;
+ }
+ closeLabelEditor(false);
+ const node = findNode(diagram, id);
+ const edge = node ? undefined : findEdge(diagram, id);
+ let box: { x: number; y: number; width: number; height: number };
+ let current: string;
+ if (node) {
+ box = { x: node.x, y: node.y, width: Math.max(node.width, 80), height: Math.max(node.height, 30) };
+ current = node.label;
+ } else if (edge) {
+ const endpoints = getEdgeEndpoints(diagram, edge);
+ if (!endpoints) {
+ return;
+ }
+ const mid = { x: (endpoints.start.x + endpoints.end.x) / 2, y: (endpoints.start.y + endpoints.end.y) / 2 };
+ box = { x: mid.x - 70, y: mid.y - 16, width: 140, height: 32 };
+ current = edge.label ?? '';
+ } else {
+ return;
+ }
+
+ const editor = document.createElement('textarea');
+ editor.className = 'label-editor';
+ editor.value = current;
+ editor.style.left = `${box.x}px`;
+ editor.style.top = `${box.y}px`;
+ editor.style.width = `${box.width}px`;
+ editor.style.height = `${box.height}px`;
+ editor.dataset.id = id;
+ editor.addEventListener('keydown', (e) => {
+ e.stopPropagation();
+ if (e.key === 'Enter' && !e.shiftKey) {
+ e.preventDefault();
+ closeLabelEditor(true);
+ } else if (e.key === 'Escape') {
+ e.preventDefault();
+ closeLabelEditor(false);
+ }
+ });
+ editor.addEventListener('blur', () => closeLabelEditor(true));
+ container.appendChild(editor);
+ labelEditor = editor;
+ editor.focus();
+ editor.select();
+}
+
+function closeLabelEditor(save: boolean): void {
+ const editor = labelEditor;
+ if (!editor) {
+ return;
+ }
+ labelEditor = undefined;
+ const id = editor.dataset.id ?? '';
+ const value = editor.value;
+ editor.remove();
+ container.focus();
+ if (save && diagram) {
+ const node = findNode(diagram, id);
+ const edge = findEdge(diagram, id);
+ const before = node ? node.label : (edge?.label ?? '');
+ if ((node || edge) && value !== before) {
+ commit('Edit label', setLabel(diagram, id, value));
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Pointer and keyboard handling
+// ---------------------------------------------------------------------------
+
+function onCanvasPointerDown(e: PointerEvent): void {
+ if (!diagram || e.button !== 0) {
+ return;
+ }
+ container.focus();
+ const target = e.target as Element;
+ const point = toCanvasPoint(e);
+ const nodeEl = target.closest('.node');
+ const edgeEl = target.closest('.edge');
+
+ if (nodeEl) {
+ const id = nodeEl.getAttribute('data-id') ?? '';
+ const node = findNode(diagram, id);
+ if (!node) {
+ return;
+ }
+ e.preventDefault();
+ selection = { kind: 'node', id };
+ if (target.classList.contains('handle')) {
+ interaction = { kind: 'connect', fromId: id, pointer: point };
+ } else {
+ interaction = { kind: 'move', nodeId: id, start: point, origin: { x: node.x, y: node.y }, moved: false };
+ }
+ } else if (edgeEl) {
+ selection = { kind: 'edge', id: edgeEl.getAttribute('data-id') ?? '' };
+ } else {
+ selection = undefined;
+ }
+ // Only toggle classes here: rebuilding the elements under the pointer would break double-click.
+ updateSelectionClasses();
+}
+
+function updateSelectionClasses(): void {
+ for (const el of svg.querySelectorAll('.node, .edge')) {
+ const kind = el.classList.contains('node') ? 'node' : 'edge';
+ el.classList.toggle('selected', selection?.kind === kind && selection.id === el.getAttribute('data-id'));
+ }
+}
+
+function onPointerMove(e: PointerEvent): void {
+ if (!diagram || interaction.kind === 'none') {
+ return;
+ }
+ const point = toCanvasPoint(e);
+ if (interaction.kind === 'move') {
+ const dx = point.x - interaction.start.x;
+ const dy = point.y - interaction.start.y;
+ if (!interaction.moved && Math.abs(dx) < 2 && Math.abs(dy) < 2) {
+ return;
+ }
+ interaction.moved = true;
+ const x = Math.max(0, Math.round(interaction.origin.x + dx));
+ const y = Math.max(0, Math.round(interaction.origin.y + dy));
+ // Update locally while dragging; the edit is reported once on pointer up.
+ diagram = moveNode(diagram, interaction.nodeId, x, y);
+ render();
+ } else {
+ interaction.pointer = point;
+ interaction.targetId = hitTestNode(diagram, point, interaction.fromId)?.id;
+ render();
+ }
+}
+
+function onPointerUp(): void {
+ if (!diagram) {
+ return;
+ }
+ const finished = interaction;
+ interaction = { kind: 'none' };
+ if (finished.kind === 'move') {
+ if (finished.moved) {
+ vscode.postMessage({ type: 'edit', label: 'Move node', diagram });
+ }
+ } else if (finished.kind === 'connect') {
+ if (finished.targetId) {
+ const next = addEdge(diagram, finished.fromId, finished.targetId);
+ const created = next.edges.find((edge) => !diagram?.edges.includes(edge));
+ if (created) {
+ selection = { kind: 'edge', id: created.id };
+ }
+ commit('Add connector', next);
+ }
+ render();
+ }
+}
+
+function cancelInteraction(): void {
+ interaction = { kind: 'none' };
+ closeLabelEditor(false);
+}
+
+function onCanvasDoubleClick(e: MouseEvent): void {
+ const target = e.target as Element;
+ const el = target.closest('.node') ?? target.closest('.edge');
+ const id = el?.getAttribute('data-id');
+ if (id) {
+ e.preventDefault();
+ startLabelEdit(id);
+ }
+}
+
+function onKeyDown(e: KeyboardEvent): void {
+ if (labelEditor) {
+ return;
+ }
+ if (e.key === 'Delete' || e.key === 'Backspace') {
+ if (selection) {
+ e.preventDefault();
+ deleteSelection();
+ }
+ } else if (e.key === 'Enter' || e.key === 'F2') {
+ if (selection) {
+ e.preventDefault();
+ startLabelEdit(selection.id);
+ }
+ } else if (e.key === 'Escape') {
+ if (interaction.kind !== 'none' || selection) {
+ interaction = { kind: 'none' };
+ selection = undefined;
+ render();
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Helpers
+// ---------------------------------------------------------------------------
+
+function toCanvasPoint(e: { clientX: number; clientY: number }): Point {
+ const rect = svg.getBoundingClientRect();
+ return { x: e.clientX - rect.left, y: e.clientY - rect.top };
+}
+
+function svgEl<K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string> = {}): SVGElementTagNameMap[K] {
+ const el = document.createElementNS(SVG_NS, tag);
+ setAttrs(el, attrs);
+ return el;
+}
+
+function setAttrs(el: Element, attrs: Record<string, string>): void {
+ for (const [key, value] of Object.entries(attrs)) {
+ el.setAttribute(key, value);
+ }
+}
+
+init();
diff --git a/test-fixtures/workspace/broken.diagram.json b/test-fixtures/workspace/broken.diagram.json
new file mode 100644
index 0000000..af24efd
--- /dev/null
+++ b/test-fixtures/workspace/broken.diagram.json
@@ -0,0 +1 @@
+{ "version": 1, "nodes": [
\ No newline at end of file
diff --git a/test-fixtures/workspace/sample.diagram.json b/test-fixtures/workspace/sample.diagram.json
new file mode 100644
index 0000000..5310327
--- /dev/null
+++ b/test-fixtures/workspace/sample.diagram.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "nodes": [
+ { "id": "node-1", "type": "rectangle", "x": 40, "y": 40, "width": 140, "height": 70, "label": "Client" },
+ { "id": "node-2", "type": "ellipse", "x": 300, "y": 40, "width": 140, "height": 80, "label": "API" },
+ { "id": "node-3", "type": "sticky", "x": 300, "y": 220, "width": 150, "height": 120, "label": "Remember\nto cache" }
+ ],
+ "edges": [
+ { "id": "edge-1", "from": "node-1", "to": "node-2", "label": "HTTP" },
+ { "id": "edge-2", "from": "node-2", "to": "node-3" }
+ ]
+}
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..1e76ce5
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "target": "ES2022",
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
+ "outDir": "out",
+ "rootDir": "src",
+ "sourceMap": true,
+ "strict": true,
+ "noUnusedLocals": true,
+ "noImplicitReturns": true,
+ "noFallthroughCasesInSwitch": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "types": ["node", "mocha", "vscode"]
+ },
+ "include": ["src"]
+}
No comments yet.