@dcrays/dcgchat 0.3.28 → 0.3.29
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 +1 -1
- package/src/channel.ts +4 -4
- package/src/utils/params.ts +2 -2
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -43,14 +43,14 @@ export async function sendDcgchatMedia(opts: DcgchatMediaSendOptions): Promise<v
|
|
|
43
43
|
message_tags: { source: 'file' },
|
|
44
44
|
files: [{ url, name: fileName }]
|
|
45
45
|
})
|
|
46
|
-
dcgLogger(`dcgchat: sendMedia
|
|
46
|
+
dcgLogger(`dcgchat: sendMedia session=${opts.sessionKey}, file=${fileName}`)
|
|
47
47
|
} catch (error) {
|
|
48
48
|
wsSendRaw(msgCtx, {
|
|
49
49
|
response: opts.text ?? '',
|
|
50
50
|
message_tags: { source: 'file' },
|
|
51
51
|
files: [{ url: opts.mediaUrl ?? '', name: fileName }]
|
|
52
52
|
})
|
|
53
|
-
dcgLogger(`dcgchat: error sendMedia
|
|
53
|
+
dcgLogger(`dcgchat: error sendMedia session=${opts.sessionKey}: ${String(error)}`, 'error')
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -138,7 +138,7 @@ export const dcgchatPlugin: ChannelPlugin<ResolvedDcgchatAccount> = {
|
|
|
138
138
|
normalizeTarget: (raw) => raw?.trim() || undefined,
|
|
139
139
|
targetResolver: {
|
|
140
140
|
looksLikeId: (raw) => Boolean(raw?.trim()),
|
|
141
|
-
hint: '
|
|
141
|
+
hint: 'effectiveSessionKey'
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
outbound: {
|
|
@@ -186,7 +186,7 @@ export const dcgchatPlugin: ChannelPlugin<ResolvedDcgchatAccount> = {
|
|
|
186
186
|
return {
|
|
187
187
|
channel: "dcgchat",
|
|
188
188
|
messageId: `${messageId}`,
|
|
189
|
-
chatId:
|
|
189
|
+
chatId: to
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
},
|
package/src/utils/params.ts
CHANGED
|
@@ -47,8 +47,8 @@ export function getEffectiveMsgParams(sessionKey?: string): IMsgParams {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* Agent `message`
|
|
51
|
-
* `
|
|
50
|
+
* Agent `message` 工具的 `target` 应为 `effectiveSessionKey`(如 `agent:main:mobook:direct:...`)。
|
|
51
|
+
* `setParamsMessage` 使用的 key 与此一致。若按 preferredKey 查不到 map,
|
|
52
52
|
* 则回落到当前会话 `currentSessionKey`,避免拿到空 `messageId` / `sessionId` 导致无文件卡片、WS 上下文错误。
|
|
53
53
|
*/
|
|
54
54
|
export function getOutboundMsgParams(preferredKey: string): IMsgParams {
|