@geohar/pi-svg-mcp 0.10.7 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,56 @@ released together under one version. The format follows
5
5
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
6
6
  [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [0.11.0] - 2026-11-23
9
+
10
+ ### Changed
11
+ - **Breaking:** every tool that touches session state needs a `session_id` from
12
+ `create_session`, on every client and transport. Stdio and handshake-era HTTP clients no
13
+ longer get documents tied to their connection implicitly; a call without a `session_id` is
14
+ rejected with guidance. A session created over a handshake-era HTTP connection still
15
+ belongs to that connection: only it can use the id, and the session ends when it
16
+ disconnects. Over stdio the process is the isolation (one client per server).
17
+ - **Breaking:** there is no active document. Every tool that acts on a document takes a
18
+ required `document_id`. `set_active_document` is removed, and `import_svg`'s `into_active`
19
+ is replaced by `document_id` (replace that document's content).
20
+ - **Breaking:** resources are scoped to the session by a token (a hash of the session id):
21
+ `svg://<token>/documents`, `svg://<token>/<document_id>/svg` and `/render`. Tools return
22
+ them (`create_document` and `import_svg` give `resources`; `list_documents` and
23
+ `current_context` give `index`). A session owned by its connection only reads from it.
24
+ - **Breaking:** the live preview has one page per document, `/<token>/<document_id>/`, and an
25
+ index at `/<token>/`. `start_preview` takes a `document_id` and returns that page's `url` plus
26
+ the `index`. A page stays on its document.
27
+ - Ending a session (`end_session`, disconnect, idle reaping) also drops its live-preview
28
+ snapshot, so its pages stop serving the drawing. `set_preview_backdrop` needs a session.
29
+ The preview `index` URL carries a login ticket like the document URL, and the index page
30
+ hides the drawing controls. Preview watchers of unknown tokens leave no state behind.
31
+ - The widget's resource URI is shared by every session, so it is now sent only on the
32
+ caller's own stream, not the listen bus.
33
+ - `session_id` is a required, non-null argument in every session-state tool's schema, so
34
+ clients see it as mandatory. The `X-Svg-Mcp-Session` header is removed (nothing used it).
35
+ Tools that touch no session state (`list_fonts`, `render_svg`, `render_backends`,
36
+ `export_formats`, `measure_text`) no longer take a `session_id`.
37
+ - The live preview answers an unknown or ended token, an unknown document's data and an
38
+ unsupported export format with one identical 404, so existing tokens and documents can't
39
+ be told apart from made-up ones. A page whose session ended shows "session ended".
40
+ - A call still running when its session ends can no longer bring the session back: it is
41
+ refused instead of recreating the documents, and it can't republish the preview.
42
+ - Refused resource reads (unknown token, ended session, a session owned by another
43
+ connection, a document that isn't open) all give the same error and never list
44
+ documents.
45
+ - `start_preview` no longer takes a `host`: the preview binds to the configured
46
+ `preview_host` (loopback by default), so the model can't choose the exposure.
47
+ - Style keys are documented as the CSS property names (`stroke-width`, `font-size`), the
48
+ only spelling the published schema accepts. The instructions used to list the snake_case
49
+ field names, which schema-validating clients such as mcp-combiner reject.
50
+ - `list_documents` returns `{document_ids, index}`; `current_context` returns the session and
51
+ its open documents, without an outline.
52
+
53
+ ### Fixed
54
+ - `set_document_metadata` never worked: inkex 1.4.1 exposes the metadata fields as
55
+ read-only properties, so every field failed. svg-mcp now writes Inkscape's RDF block itself,
56
+ and `title` also sets the root `<title>` that browsers and screen readers use.
57
+
8
58
  ## [0.10.7] - 2026-11-09
9
59
 
10
60
  ### Added
@@ -118,6 +168,7 @@ released together under one version. The format follows
118
168
  ### Fixed
119
169
  - Exports no longer try to fsync a directory on Windows.
120
170
 
171
+ [0.11.0]: https://github.com/georgeharker/svg-mcp/compare/v0.10.7...v0.11.0
121
172
  [0.10.7]: https://github.com/georgeharker/svg-mcp/compare/v0.10.6...v0.10.7
122
173
  [0.10.6]: https://github.com/georgeharker/svg-mcp/compare/v0.10.5...v0.10.6
123
174
  [0.10.5]: https://github.com/georgeharker/svg-mcp/compare/v0.10.4...v0.10.5
package/README.md CHANGED
@@ -58,7 +58,7 @@ so they apply across every client. Pi-extension toggles use `PI_SVG_MCP_*`.
58
58
  | Variable | Default | Effect |
59
59
  |----------|---------|--------|
60
60
  | `SVG_MCP_PORT` | `7731` | HTTP port svg-mcp serves on. |
61
- | `SVG_MCP_VERSION` | `0.10.7` | Pin the PyPI release (`uvx svg-mcp@<v>`). Kept in lockstep with this package's release by `scripts/bump-version.sh`. |
61
+ | `SVG_MCP_VERSION` | `0.11.0` | Pin the PyPI release (`uvx svg-mcp@<v>`). Kept in lockstep with this package's release by `scripts/bump-version.sh`. |
62
62
  | `SVG_MCP_DEV` | — | Dev checkout for `uv run --project <dir>` (a path, or `1` for in-repo source). |
63
63
  | `PI_SVG_MCP_NAME` | `svg-mcp` | `sharedserver` instance name. |
64
64
  | `PI_SVG_MCP_GRACE` | `1h` | `sharedserver` grace period. |
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ const SHAREDSERVER_MIN_VERSION = "0.6.7";
42
42
  // scripts/bump-version.sh — a plugin shipped un-updated here served svg-mcp@0.2.6 for
43
43
  // several releases. (Track the release this tag publishes; `latest` is not published
44
44
  // to the pi extension store, so users on `@latest` can still miss releases.)
45
- const SVG_MCP_TOOL_VERSION = "0.10.7";
45
+ const SVG_MCP_TOOL_VERSION = "0.11.0";
46
46
  // ── the diagram-authoring directive ────────────────────────────────
47
47
  // Appended to the system prompt so the agent reaches for svg-mcp's tools instead of
48
48
  // hand-writing SVG XML. Canonical source: CLAUDE.md.example at the repo root; a
package/instructions.txt CHANGED
@@ -13,9 +13,13 @@ topic you have to remember to think about. That's deliberate: you will not remem
13
13
 
14
14
  `create_session` is on the tools: call it ONCE per drawing task, then pass its
15
15
  `session_id` on EVERY svg-mcp call that follows (each tool's schema marks the argument).
16
- Keep the id in the conversation — drawings persist under it, and another chat can pick the
17
- drawing up with it. A session_id-less call fails with this same guidance: that's the cue
18
- you skipped the mint, not a bug to route around — run create_session, retry with the id.
16
+ Keep the id in the conversation — drawings persist under it for the rest of the task.
17
+ A session_id-less call fails with this same guidance: that's the cue you skipped the
18
+ mint, not a bug to route around — run create_session, retry with the id.
19
+ The same goes for documents: there is no "current" one, so pass the `document_id` you got
20
+ from `create_document` on every call that acts on it, even when only one is open.
21
+ The calls shown below omit `session_id` and `document_id` for brevity; every real call
22
+ passes both.
19
23
 
20
24
  ### 1. About to write `<svg`, or hand-edit XML inside one? That's the cue.
21
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geohar/pi-svg-mcp",
3
- "version": "0.10.7",
3
+ "version": "0.11.0",
4
4
  "description": "Pi extension: run the svg-mcp MCP server via sharedserver and inject the diagram-authoring directive. Pairs with pi-mcp-adapter, which makes svg-mcp's tools reachable from Pi.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,9 +23,9 @@
23
23
  "assets"
24
24
  ],
25
25
  "scripts": {
26
- "build": "tsc",
26
+ "build": "node ./node_modules/typescript/bin/tsc",
27
27
  "clean": "rm -rf dist",
28
- "typecheck": "tsc --noEmit",
28
+ "typecheck": "node ./node_modules/typescript/bin/tsc --noEmit",
29
29
  "prepack": "node -e \"const fs = require('fs'); fs.copyFileSync('../../CLAUDE.md.example', './instructions.txt'); fs.copyFileSync('../../CHANGELOG.md', './CHANGELOG.md')\"",
30
30
  "prepublishOnly": "npm run clean && npm run build"
31
31
  },
@@ -53,6 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "^22.0.0",
56
+ "@typescript/native": "npm:typescript@^7.0.2",
56
57
  "typescript": "^5.6.0"
57
58
  },
58
59
  "engines": {
package/src/index.ts CHANGED
@@ -51,7 +51,7 @@ const SHAREDSERVER_MIN_VERSION = "0.6.7"
51
51
  // scripts/bump-version.sh — a plugin shipped un-updated here served svg-mcp@0.2.6 for
52
52
  // several releases. (Track the release this tag publishes; `latest` is not published
53
53
  // to the pi extension store, so users on `@latest` can still miss releases.)
54
- const SVG_MCP_TOOL_VERSION = "0.10.7"
54
+ const SVG_MCP_TOOL_VERSION = "0.11.0"
55
55
 
56
56
  type LogFn = (level: "info" | "warn" | "error", message: string) => void
57
57