@threadbase-sh/streamer 1.15.2 → 1.15.4

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.cjs CHANGED
@@ -1605,7 +1605,13 @@ function getVersion() {
1605
1605
  function resolveVersion() {
1606
1606
  const scriptPath = process.argv[1] ?? "";
1607
1607
  const here = scriptPath ? (0, import_node_path3.dirname)(scriptPath) : process.cwd();
1608
- for (const dir of [here, (0, import_node_path3.join)(here, "..")]) {
1608
+ let realHere = here;
1609
+ try {
1610
+ realHere = (0, import_node_path3.dirname)((0, import_node_fs2.realpathSync)(scriptPath));
1611
+ } catch {
1612
+ }
1613
+ const searchDirs = realHere === here ? [here, (0, import_node_path3.join)(here, "..")] : [here, (0, import_node_path3.join)(here, ".."), realHere, (0, import_node_path3.join)(realHere, "..")];
1614
+ for (const dir of searchDirs) {
1609
1615
  try {
1610
1616
  const v = (0, import_node_fs2.readFileSync)((0, import_node_path3.join)(dir, "version.txt"), "utf8").trim();
1611
1617
  if (v) return v;
@@ -5464,6 +5470,16 @@ var StreamerServer = class {
5464
5470
  cleanup();
5465
5471
  this.sessionFileMap.set(sessionId, resolvedFilePath);
5466
5472
  this.fileWatcher.watch(resolvedFilePath);
5473
+ try {
5474
+ const existing = (0, import_fs11.readFileSync)(resolvedFilePath, "utf8").split("\n").filter(Boolean);
5475
+ if (existing.length > 0) {
5476
+ this.wsHub.broadcast({ type: "conversation_events", sessionId, lines: existing });
5477
+ for (const line of existing) {
5478
+ this.wsHub.broadcast({ type: "conversation_event", sessionId, line });
5479
+ }
5480
+ }
5481
+ } catch {
5482
+ }
5467
5483
  if (this.scannerReady) {
5468
5484
  this.scannerStale = true;
5469
5485
  } else {