PWA plugin for DSH — adds offline support, service worker caching, and install-as-app capability.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:RaulLazaro/dsh-pwa-plugin
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
PWA plugin for DeepSeek Harness that adds offline support and install-as-app capability.
Features
- Service Worker with smart caching strategy
- PWA Manifest with proper maskable icons
- Automatic updates — new versions activate silently and reload the page exactly once (a first-ever visit never reloads)
- Versioned caches — cache names carry the package version, so upgrading the plugin purges stale caches automatically
- Offline-first for static assets
- Official DSH whale icon — derived from the upstream SVG favicon
Installation
1. Add as a dependency
From npm (once published):
npm install dsh-pwa-plugin
Or, for a local checkout, in your DSH web profile's package.json:
{
"dependencies": {
"dsh-pwa-plugin": "file:~/workspace/dsh-pwa-plugin"
}
}
2. Register the plugin
In your profile's cordis.patch.yml:
- insert:
- id: dsh-pwa
name: 'dsh-pwa-plugin'
3. Restart DSH
dsh web
Generate PNG Icons
The plugin ships pre-built PNG icons. To regenerate (requires sharp):
cd dsh-pwa-plugin
node scripts/generate-icons.js
This reads the official public/favicon.svg and produces:
| File | Size | Purpose |
|---|---|---|
icon-192.png |
192×192 | Regular (any) |
icon-192-maskable.png |
192×192 | Maskable (20% safe zone) |
icon-512.png |
512×512 | Regular (any) |
icon-512-maskable.png |
512×512 | Maskable (20% safe zone) |
How It Works
- The host plugin serves
/sw.js(stamped with the package version),/manifest.webmanifest, and icon files - It injects a service worker registration script into the HTML
- The service worker pre-caches static assets (one failing URL never aborts the install) and caches them for offline use
- The manifest enables installing the app as a PWA
- Updates are detected automatically and silently activated; the page reloads once per update
- DSH's built-in
/favicon.svgis used as-is (not overridden)
Caching Strategy
| Resource Type | Strategy | Description |
|---|---|---|
| HTML | Network-first | Always fetches the latest version; only storable 200 responses become the offline fallback |
| JS/CSS/Fonts/Images | Cache-first | Kept in a cache named after the package version, so an upgrade invalidates it without a manual version bump |
| Dynamic DSH routes | Not intercepted | /api, /auth-api, /oauth, /open-in-app, /plugins, /ws, /hooks and /dsh-pwa always reach the network |
Cache-Control: no-store |
Never cached | The server's directive wins over the service worker |
| API/WebSocket | Not cached | Always goes to the network |
Limitations
- Requires HTTPS to work (except localhost)
- Service worker cannot cache API calls
- Updates require a page reload (automatic after detection)
Project Structure
dsh-pwa-plugin/
├── src/
│ ├── host/
│ │ └── index.js # Host plugin (Node.js)
│ └── sw.js # Service Worker
├── public/
│ ├── manifest.webmanifest # PWA Manifest
│ ├── favicon.svg # DSH whale icon (same as upstream)
│ └── icons/ # PWA icons (maskable + regular)
├── scripts/
│ ├── generate-icons.js # Icon generator (sharp)
│ ├── install.js # Verification script
│ └── verify.js # Verification
├── cordis.patch.yml # Plugin registration
├── LICENSE
└── package.json
Testing
npm test
Zero-dependency suite on Node's built-in runner (node --test):
test/manifest.test.mjs— manifest required fields, icon densities (regular + maskable at 192/512) and that every icon file exists on disk.test/sw.test.mjs— the service worker evaluated against a fakeself: install/activate cache lifecycle (per-URL resilient pre-cache, versioned cache names, orphan cleanup), the bypass rules (non-GET, non-HTTP schemes,/api,/auth-api,/oauth,/open-in-app,/plugins,/ws,/hooks,/dsh-pwa, websocket upgrades), network-first HTML with its offline fallbacks, cache-first statics with the store guard (200/basic/no-store), and theGET_VERSION/SKIP_WAITINGmessages.test/host.test.mjs— route registration (sw, manifest, 4 icons, version), response headers, the package-version stamping of/sw.js, the index-HTML script injection, the registration script's reload guard (executed in a sandboxed VM), and the effect cleanup used on HMR unmounts.
License
MIT
Links
More in this category
yjh051108/dsh-routing-suite★ 6997
One repository, three parts: a runtime injector for DSH plugin packages (inject, hot-reload, unload, promote a dev staging tool to the front, route self-heal, plus a settings-page plugin manager that lists, unloads and drags folders in to internalize), a task-aware reasoning-mode router agent preset (router-standard / router-spec / router-react), and a graded two-level task protocol whose six tools (commit_star, lock_stage, revise_do, edit_plan, mark_task, redteam_verdict) pin task state to disk. The injector implementation ships in-tree, so the install carries its own behaviour rather than a dependency list.
strukto-ai/mirage#dsh★ 3696
Swaps the filesystem and bash providers for a mirage virtual workspace: file tools and shell commands run over mounted resources (RAM, S3, Redis, Slack, Gmail, Notion, Postgres) instead of the host disk, with per-mount read/write/exec modes, per-command sandbox routing (monty, pyodide, quickjs in process; docker, e2b, daytona remote), and installed CLIs (git, gh, slack, linear, ntn, gws, or one you register) as head words in the virtual terminal.
first-fluke/oh-my-agent#dsh★ 1344
Runs project OMA checks before and after tool execution and when a turn tries to finish. Installs its OMA CLI dependency and initializes unconfigured projects on first use. Requires Node.js 22+; initial setup needs network access and project write access.
hust-open-atom-club/oh-dsh★ 322
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
weijiafu14/pi2dsh★ 217
Pi Host ABI compatibility engine: after one install, unmodified Pi extensions from npm mount as native DSH plugins with `dsh plugin add <pi-package>`. Verified end to end on stock DSH with pi-mcp-adapter (full MCP manager: OAuth, resources, prompts, MCP Apps, elicitation, sampling), @tintinweb/pi-subagents, pi-code, pi-hermes-memory and pi-background-tasks; `pi2dsh inspect` reports a package's compatibility before installing.
Fishquito7/dsh-skill-mcp-panel★ 207
Manages DSH skills and MCP servers from the web settings: skill cards with hot enable/disable, workspace scopes, groups, batch migration and drag-and-drop import, plus stdio/HTTP MCP CRUD with connection tests, secret redaction and the unified dsh-panel CLI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.