Merge pull request #8504 from deepseek-harness/feat/client-config-live-update

feat(client): sync volatile plugin config to the browser
This commit is contained in:
imccyu authored and GitHub committed 2026-11-17 16:08:14 +08:00
1 parent 4c74abdbad
commit bd1d6dcd0c
175 files changed
+3691 -779

No files matched your search

+2 -2
View File
@@ -6,5 +6,5 @@
en: 41d772192075e133
zh: 5ef3da69b4de1d8a
/capability-seams-and-core-services:
en: 15d626593d746219
zh: 332d2135597249b8
en: 4eb44ffc136cee25
zh: a34b8a156fc22955
+5
View File
@@ -312,6 +312,8 @@ flowchart LR
pkg_web_app["web-app"]
svc_webApp["ctx.webApp<br/>Served Web GUI"]
pkg_harness_dev_context["harness-dev-context"]
pkg_client_config["client-config"]
svc_config["ctx.config<br/>Browser synced configuration lookup"]
svc_clientModules["ctx.clientModules<br/>Client plugin graph host"]
pkg_workflow["workflow"]
svc_workflowEngine["ctx.workflowEngine<br/>Workflow script engine"]
@@ -352,10 +354,12 @@ flowchart LR
pkg_bash_local --> svc_shell
pkg_bash_sandbox --> svc_shell
pkg_browser_use --> svc_browserUse
pkg_client_config --> svc_config
pkg_client_connection --> svc_connection
pkg_client_connection --> svc_connection_authentication
pkg_client_file_upload --> svc_fileUploads
pkg_client_modules --> svc_clientModules
pkg_client_modules --> svc_config
pkg_client_product_analytics --> svc_productAnalytics
pkg_client_ui_connector_account --> svc_connectorAccounts
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
@@ -784,6 +788,7 @@ flowchart LR
| `ctx.directoryPicker` | `seam` | [`host-directory-picker`](../packages/host/directory-picker) | [`host-directory-picker-native`](../packages/host/directory-picker-native), [`host-directory-picker-browse`](../packages/host/directory-picker-browse) | [`api-workspace-controller`](../packages/api/workspace-controller) | - | Discriminated interaction capability: the native backend opens one OS chooser on the host display, the browse backend serves listing/creation primitives for the in-app browser; dual-face backends fill ui-workspace directory-flow slots from their browser halves (no wire advertisement). |
| `ctx.webServer` | `core` | [`host-webserver`](../packages/host/webserver) | - | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`client-hmr`](../packages/client/hmr) | - | Plain node:http carrier: named-route registry, index transform taps, and the static dist fallback; web-transport plugins register their own routes. |
| `ctx.webApp` | `core` | [`web-app`](../packages/bundle/web-app) | - | [`harness-dev-context`](../packages/context/harness-dev-context) | - | The web-runtime row advertises one URL for its Web GUI: the configured publicUrl, otherwise the listener origin; DSH_WEB_URL, the startup URL, and harness-dev-context read the same value. |
| `ctx.config` | `service` | [`client-config`](../packages/client/config) | [`client-modules`](../packages/client/modules) | - | - | Types-only declaration; the client-modules plugin face provides the read-only lookup of each package's current synced Config. |
| `ctx.clientModules` | `core` | [`client-modules`](../packages/client/modules) | - | [`client-hmr`](../packages/client/hmr) | - | Composes the __DSH_BOOT__ entry graph from an incremental dsh.client scan, serves plugin bundles, and notifies rebuilt/graph-changed subscribers. |
| `ctx.workflowEngine` | `seam` | [`workflow`](../packages/workflow/workflow) | [`workflow-ptc`](../packages/workflow/workflow-ptc) | [`tool-workflow`](../packages/workflow/tool-workflow), [`tool-ralph`](../packages/experimental/tool-ralph) | - | One engine per context, as in bash, with no named-provider registry; the general workflow and fixed Ralph consumers start runs whose agent() calls fan out through ctx.subagents. |
| `ctx.webhookRuntime` | `core` | [`webhook`](../packages/experimental/webhook) | - | [`webhook-github`](../packages/experimental/webhook-github) | - | Provider adapters dispatch authenticated deliveries; trusted plugins register independent process-local rules, and the runtime turns non-null results into ordinary Workspace-backed Sessions without delivery or completion state. |
+5
View File
@@ -314,6 +314,8 @@ flowchart LR
pkg_web_app["web-app"]
svc_webApp["ctx.webApp<br/>Served Web GUI"]
pkg_harness_dev_context["harness-dev-context"]
pkg_client_config["client-config"]
svc_config["ctx.config<br/>Browser synced configuration lookup"]
svc_clientModules["ctx.clientModules<br/>Client plugin graph host"]
pkg_workflow["workflow"]
svc_workflowEngine["ctx.workflowEngine<br/>Workflow script engine"]
@@ -354,10 +356,12 @@ flowchart LR
pkg_bash_local --> svc_shell
pkg_bash_sandbox --> svc_shell
pkg_browser_use --> svc_browserUse
pkg_client_config --> svc_config
pkg_client_connection --> svc_connection
pkg_client_connection --> svc_connection_authentication
pkg_client_file_upload --> svc_fileUploads
pkg_client_modules --> svc_clientModules
pkg_client_modules --> svc_config
pkg_client_product_analytics --> svc_productAnalytics
pkg_client_ui_connector_account --> svc_connectorAccounts
pkg_client_ui_plugin_manager --> svc_pluginRegistryProbe
@@ -786,6 +790,7 @@ flowchart LR
| `ctx.directoryPicker` | `seam` | [`host-directory-picker`](../packages/host/directory-picker) | [`host-directory-picker-native`](../packages/host/directory-picker-native), [`host-directory-picker-browse`](../packages/host/directory-picker-browse) | [`api-workspace-controller`](../packages/api/workspace-controller) | - | 带判别标记的交互能力:原生后端在 Host 显示设备上打开一个操作系统选择器,浏览后端为应用内浏览器提供列表与创建原语;双端后端通过其浏览器侧填充 ui-workspace 目录流程的 slot(不通过协议发布)。 |
| `ctx.webServer` | `core` | [`host-webserver`](../packages/host/webserver) | - | [`client-connection`](../packages/client/connection), [`client-modules`](../packages/client/modules), [`client-hmr`](../packages/client/hmr) | - | 普通的 node:http 载体:具名路由注册表、索引转换 tap,以及静态 dist 回退;Web 传输插件注册自己的路由。 |
| `ctx.webApp` | `core` | [`web-app`](../packages/bundle/web-app) | - | [`harness-dev-context`](../packages/context/harness-dev-context) | - | web-runtime 行为其 Web GUI 公告一个 URL:配置了 publicUrl 时用它,否则用监听器 origin;DSH_WEB_URL、启动 URL 与 harness-dev-context 读取同一个值。 |
| `ctx.config` | `service` | [`client-config`](../packages/client/config) | [`client-modules`](../packages/client/modules) | - | - | 只有类型的声明;client-modules 插件面提供对各包当前同步 Config 的只读查询。 |
| `ctx.clientModules` | `core` | [`client-modules`](../packages/client/modules) | - | [`client-hmr`](../packages/client/hmr) | - | 通过增量 `dsh.client` 扫描组合 __DSH_BOOT__ 入口图,提供插件组合包,并通知重建/图变更订阅方。 |
| `ctx.workflowEngine` | `seam` | [`workflow`](../packages/workflow/workflow) | [`workflow-ptc`](../packages/workflow/workflow-ptc) | [`tool-workflow`](../packages/workflow/tool-workflow), [`tool-ralph`](../packages/experimental/tool-ralph) | - | 每个上下文使用一个引擎,与 bash 相同,且没有具名提供方注册表;通用工作流与固定 Ralph 消费方启动运行,其中的 agent() 调用通过 ctx.subagents 扇出。 |
| `ctx.webhookRuntime` | `core` | [`webhook`](../packages/experimental/webhook) | - | [`webhook-github`](../packages/experimental/webhook-github) | - | 提供方适配器分派已认证交付;可信插件注册独立的进程本地规则,runtime 把非 null 结果转换为普通的 Workspace-backed Session,不保留交付或完成状态。 |
+9 -3
View File
@@ -222,7 +222,7 @@ export interface Config {
## `@deepseek-ai/dsh-api-gateway`
- `inject`: `typert` · `remoteAccess`
- `source`: [`packages/api/gateway/src/index.ts:157`](../packages/api/gateway/src/index.ts)
- `source`: [`packages/api/gateway/src/index.ts:158`](../packages/api/gateway/src/index.ts)
```ts config-catalog
/** Gateway transport configuration. */
@@ -231,6 +231,11 @@ export interface Config {
readonly websocketHeartbeatIntervalMs?: number
/** Buffered uplink frame bytes one logical stream may hold before it fails with `gateway/uplink-overflow`. @default 262144 */
readonly streamInboxBytes?: number
/**
* Encoded downlink bytes one WebSocket connection may have queued and unwritten before every logical stream on it
* pauses reading its source. Items leave in the order their streams produced them. @default 1048576
*/
readonly streamOutboxBytes?: number
/** Per-message compression for the Remote stream WebSocket; `'none'` disables the extension. @default 'deflate' */
readonly websocketCompression?: 'none' | 'deflate'
}
@@ -539,8 +544,8 @@ export interface ConnectionRecoveryConfig {
## `@deepseek-ai/dsh-client-hmr`
- `inject`: `clientModules` · `webServer`
- `source`: [`packages/client/hmr/src/index.ts:30`](../packages/client/hmr/src/index.ts)
- `inject`: `clientModules`
- `source`: [`packages/client/hmr/src/index.ts:26`](../packages/client/hmr/src/index.ts)
```ts config-catalog
/** Plugin config, validated by the same-named schemastery schema. */
@@ -5245,6 +5250,7 @@ These load from a `cordis.yml` entry with no `config:` block; they declare no co
| `@deepseek-ai/dsh-api-remotes` | `typertGateway` | [`packages/api/remotes/src/index.ts`](../packages/api/remotes/src/index.ts) |
| `@deepseek-ai/dsh-authorization` | `credentials` | [`packages/credentials/authorization/src/index.ts`](../packages/credentials/authorization/src/index.ts) |
| `@deepseek-ai/dsh-browser-use` | — | [`packages/browser-use/browser-use/src/index.ts`](../packages/browser-use/browser-use/src/index.ts) |
| `@deepseek-ai/dsh-client-config` | — | [`packages/client/config/src/index.ts`](../packages/client/config/src/index.ts) |
| `@deepseek-ai/dsh-client-file-upload` | `agents` · `attachments` · `commands` · `connection` | [`packages/client/file-upload/src/index.ts`](../packages/client/file-upload/src/index.ts) |
| `@deepseek-ai/dsh-client-locale` | — | [`packages/client/locale/src/index.ts`](../packages/client/locale/src/index.ts) |
| `@deepseek-ai/dsh-client-modules` | `loader` | [`packages/client/modules/src/index.ts`](../packages/client/modules/src/index.ts) |
+9 -3
View File
@@ -224,7 +224,7 @@ export interface Config {
## `@deepseek-ai/dsh-api-gateway`
- `inject`: `typert` · `remoteAccess`
- `source`: [`packages/api/gateway/src/index.ts:157`](../packages/api/gateway/src/index.ts)
- `source`: [`packages/api/gateway/src/index.ts:158`](../packages/api/gateway/src/index.ts)
```ts config-catalog
/** Gateway transport configuration. */
@@ -233,6 +233,11 @@ export interface Config {
readonly websocketHeartbeatIntervalMs?: number
/** Buffered uplink frame bytes one logical stream may hold before it fails with `gateway/uplink-overflow`. @default 262144 */
readonly streamInboxBytes?: number
/**
* Encoded downlink bytes one WebSocket connection may have queued and unwritten before every logical stream on it
* pauses reading its source. Items leave in the order their streams produced them. @default 1048576
*/
readonly streamOutboxBytes?: number
/** Per-message compression for the Remote stream WebSocket; `'none'` disables the extension. @default 'deflate' */
readonly websocketCompression?: 'none' | 'deflate'
}
@@ -541,8 +546,8 @@ export interface ConnectionRecoveryConfig {
## `@deepseek-ai/dsh-client-hmr`
- `inject`: `clientModules` · `webServer`
- `source`: [`packages/client/hmr/src/index.ts:30`](../packages/client/hmr/src/index.ts)
- `inject`: `clientModules`
- `source`: [`packages/client/hmr/src/index.ts:26`](../packages/client/hmr/src/index.ts)
```ts config-catalog
/** Plugin config, validated by the same-named schemastery schema. */
@@ -5247,6 +5252,7 @@ export interface Config {
| `@deepseek-ai/dsh-api-remotes` | `typertGateway` | [`packages/api/remotes/src/index.ts`](../packages/api/remotes/src/index.ts) |
| `@deepseek-ai/dsh-authorization` | `credentials` | [`packages/credentials/authorization/src/index.ts`](../packages/credentials/authorization/src/index.ts) |
| `@deepseek-ai/dsh-browser-use` | — | [`packages/browser-use/browser-use/src/index.ts`](../packages/browser-use/browser-use/src/index.ts) |
| `@deepseek-ai/dsh-client-config` | — | [`packages/client/config/src/index.ts`](../packages/client/config/src/index.ts) |
| `@deepseek-ai/dsh-client-file-upload` | `agents` · `attachments` · `commands` · `connection` | [`packages/client/file-upload/src/index.ts`](../packages/client/file-upload/src/index.ts) |
| `@deepseek-ai/dsh-client-locale` | — | [`packages/client/locale/src/index.ts`](../packages/client/locale/src/index.ts) |
| `@deepseek-ai/dsh-client-modules` | `loader` | [`packages/client/modules/src/index.ts`](../packages/client/modules/src/index.ts) |
+3 -3
View File
@@ -119,12 +119,12 @@ Application listeners are outside this package matrix. Desktop Host subscribes t
| --- | --- | --- |
| `agent/request` | [`agent-loop`](../packages/core/agent-loop) (`waterfall`) | [`compaction-basic`](../packages/compaction/compaction-basic), [`timeline`](../packages/experimental/timeline) |
| `connection/reset` | `gateway` (`emit`) | `terminal-controller`, `ui-settings` |
| `internal/config` | - | [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager) |
| `internal/config` | - | [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules` |
| `internal/dispatch` | - | [`terminal-bash`](../packages/terminal/terminal-bash) |
| `internal/plugin` | - | `computer-use-cua-driver-native`, `inspector`, `loader`, [`lsp-stdio`](../packages/lsp/lsp-stdio), [`mcp-client`](../packages/mcp/mcp-client), [`mcp-manager`](../packages/mcp/mcp-manager), `modules` |
| `internal/service` | - | `client-ui-forge`, `gateway` |
| `internal/status` | - | [`agent`](../packages/core/agent), `claude-code-mods`, `inspector`, `translator`, [`web`](../packages/web/web) |
| `loader/volatile-update` | - | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) |
| `internal/status` | - | [`agent`](../packages/core/agent), `claude-code-mods`, `inspector`, `modules`, `translator`, [`web`](../packages/web/web) |
| `loader/volatile-update` | - | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules`, [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) |
| `locale/change` | `locale` (`emit`) | `locale` |
| `slots/changed` | `ui-renderer` (`emit`) | - |
| `theme/change` | `ui-theme` (`emit`) | `ui-layout`, `ui-theme` |
+3 -3
View File
@@ -121,12 +121,12 @@
| --- | --- | --- |
| `agent/request` | [`agent-loop`](../packages/core/agent-loop) (`waterfall`) | [`compaction-basic`](../packages/compaction/compaction-basic), [`timeline`](../packages/experimental/timeline) |
| `connection/reset` | `gateway` (`emit`) | `terminal-controller`, `ui-settings` |
| `internal/config` | - | [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager) |
| `internal/config` | - | [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules` |
| `internal/dispatch` | - | [`terminal-bash`](../packages/terminal/terminal-bash) |
| `internal/plugin` | - | `computer-use-cua-driver-native`, `inspector`, `loader`, [`lsp-stdio`](../packages/lsp/lsp-stdio), [`mcp-client`](../packages/mcp/mcp-client), [`mcp-manager`](../packages/mcp/mcp-manager), `modules` |
| `internal/service` | - | `client-ui-forge`, `gateway` |
| `internal/status` | - | [`agent`](../packages/core/agent), `claude-code-mods`, `inspector`, `translator`, [`web`](../packages/web/web) |
| `loader/volatile-update` | - | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) |
| `internal/status` | - | [`agent`](../packages/core/agent), `claude-code-mods`, `inspector`, `modules`, `translator`, [`web`](../packages/web/web) |
| `loader/volatile-update` | - | [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules`, [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) |
| `locale/change` | `locale` (`emit`) | `locale` |
| `slots/changed` | `ui-renderer` (`emit`) | - |
| `theme/change` | `ui-theme` (`emit`) | `ui-layout`, `ui-theme` |
+2
View File
@@ -155,6 +155,7 @@ flowchart TD
pkg_web_app["web-app"]
end
subgraph group_client["packages/client"]
pkg_client_config["client-config"]
pkg_client_connection["client-connection"]
pkg_client_file_upload["client-file-upload"]
pkg_client_hmr["client-hmr"]
@@ -1627,6 +1628,7 @@ flowchart TD
| [`base`](../packages/bundle/base) | `bundle` | — |
| [`sdk-app`](../packages/bundle/sdk-app) | `bundle` | — |
| [`sdk-minimal`](../packages/bundle/sdk-minimal) | `bundle` | — |
| [`client-config`](../packages/client/config) | `client` | — |
| [`client-file-upload`](../packages/client/file-upload) | `client` | — |
| [`client-hmr`](../packages/client/hmr) | `client` | — |
| [`client-locale`](../packages/client/locale) | `client` | — |
+2
View File
@@ -157,6 +157,7 @@ flowchart TD
pkg_web_app["web-app"]
end
subgraph group_client["packages/client"]
pkg_client_config["client-config"]
pkg_client_connection["client-connection"]
pkg_client_file_upload["client-file-upload"]
pkg_client_hmr["client-hmr"]
@@ -1629,6 +1630,7 @@ flowchart TD
| [`base`](../packages/bundle/base) | `bundle` | — |
| [`sdk-app`](../packages/bundle/sdk-app) | `bundle` | — |
| [`sdk-minimal`](../packages/bundle/sdk-minimal) | `bundle` | — |
| [`client-config`](../packages/client/config) | `client` | — |
| [`client-file-upload`](../packages/client/file-upload) | `client` | — |
| [`client-hmr`](../packages/client/hmr) | `client` | — |
| [`client-locale`](../packages/client/locale) | `client` | — |
+37 -4
View File
@@ -35,6 +35,8 @@ interface WebBootEntry {
immediately?: boolean
/** Non-baseline module specifiers this row requests; omitted when it requests none. */
external?: string[]
/** Browser-synced values of the plugin's top-level volatile Config fields, secrets removed; omitted when it has none. */
config?: SyncedConfigValues
}
```
@@ -139,11 +141,19 @@ The web plugin table service: incremental `dsh.client` scan + wire composition +
```ts cordis-catalog
/**
* Current composed entry graph (stable object between changes).
* @returns the graph served as `window.__DSH_BOOT__`.
* Current composed entry graph (stable object between changes), carrying the configured synced values.
* @returns the graph served as the owner's `window.__DSH_BOOT__`.
*/
graph(): WebBootGraph
/**
* The current graph as one Peer may see it: the owner receives the configured synced values, and every other Peer
* receives each row's schema defaults in their place.
* @param principal - the Peer's principal; undefined for the owner or an in-process caller.
* @returns the graph served to that Peer at first render and in plugin-events frames.
*/
graphFor(principal: Principal | undefined): WebBootGraph
/**
* Absolute path of an entry's client bundle.
* @param id - entry id (package name).
@@ -194,13 +204,36 @@ rebuilt(id: string): string | undefined
onRebuilt(listener: (id: string, rev: string) => void): () => void
/**
* Fires after any flush that recomposed the graph (row added/removed, or a
* rebuilt rev change). Pull model: listeners re-read {@link graph}.
* Fires after the graph's rows or rev change: a flush that recomposed the
* graph (row added/removed, or a rebuilt rev change), or a republication of
* synced configuration alone, which leaves the batch artifacts unchanged.
* Pull model: listeners re-read {@link graph}.
* @param listener - notified with no payload.
* @returns the unsubscriber.
*/
onGraphChanged(listener: () => void): () => void
```
Types: [Principal](typert.md)
Source: [`packages/client/modules/src/index.ts`](../../packages/client/modules/src/index.ts)
<a id="ctxconfig--syncedconfigservice"></a>
### `ctx.config` — `SyncedConfigService`
Read-only access to other packages' synced Config; a plugin receives its own through `apply`.
```ts cordis-catalog
/**
* The synced Config object of a package's current plugin activation, as that activation's `apply` received it. Each
* activation receives a new object, so the result changes when the plugin is replaced. The caller states the
* package's shared Config type.
* @param packageName - package name of the graph row.
* @returns the object, or undefined while no activation of the package is running.
*/
resolveConfigByPackage<C>(packageName: string): SyncedConfig<C> | undefined
```
Source: [`packages/client/config/src/types.ts`](../../packages/client/config/src/types.ts)
<!-- END GENERATED cordis-surface -->
+37 -4
View File
@@ -35,6 +35,8 @@ interface WebBootEntry {
immediately?: boolean
/** Non-baseline module specifiers this row requests; omitted when it requests none. */
external?: string[]
/** Browser-synced values of the plugin's top-level volatile Config fields, secrets removed; omitted when it has none. */
config?: SyncedConfigValues
}
```
@@ -139,11 +141,19 @@ The web plugin table service: incremental `dsh.client` scan + wire composition +
```ts cordis-catalog
/**
* Current composed entry graph (stable object between changes).
* @returns the graph served as `window.__DSH_BOOT__`.
* Current composed entry graph (stable object between changes), carrying the configured synced values.
* @returns the graph served as the owner's `window.__DSH_BOOT__`.
*/
graph(): WebBootGraph
/**
* The current graph as one Peer may see it: the owner receives the configured synced values, and every other Peer
* receives each row's schema defaults in their place.
* @param principal - the Peer's principal; undefined for the owner or an in-process caller.
* @returns the graph served to that Peer at first render and in plugin-events frames.
*/
graphFor(principal: Principal | undefined): WebBootGraph
/**
* Absolute path of an entry's client bundle.
* @param id - entry id (package name).
@@ -194,13 +204,36 @@ rebuilt(id: string): string | undefined
onRebuilt(listener: (id: string, rev: string) => void): () => void
/**
* Fires after any flush that recomposed the graph (row added/removed, or a
* rebuilt rev change). Pull model: listeners re-read {@link graph}.
* Fires after the graph's rows or rev change: a flush that recomposed the
* graph (row added/removed, or a rebuilt rev change), or a republication of
* synced configuration alone, which leaves the batch artifacts unchanged.
* Pull model: listeners re-read {@link graph}.
* @param listener - notified with no payload.
* @returns the unsubscriber.
*/
onGraphChanged(listener: () => void): () => void
```
Types: [Principal](typert.zh.md)
Source: [`packages/client/modules/src/index.ts`](../../packages/client/modules/src/index.ts)
<a id="ctxconfig--syncedconfigservice"></a>
### `ctx.config` — `SyncedConfigService`
Read-only access to other packages' synced Config; a plugin receives its own through `apply`.
```ts cordis-catalog
/**
* The synced Config object of a package's current plugin activation, as that activation's `apply` received it. Each
* activation receives a new object, so the result changes when the plugin is replaced. The caller states the
* package's shared Config type.
* @param packageName - package name of the graph row.
* @returns the object, or undefined while no activation of the package is running.
*/
resolveConfigByPackage<C>(packageName: string): SyncedConfig<C> | undefined
```
Source: [`packages/client/config/src/types.ts`](../../packages/client/config/src/types.ts)
<!-- END GENERATED cordis-surface -->
@@ -0,0 +1,16 @@
# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
# After editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.2-rc.3/client-hmr-plugin-events-stream/guide.md
/:
en: fc0f253f60ad41b4
zh: 4b7f02f9260c672a
/plugin-events-stream-and-synced-browser-configuration:
en: 2cd6093e448761ba
zh: 66910abc17effed8
/plugin-events-stream-and-synced-browser-configuration/change:
en: 691f405846b33bbe
zh: b413c6be43ff2ee1
/plugin-events-stream-and-synced-browser-configuration/migration:
en: a8c0674e9b91d83c
zh: 557341db53da1025
@@ -0,0 +1,25 @@
---
kind: upgrade-guide
description: "`@deepseek-ai/dsh-client-hmr` removes `GET /plugins/events` and `EVENTS_ENDPOINT` for the authenticated `pluginEvents/follow` Remote stream, and browser plugins receive synced configuration in `apply`."
---
# Plugin events stream and synced browser configuration
English | [中文](guide.zh.md)
## Change
`@deepseek-ai/dsh-client-hmr` no longer registers the anonymous Server-Sent Events route `GET /plugins/events` and no longer exports `EVENTS_ENDPOINT`. Graph and rebuilt frames travel on the authenticated Typert Remote stream `pluginEvents/follow`: each stream generation opens with a `baseline` frame holding the full graph, followed by `graph` and `rebuilt` frames. Frame types come from `@deepseek-ai/dsh-client-hmr/types`. The browser face opens the stream over Connection and the API Gateway Client face while `remoteAccess` allows `pluginEvents/follow`; it no longer reads `window.__DSH_TRANSPORT__.fetch` or uses `EventSource`. A Peer whose Remote access does not allow `pluginEvents/follow`, such as a live-share viewer, no longer receives live graph or rebuilt updates.
Each graph row carries the plugin's [synced configuration](../../../../packages/client/modules/README.md#synced-plugin-configuration). A browser plugin whose Client face exports no `Config` schema receives a `SyncedConfig` object in `apply`, empty when its Host face declares no volatile fields, where it previously received `undefined`. A Client face that exports its own `Config` schema fails to activate when its graph row also carries synced values.
Affected: custom shells, scripts, and tests that read `/plugins/events` or import `EVENTS_ENDPOINT`; shells that supplied the plugin-events transport through `__DSH_TRANSPORT__.fetch`; deployments relying on viewer Peers following plugin changes; browser plugins that test their `apply` config for `undefined` or export a Client `Config` alongside volatile Host fields.
## Migration
1. Replace reads of `/plugins/events` and imports of `EVENTS_ENDPOINT` with a Remote client that mounts `@deepseek-ai/dsh-client-hmr/remote` and follows `pluginEvents.follow(signal)`; treat each `baseline` frame as a replacement of all earlier state, as [`src/client/index.ts`](../../../../packages/client/hmr/src/client/index.ts) does.
2. In a custom shell, provide the Remote carrier through Connection and the API Gateway Client face instead of a `__DSH_TRANSPORT__.fetch` handler for this endpoint.
3. Grant `pluginEvents/follow` in the Remote access policy of every Peer that must follow plugin changes; Peers without it reload the page to see them.
4. In browser plugins, stop treating an `undefined` `apply` config as "no configuration"; read fields through `SyncedConfig` from `@deepseek-ai/dsh-client-config/types`.
5. For a plugin with volatile Host fields, remove the Client face `Config` schema export and keep the only schema on the Host face, with the shared interface in `src/types.ts`.
6. Confirm: open the Web page, enable or disable a plugin, and check that the page updates without reload and that the browser sends no `/plugins/events` request.
@@ -0,0 +1,25 @@
---
kind: upgrade-guide
description: "`@deepseek-ai/dsh-client-hmr` 删除 `GET /plugins/events` 和 `EVENTS_ENDPOINT`,改用经过鉴权的 `pluginEvents/follow` Remote 流,浏览器插件在 `apply` 中接收同步配置。"
---
# 插件事件流与浏览器同步配置
[English](guide.md) | 中文
## 变更
`@deepseek-ai/dsh-client-hmr` 不再注册匿名 Server-Sent Events 路由 `GET /plugins/events`,也不再导出 `EVENTS_ENDPOINT`。图帧与重建帧改由经过鉴权的 Typert Remote 流 `pluginEvents/follow` 传递:每一代流先发一个包含完整图的 `baseline` 帧,之后发送 `graph` 与 `rebuilt` 帧。帧类型来自 `@deepseek-ai/dsh-client-hmr/types`。浏览器半侧在 `remoteAccess` 允许 `pluginEvents/follow` 时,经 Connection 与 API Gateway Client 半侧打开这条流;它不再读取 `window.__DSH_TRANSPORT__.fetch`,也不再使用 `EventSource`。Remote access 不允许 `pluginEvents/follow` 的 Peer(例如 live share 观看者)不再收到实时的图更新与重建更新。
图的每一行携带该插件的[同步配置](../../../../packages/client/modules/README.zh.md#synced-plugin-configuration)。Client 半侧未导出 `Config` schema 的浏览器插件在 `apply` 中接收一个 `SyncedConfig` 对象,Host 半侧未声明 volatile 字段时该对象为空,此前接收的是 `undefined`。Client 半侧导出自己 `Config` schema 的插件,若其图行同时携带同步值,则激活失败。
受影响者:读取 `/plugins/events` 或导入 `EVENTS_ENDPOINT` 的自定义 shell、脚本和测试;通过 `__DSH_TRANSPORT__.fetch` 提供插件事件传输的 shell;依赖观看者 Peer 跟随插件变更的部署;检查 `apply` 配置是否为 `undefined`,或在 Host volatile 字段之外还导出 Client `Config` 的浏览器插件。
## 迁移
1. 把对 `/plugins/events` 的读取和 `EVENTS_ENDPOINT` 的导入替换为挂载 `@deepseek-ai/dsh-client-hmr/remote` 并跟随 `pluginEvents.follow(signal)` 的 Remote 客户端;与 [`src/client/index.ts`](../../../../packages/client/hmr/src/client/index.ts) 一样,把每个 `baseline` 帧视为对之前全部状态的替换。
2. 在自定义 shell 中,经 Connection 与 API Gateway Client 半侧提供 Remote carrier,而不是为该端点提供 `__DSH_TRANSPORT__.fetch` 处理函数。
3. 在每个需要跟随插件变更的 Peer 的 Remote access 策略中授予 `pluginEvents/follow`;没有该权限的 Peer 需重新加载页面才能看到变更。
4. 在浏览器插件中,不再把 `undefined` 的 `apply` 配置当作“没有配置”;通过 `@deepseek-ai/dsh-client-config/types` 中的 `SyncedConfig` 读取字段。
5. 对带有 Host volatile 字段的插件,删除 Client 半侧的 `Config` schema 导出,只在 Host 半侧保留 schema,共享接口放在 `src/types.ts`。
6. 确认:打开 Web 页面,启用或禁用一个插件,检查页面无需重新加载即更新,且浏览器不再发出 `/plugins/events` 请求。