File tree Expand file tree Collapse file tree
packages/memory-host-sdk/src/host Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Memory Host SDK module implements session files behavior.
2- import fsSync from "node:fs" ;
32import fs from "node:fs/promises" ;
43import path from "node:path" ;
54import { readRegularFile , statRegularFile } from "./fs-utils.js" ;
@@ -254,22 +253,10 @@ function readSessionTranscriptClassificationStore(
254253 storePath : string ,
255254) : Record < string , SessionTranscriptStoreEntry > {
256255 try {
257- const store = loadSessionStore ( storePath , { skipCache : true } ) as Record <
256+ return loadSessionStore ( storePath , { skipCache : true } ) as Record <
258257 string ,
259258 SessionTranscriptStoreEntry
260259 > ;
261- if ( Object . keys ( store ) . length > 0 ) {
262- return store ;
263- }
264- } catch {
265- // Fall back to legacy JSON stores below.
266- }
267- try {
268- const parsed = JSON . parse ( fsSync . readFileSync ( storePath , "utf8" ) ) as unknown ;
269- if ( ! parsed || typeof parsed !== "object" || Array . isArray ( parsed ) ) {
270- return { } ;
271- }
272- return parsed as Record < string , SessionTranscriptStoreEntry > ;
273260 } catch {
274261 return { } ;
275262 }
You can’t perform that action at this time.
0 commit comments