npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-cockpit-worktree-open-shim

v0.1.0

Published

Deployment-local adapter from dsh-cockpit-bridge remote editor opening to the Worktree Session open-handler registry

Readme

dsh-cockpit-worktree-open-shim

English · 简体中文

没有这个 shim 时,远程机器上 Worktree Session 的「在编辑器中打开」会退回只能指向本机的 vscode://file/ 链接,打不开那份 worktree。本 shim 把 worktree 路径交给 dsh-cockpit 的远程编辑器能力,让编辑器在正确的机器上打开。

部署侧专用适配器:把 dsh-cockpit-bridge 暴露的远程编辑器打开能力注册给 dsh-worktree-session 的通用打开行为扩展点。

dsh-cockpit-bridge ──provide──▶ shim ──register──▶ dsh-worktree-session
        不知道 ws                              不知道 cockpit

安装

与两端一起安装:dsh-cockpit-bridge >= 0.4.0(以 GitHub Release tarball 分发)和 dsh-worktree-session。

dsh plugin --profile web add https://github.com/prgrmrwy/dsh-cockpit/releases/download/dsh-cockpit-bridge-v0.6.4/dsh-cockpit-bridge-0.6.4.tgz
dsh plugin --profile web add dsh-cockpit-worktree-open-shim

然后重启 DSH web。卸载:dsh plugin --profile web remove dsh-cockpit-worktree-open-shim。

为什么独立成包

Worktree Session 是通用插件,不应知道 dsh-cockpit;dsh-cockpit-bridge 也不应知道具体消费方。两端的全部耦合只存在于本 shim,便于独立升级和彻底移除。

行为

  • 无顶层 inject,运行时监听两端服务出现/消失,支持任意加载顺序。
  • 以完整 dotted name ctx.get('cockpitBridge.editorOpen') 读取 bridge 服务,禁止 ctx.get('cockpitBridge').editorOpen。
  • 只把 worktree 绝对路径原样转交 bridge:不校验、不改写、不持状态、不重试。
  • 任一端缺失或卸载时不生效;Worktree Session 自动回落 vscode://file/ 默认行为。

前置条件与已知边界

  • 需要 dsh-cockpit-bridge >= 0.4.0(本仓当前 pin 0.6.4);旧版 bridge 不提供该服务,shim 会静默不生效。
  • 宿主机需要安装 VS Code Remote-SSH,并能用 Cockpit 设备登记的 SSH config alias 连接目标设备。
  • 未安装 Remote-SSH 时 URI 可能被静默丢弃;包含点号的目录名可能被 VS Code URI handler 判断为文件。

移除

本 shim 连接两端:dsh-cockpit-bridge 的 cockpitBridge.editorOpen 服务,与 dsh-worktree-session 的打开行为扩展点(worktreeSession.openHandler)。两端互不引用,shim 是两者唯一的交汇点。

随时都可以移除;当你不再使用 dsh-cockpit 远程编辑器,或任一端原生提供该集成时,就应当移除。从 dsh.yaml 删除或禁用 cockpit-worktree-open-shim,运行 dsh build 并重启 DSH web。移除后:

  • Worktree Session 恢复默认 vscode://file/ 行为;
  • dsh-cockpit-bridge 的会话已读确认、pending snapshot 等既有功能不受影响;
  • 两端无需任何源码或配置迁移。

来源与许可证

源码在 ohmydsh 的 packages/cockpit-worktree-open-shim 中持续维护,dsh-cockpit-worktree-open-shim 是发布镜像。以 MIT 许可证 发布,欢迎到 https://github.com/prgrmrwy/dsh-cockpit-worktree-open-shim/issues 提 issue 或 PR。