File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -95,10 +95,11 @@ export function* iterActions<TWorkspaces extends readonly AnyWorkspaceConfig[]>(
9595 for ( const [ workspaceId , workspaceClient ] of Object . entries (
9696 workspaceClients ,
9797 ) ) {
98- // Extract all exports (excluding cleanup methods from the workspace interface)
98+ // Extract all exports (excluding cleanup methods and internal properties from the workspace interface)
9999 const {
100100 destroy : _workspaceDestroy ,
101101 [ Symbol . asyncDispose ] : _workspaceAsyncDispose ,
102+ $ydoc : _$ydoc ,
102103 ...workspaceExports
103104 } = workspaceClient as WorkspaceClient < WorkspaceExports > ;
104105
Original file line number Diff line number Diff line change @@ -2,13 +2,15 @@ import { openapi } from '@elysiajs/openapi';
22import { Elysia } from 'elysia' ;
33// import { mcp } from 'elysia-mcp';
44import { Err , isResult , Ok } from 'wellcrafted/result' ;
5+ import type { WorkspaceExports } from '../core/actions' ;
56import {
67 createEpicenterClient ,
78 type EpicenterConfig ,
89 iterActions ,
910} from '../core/epicenter' ;
1011import type {
1112 AnyWorkspaceConfig ,
13+ WorkspaceClient ,
1214 WorkspacesToClients ,
1315} from '../core/workspace' ;
1416import { createSyncPlugin } from './sync' ;
@@ -105,8 +107,11 @@ export async function createServer<
105107 createSyncPlugin ( {
106108 getDoc : ( room ) => {
107109 // Room name is the workspace ID
108- const workspace =
109- client [ room as keyof WorkspacesToClients < TWorkspaces > ] ;
110+ // Type assertion needed because TypeScript can't prove the generic
111+ // WorkspacesToClients mapping resolves to WorkspaceClient
112+ const workspace = client [
113+ room as keyof WorkspacesToClients < TWorkspaces >
114+ ] as WorkspaceClient < WorkspaceExports > | undefined ;
110115 return workspace ?. $ydoc ;
111116 } ,
112117 } ) ,
You can’t perform that action at this time.
0 commit comments