No JSDoc comment in source yet.
API
@Component()
export class TraceIndexRepo implements TraceIndexStore {
@Use() private readonly db!: Db;
upsertFile(row: TraceFileRow): void;
updateFileSize(projectId: string, agentId: string, sessionId: string, fileIndex: number, sizeBytes: number): void;
getPageStats(projectId: string, agentId: string, sessionId: string, fileIndex: number): string | null;
setPageStats(projectId: string, agentId: string, sessionId: string, fileIndex: number, sizeBytes: number, pageStats: string): void;
deleteFile(projectId: string, agentId: string, sessionId: string, fileIndex: number): void;
listFilesByAgent(projectId: string, agentId: string): TraceFileRow[];
listFilesBySession(projectId: string, agentId: string, sessionId: string): TraceFileRow[];
findAgentBySession(projectId: string, sessionId: string): string | null;
upsertSession(row: TraceSessionRow): void;
getSession(sessionId: string): TraceSessionRow | null;
listSessionsByAgent(projectId: string, agentId: string): TraceSessionRow[];
deleteBySession(sessionId: string): void;
deleteByAgent(projectId: string, agentId: string): void;
deleteByProject(projectId: string): void;
}Dependencies & Wiring
Extracted from class decoratorsMethods (14)
upsertFile
upsertFile(row: TraceFileRow): void@paramrow
TraceFileRow@returns
voidupdateFileSize
updateFileSize(projectId: string, agentId: string, sessionId: string, fileIndex: number, sizeBytes: number): voidRefreshes one shard's last-observed size (listings write back their page stats); a changed size voids the cached window scan.
@paramprojectId
string@paramagentId
string@paramsessionId
string@paramfileIndex
number@paramsizeBytes
number@returns
voidgetPageStats
getPageStats(projectId: string, agentId: string, sessionId: string, fileIndex: number): string | nullCached message-window prefix record of one shard (see services/message-window.ts); null = none.
@paramprojectId
string@paramagentId
string@paramsessionId
string@paramfileIndex
number@returns
string | nullsetPageStats
setPageStats(projectId: string, agentId: string, sessionId: string, fileIndex: number, sizeBytes: number, pageStats: string): voidStores a shard's message-window prefix record, guarded on the size it was computed for (a concurrent append voids the write).
@paramprojectId
string@paramagentId
string@paramsessionId
string@paramfileIndex
number@paramsizeBytes
number@parampageStats
string@returns
voiddeleteFile
deleteFile(projectId: string, agentId: string, sessionId: string, fileIndex: number): void@paramprojectId
string@paramagentId
string@paramsessionId
string@paramfileIndex
number@returns
voidlistFilesByAgent
listFilesByAgent(projectId: string, agentId: string): TraceFileRow[]All indexed shards of one Agent (date desc, session desc, index asc — the listing's canonical order).
@paramprojectId
string@paramagentId
string@returns
TraceFileRow[]listFilesBySession
listFilesBySession(projectId: string, agentId: string, sessionId: string): TraceFileRow[]One Session's shards, index ascending.
@paramprojectId
string@paramagentId
string@paramsessionId
string@returns
TraceFileRow[]findAgentBySession
findAgentBySession(projectId: string, sessionId: string): string | nullOwning Agent of a Session's Trace within a Project (the subagent-pointer resolver); null when unindexed.
@paramprojectId
string@paramsessionId
string@returns
string | nullupsertSession
upsertSession(row: TraceSessionRow): void@paramrow
TraceSessionRow@returns
voidgetSession
getSession(sessionId: string): TraceSessionRow | null@paramsessionId
string@returns
TraceSessionRow | nulllistSessionsByAgent
listSessionsByAgent(projectId: string, agentId: string): TraceSessionRow[]@paramprojectId
string@paramagentId
string@returns
TraceSessionRow[]deleteBySession
deleteBySession(sessionId: string): voidRemoves one Session's rows from both tables (Session delete keeps the cache coherent).
@paramsessionId
string@returns
voiddeleteByAgent
deleteByAgent(projectId: string, agentId: string): void@paramprojectId
string@paramagentId
string@returns
voiddeleteByProject
deleteByProject(projectId: string): void@paramprojectId
string@returns
void