@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 +15 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -483,6 +483,7 @@ declare class ConversationCache {
|
|
|
483
483
|
* offset index keys on this so the window select and the cursor agree.
|
|
484
484
|
*/
|
|
485
485
|
static conversationIdForFile(filePath: string): string;
|
|
486
|
+
private isIndexableFile;
|
|
486
487
|
/**
|
|
487
488
|
* Incremental offset-index writer: extend the index for a burst of appended
|
|
488
489
|
* lines (one watcher read) using their byte spans. Each line is classified
|
package/dist/index.d.ts
CHANGED
|
@@ -483,6 +483,7 @@ declare class ConversationCache {
|
|
|
483
483
|
* offset index keys on this so the window select and the cursor agree.
|
|
484
484
|
*/
|
|
485
485
|
static conversationIdForFile(filePath: string): string;
|
|
486
|
+
private isIndexableFile;
|
|
486
487
|
/**
|
|
487
488
|
* Incremental offset-index writer: extend the index for a burst of appended
|
|
488
489
|
* lines (one watcher read) using their byte spans. Each line is classified
|
package/dist/index.js
CHANGED
|
@@ -3581,6 +3581,16 @@ var ConversationCache = class _ConversationCache {
|
|
|
3581
3581
|
static conversationIdForFile(filePath) {
|
|
3582
3582
|
return filePath.split(/[/\\]/).pop()?.replace(/\.jsonl$/, "") ?? filePath;
|
|
3583
3583
|
}
|
|
3584
|
+
// The offset index understands only claude-code JSONL: parseJsonlLine is the
|
|
3585
|
+
// claude-code reducer, so a codex file "indexes" as zero messages and the
|
|
3586
|
+
// resulting file_state serves empty windows for a real conversation (the
|
|
3587
|
+
// silent-wrong-data bug hotfixed after 1.28.0). Non-claude providers are
|
|
3588
|
+
// excluded from the index entirely; the scanner serves them (it routes each
|
|
3589
|
+
// provider to its own parser).
|
|
3590
|
+
isIndexableFile(filePath) {
|
|
3591
|
+
const meta = this.getMetaById(_ConversationCache.conversationIdForFile(filePath));
|
|
3592
|
+
return (meta?.provider ?? CLAUDE_CODE_PROVIDER) === CLAUDE_CODE_PROVIDER;
|
|
3593
|
+
}
|
|
3584
3594
|
/**
|
|
3585
3595
|
* Incremental offset-index writer: extend the index for a burst of appended
|
|
3586
3596
|
* lines (one watcher read) using their byte spans. Each line is classified
|
|
@@ -3608,6 +3618,7 @@ var ConversationCache = class _ConversationCache {
|
|
|
3608
3618
|
* offset and file_state.byte_offset are the same number by construction.
|
|
3609
3619
|
*/
|
|
3610
3620
|
extendMessageIndex(filePath, spans, stat3, readFrom, endOffset) {
|
|
3621
|
+
if (!this.isIndexableFile(filePath)) return spans.map(() => null);
|
|
3611
3622
|
const existing = this.getFileState(filePath);
|
|
3612
3623
|
const expectedStart = existing?.byte_offset ?? 0;
|
|
3613
3624
|
if (readFrom !== expectedStart) return null;
|
|
@@ -3682,6 +3693,7 @@ var ConversationCache = class _ConversationCache {
|
|
|
3682
3693
|
const convId = _ConversationCache.conversationIdForFile(filePath);
|
|
3683
3694
|
this.deleteFileIndex(filePath, convId);
|
|
3684
3695
|
this.indexParseState.delete(filePath);
|
|
3696
|
+
if (!this.isIndexableFile(filePath)) return;
|
|
3685
3697
|
const CHUNK = 256 * 1024;
|
|
3686
3698
|
const YIELD_EVERY = 1e3;
|
|
3687
3699
|
const state = createJsonlParseState();
|
|
@@ -3763,6 +3775,9 @@ var ConversationCache = class _ConversationCache {
|
|
|
3763
3775
|
if (fileIdentity(stat3) !== fileState.identity || stat3.size !== fileState.byte_offset) {
|
|
3764
3776
|
return null;
|
|
3765
3777
|
}
|
|
3778
|
+
if (fileState.last_message_index < 0 || !this.isIndexableFile(filePath)) {
|
|
3779
|
+
return null;
|
|
3780
|
+
}
|
|
3766
3781
|
const total = fileState.last_message_index + 1;
|
|
3767
3782
|
const from = Math.max(0, fromIndex);
|
|
3768
3783
|
const to = Math.min(toIndex, total);
|