dsh-chat-comprehension 0.2.0 → 0.3.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/NOTICE.md +20 -0
- package/README.md +20 -9
- package/client.js +30 -9
- package/lib/engines.mjs +136 -0
- package/lib/index.js +37 -4
- package/lib/qqbot-0.5.3-patches.json +75 -70
- package/lib/qqbot-patch.mjs +12 -7
- package/lib/video.mjs +11 -2
- package/package.json +7 -23
- package/vendor/dsh-agent-md/LICENSE +21 -0
- package/vendor/dsh-agent-md/cordis.patch.yml +8 -0
- package/vendor/dsh-agent-md/lib/index.js +775 -0
- package/vendor/dsh-agent-md/lib/persona.js +634 -0
- package/vendor/dsh-agent-md/lib/qq.js +527 -0
- package/vendor/dsh-agent-md/package.json +50 -0
- package/vendor/dsh-bili-scroll/LICENSE +21 -0
- package/vendor/dsh-bili-scroll/NOTICE.md +18 -0
- package/vendor/dsh-bili-scroll/cordis.patch.yml +20 -0
- package/vendor/dsh-bili-scroll/index.js +3278 -0
- package/vendor/dsh-bili-scroll/lib/asr.py +141 -0
- package/vendor/dsh-bili-scroll/lib/diagnose.mjs +95 -0
- package/vendor/dsh-bili-scroll/lib/dm.mjs +110 -0
- package/vendor/dsh-bili-scroll/lib/favops.py +90 -0
- package/vendor/dsh-bili-scroll/lib/hostdeps.mjs +148 -0
- package/vendor/dsh-bili-scroll/lib/login.mjs +141 -0
- package/vendor/dsh-bili-scroll/lib/mcp.mjs +144 -0
- package/vendor/dsh-bili-scroll/lib/state.mjs +236 -0
- package/vendor/dsh-bili-scroll/lib/uid.mjs +61 -0
- package/vendor/dsh-bili-scroll/lib/uvfetch.mjs +217 -0
- package/vendor/dsh-bili-scroll/lib/verify.mjs +184 -0
- package/vendor/dsh-bili-scroll/package.json +84 -0
- package/vendor/dsh-bili-scroll/profile-template/bili-duty/cordis.patch.yml +116 -0
- package/vendor/dsh-bili-scroll/profile-template/bili-duty/cordis.yml +4 -0
- package/vendor/dsh-bili-scroll/profile-template/bili-duty/package.json +13 -0
- package/vendor/dsh-bili-scroll/prompts/duty.md +296 -0
- package/vendor/dsh-bili-scroll/vendor/bilibili-mcp/LICENSE +21 -0
- package/vendor/dsh-bili-scroll/vendor/bilibili-mcp/README.md +176 -0
- package/vendor/dsh-bili-scroll/vendor/bilibili-mcp/mcp_server.py +2015 -0
- package/vendor/dsh-bili-scroll/vendor/bilibili-mcp/requirements.txt +10 -0
- package/vendor/dsh-meme/.dsh/skills/dsh-meme-maintenance/SKILL.md +50 -0
- package/vendor/dsh-meme/LICENSE +21 -0
- package/vendor/dsh-meme/anim.js +588 -0
- package/vendor/dsh-meme/cordis.patch.yml +13 -0
- package/vendor/dsh-meme/icon.jpg +0 -0
- package/vendor/dsh-meme/index.js +2616 -0
- package/vendor/dsh-meme/locale/en.json +6 -0
- package/vendor/dsh-meme/locale/zh.json +6 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/index.db +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/manifest.json +13 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/angry/shengqi.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/baka/xianqi.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/color/huachi.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/confused/jiazai.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/confused/wenhao.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/cpu/jiaban.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/daily/ganfan.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/fool/buyao.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/givemoney/yaoqian.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/happy/deyi.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/happy/ok.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/happy/piaole.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/like/bixin.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/meow/maozhua.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/morning/zaoshanghao.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/sad/qiurao.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/sad/yun.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/see/zhenjing.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/shy/haixiu.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/shy/toukan.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/sigh/wuyu.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/sleep/shuijiao.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/surprised/xia.jpg +0 -0
- package/vendor/dsh-meme/memes/dafeiyu-001/memes/work/tangping.jpg +0 -0
- package/vendor/dsh-meme/memes.js +998 -0
- package/vendor/dsh-meme/package.json +67 -0
- package/vendor/dsh-meme/panel.html +210 -0
- package/vendor/dsh-video-storyboard/LICENSE +21 -0
- package/vendor/dsh-video-storyboard/NOTICE +12 -0
- package/vendor/dsh-video-storyboard/bin/_args.mjs +16 -0
- package/vendor/dsh-video-storyboard/bin/asr-check.mjs +85 -0
- package/vendor/dsh-video-storyboard/bin/scan-stats.mjs +43 -0
- package/vendor/dsh-video-storyboard/bin/scan-video.mjs +38 -0
- package/vendor/dsh-video-storyboard/bin/storyboard.mjs +195 -0
- package/vendor/dsh-video-storyboard/cordis.patch.yml +3 -0
- package/vendor/dsh-video-storyboard/dsh.plugin.json +12 -0
- package/vendor/dsh-video-storyboard/package.json +88 -0
- package/vendor/dsh-video-storyboard/scripts/check-syntax.mjs +56 -0
- package/vendor/dsh-video-storyboard/scripts/install-dev.mjs +104 -0
- package/vendor/dsh-video-storyboard/src/flicker.js +104 -0
- package/vendor/dsh-video-storyboard/src/index.js +82 -0
- package/vendor/dsh-video-storyboard/src/ocr_bridge.py +103 -0
- package/vendor/dsh-video-storyboard/src/storyboard/asr-lifecycle.js +262 -0
- package/vendor/dsh-video-storyboard/src/storyboard/asr.js +488 -0
- package/vendor/dsh-video-storyboard/src/storyboard/audio.js +168 -0
- package/vendor/dsh-video-storyboard/src/storyboard/binaries.js +69 -0
- package/vendor/dsh-video-storyboard/src/storyboard/board.js +121 -0
- package/vendor/dsh-video-storyboard/src/storyboard/browser-time.js +504 -0
- package/vendor/dsh-video-storyboard/src/storyboard/cache.js +143 -0
- package/vendor/dsh-video-storyboard/src/storyboard/cells.js +70 -0
- package/vendor/dsh-video-storyboard/src/storyboard/density.js +545 -0
- package/vendor/dsh-video-storyboard/src/storyboard/direct-url.js +130 -0
- package/vendor/dsh-video-storyboard/src/storyboard/fetch.js +373 -0
- package/vendor/dsh-video-storyboard/src/storyboard/flash.js +180 -0
- package/vendor/dsh-video-storyboard/src/storyboard/format.js +573 -0
- package/vendor/dsh-video-storyboard/src/storyboard/frames.js +212 -0
- package/vendor/dsh-video-storyboard/src/storyboard/index.js +32 -0
- package/vendor/dsh-video-storyboard/src/storyboard/injection.js +76 -0
- package/vendor/dsh-video-storyboard/src/storyboard/layout-order.js +176 -0
- package/vendor/dsh-video-storyboard/src/storyboard/locate.js +113 -0
- package/vendor/dsh-video-storyboard/src/storyboard/media-store.js +106 -0
- package/vendor/dsh-video-storyboard/src/storyboard/memory.js +94 -0
- package/vendor/dsh-video-storyboard/src/storyboard/ocr-subs.js +107 -0
- package/vendor/dsh-video-storyboard/src/storyboard/ocr.js +167 -0
- package/vendor/dsh-video-storyboard/src/storyboard/pipeline.js +853 -0
- package/vendor/dsh-video-storyboard/src/storyboard/plan.js +400 -0
- package/vendor/dsh-video-storyboard/src/storyboard/probe.js +132 -0
- package/vendor/dsh-video-storyboard/src/storyboard/provenance.js +44 -0
- package/vendor/dsh-video-storyboard/src/storyboard/python.js +84 -0
- package/vendor/dsh-video-storyboard/src/storyboard/register.js +32 -0
- package/vendor/dsh-video-storyboard/src/storyboard/scan.js +486 -0
- package/vendor/dsh-video-storyboard/src/storyboard/segments.js +117 -0
- package/vendor/dsh-video-storyboard/src/storyboard/sheet.js +507 -0
- package/vendor/dsh-video-storyboard/src/storyboard/storage.js +93 -0
- package/vendor/dsh-video-storyboard/src/storyboard/subtitles.js +181 -0
- package/vendor/dsh-video-storyboard/src/storyboard/tool-spec.js +544 -0
- package/vendor/dsh-video-storyboard/src/storyboard/transcript-file.js +146 -0
- package/vendor/dsh-video-storyboard/src/storyboard/url.js +69 -0
- package/vendor/dsh-video-storyboard/src/storyboard/ytdlp.js +289 -0
- package/vendor/dsh-video-storyboard/src/tool-spec.js +17 -0
- package/vendor/dsh-video-storyboard/src/tools/locate.js +39 -0
- package/vendor/dsh-video-storyboard/src/tools/probe.js +23 -0
- package/vendor/dsh-video-storyboard/src/tools/shared.js +39 -0
- package/vendor/dsh-video-storyboard/src/tools/storyboard.js +20 -0
- package/vendor/dsh-video-storyboard/src/tools/zoom.js +56 -0
- package/vendor/dsh-world/LICENSE +21 -0
- package/vendor/dsh-world/assets/qq-card.png +0 -0
- package/vendor/dsh-world/cordis.patch.yml +6 -0
- package/vendor/dsh-world/lib/archive.d.ts +6 -0
- package/vendor/dsh-world/lib/archive.js +49 -0
- package/vendor/dsh-world/lib/archiveSelection.d.ts +8 -0
- package/vendor/dsh-world/lib/archiveSelection.js +20 -0
- package/vendor/dsh-world/lib/compaction.d.ts +124 -0
- package/vendor/dsh-world/lib/compaction.js +273 -0
- package/vendor/dsh-world/lib/compactionRegion.d.ts +42 -0
- package/vendor/dsh-world/lib/compactionRegion.js +210 -0
- package/vendor/dsh-world/lib/console/routes.d.ts +57 -0
- package/vendor/dsh-world/lib/console/routes.js +129 -0
- package/vendor/dsh-world/lib/console/snapshot.d.ts +39 -0
- package/vendor/dsh-world/lib/console/snapshot.js +51 -0
- package/vendor/dsh-world/lib/ecosystem/bridge/bridge.d.ts +36 -0
- package/vendor/dsh-world/lib/ecosystem/bridge/bridge.js +140 -0
- package/vendor/dsh-world/lib/ecosystem/bridge/route.d.ts +9 -0
- package/vendor/dsh-world/lib/ecosystem/bridge/route.js +46 -0
- package/vendor/dsh-world/lib/ecosystem/qq/bridge.d.ts +123 -0
- package/vendor/dsh-world/lib/ecosystem/qq/bridge.js +380 -0
- package/vendor/dsh-world/lib/ecosystem/qq/panel.d.ts +75 -0
- package/vendor/dsh-world/lib/ecosystem/qq/panel.js +187 -0
- package/vendor/dsh-world/lib/ecosystem/qq/route.d.ts +32 -0
- package/vendor/dsh-world/lib/ecosystem/qq/route.js +134 -0
- package/vendor/dsh-world/lib/ecosystem/qq/supervisor.d.ts +57 -0
- package/vendor/dsh-world/lib/ecosystem/qq/supervisor.js +188 -0
- package/vendor/dsh-world/lib/ecosystem/shared/context.d.ts +14 -0
- package/vendor/dsh-world/lib/ecosystem/shared/context.js +42 -0
- package/vendor/dsh-world/lib/ecosystem/shared/identity.d.ts +15 -0
- package/vendor/dsh-world/lib/ecosystem/shared/identity.js +36 -0
- package/vendor/dsh-world/lib/ecosystem/shared/outlets.d.ts +43 -0
- package/vendor/dsh-world/lib/ecosystem/shared/outlets.js +70 -0
- package/vendor/dsh-world/lib/ecosystem/shared/sessions.d.ts +16 -0
- package/vendor/dsh-world/lib/ecosystem/shared/sessions.js +52 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/archive.d.ts +24 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/archive.js +62 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/home.d.ts +21 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/home.js +111 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/images.d.ts +5 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/images.js +43 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/index.d.ts +41 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/index.js +166 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/messages.d.ts +24 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/messages.js +35 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/sending.d.ts +30 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/sending.js +216 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/supervisor.d.ts +39 -0
- package/vendor/dsh-world/lib/ecosystem/wechat/supervisor.js +138 -0
- package/vendor/dsh-world/lib/faults.d.ts +10 -0
- package/vendor/dsh-world/lib/faults.js +13 -0
- package/vendor/dsh-world/lib/history.d.ts +16 -0
- package/vendor/dsh-world/lib/history.js +80 -0
- package/vendor/dsh-world/lib/hostContract.d.ts +19 -0
- package/vendor/dsh-world/lib/hostContract.js +1 -0
- package/vendor/dsh-world/lib/http.d.ts +18 -0
- package/vendor/dsh-world/lib/http.js +39 -0
- package/vendor/dsh-world/lib/index.d.ts +108 -0
- package/vendor/dsh-world/lib/index.js +356 -0
- package/vendor/dsh-world/lib/life/activity.d.ts +14 -0
- package/vendor/dsh-world/lib/life/activity.js +58 -0
- package/vendor/dsh-world/lib/life/alarm.d.ts +39 -0
- package/vendor/dsh-world/lib/life/alarm.js +132 -0
- package/vendor/dsh-world/lib/life/alarmTimer.d.ts +22 -0
- package/vendor/dsh-world/lib/life/alarmTimer.js +49 -0
- package/vendor/dsh-world/lib/life/diary.d.ts +4 -0
- package/vendor/dsh-world/lib/life/diary.js +9 -0
- package/vendor/dsh-world/lib/life/earlyStop.d.ts +19 -0
- package/vendor/dsh-world/lib/life/earlyStop.js +25 -0
- package/vendor/dsh-world/lib/life/home.d.ts +34 -0
- package/vendor/dsh-world/lib/life/home.js +91 -0
- package/vendor/dsh-world/lib/life/host.d.ts +22 -0
- package/vendor/dsh-world/lib/life/host.js +24 -0
- package/vendor/dsh-world/lib/life/journal.d.ts +20 -0
- package/vendor/dsh-world/lib/life/journal.js +59 -0
- package/vendor/dsh-world/lib/life/lifeStore.d.ts +16 -0
- package/vendor/dsh-world/lib/life/lifeStore.js +105 -0
- package/vendor/dsh-world/lib/life/messages.d.ts +17 -0
- package/vendor/dsh-world/lib/life/messages.js +53 -0
- package/vendor/dsh-world/lib/life/notify.d.ts +15 -0
- package/vendor/dsh-world/lib/life/notify.js +40 -0
- package/vendor/dsh-world/lib/life/pricing.d.ts +4 -0
- package/vendor/dsh-world/lib/life/pricing.js +30 -0
- package/vendor/dsh-world/lib/life/runtime.d.ts +52 -0
- package/vendor/dsh-world/lib/life/runtime.js +376 -0
- package/vendor/dsh-world/lib/life/toolRegistry.d.ts +22 -0
- package/vendor/dsh-world/lib/life/toolRegistry.js +64 -0
- package/vendor/dsh-world/lib/life/tools.d.ts +24 -0
- package/vendor/dsh-world/lib/life/tools.js +47 -0
- package/vendor/dsh-world/lib/life/types.d.ts +67 -0
- package/vendor/dsh-world/lib/life/types.js +1 -0
- package/vendor/dsh-world/lib/persona.d.ts +10 -0
- package/vendor/dsh-world/lib/persona.js +29 -0
- package/vendor/dsh-world/lib/promptSection.d.ts +30 -0
- package/vendor/dsh-world/lib/promptSection.js +81 -0
- package/vendor/dsh-world/lib/qqScope.d.ts +11 -0
- package/vendor/dsh-world/lib/qqScope.js +39 -0
- package/vendor/dsh-world/lib/runtime.d.ts +23 -0
- package/vendor/dsh-world/lib/runtime.js +206 -0
- package/vendor/dsh-world/lib/self.d.ts +10 -0
- package/vendor/dsh-world/lib/self.js +36 -0
- package/vendor/dsh-world/lib/sourceArchive.d.ts +28 -0
- package/vendor/dsh-world/lib/sourceArchive.js +156 -0
- package/vendor/dsh-world/lib/store.d.ts +30 -0
- package/vendor/dsh-world/lib/store.js +191 -0
- package/vendor/dsh-world/lib/timeContext.d.ts +3 -0
- package/vendor/dsh-world/lib/timeContext.js +13 -0
- package/vendor/dsh-world/lib/types.d.ts +118 -0
- package/vendor/dsh-world/lib/types.js +1 -0
- package/vendor/dsh-world/lib/worldPrompt.d.ts +47 -0
- package/vendor/dsh-world/lib/worldPrompt.js +49 -0
- package/vendor/dsh-world/lib/worldSwitch.d.ts +44 -0
- package/vendor/dsh-world/lib/worldSwitch.js +78 -0
- package/vendor/dsh-world/package-lock.json +1088 -0
- package/vendor/dsh-world/package.json +88 -0
- package/vendor/dsh-world/scripts/enable-tool-free-compaction.ps1 +33 -0
- package/vendor/dsh-world/src/archive.ts +45 -0
- package/vendor/dsh-world/src/archiveSelection.ts +27 -0
- package/vendor/dsh-world/src/compaction.ts +260 -0
- package/vendor/dsh-world/src/compactionRegion.ts +172 -0
- package/vendor/dsh-world/src/console/routes.ts +125 -0
- package/vendor/dsh-world/src/console/snapshot.ts +84 -0
- package/vendor/dsh-world/src/ecosystem/README.md +14 -0
- package/vendor/dsh-world/src/ecosystem/bridge/bridge.ts +121 -0
- package/vendor/dsh-world/src/ecosystem/bridge/route.ts +35 -0
- package/vendor/dsh-world/src/ecosystem/qq/bridge.ts +456 -0
- package/vendor/dsh-world/src/ecosystem/qq/panel.ts +178 -0
- package/vendor/dsh-world/src/ecosystem/qq/route.ts +130 -0
- package/vendor/dsh-world/src/ecosystem/qq/supervisor.ts +262 -0
- package/vendor/dsh-world/src/ecosystem/shared/context.ts +38 -0
- package/vendor/dsh-world/src/ecosystem/shared/identity.ts +42 -0
- package/vendor/dsh-world/src/ecosystem/shared/outlets.ts +75 -0
- package/vendor/dsh-world/src/ecosystem/shared/sessions.ts +47 -0
- package/vendor/dsh-world/src/ecosystem/wechat/archive.ts +66 -0
- package/vendor/dsh-world/src/ecosystem/wechat/home.ts +94 -0
- package/vendor/dsh-world/src/ecosystem/wechat/images.ts +38 -0
- package/vendor/dsh-world/src/ecosystem/wechat/index.ts +101 -0
- package/vendor/dsh-world/src/ecosystem/wechat/messages.ts +43 -0
- package/vendor/dsh-world/src/ecosystem/wechat/sending.ts +177 -0
- package/vendor/dsh-world/src/ecosystem/wechat/supervisor.ts +116 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/README.md +117 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/adapter.py +572 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/binding.py +52 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/engine/LICENSE +43 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/engine/NOTICE.md +10 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/engine/bridge.cpp +229 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/engine/build.ps1 +19 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/engine/profile.json +28 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/groups.py +42 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/incoming.py +157 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/native.py +168 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/outgoing.py +95 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/requirements.txt +1 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/sender.py +157 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/snapshot.py +32 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/stickers.py +60 -0
- package/vendor/dsh-world/src/ecosystem/wechat/windows/wechat.ps1 +75 -0
- package/vendor/dsh-world/src/faults.ts +12 -0
- package/vendor/dsh-world/src/history.ts +77 -0
- package/vendor/dsh-world/src/hostContract.ts +9 -0
- package/vendor/dsh-world/src/http.ts +34 -0
- package/vendor/dsh-world/src/index.ts +286 -0
- package/vendor/dsh-world/src/life/activity.ts +48 -0
- package/vendor/dsh-world/src/life/alarm.ts +119 -0
- package/vendor/dsh-world/src/life/alarmTimer.ts +45 -0
- package/vendor/dsh-world/src/life/diary.ts +10 -0
- package/vendor/dsh-world/src/life/earlyStop.ts +27 -0
- package/vendor/dsh-world/src/life/home.ts +85 -0
- package/vendor/dsh-world/src/life/host.ts +50 -0
- package/vendor/dsh-world/src/life/journal.ts +44 -0
- package/vendor/dsh-world/src/life/lifeStore.ts +70 -0
- package/vendor/dsh-world/src/life/messages.ts +44 -0
- package/vendor/dsh-world/src/life/notify.ts +47 -0
- package/vendor/dsh-world/src/life/pricing.ts +37 -0
- package/vendor/dsh-world/src/life/runtime.ts +318 -0
- package/vendor/dsh-world/src/life/toolRegistry.ts +48 -0
- package/vendor/dsh-world/src/life/tools.ts +61 -0
- package/vendor/dsh-world/src/life/types.ts +19 -0
- package/vendor/dsh-world/src/persona.ts +26 -0
- package/vendor/dsh-world/src/promptSection.ts +71 -0
- package/vendor/dsh-world/src/qqScope.ts +51 -0
- package/vendor/dsh-world/src/runtime.ts +172 -0
- package/vendor/dsh-world/src/self.ts +32 -0
- package/vendor/dsh-world/src/sourceArchive.ts +132 -0
- package/vendor/dsh-world/src/store.ts +170 -0
- package/vendor/dsh-world/src/timeContext.ts +13 -0
- package/vendor/dsh-world/src/types.ts +112 -0
- package/vendor/dsh-world/src/worldPrompt.ts +64 -0
- package/vendor/dsh-world/src/worldSwitch.ts +82 -0
- package/vendor/dsh-world/templates/alarm.md +49 -0
- package/vendor/dsh-world/templates/world-prompt.md +7 -0
- package/vendor/dsh-world/tests/archive.test.ts +57 -0
- package/vendor/dsh-world/tests/archiveScope.test.ts +86 -0
- package/vendor/dsh-world/tests/bridge.test.ts +211 -0
- package/vendor/dsh-world/tests/channelSessions.test.ts +79 -0
- package/vendor/dsh-world/tests/clientHooks.test.ts +103 -0
- package/vendor/dsh-world/tests/compaction.test.ts +141 -0
- package/vendor/dsh-world/tests/console.test.ts +202 -0
- package/vendor/dsh-world/tests/consoleClient.test.ts +101 -0
- package/vendor/dsh-world/tests/enableCompaction.test.ts +19 -0
- package/vendor/dsh-world/tests/fixtures.ts +6 -0
- package/vendor/dsh-world/tests/history.test.ts +100 -0
- package/vendor/dsh-world/tests/hostFixture.ts +46 -0
- package/vendor/dsh-world/tests/lifeActivity.test.ts +70 -0
- package/vendor/dsh-world/tests/lifeAlarm.test.ts +87 -0
- package/vendor/dsh-world/tests/lifeDiary.test.ts +33 -0
- package/vendor/dsh-world/tests/lifeMessages.test.ts +61 -0
- package/vendor/dsh-world/tests/lifeNotify.test.ts +46 -0
- package/vendor/dsh-world/tests/lifeParts.test.ts +45 -0
- package/vendor/dsh-world/tests/lifeRuntime.test.ts +660 -0
- package/vendor/dsh-world/tests/lifeStore.test.ts +90 -0
- package/vendor/dsh-world/tests/lifeTools.test.ts +53 -0
- package/vendor/dsh-world/tests/outlets.test.ts +85 -0
- package/vendor/dsh-world/tests/panel.test.ts +85 -0
- package/vendor/dsh-world/tests/plugin.test.ts +614 -0
- package/vendor/dsh-world/tests/pricing.test.ts +21 -0
- package/vendor/dsh-world/tests/qq.test.ts +121 -0
- package/vendor/dsh-world/tests/qqSessionMode.test.ts +97 -0
- package/vendor/dsh-world/tests/qqSupervisor.test.ts +149 -0
- package/vendor/dsh-world/tests/sourceArchive.test.ts +58 -0
- package/vendor/dsh-world/tests/store.test.ts +82 -0
- package/vendor/dsh-world/tests/storeWriter.ts +5 -0
- package/vendor/dsh-world/tests/timeContext.test.ts +15 -0
- package/vendor/dsh-world/tests/wechat.test.ts +254 -0
- package/vendor/dsh-world/tests/wechatImages.test.ts +130 -0
- package/vendor/dsh-world/tests/wechatSending.test.ts +142 -0
- package/vendor/dsh-world/tests/wechatSupervisor.test.ts +91 -0
- package/vendor/dsh-world/tests/worldPrompt.test.ts +201 -0
- package/vendor/dsh-world/tsconfig.build.json +5 -0
- package/vendor/dsh-world/tsconfig.json +8 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-meme",
|
|
3
|
+
"version": "0.1.63",
|
|
4
|
+
"description": "DeepSeek Harness 表情包插件:输入框一键发图(图库/情绪多选筛选、悬浮大图预览)、多图库开关、情绪与关键词搜图、AI 学图,图库可从市场一键安装或导入/导出 ZIP。",
|
|
5
|
+
"icon": "icon.jpg",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/yyh-001/dsh-meme.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://yyh-001.github.io/dsh-meme/",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/yyh-001/dsh-meme/issues"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "index.js",
|
|
16
|
+
"files": [
|
|
17
|
+
"anim.js",
|
|
18
|
+
"client.js",
|
|
19
|
+
"cordis.patch.yml",
|
|
20
|
+
"docs/",
|
|
21
|
+
"icon.jpg",
|
|
22
|
+
"index.js",
|
|
23
|
+
"locale/",
|
|
24
|
+
"memes.js",
|
|
25
|
+
"memes/",
|
|
26
|
+
"panel.html",
|
|
27
|
+
"AGENTS.md",
|
|
28
|
+
".dsh/skills/"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./index.js",
|
|
32
|
+
"./client": "./client.js",
|
|
33
|
+
"./locale/*.json": "./locale/*.json",
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"dsh": {
|
|
37
|
+
"bundle": {
|
|
38
|
+
"patch": "./cordis.patch.yml"
|
|
39
|
+
},
|
|
40
|
+
"client": {
|
|
41
|
+
"inject": [
|
|
42
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
43
|
+
"@deepseek-ai/dsh-client-connection",
|
|
44
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
45
|
+
],
|
|
46
|
+
"platform": "web"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@deepseek-ai/dsh-tools": "*"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"dsh-plugin",
|
|
54
|
+
"dsh-meme",
|
|
55
|
+
"deepseek-harness",
|
|
56
|
+
"meme",
|
|
57
|
+
"emoticon",
|
|
58
|
+
"sticker"
|
|
59
|
+
],
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=22.13.0"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"test": "node --test test/*.test.mjs"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>表情包管理</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #f5f5f7; --card: #ffffff; --border: #d9d9e3; --text: #1c1c28;
|
|
10
|
+
--muted: #6b6b7b; --accent: #4f6ef7; --err: #d64545; --ok: #2e9e5b;
|
|
11
|
+
}
|
|
12
|
+
@media (prefers-color-scheme: dark) {
|
|
13
|
+
:root {
|
|
14
|
+
--bg: #16161e; --card: #20202c; --border: #36364a; --text: #e8e8f0;
|
|
15
|
+
--muted: #9a9ab0; --accent: #7b93ff; --err: #ff6b6b; --ok: #4cc38a;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
* { box-sizing: border-box; }
|
|
19
|
+
body {
|
|
20
|
+
margin: 0; background: var(--bg); color: var(--text);
|
|
21
|
+
font: 14px/1.5 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
22
|
+
}
|
|
23
|
+
.wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }
|
|
24
|
+
h1 { font-size: 20px; margin: 4px 0 16px; }
|
|
25
|
+
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
|
|
26
|
+
input[type=text], select, textarea {
|
|
27
|
+
background: var(--card); color: var(--text); border: 1px solid var(--border);
|
|
28
|
+
border-radius: 8px; padding: 7px 10px; font-size: 14px; outline: none;
|
|
29
|
+
}
|
|
30
|
+
input[type=text]:focus, select:focus, textarea:focus { border-color: var(--accent); }
|
|
31
|
+
textarea { resize: vertical; font-family: inherit; }
|
|
32
|
+
button {
|
|
33
|
+
background: var(--card); color: var(--text); border: 1px solid var(--border);
|
|
34
|
+
border-radius: 8px; padding: 7px 14px; font-size: 14px; cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
button:hover { border-color: var(--accent); color: var(--accent); }
|
|
37
|
+
button:disabled { opacity: .5; cursor: default; }
|
|
38
|
+
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
|
|
39
|
+
.total { color: var(--muted); font-size: 13px; }
|
|
40
|
+
.notice { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 12px; font-size: 13px; }
|
|
41
|
+
.notice.err { color: var(--err); border-color: var(--err); }
|
|
42
|
+
.notice.ok { color: var(--ok); border-color: var(--ok); }
|
|
43
|
+
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
|
|
44
|
+
.card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
|
|
45
|
+
.card img { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--bg); }
|
|
46
|
+
.meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-height: 84px; }
|
|
47
|
+
.tag { font-size: 11px; color: var(--accent); text-transform: lowercase; }
|
|
48
|
+
.cap { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
49
|
+
.acts { display: flex; gap: 6px; margin-top: auto; }
|
|
50
|
+
.acts button { padding: 4px 10px; font-size: 12px; }
|
|
51
|
+
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
|
|
52
|
+
.api { color: var(--muted); font-size: 12px; margin-top: 24px; }
|
|
53
|
+
</style>
|
|
54
|
+
</head>
|
|
55
|
+
<body>
|
|
56
|
+
<div class="wrap">
|
|
57
|
+
<h1>😼 表情包管理</h1>
|
|
58
|
+
<div class="row">
|
|
59
|
+
<input type="text" id="q" placeholder="搜索描述/关键词" style="width: 200px">
|
|
60
|
+
<select id="tagFilter"><option value="">全部分类</option></select>
|
|
61
|
+
<button id="searchBtn">搜索</button>
|
|
62
|
+
<button id="resetBtn">重置</button>
|
|
63
|
+
<span class="total" id="total"></span>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="row">
|
|
66
|
+
<input type="text" id="upTag" placeholder="新图分类(如 happy)" style="width: 150px">
|
|
67
|
+
<button class="primary" id="uploadBtn">上传表情包</button>
|
|
68
|
+
<input type="file" id="fileInput" accept="image/*" style="display:none">
|
|
69
|
+
<button id="scanBtn" title="把图库目录里手动拷入、还没入索引的图片收进来;动图 GIF 走这条路保留动画">扫描新增</button>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="api" style="margin:0 0 6px">支持 jpg/png/gif/webp;动图 GIF 从这里上传或扫描入库保留动画,从聊天发给 AI 学图会被压成单帧。</div>
|
|
72
|
+
<div id="notice"></div>
|
|
73
|
+
<div class="grid" id="grid"></div>
|
|
74
|
+
<div class="api">数据与 selfloom 图库同源(index.db + memes/ 目录);API: GET/POST /dsh-memes-api</div>
|
|
75
|
+
</div>
|
|
76
|
+
<script>
|
|
77
|
+
'use strict'
|
|
78
|
+
const $ = (id) => document.getElementById(id)
|
|
79
|
+
let memes = [], tags = [], editing = null
|
|
80
|
+
|
|
81
|
+
function notice(msg, kind) {
|
|
82
|
+
const el = $('notice')
|
|
83
|
+
el.className = 'notice' + (kind ? ' ' + kind : '')
|
|
84
|
+
el.textContent = msg
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function apiGet(params) {
|
|
88
|
+
const qs = new URLSearchParams()
|
|
89
|
+
if (params.tag) qs.set('tag', params.tag)
|
|
90
|
+
if (params.q) qs.set('q', params.q)
|
|
91
|
+
const res = await fetch('/dsh-memes-api?' + qs.toString())
|
|
92
|
+
return res.json()
|
|
93
|
+
}
|
|
94
|
+
async function apiPost(payload) {
|
|
95
|
+
const res = await fetch('/dsh-memes-api', {
|
|
96
|
+
method: 'POST',
|
|
97
|
+
headers: { 'Content-Type': 'application/json' },
|
|
98
|
+
body: JSON.stringify(payload),
|
|
99
|
+
})
|
|
100
|
+
return res.json()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function load() {
|
|
104
|
+
const res = await apiGet({ q: $('q').value.trim(), tag: $('tagFilter').value })
|
|
105
|
+
if (!res.ok) { notice('加载失败: ' + (res.error || ''), 'err'); return }
|
|
106
|
+
memes = res.memes; tags = res.tags
|
|
107
|
+
$('total').textContent = res.total + ' 张'
|
|
108
|
+
const sel = $('tagFilter')
|
|
109
|
+
const current = sel.value
|
|
110
|
+
sel.innerHTML = '<option value="">全部分类</option>' + tags.map((t) => '<option value="' + t + '">' + t + '</option>').join('')
|
|
111
|
+
sel.value = current
|
|
112
|
+
render()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function render() {
|
|
116
|
+
const grid = $('grid')
|
|
117
|
+
if (memes.length === 0) {
|
|
118
|
+
grid.innerHTML = '<div class="empty">没有匹配的表情包</div>'
|
|
119
|
+
return
|
|
120
|
+
}
|
|
121
|
+
grid.innerHTML = ''
|
|
122
|
+
for (const m of memes) {
|
|
123
|
+
const card = document.createElement('div')
|
|
124
|
+
card.className = 'card'
|
|
125
|
+
const img = document.createElement('img')
|
|
126
|
+
img.src = m.url || ''; img.alt = m.path; img.loading = 'lazy'
|
|
127
|
+
card.appendChild(img)
|
|
128
|
+
const meta = document.createElement('div')
|
|
129
|
+
meta.className = 'meta'
|
|
130
|
+
if (editing === m.path) {
|
|
131
|
+
const tagInput = document.createElement('input')
|
|
132
|
+
tagInput.type = 'text'; tagInput.value = m.tag; tagInput.placeholder = '分类'
|
|
133
|
+
const capInput = document.createElement('textarea')
|
|
134
|
+
capInput.rows = 2; capInput.value = m.caption || ''; capInput.placeholder = '描述'
|
|
135
|
+
const kwInput = document.createElement('input')
|
|
136
|
+
kwInput.type = 'text'; kwInput.value = m.keywords || ''; kwInput.placeholder = '关键词'
|
|
137
|
+
const acts = document.createElement('div'); acts.className = 'acts'
|
|
138
|
+
const save = document.createElement('button'); save.textContent = '保存'
|
|
139
|
+
save.onclick = async () => {
|
|
140
|
+
const res = await apiPost({ op: 'update', path: m.path, tag: tagInput.value, caption: capInput.value, keywords: kwInput.value })
|
|
141
|
+
notice(res.ok ? '已保存' : '保存失败: ' + (res.error || ''), res.ok ? 'ok' : 'err')
|
|
142
|
+
editing = null
|
|
143
|
+
load()
|
|
144
|
+
}
|
|
145
|
+
const cancel = document.createElement('button'); cancel.textContent = '取消'
|
|
146
|
+
cancel.onclick = () => { editing = null; render() }
|
|
147
|
+
acts.appendChild(save); acts.appendChild(cancel)
|
|
148
|
+
meta.append(tagInput, capInput, kwInput, acts)
|
|
149
|
+
} else {
|
|
150
|
+
const tag = document.createElement('div'); tag.className = 'tag'; tag.textContent = m.tag
|
|
151
|
+
const cap = document.createElement('div'); cap.className = 'cap'; cap.textContent = m.caption || m.file_name
|
|
152
|
+
const acts = document.createElement('div'); acts.className = 'acts'
|
|
153
|
+
const edit = document.createElement('button'); edit.textContent = '编辑'
|
|
154
|
+
edit.onclick = () => { editing = m.path; render() }
|
|
155
|
+
const del = document.createElement('button'); del.textContent = '删除'
|
|
156
|
+
del.onclick = async () => {
|
|
157
|
+
if (!window.confirm('删除 ' + m.path + ' ?')) return
|
|
158
|
+
const res = await apiPost({ op: 'delete', path: m.path })
|
|
159
|
+
notice(res.ok ? '已删除' : '删除失败: ' + (res.error || ''), res.ok ? 'ok' : 'err')
|
|
160
|
+
load()
|
|
161
|
+
}
|
|
162
|
+
acts.appendChild(edit); acts.appendChild(del)
|
|
163
|
+
meta.append(tag, cap, acts)
|
|
164
|
+
}
|
|
165
|
+
card.appendChild(meta)
|
|
166
|
+
grid.appendChild(card)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
$('searchBtn').onclick = load
|
|
171
|
+
$('resetBtn').onclick = () => { $('q').value = ''; $('tagFilter').value = ''; load() }
|
|
172
|
+
$('q').addEventListener('keydown', (e) => { if (e.key === 'Enter') load() })
|
|
173
|
+
$('uploadBtn').onclick = () => $('fileInput').click()
|
|
174
|
+
$('fileInput').onchange = async (e) => {
|
|
175
|
+
const file = e.target.files && e.target.files[0]
|
|
176
|
+
e.target.value = ''
|
|
177
|
+
if (!file) return
|
|
178
|
+
if (!/\.(jpg|jpeg|png|gif|webp)$/i.test(file.name)) { notice('仅支持 jpg/png/gif/webp', 'err'); return }
|
|
179
|
+
const tag = $('upTag').value.trim().toLowerCase()
|
|
180
|
+
if (!tag) { notice('先填新图分类(tag)', 'err'); return }
|
|
181
|
+
$('uploadBtn').disabled = true
|
|
182
|
+
const reader = new FileReader()
|
|
183
|
+
reader.onload = async () => {
|
|
184
|
+
const data = String(reader.result || '').split(',')[1] || ''
|
|
185
|
+
const res = await apiPost({ op: 'upload', tag, fileName: file.name, dataBase64: data })
|
|
186
|
+
notice(res.ok && res.meme ? '已上传: ' + res.meme.path : '上传失败: ' + (res.error || ''), res.ok ? 'ok' : 'err')
|
|
187
|
+
$('uploadBtn').disabled = false
|
|
188
|
+
load()
|
|
189
|
+
}
|
|
190
|
+
reader.onerror = () => { $('uploadBtn').disabled = false; notice('读取文件失败', 'err') }
|
|
191
|
+
reader.readAsDataURL(file)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
$('scanBtn').onclick = async () => {
|
|
195
|
+
$('scanBtn').disabled = true
|
|
196
|
+
try {
|
|
197
|
+
const res = await apiPost({ op: 'scanPack' })
|
|
198
|
+
notice(res.ok ? (res.message || '扫描完成') : '扫描失败: ' + (res.error || ''), res.ok ? 'ok' : 'err')
|
|
199
|
+
if (res.ok) load()
|
|
200
|
+
} catch (e) {
|
|
201
|
+
notice('扫描失败: ' + (e && e.message ? e.message : e), 'err')
|
|
202
|
+
} finally {
|
|
203
|
+
$('scanBtn').disabled = false
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
load()
|
|
208
|
+
</script>
|
|
209
|
+
</body>
|
|
210
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SAOS-3624
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# NOTICE
|
|
2
|
+
|
|
3
|
+
The MIT license in `LICENSE` covers the **source code** of this project.
|
|
4
|
+
|
|
5
|
+
Documentation images in `docs/` are not part of that grant:
|
|
6
|
+
|
|
7
|
+
- `docs/demo.png` — generated by ffmpeg from a synthetic clip. Nothing third-party in it.
|
|
8
|
+
- `docs/demo-real.png` — a storyboard of the repository author's **own** video, included to show what
|
|
9
|
+
the tool looks like on real footage. © the author; provided as documentation only, not for reuse.
|
|
10
|
+
|
|
11
|
+
No third-party footage, model weights or binaries are redistributed in this repository. See
|
|
12
|
+
`CREDITS.md` for the projects this one takes ideas from.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 极简参数解析:`--k v` 与裸参。零依赖,够用即可。 */
|
|
2
|
+
export function args(argv, defaults = {}) {
|
|
3
|
+
const out = { ...defaults, _: [] };
|
|
4
|
+
for (let i = 0; i < argv.length; i++) {
|
|
5
|
+
const token = argv[i];
|
|
6
|
+
if (token.startsWith('--')) {
|
|
7
|
+
const key = token.slice(2);
|
|
8
|
+
const next = argv[i + 1];
|
|
9
|
+
if (next === undefined || next.startsWith('--')) out[key] = true;
|
|
10
|
+
else { out[key] = next; i += 1; }
|
|
11
|
+
} else {
|
|
12
|
+
out._.push(token);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* asr-check — 在真机上验一次台词链路,只花十几秒音频的钱。
|
|
4
|
+
*
|
|
5
|
+
* node bin/asr-check.mjs <video> [--from 60] [--seconds 12]
|
|
6
|
+
*
|
|
7
|
+
* 顺序:字幕轨 → ASR。没有配置 key 时会直接告诉你缺什么,不会发请求。
|
|
8
|
+
*/
|
|
9
|
+
import { args as parse } from './_args.mjs';
|
|
10
|
+
import { probeVideo } from '../src/storyboard/probe.js';
|
|
11
|
+
import {
|
|
12
|
+
ASR_DEFAULTS, describeAsrTarget, extractSubtitleTrack, filterSuspectSegments, transcribeLong,
|
|
13
|
+
} from '../src/storyboard/asr.js';
|
|
14
|
+
import { analyzeAudio } from '../src/storyboard/audio.js';
|
|
15
|
+
|
|
16
|
+
const opt = parse(process.argv.slice(2), { from: 0, seconds: 12 });
|
|
17
|
+
const input = opt._[0];
|
|
18
|
+
if (!input) {
|
|
19
|
+
console.error('usage: node bin/asr-check.mjs <video> [--from 60] [--seconds 12]');
|
|
20
|
+
process.exit(2);
|
|
21
|
+
}
|
|
22
|
+
const from = Number(opt.from) || 0;
|
|
23
|
+
const seconds = Number(opt.seconds) || 12;
|
|
24
|
+
|
|
25
|
+
const info = await probeVideo(input);
|
|
26
|
+
console.log(`[probe] ${info.width}x${info.height} ${info.duration.toFixed(1)}s ` +
|
|
27
|
+
`${info.hasAudio ? 'audio' : 'NO AUDIO'}${info.hasSubtitle ? ' + 字幕轨' : ''}`);
|
|
28
|
+
if (!info.hasAudio) {
|
|
29
|
+
console.log('这个文件没有音轨,台词链路无事可做。');
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 1) 字幕轨
|
|
34
|
+
if (info.hasSubtitle) {
|
|
35
|
+
const subs = await extractSubtitleTrack({ input });
|
|
36
|
+
if (subs?.length) {
|
|
37
|
+
console.log(`[subtitle] 抽到 ${subs.length} 条字幕,前 3 条:`);
|
|
38
|
+
for (const s of subs.slice(0, 3)) console.log(` ${s.from.toFixed(1)}–${s.to.toFixed(1)} ${s.text}`);
|
|
39
|
+
console.log('\n有字幕轨时根本不用调 ASR —— 这条路径是免费且最准的。');
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
console.log('[subtitle] 声明了字幕轨但抽不出来,回退到 ASR');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 2) ASR 配置:走和工具同一套解析(env > asr.json > 默认),别再各读各的
|
|
46
|
+
const keyEnv = ASR_DEFAULTS.keyEnv;
|
|
47
|
+
const apiKey = ASR_DEFAULTS.fileKey || process.env[keyEnv];
|
|
48
|
+
console.log(`[asr] ${describeAsrTarget()}`);
|
|
49
|
+
if (!apiKey) {
|
|
50
|
+
console.log(`\n没有检测到 ${keyEnv}。设置后重跑:`);
|
|
51
|
+
console.log(' Windows PowerShell: $env:' + keyEnv + ' = "sk-..."');
|
|
52
|
+
console.log(' Git Bash / WSL: export ' + keyEnv + '=sk-...');
|
|
53
|
+
console.log('可选:DSH_ASR_BASE_URL / DSH_ASR_MODEL / DSH_ASR_LANG(默认 zh)');
|
|
54
|
+
console.log(` 自建 funasr-server 也可以,只要它兼容 OpenAI 的 /audio/transcriptions。`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 3) 真调一次
|
|
59
|
+
const t0 = Date.now();
|
|
60
|
+
console.log(`[asr] 转写 ${from}s–${from + seconds}s(≈${(seconds * 31.25).toFixed(0)}KB @16k 单声道)…`);
|
|
61
|
+
// 走和工具同一套切片逻辑(>45s 会自动切成多请求,切点优先落在静音)
|
|
62
|
+
const { silences } = (await analyzeAudio({ input, start: from, end: from + seconds })) ?? { silences: [] };
|
|
63
|
+
const result = await transcribeLong({
|
|
64
|
+
input, start: from, end: from + seconds, silences, maxChunk: 45,
|
|
65
|
+
});
|
|
66
|
+
const ms = Date.now() - t0;
|
|
67
|
+
if (!result) {
|
|
68
|
+
console.log('没有返回内容(音频可能全是静音)。');
|
|
69
|
+
process.exit(0);
|
|
70
|
+
}
|
|
71
|
+
console.log(`[asr] ${ms}ms,${result.segments.length} 段` +
|
|
72
|
+
`${result.chunks ? `(${result.chunks} 片)` : ''},model=${result.model}`);
|
|
73
|
+
for (const s of result.segments) {
|
|
74
|
+
console.log(` ${s.from.toFixed(2)}–${s.to.toFixed(2)} ${s.text}`);
|
|
75
|
+
}
|
|
76
|
+
const { kept, dropped } = filterSuspectSegments(result.segments);
|
|
77
|
+
const chars = kept.reduce((n, s) => n + s.text.length, 0);
|
|
78
|
+
if (dropped.length > 0) {
|
|
79
|
+
console.log(`\n[过滤] ${dropped.length} 段疑似非语音(音乐/噪声),已忽略:`);
|
|
80
|
+
for (const d of dropped.slice(0, 5)) {
|
|
81
|
+
console.log(` ${d.from.toFixed(2)}–${d.to.toFixed(2)} ${d.charsPerSec} 字/秒 ${d.reason} "${d.text.slice(0, 20)}"`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
console.log(`\n[统计] ${chars} 字 / ${seconds}s = ${(chars / seconds).toFixed(2)} 字/秒`);
|
|
85
|
+
console.log('[提示] 这些时间码会按重叠贴到分镜格子上;字/秒也会作为第三条密度信号。');
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* scan-stats — 分数分布与阈值扫描。调阈值前先看这个,别靠猜。
|
|
4
|
+
*
|
|
5
|
+
* node bin/scan-stats.mjs <video> [--step 2]
|
|
6
|
+
*
|
|
7
|
+
* 输出:分位数、各阈值下的切点数、切点间隔统计(判断是否有误检成簇)。
|
|
8
|
+
*/
|
|
9
|
+
import { args as parse } from './_args.mjs';
|
|
10
|
+
import { probeVideo } from '../src/storyboard/probe.js';
|
|
11
|
+
import { scanShots } from '../src/storyboard/scan.js';
|
|
12
|
+
|
|
13
|
+
const opt = parse(process.argv.slice(2), { step: 2 });
|
|
14
|
+
const input = opt._[0];
|
|
15
|
+
if (!input) {
|
|
16
|
+
console.error('usage: node bin/scan-stats.mjs <video> [--step 2]');
|
|
17
|
+
process.exit(2);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const info = await probeVideo(input);
|
|
21
|
+
const t0 = Date.now();
|
|
22
|
+
const { stats, frames } = await scanShots({ input, fps: info.fps, threshold: 999 });
|
|
23
|
+
const ms = Date.now() - t0;
|
|
24
|
+
const scores = stats.map((s) => s.score).sort((a, b) => a - b);
|
|
25
|
+
const q = (p) => scores[Math.min(scores.length - 1, Math.floor(scores.length * p))];
|
|
26
|
+
|
|
27
|
+
console.log(`[probe] ${info.width}x${info.height} ${info.fps.toFixed(2)}fps ${info.duration.toFixed(1)}s ` +
|
|
28
|
+
`${info.hasAudio ? 'audio' : 'no-audio'}${info.hasSubtitle ? ' subtitle' : ''}`);
|
|
29
|
+
console.log(`[scan] ${frames} 帧 / ${ms}ms (${(info.duration / (ms / 1000)).toFixed(1)}x realtime)`);
|
|
30
|
+
console.log(`[分数] p50=${q(0.5).toFixed(1)} p90=${q(0.9).toFixed(1)} p95=${q(0.95).toFixed(1)} ` +
|
|
31
|
+
`p99=${q(0.99).toFixed(1)} max=${scores.at(-1).toFixed(1)}`);
|
|
32
|
+
console.log('[阈值 → 切点数 → 平均间隔]');
|
|
33
|
+
const step = Math.max(1, Number(opt.step));
|
|
34
|
+
for (let th = 10; th <= 60; th += step) {
|
|
35
|
+
const hits = stats.filter((s) => s.score >= th).map((s) => s.t);
|
|
36
|
+
const gaps = hits.slice(1).map((t, i) => t - hits[i]);
|
|
37
|
+
const minGap = gaps.length ? Math.min(...gaps) : NaN;
|
|
38
|
+
const near = gaps.filter((g) => g < 1.0).length;
|
|
39
|
+
console.log(` ${String(th).padStart(3)} → ${String(hits.length).padStart(4)} 个` +
|
|
40
|
+
` → 平均 ${hits.length > 1 ? (info.duration / hits.length).toFixed(1) : '—'}s/个` +
|
|
41
|
+
` → 最短间隔 ${Number.isFinite(minGap) ? minGap.toFixed(2) + 's' : '—'}` +
|
|
42
|
+
` → <1s 的密集簇 ${near} 处`);
|
|
43
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* scan-video — 对任意视频跑一遍探测 + HSV 镜头切分,打印切点与分数。
|
|
4
|
+
*
|
|
5
|
+
* node bin/scan-video.mjs <video> [cells]
|
|
6
|
+
*
|
|
7
|
+
* 用途:调阈值。先看 cuts 与 top peaks,再决定 threshold 要不要动。
|
|
8
|
+
*/
|
|
9
|
+
import { probeVideo } from '../src/storyboard/probe.js';
|
|
10
|
+
import { scanShots } from '../src/storyboard/scan.js';
|
|
11
|
+
import { fitSegments, segmentsFromCuts, totalDur } from '../src/storyboard/segments.js';
|
|
12
|
+
|
|
13
|
+
const [, , input, cellsArg] = process.argv;
|
|
14
|
+
if (!input) {
|
|
15
|
+
console.error('usage: node bin/scan-video.mjs <video> [cells]');
|
|
16
|
+
process.exit(2);
|
|
17
|
+
}
|
|
18
|
+
const cells = Number(cellsArg) || 9;
|
|
19
|
+
|
|
20
|
+
const info = await probeVideo(input);
|
|
21
|
+
console.log(`[probe] ${info.width}x${info.height} ${info.fps.toFixed(2)}fps ${info.duration.toFixed(2)}s` +
|
|
22
|
+
`${info.rotation ? ` rotation=${info.rotation}` : ''}${info.hasAudio ? ' audio' : ''}${info.hasSubtitle ? ' subtitle' : ''}`);
|
|
23
|
+
|
|
24
|
+
const t0 = Date.now();
|
|
25
|
+
const { cuts, stats, frames, threshold } = await scanShots({ input, fps: info.fps });
|
|
26
|
+
const ms = Date.now() - t0;
|
|
27
|
+
|
|
28
|
+
console.log(`[scan] ${frames} frames, ${cuts.length} cuts (threshold ${threshold}), ${ms}ms (${(info.duration / (ms / 1000)).toFixed(1)}x realtime)`);
|
|
29
|
+
for (const c of cuts) console.log(` ${c.t.toFixed(2)}s score=${c.score.toFixed(1)}`);
|
|
30
|
+
|
|
31
|
+
const segs = segmentsFromCuts(info.duration, cuts.map((c) => c.t));
|
|
32
|
+
console.log(`[segments] ${segs.length} 段 总长 ${totalDur(segs).toFixed(2)}s`);
|
|
33
|
+
const fitted = fitSegments(segs, cells);
|
|
34
|
+
console.log(`[fitted] 调到 ${fitted.length} 段(目标 ${cells})`);
|
|
35
|
+
for (const [a, b] of fitted) console.log(` ${a.toFixed(2)}–${b.toFixed(2)} (${(b - a).toFixed(2)}s)`);
|
|
36
|
+
|
|
37
|
+
const top = [...stats].sort((a, b) => b.score - a.score).slice(0, 5);
|
|
38
|
+
console.log('[top peaks] ' + top.map((s) => `${s.t.toFixed(2)}s:${s.score.toFixed(0)}`).join(' '));
|