DeepSeek Harness Plugin

Rosynb666/dsh-whale-catch

Stars ★ 117 Downloads (30d) 2,390 Category Tools & Capabilities Added 2026-10-20 npm dsh-whale-catch

Right-sidebar basket that collects the files a session produced or changed without the agent having to register them, with preview, zip packaging, and one-click archiving.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-whale-catch

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:Rosynb666/dsh-whale-catch

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

Collect automatically · preview & diff · delivery ledger · checks · receipts · restore · content search

🚀 Quick start · ✨ Features · 🖥️ UI · 🛡️ Security · 中文

A right-sidebar delivery workbench for DeepSeek Harness (DSH): it collects the files a session produced or changed into one basket, with preview, inline diff, version chain, delivery ledger, delivery checks, receipts, archive restore, content search, zip and copy-as-Markdown.

[!TIP] In one sentence: it does not change your workflow; it just gives “what did this session actually produce?” a permanent answer.

🧭 Contents


🐋 Why Whale Catch

After a few turns in DSH, “where did that file go?” becomes routine:

  • 🪟 The built-in deliverables card only covers the current turn — scroll a few screens and it is gone.
  • 🐚 Files written by python build_doc.py or npm run build inside bash are neither a file-tool edit nor a present call, so neither mechanism sees them.
  • 📦 Sending a dozen deliverables somewhere means digging through the workspace and hoping nothing was missed.
  • 🔍 Checking “how much changed / what changed” means switching back to git or scrolling history.

Whale Catch now covers the whole line: collect automatically, show in one place, check before delivery, zip / archive / receipt, and a history you can revisit and restore. Changed files expand a unified diff, version turns are selectable, and content search lives in the same sidebar.

🆚 Compared with built-in deliverables

This is not reinventing the wheel: both deliverables/presented and workspace/changes are consumed as-is. It fills the gaps they leave.

🪟 Built-in deliverables card 🧺 Whale Catch
Sources present files + git / file-tool edits the same two, plus a directory-scan fallback (bash, python, build scripts)
Scope one turn, shown at turn end the whole session, across turns
Change detail shown once on the turn-end card persistent line badges; expand a unified diff in place; group by turn
Actions open source file preview / diff / search / zip / archive / copy path / copy as Markdown
After a Host restart change summaries live in memory and are lost file list rebuilt from mtime; present descriptions and delivery marks come back from the local ledger
Needs agent cooperation yes, the model must call present no, zero registration
Deliverable boundary what the kernel considers output also catches files written into cwd by external processes

✨ Features

Capability What you get
🧺 Automatic collection present declarations, workspace/changes edits, and a cwd scan merged by absolute path
👀 In-place preview images / PDF / Markdown / text / source / Office open in the right sidebar through DSH Document Preview; files outside cwd show a copy-path-or-archive hint
🔍 Inline diff unified diff for kernel-recorded changes: + / − colours, @@ headers, new / deleted / binary / oversized notes
🧭 Search & grouping search by name / path / description; kind chips; group by “Turn N”; copy as Markdown
📦 Zip selected or all files; manifest.json + a human-readable checklist inside; cwd-outside files under _external/
🗂️ One-click archive relative paths preserved; (2) suffixes instead of overwrites; failures reported, never silent; a batch manifest and ledger entry are written
🧾 Delivery ledger This session / History views: revisit archived batches, download receipts, restore, compare with the current file
🪟 Delivery portal Render an archived batch as a self-contained HTML page: offline, printable, with sha256; optional full zip with file contents
🩺 Delivery check before zip / archive: missing, oversized, empty, sensitive and dirty-since-archive files; blocking issues stop, warnings can be confirmed
🔁 Version chain pick any recorded turn for a diff; compare the current file with an archived version
🔎 Content search search file bodies; hit lines jump to the matching Document Preview line
✅ Delivery marks mark files delivered and see N / M delivered; state is written to the local ledger
📊 Line badges +N −M per file and a session-wide total
🌗 Theme-aware only --dsw-alias-* / --dsw-static-* tokens; dark / light follows DSH
🌐 Bilingual Chinese and English dictionaries; localised error codes
⚡ Zero build lib/client.js is handed to __ModuleLoader__ as-is

🎁 What's new in 0.5.0

  • 🪟 Delivery portal: turn an archived batch into a self-contained portal.html — offline, printable, with sha256; manifest-only or full zip.
  • 🧾 Delivery brief: file count, size, type mix, turns and unarchived items, ready to paste.
  • 🌐 Cross-session totals: batches, files and bytes across sessions at the top of History; local ledger only.

🎁 What's new in 0.4.0

  • 🧾 From basket to delivery workbench: archives now write manifest.json plus a local ledger, so batches survive restarts and session switches; present descriptions survive too.
  • 🩺 Delivery check: missing / oversized / empty / sensitive / dirty-since-archive issues before you package; content hits report only the pattern name and line number.
  • 🧾 Receipts: self-contained HTML / Markdown with sha256, printable and checkable; the /ledger/verify API recomputes digests.
  • 🔁 Version chain and archive diff: every recorded turn is selectable, and the current file can be compared with the archived copy.
  • ♻️ Restore: skip / rename / overwrite, dry-run first, backup before overwrite, cwd-only writes.
  • 🔎 Content search: text files in the basket only, hit lines jump to preview; no index, no disk writes, no regex.
  • ✅ Delivery marks: mark delivered, see progress, persisted in the ledger.

Per-version notes for 0.3.x / 0.2.x live in CHANGELOG.md; the README keeps only the current release.

🚀 Quick start

Requirements

  • DSH >= 0.2.0-rc.2
  • Node ^22.19 || >=24 (the Desktop runtime already satisfies this)
  • No build step, no extra service, no database

1. Install

On Desktop use the in-app Settings → Plugins → Install and paste one of these (the desktop profile is owned by the Electron app, so dsh plugin --profile desktop add is refused):

github:Rosynb666/dsh-whale-catch     # latest main from GitHub
dsh-whale-catch@0.7.0                # a pinned npm version

Only self-managed profiles use the CLI:

dsh plugin --profile <profile> add github:Rosynb666/dsh-whale-catch
dsh plugin --profile <profile> add dsh-whale-catch@0.7.0

2. Open the panel

Reload the page (⌘R / Ctrl+R), click + in the right sidebar, and pick “Open Whale Catch”. You can also select the whale mascot in the sidebar guide.

3. Get to work

Let the agent produce something, or click Refresh once. Select files → Zip or Archive.

Uninstall

Desktop: Settings → Plugins → Uninstall. For self-managed profiles:

dsh plugin --profile <profile> remove dsh-whale-catch

🖥️ UI and interactions

The repository sidebar uses the whale mascot shown above. The catch card at the top shows the file count, size and changed lines for this session; the bar below it shows each kind's share, and its legend doubles as a filter. Click a row to select it (its tile turns into a check), or click the filename to open Document Preview. Open ••• to preview, view a diff or version, mark delivery or copy the path. The footer waterline is delivered / all files. Colors follow the DSH theme, and the sidebar respects the system’s reduced-motion setting. To work on the UI locally, run npm run preview and open http://localhost:4173.

🎛️ Controls

Control What it does
☑️ Checkbox / row click select files; only selected files are zipped / archived; none selected means all
🔄 Refresh force a rescan of the session cwd and fetch a fresh snapshot
🏷️ Kind chips all / docs / sheets / slides / images / code / archives / media / other
🗂️ Session / History Session is this conversation's basket; History is the local delivery ledger (batches, receipts, restore)
🔎 Search case-insensitive substring over name, relative path and description
🔤 Body toggle search file contents on Enter; hit lines jump to the matching Document Preview line; no index is written
🔀 Group by turn sections per “Turn N”, newest first, unmarked files last
↕️ Sort modified / name / size / kind; re-renders immediately
📋 Copy list export the selection (or current filter) as Markdown for a report or issue
⧉ Copy path copy the absolute path
👁️ Open open in the right sidebar through DSH Document Preview (images / PDF / Markdown / text / source / Office); files outside cwd show a hint
🧾 Diff expand the kernel's unified diff; only entries with a workspace/changes record have one
🕰️ Turn picker when a file changed across turns, pick any recorded turn; released turns show a readable hint
✅ Delivery mark mark delivered / undo; the footer shows N / M delivered; state goes into the local ledger
🩺 Delivery check before zip / archive: missing, oversized, empty, sensitive names / headers, dirty-since-archive; blocking issues stop
📦 Zip download a zip with the delivery manifest
🗂️ Archive copy into the archive directory, write a batch manifest and ledger entry; shows “N archived / M failed”
🧾 Receipt / Restore download an HTML / Markdown receipt with sha256, or dry-run and restore a batch
🔁 Compare current compare an archived version with the current file; does not depend on kernel diff memory
🔎 Show more with more than 200 rows, starts with 200 and appends on demand

📦 What the zip looks like

quarterly-delivery.zip
├── report.docx
├── assets/
│   └── chart.png
├── _external/
│   └── external-delivery.pdf
└── _whale-catch/
    ├── manifest.json       # machine-readable: session, entry path, size, turn, sha256…
    └── 交付清单.md          # human-readable Markdown table

🗂️ What the archive looks like

$DSH_HOME/whale-catch/archive/
└── <session-id>/
    ├── report.docx
    ├── assets/chart.png
    ├── _external/external-delivery.pdf
    └── _whale-catch/
        ├── manifests/<batch>.json     # batch manifest for the flat layout
        └── backups/<timestamp>/       # pre-overwrite restore backups

With archiveKeep enabled, each run gets its own batch directory and old batches are pruned:

$DSH_HOME/whale-catch/archive/
└── <session-id>/
    └── runs/
        ├── 20261030-153012-120/
        │   ├── report.docx
        │   └── _whale-catch/manifest.json
        └── 20261030-160145-004/   # keep newest N batches
            ├── report.docx
            └── _whale-catch/manifest.json

The ledger index lives at $DSH_HOME/whale-catch/ledger/<session-id>.jsonl; it is only a directory of the manifests and can be rebuilt with POST /whale-catch/api/ledger/rebuild.

🧠 How zero-registration works

Whale Catch does not ask the agent to register files. It merges three sources by absolute path:

Source From Covers
presented deliverables/presented session event files the model explicitly delivered, with description and turn
changed workspace/changes + ctx.workspaceChanges.summary() / .diff() git snapshots and file-tool edits, with line counts and a unified diff
scanned a cwd scan (mtime >= session creation) anything written by bash / python / build scripts
flowchart LR
  subgraph E["session events"]
    direction TB
    P["deliverables/presented"]
    W["workspace/changes"]
    S["turn/end → scan cwd"]
  end

  B["Basket<br/>merged by absolute path"]
  API["GET /basket"]
  UI["sidebar panel"]

  P --> B
  W --> B
  S --> B
  B --> API --> UI

🧭 Scan boundaries

  • current session cwd only; no symlink following;
  • node_modules / .git and other default directories skipped;
  • dot-files and dot-directories skipped (.env, .gitignore are not collected automatically; use present if they really are deliverables);
  • maxDepth (6), maxFiles (800), maxFileBytes (64 MB), and a 20,000-entry visit cap;
  • when truncated, the panel shows a “large directory” note.

⏱️ When scans happen

Trigger Behaviour
First panel open one scan
Every turn/end one debounced scan (1.2 s, gives writes time to land)
Explicit Refresh forced rescan; waits for an in-flight scan first
5-second poll cache only, no disk scan

The session table is LRU with 40 entries; snapshot stats use 16-way concurrency.

⚙️ Configuration

Override in your own profile patch layer — do not edit the bundled cordis.patch.yml:

# ~/.dsh/profiles/desktop/cordis.patch.yml
- id: dsh-whale-catch
  config:
    archiveDir: ~/Documents/whale-catch   # default: $DSH_HOME/whale-catch/archive
    ignore: [dist, build, .venv]
    maxFiles: 800
    maxDepth: 6
    maxFileBytes: 67108864
    maxZipBytes: 536870912
    maxBodyBytes: 1048576
    archiveKeep: 0                        # batch retention; 0 disables batch dirs and pruning
    lookbackMinutes: 720
    allowHosts: []                        # extra allowed Host names; localhost / IP literals always pass
    ledger: true                          # write the ledger index (manifests are always written)
    ledgerDir: ~/.dsh/whale-catch/ledger  # ledger index directory
    searchMaxBytes: 65536                 # per-file read cap for content search
    searchTimeoutMs: 3000                 # overall content-search budget
    restoreBackup: true                   # backup before overwriting on restore
    sensitivePatterns: []                 # extra sensitive filename globs
Field Default Meaning
archiveDir $DSH_HOME/whale-catch/archive archive root; a leading ~ / ~/ expands
ignore [] extra directory names to skip, on top of the built-in list
maxFiles 800 max files collected per scan
maxDepth 6 directory traversal depth
maxFileBytes 67108864 per-file limit; shared by zip and archive
maxZipBytes 536870912 total zip limit; also used for zip preflight
maxBodyBytes 1048576 JSON request-body limit
archiveKeep 0 archive batch retention; 0 keeps the old layout, > 0 writes runs/<timestamp>/ and prunes old batches
lookbackMinutes 720 fallback window when session creation time is unavailable
allowHosts [] extra allowed Host names (reverse proxies); IP literals and localhost always pass
ledger true write the ledger index; manifests are always written and can rebuild it
ledgerDir $DSH_HOME/whale-catch/ledger ledger index directory
searchMaxBytes 65536 per-file read cap for content search
searchTimeoutMs 3000 overall content-search budget (ms)
restoreBackup true back up existing files before overwrite
sensitivePatterns [] extra sensitive filename globs (warn only)

Hot reload picks it up; no restart needed.

🛡️ Security model

The routes live on the loopback Host. The threat model is a third-party page in your browser hitting the local API, not other local processes (they can already read your files).

Defence What it does
🚧 Path allowlist /file, /diff, /zip, /archive only accept paths already in the basket; ../ is rejected at the allowlist. /diff is narrower: only entries with a workspace/changes record
🌐 Origin + Host Origin must match Host; Sec-Fetch-Site: cross-site is rejected; Host must be localhost, an IP literal, or an allowHosts entry
🧾 JSON writes cross-site forms cannot send application/json; declaring it triggers a preflight that this route rejects with 415
🧪 Inline sandbox HTML / SVG responses carry Content-Security-Policy: sandbox: styles still render, scripts do not run, origin becomes opaque
📦 Zip checks entry names drop .. and leading slashes; manifest names are reserved; cwd-outside files go to _external/
🗂️ Archive checks realpath keeps the parent under the archive root; symlink escapes become unsafe-path; archiveDir == cwd is rejected; pruning only removes time-named directories under runs/
📏 Hard caps 64 MB per file, 512 MB per zip, 800 files, 1 MB request body — all configurable
🚫 Visible failures oversized / unsafe / copy failures land in failed; the panel reports both counts

Privacy notes

  • The zip's _whale-catch/manifest.json and checklist record the cwd (home prefix redacted to ~), session id and sha256. Review before sharing.
  • The scan deliberately skips dot-files so .env / .gitignore are not collected automatically.
  • For security reports use the private channel in SECURITY.md.

📊 Compatibility and limitations

✅ Compatibility

Item Range
DSH >= 0.2.0-rc.2
Preview needs DSH >= 0.2.1 (Document Preview + sidebarRight.openResource()); cwd files preview, files outside cwd show a hint
Node `^22.19
Platforms macOS / Windows / Linux (CI: three platforms × Node 22/24)
Build none; lib/client.js loads as-is
Runtime dependency @deepseek-ai/schemastery (validation only)

⚠️ Known limitations

Limitation Impact / note
Current session cwd only files outside cwd are not collected, except absolute paths declared via present
Host restart files reappear via mtime; present descriptions and delivery marks are rehydrated from the local ledger (0.4+ events only)
Old mtime files whose mtime predates the session are skipped
Turn diffs depend on Host lifetime workspace-changes keeps comparisons in memory; archive comparison does not depend on it (it reads archived bytes)
Diffs depend on kernel capability a Host without workspaceChanges.diff() shows the “no readable diff” note
Long diffs truncated /diff returns at most 1200 lines; the panel renders at most 300 lines per hunk
No archive cleanup by default the archive lives under $DSH_HOME and is not pruned; set archiveKeep to retain batches
Preview needs the DSH preview plugin preview goes through Document Preview; a disabled plugin shows a notice. Files outside cwd have no dsh-resource address, so the panel asks you to copy the path or archive
Large lists the first 200 rows render, the rest via Show more; no true virtualization yet
Content search has a budget 64 KiB per file, 3 seconds overall; results say when they may be incomplete; no index
Ledger is local manifest.json and ledger/*.jsonl stay on this machine; mind cwd and file names when sharing a zip
Dot-files not auto-collected .env and friends need an explicit present

❓ FAQ

Check that the session has a cwd, let the turn finish, then click Refresh. A file's mtime must not predate the session; dot-files are skipped. If it still fails, look for no-cwd / scan errors in the Host log.

Only files with a workspace/changes record have before/after snapshots. Scanned files and plain present files do not; comparisons also disappear after a Host restart.

Since 0.3.2 preview goes through DSH's Document Preview instead of opening a new window. The old code used window.open on the local /file URL, which the Desktop Electron main process denies silently (it only forwards https: links), so the button looked broken. After upgrading, cwd files should open in the right sidebar; files outside cwd show a copy-path-or-archive hint.

A restricted environment may block writes to ~/.npm. Use a writable cache instead of sudo:

npm pack --dry-run --cache="$(mktemp -d)"

🛠️ Development

npm install
npm test        # 112 tests: scan / merge / version chain / streaming zip / Range / HTTP fence / diff engine / ledger / preflight / receipt / restore / search / plugin load
npm run check   # contract self-check: package shape, patch, client.inject, locale meta, icon, deps
npm run verify  # check + test

No build step: lib/index.js is the Host half; lib/client.js is the browser half handed verbatim to __ModuleLoader__.

Dependency discipline: the only runtime dependency is @deepseek-ai/schemastery (a pure validation library). It must be a real dependency, not a peer: profiles pin autoInstallPeers: false, so a peer would never be installed in a clean profile and the Host half would fail to load.

dsh-whale-catch/
├── lib/
│   ├── index.js      # plugin entry: session events → basket registry, HTTP routes
│   ├── basket.js     # three-source merge, change metadata, snapshot, path allowlist
│   ├── scan.js       # bounded workspace scan
│   ├── zip.js        # zero-dependency streaming ZIP writer (STORE + DEFLATE)
│   ├── routes.js     # HTTP routes: preview / diff / zip / archive
│   ├── http.js       # Origin + Host fence, JSON, MIME, Range
│   └── client.js     # right-sidebar tab + panel (plain JS, zero build)
├── locale/           # metadata for marketplace/settings
├── test/             # node:test, no framework dependency
├── scripts/          # contract self-check
└── docs/             # architecture, release checklist, dev playbook

🗺️ Roadmap

  • 🌉 Cross-session aggregate: one view over every session's batches (0.4 already keeps a per-session ledger).
  • 🧹 Archive cleanup dry-runs, plus date / project views (archiveKeep already retains batches).
  • ⚡ True virtualization and keyboard navigation for large lists (currently 200-row batches with Show more).
  • 🖼️ Image gallery and inline audio / video fallback (formats Document Preview does not cover).
  • 🧪 Real client-render tests, tsc --checkJs and lint.

🤝 Contributing and thanks

Thanks to everyone who described the “file generated, then lost” pain, and to the DSH community members who mapped the plugin boundaries before us.

🐋 Whale Catch is maintained with love, rice and a mild case of OCD. If it saves you one trip through a folder tree, a ⭐ is the best tip.

📄 License

MIT © Rosynb666

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.