restores Helder in all its glory

This commit is contained in:
2026-09-28 11:34:49 +02:00
parent c2b38b853c
commit 1d29d0952d
280 changed files with 29205 additions and 7 deletions
@@ -0,0 +1,21 @@
import Foundation
import HelderCore
import HelderServices
@testable import HelderUI
/// Sessions and the agent split, in memory instead of UserDefaults.
final class FakeSession: SessionStoring, @unchecked Sendable {
private let state = Locked((sessions: [String: SessionState](), layout: LayoutState()))
var sessions: [String: SessionState] {
get { state.current.sessions }
set { state.mutate { $0.sessions = newValue } }
}
var layout: LayoutState { state.current.layout }
func loadSession(root: String) -> SessionState? { state.current.sessions[root] }
func saveSession(_ session: SessionState, root: String) { state.mutate { $0.sessions[root] = session } }
func loadLayout() -> LayoutState { state.current.layout }
func saveLayout(_ layout: LayoutState) { state.mutate { $0.layout = layout } }
}