/** * Web shell boot — the kernel face consumed by the apps/web entry. Everything * here is machinery that cannot itself be an entry, and none of it * value-imports a plugin package (web2 shell self-sufficiency rule: the * loading page must work while — especially when — plugins fail). * * Two-stage boot (web2 §0): * Stage one (module face): build the module system over the host graph * (`window.__DSH_BOOT__`) and prefetch every `immediately` row in parallel * — fetch + execute registers factories only; module side effects wait for * materialization. Prefetch failures are non-fatal here: stage two's * import path retries the fetch and owns the loud failure. * Stage two (plugin face): mount the vendored cordis Loader, inject the * module system as its internal seam (BEFORE any entry exists — the * bare-import fallback in tree.import must never run in a browser), create * one loader entry per graph row (tree.import materializes each module), * let fibers activate on service availability, then loader.await() + a * full fiber sweep (all ACTIVE, else reject listing who/what/which * service) → flip the settled signal so AppRoot switches to the real UI in * one pass. * * Composition lives in the host graph; the shell makes zero composition * decisions (the app-shell assembly is itself a graph entry, the only * shell-own module registered with the module system). */ import { Context } from 'cordis' import Loader from '@cordisjs/plugin-loader' import { createRoot } from 'react-dom/client' import { createClientModuleLoader, type ClientModuleLoader, type ClientModuleLoaderOptions, type DshWindow, type WebBootGraph, } from '@deepseek-ai/dsh-client-modules' import * as AppShell from './app-shell.ts' import { APP_SHELL_ID } from './app-shell.ts' import { AppRoot } from './AppRoot.tsx' import { getStaticModules } from './seed.ts' import { STATE_LABELS, createLoaderStatusStore, createSignal, type LoaderStatusStore, } from './loader-status.ts' import './base.css' /** Module transport seams the shell passes through (jsdom tests replace the