dsh-qqbot-muu 0.1.7 → 0.1.9
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 +21 -0
- package/README.md +22 -1
- package/client/qqbot-settings.js +3 -3
- package/dist/channel-tools.js +1 -1
- package/dist/commands/exit.js +1 -1
- package/dist/features/firstrun.js +1 -1
- package/dist/gateway/bootstrap.js +35 -4
- package/dist/transport/tool-presenter.js +32 -1
- package/dshqqbot/.qqbot-extensions/hooks/bili-scheduler.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/hooks/interview-panel.mjs +1 -1
- package/dshqqbot/.qqbot-extensions/hooks/overlay-check.mjs +33 -2
- package/dshqqbot/.qqbot-extensions/hooks/pet-gate-agent.mjs +33 -2
- package/dshqqbot/.qqbot-extensions/inbound/aa-memory-recall.mjs +33 -2
- package/dshqqbot/.qqbot-extensions/inbound/az-bili-remember.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/inbound/az-feedback.mjs +34 -3
- package/dshqqbot/.qqbot-extensions/inbound/no-wake-on-child-quote.mjs +1 -1
- package/dshqqbot/.qqbot-extensions/inbound/router-observe.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/interview/keepalive.bat +16 -16
- package/dshqqbot/.qqbot-extensions/interview/page.html +1 -1
- package/dshqqbot/.qqbot-extensions/interview/start-interview.mjs +151 -151
- package/dshqqbot/.qqbot-extensions/lib/atomic-write.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/lib/bili-ops.mjs +39 -8
- package/dshqqbot/.qqbot-extensions/lib/comment-watch.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/lib/draw-core.mjs +35 -4
- package/dshqqbot/.qqbot-extensions/lib/embedder.mjs +6 -3
- package/dshqqbot/.qqbot-extensions/lib/local-llm.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/lib/memory-db.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/lib/memory-panel-core.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/lib/person-link.mjs +33 -2
- package/dshqqbot/.qqbot-extensions/lib/safe-fs.mjs +33 -2
- package/dshqqbot/.qqbot-extensions/lib/script-writer.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/lib/tts-core.mjs +34 -3
- package/dshqqbot/.qqbot-extensions/lib/tts-polish.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/live/test/connect-smoke.mjs +1 -1
- package/dshqqbot/.qqbot-extensions/outbound/outbox.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/outbound/split-reply.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/outbound/zz-video-card.mjs +34 -3
- package/dshqqbot/.qqbot-extensions/tools/accounts.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/bili.mjs +33 -2
- package/dshqqbot/.qqbot-extensions/tools/diary.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/draw.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/learn_style.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/lib/game-lib.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/lib/session_watch_lib.mjs +1 -1
- package/dshqqbot/.qqbot-extensions/tools/memory.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/pet_card.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/qq_timer.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/safe_fs.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/sing.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/storyboard.mjs +33 -2
- package/dshqqbot/.qqbot-extensions/tools/surf.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/tools/voice.mjs +32 -1
- package/dshqqbot/.qqbot-extensions/vendor/abogus/test-abogus.mjs +34 -3
- package/index.js +32 -1
- package/install.mjs +34 -3
- package/package.json +3 -2
- package/scripts/backfill-wechat-archive.mjs +35 -4
- package/scripts/check-submission.mjs +16 -8
- package/scripts/douyin-cdp-comment.mjs +33 -2
- package/scripts/douyin-cdp-dm.mjs +33 -2
- package/scripts/douyin-cdp-export.mjs +32 -1
- package/scripts/douyin-cdp-upload.mjs +33 -2
- package/scripts/dsh-instance-guard.mjs +1 -1
- package/scripts/dsh-profile-links.mjs +39 -8
- package/scripts/migrate-scope.mjs +34 -3
- package/scripts/release-check.mjs +4 -3
- package/scripts/sync-plugin-copies.mjs +40 -9
- package/scripts/wechat-full-pull.mjs +32 -1
- package/scripts/wechat-media-pull.mjs +33 -2
- package/settings-host.js +44 -13
- package/scripts/archive-secrets.ps1 +0 -34
- package/scripts/check-secrets.ps1 +0 -30
- package/scripts/fix-dsh-016-presets.ps1 +0 -133
- package/scripts/migrate-appdata.ps1 +0 -112
- package/scripts/push-github.ps1 +0 -31
- package/scripts/recover-pad.ps1 +0 -182
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## 0.1.9
|
|
4
|
+
|
|
5
|
+
### 文档
|
|
6
|
+
- README 新增「默认谁都不会被回(空名单 = 全拒)」一节:写清出厂默认(`care` 模式 + 空名单 = 私聊/群聊一律不回复)、三个添加入口(桌宠面板按名字加 / 配置里填 OpenID / 临时改 `open`),以及自己的 OpenID 在哪看。
|
|
7
|
+
- 市场条目按上游规范迁到 `data/plugins/<owner>__<repo>.yml`,描述里明确写出访问默认值。
|
|
8
|
+
|
|
9
|
+
> 0.1.9 与 0.1.8 的代码完全一致,只补了访问控制的说明与市场提交结构;npm 同版本不可覆盖,所以用新版本号带上这批文档修正。
|
|
10
|
+
|
|
11
|
+
## 0.1.8
|
|
12
|
+
|
|
13
|
+
### 修复
|
|
14
|
+
- **彻底去掉写死的本机绝对路径**:`dist/`、`client/`、`dshqqbot/.qqbot-extensions/`、`scripts/` 里所有 `F:/qqbot/...`、`C:/Users/Administrator/...`、`D:/...` 改成运行期推导(环境变量 → 从模块自身位置往上找仓库根 → cwd),别人机器上不会再指向不存在的目录。
|
|
15
|
+
- `settings-host.js` 里 Chrome 调试实例的 `--user-data-dir=F:\qqbot mp\chrome-dy` 原来会被 JS 解析成制表符 + 相对路径,已改成按仓库根拼接。
|
|
16
|
+
- `tts-core.mjs` 的 Python 兜底不再写死 `E:\Anaconda\python.exe`,改成 `QQBOT_PYTHON` → `python`。
|
|
17
|
+
- `embedder.mjs` 找插件目录不再写死某个用户目录,改成 `USERPROFILE` / `APPDATA` + `DSH_HOME` 推导。
|
|
18
|
+
- `start-interview.mjs` 不再写死 DSH 桌面端安装路径(仍可用 `DSH_DESKTOP_EXE` 覆盖)。
|
|
19
|
+
|
|
20
|
+
### 发版闸门
|
|
21
|
+
- 绝对路径检查现在真的会拦:系统目录(`C:/Windows`、`Program Files`)豁免,其余一律点名。
|
|
22
|
+
- 运维用的 `scripts/*.ps1` 不再打包进 npm 包。
|
|
23
|
+
|
|
3
24
|
## 0.1.7 — 2026-11-18
|
|
4
25
|
|
|
5
26
|
这一版主要是「别再让用户被同样的问题绊倒」:修掉已知 bug、把隐私数据从发布包里清干净、补上升级自检。
|
package/README.md
CHANGED
|
@@ -240,10 +240,31 @@ access:
|
|
|
240
240
|
groupAllow: ['额外放行的群openid']
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
> 不知道 openid
|
|
243
|
+
> 不知道 openid?让对方在群里 @ 她一句或私聊发一句,然后 `harness.log` 搜 `not in allowlist`,括号里就是;
|
|
244
244
|
> care/allowlist 名单为空时启动日志会打醒目提示(不会静默)。
|
|
245
245
|
> 拒绝时日志会打醒目提示(不会静默)。
|
|
246
246
|
|
|
247
|
+
### 默认谁都不会被回(空名单 = 全拒)
|
|
248
|
+
|
|
249
|
+
**这是刻意的安全默认,不是 bug。** 装完 `care` 模式下两份名单都是空的,
|
|
250
|
+
所以**私聊和群聊默认谁都不理**(只记录、不回复)——先把人加进去,她才会开口。
|
|
251
|
+
|
|
252
|
+
三个入口,任选一个(改完 5 秒内生效,不用重启):
|
|
253
|
+
|
|
254
|
+
1. **浮窗「🧠 记忆」页 → 特别关心**:按**名字**加人/加群(最省事,不用 id)。
|
|
255
|
+
2. **配置 `access` 段填 openid**(要精确控制时用):
|
|
256
|
+
```yaml
|
|
257
|
+
access:
|
|
258
|
+
c2cMode: care # care = 只认特别关心 + 下面两个白名单
|
|
259
|
+
c2cAllow: ['对方的 openid'] # 私聊额外放行;"*" = 全放行
|
|
260
|
+
groupMode: care
|
|
261
|
+
groupAllow: ['群的 openid'] # 群聊额外放行
|
|
262
|
+
```
|
|
263
|
+
3. **临时全开**:把 `c2cMode` / `groupMode` 改成 `open`(任何人可用,公开 bot 才建议)。
|
|
264
|
+
|
|
265
|
+
**自己的 openid 在哪看**:对方发一条消息后,`harness.log` 里那条入站记录会带完整 openid;
|
|
266
|
+
浮窗「任务管理」新建任务时也要求填同一串完整 openid(不是尾号)。
|
|
267
|
+
|
|
247
268
|
## 🚀 新装即用(v0.1.7 · 只缺省才写入的默认值)
|
|
248
269
|
|
|
249
270
|
下载插件后**不用手工调**:启动时做一次"补丁式迁移",只往**空位**里补默认值。
|
package/client/qqbot-settings.js
CHANGED
|
@@ -6132,9 +6132,9 @@ html += '<div class="dk-msg" style="font-size:11px;color:#888;line-height:1.6">
|
|
|
6132
6132
|
if (rootBtn) rootBtn.onclick = async function () {
|
|
6133
6133
|
try {
|
|
6134
6134
|
// [qqbot-mod] 2026-10-28: 不再猜路径 —— kind:'bili-jobs' 让宿主用 bili-ops.paths() 给真实产物根
|
|
6135
|
-
// (之前写死
|
|
6135
|
+
// (之前写死 dshqqbot/.qqbot/bili-ops/jobs,真产物在 data/bili-ops/jobs)
|
|
6136
6136
|
var r = await apiPost('open-dir', { kind: 'bili-jobs' })
|
|
6137
|
-
var p = (r && r.path) || '
|
|
6137
|
+
var p = (r && r.path) || 'data/bili-ops/jobs'
|
|
6138
6138
|
var cnt = (r && typeof r.count === 'number') ? r.count : -1
|
|
6139
6139
|
var cntText = cnt < 0 ? '项数未知' : (cnt === 0 ? '空目录:还没渲染过视频' : cnt + ' 项')
|
|
6140
6140
|
var okText = (r && r.ok) ? ('已打开(' + ((r && r.via) || 'explorer') + ',' + cntText + ')') : ('没弹出来:' + ((r && r.error) || '未知原因'))
|
|
@@ -6221,7 +6221,7 @@ html += '<div class="dk-msg" style="font-size:11px;color:#888;line-height:1.6">
|
|
|
6221
6221
|
'画面硬规则(imagePrompt 必须遵守):',
|
|
6222
6222
|
'· 背景统一"深海蓝+月白"柔和色调,有景深层次与地面投影带;',
|
|
6223
6223
|
'· 禁止空旷渐变底、禁止恐怖谷脸、禁手部特写;大字号短句排版由管线字幕负责,画面里不要塞文字;',
|
|
6224
|
-
'·
|
|
6224
|
+
'· 角色形象基准:设定/小蓝_2D三视图_建模基准.png;透明立绘两套:assets/char/pose/*.png(v1 720×980)与 assets/char-v2/pose-alpha/*.png(v2 已抠透明,动作渲染用这套)。',
|
|
6225
6225
|
'',
|
|
6226
6226
|
'规格:orientation=vertical(B站竖屏 1080×1920)。成片目标 ≥60 秒——管线会自动检查:总旁白不足 240 字会拒收重写,所以别拷电报体。',
|
|
6227
6227
|
'音频:dubbing 参数【必传】——主人的选题里写了什么引擎就传什么:提到 IndexTTS/Index → dubbing="index";提到 Breeze → dubbing="breeze";完全没提 → dubbing="gsv"。注意管线有 dubbingOverride(默认强制 index):LLM 怕超时自己改 gsv 也会被拉回来;index 拉起前管线会自动腾卡(停 gsv/breeze),慢是正常的,不要中途重试。',
|
package/dist/channel-tools.js
CHANGED
|
@@ -1945,7 +1945,7 @@ export async function apply(ctx) {
|
|
|
1945
1945
|
'\n最小示例(照抄改值):\n' +
|
|
1946
1946
|
'· 唤醒单发 {session_id:"<uuid>", text:"帮我看下这个"}\n' +
|
|
1947
1947
|
'· 跨群喇叭不唤醒 {peer_id:"<群openid>", scope:"group", text:"公告:…", mode:"append"}\n' +
|
|
1948
|
-
'· 批量(每项自带 text) {batch:[{peer_id:"<g1>",scope:"group",text:"A"},{peer_id:"<g2>",scope:"group",text:"B",media:"
|
|
1948
|
+
'· 批量(每项自带 text) {batch:[{peer_id:"<g1>",scope:"group",text:"A"},{peer_id:"<g2>",scope:"group",text:"B",media:"<图片路径>"}]} ← 用 batch 时**不要再传顶层 text**',
|
|
1949
1949
|
parameters: {
|
|
1950
1950
|
session_id: { type: 'string', description: '目标会话 id(完整 sessionId, 来自 session_list)' },
|
|
1951
1951
|
peer_id: { type: 'string', description: '或按 peer 寻址: 群 openid/私聊 openid(需带 scope)' },
|
package/dist/commands/exit.js
CHANGED
|
@@ -35,7 +35,7 @@ export function selfRestart(delayMs = 1600, killWaitMs = 2000) {
|
|
|
35
35
|
const pid = process.pid;
|
|
36
36
|
const cwd = process.cwd();
|
|
37
37
|
const env = { ...process.env }; // ★ 必须带上,否则 ELECTRON_RUN_AS_NODE / DSH_HOME 会丢
|
|
38
|
-
const logFile = join(process.env.QQBOT_LOG_DIR || '
|
|
38
|
+
const logFile = join(process.env.QQBOT_LOG_DIR || __repoRoot() + '/logs', 'bot-restart.log');
|
|
39
39
|
const helper = [
|
|
40
40
|
"const { spawn } = require('child_process');",
|
|
41
41
|
"const { appendFileSync, mkdirSync, unlinkSync } = require('fs');",
|
|
@@ -226,7 +226,7 @@ export function seedExtensions(opts = {}) {
|
|
|
226
226
|
return 0;
|
|
227
227
|
}
|
|
228
228
|
})();
|
|
229
|
-
// 文本文件顺手把作者机绝对路径改写成这台机器的数据根(否则扩展里写死的
|
|
229
|
+
// 文本文件顺手把作者机绝对路径改写成这台机器的数据根(否则扩展里写死的 <仓库根> 会指向不存在的目录)
|
|
230
230
|
if (size > 0 && size <= REWRITE_MAX_BYTES && /\.(mjs|js|cjs|json|ya?ml|md|txt)$/i.test(e.name)) {
|
|
231
231
|
const raw = readFileSync(abs, 'utf8');
|
|
232
232
|
if (AUTHOR_ROOT_RE.test(raw)) {
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
import { join, resolve, relative, isAbsolute, basename, extname } from 'node:path';
|
|
2
33
|
import { readFileSync as qqReadFileSync, writeFileSync as qqWriteFileSync, mkdirSync as qqMkdirSync, realpathSync as qqRealpathSync, existsSync as qqExistsSync, statSync as qqStatSync } from 'node:fs';
|
|
3
34
|
import { fileURLToPath } from 'node:url';
|
|
@@ -5,10 +36,10 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
36
|
/** 项目根:dist/gateway → 上两级。
|
|
6
37
|
* 2026-11-14:插件被 pnpm 复制进 profiles/web/node_modules/.pnpm/… 之后,上两级成了**包目录**而不是
|
|
7
38
|
* 仓库根,媒体白名单(assets/media/tmp/render/voices)会整体指错。这里优先认「上两级里真有
|
|
8
|
-
* wechat-bridge/util.mjs」的那个,其次 QQBOT_REPO_ROOT,最后回落老部署
|
|
39
|
+
* wechat-bridge/util.mjs」的那个,其次 QQBOT_REPO_ROOT,最后回落老部署 <仓库根>。 */
|
|
9
40
|
const QQBOT_ROOT = (() => {
|
|
10
41
|
const up = resolve(fileURLToPath(new URL('.', import.meta.url)), '..', '..');
|
|
11
|
-
const cands = [up, String(process.env.QQBOT_REPO_ROOT || '').trim(),
|
|
42
|
+
const cands = [up, String(process.env.QQBOT_REPO_ROOT || '').trim(), __repoRoot() + ""].filter(Boolean);
|
|
12
43
|
return cands.find((p) => { try { return qqExistsSync(join(p, 'wechat-bridge', 'util.mjs')) } catch { return false } }) || up;
|
|
13
44
|
})();
|
|
14
45
|
/** 允许出站的本地媒体根目录(P0-4):[MEDIA]/send_media 只能引用这些目录内的文件 */
|
|
@@ -185,7 +216,7 @@ export async function bootstrapGateway(ctx, agents, config, logger, hooks) {
|
|
|
185
216
|
// 纪律:绝不打日志泄露 secret 内容;任何失败静默,不影响启动。
|
|
186
217
|
try {
|
|
187
218
|
const _sec = String(config.appSecret ?? '');
|
|
188
|
-
const _cwd = String(config.cwd ?? '').trim() ||
|
|
219
|
+
const _cwd = String(config.cwd ?? '').trim() || __repoRoot() + "";
|
|
189
220
|
const _nsSafe = myNs.replace(/[^\w.-]/g, '_');
|
|
190
221
|
const _mirrorPath = join(_cwd, 'secrets', 'runtime', `qqbot-account-${_nsSafe}.json`);
|
|
191
222
|
// 自有存储路径(与 settings-host ns-guard 同规则):<DSH_HOME>/qqbot-settings/<profile>/<ns>.json
|
|
@@ -1092,7 +1123,7 @@ export async function bootstrapGateway(ctx, agents, config, logger, hooks) {
|
|
|
1092
1123
|
}
|
|
1093
1124
|
})();
|
|
1094
1125
|
// 2026-11-18(v0.1.7):profile 依赖自检 —— 老用户升级后如果 profile 里还是
|
|
1095
|
-
// "file
|
|
1126
|
+
// "file:<仓库根>" 这种绝对盘符写法,pnpm 会把它当相对路径拼到 profile 目录下、
|
|
1096
1127
|
// 直接 ENOENT → dshmarket 基线立不起来 → 整机进安全模式(2026-11-13 事故一)。
|
|
1097
1128
|
// 这里只在运行期【检测 + 记日志 + 落标记】,不擅自改 profile(改配置会让市场重装,
|
|
1098
1129
|
// 正在跑的实例更危险);真正的修复交给 scripts/dsh-profile-links.mjs。
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
import { appendFileSync, mkdirSync, existsSync, statSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
33
|
/**
|
|
3
34
|
* 工具调用结果 → Markdown 格式化
|
|
@@ -14,7 +45,7 @@ const __qqToolErrorsOnQq = () => {
|
|
|
14
45
|
return v === '1' || v === 'true' || v === 'yes';
|
|
15
46
|
};
|
|
16
47
|
export function toolErrorLogPath() {
|
|
17
|
-
const root = String(process.env.QQBOT_MEMORY_DATA_ROOT ||
|
|
48
|
+
const root = String(process.env.QQBOT_MEMORY_DATA_ROOT || __repoRoot() + "/dshqqbot").replace(/[/]+$/, "");
|
|
18
49
|
return root + '/.qqbot/tool-errors.jsonl';
|
|
19
50
|
}
|
|
20
51
|
function __qqWriteToolError(name, err) {
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
/**
|
|
2
33
|
* hooks/bili-scheduler.mjs — B 站定时任务
|
|
3
34
|
*
|
|
@@ -11,7 +42,7 @@ import { appendFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
|
|
11
42
|
import { join } from 'node:path';
|
|
12
43
|
import * as B from '../lib/bili-api.mjs';
|
|
13
44
|
|
|
14
|
-
const DATA_ROOT_FALLBACK =
|
|
45
|
+
const DATA_ROOT_FALLBACK = __repoRoot() + "/dshqqbot";
|
|
15
46
|
|
|
16
47
|
function dataRootOf(cfg) {
|
|
17
48
|
const env = String(process.env.QQBOT_MEMORY_DATA_ROOT || '').trim();
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
// overlay-check.mjs — 启动时自检「补丁是否还活着」(主人 2026-10-27 需求)
|
|
2
33
|
//
|
|
3
34
|
// 背景:所有定制都打在 profiles/.generations/live/…/@zaofan/dsh-qqbot 的文件上,
|
|
@@ -121,7 +152,7 @@ export async function run(env) {
|
|
|
121
152
|
} else {
|
|
122
153
|
logger.warn?.(`[overlay-check] ⚠️ 检测到 ${out.missing.length} 个定制缺失(多半是上游升级换了 generation)——`)
|
|
123
154
|
for (const m of out.missing) logger.warn?.(`[overlay-check] ✗ ${m.desc}(标记 ${m.mark} 不在 ${m.file};重放:qqbot-mod/patches/${m.fix}${String(m.fix).endsWith('.mjs') ? ' --apply' : ''})`)
|
|
124
|
-
logger.warn?.('[overlay-check] 修复方式:node
|
|
155
|
+
logger.warn?.('[overlay-check] 修复方式:node <仓库根>/qqbot-mod/patches/<对应脚本> --apply,或 live-overlay/install.mjs --apply 三路合并整体重放')
|
|
125
156
|
// ── 自动重放(主人 2026-10-27:上游升级不能影响我们)──
|
|
126
157
|
// 走三路合并(base=官方基线 / ours=定制 / live=新 generation),只撞行才冲突,冲突不写盘。
|
|
127
158
|
// 护栏:① 环境变量 QQBOT_AUTO_REPLAY=0 关闭;② 同一 generation 最多自动试 2 次;
|
|
@@ -129,7 +160,7 @@ export async function run(env) {
|
|
|
129
160
|
try {
|
|
130
161
|
const AUTO = String(process.env.QQBOT_AUTO_REPLAY ?? '1') !== '0'
|
|
131
162
|
const DRY = String(process.env.QQBOT_REPLAY_DRY ?? '') === '1'
|
|
132
|
-
const REPO =
|
|
163
|
+
const REPO = __repoRoot() + ""
|
|
133
164
|
const INSTALLER = REPO + '/qqbot-mod/patches/live-overlay/install.mjs'
|
|
134
165
|
const stateDir = join(env.dataRoot || '', '.qqbot-extensions', 'hooks', 'data')
|
|
135
166
|
const statePath = join(stateDir, 'overlay-replay-state.json')
|
|
@@ -1,8 +1,39 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
/**
|
|
2
33
|
* hooks/pet-gate-agent.mjs — 公网桌宠网关的本机连接器自启动(2026-11-01)
|
|
3
34
|
*
|
|
4
35
|
* 职责:DSH 启动时若 pet-gate/secrets.json 已配置 cloudUrl,就 spawn 一个
|
|
5
|
-
* detached 的 `node pet-gate/agent.mjs`
|
|
36
|
+
* detached 的 `node pet-gate/agent.mjs` 子进程(<仓库根>)。
|
|
6
37
|
* agent 自己断线重连、失败退避;这里只负责拉起 + 每 10 分钟巡检补拉。
|
|
7
38
|
* 主人手动管理:node pet-gate/agent.mjs status / reset-seat / new-key
|
|
8
39
|
*
|
|
@@ -13,7 +44,7 @@ import { spawn } from 'node:child_process';
|
|
|
13
44
|
import { join, dirname } from 'node:path';
|
|
14
45
|
import { fileURLToPath } from 'node:url';
|
|
15
46
|
|
|
16
|
-
const GATE_DIR =
|
|
47
|
+
const GATE_DIR = __repoRoot() + "/pet-gate";
|
|
17
48
|
const AGENT = join(GATE_DIR, 'agent.mjs');
|
|
18
49
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
19
50
|
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
/**
|
|
2
33
|
* memory-recall.mjs — 入站时按需召回长期记忆(Neuro 式「检索而非重放」)
|
|
3
34
|
*
|
|
@@ -86,7 +117,7 @@ export const name = 'aa-memory-recall';
|
|
|
86
117
|
function dataRootOf(cfg) {
|
|
87
118
|
const env = String(process.env.QQBOT_MEMORY_DATA_ROOT || '').trim();
|
|
88
119
|
if (env) return env;
|
|
89
|
-
return (cfg && cfg.dataRoot) ||
|
|
120
|
+
return (cfg && cfg.dataRoot) || __repoRoot() + "/dshqqbot";
|
|
90
121
|
}
|
|
91
122
|
|
|
92
123
|
/** 会话作用域:群按群 openid,私聊按用户 openid */
|
|
@@ -177,7 +208,7 @@ function worthRemembering(text, cfg) {
|
|
|
177
208
|
// 模型照样看得见(语义不变);只有真变了才注入一份新的(新版在后,模型取最新)。
|
|
178
209
|
// 快块([记忆]召回/[状态]/[echo])是为当前句服务的,保持每条,但连续相同内容也跳过。
|
|
179
210
|
const _slowBlockMemo = new Map(); // key: scope+'|'+tag → 上次注入文本
|
|
180
|
-
let _lastRoot =
|
|
211
|
+
let _lastRoot = __repoRoot() + "/dshqqbot"; // onInbound 每轮刷新,供 blockIfChanged 持久化记账用
|
|
181
212
|
// 2026-10-29:召回源判重——key: scope → 上次实际注入的那批记忆源文本指纹。
|
|
182
213
|
// 连续同话题时同一批旧记忆不再每条重发(历史里上一份仍在,模型照样看得见)。
|
|
183
214
|
const _recallSrcMemo = new Map();
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
/**
|
|
2
33
|
* inbound/az-bili-remember.mjs — 谁来群里丢了个 B 站视频,就记住是哪个(问题 C)
|
|
3
34
|
*
|
|
@@ -24,7 +55,7 @@ import * as B from '../lib/bili-api.mjs';
|
|
|
24
55
|
|
|
25
56
|
export const name = 'az-bili-remember';
|
|
26
57
|
|
|
27
|
-
const DATA_ROOT_FALLBACK =
|
|
58
|
+
const DATA_ROOT_FALLBACK = __repoRoot() + "/dshqqbot";
|
|
28
59
|
|
|
29
60
|
function dataRootOf(ctx) {
|
|
30
61
|
const fromCtx = String((ctx && ctx.dataRoot) || '').trim();
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
/**
|
|
2
33
|
* az-feedback.mjs — 把“用户对刚才回复的真实评价”收进记忆,喂给自我反思
|
|
3
34
|
*
|
|
@@ -33,10 +64,10 @@ function dataRootOf() {
|
|
|
33
64
|
const env = String(process.env.QQBOT_MEMORY_DATA_ROOT || '').trim();
|
|
34
65
|
if (env) return env;
|
|
35
66
|
try {
|
|
36
|
-
const cfg = loadConfig(
|
|
37
|
-
return (cfg && cfg.dataRoot) ||
|
|
67
|
+
const cfg = loadConfig(__repoRoot() + "/dshqqbot");
|
|
68
|
+
return (cfg && cfg.dataRoot) || __repoRoot() + "/dshqqbot";
|
|
38
69
|
} catch {
|
|
39
|
-
return
|
|
70
|
+
return __repoRoot() + "/dshqqbot";
|
|
40
71
|
}
|
|
41
72
|
}
|
|
42
73
|
|
|
@@ -156,7 +156,7 @@ async function loadLib() {
|
|
|
156
156
|
* ⇒ 真机上完全静默、无法定位。" 本扩展此前一直用 `ctx.logger.debug` ⇒ 等于瞎的,
|
|
157
157
|
* 导致"引用回流没投递"排查了三轮全靠猜。此后所有关键判定一律 `appendDiag` 落盘。
|
|
158
158
|
*/
|
|
159
|
-
const DIAG_FILE = '
|
|
159
|
+
const DIAG_FILE = __repoRoot() + '/dshqqbot/.qqbot-extensions/data/no-wake-diag.log';
|
|
160
160
|
|
|
161
161
|
async function appendDiag(line) {
|
|
162
162
|
try {
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { existsSync as __existsSync } from 'node:fs'
|
|
2
|
+
const __repoRoot = (() => {
|
|
3
|
+
let cached = ''
|
|
4
|
+
const norm = (p) => String(p || '').split(String.fromCharCode(92)).join('/')
|
|
5
|
+
return () => {
|
|
6
|
+
if (cached) return cached
|
|
7
|
+
const cands = []
|
|
8
|
+
const env = String(process.env.QQBOT_ROOT || process.env.QQBOT_REPO_ROOT || '').trim()
|
|
9
|
+
if (env) cands.push(norm(env))
|
|
10
|
+
try {
|
|
11
|
+
let here = decodeURIComponent(new URL('.', import.meta.url).pathname)
|
|
12
|
+
if (here[0] === '/' && here[2] === ':') here = here.slice(1)
|
|
13
|
+
here = norm(here).replace(/\/+$/, '')
|
|
14
|
+
let d = here
|
|
15
|
+
for (let i = 0; i < 6; i += 1) {
|
|
16
|
+
if (!d) break
|
|
17
|
+
cands.push(d)
|
|
18
|
+
const k = d.lastIndexOf('/')
|
|
19
|
+
d = k > 0 ? d.slice(0, k) : ''
|
|
20
|
+
}
|
|
21
|
+
} catch { /* noop */ }
|
|
22
|
+
try { cands.push(norm(process.cwd())) } catch { /* noop */ }
|
|
23
|
+
for (const c of cands) {
|
|
24
|
+
try {
|
|
25
|
+
if (c && (__existsSync(c + '/qqbot-mod/muu-shared.mjs') || __existsSync(c + '/dshqqbot'))) { cached = c; return cached }
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
}
|
|
28
|
+
cached = norm(cands.find(Boolean) || '.')
|
|
29
|
+
return cached
|
|
30
|
+
}
|
|
31
|
+
})()
|
|
1
32
|
/**
|
|
2
33
|
* router-observe.mjs — 分流决策的**观察期**钩子(不改变任何行为)
|
|
3
34
|
*
|
|
@@ -25,7 +56,7 @@ const MAX_BYTES = 2 * 1024 * 1024; // 超 2MB 自动轮转一份
|
|
|
25
56
|
function dataRootOf(cfg) {
|
|
26
57
|
const env = String(process.env.QQBOT_MEMORY_DATA_ROOT || '').trim();
|
|
27
58
|
if (env) return env;
|
|
28
|
-
return (cfg && cfg.dataRoot) ||
|
|
59
|
+
return (cfg && cfg.dataRoot) || __repoRoot() + "/dshqqbot";
|
|
29
60
|
}
|
|
30
61
|
|
|
31
62
|
function logPath(root) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
rem interview standalone keepalive (ASCII only: cmd parses bat as ANSI, UTF-8 Chinese breaks it)
|
|
3
|
-
rem 2026-11-09: keep 4321 alive so shared interview links never die.
|
|
4
|
-
rem same idea as wechat-bridge/start-bridge.bat: skip when already listening,
|
|
5
|
-
rem absolute node path because DSH desktop env has no node in PATH.
|
|
6
|
-
cd /d
|
|
7
|
-
|
|
8
|
-
netstat -ano | findstr /C:":4321" | findstr /C:"LISTENING" >nul 2>&1
|
|
9
|
-
if %errorlevel%==0 exit /b 0
|
|
10
|
-
|
|
11
|
-
set LOGDIR
|
|
12
|
-
if not exist "%LOGDIR%" mkdir "%LOGDIR%"
|
|
13
|
-
if not exist
|
|
14
|
-
set /p IKEY
|
|
15
|
-
|
|
16
|
-
F:\nodejs\node.exe standalone.mjs --port 4321 --key %IKEY% >> "%LOGDIR%\standalone.log" 2>&1
|
|
1
|
+
@echo off
|
|
2
|
+
rem interview standalone keepalive (ASCII only: cmd parses bat as ANSI, UTF-8 Chinese breaks it)
|
|
3
|
+
rem 2026-11-09: keep 4321 alive so shared interview links never die.
|
|
4
|
+
rem same idea as wechat-bridge/start-bridge.bat: skip when already listening,
|
|
5
|
+
rem absolute node path because DSH desktop env has no node in PATH.
|
|
6
|
+
cd /d "%~dp0"
|
|
7
|
+
|
|
8
|
+
netstat -ano | findstr /C:":4321" | findstr /C:"LISTENING" >nul 2>&1
|
|
9
|
+
if %errorlevel%==0 exit /b 0
|
|
10
|
+
|
|
11
|
+
set LOGDIR=%TEMP%\interview-logs
|
|
12
|
+
if not exist "%LOGDIR%" mkdir "%LOGDIR%"
|
|
13
|
+
if not exist %TEMP%\interview-key.txt echo xiaolan> %TEMP%\interview-key.txt
|
|
14
|
+
set /p IKEY=<%TEMP%\interview-key.txt
|
|
15
|
+
|
|
16
|
+
F:\nodejs\node.exe standalone.mjs --port 4321 --key %IKEY% >> "%LOGDIR%\standalone.log" 2>&1
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
<p class="hint">这个页面放在本地文件里,必须连上 DSH 桌面服务才能开始面试。服务没启动时不会白屏,按下面任一方式拉起即可。</p>
|
|
237
237
|
<div class="row"><button type="button" id="localBarRetry">重新检查并进入</button></div>
|
|
238
238
|
<p class="hint" id="localBarHow" hidden>
|
|
239
|
-
① 双击 <code
|
|
239
|
+
① 双击 <code>小蓝面试.lnk</code>(或在同目录运行 <code>start-interview.cmd</code>),它会检查服务、没起就拉起,再打开通话页。<br>
|
|
240
240
|
② 或先启动 DSH Desktop,再点上面的「重新检查并进入」。
|
|
241
241
|
</p>
|
|
242
242
|
</div>
|