Local Testing
September 1, 2026 · View on GitHub
English | 中文
Prerequisites
-
Node.js >= 20
-
Chrome or Edge (for WebGPU support and SharedArrayBuffer)
Install
npm install
npm run build
Link-based testing (recommended)
This plugin has both a Host entry (lib/index.js) and a Client bundle
(lib/client.js, declared via dsh.client in package.json). The overlay
approach only loads the Host — the Client is discovered through node_modules,
so the package must be linked first.
One-time setup: link the local package
Windows (Git Bash / MINGW):
PROJECT="$(cygpath -m ~/Downloads/dsh-math-input)" # ← your path
npx @deepseek-ai/dsh plugin --profile web add "file:$PROJECT"
macOS / Linux:
PROJECT="$(pwd)" # ← run from the repo root
npx @deepseek-ai/dsh plugin --profile web add "file:$PROJECT"
This installs the package into the profile's node_modules via a persistent
link. After npm run build, the rebuilt lib/ is immediately available —
no reinstall needed.
Iterate: rebuild + restart
npm run build
npx @deepseek-ai/dsh web --no-open
Open http://127.0.0.1:3080.
Cleanup: unlink when done
npx @deepseek-ai/dsh plugin --profile web remove dsh-math-input
Overlay alternative (Host-only)
If you only need to test Host-side code (settings service, typert manifest, etc.) and don't need the Client UI, use an overlay patch instead of linking:
Create overlay.yml in the project root:
- insert:
- id: dsh-math-input
name: '/your/absolute/path/dsh-math-input/lib/index.js'
Or generate it with a command (from the project root):
Windows (Git Bash / MINGW):
cat > overlay.yml <<EOF
- insert:
- id: dsh-math-input
name: '/$(pwd -W)/lib/index.js'
EOF
pwd -Woutputs a Windows-style path (e.g.C:/Users/xxx/dsh-math-input). You must prefix it with/, resulting in/C:/Users/xxx/dsh-math-input/lib/index.js. Node.js ESM loader doesn't accept bareC:/...paths on Windows (treatsC:as a protocol) — it must be/C:/...orfile:///C:/.... Do not usepwd(outputs/c/Users/...which the loader resolves asC:\c\Users\...).
macOS / Linux:
cat > overlay.yml <<EOF
- insert:
- id: dsh-math-input
name: '$(pwd)/lib/index.js'
EOF
pwdoutputs a Unix-style path (e.g./Users/xxx/dsh-math-input), which already starts with/— no extra prefix needed.
Launch the DSH web client with the overlay patch:
npx @deepseek-ai/dsh web --patch overlay.yml
Note: the overlay only loads the Host entry. The Client UI (handwriting pad, screenshot OCR, LaTeX editor, settings page) will not appear because
dsh.clientis discovered throughnode_modules, which the overlay bypasses. For full UI testing, use the link-based approach above.
Verification Checklist
Applies to the link-based approach (overlay only covers Host loading):
- "+" button appears to the left of the input row
- Menu opens on click with three items: Handwriting, Screenshot, LaTeX Editor
- Handwriting pad modal renders, canvas accepts pointer drawing
- Settings section appears in Settings with five controls (mode, beam, provider, debounce, language)
- Changing a setting persists across page reload
- Preview strip renders
\[x^2\]typed in the composer as a KaTeX chip - LaTeX editor dock toggles from the menu, palette inserts snippets, Insert writes
\[...\]
Troubleshooting
-
Absolute path required: the
namefield inoverlay.ymlmust be an absolute path tolib/index.js -
SharedArrayBuffer fallback: if the server does not send
Cross-Origin-Opener-PolicyandCross-Origin-Embedder-Policyheaders, ONNX Runtime falls back to single-threaded WASM — recognition still works but is slower -
Model download: first recognition triggers a ~7.2 MB download (encoder + decoder + vocab); subsequent loads use IndexedDB cache
-
WebGPU:
provider: 'webgpu'auto-detects and falls back towasmon unsupported browsers