(id: string, displayName: string)
| 107 | |
| 108 | /** Update only the display name in workspace_meta.json (lightweight, no full state). */ |
| 109 | export async function updateWorkspaceMeta(id: string, displayName: string): Promise<void> { |
| 110 | const backend = await _getBackend(); |
| 111 | if (backend === 'ephemeral') { |
| 112 | await workspaceDB.updateDisplayName(id, displayName); |
| 113 | _notifyListChanged(); |
| 114 | return; |
| 115 | } |
| 116 | await apiRequest(getUrls().SESSION_UPDATE_META, { |
| 117 | method: 'POST', |
| 118 | headers: { 'Content-Type': 'application/json' }, |
| 119 | body: JSON.stringify({ id, display_name: displayName }), |
| 120 | }); |
| 121 | _notifyListChanged(); |
| 122 | } |
| 123 | |
| 124 | /** Save current workspace state (called by auto-save). */ |
| 125 | export async function saveWorkspaceState(state: Record<string, unknown>): Promise<void> { |
no test coverage detected