dsh-qq-link 1.5.4 → 1.5.5

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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## 1.5.5 — 2026-11-10
2
+
3
+ **QQ 空间「看单条说说」会把整轮对话弄崩:tid 被声明成了整数**
4
+
5
+ - 🐞 `qq_space_detail` 的 `tid` 参数类型写的是 `integer`,可它其实是 24 位十六进制的一串字符。
6
+ 模型照着「整数」去填就不加引号,写出来是个**非法 JSON**,整轮直接被判失败
7
+ (`DeepSeek Messages stream: tool input is invalid JSON`),重试几次都一样。
8
+ - 🐞 列表里输出 tid 时也没带引号,模型原样抄下来正好踩进这个坑。
9
+ - 🐞 执行时又拿 `Math.round(Number())` 去转:十六进制转出来是 NaN,长数字串还会丢精度。
10
+ - 现在:`tid` 声明成 `string`,列表输出带引号,执行时原样当字符串往下传
11
+ (模型还是给数字也照收,转成字符串再用)。
12
+
1
13
  ## 1.5.4 — 2026-11-07
2
14
 
3
15
  **宿主 0.2.2 起,QQ 空间的四个工具每 2 秒报一次 already registered,日志被刷爆**
package/lib/host.js CHANGED
@@ -2954,7 +2954,7 @@ export function apply(ctx) {
2954
2954
  if (!m) continue
2955
2955
  const 图数 = Array.isArray(m.images) ? m.images.length : 0
2956
2956
  行们.push((起 + i + 1) + '. ' + 空间时间(m.time)
2957
- + (m.tid != null ? ' tid ' + String(m.tid) : '')
2957
+ + (m.tid != null ? ' tid ' + JSON.stringify(String(m.tid)) : '')
2958
2958
  + ' 评论 ' + (Number(m.comment_num) || 0)
2959
2959
  + (m.is_private ? ' 私密' : '')
2960
2960
  + ' 图 ' + 图数 + ' 张'
@@ -2972,7 +2972,7 @@ export function apply(ctx) {
2972
2972
  parameters: {
2973
2973
  type: 'object',
2974
2974
  properties: {
2975
- tid: { type: 'integer', description: '说说的 tid(qq_space_list 里每条前面那个)' },
2975
+ tid: { type: 'string', description: '说说的 tid:qq_space_list 里 tid 后面那一串,原样照抄' },
2976
2976
  qq: { type: 'string', description: '这条说说属于谁的 QQ 号。不填 = 机器人自己的' },
2977
2977
  num: { type: 'integer', minimum: 1, maximum: 50, description: '评论最多看几条,默认 20' },
2978
2978
  pos: { type: 'integer', minimum: 0, description: '评论从第几条开始,默认 0' },
@@ -2983,8 +2983,12 @@ export function apply(ctx) {
2983
2983
  output: 空间输出(),
2984
2984
  async execute(args = {}) {
2985
2985
  const 配置 = 读配置()
2986
- const tid = Math.round(Number(args.tid))
2987
- if (!Number.isFinite(tid) || tid <= 0) return { ok: false, 说: '要给一个说说的 tid(数字,从 qq_space_list 里拿)' }
2986
+ // ⭐ 1.5.5:tid 是 24 位十六进制的一串字符,不是数字。
2987
+ // 以前这里写的是 integer + Math.round(Number()):模型照着「整数」去填就不加引号,
2988
+ // 写出来是个非法 JSON,整轮直接被判失败;就算写成数字串,Number() 也会丢精度。
2989
+ // 现在一律当字符串原样往下传。
2990
+ const tid = String(args.tid == null ? '' : args.tid).trim()
2991
+ if (!tid) return { ok: false, 说: '要给一个说说的 tid(从 qq_space_list 里拿,原样照抄)' }
2988
2992
  const 条数 = Math.max(1, Math.min(Math.round(Number(args.num) || 20), 50))
2989
2993
  const 起 = Math.max(0, Math.round(Number(args.pos) || 0))
2990
2994
  const 体 = { tid, pos: 起, num: 条数 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-qq-link",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "通到 QQ:DSH 里的 AI 伙伴和 QQ 双向互通 —— 它说完话自动发到 QQ,你在 QQ 里说的话自动转进 DSH。走 OneBot 11 HTTP(SnowLuma / NapCat 都行)。",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "engines": {