@@ -396,10 +396,6 @@ type DailyIngestionState = {
396396 files : Record < string , DailyIngestionFileState > ;
397397} ;
398398
399- function resolveDailyIngestionStatePath ( workspaceDir : string ) : string {
400- return path . join ( workspaceDir , DAILY_INGESTION_STATE_RELATIVE_PATH ) ;
401- }
402-
403399function normalizeDailyIngestionState ( raw : unknown ) : DailyIngestionState {
404400 const record = asRecord ( raw ) ;
405401 const filesRaw = asRecord ( record ?. files ) ;
@@ -442,10 +438,9 @@ function normalizeMemoryDay(value: unknown): string | undefined {
442438}
443439
444440async function readDailyIngestionState ( workspaceDir : string ) : Promise < DailyIngestionState > {
445- const statePath = resolveDailyIngestionStatePath ( workspaceDir ) ;
446441 try {
447442 return normalizeDailyIngestionState (
448- await privateFileStore ( workspaceDir ) . readJsonIfExists ( path . relative ( workspaceDir , statePath ) ) ,
443+ await privateFileStore ( workspaceDir ) . readJsonIfExists ( DAILY_INGESTION_STATE_RELATIVE_PATH ) ,
449444 ) ;
450445 } catch ( err ) {
451446 if ( err instanceof SyntaxError ) {
@@ -459,8 +454,7 @@ async function writeDailyIngestionState(
459454 workspaceDir : string ,
460455 state : DailyIngestionState ,
461456) : Promise < void > {
462- const statePath = resolveDailyIngestionStatePath ( workspaceDir ) ;
463- await privateFileStore ( workspaceDir ) . writeJson ( path . relative ( workspaceDir , statePath ) , state , {
457+ await privateFileStore ( workspaceDir ) . writeJson ( DAILY_INGESTION_STATE_RELATIVE_PATH , state , {
464458 trailingNewline : true ,
465459 } ) ;
466460}
@@ -496,10 +490,6 @@ function normalizeWorkspaceKey(workspaceDir: string): string {
496490 return process . platform === "win32" ? resolved . toLowerCase ( ) : resolved ;
497491}
498492
499- function resolveSessionIngestionStatePath ( workspaceDir : string ) : string {
500- return path . join ( workspaceDir , SESSION_INGESTION_STATE_RELATIVE_PATH ) ;
501- }
502-
503493function normalizeSessionIngestionState ( raw : unknown ) : SessionIngestionState {
504494 const record = asRecord ( raw ) ;
505495 const filesRaw = asRecord ( record ?. files ) ;
@@ -554,10 +544,9 @@ function normalizeSessionIngestionState(raw: unknown): SessionIngestionState {
554544}
555545
556546async function readSessionIngestionState ( workspaceDir : string ) : Promise < SessionIngestionState > {
557- const statePath = resolveSessionIngestionStatePath ( workspaceDir ) ;
558547 try {
559548 return normalizeSessionIngestionState (
560- await privateFileStore ( workspaceDir ) . readJsonIfExists ( path . relative ( workspaceDir , statePath ) ) ,
549+ await privateFileStore ( workspaceDir ) . readJsonIfExists ( SESSION_INGESTION_STATE_RELATIVE_PATH ) ,
561550 ) ;
562551 } catch ( err ) {
563552 if ( err instanceof SyntaxError ) {
@@ -571,8 +560,7 @@ async function writeSessionIngestionState(
571560 workspaceDir : string ,
572561 state : SessionIngestionState ,
573562) : Promise < void > {
574- const statePath = resolveSessionIngestionStatePath ( workspaceDir ) ;
575- await privateFileStore ( workspaceDir ) . writeJson ( path . relative ( workspaceDir , statePath ) , state , {
563+ await privateFileStore ( workspaceDir ) . writeJson ( SESSION_INGESTION_STATE_RELATIVE_PATH , state , {
576564 trailingNewline : true ,
577565 } ) ;
578566}
0 commit comments