@cmach_socket/opencode-qq-bot 0.3.2 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmach_socket/opencode-qq-bot",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "OpenCode V2 plugin bridging a QQ group chat (NapCat via NapLink) to an OpenCode session.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,5 +1,5 @@
1
- import { randomUUID } from "node:crypto"
2
1
  import type { Plugin } from "@opencode/plugin"
2
+ import { SessionMessage } from "@opencode/schema"
3
3
  import { Mutex } from "async-mutex"
4
4
  import { type ChatTarget, isTargetEnabled, parseTargetKey, targetKey, targetLabel } from "../chat"
5
5
  import type { QQBotConfig } from "../config"
@@ -319,7 +319,7 @@ export class SessionManager {
319
319
  /** 收到一条消息:先入队,再尝试投递;上游忙时留在队列里。 */
320
320
  async enqueue(target: ChatTarget, turn: Turn): Promise<void> {
321
321
  const state = this.state(target)
322
- const queued = turn.id ? turn : { ...turn, id: randomUUID() }
322
+ const queued = turn.id ? turn : { ...turn, id: SessionMessage.ID.create() }
323
323
  await this.targetMutex(target).runExclusive(async () => {
324
324
  this.pushBuffered(state, queued)
325
325
  await this.drain(state)