@eyeclaw/eyeclaw 2.0.13 → 2.0.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 +1 -1
- package/src/client.ts +31 -0
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -296,20 +296,51 @@ export class EyeClawClient {
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
sendLog(level: string, message: string): void {
|
|
299
|
+
// Send to BotChannel
|
|
299
300
|
this.sendChannelMessage('log', {
|
|
300
301
|
level,
|
|
301
302
|
message,
|
|
302
303
|
timestamp: new Date().toISOString(),
|
|
303
304
|
})
|
|
305
|
+
|
|
306
|
+
// Also broadcast directly to bot_{id} stream as backup
|
|
307
|
+
this.send({
|
|
308
|
+
command: 'message',
|
|
309
|
+
identifier: JSON.stringify({
|
|
310
|
+
channel: `bot_${this.config.botId}`,
|
|
311
|
+
}),
|
|
312
|
+
data: JSON.stringify({
|
|
313
|
+
action: 'log',
|
|
314
|
+
level,
|
|
315
|
+
message,
|
|
316
|
+
timestamp: new Date().toISOString(),
|
|
317
|
+
}),
|
|
318
|
+
})
|
|
304
319
|
}
|
|
305
320
|
|
|
306
321
|
sendStreamChunk(type: string, streamId: string, chunk: string): void {
|
|
322
|
+
// Send to BotChannel which will broadcast to bot_{id} for Rails to receive
|
|
307
323
|
this.sendChannelMessage('stream_chunk', {
|
|
308
324
|
type,
|
|
309
325
|
stream_id: streamId,
|
|
310
326
|
chunk,
|
|
311
327
|
timestamp: new Date().toISOString(),
|
|
312
328
|
})
|
|
329
|
+
|
|
330
|
+
// Also broadcast directly to bot_{id} stream as backup (Rails expects stream_type)
|
|
331
|
+
this.send({
|
|
332
|
+
command: 'message',
|
|
333
|
+
identifier: JSON.stringify({
|
|
334
|
+
channel: `bot_${this.config.botId}`,
|
|
335
|
+
}),
|
|
336
|
+
data: JSON.stringify({
|
|
337
|
+
action: 'stream_chunk',
|
|
338
|
+
stream_type: type, // Rails expects 'stream_type'
|
|
339
|
+
stream_id: streamId,
|
|
340
|
+
chunk,
|
|
341
|
+
timestamp: new Date().toISOString(),
|
|
342
|
+
}),
|
|
343
|
+
})
|
|
313
344
|
}
|
|
314
345
|
|
|
315
346
|
sendCommandResult(command: string, result: unknown, error?: string): void {
|