@threadbase-sh/streamer 1.27.2 → 1.28.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/cli.cjs +636 -156
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +500 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +118 -1
- package/dist/index.d.ts +118 -1
- package/dist/index.js +481 -15
- package/dist/index.js.map +1 -1
- package/dist/migrations/009_create_offset_index.sql +28 -0
- package/package.json +2 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
-- Offset index for windowed conversation-detail reads (design 1b).
|
|
2
|
+
-- Lets a detail/delta request do a SQL window lookup + pread of exact byte
|
|
3
|
+
-- ranges from the JSONL instead of re-parsing the whole file.
|
|
4
|
+
|
|
5
|
+
-- Per-file resume state: where indexing left off, and the identity used to
|
|
6
|
+
-- detect truncation/replacement (size < byte_offset, or a changed identity).
|
|
7
|
+
CREATE TABLE IF NOT EXISTS conversation_file_state (
|
|
8
|
+
path TEXT PRIMARY KEY,
|
|
9
|
+
identity TEXT NOT NULL, -- inode (dev:ino), else fingerprint of first N bytes
|
|
10
|
+
size INTEGER NOT NULL,
|
|
11
|
+
mtime_ms INTEGER NOT NULL,
|
|
12
|
+
byte_offset INTEGER NOT NULL, -- end of last fully-indexed line
|
|
13
|
+
last_message_index INTEGER NOT NULL
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
-- One row per indexed message. Non-message lines (summary/sidecar) get no row.
|
|
17
|
+
-- The PK (conversation_id, message_index) covers the window select
|
|
18
|
+
-- WHERE conversation_id = ? AND message_index BETWEEN ? AND ?.
|
|
19
|
+
CREATE TABLE IF NOT EXISTS conversation_message_index (
|
|
20
|
+
conversation_id TEXT NOT NULL,
|
|
21
|
+
message_index INTEGER NOT NULL,
|
|
22
|
+
byte_offset INTEGER NOT NULL,
|
|
23
|
+
byte_length INTEGER NOT NULL,
|
|
24
|
+
uuid TEXT,
|
|
25
|
+
role TEXT,
|
|
26
|
+
ts INTEGER,
|
|
27
|
+
PRIMARY KEY (conversation_id, message_index)
|
|
28
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threadbase-sh/streamer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "PTY session management, WebSocket streaming, and REST API server for Claude Code conversations",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ronen Mars",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@hono/node-ws": "^1.3.1",
|
|
93
93
|
"@temporalio/client": "^1.18.1",
|
|
94
94
|
"@threadbase-sh/agent-types": "^1.0.0",
|
|
95
|
-
"@threadbase-sh/scanner": "^0.10.
|
|
95
|
+
"@threadbase-sh/scanner": "^0.10.1",
|
|
96
96
|
"@xterm/headless": "^6.0.0",
|
|
97
97
|
"better-sqlite3": "^12.9.0",
|
|
98
98
|
"chokidar": "^5.0.0",
|