mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-21 14:34:32 +00:00
Reading, decoding and line-parsing a Claude session JSONL is per-file work that touches nothing shared, so it moves onto worker_threads for a large cold parse. parseClaudeFileFull() is the extracted unit both sides run; a worker runs it against an empty dedup set and returns the result as a JSON string, and the parent installs results in the order the serial loop would. Everything with cross-file state stays on the main thread, and a file whose message ids were already claimed (or whose worker failed) re-parses in-process, so the output is identical to the serial path. Thread count is decided per parse: never with <=2 cores, under 2 GB free memory, fewer than 200 pending whole-file re-parses or under 200 MB behind them, so warm and incremental runs spawn nothing. CODEBURN_PARSE_WORKERS overrides it. The pool is terminated when the parse ends, so the resident serve child accumulates no threads.
13 lines
294 B
TypeScript
13 lines
294 B
TypeScript
import { defineConfig } from 'tsup'
|
|
|
|
export default defineConfig({
|
|
entry: ['src/main.ts', 'src/parse-worker.ts'],
|
|
format: ['esm'],
|
|
target: 'node20',
|
|
outDir: 'dist',
|
|
clean: true,
|
|
splitting: false,
|
|
sourcemap: true,
|
|
dts: false,
|
|
external: ['@modelcontextprotocol/sdk', 'zod'],
|
|
})
|