Skip to content

dsh-bookmark

Verified

@feiertu/dsh-bookmark · v0.1.0 · MIT

Link/bookmark stash for DeepSeek Harness: save and search links, usable by both the agent and the user.

Install

dsh plugin add @feiertu/dsh-bookmark

Confirm the layer applied with dsh --profile default --dump-config — see the install guide.

Source

Published to npm without a public repository. Inspect the package contents before installing.

Creators

Readme

dsh-bookmark

一个最小可运行的 DSH 资源整合类插件骨架:把散落的链接/书签/收藏存起来,让 agent 和用户都能用

它演示了什么

机制 用途
ctx.tools.register(defineTool(...)) 给 agent 暴露 save_link / list_links 两个工具
ctx.storageDomain + defineDomain/domainTable + zod 持久化、schema 校验的键值存储,重启不丢,不污染会话记录
dsh.bundle.patch + cordis.patch.yml 以 patch 层方式注入 profile,不侵入核心

本地安装(发布前验证)

本地开发建议用 tarball 方式安装,而不是 add ./dsh-bookmark

  • add ./dsh-bookmark 会被 pnpm 装成 link:(symlink 到源码目录),此时插件内部的 @deepseek-ai/dsh-tools 等 peer 依赖会从源码物理路径向上解析,找不到 profile 的 fallback,启动时报 ERR_MODULE_NOT_FOUND
  • tarball / registry 安装是 copy 语义,模块位于 profile 的 node_modules 内,peer 依赖通过 $DSH_HOME/profiles/node_modules 的 flat fallback 正常解析。
# 1. 打包
cd dsh-bookmark
pnpm pack --pack-destination ..

# 2. 安装 tarball
dsh plugin --profile headless add ./dsh-bookmark-0.1.0.tgz
# 注意:Windows 下不要用 `file:` 前缀 + 盘符路径(会被 pnpm 当相对路径)。

# 3. 确认插件进入了配置树
dsh --profile headless --dump-config
# 期望看到 id 为 bookmark、name 为 dsh-bookmark 的行。

# 4. 真实任务验证(需要已配置模型凭证)
dsh --profile headless "帮我把 https://example.com 收藏一下,标题写 Example"
dsh --profile headless "我收藏了哪些链接?"

⚠️ headless profile 默认不含 storage 服务(storage 三件套在 dsh-web-app 里)。要在 headless 里用本插件,需先在其 cordis.patch.yml 里补:

- insert:
    - id: storage
      name: '@deepseek-ai/dsh-storage'
    - id: storage-json
      name: '@deepseek-ai/dsh-storage-json'
      config:
        root: !!js dshHomePath('storages')
    - id: storage-domain
      name: '@deepseek-ai/dsh-storage-domain'
      config:
        backend: json

web profile 自带 storage 栈,无需补。装到 web profile 后需重启 dsh web 才会加载。

发布

npm login
# 建议先改名成你的 scope,例如 @yourname/dsh-bookmark,并同步修改 cordis.patch.yml 里的 name
npm publish --access public

别人安装:

dsh plugin --profile web add @yourname/dsh-bookmark

从骨架扩展成完整插件

  1. 给用户用:加一个 dsh-client-ui-* 前端面板,在 Web 里浏览/管理收藏。
  2. 给 agent 用得更强:把 list_links 的"子串过滤"升级成语义检索(embedding 索引)。
  3. 多数据源聚合:新增表或工具,把 RSS、网页、笔记接进同一个 stash。
  4. 配置化:加 schemastery Config,让用户在设置面板里配后端、每页条数等。

⚠️ 外部资源改动需手动

资源整合类插件要操作外部资源(浏览器书签、第三方账号数据等)时,写操作不能安全地由插件/脚本直接执行,必须手动。以整理浏览器书签为例:

  • checksum 校验:Chrome/Edge 的 Bookmarks 文件带 MD5 checksum,现代 Chromium 改过算法、无法简单重算;校验不通过时浏览器会用 Bookmarks.bak 回滚,直接改文件会丢失改动。
  • 运行中覆盖:浏览器运行时会把内存书签写回磁盘,直接改文件会在退出时被覆盖。

正确做法:先备份原文件 → 生成标准的 Netscape HTML 书签文件(或分类方案)→ 用户手动导入 → 核对后手动清理旧书签。