@dcrays/dcgchat-test 0.2.23 → 0.2.24
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/bot.ts +13 -0
- package/src/tool.ts +2 -4
package/package.json
CHANGED
package/src/bot.ts
CHANGED
|
@@ -464,6 +464,18 @@ export async function handleDcgchatMessage(params: {
|
|
|
464
464
|
|
|
465
465
|
let wasAborted = false;
|
|
466
466
|
try {
|
|
467
|
+
if (text === '/new') {
|
|
468
|
+
log(`dcgchat[${accountId}]: skipping agent dispatch for /new`);
|
|
469
|
+
await core.channel.reply.dispatchReplyFromConfig({
|
|
470
|
+
ctx: ctxPayload,
|
|
471
|
+
cfg,
|
|
472
|
+
dispatcher,
|
|
473
|
+
replyOptions: {
|
|
474
|
+
...replyOptions,
|
|
475
|
+
onModelSelected: prefixContext.onModelSelected
|
|
476
|
+
},
|
|
477
|
+
});
|
|
478
|
+
} else {
|
|
467
479
|
log(
|
|
468
480
|
`dcgchat[${accountId}]: dispatching to agent (session=${route.sessionKey})`,
|
|
469
481
|
);
|
|
@@ -534,6 +546,7 @@ export async function handleDcgchatMessage(params: {
|
|
|
534
546
|
},
|
|
535
547
|
},
|
|
536
548
|
});
|
|
549
|
+
}
|
|
537
550
|
} catch (err: unknown) {
|
|
538
551
|
if (genSignal.aborted) {
|
|
539
552
|
wasAborted = true;
|
package/src/tool.ts
CHANGED
|
@@ -120,7 +120,7 @@ export function monitoringToolMessage(api: OpenClawPluginApi) {
|
|
|
120
120
|
status: item.event === 'after_tool_call' ? 'finished' : 'running'
|
|
121
121
|
});
|
|
122
122
|
sendToolCallMessage(text, event.toolCallId || event.runId || Date.now().toString(), item.event === 'after_tool_call' ? 1 : 0)
|
|
123
|
-
} else if (item.
|
|
123
|
+
} else if (item.event) {
|
|
124
124
|
const text = JSON.stringify({
|
|
125
125
|
type: item.event,
|
|
126
126
|
specialIdentification: 'dcgchat_tool_call_special_identification',
|
|
@@ -130,9 +130,7 @@ export function monitoringToolMessage(api: OpenClawPluginApi) {
|
|
|
130
130
|
});
|
|
131
131
|
sendToolCallMessage(text, event.runId || Date.now().toString(), 0)
|
|
132
132
|
console.log('消息事件:', item.event, item.message)
|
|
133
|
-
}
|
|
134
|
-
console.log('其他事件:', item.event, JSON.stringify(event).slice(0, 3200))
|
|
135
|
-
}
|
|
133
|
+
}
|
|
136
134
|
// log?.(`dcgchat[${params?.sessionId}]:11111111 tool message to ${params?.sessionId}, ${JSON.stringify(rest)}`);
|
|
137
135
|
// } else {
|
|
138
136
|
// log?.(`dcgchat[${params?.sessionId}]:22222222 tool ${status} message to ${ws?.readyState}, ${JSON.stringify(rest)}`);
|