{"_id":"dsh-excalidraw","_rev":"3-cf8242d21288d6851b72add04bb01a29","name":"dsh-excalidraw","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.0-stage":{"name":"dsh-excalidraw","version":"0.0.0-stage","_id":"dsh-excalidraw@0.0.0-stage","stub":true,"maintainers":[{"name":"sakurain","email":"tokenaissance@gmail.com"}],"dist":{"shasum":"5bd9b06ab921ceb02c0ed20e88ccf817786d0054","tarball":"https://registry.npmjs.org/dsh-excalidraw/-/dsh-excalidraw-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-5NvtjQeTThLJWk4yz+hHvM0wHoVMvPO1wnVOm7hw8YolUqHPs+7hP7gMthrjN9ovBUPnEUFhiaswzdlUerOnWQ==","signatures":[{"sig":"MEUCIDcbfCrJZjjWCO9eMBTjxeUhzoDW9g2JOzvGdJZj14RUAiEAtXxd82sUCeMXU8lm8qPTrMsvk23pTg+UJxcHIXxarWo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":336},"_npmUser":{"name":"sakurain","email":"tokenaissance@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{}},"0.1.0":{"name":"dsh-excalidraw","version":"0.1.0","keywords":["dsh","dsh-plugin","deepseek","deepseek-harness","excalidraw","diagram","architecture","mcp"],"license":"MIT","_id":"dsh-excalidraw@0.1.0","maintainers":[{"name":"sakurain","email":"tokenaissance@gmail.com"}],"homepage":"https://github.com/tokenaissance/dsh-excalidraw#readme","bugs":{"url":"https://github.com/tokenaissance/dsh-excalidraw/issues"},"dsh":{"bundle":{"patch":["./cordis.patch.yml"]},"client":{"inject":["@deepseek-ai/dsh-client-locale"],"platform":"web","immediately":true}},"dist":{"shasum":"59dcd7382c90379555924cc1fafa19b402f00932","tarball":"https://registry.npmjs.org/dsh-excalidraw/-/dsh-excalidraw-0.1.0.tgz","fileCount":63,"integrity":"sha512-yR8lQtipgIfSjvTbYP5yjlSvfd2e5bX9qOYjA+qRFe9eNR8uTaajTYsVaoLdkTVi75yaJIOoRXYq/LmbBSnx3w==","signatures":[{"sig":"MEYCIQDx7+odIIUtKGYHNESkTTnlvVXQ22T74nC52y34pvanXQIhAI+fapICoYdkicSjuOfG6aDUWqdOjFrhQ/1Qgb1lG2BK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDJX1Hk3Uba3TBT+KGSI2g4+/BRbbN71CgF32rR1Y/F+AIhAPnDEWxoDptdtiSkL8kIvZnXkvnO3Co3iyEWb41or0rI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":984526},"icon":"./icon.svg","type":"module","engines":{"dsh":">=0.2.1-rc.1 <0.3.0","node":">=22.19"},"exports":{".":"./index.js","./icon":"./icon.svg","./client":"./client.js","./package.json":"./package.json","./locale/*.json":"./locale/*.json","./cordis.patch.yml":"./cordis.patch.yml"},"gitHead":"5b081699ea923633600c33b02471b69acc9dcd99","scripts":{"test":"node scripts/gen-fonts-data.mjs --check && node --test test/","build":"node scripts/gen-fonts-data.mjs && node scripts/build-client.mjs","render":"node scripts/render-scene.mjs","verify":"node scripts/gen-fonts-data.mjs --check && node --test test/ && node scripts/build-client.mjs && node --test test/client.test.mjs","prepack":"node scripts/gen-fonts-data.mjs && node scripts/build-client.mjs"},"_npmUser":{"name":"sakurain","email":"tokenaissance@gmail.com"},"repository":{"url":"git+https://github.com/tokenaissance/dsh-excalidraw.git","type":"git"},"_npmVersion":"10.9.8","description":"Live Excalidraw architecture scenes rendered in DSH (sidebar tab or native conversation view), refreshed from Excalidraw+ over MCP.","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@deepseek-ai/cordis":"*","@deepseek-ai/dsh-tools":"*","@deepseek-ai/dsh-session":"*","@deepseek-ai/schemastery":"*"},"_npmOperationalInternal":{"tmp":"tmp/dsh-excalidraw_0.1.0_1793446353742_0.10496124295031706","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"dsh-excalidraw@0.1.1","dsh":{"bundle":{"patch":["./cordis.patch.yml"]},"client":{"inject":["@deepseek-ai/dsh-client-locale"],"platform":"web","immediately":true}},"bugs":{"url":"https://github.com/tokenaissance/dsh-excalidraw/issues"},"dist":{"shasum":"b6c7b6a2b607c4263a9fbad8932940c24d6a8728","tarball":"https://registry.npmjs.org/dsh-excalidraw/-/dsh-excalidraw-0.1.1.tgz","fileCount":63,"integrity":"sha512-zU8FVObgay3wiH0GB/Q/lE+caXQMYlsvgnZsid37ptgu1RlW8EAEwSLfsvWSbBR/6PXBzPKDM1Bg2OhKOjMJhg==","signatures":[{"sig":"MEUCIFmfwjpyWAjgwOKeGJWkdusDhKguix6JwuUndysvCkBgAiEAzCse/A5WomCFxnLV9f52v4zOvVHBBIylpZHn4wIje1E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHqvzAIOvKKehIdkmH6dZsBs8/XWLNitlp589sJx2FonAiEAmxabOTR1J3OdWA0d6MEpKE5zwABuVXOvt9ncTq+/jGA="}],"unpackedSize":999721},"icon":"./icon.svg","name":"dsh-excalidraw","type":"module","engines":{"dsh":">=0.2.1-rc.1 <0.3.0","node":">=22.19"},"exports":{".":"./index.js","./icon":"./icon.svg","./client":"./client.js","./package.json":"./package.json","./locale/*.json":"./locale/*.json","./cordis.patch.yml":"./cordis.patch.yml"},"gitHead":"fb5223bfd0aa234c4e63ab77091e942cdfda226a","license":"MIT","scripts":{"test":"node scripts/gen-fonts-data.mjs --check && node --test test/","build":"node scripts/gen-fonts-data.mjs && node scripts/build-client.mjs","render":"node scripts/render-scene.mjs","verify":"node scripts/gen-fonts-data.mjs --check && node --test test/ && node scripts/build-client.mjs && node --test test/client.test.mjs","prepack":"node scripts/gen-fonts-data.mjs && node scripts/build-client.mjs"},"version":"0.1.1","_npmUser":{"name":"sakurain","email":"tokenaissance@gmail.com"},"homepage":"https://github.com/tokenaissance/dsh-excalidraw#readme","keywords":["dsh","dsh-plugin","deepseek","deepseek-harness","excalidraw","diagram","architecture","mcp"],"repository":{"url":"git+https://github.com/tokenaissance/dsh-excalidraw.git","type":"git"},"_npmVersion":"10.9.8","description":"Live Excalidraw architecture scenes rendered in DSH (sidebar tab or native conversation view), refreshed from Excalidraw+ over MCP.","directories":{},"maintainers":[{"name":"sakurain","email":"tokenaissance@gmail.com"}],"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@deepseek-ai/cordis":"*","@deepseek-ai/dsh-tools":"*","@deepseek-ai/dsh-session":"*","@deepseek-ai/schemastery":"*"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-excalidraw_0.1.1_1793636622365_0.7388285089373096"}}},"time":{"created":"2026-10-31T11:31:16.911Z","modified":"2026-11-02T16:23:42.734Z","0.0.0-stage":"2026-10-31T11:31:16.911Z","0.1.0":"2026-10-31T11:32:33.865Z","0.1.1":"2026-11-02T16:23:42.599Z"},"bugs":{"url":"https://github.com/tokenaissance/dsh-excalidraw/issues"},"license":"MIT","homepage":"https://github.com/tokenaissance/dsh-excalidraw#readme","keywords":["dsh","dsh-plugin","deepseek","deepseek-harness","excalidraw","diagram","architecture","mcp"],"repository":{"url":"git+https://github.com/tokenaissance/dsh-excalidraw.git","type":"git"},"description":"Live Excalidraw architecture scenes rendered in DSH (sidebar tab or native conversation view), refreshed from Excalidraw+ over MCP.","maintainers":[{"name":"sakurain","email":"tokenaissance@gmail.com"}],"readme":"# dsh-excalidraw\n\nShow **live Excalidraw architecture scenes in the DSH sidebar.**\n\nAsk the agent to draw or refresh the code architecture in Excalidraw;\ndsh-excalidraw pulls the scene through the Excalidraw+ MCP server, stores it in the\nworkspace, and the **Excalidraw** sidebar tab re-renders it — no page refresh, no\nscreenshots.\n\n```\nagent ──▶ tool: excalidraw_refresh ──▶ Excalidraw+ MCP (get_scene_content)\n                                         │\n                                         ▼\n                       <cwd>/.dsh/excalidraw/<slug>.excalidraw\n                                         │  (revision bump + focus pointer)\n                                         ▼\n  sidebar tab «Excalidraw» ◀── /excalidraw/api/* ◀── host HTTP routes\n```\n\nDesign drawn in Excalidraw before a line of code:\n[architecture](https://app.excalidraw.com/s/9Zq6XgRe98z/6gbUPPB8Q7X) ·\n[sidebar wireframe](https://app.excalidraw.com/s/9Zq6XgRe98z/Aw55m5vJxYJ)\n\n## Preview\n\nThe **Excalidraw** view on a stock DSH, beside Chat and Trajectory:\n\n![Excalidraw view on a stock DSH](https://raw.githubusercontent.com/tokenaissance/dsh-excalidraw/main/assets/preview-stock.png)\n\nThe same scene as the **Excalidraw** tab in dsh-better-sidebar:\n\n![Excalidraw sidebar tab](https://raw.githubusercontent.com/tokenaissance/dsh-excalidraw/main/assets/preview-sidebar.png)\n\n## Install\n\n```sh\n# from a directory that holds this package\ndsh plugin --profile desktop add \"$PWD\"\n# then restart DSH so the Host row and the client bundle load\n```\n\nThe version here is a plain ESM bundle: no build step is needed at install time\n(`client.js` is committed). `npm run build` rebuilds it, however, so a checkout edited\nin `src/` must be rebuilt before installing.\n\nWhen this repository lives inside LayerFS (as it does in `tokenaissance`), export it\nto a real host directory first — `dsh plugin add` needs a filesystem path:\n\n```sh\n# from a session bound to the LayerFS project\nlayerfs fs read main /dsh-excalidraw/...  # or mount a Workspace and copy the tree out\ndsh plugin --profile desktop add /path/to/exported/dsh-excalidraw\n```\n\n**Two ways in.** *Local import* works with no account at all: point\n`excalidraw_import` at a `.excalidraw`/`.json` file in the workspace, or hand it\nan inline Excalidraw JSON document, and the view renders it. *Excalidraw+ refresh*\nneeds an account and a token (below).\n\n**Refresh prerequisite: an Excalidraw+ MCP token.** Pulling a scene from Excalidraw+\n(`excalidraw_refresh`, the tab's Refresh button) needs an Excalidraw+ account and\nits MCP bearer token — set `mcpToken` on the plugin row, or `EXCALIDRAW_MCP_TOKEN`,\nor keep the `Authorization: Bearer …` header your profile already has for the\n`excalidraw` MCP server; when empty, the tool fails at the MCP endpoint. Without a\ntoken the viewer still works read-only for what is already local: the\n`.excalidraw` file viewer opens any scene file, and the Excalidraw view renders\nscenes already present in `<workspace>/.dsh/excalidraw/`.\n\nRequirements: DSH 0.2.1-rc.1+ (the Excalidraw view renders on DSH's own\n`conversation.view` slot, so **no third-party sidebar is required**). With\n[dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) 0.28+ you\nadditionally get the right-sidebar tab, the `.excalidraw` file viewer, the file\nicon and the auto-open focus watcher.\n\n## Interactions (preview only)\n\nThe scene view is a **read-only viewer**, but its navigation follows Excalidraw's:\n\n| Gesture | Effect |\n| --- | --- |\n| drag (or middle-drag) | pan |\n| wheel / two-finger scroll | pan (shift: horizontal) |\n| ⌘/Ctrl + wheel, or pinch | zoom at the cursor |\n| click | select the topmost element under the cursor |\n| Shift + click | add/remove that element from the selection |\n| Shift + drag | marquee-select everything the rectangle touches |\n| ⌘/Ctrl + A | select every element · `Esc` clears |\n| double-click | fit the scene (on an element: zoom to that element) |\n| `+` / `-` / `0` | zoom in / out / back to 100% |\n| `Shift+1` or `Home` | fit to the window |\n| `Shift+2` | zoom to the selection |\n| arrow keys | pan by 40 px |\n\nThe zoom control in the bottom-right shows the current percentage and offers\nfit / 100%. Selection is drawn as an outline and never changes the scene: there is\nno editing, moving or resizing.\n\n## Use\n\n1. Ask the agent to refresh the architecture, e.g.\n   *“把代码架构刷新到 Excalidraw，然后侧边栏给我看”*.\n   The agent calls `excalidraw_refresh` with the Excalidraw+ scene id.\n2. The host pulls `get_scene_content`, writes\n   `<cwd>/.dsh/excalidraw/architecture.excalidraw`, bumps the revision and\n   leaves a `focus` pointer for the calling session.\n3. The **Excalidraw** tab opens (or refocuses) and renders the scene as SVG. Later\n   refreshes re-render in place; the tab polls `/excalidraw/api/rev` while it is\n   visible, so nothing else is needed.\n\nExtras that come with the same sidebar service:\n\n- any `.excalidraw` file opens in the sidebar as a diagram (read-only) instead\n  of raw JSON; legacy `.excalidraw.json` scenes stay readable through the Excalidraw\n  tab (better-sidebar only sniffs content for files with a head, so those keep\n  opening in the JSON preview);\n- the file tree shows the diagram glyph for those files;\n- the tab's own **Refresh** button re-pulls the last stored scene.\n\n## Tools\n\n| Tool | Arguments | Effect |\n| --- | --- | --- |\n| `excalidraw_refresh` | `{ sceneId?, name?, slug? }` | pull a scene from Excalidraw+ into the workspace store; returns `{ ok, slug, file, sceneId, elements, revision, opened }` |\n| `excalidraw_import` | `{ path?, scene?, name?, slug? }` | store a scene that already exists locally — a `.excalidraw`/`.json` file **inside the workspace**, or an inline Excalidraw JSON document — **no Excalidraw+ account or token** |\n| `excalidraw_open` | `{ slug? }` | focus the Excalidraw tab for an already-stored scene |\n| `excalidraw_export` | `{ slug?, format? }` | write the scene as `<scenesDir>/<slug>.svg` (PNG comes from the tab's button, which rasterises in the browser) |\n\nThe tab has no plugin-local settings: auto-open follows the host's `autoOpen`, and\nthe poll interval is the host's `pollIntervalMs` (delivered to the client in\n`/rev`).\n\n## Fonts\n\nThe plugin ships the Excalidraw web fonts it can redistribute — Comic Shanns\n(MIT), Virgil (SIL OFL) and Lilita One (SIL OFL) — and serves them from the\npackage, so a scene's hand-drawn text renders the way Excalidraw draws it without\nany third-party request. `Excalifont` (Excalidraw's own default) is **not**\nincluded because it carries no licence grant; scenes that use it fall back to the\nbrowser's font stack. See `fonts/README.md` and `docs/FIDELITY.md`.\n\n## Configuration (cordis row `config`)\n\n| key | default | meaning |\n| --- | --- | --- |\n| `mcpUrl` | `https://api.excalidraw.com/api/v1/mcp` | Excalidraw+ MCP endpoint |\n| `mcpToken` | `''` | bearer token; when empty it falls back to `EXCALIDRAW_MCP_TOKEN`, then to the profile's own `mcp-excalidraw` row |\n| `scenesDir` | `.dsh/excalidraw` | scene directory, relative to the session workspace |\n| `extraFontsDir` | `''` | optional directory of user-supplied fonts (`fonts.json` + files); served to the tab and used by exports — the legal way to add Excalifont |\n| `pollIntervalMs` | `1500` | client revision-poll interval (500–10000) |\n| `autoOpen` | `true` | open/focus the tab after a refresh |\n| `maxSceneBytes` | `4194304` | refuse larger scene files |\n\n## How it is built\n\n- **Host half** (`index.js` + `lib/`): a cordis plugin that registers seven HTTP\n  routes plus the `/excalidraw/fonts/` prefix, three model tools, and a per-workspace scene store with atomic writes and\n  a monotonic revision. Zero runtime dependencies; the Excalidraw MCP client is\n  plain `fetch` + JSON-RPC over streamable HTTP.\n- **Client half** (`client.js`, generated from `src/client.mjs` +\n  `src/renderer.mjs` + `src/fonts-data.mjs` by `scripts/build-client.mjs`): one\n  `window.__ModuleLoader__.load` module that mounts the scene view on **two\n  surfaces** — DSH's native `conversation.view` slot (an **Excalidraw** view beside\n  Chat/Trajectory, so a stock DSH works) and, when present, the\n  dsh-better-sidebar tab with its file viewer and file icon.\n- **Renderer** (`src/renderer.mjs`): pure, deterministic Excalidraw→SVG for the\n  element subset the diagram tools emit; no `@excalidraw/*` dependency.\n\nRead [docs/DESIGN.md](docs/DESIGN.md) for the design, [docs/CONTRACT.md](docs/CONTRACT.md)\nfor the normative wire contract, and [docs/HOST-NOTES.md](docs/HOST-NOTES.md) /\n[docs/CLIENT-NOTES.md](docs/CLIENT-NOTES.md) / [docs/RENDERER-NOTES.md](docs/RENDERER-NOTES.md)\nfor per-half implementation notes.\n\n## No Excalidraw+ account?\n\n```text\nagent ── excalidraw_import { path: \"docs/flow.excalidraw\" } ──▶ <cwd>/.dsh/excalidraw/flow.excalidraw\nagent ── excalidraw_import { scene: { type: \"excalidraw\", elements: [...] } } ──▶ same store\n```\n\nEither form stores the scene locally and shows it in the **Excalidraw** view; the\nfile viewer opens `.excalidraw` files directly as well. Only `excalidraw_refresh`\n(the pull from Excalidraw+) requires the token.\n\n## Publish / install from elsewhere\n\n- **Any DSH:** Settings → Plugins → *Add plugin* accepts a local directory, a\n  `.tgz`, or a Git URL; the CLI equivalent is\n  `dsh plugin --profile desktop add <source>`.\n- **npm:** `npm publish --access public`, then install by name\n  (`dsh plugin --profile desktop add dsh-excalidraw`).\n- **Community catalog:** one YAML entry in\n  [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)\n  (`data/plugins/<owner>__<repo>.yml`); the market and Plugins → Discover pick\n  it up after merge.\n\nSee [docs/PUBLISHING.md](docs/PUBLISHING.md) for the exact commands, the\ncatalog entry, and the pre-announcement checks.\n\n## Tests\n\n```sh\nnpm test        # node --test test/ (212 tests, zero deps) — it does NOT rebuild:\n                # a stale client.js fails the build-signature test on purpose\nnpm run build   # regenerate src/fonts-data.mjs and client.js\nnode scripts/render-scene.mjs test/fixtures/design-scene.json /tmp/design.svg\n```\n\nThe renderer is checked against the Excalidraw-rendered reference of the same\nscene (ink coverage and aspect ratio), the store and MCP client have unit tests,\nthe host routes are exercised handler-by-handler, and the client module is loaded\nthrough a stubbed module loader.\n\n## Limits (v1)\n\nRead-only: editing stays in Excalidraw (the viewer pans, zooms, selects and\nmarquees, but never writes the scene back). `roughness`/hachure are rendered clean;\n`image` elements render only from a `data:image/…;base64,` URL already in the\nscene's `files`; nothing is fetched from the network. Excalidraw's fonts are not\nshipped, so family 5 (`Excalifont`) renders with the shipped **Virgil** fallback,\nwhich is what Excalidraw's own stack does; families 2/3/4/6 fall back to the\nbrowser stack. `Comic Shanns` (8), `Virgil` (1) and `Lilita One` (7) ship.\n","readmeFilename":"README.md"}