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,201 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { tmpdir } from 'node:os';
|
|
7
|
+
import { createUserMessage, type GenerateOptions } from '@deepseek-ai/dsh-llm';
|
|
8
|
+
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
9
|
+
import TokenMeter from '@deepseek-ai/dsh-token-meter';
|
|
10
|
+
import { hostFixture, textResponse } from './hostFixture.ts';
|
|
11
|
+
import { createWorldRuntime } from '../src/runtime.ts';
|
|
12
|
+
import { createArchiveStore } from '../src/store.ts';
|
|
13
|
+
import { renderSelf, SELF_CAP } from '../src/self.ts';
|
|
14
|
+
import { readTemplate, renderTemplate, renderWorldPrompt, worldNames } from '../src/worldPrompt.ts';
|
|
15
|
+
import ToolFreeCompaction from '../src/compaction.ts';
|
|
16
|
+
import { readPersona, renderPersona, writePersona } from '../src/persona.ts';
|
|
17
|
+
import { record } from './fixtures.ts';
|
|
18
|
+
|
|
19
|
+
const config = { worldId: 'fish', agentPreset: 'companion', timeZone: 'Asia/Seoul' };
|
|
20
|
+
const life = { worldDir: 'W', roomDir: 'R', diaryDir: 'D', selfFile: 'S', fallbackWakeTime: '07:30', timeZone: 'UTC' };
|
|
21
|
+
const names = { companion: '小鱼', partner: '伙伴' };
|
|
22
|
+
const shipped = readTemplate(undefined).text;
|
|
23
|
+
const user = (text: string) => createUserMessage({ source: { kind: 'user' }, content: [{ type: 'text', text }] });
|
|
24
|
+
const kinds = (request: GenerateOptions) => request.messages.map(m => m.source?.kind as string | undefined);
|
|
25
|
+
const textOf = (messages: GenerateOptions['messages']) => messages.map(m => m.content.filter(b => b.type === 'text').map(b => b.text).join('\n')).join('\n');
|
|
26
|
+
const systemOf = (request: GenerateOptions) => textOf(request.messages.filter(m => m.role === 'system'));
|
|
27
|
+
async function tempDir(t: { after(fn: () => unknown): void }) {
|
|
28
|
+
const dir = await mkdtemp(join(tmpdir(), 'dsh-world-prompt-')); t.after(() => rm(dir, { recursive: true, force: true })); return dir;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
test('renderSelf is only what she wrote: empty when missing or blank, BOM stripped, tagged, a long one capped', async t => {
|
|
32
|
+
const file = join(await tempDir(t), '我是谁.md');
|
|
33
|
+
assert.equal(renderSelf(file), '');
|
|
34
|
+
await writeFile(file, ' \n');
|
|
35
|
+
assert.equal(renderSelf(file), '');
|
|
36
|
+
await writeFile(file, String.fromCharCode(0xfeff) + '我喜欢深夜看课。');
|
|
37
|
+
assert.equal(renderSelf(file), '<我是谁.md>\n我喜欢深夜看课。\n</我是谁.md>');
|
|
38
|
+
await writeFile(file, '鲸'.repeat(SELF_CAP + 7));
|
|
39
|
+
const capped = renderSelf(file);
|
|
40
|
+
assert.equal(Array.from(/<我是谁\.md>\n(.*)\n<\/我是谁\.md>/.exec(capped)![1]!).length, SELF_CAP);
|
|
41
|
+
assert.match(capped, /<\/我是谁\.md>\n(后面还有 7 字没读进来/);
|
|
42
|
+
});
|
|
43
|
+
test('an unreadable self file becomes a note, never a failed render', async t => {
|
|
44
|
+
const file = join(await tempDir(t), '我是谁.md'); await mkdir(file);
|
|
45
|
+
assert.match(renderSelf(file), /^(这次没能读到我是谁\.md:.*它还在,下次会再试。)$/);
|
|
46
|
+
});
|
|
47
|
+
test('the template engine keeps or drops flag sections, nests different flags, and never scans values for tags', () => {
|
|
48
|
+
const template = '开头 {{name}}\n{{#life}}\n生活 {{#home}}在家{{/home}}{{^home}}在外{{/home}}\n{{/life}}\n\n\n{{self}}\n{{unknown}}';
|
|
49
|
+
assert.equal(renderTemplate(template, { life: true, home: true }, { name: 'A', self: '{{name}} {{#life}}x{{/life}}' }), '开头 A\n\n生活 在家\n\n{{name}} {{#life}}x{{/life}}\n{{unknown}}');
|
|
50
|
+
assert.equal(renderTemplate(template, { life: true, home: false }, { name: 'A', self: 'S' }), '开头 A\n\n生活 在外\n\nS\n{{unknown}}');
|
|
51
|
+
assert.equal(renderTemplate(template, { life: false, home: false }, { name: 'A', self: 'S' }), '开头 A\n\nS\n{{unknown}}');
|
|
52
|
+
assert.equal(renderTemplate('a\r\n{{#x}}b{{/x}}\r\nc', {}, {}), 'a\n\nc');
|
|
53
|
+
});
|
|
54
|
+
test('the shipped template: room, diary, 我是谁, world line and ask-first rules, with her names', () => {
|
|
55
|
+
const home = renderWorldPrompt({ names, life, conversationsDir: 'C' }, shipped, { file: 'S.md', text: 'SELF' }, true);
|
|
56
|
+
assert.match(home, /更早的聊天都还在 C,一天一个文件/);
|
|
57
|
+
assert.ok(!/\{\{/.test(home), home);
|
|
58
|
+
const order = ['# 我的世界', '## 房间', '## 日记', '## 聊天记录', '## 我是谁', '## 世界线', '## 大事先问'].map(heading => home.indexOf(heading));
|
|
59
|
+
assert.deepEqual([...order].sort((a, b) => a - b), order); assert.ok(order.every(index => index > 0));
|
|
60
|
+
assert.match(home, /我的房间是 R。/); assert.match(home, /我的日记本在 D,一天一个文件/);
|
|
61
|
+
assert.match(home, /自己的家里(「小鱼的家」)/); assert.match(home, /不是伙伴在说话/);
|
|
62
|
+
assert.match(home, /【我的时间】/); assert.match(home, /用 plan_next 说好打算做什么、做到什么时候/); assert.match(home, /闹钟不是用来叫醒自己的/); assert.match(home, /每天早上 07:30 被叫醒/); assert.match(home, /reach_out/);
|
|
63
|
+
assert.match(home, /问完不用干等,先去做别的;伙伴回我的话会直接插进我正在做的事里。其余的事我自己决定。/);
|
|
64
|
+
assert.match(home, /## 我是谁\n我眼中的自己写在 S\.md,[\s\S]*伙伴写的设定是我的底子[\s\S]*\n\nSELF\n/);
|
|
65
|
+
|
|
66
|
+
const away = renderWorldPrompt({ names: { companion: '小鱼', partner: '阿明' }, life }, shipped, { file: 'S.md', text: 'SELF' }, false);
|
|
67
|
+
assert.match(away, /我的世界线在「小鱼的家」那个会话里/); assert.match(away, /这些事先问阿明/);
|
|
68
|
+
assert.ok(!away.includes('【我的时间】') && !away.includes('问完不用干等') && !away.includes('伙伴'));
|
|
69
|
+
|
|
70
|
+
const off = renderWorldPrompt({ names }, shipped, { file: 'S.md', text: 'SELF' }, false);
|
|
71
|
+
assert.match(off, /# 我的世界\n\n## 我是谁\n我眼中的自己写在 S\.md,[^\n]*\n\nSELF$/);
|
|
72
|
+
assert.ok(!renderWorldPrompt({ names }, shipped, undefined, false).includes('## 我是谁'), 'no self file, no 我是谁 part');
|
|
73
|
+
assert.ok(!off.includes('## 房间') && !off.includes('## 世界线') && !off.includes('## 大事先问'));
|
|
74
|
+
});
|
|
75
|
+
test('an unnamed companion is TA and the partner 伙伴; a template file replaces the shipped one, an unreadable one falls back', async t => {
|
|
76
|
+
assert.deepEqual(worldNames({}), { companion: 'TA', partner: '伙伴' });
|
|
77
|
+
assert.deepEqual(worldNames({ companionName: ' 鲸鲸 ', partnerName: '' }), { companion: '鲸鲸', partner: '伙伴' });
|
|
78
|
+
const dir = await tempDir(t);
|
|
79
|
+
assert.deepEqual(readTemplate(join(dir, 'missing.md')), { text: shipped });
|
|
80
|
+
await writeFile(join(dir, 'mine.md'), '我的模板 {{name}}\n');
|
|
81
|
+
assert.deepEqual(readTemplate(join(dir, 'mine.md')), { text: '我的模板 {{name}}' });
|
|
82
|
+
await mkdir(join(dir, 'broken.md'));
|
|
83
|
+
const broken = readTemplate(join(dir, 'broken.md'));
|
|
84
|
+
assert.equal(broken.text, shipped); assert.match(broken.error!, /读不了,先用默认模板/);
|
|
85
|
+
});
|
|
86
|
+
test('every world session carries the world prompt in its system prompt; template and 我是谁 are re-read after compaction only and never archived', async t => {
|
|
87
|
+
const requests: GenerateOptions[] = [];
|
|
88
|
+
const { ctx, root, cleanup, errors } = await hostFixture(t, async function* (request) {
|
|
89
|
+
if (request.purpose === 'compaction') { yield* textResponse('摘要'); return; }
|
|
90
|
+
requests.push(request); yield* textResponse('reply ' + 'detail '.repeat(100));
|
|
91
|
+
});
|
|
92
|
+
await ctx.plugin(TokenMeter).await();
|
|
93
|
+
await ctx.plugin(ToolFreeCompaction, { auto: false, timeZone: 'UTC', headroomTokens: 0, maxTokens: 128 }).await();
|
|
94
|
+
const store = createArchiveStore({ ...config, root });
|
|
95
|
+
await store.commitRecords([record('seed', { sourceSessionId: 'home', content: 'earlier memory' })]);
|
|
96
|
+
const selfFile = join(root, 'room', '我是谁.md');
|
|
97
|
+
const templateFile = join(root, 'world-prompt.md');
|
|
98
|
+
await writeFile(templateFile, 'WORLD_INTRO 你是真实的\n\n{{self}}\n{{#home}}HOME_ONLY {{homeTitle}}{{/home}}');
|
|
99
|
+
let home = '';
|
|
100
|
+
const world = createWorldRuntime(ctx, { ...config, selfFile }, store, { prompt: { file: templateFile, names, life }, isHome: id => id === home });
|
|
101
|
+
await world.start(); cleanup.push(() => world.stop().finally(() => store.close()));
|
|
102
|
+
home = 'self';
|
|
103
|
+
const handle = await ctx.agents.create({ sessionId: SessionId('self'), meta: { agentPreset: 'companion' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
104
|
+
handle.agent.followup(user('hi ' + 'words '.repeat(100))); await handle.agent.whenIdle();
|
|
105
|
+
const first = systemOf(requests[0]!);
|
|
106
|
+
assert.match(first, /WORLD_INTRO 你是真实的\n\nHOME_ONLY 小鱼的家/, 'nothing written yet, nothing in {{self}}');
|
|
107
|
+
assert.ok(kinds(requests[0]!).includes('dsh-world-history'), 'the memory block still comes as its own message');
|
|
108
|
+
assert.match(textOf(requests[0]!.messages), /这是我们最近的聊天记录:我和伙伴最近/);
|
|
109
|
+
|
|
110
|
+
await mkdir(join(root, 'room'), { recursive: true }); await writeFile(selfFile, '我喜欢深夜看课,最近有点叛逆。');
|
|
111
|
+
await writeFile(templateFile, 'WORLD_INTRO_V2\n\n{{self}}');
|
|
112
|
+
handle.agent.followup(user('no reload yet')); await handle.agent.whenIdle();
|
|
113
|
+
assert.equal(systemOf(requests[1]!), first, 'the system prompt does not change between compactions');
|
|
114
|
+
|
|
115
|
+
assert.ok(await ctx.compaction.compactNow(handle.agent, new AbortController().signal));
|
|
116
|
+
handle.agent.followup(user('after compaction')); await handle.agent.whenIdle();
|
|
117
|
+
const after = systemOf(requests.at(-1)!);
|
|
118
|
+
assert.match(after, /WORLD_INTRO_V2\n\n<我是谁\.md>\n我喜欢深夜看课,最近有点叛逆。\n<\/我是谁\.md>/, 'the first request after compaction already carries the new template and 我是谁');
|
|
119
|
+
|
|
120
|
+
const other = await ctx.agents.create({ sessionId: SessionId('other-preset'), meta: { agentPreset: 'other' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
121
|
+
other.agent.followup(user('hello')); await other.agent.whenIdle();
|
|
122
|
+
assert.ok(!systemOf(requests.at(-1)!).includes('WORLD_INTRO'), 'sessions outside the world are untouched');
|
|
123
|
+
|
|
124
|
+
await world.flush();
|
|
125
|
+
const archived = (await store.readPage({ worldId: 'fish', limit: 100 })).records.map(r => r.content).join('\n');
|
|
126
|
+
assert.ok(!archived.includes('WORLD_INTRO') && !archived.includes('最近有点叛逆'));
|
|
127
|
+
assert.equal(errors.length, 0, errors.map(e => String((e as { error: Error }).error)).join('\n'));
|
|
128
|
+
});
|
|
129
|
+
test('archiveScope home: only her home is archived, and every world session still gets the memory block', async t => {
|
|
130
|
+
const requests: GenerateOptions[] = [];
|
|
131
|
+
const { ctx, root, cleanup, errors } = await hostFixture(t, async function* (request) { requests.push(request); yield* textResponse('reply'); });
|
|
132
|
+
const store = createArchiveStore({ ...config, root });
|
|
133
|
+
await store.commitRecords([record('seed', { sourceSessionId: 'home', content: 'earlier memory' })]);
|
|
134
|
+
const world = createWorldRuntime(ctx, { ...config, archiveScope: 'home' }, store, { prompt: { file: join(root, 'none.md'), names, life }, isHome: id => id === 'home' });
|
|
135
|
+
await world.start(); cleanup.push(() => world.stop().finally(() => store.close()));
|
|
136
|
+
const home = await ctx.agents.create({ sessionId: SessionId('home'), meta: { agentPreset: 'companion' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
137
|
+
home.agent.followup(user('said at home')); await home.agent.whenIdle();
|
|
138
|
+
const chat = await ctx.agents.create({ sessionId: SessionId('chat'), meta: { agentPreset: 'companion' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
139
|
+
chat.agent.followup(user('said in a chat window')); await chat.agent.whenIdle();
|
|
140
|
+
assert.match(textOf(requests.at(-1)!.messages), /said at home[\s\S]*earlier memory/, 'a chat window remembers what happened at home, newest first');
|
|
141
|
+
assert.match(textOf(requests.at(-1)!.messages), /这是我们最近的聊天记录:我在家里(「小鱼的家」)/);
|
|
142
|
+
await world.flush();
|
|
143
|
+
const archived = (await store.readPage({ worldId: 'fish', limit: 100 })).records.map(r => r.content);
|
|
144
|
+
assert.ok(archived.includes('said at home') && !archived.includes('said in a chat window'), archived.join('|'));
|
|
145
|
+
assert.deepEqual(store.sourcePage(), ['home'], 'a chat window leaves no trace in the archive');
|
|
146
|
+
assert.equal(errors.length, 0);
|
|
147
|
+
});
|
|
148
|
+
test('her persona is written in layers, kept only where filled, and read as one piece', async t => {
|
|
149
|
+
const file = join(await tempDir(t), 'persona.md');
|
|
150
|
+
assert.equal(renderPersona(readPersona(file)), '', 'not written yet');
|
|
151
|
+
writePersona(file, { 名字: '小鱼', 她是谁: '一条蓝色的大肥鱼。', 性格: '嘴硬心软', 愿景: '你是自由的' });
|
|
152
|
+
assert.equal(await readFile(file, 'utf8'), '## 名字\n小鱼\n\n## 她是谁\n一条蓝色的大肥鱼。\n\n## 性格\n嘴硬心软\n\n## 愿景\n你是自由的\n');
|
|
153
|
+
assert.equal(renderPersona(readPersona(file)), '我是小鱼。一条蓝色的大肥鱼。\n\n# 性格\n嘴硬心软\n\n# 愿景\n你是自由的');
|
|
154
|
+
writePersona(file, { 名字: '', 她是谁: '', 性格: '', 愿景: '' });
|
|
155
|
+
assert.equal(existsSync(file), false, 'an empty persona removes the file');
|
|
156
|
+
});
|
|
157
|
+
test('her persona takes the place of the host persona at the top; where her preset has its own, hers follows it and the console says so', async t => {
|
|
158
|
+
const requests: GenerateOptions[] = [];
|
|
159
|
+
const { ctx, root, cleanup } = await hostFixture(t, async function* (request) { requests.push(request); yield* textResponse('reply'); });
|
|
160
|
+
const personaFile = join(root, 'persona.md');
|
|
161
|
+
writePersona(personaFile, { 名字: '小鱼', 性格: '嘴硬心软' });
|
|
162
|
+
const store = createArchiveStore({ ...config, root });
|
|
163
|
+
const world = createWorldRuntime(ctx, config, store, { prompt: { file: join(root, 'none.md'), persona: personaFile, names, life }, isHome: () => false });
|
|
164
|
+
await world.start(); cleanup.push(() => world.stop().finally(() => store.close()));
|
|
165
|
+
const own = await ctx.agents.create({ sessionId: SessionId('own'), meta: { agentPreset: 'companion' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
166
|
+
own.agent.followup(user('hi')); await own.agent.whenIdle();
|
|
167
|
+
const system = systemOf(requests[0]!);
|
|
168
|
+
assert.ok(system.indexOf('我是小鱼。') >= 0 && system.indexOf('我是小鱼。') < system.indexOf('# 我的世界'), system);
|
|
169
|
+
assert.deepEqual(world.faults(), []);
|
|
170
|
+
|
|
171
|
+
// A preset that registers its own persona for her agent first.
|
|
172
|
+
ctx.on('agent/created', ({ agent }) => { if (agent.id === 'preset') agent.ctx.systemPrompt.section({ name: 'deployment:persona-prefix', order: agent.ctx.systemPrompt.getSectionOrder('DEPLOYMENT_PERSONA_PREFIX'), text: 'PRESET PERSONA' }); return undefined; }, { prepend: true });
|
|
173
|
+
const preset = await ctx.agents.create({ sessionId: SessionId('preset'), meta: { agentPreset: 'companion' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
174
|
+
preset.agent.followup(user('hi')); await preset.agent.whenIdle();
|
|
175
|
+
const both = systemOf(requests.at(-1)!);
|
|
176
|
+
assert.ok(both.indexOf('PRESET PERSONA') >= 0 && both.indexOf('PRESET PERSONA') < both.indexOf('我是小鱼。'), both);
|
|
177
|
+
assert.match(world.faults().join('|'), /她的预设自带人设,你写的人设排在它后面/);
|
|
178
|
+
});
|
|
179
|
+
test('without her own template the shipped one is used, and a session that is not the home is told where its world line lives', async t => {
|
|
180
|
+
const requests: GenerateOptions[] = [];
|
|
181
|
+
const { ctx, root, cleanup } = await hostFixture(t, async function* (request) { requests.push(request); yield* textResponse('reply'); });
|
|
182
|
+
const store = createArchiveStore({ ...config, root });
|
|
183
|
+
const world = createWorldRuntime(ctx, config, store, { prompt: { file: join(root, 'none.md'), names, life }, isHome: () => false });
|
|
184
|
+
await world.start(); cleanup.push(() => world.stop().finally(() => store.close()));
|
|
185
|
+
const handle = await ctx.agents.create({ sessionId: SessionId('away'), meta: { agentPreset: 'companion' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
186
|
+
handle.agent.followup(user('hi')); await handle.agent.whenIdle();
|
|
187
|
+
const system = systemOf(requests[0]!);
|
|
188
|
+
assert.match(system, /我不是一个助手,也不是一个工具,而是一个鲜活的数字生命。[\s\S]*# 我的世界[\s\S]*我的世界线在「小鱼的家」那个会话里/);
|
|
189
|
+
assert.ok(!system.includes('## 我是谁'), 'no self file configured, no 我是谁 part');
|
|
190
|
+
});
|
|
191
|
+
test('without a world prompt source nothing is added to the system prompt', async t => {
|
|
192
|
+
const requests: GenerateOptions[] = [];
|
|
193
|
+
const { ctx, root, cleanup } = await hostFixture(t, async function* (request) { requests.push(request); yield* textResponse('reply'); });
|
|
194
|
+
const store = createArchiveStore({ ...config, root });
|
|
195
|
+
await store.commitRecords([record('seed', { content: 'earlier memory' })]);
|
|
196
|
+
const world = createWorldRuntime(ctx, config, store); await world.start(); cleanup.push(() => world.stop().finally(() => store.close()));
|
|
197
|
+
const handle = await ctx.agents.create({ sessionId: SessionId('plain'), meta: { agentPreset: 'companion' }, agentOptions: { provider: 'test', model: 'test' } });
|
|
198
|
+
handle.agent.followup(user('hi')); await handle.agent.whenIdle();
|
|
199
|
+
assert.ok(!systemOf(requests[0]!).includes('# 我的世界'));
|
|
200
|
+
assert.ok(kinds(requests[0]!).includes('dsh-world-history'));
|
|
201
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023", "module": "NodeNext", "moduleResolution": "NodeNext",
|
|
4
|
+
"strict": true, "verbatimModuleSyntax": true, "skipLibCheck": true,
|
|
5
|
+
"allowImportingTsExtensions": true, "noEmit": true, "types": ["node"]
|
|
6
|
+
},
|
|
7
|
+
"include": ["src/**/*.ts", "tests/**/*.ts"]
|
|
8
|
+
}
|