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-lan-share

v0.1.1

Published

LAN sharing for DeepSeek Harness: discover other DSH devices on the local network, send text and files to a chosen device, receive text/files with accept-or-ask policy, and watch transfer progress — all from a 局域网服务 tab in the right sidebar. 局域网共享插件:发现同网段

Readme

dsh-lan-share(局域网共享)

在同一个局域网内的 DeepSeek Harness 设备之间收发文字和文件 —— 从右侧边栏的 局域网服务 标签页操作,也可以直接让 agent 帮你发。

English: README.md

功能

  • 发现同网段设备:UDP 组播 + 广播;对屏蔽广播的网络提供 手动添加设备(填对方 IP)。
  • 重命名:改自己的名字(整个局域网看到的名字),或给别人的设备起一个本机别名。
  • 指定某台设备发送文字或文件。
  • 接收文字与文件,文件落到你指定的目录(DSH 的工作目录,或你设置的路径)。
  • 接收策略:全部默认接收总开关 + 未知设备兜底策略 + 单设备覆盖;另有自动接收的 大小上限与扩展名白名单,决定哪些文件可以免询问。
  • 接收提醒:标签页上的未读数、需要确认时的全页面提示、带本地路径的接收记录。
  • 收发进度:字节数、速率、剩余时间、取消。
  • 断点续传:连接中断后从接收端实际保留的字节继续。
  • 可见性开关:可以让自己对局域网完全不可见,也可以要求共享口令才能连接。
  • 7 个模型工具(lan_share_devices / lan_share_send_text / lan_share_send_file / lan_share_inbox / lan_share_respond / lan_share_rename_device / lan_share_settings),上面每件事 agent 都能做。

安装

dsh plugin --profile web add dsh-lan-share

DSH Desktop 使用 web profile;安装后必须重启桌面应用,Host 半只在启动时加载。

如果 dsh 不在 PATH 上,用桌面应用自带的:

$app = "<安装目录>\DSH Desktop\resources\app"
node "$app\node_modules\@deepseek-ai\dsh\lib\bin.js" plugin --profile web add dsh-lan-share

校验安装

  1. profiles\web\package.json 的 dependencies 与 dsh.profile.bundles 里都有 dsh-lan-share;
  2. profiles\web\node_modules\dsh-lan-share\lib\ 下有 index.js 与 client.js;
  3. 重启后,右侧边栏的「添加标签页」列表里出现 局域网服务。

在其他机器上安装

局域网插件要每台机器各装一次 —— 它不是"装一台,全网络可用"。两条路:

一、打包分发(不需要 npm、不需要目标机联网编译)

在开发机上:

npm run check      # 确保产物是最新的,并过三道发布闸
npm pack           # 产出 dsh-lan-share-<版本>.tgz

把 .tgz 拷到目标机(U 盘、scp、或者就用本插件自己发过去),然后在目标机上:

# 桌面应用自带的 dsh;DSH Desktop 用的是 web profile
$app = "<安装目录>\DSH Desktop\resources\app"
& "$app\node_modules\node\bin\node.exe" "$app\node_modules\@deepseek-ai\dsh\lib\bin.js" `
    plugin --profile web add "C:\path\to\dsh-lan-share-0.1.0.tgz"

然后完全退出并重启目标机的 harness(桌面应用走托盘 → 退出;dsh web 走 Ctrl+C 重跑)。

lib/ 已经从开发机打包进来了,目标机不需要 Node 工具链、不需要 npm install、不联网。 .tgz 里没有 src/、没有 devDependencies。

二、发布到 npm

npm publish --access public

之后每台机器一条命令,不需要拷文件:

dsh plugin --profile web add dsh-lan-share

目标机上的验证

# 1) 清单
Select-String dsh-lan-share "$env:APPDATA\dsh-desktop\harness\profiles\web\package.json"

# 2) 半成品是否自带
Test-Path "$env:APPDATA\dsh-desktop\harness\profiles\web\node_modules\dsh-lan-share\lib\client.js"

# 3) LAN 面(不需要登录,端口看启动日志或面板顶部)
curl.exe -s "http://127.0.0.1:48901/lan-share/v1/info"

# 4) 面板面:不带 cookie 必须 401,带 cookie 必须 200
curl.exe -s -o NUL -w '%{http_code}' "http://127.0.0.1:43129/lan-share/api/state"

第 4 条的 401/200 这一对是唯一能廉价证明守门真的在工作的方式,每次部署都值得跑一遍。

两条容易踩的时序

  • 面板路由比监听端口晚几拍才注册。 刚 listening 时探测 /lan-share/api/state 会得到 404,等一两秒才是 401。别据此判断插件没装。
  • 客户端 bundle 的启动图在 harness 启动时扫描一次。 装完(或装完后重新构建过 lib/client.js)必须重启那个 harness,否则页面拿到的还是旧图 —— Host 半会热挂载, 浏览器半不会。

使用

打开标签页,或直接让 agent 发送。

  1. 同一网段时不需要任何配置,几秒内两台设备会互相发现。发现不到时用 手动添加设备 填对方 IP —— 很多访客 Wi-Fi 与管理型交换机会丢弃组播。
  2. 可信网络下把 共享口令 留空;或者两端设成同一个口令。设了口令后,不知道口令的 设备完全连不上。
  3. 发送:选设备 → 发文字 或 发文件。文件框填的是本机绝对路径 —— 浏览器拿不到文件选择器的真实路径,所以面板能发出去的就是这个路径。
  4. 接收:默认策略下,在对方确认之前不会有任何字节传输。打开 全部默认接收 可以免询问; 单台设备的策略选择器优先级更高。

文件保存位置

设置页在「当前工作区目录」(DSH 进程工作目录,或你填的路径)与「指定目录」之间切换。 面板顶部始终显示解析后的绝对路径,不需要猜文件去了哪里。未完成的续传分片保存在 <保存目录>/.dsh-lan-share-incoming,文件收完后自动清掉。

端口与防火墙

| 端口 | 协议 | 用途 | | --- | --- | --- | | 48900 | UDP | 信标:组播到 239.255.77.88,并额外广播到 255.255.255.255 | | 48901 | TCP | 传输面,绑定 0.0.0.0 |

两者都可以在 profile 的补丁行里改:

- insert:
    - id: lan-share
      name: 'dsh-lan-share'
      config:
        discoveryPort: 48900
        transferPort: 48901
        multicastGroup: '239.255.77.88'
        checksumMaxBytes: 268435456
        maxConcurrentInbound: 4
        registerTools: true

端口被占用时(比如本机开了第二个实例)插件会改用系统分配的端口,在面板上明确说明, 手动添加设备 依然可用。

传输面不是 DSH 的 Web 服务。 Web 服务只监听回环、靠浏览器 Cookie 守门;本插件自己 在 0.0.0.0 上起监听,好让同网段的设备连得上,并用握手签发的 Bearer 令牌守门。 面板走的是 DSH Web 服务的同源路由,由宿主自己的信任栅栏守门。

安全模型

  • 信标是未认证的广播,只能让一台设备「出现」,不能授权任何操作。
  • 每个数据请求都带令牌,证明对方完成过握手。设了 共享口令 就必须知道口令, 而且改口令会让已经签发的令牌全部失效。
  • 发送方名字取自接收端自己的设备表,不取自请求体 —— 一台设备无法冒用另一台的名义。
  • 文件名会被规整成单个路径段,落盘前再用保存目录复核解析后的路径。
  • 可执行文件默认拒绝(exe, bat, cmd, com, scr, msi, ps1, vbs, js, jar), 与策略无关。
  • 只有声明的大小(以及对方给出的校验值)核对通过后,文件才会被改名放进保存目录。

不设口令就是「同网段任何装了本插件的设备都能给你发文件」。家用网络这样最省事, 不可信网络请设口令。

开发

npm install
npm test                  # tsc + tests/*.ts
npm run build             # Host 半 → lib/,浏览器半 → lib/client.js
npm run typecheck
npm run check             # 测试 + 构建 + 两道发布闸

测试没有框架:tests/ 下每个文件都是普通 Node 脚本,打印 N/M checks passed。 覆盖五层 —— 纯规则、两个真节点走回环套接字、UDP 发现、完整服务双实例、 面板路由守门。改代码之前值得先看 AGENTS.md 里记的平台结论。

许可

MIT