@threadbase-sh/streamer 1.18.4 → 1.18.6

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
@@ -746,6 +746,7 @@ declare class StreamerServer {
746
746
  private pendingQuestionKey;
747
747
  private pendingPermission;
748
748
  private scanner;
749
+ private allScanners;
749
750
  private scannerReady;
750
751
  private scannerStale;
751
752
  private binding;
package/dist/index.d.ts CHANGED
@@ -746,6 +746,7 @@ declare class StreamerServer {
746
746
  private pendingQuestionKey;
747
747
  private pendingPermission;
748
748
  private scanner;
749
+ private allScanners;
749
750
  private scannerReady;
750
751
  private scannerStale;
751
752
  private binding;
package/dist/index.js CHANGED
@@ -4304,6 +4304,9 @@ var StreamerServer = class {
4304
4304
  // /input { keys }. Cleared when the gate closes.
4305
4305
  pendingPermission = /* @__PURE__ */ new Map();
4306
4306
  scanner = null;
4307
+ // Tracks every ConversationScanner ever created so close() can shut them all
4308
+ // down and release SQLite handles (open handles block temp-dir deletion on Windows).
4309
+ allScanners = /* @__PURE__ */ new Set();
4307
4310
  scannerReady = null;
4308
4311
  // Set by onConversationChanged while a scan is in-flight; getScanner() does
4309
4312
  // a single rescan after the current one completes instead of restarting it.
@@ -4768,8 +4771,15 @@ var StreamerServer = class {
4768
4771
  this.conversationsRepo = new ConversationsRepository(this.cache);
4769
4772
  this.sessionsRepo = new SessionsRepository(this.sessionStore);
4770
4773
  this.cacheMetadataRepo = new CacheMetadataRepository(db);
4771
- const projectsDir = join12(homedir5(), ".claude", "projects");
4772
- this.fileWatcher.watchDirectory(projectsDir);
4774
+ if (this.scanProfiles && this.scanProfiles.length > 0) {
4775
+ for (const profile of this.scanProfiles) {
4776
+ if (profile.enabled) {
4777
+ this.fileWatcher.watchDirectory(join12(profile.configDir, "projects"));
4778
+ }
4779
+ }
4780
+ } else {
4781
+ this.fileWatcher.watchDirectory(join12(homedir5(), ".claude", "projects"));
4782
+ }
4773
4783
  } catch (err) {
4774
4784
  const message = err instanceof Error ? err.message : String(err);
4775
4785
  this.log.warn(`ConversationCache failed to open (running without cache): ${message}`, {
@@ -4778,6 +4788,7 @@ var StreamerServer = class {
4778
4788
  });
4779
4789
  }
4780
4790
  const warmupScanner = new ConversationScanner();
4791
+ this.allScanners.add(warmupScanner);
4781
4792
  const warmupStatCache = this.buildStatCache(null);
4782
4793
  const shouldEmitProgress = createScanProgressThrottle();
4783
4794
  const scanOpts = {
@@ -4902,6 +4913,9 @@ var StreamerServer = class {
4902
4913
  for (const timer of this.ptyGraceTimers.values()) clearTimeout(timer);
4903
4914
  this.ptyGraceTimers.clear();
4904
4915
  this.markScannerStaleDebounced.cancel();
4916
+ for (const s of this.allScanners) s.close();
4917
+ this.allScanners.clear();
4918
+ this.scanner = null;
4905
4919
  this.cache?.close();
4906
4920
  this.ptyManager.dispose();
4907
4921
  this.fileWatcher.dispose();
@@ -5230,6 +5244,7 @@ var StreamerServer = class {
5230
5244
  this.scannerStale = false;
5231
5245
  const statCache = this.buildStatCache(this.scanner);
5232
5246
  this.scanner = new ConversationScanner();
5247
+ this.allScanners.add(this.scanner);
5233
5248
  this.scannerReady = this.scanner.scan({
5234
5249
  ...this.scanProfiles ? { profiles: this.scanProfiles } : {},
5235
5250
  ...this.codexScanOpts(),