@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/cli.cjs CHANGED
@@ -137142,6 +137142,16 @@ var ConversationCache = class _ConversationCache {
137142
137142
  static conversationIdForFile(filePath) {
137143
137143
  return filePath.split(/[/\\]/).pop()?.replace(/\.jsonl$/, "") ?? filePath;
137144
137144
  }
137145
+ // The offset index understands only claude-code JSONL: parseJsonlLine is the
137146
+ // claude-code reducer, so a codex file "indexes" as zero messages and the
137147
+ // resulting file_state serves empty windows for a real conversation (the
137148
+ // silent-wrong-data bug hotfixed after 1.28.0). Non-claude providers are
137149
+ // excluded from the index entirely; the scanner serves them (it routes each
137150
+ // provider to its own parser).
137151
+ isIndexableFile(filePath) {
137152
+ const meta3 = this.getMetaById(_ConversationCache.conversationIdForFile(filePath));
137153
+ return (meta3?.provider ?? CLAUDE_CODE_PROVIDER2) === CLAUDE_CODE_PROVIDER2;
137154
+ }
137145
137155
  /**
137146
137156
  * Incremental offset-index writer: extend the index for a burst of appended
137147
137157
  * lines (one watcher read) using their byte spans. Each line is classified
@@ -137169,6 +137179,7 @@ var ConversationCache = class _ConversationCache {
137169
137179
  * offset and file_state.byte_offset are the same number by construction.
137170
137180
  */
137171
137181
  extendMessageIndex(filePath, spans, stat10, readFrom, endOffset) {
137182
+ if (!this.isIndexableFile(filePath)) return spans.map(() => null);
137172
137183
  const existing = this.getFileState(filePath);
137173
137184
  const expectedStart = existing?.byte_offset ?? 0;
137174
137185
  if (readFrom !== expectedStart) return null;
@@ -137243,6 +137254,7 @@ var ConversationCache = class _ConversationCache {
137243
137254
  const convId = _ConversationCache.conversationIdForFile(filePath);
137244
137255
  this.deleteFileIndex(filePath, convId);
137245
137256
  this.indexParseState.delete(filePath);
137257
+ if (!this.isIndexableFile(filePath)) return;
137246
137258
  const CHUNK = 256 * 1024;
137247
137259
  const YIELD_EVERY = 1e3;
137248
137260
  const state = initialConvState();
@@ -137324,6 +137336,9 @@ var ConversationCache = class _ConversationCache {
137324
137336
  if (fileIdentity(stat10) !== fileState.identity || stat10.size !== fileState.byte_offset) {
137325
137337
  return null;
137326
137338
  }
137339
+ if (fileState.last_message_index < 0 || !this.isIndexableFile(filePath)) {
137340
+ return null;
137341
+ }
137327
137342
  const total = fileState.last_message_index + 1;
137328
137343
  const from = Math.max(0, fromIndex);
137329
137344
  const to2 = Math.min(toIndex, total);