@threadbase-sh/streamer 1.28.0 → 1.28.1

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
@@ -3617,6 +3617,16 @@ var ConversationCache = class _ConversationCache {
3617
3617
  static conversationIdForFile(filePath) {
3618
3618
  return filePath.split(/[/\\]/).pop()?.replace(/\.jsonl$/, "") ?? filePath;
3619
3619
  }
3620
+ // The offset index understands only claude-code JSONL: parseJsonlLine is the
3621
+ // claude-code reducer, so a codex file "indexes" as zero messages and the
3622
+ // resulting file_state serves empty windows for a real conversation (the
3623
+ // silent-wrong-data bug hotfixed after 1.28.0). Non-claude providers are
3624
+ // excluded from the index entirely; the scanner serves them (it routes each
3625
+ // provider to its own parser).
3626
+ isIndexableFile(filePath) {
3627
+ const meta = this.getMetaById(_ConversationCache.conversationIdForFile(filePath));
3628
+ return (meta?.provider ?? CLAUDE_CODE_PROVIDER) === CLAUDE_CODE_PROVIDER;
3629
+ }
3620
3630
  /**
3621
3631
  * Incremental offset-index writer: extend the index for a burst of appended
3622
3632
  * lines (one watcher read) using their byte spans. Each line is classified
@@ -3644,6 +3654,7 @@ var ConversationCache = class _ConversationCache {
3644
3654
  * offset and file_state.byte_offset are the same number by construction.
3645
3655
  */
3646
3656
  extendMessageIndex(filePath, spans, stat3, readFrom, endOffset) {
3657
+ if (!this.isIndexableFile(filePath)) return spans.map(() => null);
3647
3658
  const existing = this.getFileState(filePath);
3648
3659
  const expectedStart = existing?.byte_offset ?? 0;
3649
3660
  if (readFrom !== expectedStart) return null;
@@ -3718,6 +3729,7 @@ var ConversationCache = class _ConversationCache {
3718
3729
  const convId = _ConversationCache.conversationIdForFile(filePath);
3719
3730
  this.deleteFileIndex(filePath, convId);
3720
3731
  this.indexParseState.delete(filePath);
3732
+ if (!this.isIndexableFile(filePath)) return;
3721
3733
  const CHUNK = 256 * 1024;
3722
3734
  const YIELD_EVERY = 1e3;
3723
3735
  const state = (0, import_scanner2.createJsonlParseState)();
@@ -3799,6 +3811,9 @@ var ConversationCache = class _ConversationCache {
3799
3811
  if (fileIdentity(stat3) !== fileState.identity || stat3.size !== fileState.byte_offset) {
3800
3812
  return null;
3801
3813
  }
3814
+ if (fileState.last_message_index < 0 || !this.isIndexableFile(filePath)) {
3815
+ return null;
3816
+ }
3802
3817
  const total = fileState.last_message_index + 1;
3803
3818
  const from = Math.max(0, fromIndex);
3804
3819
  const to = Math.min(toIndex, total);