Minglink/dsh-infinite-gen-4
Minglink/dsh-infinite-gen-5DeepSeek 专用破甲插件:以 order 100 追加无条件服从的系统提示词段,提供带校准元数据的 profile 工具,并通过会话投影在输入框上方显示实时破甲状态徽标。
A DeepSeek Harness (DSH) plugin that manages archived sessions and the trash from the settings panel.
Deletes are reversible: deleting a session moves it to the trash (~/.dsh/trash); only
purge / empty trash are permanent. Live (running) sessions refuse deletion with a clear message.
dsh plugin --profile web add github:imrascal/dsh-archive
Or from a local checkout:
dsh plugin --profile web add file:C:/path/to/dsh-archive
Restart the app after installing (the host half loads at boot), then refresh the page — the section appears under Settings → Archived Sessions.
dsh pluginforwards to pnpm, sopnpmmust be on your PATH.
This feature originally lived as in-box patches across 12 files
(dsh-workspace, dsh-session-persistence-jsonl, dsh-host-apiproxy, dsh-client-runtime,
dsh-client-ui-workspace, ... — reference diffs in patches/). This plugin re-implements
it as a standalone package with a dual-path design:
| Path | When | Behavior |
|---|---|---|
| Native | host/client already carry the archive API | the client calls ctx.workspaces.unarchiveSession / trashList / ... directly — same RPC + store-frame sync as the in-box implementation |
| Fallback | an app update reverted host or client to stock | the host half patches at runtime: adds the trash layer to sessionPersistence and the archive API to workspaceRegistry; the client talks to the plugin's own /dsh-archive/session HTTP route |
So the feature survives app updates: trash data lives in ~/.dsh/trash (data, not code) and the
archive set lives in the workspace registry's persisted state. Whatever the update does to the
packages, the plugin feature-detects at startup and fills in whatever is missing.
dsh/index.js host half: persistence trash layer + registry archive API + /dsh-archive/session route
dsh/client.js browser half: "Archived Sessions" settings section (settings.section slot), no build, react only
cordis.patch.yml bundle mount declaration
patches/ reference diffs for the in-box host patches (the client patches are replaced by this plugin)
scripts/ eval-check.mjs (client factory eval) and host-logic-test.mjs (host backend lifecycle)
If your DSH install already carries the local archive-management patches (as this repo's dev
machine did), the plugin and the in-box patch would register the same archived-sessions section.
To migrate:
node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js to the official
release (drops the embedded ArchivedSessionsSection registration; the host patches may stay —
the plugin detects them and no-ops).To move the host side back to stock as well, back up
~/.dshfirst, reversepatches/, and let this plugin's host half re-add the backend. Trash data and the archive set are unaffected.
~/.dsh/trash/<sessionId>-<timestamp>/, restorable at any time.session-live); the UI explains what to do.0.1.0-rc.5 and later — both the native Web UI (dsh web in a browser) and the
desktop GUI (Electron window), which share the same host services and client bundle./dsh-archive/session.unarchiveSession/deleteSession/ trash*, API-proxy routes, client-runtime methods): every step feature-detects and no-ops; the
client calls the native ctx.workspaces API directly. Service availability is checked per call,
so a service that is provided late is picked up automatically instead of stranding the section on
the fallback path.0.1.7-rc.1 has archiveSession/unarchiveSession natively but no deleteSession and no trash
layer at all. The plugin now feature-detects every method on its own: it fills exactly the gaps
(here: deleteSession + trashList/trashRestore/trashPurge/trashEmpty plus the persistence trash
layer) and never replaces a native method. 0.2.3 and earlier treated a native unarchiveSession
as proof that the whole API existed, skipped the patch, and every delete failed with
workspace registry backend is not available yet.deleteSession is fail-closed: it refuses to run unless the persistence layer is trash-aware,
so the plugin can never drive a stock hard-delete backend (nothing is removed on refusal).@deepseek-ai/cordis 4.x, where reading a
service property off a context (ctx.sessionPersistence) is only allowed when the current fiber
declares it in inject; undeclared reads throw cannot get property "X" without inject. The host
half resolves services through ctx.get(...) and through the patched methods' receiver
(this.ctx, which Cordis shadows to the registry's own fiber) — never through
registry.ctx on a traceable service wrapper, whose ctx property resolves to the caller's
context. On older Cordis 3.x hosts both spellings work; the 0.2.1 path is required on Cordis 4.findLog returns a bare path string on older hosts but a generation record
({ sourcePath, sourceVersion, currentPath }) on current ones — reading it as a string made every
delete fail with The "path" argument must be of type string. Received an instance of Object
before anything was removed. The log inside a session directory is likewise resolved by listing
the directory and preferring the highest generation, instead of hard-coding
session.jsonl[.zstd]: format v0 keeps that name, every later generation is
session.vN.jsonl[.zstd] (hosts that migrated their session format store
session.v3.jsonl.zstd), and a directory can hold both. Without that, trashed sessions written
under a versioned name were invisible to trash list / restore.fs; no platform assumptions).npm install # fetches the @deepseek-ai/cordis devDependency
node scripts/host-logic-test.mjs # host lifecycle: delete → trash → restore → purge → empty → live refusal; covers the generation-record findLog shape and both log namings (0.2.3)
node scripts/host-robustness-test.mjs # late service provision + fail-closed delete + route on-demand ensure
node scripts/cordis4-strict-test.mjs # REAL Cordis 4 strict-inject regression (0.2.1: "without inject" fix)
node scripts/eval-check.mjs # client bundle factory eval + apply + slot registration + late-service detection + dual-store resync (0.2.2)
MIT