dsh-bili-watch 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/index.js +12 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -25,7 +25,7 @@ dsh plugin --profile web add dsh-bili-watch
25
25
 
26
26
  插件依赖 DSH 自带的 `@deepseek-ai/dsh-tools`(peer,optional)。profile 里缺这个包时 `index.js` 会报 `ERR_MODULE_NOT_FOUND`,先补装再重启。
27
27
 
28
- 插件尚未收录到插件市场,目前只能按上面的命令装。
28
+ 插件市场已收录(2026-10-21):在市场里搜 `dsh-bili-watch` 直接安装,这是最省事的方式;市场里暂时搜不到时,按上面的命令装。
29
29
 
30
30
  ### 只当命令行工具
31
31
 
@@ -47,7 +47,7 @@ dsh plugin --profile web remove dsh-bili-watch
47
47
 
48
48
  ## 插件面板
49
49
 
50
- 装进 DSH 后,设置 → 插件 → `dsh-bili-watch` 的详情页有一块面板,常规操作无需去对话里敲命令:
50
+ 装进 DSH 后,打开插件列表,点 `dsh-bili-watch` 卡片进详情页,里面有一块面板(不用先进设置),常规操作无需去对话里敲命令:
51
51
 
52
52
  - **依赖状态**:ffmpeg、yt-dlp、ASR 环境、OCR 环境、转写模型、登录凭证逐项列出是否就绪、实际路径、占用体积。缺的点击行末「下载」,后台跑 `scripts/fetch-deps`(体积是估算值,实际以跑完为准)。
53
53
  - **扫码登录**:凭证未登录时点「重新扫码」,面板里弹出二维码,手机 B 站扫完自动刷新。凭证保存在本机 `deps/credential.json`。
package/index.js CHANGED
@@ -14,7 +14,14 @@ import { appendFileSync, existsSync, readFileSync, readdirSync, rmSync, statSync
14
14
  import { tmpdir } from 'node:os'
15
15
  import { dirname, join } from 'node:path'
16
16
  import { fileURLToPath } from 'node:url'
17
- import { defineTool } from '@deepseek-ai/dsh-tools'
17
+ // @deepseek-ai/dsh-tools 是可选 peer:桌面版 autoInstallPeers:false,市场安装时不会自动装上。
18
+ // 缺了只少一个 bili_watch 工具,/bili 命令、插件面板与路由照常工作,不能因此整块加载失败。
19
+ let defineTool = null
20
+ try {
21
+ ({ defineTool } = await import('@deepseek-ai/dsh-tools'))
22
+ } catch {
23
+ defineTool = null
24
+ }
18
25
  import QRCode from 'qrcode'
19
26
 
20
27
  const HERE = dirname(fileURLToPath(import.meta.url))
@@ -565,6 +572,7 @@ function apply(ctx) {
565
572
  // ② 同名工具:模型可调,需要看视频时自己来,不依赖用户敲命令
566
573
  // 必须用 defineTool 包一层:ctx.tools.register 收的是编译好的 tool 对象,
567
574
  // 直接传 options 会让发往模型的 parameters 变成 null(报 INVALID_REQUEST: schema must be type "object")。
575
+ if (defineTool) {
568
576
  ctx.tools.register(defineTool({
569
577
  name: 'bili_watch',
570
578
  description:
@@ -643,6 +651,9 @@ function apply(ctx) {
643
651
  return { ok: r.ok, text: r.text }
644
652
  },
645
653
  }))
654
+ } else {
655
+ console.warn('[dsh-bili-watch] 未找到 @deepseek-ai/dsh-tools,bili_watch 工具未注册(/bili 命令与插件面板不受影响)')
656
+ }
646
657
 
647
658
  // ③ 设置页:读盘状态 + 清缓存(只读优先;唯一写操作是删本机抽帧缓存目录)
648
659
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-bili-watch",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "private": false,
5
5
  "description": "Reads Bilibili (and generic URLs via yt-dlp) into text for DSH agents: search, hot, metadata, comments, danmaku, AI subtitles, local ASR, frame OCR.",
6
6
  "type": "module",