@threadbase-sh/streamer 1.28.1 → 1.29.0

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
@@ -3471,6 +3471,9 @@ var ConversationCache = class _ConversationCache {
3471
3471
  deleteAll: db.prepare("DELETE FROM conversation_meta"),
3472
3472
  deleteTailAll: db.prepare("DELETE FROM conversation_tail"),
3473
3473
  getIdByFilePath: db.prepare("SELECT id FROM conversation_meta WHERE file_path = ?"),
3474
+ getProviderByFilePath: db.prepare(
3475
+ "SELECT provider FROM conversation_meta WHERE file_path = ?"
3476
+ ),
3474
3477
  allFilePaths: db.prepare("SELECT id, file_path FROM conversation_meta"),
3475
3478
  allFileStats: db.prepare(
3476
3479
  "SELECT file_path, mtime_ms, file_size FROM conversation_meta WHERE mtime_ms IS NOT NULL AND file_size IS NOT NULL"
@@ -3624,8 +3627,9 @@ var ConversationCache = class _ConversationCache {
3624
3627
  // excluded from the index entirely; the scanner serves them (it routes each
3625
3628
  // provider to its own parser).
3626
3629
  isIndexableFile(filePath) {
3627
- const meta = this.getMetaById(_ConversationCache.conversationIdForFile(filePath));
3628
- return (meta?.provider ?? CLAUDE_CODE_PROVIDER) === CLAUDE_CODE_PROVIDER;
3630
+ const row = this.stmts.getProviderByFilePath.get(filePath);
3631
+ if (!row) return false;
3632
+ return (row.provider ?? CLAUDE_CODE_PROVIDER) === CLAUDE_CODE_PROVIDER;
3629
3633
  }
3630
3634
  /**
3631
3635
  * Incremental offset-index writer: extend the index for a burst of appended
@@ -5913,7 +5917,7 @@ var StreamerServer = class {
5913
5917
  }
5914
5918
  for (const [sessionId, subscribers] of this.sessionSubscribers) {
5915
5919
  subscribers.delete(ws);
5916
- if (subscribers.size === 0) {
5920
+ if (subscribers.size === 0 && this.ptyGracePeriodMs > 0) {
5917
5921
  this.startGraceTimer(sessionId, this.ptyGracePeriodMs);
5918
5922
  }
5919
5923
  }