feat(ext/sw): get_vault_status handler + cached sync state (Plan C Phase 6)

Returns cached ahead/behind/lastSyncAt from the GitHost plus a live count of
active (non-trashed) manifest items. No network call — sync is user-initiated;
the sync handler records lastSyncAt (unix seconds). ahead/behind stay 0 in the
extension (writes go straight to the host, no local commit graph) and exist
for parity with relicario status.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-05-31 15:24:02 -04:00
parent 3121431a7e
commit 61275574d4
6 changed files with 105 additions and 4 deletions

View File

@@ -41,6 +41,15 @@ export interface GitHost {
/// Delete a blob from the repo. Currently identical to deleteFile;
/// kept distinct for symmetry with putBlob.
deleteBlob(path: string, message: string): Promise<void>;
/// Cached sync metadata, populated by the `sync` handler — get_vault_status
/// reads these without any network call. lastSyncAt is unix SECONDS (or null
/// until the first sync). ahead/behind exist for parity with `relicario
/// status`; the extension writes straight to the host (no local commit
/// graph), so in practice they stay 0.
lastSyncAt: number | null;
ahead: number;
behind: number;
}
/// Pre-base64 byte size at which putBlob switches from Contents API to