dsh-plugin
DayuanJiang/next-ai-draw-iodsh 的 draw.io 绘图插件:通过 next-ai-drawio MCP 服务器作图,点回复里的链接在右侧栏打开实时预览,可以手动修改图,AI 的每次修改都是可以恢复的版本。需 Node.js 18+,首次使用由 npx 下载 MCP 服务器。
提供 bili_summary 工具:B 站视频元数据、字幕时间轴与 sharp 切帧配图,内置错误处理与优雅降级。
DeepSeek Harness Host plugin: registers the model tool
bili_summary— a single call fetches a Bilibili video's metadata, subtitle timeline and optional image material (sharp frame extraction), letting the Agent produce structured summary notes with time-stamped jump links.DeepSeek Harness Host 插件:注册模型工具
bili_summary,一次调用取回 B 站视频的元数据、字幕时间轴与可选配图素材(sharp 切帧),供 Agent 生成带时间点跳转链接的结构化总结笔记。
中文 · ← Back to DeepSeekHarnessPlugins
video input accepts BV IDs, bilibili.com/video/ links and b23.tv short links (redirect auto-resolved)read in segmentspage parameter switches parts, each part has its own cid; out-of-range returns the total part countThis repo is also an installable dsh plugin package (package.json declares dsh.bundle, cordis.patch.yml declares the insertion row):
dsh plugin --profile web add github:YZz-S/dsh-bili-summary
After installation, start with dsh --profile web and the bili_summary tool mounts automatically; headless users switch the profile to headless. Notes:
dsh plugin forwards to pnpm internally (pnpm must be installed first); the profile is initialized automatically on first run;cordis.patch.yml under the row id bili-summary.${DSH_HOME}/.agent-presets/<id>/, composition file agent.cordis.yml).bili-summary.js into the preset directory and add a row to the composition:- id: tool-bili-summary
name: ./bili-summary.js
config:
outputDir: bili-output
(A full example is in examples/cordis.row.yml; this row only registers the tool in the host tools registry and publishes no services, so no isolate realm is needed.)
npm install inside the plugin directory tree. It works without it — automatically degrading to "cover-only images" and stating so in the result.standingKeyFor(<preset-id>), then open a new session and confirm bili_summary appears in the tool list.| Parameter | Type | Description |
|---|---|---|
video | string (required) | Bilibili link (b23.tv short link, bilibili.com/video/ link) or BV ID |
withImages | boolean | Default false (plain text); pass true only when the user explicitly asks for "with images" |
page | number | Part number of multi-part videos (default 1) |
maxFrames | number | Max frames to extract in image mode (1–48, default 12) |
refresh | boolean | Re-fetch ignoring the disk cache (default false) |
config)| Field | Default | Description |
|---|---|---|
outputDir | bili-output | Output root: images/<safe-title>_<bvid>/, cache/<bvid>/ (meta.json / subtitle.json / subtitle.srt) |
cookie | empty | SESSDATA=...; bili_jct=.... Use when risk control (-412) or login (-352) triggers; used only in request headers, never written to logs or results |
userAgent | built-in browser UA | Overrides the default UA |
timeoutMs | 15000 | Per-HTTP timeout |
retries | 2 | Retry count for network failures / 5xx / risk control (exponential backoff) |
maxFrames | 12 | Max frames in image mode |
chapterIntervalSec | 180 | Chapter granularity (snaps to the nearest subtitle start when subtitles exist) |
inlineSubtitleLimit | 10000 | Max characters of inlined subtitles returned |
redirect_url), live streams and interactive videos are explicitly unsupported (structured error instead of blind attempts)view/player/v2 endpoints without WBI signing; if Bilibili tightens this, subtitles degrade to "no subtitle" with an explanationoutputDir with process-level Node fs (bypassing the session file sandbox) — treat the preset mounting it as trustedweb service has no fetch providernpm test # or node test/sanity.mjs
No network or dependencies required. Covers input parsing, sprite-frame extraction math regression (multi-sprite Y-coordinate bug), file-name sanitization, SRT formatting, frame-selection dedup and chapter snapping.
sharp version requirement: ≥ 0.35.3 (bundled libvips 8.18.3). sharp < 0.35.0 ships a libvips with CVE-2026-33327 / CVE-2026-33328 / CVE-2026-35590 / CVE-2026-35591 (triggerable by maliciously crafted images; two of them are HIGH on the CVSSv4 scale). This plugin only decodes Bilibili CDN covers and snapshot images, so the real exposure is limited — but upgrading is side-effect-free, so always stay current.
Node requirement: sharp 0.35+ requires Node ≥ 20.9.0; this package's engines is in sync.
Optional hardening (standalone usage): to shrink the decode surface further, restrict decoders at plugin init:
sharp.block({ operation: ['VipsForeignLoadNsgif', 'VipsForeignLoadTiff', 'VipsForeignLoadVips'] })
Note sharp.block is a process-wide global: if the process is shared with other programs that handle GIF/TIFF (e.g. other plugins inside the dsh harness), do not enable it, to avoid affecting them.
Depends on Bilibili unofficial interfaces; for personal study and note-taking only. Please follow Bilibili's user agreement, control request frequency, and do not use for commercial scraping; screenshots and subtitles are for personal use only; summaries should be general content rather than large verbatim copies.
Description: DeepSeek Harness Host plugin: bili_summary tool — Bilibili video metadata, subtitle timeline and sharp frame extraction, with built-in error handling and degradation, cross-platform pure Node implementation
Topics: bilibili bilibili-api deepseek-harness cordis ai-agents llm-tools video-summary subtitle sharp markdown nodejs
MIT (see LICENSE).
English · ← 返回 DeepSeekHarnessPlugins
DeepSeek Harness Host 插件:注册模型工具
bili_summary,一次调用取回 B 站视频的元数据、字幕时间轴与可选配图素材(sharp 切帧),供 Agent 生成带时间点跳转链接的结构化总结笔记。
video 输入支持 BV 号、bilibili.com/video/ 链接与 b23.tv 短链(自动解析跳转)read 分段阅读page 参数切换分P,每 P 独立 cid;越界给出总 P 数本仓库同时是可安装的 dsh 插件包(package.json 声明 dsh.bundle,cordis.patch.yml 声明插入行):
dsh plugin --profile web add github:YZz-S/dsh-bili-summary
安装后以 dsh --profile web 启动即自动挂载 bili_summary 工具;headless 用户把 profile 换成 headless。注意:
dsh plugin 内部转发给 pnpm(需先装 pnpm),首次会自动初始化 profile;cordis.patch.yml 中按行 id bili-summary 覆盖。${DSH_HOME}/.agent-presets/<id>/,组合文件 agent.cordis.yml)。bili-summary.js 放进 preset 目录,在组合里加一行:- id: tool-bili-summary
name: ./bili-summary.js
config:
outputDir: bili-output
(完整示例见 examples/cordis.row.yml;该行只向宿主 tools 注册表注册工具、不发布服务,不需要 isolate realm。)
npm install。不装也能用——自动降级为"仅封面配图"并在结果里说明。standingKeyFor(<preset-id>) 挂载校验,然后开新会话确认工具列表出现 bili_summary。| 参数 | 类型 | 说明 |
|---|---|---|
video | string(必填) | B 站链接(b23.tv 短链、bilibili.com/video/ 链接)或 BV 号 |
withImages | boolean | 默认 false(纯文字);仅当用户明确要求"带图"时传 true |
page | number | 多P视频分P序号(默认 1) |
maxFrames | number | 带图模式最多切帧数(1–48,默认 12) |
refresh | boolean | 忽略磁盘缓存重新抓取(默认 false) |
config)| 字段 | 默认 | 说明 |
|---|---|---|
outputDir | bili-output | 输出根目录:images/<安全标题>_<bvid>/、cache/<bvid>/(meta.json / subtitle.json / subtitle.srt) |
cookie | 空 | SESSDATA=...; bili_jct=...。风控(-412)/需登录(-352)时启用;仅用于请求头,绝不写入日志或结果 |
userAgent | 内置浏览器 UA | 覆盖默认 UA |
timeoutMs | 15000 | 单次 HTTP 超时 |
retries | 2 | 网络失败 / 5xx / 风控重试次数(指数退避) |
maxFrames | 12 | 带图模式最多切帧数 |
chapterIntervalSec | 180 | 章节划分粒度(有字幕时吸附到最近字幕起点) |
inlineSubtitleLimit | 10000 | 字幕内联返回字符上限 |
redirect_url)、直播、互动视频明确不支持(结构化报错而非瞎试)view/player/v2 遗留接口,未实现 WBI 签名;B 站收紧时字幕会降级为"无字幕"并说明outputDir(不经过会话文件沙箱)——挂载它的 preset 视为可信web 服务无 fetch providernpm test # 或 node test/sanity.mjs
无需网络与依赖。覆盖输入解析、精灵图切帧数学回归(多精灵图 Y 坐标 bug)、文件名清洗、SRT 格式、帧选择去重、章节吸附。
sharp 版本要求:≥ 0.35.3(内置 libvips 8.18.3)。< 0.35.0 的 sharp 自带 libvips 存在 CVE-2026-33327 / CVE-2026-33328 / CVE-2026-35590 / CVE-2026-35591(处理恶意构造的图片可触发, 其中两项 CVSSv4 为高危);本插件只解码 B 站 CDN 的封面与快照图,实际暴露面有限,但升级无副作用,务必保持最新。
Node 要求:sharp 0.35 起要求 Node ≥ 20.9.0,本包 engines 已同步。
可选加固(standalone 使用场景):如需进一步缩小解码面,可在插件初始化处限制解码器:
sharp.block({ operation: ['VipsForeignLoadNsgif', 'VipsForeignLoadTiff', 'VipsForeignLoadVips'] })
注意 sharp.block 是进程级全局生效:若与处理 GIF/TIFF 的其他程序共享进程(例如 DSH harness 内的其他插件),请勿启用,以免影响它们。
依赖 B 站非官方接口,仅供个人学习与笔记用途;请遵守 B 站用户协议、控制请求频率、勿用于商业抓取;截图与字幕仅限个人使用;总结应为概括性内容而非大段复制原文。
Description:DeepSeek Harness Host 插件:bili_summary 工具——B站视频元数据、字幕时间轴与 sharp 切帧配图,错误处理与降级内置,跨平台纯 Node 实现
Topics:bilibili bilibili-api deepseek-harness cordis ai-agents llm-tools video-summary subtitle sharp markdown nodejs
MIT(见 LICENSE)。