refactor(gui): rebuild the client loading kernel as dsh-client-modules with a two-phase boot

The module system moves out of dsh-client-runtime (./loader retired) into
its own package: a lazy CJS table where executing a bundle only registers
its factory and materialization happens at first require, memoized, with
recursive requires self-ordering. ClientModuleSystem is a class; index.ts
keeps the types and a thin factory. Boot is two-phase: phase one prefetches
the immediately tier in parallel (registration only, failures deferred to
phase two's loud import); phase two mounts the vendored Loader with the
module system as internal, creates one entry per graph row plus the
app-shell pseudo-row the kernel appends itself, and settles on an
all-ACTIVE sweep. The shell kernel is self-sufficient: hand-rolled
loader-status stores, no plugin value imports, platform seed list single-
sourced in platform.ts.
This commit is contained in:
imccyu
2026-07-23 21:55:39 +08:00
parent 15fde82f80
commit b58f0989f9
30 changed files with 1064 additions and 1015 deletions

View File

@@ -102,9 +102,10 @@
"@deepseek-ai/dsh-client-ui-primitives": ["./packages/client/ui-primitives/src"],
"@deepseek-ai/dsh-client-web-react": ["./packages/client/web-react/src"],
"@deepseek-ai/dsh-client-connection": ["./packages/client/connection/src"],
"@deepseek-ai/dsh-client-hmr": ["./packages/client/hmr/src"],
"@deepseek-ai/dsh-client-modules": ["./packages/client/modules/src"],
"@deepseek-ai/dsh-client-runtime": ["./packages/client/runtime/src"],
"@deepseek-ai/dsh-client-runtime/client": ["./packages/client/runtime/src/client"],
"@deepseek-ai/dsh-client-runtime/loader": ["./packages/client/runtime/src/client/loader"],
"@deepseek-ai/dsh-client-ui-layout": ["./packages/client/ui-layout/src"],
"@deepseek-ai/dsh-client-ui-sidebar": ["./packages/client/ui-sidebar/src"],
"@deepseek-ai/dsh-client-ui-conversation": ["./packages/client/ui-conversation/src"],