@dcrays/dcgchat-test 0.3.13 → 0.3.14

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": "@dcrays/dcgchat-test",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "type": "module",
5
5
  "description": "OpenClaw channel plugin for 书灵墨宝 (WebSocket)",
6
6
  "main": "index.ts",
package/src/channel.ts CHANGED
@@ -163,15 +163,15 @@ export const dcgchatPlugin: ChannelPlugin<ResolvedDcgchatAccount> = {
163
163
  wsSendRaw(newCtx, { response: ctx.text, is_finish: -1, message_tags: { source: 'channel' } })
164
164
  dcgLogger(`channel sendText to ${ctx.to} ${ctx.text?.slice(0, 50)}`)
165
165
  } else {
166
- const sessionInfo = ctx.to.split(':')[1]
167
- const parts = sessionInfo.split('-')
168
- const sessionId = parts.at(-1) ?? ''
169
- const agentId = parts.at(-2) ?? ''
166
+ const sessionInfo = ctx.to.split(':')
167
+ const sessionId = sessionInfo.at(-1) ?? ''
168
+ const agentId = sessionInfo.at(-2) ?? ''
170
169
  const merged = mergeDefaultParams({
171
170
  agentId: agentId,
172
171
  sessionId: `${sessionId}`,
173
172
  messageId: messageId,
174
- is_finish: -1
173
+ is_finish: -1,
174
+ real_mobook: !sessionId ? 1 : ''
175
175
  })
176
176
  dcgLogger(`channel sendText to ${ctx.to} ${ctx.text?.slice(0, 50)}`)
177
177
  wsSendRaw(merged, { response: ctx.text })
@@ -127,7 +127,7 @@ export const getSessionKey = (content: any, accountId: string) => {
127
127
  accountId: accountId || 'default',
128
128
  peer: { kind: 'direct', id: session_id }
129
129
  })
130
- return real_mobook === '1' ? route.sessionKey : `agent:main:mobook:direct:${agent_id}:${session_id}`.toLowerCase()
130
+ return real_mobook == '1' ? route.sessionKey : `agent:main:mobook:direct:${agent_id}:${session_id}`.toLowerCase()
131
131
  }
132
132
 
133
133
  const cronMessageIdMap = new Map<string, string>()