@geohar/pi-svg-mcp 0.10.7 → 0.11.1

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,64 @@ 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.1] - 2026-11-24
9
+
10
+ ### Added
11
+ - `preview_public_url`: where browsers reach the live preview behind a reverse proxy
12
+ (e.g. `https://host.example/svg/`). `start_preview` hands out links under it; a path
13
+ prefix is honoured on every route, page request, login redirect, login form and cookie
14
+ path, whether or not the proxy strips it; and its host counts as this machine's name.
15
+
16
+ ## [0.11.0] - 2026-11-23
17
+
18
+ ### Changed
19
+ - **Breaking:** every tool that touches session state needs a `session_id` from
20
+ `create_session`, on every client and transport. Stdio and handshake-era HTTP clients no
21
+ longer get documents tied to their connection implicitly; a call without a `session_id` is
22
+ rejected with guidance. A session created over a handshake-era HTTP connection still
23
+ belongs to that connection: only it can use the id, and the session ends when it
24
+ disconnects. Over stdio the process is the isolation (one client per server).
25
+ - **Breaking:** there is no active document. Every tool that acts on a document takes a
26
+ required `document_id`. `set_active_document` is removed, and `import_svg`'s `into_active`
27
+ is replaced by `document_id` (replace that document's content).
28
+ - **Breaking:** resources are scoped to the session by a token (a hash of the session id):
29
+ `svg://<token>/documents`, `svg://<token>/<document_id>/svg` and `/render`. Tools return
30
+ them (`create_document` and `import_svg` give `resources`; `list_documents` and
31
+ `current_context` give `index`). A session owned by its connection only reads from it.
32
+ - **Breaking:** the live preview has one page per document, `/<token>/<document_id>/`, and an
33
+ index at `/<token>/`. `start_preview` takes a `document_id` and returns that page's `url` plus
34
+ the `index`. A page stays on its document.
35
+ - Ending a session (`end_session`, disconnect, idle reaping) also drops its live-preview
36
+ snapshot, so its pages stop serving the drawing. `set_preview_backdrop` needs a session.
37
+ The preview `index` URL carries a login ticket like the document URL, and the index page
38
+ hides the drawing controls. Preview watchers of unknown tokens leave no state behind.
39
+ - The widget's resource URI is shared by every session, so it is now sent only on the
40
+ caller's own stream, not the listen bus.
41
+ - `session_id` is a required, non-null argument in every session-state tool's schema, so
42
+ clients see it as mandatory. The `X-Svg-Mcp-Session` header is removed (nothing used it).
43
+ Tools that touch no session state (`list_fonts`, `render_svg`, `render_backends`,
44
+ `export_formats`, `measure_text`) no longer take a `session_id`.
45
+ - The live preview answers an unknown or ended token, an unknown document's data and an
46
+ unsupported export format with one identical 404, so existing tokens and documents can't
47
+ be told apart from made-up ones. A page whose session ended shows "session ended".
48
+ - A call still running when its session ends can no longer bring the session back: it is
49
+ refused instead of recreating the documents, and it can't republish the preview.
50
+ - Refused resource reads (unknown token, ended session, a session owned by another
51
+ connection, a document that isn't open) all give the same error and never list
52
+ documents.
53
+ - `start_preview` no longer takes a `host`: the preview binds to the configured
54
+ `preview_host` (loopback by default), so the model can't choose the exposure.
55
+ - Style keys are documented as the CSS property names (`stroke-width`, `font-size`), the
56
+ only spelling the published schema accepts. The instructions used to list the snake_case
57
+ field names, which schema-validating clients such as mcp-combiner reject.
58
+ - `list_documents` returns `{document_ids, index}`; `current_context` returns the session and
59
+ its open documents, without an outline.
60
+
61
+ ### Fixed
62
+ - `set_document_metadata` never worked: inkex 1.4.1 exposes the metadata fields as
63
+ read-only properties, so every field failed. svg-mcp now writes Inkscape's RDF block itself,
64
+ and `title` also sets the root `<title>` that browsers and screen readers use.
65
+
8
66
  ## [0.10.7] - 2026-11-09
9
67
 
10
68
  ### Added
@@ -118,6 +176,8 @@ released together under one version. The format follows
118
176
  ### Fixed
119
177
  - Exports no longer try to fsync a directory on Windows.
120
178
 
179
+ [0.11.1]: https://github.com/georgeharker/svg-mcp/compare/v0.11.0...v0.11.1
180
+ [0.11.0]: https://github.com/georgeharker/svg-mcp/compare/v0.10.7...v0.11.0
121
181
  [0.10.7]: https://github.com/georgeharker/svg-mcp/compare/v0.10.6...v0.10.7
122
182
  [0.10.6]: https://github.com/georgeharker/svg-mcp/compare/v0.10.5...v0.10.6
123
183
  [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.1` | 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.1";
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.1",
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.1"
55
55
 
56
56
  type LogFn = (level: "info" | "warn" | "error", message: string) => void
57
57