@threadbase-sh/streamer 1.15.2 → 1.15.3

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/dist/index.js CHANGED
@@ -1189,7 +1189,14 @@ import {
1189
1189
  ConversationScanner,
1190
1190
  search
1191
1191
  } from "@threadbase-sh/scanner";
1192
- import { createReadStream, existsSync as existsSync6, watch as fsWatch, readdirSync as readdirSync3, statSync as statSync5 } from "fs";
1192
+ import {
1193
+ createReadStream,
1194
+ existsSync as existsSync6,
1195
+ watch as fsWatch,
1196
+ readdirSync as readdirSync3,
1197
+ readFileSync as readFileSync6,
1198
+ statSync as statSync5
1199
+ } from "fs";
1193
1200
  import { realpath as realpath2 } from "fs/promises";
1194
1201
  import { createServer } from "http";
1195
1202
  import { homedir as homedir5 } from "os";
@@ -5423,6 +5430,16 @@ var StreamerServer = class {
5423
5430
  cleanup();
5424
5431
  this.sessionFileMap.set(sessionId, resolvedFilePath);
5425
5432
  this.fileWatcher.watch(resolvedFilePath);
5433
+ try {
5434
+ const existing = readFileSync6(resolvedFilePath, "utf8").split("\n").filter(Boolean);
5435
+ if (existing.length > 0) {
5436
+ this.wsHub.broadcast({ type: "conversation_events", sessionId, lines: existing });
5437
+ for (const line of existing) {
5438
+ this.wsHub.broadcast({ type: "conversation_event", sessionId, line });
5439
+ }
5440
+ }
5441
+ } catch {
5442
+ }
5426
5443
  if (this.scannerReady) {
5427
5444
  this.scannerStale = true;
5428
5445
  } else {