feat(cli): add version, indexPath, lastIndexed to status --json (#329)
Adds `version`, `indexPath`, and an ISO `lastIndexed` to `codegraph status --json`, plus a `CodeGraph.getLastIndexedAt()` library method. `agentCount` dropped (no clear consumer). Reworked from contributor PRs #333 and #480. Co-Authored-By: Javier Gómez <199902626+12122J@users.noreply.github.com> Co-Authored-By: Ran <8403607+eddieran@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Javier Gómez
Ran
Claude Opus 4.8
parent
ddb1a8f72d
commit
7b62356f53
@@ -1421,6 +1421,17 @@ export class QueryBuilder {
|
||||
return rows.map(rowToFileRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* Most recent index timestamp (ms since epoch) across all tracked files, or
|
||||
* null when nothing is indexed yet. One indexed aggregate, no per-row scan. (#329)
|
||||
*/
|
||||
getLastIndexedAt(): number | null {
|
||||
const row = this.db
|
||||
.prepare('SELECT MAX(indexed_at) AS last FROM files')
|
||||
.get() as { last: number | null } | undefined;
|
||||
return row?.last ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files that need re-indexing (hash changed)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user