The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When building a Web interface, if you want your app to support offline access and be installable on desktop or mobile devices, additional Service Worker and Manifest configuration is required. The dsh-pwa-plugin introduced below is designed to address exactly this issue.

Plugin Overview

This is a PWA plugin provided for DeepSeek Harness. It implements smart caching strategies via Service Worker, enabling offline access to static assets and providing a standard PWA Manifest to support installing the application as a standalone app.

The plugin is maintained by RaulLazaro and is released under the MIT license.

Installation and Activation

The installation process consists of three steps and requires modifying the DSH Web Profile configuration files.

  1. Add the dependency

Add the dependency to the package.json file of the DSH Web Profile:

{
  "dependencies": {
    "dsh-pwa-plugin": "file:~/workspace/dsh-pwa-plugin"
  }
}
  1. Register the plugin

Insert the plugin configuration into the Profile’s cordis.patch.yml:

- insert:
    - id: dsh-pwa
      name: 'dsh-pwa-plugin'
  1. Restart DSH

Run the following command to restart the service:

dsh web

Core Features

The plugin hosts and injects the following files:

  • /sw.js: Service Worker script
  • /manifest.webmanifest: PWA configuration manifest
  • Icon files

The plugin automatically detects and silently activates new versions without manual intervention.

Caching Strategies

The plugin defines differentiated caching strategies for different types of resources:

Resource Type Strategy Description
HTML Network-first Always attempts to fetch the latest version
JS/CSS/Fonts/Images Cache-first Serves from cache when available
API calls Not cached Always uses network requests

How It Works

  1. The plugin runs as a Host plugin and serves static asset files.
  2. The plugin injects the Service Worker registration script into the HTML.
  3. After the Service Worker starts, it caches static assets (including icons) for offline use.
  4. The Manifest file allows the browser to install the application as a PWA.
  5. It uses DSH’s built-in /favicon.svg as the icon source without overriding it.
  6. Once an update is detected, it automatically triggers a page reload to apply the new version.

Considerations

  • HTTPS Requirement: Service Worker must run over HTTPS (localhost excepted).
  • API Limitation: Service Worker cannot cache API calls; API requests always use the network.
  • Version Dependency: Requires the @deepseek-ai/cordis version to be ^4.0.1 or higher.
  • Update Mechanism: After a new version is detected, a page reload is required for it to take effect.