@zaofan/dsh-qqbot 1.5.6 → 1.5.8

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/README.md CHANGED
@@ -194,6 +194,46 @@ pwsh -File scripts/fix-dsh-016-presets.ps1 -Apply
194
194
 
195
195
  dsh 0.1.6 起默认模型为 `deepseek-official/deepseek-flash`(旧的 `deepseek-v4-flash` 已移出默认模型列表)。插件在「什么都没配」时的兜底也已同步为该值;你在设置里显式指定的 provider/model 优先级更高。
196
196
 
197
+ ### 升级 dsh 0.1.7 后,恢复会话报「预设缺失」/ 机器人不理人?
198
+
199
+ dsh **0.1.7** 把 Agent 预设从「目录里的 yml 文件」换成了「**profile 配置里的声明行**」:
200
+ 由 `@deepseek-ai/dsh-agent-preset-registry` + 每个预设一行 `@deepseek-ai/dsh-agent-preset` 组成。
201
+ 官方明确:**注册表不扫描目录、不接受 preset 路径、没有任何接口接受 YAML 写回** —— 所以旧目录预设**必须迁移**,否则会话日志里记着的 preset ID 找不到定义,**恢复会话会被拒绝**。
202
+
203
+ **一键迁移**(仓库里 `scripts/migrate-presets-017.ps1`):
204
+
205
+ ```powershell
206
+ # ① 先看看会迁移哪些预设(不写任何文件)
207
+ pwsh -File scripts/migrate-presets-017.ps1
208
+
209
+ # ② 生成「原 patch + 迁移片段」的合并版,核对一眼
210
+ pwsh -File scripts/migrate-presets-017.ps1 -Merge -Out "$env:TEMP\cordis.patch.yml.0.1.7-ready"
211
+
212
+ # ③ 升级 dsh 到 ≥0.1.7 之后启用(⚠️ 顺序不可反!0.1.6 读不了新声明会加载失败)
213
+ cd ~/.dsh/profiles/web
214
+ Copy-Item cordis.patch.yml cordis.patch.yml.bak-0.1.6
215
+ Move-Item "$env:TEMP\cordis.patch.yml.0.1.7-ready" cordis.patch.yml -Force
216
+ # 然后重启 dsh
217
+ ```
218
+
219
+ > ⚠️ 两个坑(脚本已自动处理):patch 顶层若是空数组 `[]` 要**先删掉**再粘;新增条目必须用 `- insert:`(写成 `- id:` 会报 `entry not found`)。
220
+ > ⚠️ 0.1.7 会把**会话日志升级为 V4(不可回退)**、`settings.yaml` 也只导入一次 —— 升级前记得备份整个 `~/.dsh`。
221
+
222
+ ### 升级 dsh 0.1.7 后,某些插件被「禁用 / 跳过」?
223
+
224
+ 0.1.7 新增了**插件版本兼容检查**(比对各插件的 `peerDependencies`)。钉死在旧次版本的包会被跳过,或整行被禁用:
225
+
226
+ ```
227
+ dsh: disabling profile plugin row "mcp-chrome": Plugin ... is incompatible with dsh 0.1.7-rc.1
228
+ ```
229
+
230
+ 常见两例:
231
+
232
+ - `@deepseek-ai/dsh-mcp-client@0.0.1-rc.1` → 让所有 `mcp-*` 行失效。**注意官方这个包的 `latest` 标签还停在旧版,`next` 才是新版** → 要显式装 `@deepseek-ai/dsh-mcp-client@0.1.7-rc.1`
233
+ - `@dhicoc/dsh-reverse-skill@1.0.5` → 跳过(作者尚未适配 0.1.7)
234
+
235
+ 想强行运行,可用官方提供的**确切版本例外**(`dsh plugin allow-version`,或插件管理页里授予),但官方警告"可能崩溃或数据丢失",自行权衡。
236
+
197
237
  ## 支持这个项目
198
238
 
199
239
  如果这个插件帮你省了 token、或者让你家的鲸鱼更活蹦乱跳 —— **给个 ⭐ Star** 就是最实在的支持;有 bug / 想要的功能,欢迎开 [Issue](https://github.com/gcry13067381632-jpg/dsh-qqbot/issues)。
@@ -201,3 +241,41 @@ dsh 0.1.6 起默认模型为 `deepseek-official/deepseek-flash`(旧的 `deepse
201
241
  ## License
202
242
 
203
243
  [MIT](./LICENSE)
244
+
245
+ ### Q: 升级到 dsh 0.1.7 后,我以前设置的群守则(groupPrompt)不见了?
246
+
247
+ **A:这是 0.1.7 一次性导入设置时的已知坑,内容没丢,可以找回。**
248
+
249
+ 0.1.7 会把旧的 `~/.dsh/settings.yaml` 整体导入 profile,但导入**不一定落到 entry config 里**;
250
+ 插件的设置页读不到自定义值 → 拿到默认值 → 保存时把默认值写回 → 你的自定义内容就被顶掉了。
251
+
252
+ **找回步骤**:
253
+ 1. 打开 `~/.dsh/settings.yaml.imported`(宿主留档的原件,同目录通常还有 `.bak`)
254
+ 2. 找到你实例对应的 section(例如 `im-qqbot-2:`),再往下找 `groupPrompt:` 那一行
255
+ 3. 复制它的内容(`|-` 或 `>-` 块标量,注意去掉块缩进)
256
+ 4. 回到 Web 设置页的「群聊常驻守则」,粘贴回去并**保存**
257
+ — 1.5.8 起设置保存在插件自有存储(`~/.dsh/qqbot-settings/<实例>.json`),不会再丢
258
+
259
+ > ⚠️ **群守则里常含私人信息**(主人 openid、进群暗号等)。**发布、分享配置或截图时请务必剔除 `groupPrompt`。**
260
+
261
+ ### Q: 设置页保存后,为什么 patch 里看不到我的改动?
262
+
263
+ **A:1.5.8 起,设置页保存写在插件自有存储,**故意不写** `cordis.patch.yml`。**
264
+
265
+ - 位置:`~/.dsh/qqbot-settings/<实例名>.json`(例如 `im-qqbot-2.json`)
266
+ - 为什么不写 patch:写 patch 会触发宿主热更新 → 插件重新 apply → 若此时凭据无效又会写配置,
267
+ **形成死循环**(实测把 dsh 启动刷死);而且手拼 YAML 保不住字段类型、也不支持新增键。
268
+ - 生效优先级:**自有存储覆盖 patch**。所以两份不一致时,以自有存储为准。
269
+
270
+ ### Q: 面板上「实时入群事件」开关是干什么的?打开后机器人连不上了?
271
+
272
+ **A:它订阅 `GROUP_JOIN_REQUEST`(群成员事件,intent `1<<24`),需要 QQ 开放平台**先开通**该事件。**
273
+
274
+ 未开通时打开会导致**机器人连不上**(网关拒绝 Identify,close `4914`/`4915`)。
275
+ 正确顺序:**① 平台开通事件 → ② 打开开关 → ③ 重启**。
276
+
277
+ **只想收通知、不想折腾平台?** 用「轮询审批」即可(不需要任何事件授权):
278
+ - 勾「轮询审批」= 定时拉取各群审批列表
279
+ - 再按需勾「唤醒AI」/「注入群管会话」/「通知普通群」决定拿到申请后做什么
280
+ - ⚠️ 注意:`唤醒AI` 与 `注入群管会话` **互斥且唤醒优先** —— 两个都勾时只会唤醒 AI,不会注入会话。
281
+ 想要「静默注入群管会话」就**只勾「注入群管会话」**。
@@ -1392,9 +1392,11 @@ window.__ModuleLoader__.load({
1392
1392
  }).then(function (r) { return r.json() }).then(function (d) {
1393
1393
  setBusy('')
1394
1394
  if (d && d.error) { setMsg('复制失败: ' + d.error); return }
1395
- setMsg('✅ 新预设已生成: ' + d.newId + (copy.fromStandard ? ' (复制自标准模式, 已带 QQ 工具)' : '') + '。去「打开文件夹」改人设吧。')
1395
+ setMsg('✅ 新预设已生成: ' + d.newId + (copy.fromStandard ? ' (复制自标准模式)' : '') + '。稍等片刻即可在列表看到;要改人设点「人格」。')
1396
1396
  setCopy(null); setCopyId(''); setCopyName('')
1397
1397
  load(true)
1398
+ // dsh 0.1.7:预设写在 profile patch 里,由宿主 HMR 重载后才出现在列表中 → 稍后再拉一次
1399
+ setTimeout(function () { load(true) }, 1200)
1398
1400
  }).catch(function (e) { setBusy(''); setMsg('复制异常: ' + e.message) })
1399
1401
  }
1400
1402
  function openPreset(id) {
@@ -2701,6 +2703,7 @@ var QQS_CSS = ".qqs-btn{font:inherit;color:#333;background:linear-gradient(180de
2701
2703
  return isNaN(v) || v < 1 ? dft : v
2702
2704
  }
2703
2705
  state.gaEnabled = read('#dk-ga-enabled')
2706
+ state.gaWatch = read('#dk-ga-watch')
2704
2707
  state.gaPoll = read('#dk-ga-poll')
2705
2708
  state.gaPollWake = read('#dk-ga-pollwake')
2706
2709
  state.gaHubNotify = read('#dk-ga-hubnotify')
@@ -2735,6 +2738,7 @@ var QQS_CSS = ".qqs-btn{font:inherit;color:#333;background:linear-gradient(180de
2735
2738
  // ⚙ 群组设置: 载入轮询/开关当前值
2736
2739
  var poll = ga.pollJoinRequests || {}
2737
2740
  state.gaEnabled = ga.enabled === true
2741
+ state.gaWatch = ga.watchJoinRequests === true // 实时入群事件(需平台开通,重启生效)
2738
2742
  state.gaPoll = poll.enabled === true
2739
2743
  state.gaPollWake = poll.wakeLlm !== false
2740
2744
  state.gaHubNotify = poll.hubNotify !== false
@@ -2743,6 +2747,7 @@ var QQS_CSS = ".qqs-btn{font:inherit;color:#333;background:linear-gradient(180de
2743
2747
  state.gaInterval = poll.intervalMin || 5
2744
2748
  state.gaMinCount = poll.minCount || 1
2745
2749
  var e1 = panel && panel.querySelector('#dk-ga-enabled'); if (e1) e1.checked = state.gaEnabled
2750
+ var ew = panel && panel.querySelector('#dk-ga-watch'); if (ew) ew.checked = state.gaWatch
2746
2751
  var e2 = panel && panel.querySelector('#dk-ga-poll'); if (e2) e2.checked = state.gaPoll
2747
2752
  var e3 = panel && panel.querySelector('#dk-ga-pollwake'); if (e3) e3.checked = state.gaPollWake
2748
2753
  var e4 = panel && panel.querySelector('#dk-ga-hubnotify'); if (e4) e4.checked = state.gaHubNotify
@@ -2764,6 +2769,7 @@ var QQS_CSS = ".qqs-btn{font:inherit;color:#333;background:linear-gradient(180de
2764
2769
  var patch = Object.assign({}, cur || {})
2765
2770
  var ga = Object.assign({}, (cur && cur.groupAdmin) || {}, {
2766
2771
  enabled: state.gaEnabled,
2772
+ watchJoinRequests: state.gaWatch === true,
2767
2773
  pollJoinRequests: {
2768
2774
  enabled: state.gaPoll,
2769
2775
  intervalMin: state.gaInterval,
@@ -3450,6 +3456,7 @@ var QQS_CSS = ".qqs-btn{font:inherit;color:#333;background:linear-gradient(180de
3450
3456
  + '<span class="dk-msg" style="flex:1" id="dk-ga-hint"></span></div>'
3451
3457
  + '<div class="dk-row" style="gap:8px;flex-wrap:wrap">'
3452
3458
  + '<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px"><input type="checkbox" id="dk-ga-enabled"' + (state.gaEnabled ? ' checked' : '') + '> 群管理</label>'
3459
+ + '<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px" title="实时接收入群申请事件(GROUP_JOIN_REQUEST);需先在 QQ 开放平台开通该事件,否则机器人会连不上;打开后需重启生效"><input type="checkbox" id="dk-ga-watch"' + (state.gaWatch ? ' checked' : '') + '>实时入群事件(需平台开通·重启生效)</label>'
3453
3460
  + '<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px"><input type="checkbox" id="dk-ga-poll"' + (state.gaPoll ? ' checked' : '') + '> 轮询审批</label>'
3454
3461
  + '<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px"><input type="checkbox" id="dk-ga-pollwake"' + (state.gaPollWake ? ' checked' : '') + '> 唤醒AI</label>'
3455
3462
  + '<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px"><input type="checkbox" id="dk-ga-hubnotify"' + (state.gaHubNotify ? ' checked' : '') + '> 注入群管会话</label>'