Introduction¶
DeepSeek Harness (DSH) extends its capabilities through plugins, allowing the host and the client to each fulfill their own roles. When developers build tools, they often need the model to return structured results directly; on the client side, they may want an independent panel to accomplish a task without interrupting the conversation flow. dsh-scifi-story is a dual-end plugin targeting both sides: the host provides the scifi_story tool, and the client provides the “Sci-Fi Workshop” panel.
What Is This¶
This is a DSH dual-end plugin maintained by jasonz-ai-2026. It converts any set of physics terms into a complete short science-fiction story. The plugin directory itself is a DSH bundle, containing both the host entry point and the browser client code.
Core Features¶
The host registers a tool called scifi_story. The caller only needs to provide a set of terms, an optional narrative tone, length, and language. Internally, the plugin performs an independent model call, instructing the model to turn each term into a plot mechanism rather than a term definition, and to include specific characters, scenes, conflicts, and an irreversible cost. The story should open with suspense, contain a cognitive reversal in the middle, and leave a lingering resonance at the end. It ultimately returns a structured object { title, story, terms, language }.
The client adds a “Sci-Fi Workshop” panel to the right sidebar. Users can input 1–12 physics terms (separated by commas, Chinese enumeration commas, or newlines), optionally fill in a narrative tone, select a length and language, then click “Generate Story” or press Cmd/Ctrl + Enter to trigger generation. The panel calls the host via the same-origin endpoint POST /api/scifi-story/generate. Requests must include the x-scifi-story: 1 header, and the host only accepts same-origin requests bearing this header.
Parameters¶
| Parameter | Required | Description |
|---|---|---|
terms |
Yes | 1–12 physics terms, as a string array |
tone |
No | Narrative tone, e.g. “hard sci-fi,” “suspense,” “warm,” “dark humor,” “epic,” “thriller” |
length |
No | flash (approx. 800–1200 words), short (approx. 1500–2500 words, default), long (approx. 3000–4500 words) |
language |
No | zh (default) or en |
Two Ways to Use It¶
Sidebar Panel¶
After restarting the DSH desktop app, a “Sci-Fi Workshop” tab will appear in the right sidebar. Once opened:
- Enter 1–12 physics terms (separated by commas, Chinese enumeration commas, or newlines);
- Optionally fill in a narrative tone, select a length and language;
- Click “Generate Story,” or press
Cmd/Ctrl + Enter.
Generation runs in the background: switching to another page or right-sidebar tab and coming back will preserve your inputs, generation progress, and results. Even if the panel is unmounted, the request will not be cancelled. Within the same browser session, refreshing the page will restore the most recent result from sessionStorage. While generating, a small blue dot appears next to the tab title; when generation is complete but the panel is not open, a small green dot will indicate this.
Model Tool¶
Simply say in the conversation, “Write a short sci-fi story using these physics terms,” and the model will invoke scifi_story. Once successfully loaded, you can see scifi_story in the tool list.
Installation & Enablement¶
The plugin directory itself is a DSH bundle:
dsh-scifi-story/
├── package.json # dsh.bundle.patch + dsh.client
├── cordis.patch.yml # - insert: id: scifi-story / name: dsh-scifi-story
├── index.js # Host entry: scifi_story tool + HTTP route
├── client.js # Browser entry: "Sci-Fi Workshop" panel in right sidebar
└── README.md
Copy the plugin directory into your current desktop profile:
cp -R /Users/zheng/Codes/rust/Hello_World/dsh-scifi-story \
~/.dsh/profiles/desktop/node_modules/dsh-scifi-story
Register the dependency in ~/.dsh/profiles/desktop/package.json and add the package name to dsh.profile.bundles:
{
"dependencies": {
"dsh-scifi-story": "file:/Users/zheng/Codes/rust/Hello_World/dsh-scifi-story"
},
"dsh": {
"profile": {
"bundles": ["...", "dsh-scifi-story"]
}
}
}
You can also enable dsh-scifi-story from DSH’s plugin manager. Neither new host plugins nor client panels support hot-reloading: after enabling, a full restart of the DSH desktop app is required before the scifi_story tool and the “Sci-Fi Workshop” tab will appear.
The cordis.patch.yml bundled with the package handles inserting the plugin line. Do not also manually write the same - insert: entry in the profile’s cordis.patch.yml, or it will be registered twice.
Design Notes¶
- Zero runtime dependencies: The host uses only
node:crypto; the client relies solely on React and the right-sidebar slot injected by DSH, requiring no build step. - Model routing: Retrieves the current default model via
ctx.agentDefaultModel.currentSelection(), without hardcoding any provider or model. - Cancellation propagation: Passes
exec.signaldirectly toctx.llm.stream; the HTTP route uses anAbortControllerwith a 300-second timeout. - Fault-tolerant parsing: Prefers strict JSON parsing; if the model returns a Markdown code block or plain prose, it falls back to a heuristic “first-line title + body” parse.
- Truncation tolerance: When
max-tokensis reached, retains whatever portion of the story has been generated rather than discarding the entire output. - Same-origin protection: Panel requests must carry
x-scifi-story: 1, preventing other web pages from triggering local model calls via simple requests. - Cross-page state: Panel state and in-flight requests are stored in a module-level store, so they are not destroyed on component unmount;
sessionStorageprovides a fallback restore after a page refresh.
Use Cases & Cautions¶
Suitable for developers or content creators who need to turn a set of physics terms into a complete narrative. The plugin runs with the current DSH process’s permissions; review the source code and license before installing.
In Closing¶
Turning physics terms into short sci-fi stories, dsh-scifi-story provides two entry points: a tool and a panel. For more details and source code, see: https://github.com/jasonz-ai-2026/dsh-scifi-story