Session Cache Implementation

Nucleic-Session: B2346642-3353-4BD5-9DE2-A8B77BD66C98
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-05 22:30:54 -07:00
co-authored by Nucleic
parent e7ca7cdfa7
commit 292fd8e7a8
@@ -44,6 +44,13 @@ final class RemoteStore: ObservableObject {
/// from `hostName(forSession:)` instead.
@Published private(set) var hostName: String = ""
@Published private(set) var sessions: [WireSessionSummary] = []
/// The last session list seen from a live host, persisted to disk (`SessionCache`) and reloaded
/// at launch. It backs `sessions` whenever nothing is connected, so the list shows a read-only
/// history while offline instead of an empty "waiting to connect" screen.
private var cachedSummaries: [WireSessionSummary] = SessionCache.loadSummaries()
/// Debounced disk-write tasks for the offline cache (coalesce a burst of updates into one write).
private var summaryPersistTask: Task<Void, Never>?
private var transcriptPersistTask: Task<Void, Never>?
@Published private(set) var capabilities = WireCapabilities(canModifyToolInput: false, allowAlwaysScopes: [])
@Published private(set) var grantedScope: DeviceScope = .approve
/// The host's model/effort catalog (SYNC §5.2), driving the composer + session-header pickers.