@dcrays/dcgchat-test 0.2.31 → 0.2.33
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/index.ts +2 -0
- package/package.json +1 -1
- package/src/bot.ts +13 -5
package/index.ts
CHANGED
|
@@ -12,6 +12,8 @@ const plugin = {
|
|
|
12
12
|
configSchema: emptyPluginConfigSchema(),
|
|
13
13
|
register(api: OpenClawPluginApi) {
|
|
14
14
|
setDcgchatRuntime(api.runtime)
|
|
15
|
+
|
|
16
|
+
console.log('🚀 ~ handleDcgchatMessage ~ process.platform:', process.platform)
|
|
15
17
|
monitoringToolMessage(api)
|
|
16
18
|
setOpenClawConfig(api.config)
|
|
17
19
|
api.registerChannel({ plugin: dcgchatPlugin })
|
package/package.json
CHANGED
package/src/bot.ts
CHANGED
|
@@ -247,7 +247,9 @@ export async function handleDcgchatMessage(msg: InboundMessage, accountId: strin
|
|
|
247
247
|
onError: (err: unknown, info: { kind: string }) => {
|
|
248
248
|
dcgLogger(`${info.kind} reply failed: ${String(err)}`, 'error')
|
|
249
249
|
},
|
|
250
|
-
onIdle: () => {
|
|
250
|
+
onIdle: () => {
|
|
251
|
+
sendFinal(msgCtx)
|
|
252
|
+
}
|
|
251
253
|
})
|
|
252
254
|
|
|
253
255
|
let wasAborted = false
|
|
@@ -329,11 +331,17 @@ export async function handleDcgchatMessage(msg: InboundMessage, accountId: strin
|
|
|
329
331
|
markDispatchIdle()
|
|
330
332
|
if (![...systemCommand, ...interruptCommand].includes(text?.trim())) {
|
|
331
333
|
for (const file of extractMobookFiles(completeText)) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
const candidates: string[] = [file]
|
|
335
|
+
candidates.push(path.join(getWorkspaceDir(), file))
|
|
336
|
+
candidates.push(path.join(getWorkspaceDir(), file.replace(/^\//, '')))
|
|
337
|
+
if (process.platform === 'win32') {
|
|
338
|
+
const underMobook = file.replace(/^\/mobook\//i, '').replace(/^mobook[\\/]/i, '')
|
|
339
|
+
if (underMobook) {
|
|
340
|
+
candidates.push(path.join('C:\\', 'mobook', underMobook))
|
|
341
|
+
}
|
|
336
342
|
}
|
|
343
|
+
const resolved = candidates.find((p) => fs.existsSync(p))
|
|
344
|
+
if (!resolved) continue
|
|
337
345
|
await sendDcgchatMedia({ msgCtx, mediaUrl: resolved, text: '' })
|
|
338
346
|
}
|
|
339
347
|
}
|