heartmove/dsh-session-bridge

DSH 插件,让当前代理直接从提示词驱动其它真实 DSH 会话——创建/发送/等待回复/读取/恢复/跨工作区查找会话,并支持监控调度主任务与归档会话。A DSH plugin that lets the agent drive other real DSH sessions straight from a prompt — create, send, wait, read, resume, and find sessions across workspaces, plus monitor/schedule a main task and archive sessions.

Project Overview项目介绍

dsh-session-bridge is a native DSH (DeepSeek Harness) plugin that only loads on DSH versions ≥ 0.1.7-0 and has been regression-tested against the 0.2.0-rc.1 release. It exposes a tool family that lets the current agent drive other real DSH sessions directly from a prompt: create a main session in the current workspace or in a sibling workspace via workspaceId / cwd, queue a turn or inject steering, wait for the next reply or the next completed assistant step, page historical events with sinceSeq, and resume an offline session back online. Wait-style tools never throw on timeout or abort; they return a timedOut, aborted, or stale flag and all tools emit lossless JSON suitable for programmatic chaining.

A typical workflow starts with session_bridge_create to obtain a sinceSeq anchor, continues with session_bridge_send to append a turn, and then uses session_bridge_wait or session_bridge_segments to observe the running agent paragraph by paragraph, including streamed chain-of-thought and requested tool calls. Around that core loop, session_bridge_status reports live progress, open turn, time since the last event for stall detection, and pending work, while session_bridge_monitor_start launches a background watchdog that polls, nudges, corrects, terminates, and wraps up the main task and can be steered by chain-of-thought coRules such as "cancel when reasoning does not contain I'm". Archive behaviour mirrors the DSH sidebar: session_bridge_archive hides a session from every grouping surface while preserving history and position, refuses an active target unless stopActivity:true is passed, and unarchive / archived round-trip the archive set.

The plugin is aimed at developers and operators who need multi-session orchestration, watchdog scheduling, and selective archiving inside one DSH workspace. It is installed as a regular DSH bundle via the plugin entry src/index.ts, and the repository ships npm run check:compat to type-check src/ against the installed DSH plus a smoke-bundle script that mounts lib/index.js and asserts every tool registers, alongside npm test regression suites for wait/stall and archive handlers. One caveat is session lifetime ownership: agents spawned by session_bridge_create belong to the plugin fiber, so unloading or hot-reloading the plugin stops their live agents and leaves them offline until session_bridge_resume is called; monitor watchdogs also stop on unload. The project is released under the MIT license.

dsh-session-bridge 是 DSH(DeepSeek Harness)官方生态的原生插件,仅在 DSH 0.1.7-0 及以上版本中加载,并在 0.2.0-rc.1 上完成回归验证。它通过工具调用让当前代理直接驱动同一工作区或跨工作区的真实 DSH 会话,覆盖创建会话、注入排队消息或运行时转向、按 seq 锚点等待回复或段落、读取并分页历史以及恢复离线会话等能力,所有等待型工具在超时或中止时仅返回 timedOut / aborted / stale 标志而不抛错,并以无损 JSON 输出。

其典型流程是:先调用 session_bridge_create 拿到 sinceSeq 锚点,再用 session_bridge_send 追加轮次,最后用 session_bridge_wait 或 session_bridge_segments 按段落观察长链路代理的推理与工具调用结果;同时 session_bridge_status 提供实时进度,session_bridge_monitor_start 启动后台看门狗循环,配置 coRules 后可在停滞或偏离时自动催办、改向或终止,并通过 session_bridge_archive / unarchive / archived 与 DSH 侧边栏的归档行为完全对齐。该插件适合需要在 DSH 内编排多会话编排、看门狗调度和会话归档的开发与运维人员。

依赖方面仅需 DSH 主程序即可挂载,仓库自带 npm run check:compat 类型校验与 smoke 冒烟脚本用于验证打包兼容;由插件 fiber 持有的会话在卸载或热重载时会被一并停止并以离线状态保留,可通过 session_bridge_resume 恢复;项目以 MIT 协议开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:heartmove/dsh-session-bridge

把 heartmove/dsh-session-bridge 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-session-bridge — 会话桥 (Session bridge)

Targets DSH 0.1.7-0 and later: the peer range declares a floor only (>=0.1.7-0), never a ceiling; verified against 0.2.0-rc.2. See compatibility changes and AGENTS.md (the version policy is a hard rule, guarded by pnpm test).

A DSH plugin that lets the current agent drive other real DSH sessions directly from a prompt — create sessions, send messages to any session, wait for and read replies, resume offline sessions, and find sessions across workspaces. On top of that it can monitor and schedule a main task (watch its progress, nudge or correct its direction, and stop it), and archive sessions the same way the DSH sidebar's Archive action does.

中文文档见 README.zh.md.

What it does

  • Create real DSH sessions. session_bridge_create makes a new main session (top-level UI session) in the current workspace, or in another workspace when you pass workspaceId / cwd. It can send one first prompt and optionally block until the first reply. Provider / model / reasoning effort are inherited from the calling session by default. An async create (no waitForReply) returns a sinceSeq anchor for a later precise wait.
  • Send messages to any session. session_bridge_send appends a turn (mode=queue) or injects steering into the running step (mode=steer), and can optionally wait for the next reply. An async send also returns a sinceSeq anchor.
  • Wait for a reply or a segment. session_bridge_wait blocks until new assistant output appears after sinceSeq (default: the latest event seq at call time): waitFor=reply (default) returns as soon as a new text reply is readable; waitFor=segment returns as soon as any new completed output step appears (an assistant/message — text, reasoning, or tool-call turn), without waiting for the whole turn, so you can observe output paragraph by paragraph as it is produced. With requireTurnEnd it additionally waits for the turn to settle. Timeout / abort return the partial result rather than throwing. An already-landed reply is never lost: when no new output arrives within the budget, the latest PRE-EXISTING reply/segment is returned with stale: true (no more (no text)). To retrieve exactly "the reply to what I sent", pass the sinceSeq returned by session_bridge_send / session_bridge_create (works regardless of caller latency); sinceSeq: -1 counts existing events too, i.e. the anchor for a brand-new session.
  • Read any session. session_bridge_read folds a session's event log into readable rows — live or offline (from persistence) — with sinceSeq paging, role filtering, and a limit (default 20, max 100).
  • Read output paragraph by paragraph. session_bridge_segments returns the session's completed output segments — every finished assistant step (one assistant/message: its text, reasoning, and requested tool calls) as its own row, paged forward via sinceSeq, returning the next cursor. It works live or offline and does not wait for the whole turn, so you can follow a long agentic run step by step (chain-of-thought included when the model streams it).
  • Resume offline sessions. session_bridge_resume brings a persisted session back online (idempotent); it can also override provider / model.
  • Find sessions. session_bridge_find matches by title, id, workspace, or directory across all workspaces, returning live/running state, title, and working directory. Bridge-registered titles act as aliases.
  • Monitor and schedule a main task. session_bridge_status reads a session's real-time progress (running/idle, open turn, time since the last event for stall detection, pending work, latest reply); only a running session is flagged [STALLED] (a quiet idle session is not stuck — same rule as the watchdog). session_bridge_cancel stops a running session. session_bridge_monitor_start runs a background watchdog loop that polls the task, nudges it when it stalls, corrects it when it drifts, terminates it after it stays stuck, and wraps up when it finishes.
  • Archive / unarchive sessions. session_bridge_archive adds a session to the DSH workspace archive set (hidden from every grouping surface, history and workspace position preserved); an active target is refused unless stopActivity: true is passed, which archives first and then stops its running work (turn, subagents, jobs, schedules) through the official path. session_bridge_unarchive drops it from the archive set so it reappears at its recorded position. session_bridge_archived lists the archive set, optionally resolving titles; a session whose title cannot be resolved is listed without one instead of failing the whole call. The archive set grows without bound, so archive/unarchive results report the affected id plus the archive size and summarize the newest ids, and session_bridge_archived windows the listing with an optional limit (default 50, newest first) while total always reports the real size.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dshmath-manim 下一个 Next dsh-tweaks →