dshbase

插件目录 / UI & Skins / dsh-pi-extension-bridge

dsh-pi-extension-bridge

已验证 · 实测可装 Dwsy

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-17最近推送
跨平台平台

功能简介

TypeScript compatibility bridge for running Pi Coding Agent extensions and terminal UI inside DeepSeek DSH.

✅
我们的评价
可用 — 实测通过,早期项目

TypeScript compatibility bridge for running Pi Coding Agent extensions and terminal UI inside DeepSeek DSH. 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-pi-extension-bridge

English | 简体中文

A TypeScript compatibility bridge that adapts Pi Coding Agent extensions to DeepSeek DSH, including extension resources, tools, commands, lifecycle hooks, and Pi-style terminal UI rendering in the DSH Web client.

This project is an integration bridge, not a reimplementation of Pi or DSH. It prefers native host capabilities, maps semantics only where the correspondence is reliable, and fails explicitly when a lossless mapping is unavailable.

Highlights

  • TypeScript-first source tree — src/ is authoritative; lib/index.js and lib/client.js are generated runtime bundles.
  • Modular Host architecture — runtime/session adaptation, lifecycle hooks, resources/tools, message conversion, Typert protocol, UI registry, and terminal surface rendering are separated by responsibility.
  • Pi extension loading — uses Pi's loader/runtime rather than maintaining a handwritten extension list.
  • DSH-native integration — bridges scoped tools, commands, skills, prompt resources, model/thinking state, and lifecycle events without replacing DSH-native ownership where DSH already has the capability.
  • Web terminal UI bridge — preserves ANSI frames, terminal-column width, overlays, custom TUI input, WTerm rendering, and Pi cursor metadata.
  • Host-plane UI transport — the global Web Host owns the piExtensionUi Typert routes while Pi tools/commands stay session-scoped; revision-driven waitRevision() wakeups avoid recurring snapshot polling while the UI is static.
  • Tool renderer bridge — Pi custom renderCall / renderResult output can render inside DSH tool views.
  • Isolated regression workflow — Web validation is designed to run on a separate port without restarting the user's active DSH process.

Requirements

  • Node.js 22+ (development has been validated with Node.js 24)
  • DSH with the Web client/runtime services used by this bridge
  • Pi Coding Agent installation/resources available to the Host

The bridge currently contains environment-oriented defaults for local Pi/DSH roots. Override them through bridge configuration when your installation paths differ.

Install for local DSH development

This repository is currently intended for local DSH plugin development rather than npm publication.

npm install
npm run typecheck
npm run build

The package keeps the runtime export contract:

  • . → lib/index.js (Host)
  • ./client → lib/client.js (Web Client)

Mount the package through your DSH/Cordis configuration or scoped preset. The current development setup intentionally keeps the bridge scoped to Pi-style sessions rather than globally changing every DSH session.

Development

# TypeScript correctness gate
npm run typecheck

# Build Host + Client bundles
npm run build

# Build one side only
npm run build:host
npm run build:client

# Syntax-check generated artifacts
node --check lib/index.js
node --check lib/client.js

Do not edit generated files under lib/ directly. Make changes under src/, then rebuild.

Architecture

Host composition is intentionally small; the large responsibilities live in dedicated modules:

Module Responsibility
src/host/index.ts Plugin composition, Host service registration, bridge assembly
src/host/runtime-bridge.ts Pi runtime actions, model/thinking/session adaptation
src/host/ui-surface.ts Terminal surfaces, overlays, ANSI/cursor projection, input routing
src/host/lifecycle.ts Pi lifecycle hooks, prompt and command integration
src/host/resources.ts Extension loading, resources, skills, tools and command adapters
src/host/messages.ts DSH ↔ Pi message/replay conversion
src/host/ui-protocol.ts piExtensionUi Typert wire descriptors
src/host/ui-registry.ts Per-session UI bridge registry
src/host/config.ts Configuration normalization
src/client/index.ts DSH Client module composition and slot registration
src/client/terminal-layout.ts Terminal metrics and overlay geometry
src/client/types.ts Snapshot/frame types
src/client/errors.ts Remote envelope and error decoding

See Architecture for the data flow and compatibility boundaries.

Pi UI contract

The browser side treats Pi UI output as terminal frames, not ordinary text:

  • ANSI is preserved for WTerm; stripped lines are fallback/debug representation only.
  • Width is measured in terminal columns using the actual browser monospace font metrics.
  • Pi cursor markers are converted into cursor row/column metadata for hardware cursor and IME positioning.
  • Focused custom components and overlays receive input before global extension shortcuts.
  • Static UI produces no recurring /snapshot traffic; revision changes wake the Client and trigger the next snapshot fetch.

Compatibility and limitations

The project aims for explicit compatibility rather than pretending every Pi API has an exact DSH equivalent. Current implementation notes and historical validation evidence live in:

Some host-owned capabilities can only be partially mapped when DSH does not expose an equivalent public primitive. Those cases should remain explicit boundaries instead of being emulated with unsafe global state.

Regression testing

Never restart or replace a user's active DSH Web/TUI process just to test this bridge. Use an isolated port:

dsh --profile web --port 3081

At minimum, validate typecheck/build, generated bundle syntax, Web startup, ANSI styling, custom TUI input, cursor/IME positioning, overlay sizing, and extension shortcut routing.

Repository status

The TypeScript modularization is complete: the former monolithic Host source has been split by responsibility, the Host entry is now composition-oriented, the Client is TypeScript-based, and the current build/typecheck gates pass. STATE.md is the detailed engineering handoff record.

Contributing

Keep dependency direction simple: leaf protocol/config/conversion modules should not import the composition entry. Prefer a cohesive module over version-suffixed scratch files. Before submitting changes, run:

npm run typecheck && npm run build
node --check lib/index.js
node --check lib/client.js

License

No open-source license has been added yet. Public source visibility does not by itself grant reuse rights; add an explicit license if you want to permit redistribution or modification.

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-pi-extension-bridge」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:Dwsy/dsh-pi-extension-bridge

Headless(CLI)profile:

dsh plugin --profile headless add github:Dwsy/dsh-pi-extension-bridge

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

UI & Skins 里更多

浏览全部 7819 个插件 →