@threadbase-sh/streamer 1.24.3 → 1.24.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.d.cts CHANGED
@@ -987,6 +987,15 @@ declare class ConversationWatcher {
987
987
  constructor(events?: ConversationWatcherEvents);
988
988
  watch(filePath: string): void;
989
989
  unwatch(filePath: string): void;
990
+ /**
991
+ * Re-drive the tail read for a file that's already being tailed. A per-file
992
+ * chokidar handle can die silently (fs.watch stops firing after inode churn)
993
+ * while the coarser directory watcher keeps reporting changes — calling this
994
+ * from the directory-event path makes the tail self-healing. Reads are
995
+ * offset-based and coalesced, so a redundant poke after a normal change
996
+ * event is a cheap stat + no-op. Returns false for untailed paths.
997
+ */
998
+ poke(filePath: string): boolean;
990
999
  /**
991
1000
  * Watch a directory of conversation JSONL files. Fires
992
1001
  * onConversationChanged for any add/change/unlink event so the caller
package/dist/index.d.ts CHANGED
@@ -987,6 +987,15 @@ declare class ConversationWatcher {
987
987
  constructor(events?: ConversationWatcherEvents);
988
988
  watch(filePath: string): void;
989
989
  unwatch(filePath: string): void;
990
+ /**
991
+ * Re-drive the tail read for a file that's already being tailed. A per-file
992
+ * chokidar handle can die silently (fs.watch stops firing after inode churn)
993
+ * while the coarser directory watcher keeps reporting changes — calling this
994
+ * from the directory-event path makes the tail self-healing. Reads are
995
+ * offset-based and coalesced, so a redundant poke after a normal change
996
+ * event is a cheap stat + no-op. Returns false for untailed paths.
997
+ */
998
+ poke(filePath: string): boolean;
990
999
  /**
991
1000
  * Watch a directory of conversation JSONL files. Fires
992
1001
  * onConversationChanged for any add/change/unlink event so the caller
package/dist/index.js CHANGED
@@ -4127,6 +4127,19 @@ var ConversationWatcher = class {
4127
4127
  void entry.watcher.close();
4128
4128
  this.files.delete(filePath);
4129
4129
  }
4130
+ /**
4131
+ * Re-drive the tail read for a file that's already being tailed. A per-file
4132
+ * chokidar handle can die silently (fs.watch stops firing after inode churn)
4133
+ * while the coarser directory watcher keeps reporting changes — calling this
4134
+ * from the directory-event path makes the tail self-healing. Reads are
4135
+ * offset-based and coalesced, so a redundant poke after a normal change
4136
+ * event is a cheap stat + no-op. Returns false for untailed paths.
4137
+ */
4138
+ poke(filePath) {
4139
+ if (!this.files.has(filePath)) return false;
4140
+ void this.readNewLines(filePath);
4141
+ return true;
4142
+ }
4130
4143
  /**
4131
4144
  * Watch a directory of conversation JSONL files. Fires
4132
4145
  * onConversationChanged for any add/change/unlink event so the caller
@@ -4963,6 +4976,7 @@ var StreamerServer = class {
4963
4976
  }
4964
4977
  },
4965
4978
  onConversationChanged: (filePath) => {
4979
+ this.fileWatcher.poke(filePath);
4966
4980
  this.cache?.invalidateByFilePath(filePath, { skipIfTailed: true });
4967
4981
  this.markScannerStaleDebounced();
4968
4982
  this.log.debug?.(`Scanner invalidated by directory event: ${filePath}`, {