dsh-watch-together 0.1.0 → 0.2.0
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.
- package/CHANGELOG.md +1172 -958
- package/bin/watch.mjs +31 -3
- package/dsh.plugin.json +12 -12
- package/examples/floating-chat/requirements-glass.txt +17 -0
- package/examples/floating-chat/run-glass-60fps.cmd +7 -0
- package/examples/floating-chat/run-glass-acrylic.cmd +8 -0
- package/examples/floating-chat/run-glass-nochroma.cmd +7 -0
- package/examples/floating-chat/run-glass.cmd +12 -0
- package/examples/floating-chat/window.py +3372 -1094
- package/package.json +89 -89
- package/src/lines-util.js +87 -8
- package/src/tool-spec.js +6 -1
- package/src/watch-actions.js +6 -3
- package/src/watch-run.js +1002 -923
- package/examples/floating-chat/__pycache__/window.cpython-313.pyc +0 -0
package/bin/watch.mjs
CHANGED
|
@@ -69,8 +69,23 @@ const STORYBOARD = (() => {
|
|
|
69
69
|
}
|
|
70
70
|
})();
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
/**
|
|
73
|
+
* 装上的 `dsh-video-storyboard` 版本。
|
|
74
|
+
*
|
|
75
|
+
* STORYBOARD 指向 `<包根>/src/storyboard/pipeline.js`,所以包根是上两级。
|
|
76
|
+
* 读不到就返回 null —— doctor 里会显示"读不到版本",不会因此崩掉。
|
|
77
|
+
*/
|
|
78
|
+
function storyboardVersion() {
|
|
79
|
+
if (!STORYBOARD) return null;
|
|
80
|
+
try {
|
|
81
|
+
const root = join(dirname(STORYBOARD), '..', '..');
|
|
82
|
+
return JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).version ?? null;
|
|
83
|
+
} catch {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// 下面这三个默认值**只有这个 CLI 用得到**,插件本体(watch_together)完全不依赖它们。//
|
|
74
89
|
// 规矩:`WATCH_*` 环境变量最优先,其次 `~/.dsh/watch`。
|
|
75
90
|
// **不许写死任何人的本机路径** —— 以前这里硬编码了作者的工作区,别人装上会去一个
|
|
76
91
|
// 不存在的目录里找 cookie、往那儿写图。cookie 改成优先读 `~/.dsh/video.json` 里那份
|
|
@@ -685,6 +700,19 @@ async function cmdDoctor() {
|
|
|
685
700
|
const add = (name, ok, detail = '', level = null) => checks.push({ name, ok, detail, level: level ?? (ok ? 'ok' : 'fail') });
|
|
686
701
|
|
|
687
702
|
add('plugin', Boolean(STORYBOARD), STORYBOARD ?? 'dsh-video-storyboard 没装(npm i dsh-watch-together 会带上它)');
|
|
703
|
+
// **版本单独报一项**:0.5.x 与 0.6.x 的 `boardOptions` 参数名已经换过(cells/sheets → maxFrames/maxSheets),
|
|
704
|
+
// 混装的症状是出图最后一步报 `Cannot read properties of undefined (reading 'compression')` ——
|
|
705
|
+
// 那个报错看着像音轨问题,其实是 0.5.12 把宿主的 saveImage 裸调丢了 this(0.6.0 已修)。
|
|
706
|
+
// 不显式报版本,用户会一路去查"是不是没抓到音轨"(2026-11-01 评论区真实发生)。
|
|
707
|
+
const sbVer = storyboardVersion();
|
|
708
|
+
const sbOk = sbVer ? Number(String(sbVer).split('.')[0]) > 0 || Number(String(sbVer).split('.')[1]) >= 6 : false;
|
|
709
|
+
if (STORYBOARD) {
|
|
710
|
+
add('storyboard', sbOk,
|
|
711
|
+
sbVer
|
|
712
|
+
? `v${sbVer}${sbOk ? '' : ' —— 太旧:陪看需要 0.6.0 以上(升级:npm i dsh-video-storyboard@latest)'}`
|
|
713
|
+
: '读不到版本',
|
|
714
|
+
sbOk ? 'ok' : 'fail');
|
|
715
|
+
}
|
|
688
716
|
// cookie 只有看 B 站才需要:本地文件、直链都不用它。缺了是"少一样能力",不是"坏了"。
|
|
689
717
|
add('cookie-file', existsSync(COOKIES),
|
|
690
718
|
existsSync(COOKIES) ? COOKIES : `${COOKIES}(看 B 站才需要,跑 login 生成)`, existsSync(COOKIES) ? 'ok' : 'wait');
|
|
@@ -737,7 +765,7 @@ async function cmdDoctor() {
|
|
|
737
765
|
p ? `${p.title ?? '(没有标题)'} @${tc(p.pos)}`
|
|
738
766
|
: '读不到:调试端口没开,或者页面里没有 <video>(播个视频就好)', p ? 'ok' : 'wait');
|
|
739
767
|
|
|
740
|
-
const required = ['plugin', 'ffmpeg'];
|
|
768
|
+
const required = ['plugin', 'storyboard', 'ffmpeg'];
|
|
741
769
|
const hardOk = checks.filter((c) => required.includes(c.name)).every((c) => c.ok);
|
|
742
770
|
// 位置只要有一条通就行:调试端口,或者浏览器扩展在报
|
|
743
771
|
const canLocate = port || Boolean(bs?.fresh);
|
package/dsh.plugin.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-watch-together",
|
|
3
|
-
"description": "Watch a video together with a text-only agent: follow the user's real playback position and hand over one segment at a time, just before the segment ends.",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"entry": {
|
|
6
|
-
"name": "dsh-watch-together",
|
|
7
|
-
"inject": [
|
|
8
|
-
"tools",
|
|
9
|
-
"attachments"
|
|
10
|
-
]
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-watch-together",
|
|
3
|
+
"description": "Watch a video together with a text-only agent: follow the user's real playback position and hand over one segment at a time, just before the segment ends.",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"entry": {
|
|
6
|
+
"name": "dsh-watch-together",
|
|
7
|
+
"inject": [
|
|
8
|
+
"tools",
|
|
9
|
+
"attachments"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 悬浮窗「液态玻璃」的可选依赖
|
|
2
|
+
#
|
|
3
|
+
# 没有这些也能起窗(自动回退成纯色圆角面板),只是玻璃不会透出背后画面。
|
|
4
|
+
#
|
|
5
|
+
# pip install -r requirements-glass.txt
|
|
6
|
+
#
|
|
7
|
+
# 注意:必须装到**带 tkinter 的那个 Python** 里。有些发行版(例如微软商店版)
|
|
8
|
+
# 只给不带 tk 的构建;确认方式:
|
|
9
|
+
#
|
|
10
|
+
# python -c "import tkinter, PIL, mss; print('ok')"
|
|
11
|
+
|
|
12
|
+
Pillow>=10 # 截图、模糊、色散、合成
|
|
13
|
+
mss>=9 # 可选:整屏抓取比 ImageGrab 快约一倍(38ms vs 71ms)。
|
|
14
|
+
# 装了自动用,没装退回 ImageGrab。
|
|
15
|
+
numpy>=1.24 # 可选:边缘折射用它做"沿 SDF 法线向外采样"(PR #15 那套)。
|
|
16
|
+
# 没装会自动退回"整图放大再按边缘权重盖回"的老折射 —— 能跑,
|
|
17
|
+
# 但边缘没有"折进框外画面"的物理感。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
rem 磨砂模式:背景由 Windows 的 GPU 合成(DWM Acrylic),一次屏都不截。
|
|
3
|
+
rem 气泡和标题栏会变成实心卡片(Tk 不支持半透明叠加)。
|
|
4
|
+
rem 想调色调:DSH_GLASS_ACRYLIC_TINT,ABGR 十六进制,默认 0xB4121014
|
|
5
|
+
set DSH_GLASS_ACRYLIC=1
|
|
6
|
+
cd /d "%~dp0"
|
|
7
|
+
"C:/Users/10437/AppData/Local/Microsoft/WindowsApps/python.exe" window.py
|
|
8
|
+
pause
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
rem 悬浮窗(液态玻璃)
|
|
3
|
+
rem DSH_WATCH_GLASS_TTL 0 = 关掉实时玻璃(回到"开窗截一次");非 0 = 启用
|
|
4
|
+
rem DSH_WATCH_GLASS_FPS 目标帧率,默认 30(本机实测能跑到 26~30Hz)
|
|
5
|
+
rem DSH_WATCH_GLASS_CHROMA 色散强度,默认 8(0 = 完全关掉)
|
|
6
|
+
rem DSH_WATCH_GLASS_BLUR 模糊半径,默认 13
|
|
7
|
+
rem DSH_WATCH_GLASS_SAT 饱和度,默认 1.75
|
|
8
|
+
set DSH_WATCH_GLASS_TTL=60
|
|
9
|
+
set DSH_WATCH_GLASS_FPS=30
|
|
10
|
+
cd /d "%~dp0"
|
|
11
|
+
"C:/Users/10437/AppData/Local/Microsoft/WindowsApps/python.exe" window.py
|
|
12
|
+
pause
|