clawrelay 0.3.7 → 0.3.8
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/gateway-handler.ts +6 -2
package/package.json
CHANGED
package/src/gateway-handler.ts
CHANGED
|
@@ -69,6 +69,7 @@ export function createRelayInboundHandler(api: any) {
|
|
|
69
69
|
logger.warn(`[clawrelay] Cannot send event ${event}: no client connId`);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
+
logger.info(`[clawrelay] sendEventToClient: ${event} connId=${client.connId}`);
|
|
72
73
|
context.broadcastToConnIds(event, payload, new Set([client.connId]));
|
|
73
74
|
};
|
|
74
75
|
|
|
@@ -233,13 +234,16 @@ async function processRelayMessage(params: {
|
|
|
233
234
|
|
|
234
235
|
// Dispatch reply — collect all deliver() calls into a single buffer
|
|
235
236
|
const parts: string[] = [];
|
|
237
|
+
let deliverCount = 0;
|
|
236
238
|
|
|
237
239
|
await core.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
238
240
|
ctx: ctxPayload,
|
|
239
241
|
cfg: config,
|
|
240
242
|
dispatcherOptions: {
|
|
241
|
-
deliver: async (payload: { text?: string }) => {
|
|
243
|
+
deliver: async (payload: { text?: string }, info?: { kind?: string }) => {
|
|
244
|
+
deliverCount++;
|
|
242
245
|
const text = payload.text ?? '';
|
|
246
|
+
log?.info(`[clawrelay] deliver #${deliverCount} kind=${info?.kind ?? 'unknown'} len=${text.length} preview="${text.slice(0, 80)}"`);
|
|
243
247
|
if (text.trim()) {
|
|
244
248
|
parts.push(text);
|
|
245
249
|
streamCallback?.(text);
|
|
@@ -251,7 +255,7 @@ async function processRelayMessage(params: {
|
|
|
251
255
|
},
|
|
252
256
|
});
|
|
253
257
|
|
|
254
|
-
log?.info(`[clawrelay] Processed message ${message.messageId} from ${message.senderName}`);
|
|
258
|
+
log?.info(`[clawrelay] Processed message ${message.messageId} from ${message.senderName} (${deliverCount} delivers, ${parts.length} parts, total=${parts.join('\n').length} chars)`);
|
|
255
259
|
|
|
256
260
|
return parts.join('\n');
|
|
257
261
|
}
|