Totoro-qaq/dsh-plugin-bridge

Totoro-qaq/dsh-plugin-bridge

通过可预览的五段式交接,将已有 DSH 会话迁移到另一个 Agent Preset;保留源会话,并可让目标会话暂停等待确认或立即继续。

会话与消息context-migrationcordisdeepseek-harness

dsh-plugin-bridge

English | 中文

Halfway through a task and need another tool preset? Switching the produced session in place would leave tool history that belongs to the old assembly. Bridge previews a bounded five-part handoff, opens a clean target, and leaves the original session untouched.

Quick start · Why Bridge · Evidence · Decisions · Compatibility

Quick start

Bridge 0.5.0 adds a conversation-menu action, a configurable shortcut and natural-language preparation, while keeping preview, editing and human confirmation. The candidate passed isolated official 0.2.1-rc.2 Web and native macOS Desktop handoffs and a keyless 0.2.0-rc.2 backward check. The acceptance record separates runtime tests, their limits and pending publication checks. The bounded 0.2.1 admission policy introduced in 0.4.7 remains unchanged; see Support policy before treating an admitted future version as tested.

Check the Host's actual pnpm executable when installing or removing packages. pnpm 11.22.0 has a known late-worker shutdown bug that can keep a package operation alive after printing Done; natural DSH reproductions isolated the upstream fixes. Use 11.26.0 or later, which includes the upstream fixes, and avoid overlapping package operations. If an operation is pending, wait for it to settle or stop the Host normally before using the offline CLI. Bridge does not bundle pnpm or upgrade your tools automatically.

npm / CLI

Install from npm:

dsh plugin --profile web add dsh-plugin-bridge

On DSH 0.1.5-rc.2, restart dsh web after adding or removing the plugin. On DSH 0.1.6-alpha.2, a first install from the WebUI Plugins page applies live; CLI install and upgrades may still need one restart. DSH 0.1.7-alpha.1 was tested with CLI installation, live disable/enable, and removal followed by a restart; restart-free installation or upgrades were not tested.

On DSH 0.2.1-alpha.3 / 0.2.1-alpha.4 Web with HMR, the running pluginManager service's installBundle() API, including Remote API callers and the agent's plugin_manager tool, returns already-installed for a package already in the profile, even when another version is requested. API replacement uses removeBundle(name) followed by installBundle(spec); honor any restart request. See the upstream upgrade guide.

For CLI replacement, stop the Host using the selected profile, run dsh plugin --profile web remove dsh-plugin-bridge, then dsh plugin --profile web add , and start the Host again. The CLI runs separate profile package operations; the running-API refusal above does not apply to that path.

Before either replacement, finish or save pending handoffs: previews and unconfirmed edits live in memory and stopping or unloading Bridge discards their confirmation state. The source session remains intact; generate a new preview after reinstallation and reapply any saved draft. These Web procedures do not upgrade Desktop; native Desktop acceptance is recorded separately for 0.2.1-rc.2.

Pinned GitHub fallback:

dsh plugin --profile web add github:Totoro-qaq/dsh-plugin-bridge#v0.5.0

Discover

On DSH versions with Discover (introduced in 0.2.1-alpha.4), you can also install Bridge from the author's index:

  1. Open Plugins → Experimental plugins → More and enable Custom plugin markets.
  2. Open Discover → Add index source and paste:
https://raw.githubusercontent.com/Totoro-qaq/dsh-plugin-index/main/index.json
  1. Choose Bridge, check the package name, version and https://registry.npmjs.org/ in the confirmation, then install and choose Enable now.

This is an author-hosted third-party source, not official certification or community approval. It must be added to each profile you want to use it in. Adding and installing from the public URL was verified on an isolated alpha.4 WebUI; clients without Discover can keep using npm/CLI above. The Discover installation path was not separately re-tested on native Desktop.

Three entrypoints

  • Menu action: open the current conversation's ⋯ menu in the sidebar and choose Hand off session. This opens the target picker without replacing a draft or submitting attachments. The composer's existing Bridge item also works when offered; DSH hides argument-taking commands from its + menu when the draft is nonempty. No permanent header button or extra command is added.
  • Keyboard: search for Bridge in DSH keyboard settings and bind Hand off current session. The command is unbound by default and takes no system, Host, or other plugin shortcut; its ID is dsh-plugin-bridge.open.
  • Natural language: say, for example, “Hand this task off to PTC; let me review the summary first.” Modes with model-tool support can call bridge_prepare. An omitted target opens the picker. The model can prepare a handoff, not confirm it for you.

All paths keep human confirmation: choose a target → preview → edit Text/Markdown → confirm. Existing /bridge commands remain available. Hosts without the optional UI/tool services retain the command fallback. The shortcut acts only on the current conversation, not a separate main panel such as Jot or an open modal.

Natural language is on by default. Set naturalLanguage: false in Bridge configuration to disable it without disabling the button, keyboard command, or slash command. Enabling it adds tool-description tokens; ordinary requests are no longer universally zero-overhead. See entrypoint and confirmation boundaries.

Existing commands

Then type in the official WebUI:

/bridge                       list target presets
/bridge --doctor              check the host contract after a DSH upgrade
/bridge code                  preview the handoff; change nothing
/bridge code --go             migrate, restate, then wait
/bridge code --go --continue  restate and start work in the same target request

On DSH rc.7 and later, the official WebUI renders /bridge as a native card. Text exposes the fixed five sections as ordinary fields and flat bullet or ordered-list rows while preserving their Markdown markers; Markdown preserves full source freedom; Preview renders Markdown or a complete JSON tree. Long content scrolls inside the card. Confirm migration opens the created target session. Bridge 0.3.10 adds room to keep confirmation reachable above the fixed composer at the tested narrow widths.

UIs that implement the official conversation.chat.commandview slot receive the same card automatically. Other custom UIs retain the complete server result, summary-file workflow, and target title/session-ID fallback; UI authors can reuse the framework-free dsh-plugin-bridge/client-contract export instead of reimplementing the wire. On an older or non-slot client, correct the printed summary file and run:

/bridge code --go --file <path>

Preview edits are temporary until migration is confirmed. Restarting the client or system may discard them; the source session remains untouched, and you can regenerate the preview.

Uninstall with dsh plugin --profile web remove dsh-plugin-bridge, then restart dsh web.

Why Bridge

Promise · What it means Preview before execution · /bridge creates no target and changes no source session. Review or edit the five-section handoff first. Move state, not tool traces · Decisions, paths, current state, and next steps move to a clean preset. Incompatible calls from the old tool assembly do not. Fail closed · The target goal is paused before kickoff. If that cannot be guaranteed, Bridge clears/cancels the target and sends no model request.

With natural language disabled (naturalLanguage: false), the button, keyboard command, and /bridge are dispatched by the Host without a Bridge model-tool description. The default natural-language entry registers one preview-only tool; a summary worker runs only when a handoff is requested.

Evidence at a glance

The release gate is intentionally small and reproducible; these are regression results, not population guarantees.

Gate · Result Five-part summary facts · 30/30 Target restatement / first useful work facts · 60/60 · 60/60 Critical facts / obsolete-value resurrection · 90/90 · 0 Existing image evidence / unresolved raw image · 5/5 · 5/5 Confirm / --continue target request shape · 2 · 1 to first useful work Confirm extra, paired nominal median · +8.1% vs --continue Summary worker share of clean acceptance components · 20.74% nominal Native WebUI repeat gate (preview / target facts) · 3/3 · 3/3, five facts each DSH 0.1.2 alpha.2 / alpha.3 / alpha.5 installed WebUI · 13/13 · ordered-list edit · PTC paused · image → text fallback DSH 0.1.5-rc.1 installed WebUI, npm Bridge 0.3.4 · 13/13 · 3/3 migrations · edit reached target · PTC paused · raw image → vision target

The token percentage varies widely with preset, response length, and cache state. The worker share is composition, not causal overhead versus no Bridge; the stable product claim is one additional confirmation request. Read the design and evidence boundaries, full release report, and vision report.

How it works

fold history -> five-part handoff -> preview/edit -> clean target session
             -> pause stored goal -> inject -> restate -> wait or continue
image history -> verbatim assistant evidence; unresolved originals use the attachment gateway

The five sections are Goal, Current state, Key decisions and conventions, Key files, and Next step. The original session is never rewritten; archive the target and return to the source if the handoff is unsatisfactory.

Migration decisions

Situation · Bridge behavior · Cost / fidelity effect naturalLanguage: false, no handoff requested · No prompt injection or model tool · 0 Bridge prompt tokens Natural language enabled, no handoff requested · bridge_prepare tool description registered · Tool-description overhead; no summary-worker request /bridge code · One bounded summary worker; preview only · No target session is created Default --go · Target restates and waits · One explicit confirmation request before useful work --go --continue · Confirm the defined next step; restate and work in one target request · Separate approvals and safety limits still apply; no background goal round Image already has assistant analysis · Copy that response verbatim · No raw image is resent by default Image is unresolved and target accepts images · Copy the original attachment and preserve the source VLM · Vision pricing comes from the selected provider Image is unresolved and target is text-only · Prompt admission rejects the image; Bridge sends a visible text fallback · No hidden local VLM and no silent claim of visual understanding

Compatibility

Support policy

From Bridge 0.4.7, engines.dsh is an installation-admission range, not an exact list of tested releases:

>=0.1.0-rc.7 <0.2.0-0 || 0.2.0-rc.2 || >=0.2.1-alpha.1 <0.2.2-0

The previous host terms are unchanged. The 0.2.1 term admits later alpha/beta/rc builds and final 0.2.1, but not 0.2.2 prereleases or later versions. DSH evaluates this field with includePrerelease: true; the explicit <0.2.2-0 ceiling avoids a caret unintentionally admitting later 0.2.x prereleases.

Admission is not acceptance. The table, version-specific reports and Workshop's exact dshVersions name only exercised hosts. Published package metadata is a snapshot; later passing documentation checks do not silently rewrite an old npm artifact. Compatible 0.2.1 updates need a diff review and short acceptance pass, not a new npm release merely to append an alpha number. Actual code/dependency/packaging fixes still require a release, and a new version family requires reviewing the boundary. The verified exact alpha.4 development SDK baseline is retained; it does not have to advance for every compatible Host. /bridge --doctor helps identify missing capabilities but does not replace migration acceptance.

Since Bridge 0.4.0, Approve in new session is available on the official plan-review card, verified on DSH 0.2.0-rc.2 and 0.2.1-alpha.1 WebUI. Enter /plan and review the plan submitted through exit_plan_mode, then choose the Bridge action. It stops the original planning turn, leaves that session in plan mode, creates a fresh session with the same preset/model/workspace, transfers the approved plan verbatim in its kickoff, and starts implementation there. The host's existing Approve and Request changes controls keep their ordinary behavior. See the approved-plan workflow.

Published Bridge 0.4.1 also passed native macOS Desktop 0.2.0-rc.2 acceptance: installation, edited migration, approved-plan execution, live toggles, uninstall and restart. Desktop and npm WebUI records are separate; native-window pixels and account login are not certified.

The 0.5.0 candidate additionally passed native macOS Desktop 0.2.1-rc.2 acceptance: GUI installation, shortcut binding/remapping, the conversation menu, a real natural-language preview, exact edited handoff, automatic target opening, normal quit, restart and GUI removal. This does not re-certify approved-plan execution, native IME/paste integration, account login or every third-party UI/plugin combination.

DSH baseline · Server handoff · Native card · Verification boundary 0.2.1-rc.2 · Yes (Bridge 0.5.0 candidate) · Web and native macOS Desktop passed · Official isolated Web and Desktop, doctor 13/13; menu, configurable shortcut and real natural-language preview; Text/Markdown editing and explicit PTC confirmation with a paused one-round goal. Web also passed inflight disposal, neighboring-plugin coexistence and removal/restart; Desktop passed normal quit, restart and GUI removal. Exact 1,519-character native handoff and remaining limits are in the candidate record. Local candidate acceptance is not npm publication or a claim that every optional feature was re-tested. 0.2.1-alpha.5 · Yes (Bridge 0.4.7) · Real edit/confirm/auto-open passed · Official npm Host; no exemption, doctor 13/13, one preview worker, exact 1,856-character UI-reviewed payload into PTC with a paused goal, one target turn and zero target tools. Text/Markdown round-trip, bounded editor scrolling, current-directory placement, toggles, restart, removal and absence of the CLI shim passed. See bounded acceptance; later admitted hosts are not thereby tested. 0.1.0-rc.6 · Yes · No · Narrow RPC contract and text compatibility tests 0.1.0-rc.7 / rc.8 · Yes · Contract-checked · Client-module/command-slot contract plus server fallback 0.1.1-rc.2 · Yes · Yes · Installed official WebUI: doctor 13/13, edit/confirm/auto-open, three-run repeat gate 0.1.2-alpha.2 / alpha.3 / alpha.5 · Yes · Yes · Official DSH npm hosts: typed controllers 13/13 and PTC auto-open; the alpha.5 gate installed the branch tarball, retained alpha.3 titles, edited ordered lists, fell back from unresolved image to text, and removed cleanly 0.1.2-rc.1 → 0.1.3-alpha.2 · Yes (Bridge 0.3.3+) · Yes (Bridge 0.3.3+) · Real npm-host upgrade, preserved v2 history/title, exact edited payload, PTC paused goal, image fallback and clean removal; see acceptance report 0.1.5-alpha.1 · Yes (Bridge 0.3.4+) · Yes (Bridge 0.3.4+) · Official npm host with session format V3: tarball install, served native-card bundle, doctor 13/13 and preset listing on a V3 session; SDK type diff and V3 fold fixtures. Model-backed preview, migration and image fallback were not re-run; see smoke report 0.1.5-rc.1 · Yes (Bridge 0.3.4+) · Yes (Bridge 0.3.4+) · Official npm host with the published 0.3.4 unchanged: doctor 13/13, native card rendered, three model-backed migrations to PTC with an exact edited handoff and paused goal, and an unresolved image carried to the vision-capable default model; see acceptance report 0.1.6-alpha.1 · Yes (Bridge 0.3.6+) · Yes (Bridge 0.3.6+) · Official npm host: doctor 13/13, native card rendered, ptc still offered after the PTC runtime rename, keyless preview fails closed; the SDK change is additive and lib/ is byte-identical to 0.3.5. Model-backed migration was not re-run; see smoke report 0.1.6-alpha.2 · Yes (Bridge 0.3.7+) · Yes (Bridge 0.3.7+) · Official npm host: Bridge 0.3.6 migrates, but its Open target session button fails with ctx.sessions.open is not a function; Bridge 0.3.7 opens the target through uiWorkspace.openSession on alpha.2 and alpha.1, keeps the paused goal, and survives live disable and enable from the Plugins page; see acceptance report 0.1.7-alpha.1 · Yes (tested: Bridge 0.3.9) · Yes (tested: Bridge 0.3.9) · Published package unchanged: 13 V3 sessions restored as V4, 12 titles preserved, doctor 13/13, model-backed editing and both migration modes, automatic opening, paused goals, worker cleanup, image-to-text fallback, and live toggles. Removal clears the package/command/CSS but leaves a dangling CLI symlink; see acceptance report. 0.1.7-alpha.2 · Yes (Bridge 0.3.10 source) · Yes (Bridge 0.3.10 source) · Official npm host with a locally packed Bridge source build: doctor 13/13, model-backed preview, text/Markdown round-trip, 640/800 px confirmation reachability, exact edited handoff, no target tool calls, auto-open and paused goal. This is source-build evidence, not a registry-install claim; see bounded acceptance. 0.1.7-rc.1 · Yes (Bridge 0.3.10) · Yes (Bridge 0.3.10) · Isolated official npm host: fresh-profile install; existing-session WebUI and doctor 13/13; one model-backed text/Markdown handoff to ptc with exact edited payload, auto-open, paused goal, no target tools and unchanged source; 640/800 px confirmation hit-tests. Uninstall/restart passed but a dangling CLI link remained. The host test skipped optional Office packages after registry errors; see bounded acceptance. 0.2.0-rc.2 · Yes (tested: Bridge 0.3.10; declared in 0.3.11) · Yes (same runtime) · Isolated official npm WebUI: doctor 13/13, real preview and text/Markdown edits, exact edited handoff, direct and waiting targets, auto-open, paused goals, image transfer/text fallback, live toggles and uninstall/restart. A dangling CLI link remains; optional components and native Desktop behavior are outside this run. See bounded acceptance. 0.2.1-alpha.1 · Yes (declared in Bridge 0.4.1) · Yes (unchanged 0.4.0 runtime) · Published Bridge 0.4.0 on an isolated official npm WebUI: doctor 13/13, rendered editing, exact 484-character edited handoff to PTC, auto-open, paused goal, and a real approved-plan click that starts a new standard session and writes/read-verifies an exact 18-byte fixture. Live disable/enable preserves other styles; uninstall/restart removes package and command but retains a dangling CLI link. See bounded acceptance. 0.2.1-alpha.2 · Yes (Bridge 0.4.2) · Yes (Bridge 0.4.2) · Official npm WebUI: fresh current-directory placement at preview/confirmation/plan approval, real worker startup, text/Markdown round-trip, exact 2,009-character edited handoff to PTC, auto-open, paused goal, and approved-plan write/read/byte verification in the switched directory. Co-installed Jot, live toggles, removal and restart checked. See bounded acceptance. 0.2.1-alpha.3 · Yes (Bridge 0.4.5 declaration) · Yes (unchanged runtime) · Official npm WebUI acceptance used a local 0.4.4 candidate with byte-identical business lib/: 37-second worker in directory A, confirmation in B, exact 2,669-character reviewed handoff once, auto-open, paused goal, no target tools, 375/768/1280 px controls, live toggles, same-business-byte removal/reinstall and same-home restart. The initial mixed-format summary required Text → Markdown fallback and an explicit formatting edit before Text round-trip. See bounded acceptance and release mapping; the historical candidate run does not establish a registry install of 0.4.5. 0.2.1-alpha.4 · Yes (Bridge 0.4.6) · Preview, Text/Markdown editing and automatic opening passed · Official npm Host with a local 0.4.6 package: 27-second worker, exact 2,883-character edited handoff, paused goal, one target turn and zero target tools; controls at 375/768/1280 px, style-preserving toggles and bounded restart persistence passed. Natural same-graph DSH removal tests isolated the pnpm 11.22.0 late-worker bug; upstream single-patch controls and unmodified 11.26.0 removed Bridge successfully. The historical operation is not a PASS. See the acceptance and attribution boundaries.

Bridge 0.4.2 adds ex