@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/cli.cjs +14 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +14 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4166,6 +4166,19 @@ var ConversationWatcher = class {
|
|
|
4166
4166
|
void entry.watcher.close();
|
|
4167
4167
|
this.files.delete(filePath);
|
|
4168
4168
|
}
|
|
4169
|
+
/**
|
|
4170
|
+
* Re-drive the tail read for a file that's already being tailed. A per-file
|
|
4171
|
+
* chokidar handle can die silently (fs.watch stops firing after inode churn)
|
|
4172
|
+
* while the coarser directory watcher keeps reporting changes — calling this
|
|
4173
|
+
* from the directory-event path makes the tail self-healing. Reads are
|
|
4174
|
+
* offset-based and coalesced, so a redundant poke after a normal change
|
|
4175
|
+
* event is a cheap stat + no-op. Returns false for untailed paths.
|
|
4176
|
+
*/
|
|
4177
|
+
poke(filePath) {
|
|
4178
|
+
if (!this.files.has(filePath)) return false;
|
|
4179
|
+
void this.readNewLines(filePath);
|
|
4180
|
+
return true;
|
|
4181
|
+
}
|
|
4169
4182
|
/**
|
|
4170
4183
|
* Watch a directory of conversation JSONL files. Fires
|
|
4171
4184
|
* onConversationChanged for any add/change/unlink event so the caller
|
|
@@ -5002,6 +5015,7 @@ var StreamerServer = class {
|
|
|
5002
5015
|
}
|
|
5003
5016
|
},
|
|
5004
5017
|
onConversationChanged: (filePath) => {
|
|
5018
|
+
this.fileWatcher.poke(filePath);
|
|
5005
5019
|
this.cache?.invalidateByFilePath(filePath, { skipIfTailed: true });
|
|
5006
5020
|
this.markScannerStaleDebounced();
|
|
5007
5021
|
this.log.debug?.(`Scanner invalidated by directory event: ${filePath}`, {
|