import { createWorkbench, type AppWorkbench, type WorkbenchTheme, type WorkspaceFileSystem } from 'minwebide'; import { createMipSystem } from './numbl/mipSystem'; import { createNumblRunner } from './numbl/runner'; /** * Assembles the numbl workbench (mip system + runner) on a file system. Used * by the project-app shell for both project IDEs and GitHub repo IDEs; does * not own `fs` — the caller disposes it. */ export async function openNumblWorkbench(container: HTMLElement, fs: WorkspaceFileSystem, workspaceName: string, theme: WorkbenchTheme): Promise { const mip = await createMipSystem(); // fetch/refresh mip core in the background; runs await it (and say so // in the output channel if they actually have to wait) void mip.ensureCore().catch(() => { /* retried on the next run */ }); const workbench = createWorkbench(container, { fileSystem: fs, theme, workspaceName, }); const numbl = createNumblRunner(fs, workbench, mip); workbench.registerRunner(numbl.runner); return { workbench, dispose() { numbl.dispose(); workbench.dispose(); mip.dispose(); }, }; }