DeepSHPlugins
dsh-artifact 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-artifact

Agent 與自動化TypeScriptBSD-3-Clause

dsh 外掛:檔案交付協議——send_artifact 工具經 tool/result meta 攜帶結構化描述子,任意客戶端可渲染

1 Starswilliam-jin-cmu 更新時間 2026-08-13
訪問 GitHub 倉庫
dsh-artifact 專案預覽

專案介紹

中文

dsh 外掛:檔案交付協議——send_artifact 工具經 tool/result meta 攜帶結構化描述子,任意客戶端可渲染

English

File-delivery protocol plugin: the send_artifact tool carries structured descriptors via tool/result meta that any client can render.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
william-jin-cmu
倉庫
william-jin-cmu/dsh-artifact
GitHub Stars
1
Forks
0
開發語言
TypeScript
許可證
BSD-3-Clause
最近推送
2026-08-13
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

51/ 100
維護活躍
80
文件與實用資訊
85
生態關注度
9
安裝便捷訊號
80
專案宣告訊號
100

README 含完整安裝與使用說明;關注度尚低(1)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

git clone https://github.com/william-jin-cmu/dsh-artifact.git

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-artifact

dsh 的文件交付协议。模型写完文件 ≠ 用户拿到文件——本插件补上这最后一步。

注册一个 send_artifact(path, caption?) 工具:模型产出文件后调用它正式交付。插件校验文件、构造结构化描述子,随 tool/result 事件的 meta 字段进入 dsh 标准事件流——任何消费 events.mux 的客户端都能拿到并按自己的方式呈现:桌面壳弹预览卡片、IM 桥直接转发文件、headless 客户端记录路径。不引入任何自定义传输通道。

模型: (写完 report.md)→ send_artifact(path="/work/report.md", caption="周报")
     ← "Delivered report.md (markdown, 4096 bytes) to the user."
客户端: 在 tool/result 的 meta 里收到 ↓ 并渲染

描述子(meta 形状)

{
  "kind": "artifact",
  "artifactKind": "markdown",
  "path": "/work/report.md",
  "name": "report.md",
  "mimeType": "text/markdown",
  "caption": "周报",
  "sizeBytes": 4096
}

artifactKind: image | video | audio | pdf | markdown | html | text | other(按扩展名分类,未知类型安全回退 other)。

同时注入一段 system prompt,教模型"产出文件后调用 send_artifact 交付;只写盘不交付用户看不到;终稿交付一次,不发中间产物"。

安装

原生挂载(默认)——dsh 主程序自带 ~/.dsh/config.yaml 个人覆盖层,三步完成,不依赖任何第三方管理器:

# 1) 取码(放哪都行)
git clone https://github.com/dsh-external/dsh-artifact ~/dsh-plugins/dsh-artifact
# 2) 链接宿主依赖(pnpm 布局下必需,背景见 marisa#2)
CHECKOUT="$(cd "$(dirname "$(readlink -f "$(command -v dsh)")")/../../.." && pwd)"
mkdir -p ~/dsh-plugins/dsh-artifact/node_modules/@deepseek-ai
ln -sfn "$CHECKOUT/packages/core/tools" ~/dsh-plugins/dsh-artifact/node_modules/@deepseek-ai/dsh-tools
# 3) 挂载并重启 dsh
cat >> ~/.dsh/config.yaml <<EOF
- insert:
    - id: dsh-artifact
      name: '$HOME/dsh-plugins/dsh-artifact/lib/index.js'
EOF

用 DSH Companion 的话零安装——已随应用自带。

可选:经插件管理器安装(Marisa / plugin-registry)

dshx install dsh-artifact https://github.com/dsh-external/dsh-artifact && dshx verify dsh-artifact

或 dsh registry install ./dsh-artifact && dsh registry enable dsh-artifact。注意 marisa#2 修复前,装完仍需按上面第 2 步手工链接宿主依赖。

客户端接入指南

监听 mux 流的 session/event,事件 type == "tool/result" 且(经 tool/call 配对得到的)工具名为 send_artifact 时,event.data.meta 即上述描述子。kind: "artifact" 是判别字段。

开发

./scripts/build.sh                 # 用 dsh 检出的 tsc 编译(产物入库)
<dsh-checkout>/node_modules/.bin/vitest run --root .   # 4 个 spec:真实 Cordis 组合

License

BSD-3-Clause

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案