feat(workspaces): implement Hub auto-cleanup and connection heartbeat

This commit is contained in:
mkorwel
2026-03-19 09:50:43 -07:00
parent c368e513b0
commit 5647fb09ae
7 changed files with 140 additions and 7 deletions
@@ -93,6 +93,21 @@ export class WorkspaceHubClient {
return (await response.json()) as WorkspaceHubInfo;
}
/**
* Notify the hub that a user is connecting to a workspace
*/
async notifyConnect(id: string): Promise<void> {
const url = `${this.hubUrl}/workspaces/${id}/connect`;
const response = await fetchWithTimeout(url, 5000, {
method: 'POST',
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`Hub API error (${response.status}): ${errorText}`);
}
}
/**
* Delete a workspace
*/