From 86fa13e2d809a2fbc1ad1ce63fdcd1102684b64f Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Tue, 24 Nov 2026 01:39:49 +0800 Subject: [PATCH] docs(client): clarify when startup waits for Realm providers --- .../architecture/2026-11-05-client-module-metadata.i18n.yaml | 4 ++-- .../architecture/2026-11-05-client-module-metadata.md | 2 +- .../architecture/2026-11-05-client-module-metadata.zh.md | 2 +- docs/subsystems/web-client.i18n.yaml | 4 ++-- docs/subsystems/web-client.md | 2 +- docs/subsystems/web-client.zh.md | 2 +- packages/bundle/web-app/README.i18n.yaml | 4 ++-- packages/bundle/web-app/README.md | 2 +- packages/bundle/web-app/README.zh.md | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.i18n.yaml b/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.i18n.yaml index e399e1071c..dae69e3b7b 100644 --- a/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.i18n.yaml +++ b/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.i18n.yaml @@ -12,8 +12,8 @@ en: 93d58b7585af3f6c zh: a91c4717778dd5eb /agent-note-client-metadata-and-renderer-owned-stylesheet-installation/alternatives-considered: - en: 7e410e5f19c4ded2 - zh: f09d8d8ae2e7ac93 + en: 70adfc415b3a5328 + zh: 16599d6feb06cae8 /agent-note-client-metadata-and-renderer-owned-stylesheet-installation/consequences: en: 2db1d05ddc19891c zh: b5affd079824a7cd diff --git a/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.md b/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.md index e47f309034..e280866b88 100644 --- a/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.md +++ b/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.md @@ -26,7 +26,7 @@ This decision refines the resource handling in the [loading model](2026-07-23-cl **Reuse the dynamic plugin's private-dependency bundling for static libraries.** It moves third-party lazy chunking and font delivery into package builds, changing the established shell dependency policy. Static libraries retain that policy instead. -**Document Scope and an early Realm activation phase.** Neither is required when all modules use the existing Main carrier and all styles target the main document. Isolation requests, environment allocation, and multiple presentation destinations remain separate work. +**Document Scope and an unconditional Realm activation phase.** Neither is required for stylesheet metadata: even when a package runs in an iframe Realm, the renderer installs its styles in the main document. ## Consequences diff --git a/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.zh.md b/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.zh.md index b1a840a929..688207c5ab 100644 --- a/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.zh.md +++ b/.agents/notes/implemented/architecture/2026-11-05-client-module-metadata.zh.md @@ -26,7 +26,7 @@ Modules 拥有 JavaScript 导出、模块身份、owner id 和观察到的依赖 **静态库复用动态插件的私有依赖打包。** 这会把第三方惰性拆包和字体交付移到包构建,改变既有外壳依赖策略。静态库因此保留原策略。 -**Document Scope 与提前 Realm 激活阶段。** 所有模块使用原 Main 载体、所有样式装到主文档时,不需要这两者。隔离请求、环境分配和多个呈现目的地属于独立工作。 +**Document Scope 与无条件提前激活 Realm。** 样式表元信息不需要这两者:即使包在 iframe Realm 中运行,renderer 也会把它的样式安装到主文档。 ## Consequences diff --git a/docs/subsystems/web-client.i18n.yaml b/docs/subsystems/web-client.i18n.yaml index d0644125c1..f8b35cfeba 100644 --- a/docs/subsystems/web-client.i18n.yaml +++ b/docs/subsystems/web-client.i18n.yaml @@ -9,8 +9,8 @@ en: c0454bca818f86ee zh: 427582150fd3b976 /web-client-architecture/browser-boot: - en: ad100df8a00bd7bd - zh: b160c24ca1d835ab + en: bf3c6c60bedb96c3 + zh: e9090e34f4b7ce29 /web-client-architecture/remote-communication: en: 426b09164210b77a zh: ce576099ee668984 diff --git a/docs/subsystems/web-client.md b/docs/subsystems/web-client.md index ce3c5acc7f..0a0e8f8a92 100644 --- a/docs/subsystems/web-client.md +++ b/docs/subsystems/web-client.md @@ -25,7 +25,7 @@ The Host writes the composed `WebBootGraph` to `window.__DSH_BOOT__` and install The Web boot kernel creates the module system, prefetches `immediately` entries, mounts the vendored Cordis Loader, and creates every graph entry. Cordis service injection determines activation; module graph order determines only whether synchronous imports can be materialized. After the complete roster reaches a settled state and the boot audit accepts it (an inactive entry on the browser required list rejects startup; other inactive entries produce one console warning), `ui-renderer` hydrates the framework-free boot DOM and calls the sole context-level `renderSlot('root')` operation. [Client Modules](client-modules.md) owns the graph, bundle route, cache revision, and loader details. -Module construction binds the startup carrier's existing script loader as its Main environment; optional Realm providers do not add a startup phase. Modules retains optional metadata producers and emits module-record changes; [UI Renderer](../../packages/client/ui-renderer/README.md) evaluates stylesheet descriptors and owns their main-document installation. This resource lifecycle is module-level, not a Slot or component mount protocol. +Modules uses the startup carrier's script loader for the Main Realm. Only a graph that requests [script isolation](../../packages/client/modules/README.md#script-isolated-packages) activates the Realm providers before loading the other entries. Modules retains optional metadata producers and emits module-record changes; [UI Renderer](../../packages/client/ui-renderer/README.md) evaluates stylesheet descriptors and owns their main-document installation. This resource lifecycle is module-level, not a Slot or component mount protocol. ## Remote communication diff --git a/docs/subsystems/web-client.zh.md b/docs/subsystems/web-client.zh.md index 6d5749adc2..f5d577eb6d 100644 --- a/docs/subsystems/web-client.zh.md +++ b/docs/subsystems/web-client.zh.md @@ -25,7 +25,7 @@ Host 把组合后的 `WebBootGraph` 写入 `window.__DSH_BOOT__`,并在 parser Web boot kernel 创建模块系统、预取 `immediately` entry、挂载 vendored Cordis Loader,再创建图中的每个 entry。Cordis service injection 决定激活顺序;module graph 顺序只决定同步 import 能否被 materialize。完整 roster 到达 settled 状态且启动审计通过后(浏览器必需名单中的 entry 未激活会拒绝启动;其他未激活 entry 输出一条控制台警告),`ui-renderer` hydrate 不依赖框架的 boot DOM,并调用唯一一次 context 级 `renderSlot('root')`。[Client Modules](client-modules.zh.md)负责 graph、bundle route、cache revision 与 loader 细节。 -模块构造时将启动载体原有的脚本加载器绑定为自身 Main 环境;可选 Realm 提供方不会增加启动阶段。Modules 保存可选的元信息生产函数并发布模块记录变化;[UI Renderer](../../packages/client/ui-renderer/README.zh.md) 求值样式描述并持有其主文档安装。资源生命周期是模块级,而不是 Slot 或组件挂载协议。 +Modules 使用启动载体的脚本加载器执行 Main Realm 的脚本。只有图中请求了[脚本隔离](../../packages/client/modules/README.zh.md#script-isolated-packages)时,才会先激活 Realm 提供方,再加载其余条目。Modules 保存可选的元信息生产函数并发布模块记录变化;[UI Renderer](../../packages/client/ui-renderer/README.zh.md) 求值样式描述并持有其主文档安装。资源生命周期是模块级,而不是 Slot 或组件挂载协议。 ## Remote 通信 diff --git a/packages/bundle/web-app/README.i18n.yaml b/packages/bundle/web-app/README.i18n.yaml index 7bb565efd7..6a6e2383fe 100644 --- a/packages/bundle/web-app/README.i18n.yaml +++ b/packages/bundle/web-app/README.i18n.yaml @@ -33,8 +33,8 @@ en: 99557925a59aee67 zh: e2160750bd65505a /deepseek-ai-dsh-web-app/understand-the-implementation: - en: 08ff85438e93d1df - zh: 10cec758ff71e20f + en: 305b481f4b8e4588 + zh: b437f7f39f64210d /deepseek-ai-dsh-web-app/understand-the-implementation/patch-semantics: en: a6d126f30b1594d7 zh: 7f0ccc8a55d6f743 diff --git a/packages/bundle/web-app/README.md b/packages/bundle/web-app/README.md index 505890e5a7..9798efe849 100644 --- a/packages/bundle/web-app/README.md +++ b/packages/bundle/web-app/README.md @@ -110,7 +110,7 @@ The packaged skill uses the custom skill root: a same-named project skill overri
Implementation internals — click to expand -The bundle is one patch layer of five files plus one runtime glue plugin: `cordis.patch.yml` carries the host rows and the preset registry, and each `presets/.patch.yml` inserts one shipped preset declaration, applied in the order `dsh.bundle.patch` lists them. The storage stack and projection cache come from `dsh-base`; the web overlay's workspace and message-feedback rows consume that shared `storageDomain` service. The patch restates the surface-specific values the base deliberately omits, inserts the web-only host rows and browser roster, then moves the agent plane behind presets. The glue plugin owns dist serving, the advertised application URL, the plain-HTTP exposure warning, and the bash variable. WebApp owns startup URL publication and browser handoff; the [Token authentication plugin](../../host/authentication-token/README.md) contributes its signed entry URL. The `office-kit` row mounts one lazy [Office conversion provider](../../document/office-kit/README.md) for Host consumers, including Desktop compositions using this bundle, and keeps converted files under `$DSH_HOME/office-kit/outputs`. The `standard` and `ptc` presets mount the [Office tools](../../document/tool-document/README.md) in every profile, whether or not Kit is installed, and declare them after an Office skill loads; the `minimal` preset omits them. The conversion service's Remote methods authorize preview reads, while Document Preview owns the Office viewer and Client cache. The browser roster includes the [Script Realm registry](../../client/script-realm/README.md) and its [iframe provider](../../client/script-realm-iframe/README.md) as ordinary rows; startup does not wait for them, and they create no frame unless a package requests script isolation. +The bundle is one patch layer of five files plus one runtime glue plugin: `cordis.patch.yml` carries the host rows and the preset registry, and each `presets/.patch.yml` inserts one shipped preset declaration, applied in the order `dsh.bundle.patch` lists them. The storage stack and projection cache come from `dsh-base`; the web overlay's workspace and message-feedback rows consume that shared `storageDomain` service. The patch restates the surface-specific values the base deliberately omits, inserts the web-only host rows and browser roster, then moves the agent plane behind presets. The glue plugin owns dist serving, the advertised application URL, the plain-HTTP exposure warning, and the bash variable. WebApp owns startup URL publication and browser handoff; the [Token authentication plugin](../../host/authentication-token/README.md) contributes its signed entry URL. The `office-kit` row mounts one lazy [Office conversion provider](../../document/office-kit/README.md) for Host consumers, including Desktop compositions using this bundle, and keeps converted files under `$DSH_HOME/office-kit/outputs`. The `standard` and `ptc` presets mount the [Office tools](../../document/tool-document/README.md) in every profile, whether or not Kit is installed, and declare them after an Office skill loads; the `minimal` preset omits them. The conversion service's Remote methods authorize preview reads, while Document Preview owns the Office viewer and Client cache. The browser roster includes the [Script Realm registry](../../client/script-realm/README.md) and its [iframe provider](../../client/script-realm-iframe/README.md) as ordinary rows. Only a package that requests script isolation needs them to start first and allocate a frame. The `skill-office` row mounts the [Office skills](../../skill/skill-office/README.md) from their packaged assets in every profile. Desktop with a nonempty `DSH_PRIMARY_RUNTIME` also mounts the bundled dependency-query row and selects `pythonEnvironment: 'workspace-dependencies'`; other profiles, and Desktop without a primary runtime, select `pythonEnvironment: 'user'` and leave the dependency-query row disabled. The [Desktop application](../../../apps/desktop/README.md#bundled-workspace-dependencies) owns resource packaging. diff --git a/packages/bundle/web-app/README.zh.md b/packages/bundle/web-app/README.zh.md index 240b0055cd..c0b2699d83 100644 --- a/packages/bundle/web-app/README.zh.md +++ b/packages/bundle/web-app/README.zh.md @@ -110,7 +110,7 @@ dsh --profile web --no-open --host "$(hostname -i | awk '{print $1}')" --public-
实现细节——点击展开 -此 bundle 由一层五个文件的补丁和一个运行时胶水插件组成:`cordis.patch.yml` 承载宿主行和 preset 注册表,每个 `presets/.patch.yml` 插入一条随发行版交付的 preset 声明,按 `dsh.bundle.patch` 列出的顺序应用。存储栈与投影缓存来自 `dsh-base`;Web 叠加层的工作区和消息反馈条目消费共享的 `storageDomain` 服务。补丁重述 base 有意省略的界面专用值,插入 Web 专用宿主条目和浏览器插件列表,再将 Agent 层移到预设后面。胶水插件负责 dist 服务、公告应用 URL、明文 HTTP 暴露警告和 bash 变量。WebApp 负责启动 URL 发布与浏览器交接;[Token 认证插件](../../host/authentication-token/README.zh.md)贡献带签名的入口 URL。`office-kit` 条目为宿主消费者挂载一个延迟创建引擎的 [Office 转换提供方](../../document/office-kit/README.zh.md),使用此 bundle 的 Desktop 组合也共享该提供方,转换后的文件保存在 `$DSH_HOME/office-kit/outputs`。`standard` 和 `ptc` 预设在所有 profile 中挂载 [Office 工具](../../document/tool-document/README.zh.md),无论是否安装 Kit,并在加载 Office 技能后声明它们;`minimal` 预设不挂载它们。转换服务的 Remote 方法负责预览读取授权,Document Preview 负责 Office 查看器和客户端缓存。浏览器插件列表把 [Script Realm 注册表](../../client/script-realm/README.zh.md)及其 [iframe 提供方](../../client/script-realm-iframe/README.zh.md)作为普通条目包含在内;启动不等待它们,没有包请求脚本隔离时它们不创建 frame。 +此 bundle 由一层五个文件的补丁和一个运行时胶水插件组成:`cordis.patch.yml` 承载宿主行和 preset 注册表,每个 `presets/.patch.yml` 插入一条随发行版交付的 preset 声明,按 `dsh.bundle.patch` 列出的顺序应用。存储栈与投影缓存来自 `dsh-base`;Web 叠加层的工作区和消息反馈条目消费共享的 `storageDomain` 服务。补丁重述 base 有意省略的界面专用值,插入 Web 专用宿主条目和浏览器插件列表,再将 Agent 层移到预设后面。胶水插件负责 dist 服务、公告应用 URL、明文 HTTP 暴露警告和 bash 变量。WebApp 负责启动 URL 发布与浏览器交接;[Token 认证插件](../../host/authentication-token/README.zh.md)贡献带签名的入口 URL。`office-kit` 条目为宿主消费者挂载一个延迟创建引擎的 [Office 转换提供方](../../document/office-kit/README.zh.md),使用此 bundle 的 Desktop 组合也共享该提供方,转换后的文件保存在 `$DSH_HOME/office-kit/outputs`。`standard` 和 `ptc` 预设在所有 profile 中挂载 [Office 工具](../../document/tool-document/README.zh.md),无论是否安装 Kit,并在加载 Office 技能后声明它们;`minimal` 预设不挂载它们。转换服务的 Remote 方法负责预览读取授权,Document Preview 负责 Office 查看器和客户端缓存。浏览器插件列表把 [Script Realm 注册表](../../client/script-realm/README.zh.md)及其 [iframe 提供方](../../client/script-realm-iframe/README.zh.md)作为普通条目包含在内。只有请求脚本隔离的包才需要它们先启动并分配 iframe。 `skill-office` 行在所有 profile 中从包内 assets 挂载 [Office 技能](../../skill/skill-office/README.zh.md)。`DSH_PRIMARY_RUNTIME` 非空的 Desktop 还挂载内置依赖查询行,并选择 `pythonEnvironment: 'workspace-dependencies'`;其他 profile 以及没有主运行时的 Desktop 选择 `pythonEnvironment: 'user'`,并禁用依赖查询行。资源打包由 [Desktop 应用](../../../apps/desktop/README.zh.md#bundled-workspace-dependencies)负责。