feat(FN-1771): add dashboard memory settings UX with backend selector and capability-aware editing
- Add /api/memory/backend endpoint returning current backend, capabilities, and available backends - Create useMemoryBackendStatus hook with polling and frontend-friendly interface - Add MemorySettingsSection to SettingsModal with backend selector dropdown - Implement capability-aware UI: readonly backends disable save, fallback on unknown types - Add comprehensive tests for API endpoints and hook behavior - Update architecture docs with memory backend architecture section
This commit is contained in:
@@ -299,6 +299,37 @@ export function saveMemory(content: string, projectId?: string): Promise<{ succe
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Memory backend capabilities returned by the backend status API.
|
||||
*/
|
||||
export interface MemoryBackendCapabilities {
|
||||
readable: boolean;
|
||||
writable: boolean;
|
||||
supportsAtomicWrite: boolean;
|
||||
hasConflictResolution: boolean;
|
||||
persistent: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Memory backend status response from GET /api/memory/backend
|
||||
*/
|
||||
export interface MemoryBackendStatus {
|
||||
/** The effective backend type after runtime resolution */
|
||||
currentBackend: string;
|
||||
/** Capabilities of the effective backend */
|
||||
capabilities: MemoryBackendCapabilities;
|
||||
/** List of registered backend types available */
|
||||
availableBackends: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the current memory backend status and capabilities.
|
||||
* Use this to determine which backend is active and what operations it supports.
|
||||
*/
|
||||
export function fetchMemoryBackendStatus(projectId?: string): Promise<MemoryBackendStatus> {
|
||||
return api<MemoryBackendStatus>(withProjectId("/memory/backend", projectId));
|
||||
}
|
||||
|
||||
/** Fetch global (user-level) settings from ~/.pi/fusion/settings.json */
|
||||
export function fetchGlobalSettings(): Promise<GlobalSettings> {
|
||||
return api<GlobalSettings>("/settings/global");
|
||||
|
||||
Reference in New Issue
Block a user