Skip to main content
J

dsh-workflow-bar

jaycebox/dsh-workflow-bar

A saved-workflow library: /workflow lists stored scripts and runs one through the agent workflow tool, a left-sidebar page lists, creates and edits them, and each record is a JSON file under the DSH home. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

dsh plugin --profile web add github:jaycebox/dsh-workflow-bar

README

dsh-workflow-bar

English | 中文

A saved-workflow library for DeepSeek Harness (DSH): write a workflow script once, then run it by name from the composer, and manage the whole library from a row in the left sidebar.

  • /workflow opens a searchable picker of saved workflows; choosing one fills the composer with the exact command.
  • /workflow <name> <input> runs a saved workflow: the script, its metadata, and your input are handed to the agent's workflow tool.
  • Workflow 库 in the left sidebar opens the management page — list, search, create, edit, delete, and copy the run command.
  • Every run ends with a summary, because the plugin adds a standing system-prompt rule instead of hoping the model remembers to report back.

The Workflow library page beside the left sidebar

Contents

Requirements

  • DSH 0.2.2-rc.1 or newer, Web or Desktop surface (the management page is a browser UI; the commands and the tool also work headlessly).
  • An agent preset that mounts the workflow tool for the run path: standard and cordis do, ptc and minimal do not.

Install

From npm (published as dsh-workflow-bar):

dsh plugin --profile desktop add dsh-workflow-bar

From GitHub:

dsh plugin --profile desktop add github:Jaycebox/dsh-workflow-bar

From a local checkout: Plugins → Add plugin → the directory containing this package.json. The same path works through the agent:

plugin_manager install_bundle target="<absolute path to this directory>"

Prebuilt tarball (no build approval): every release attaches the packed package, so this also works:

dsh plugin --profile desktop add -w "https://github.com/Jaycebox/dsh-workflow-bar/releases/download/v1.0.0/dsh-workflow-bar-1.0.0.tgz"

Installation writes the bundle into the profile and survives restarts. Reload the window once so the sidebar row and the client half are in the page's module graph.

Quick start

  1. Reload the window; a Workflow 库 row appears in the left sidebar.
  2. Type /workflow in the composer and press Enter; pick a workflow from the list (or create one from the panel's 新建 button).
  3. Type your input after the filled command and press Enter. The agent calls the workflow tool with the saved script and answers with a summary.

To have the agent author a workflow for you, run /workflow-add 并行检索百度与谷歌并比较重合度 — it lists the library first, designs the script, and saves it through the workflow_library tool.

Commands

CommandWhat it does
/workflowOpens the picker of saved workflows. Choosing one completes the composer to /workflow <name> and focuses it.
/workflow <name> <input>Runs a saved workflow with your input. Without input, the record's defaultInput is used when one exists.
/workflow-list [query]Lists the library; the optional query filters names and descriptions.
/workflow-add <requirement>Starts the creation flow: the agent inspects the library, designs the script, and saves it.

Bare /workflow also prints the registered names when the picker is not available (headless or older surfaces), so the command is useful everywhere.

The picker

/workflow + Enter (or picking the row from the / menu) opens a popup listing every saved workflow with its description, input hint, and default input. It is a client-side decoration over the Host command (ctx.commandUi.decorate with a popupSelect, the same shell /model and /permission use), so the command keeps its catalog row, argument claim, and lifecycle logging.

A leading space after /workflow claims the argument instead of opening the popup — that is the contract for commands that declare an input hint, and it is how you type a name the picker does not know.

The management page

The Workflow 库 row selects a page in the main column:

  • List with a filter box; each row shows the name and one-line description.
  • Detail with description, when-to-use, input hint, default input, update time, the exact run command (with a copy button), and the script source.
  • 新建 / 编辑 with fields for name (a lowercase slug), description, when-to-use, input hint, default input, and the script body.
  • 删除 in two steps: the first click arms it for five seconds, the second removes the record. Deleting is user-only; the agent tool cannot do it.
  • 返回对话 returns the main column to the Conversation.

Where workflows live

One JSON file per workflow under $DSH_HOME/workflows (default ~/.dsh/workflows), or the directory the plugin row configures:

- id: workflow-bar
  name: dsh-workflow-bar
  config:
    directory: 'D:\workflows'
{
  "version": 1,
  "name": "open-bilibili",
  "description": "Open a bilibili page in the existing Chrome profile",
  "whenToUse": "When you want bilibili open without typing a URL",
  "argsHint": "Target: home page, search words, a BV id, or a full URL",
  "defaultInput": "首页",
  "script": "const target = String(args.input || '').trim()\n...",
  "createdAt": "2026-12-02T00:00:00.000Z",
  "updatedAt": "2026-12-02T00:00:00.000Z"
}

script is the body the workflow tool executes: plain JavaScript with top-level await, the agent(), parallel(), pipeline(), phase(), and log() hooks, and a final JSON return value. Your input reaches it as args.input. Nothing is generated or evaluated by this plugin — the file is plain data you can edit by hand or keep in version control.

The agent tool

workflow_library is host-wide and visible to every agent:

ActionPurpose
listNames, descriptions, input hints, and defaults before creating anything.
savePersist one workflow: name, description, script, optional whenToUse, argsHint, defaultInput, and overwrite.

Saving an existing name fails unless overwrite is true. Deleting is user-only on purpose: a model cannot remove your library.

Configuration

FieldDefaultMeaning
directory$DSH_HOME/workflowsWhere workflow files are read and written.
summarySectiontrueAdd the standing "summarize every workflow run" prompt section.

Permissions and privacy

  • Reads and writes only inside the workflow directory; nothing else on disk.
  • No outbound network. Workflows themselves may call the tools their child agents have; that is the script's business, not this plugin's.
  • Adds one local HTTP route, POST /workflow-bar/api, used by the management page. It accepts only loopback (or a deployment-trusted host) requests with a same-origin Origin, and only a fixed list of operations (list, detail, save, remove) — it is not a generic proxy into the Host.
  • Registers three slash commands, one model-facing tool (workflow_library), one prompt section, and the sidebar page.

Limitations

  • It does not execute scripts itself. The workflow engine lives inside each Agent preset, so the run path is the agent calling the workflow tool. A preset without that tool cannot run a workflow.
  • Running costs model tokens: one agent turn plus whatever the workflow's own subagents consume. Browsing the panel costs nothing.
  • No run history in the panel. Runs are visible in the transcript (the official workflow-run node and the tool result).
  • No recursion. A workflow script cannot call another saved workflow; DSH's workflow engine has no workflow() hook.
  • UI copy is Chinese. The panel and command output use Chinese text with the host's theme tokens; display metadata is localized for the plugin page.

Development

npm run check   # node --check on every module + the client smoke test
npm run test    # client bundle evaluation test

test/client-smoke.mjs evaluates the browser bundle against stubs and asserts both slot registrations and the picker. It exists because node --check cannot catch a broken template literal that still parses: a stray backtick in the CSS once passed the syntax check and threw only at runtime, which unregistered the whole plugin.

Layout:

PathRole
lib/index.jsHost half: commands, tool, prompt section, API wiring
lib/store.jsWorkflow records on disk
lib/prompts.jsCommand output and the follow-up prompts
lib/web.jsThe same-origin JSON route and its trust fence
lib/client.jsSidebar row, management page, /workflow picker
test/client-smoke.mjsBrowser-bundle evaluation test
scripts/render-assets.pyDraws the storefront icon and panel illustration

Storefront assets

assets/icon-256.png and assets/panel-illustration.png are produced by scripts/render-assets.py (Pillow, bundled with the DSH runtime), and screenshots.json declares the illustration for storefronts. The illustration is drawn, not captured — it depicts the page faithfully but is not a live window capture; replace the file with a real one when you have it and the declaration keeps working. The plugin's own detail page still uses the vector docs/preview.svg, which DSH renders natively.

Publishing to the plugin market

  1. Push the repository. repository, homepage, and bugs in package.json already point at Jaycebox/dsh-workflow-bar; change them only if you publish under another account.
  2. Community market (awesome-dsh-plugin). dshmarket and the Discover page read the plugins.json that awesome-dsh-plugin/awesome-dsh-plugin generates from data/plugins/*.yml. Submission is one file in a pull request: copy market/awesome-dsh-plugin.yml to data/plugins/Jaycebox__dsh-workflow-bar.yml. Two rules bite: the repository must be at least one day old and carry the dsh-plugin topic, and a custom icon: must be a GitHub-hosted raster image (SVG is refused, so the card falls back to your avatar without one).
  3. Official DSH market index (optional, self-hosted). npm run index generates a format-1 index at market/index.json from the current git remote and commit. Host it anywhere public (for example this repository's raw URL) and add it under Settings → plugin sources.

Tag releases with SemVer (v1.0.0) so an entry's version and added fields stay meaningful.

License

MIT. See LICENSE.

Related plugins