Skip to content

feat(dsh): mount the bili panel at plugins.bundle.config on the plugin detail page - #2127

Merged
ranxianglei merged 1 commit into
masterfrom
2026-10-05_dsh-bundle-config-slot
Oct 5, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-10-05_dsh-bundle-config-slot

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Closes #2125

What

The dsh plugin page gives every bundle its own config area — plugins.bundle.config (keyed by package name, rendered between the description and the rows when ledger.bundles.has(pkg.name)). billion-context never occupied it, so the plugin page showed no bind status / Web UI entry while the settings bar carried a product-level entry.

This registers the existing origin-probe panel at that slot:

  • src/agent/dsh-native-client.ts: the single section component becomes a panel(titled) factory. settings.section keeps rendering byte-identically (titled = true, same flat DOM: h3 + button/degraded + hint). The new plugins.bundle.config registration uses { name, key: "billion-context", locale } (keyed shape verified against @deepseek-ai/dsh-client-ui-plugin-manager@0.2.0-rc.2 slot-contract and the official voice-input reference registration) and renders titled = false — the plugin page draws its own title.
  • package.json: adds dsh.client.inject: ["@deepseek-ai/dsh-client-ui-plugin-manager"] so the client scanner co-loads the slot host. Same declaration the reference implementation carries; previously undeclared even for settings.section ownership.
  • tests/dsh-settings-ui.test.ts: harness now captures both registrations. All prior assertions preserved (settings options incl. id/order/label, both render branches, polling upgrade/degrade/cancel); new assertions pin the keyed options shape (exactly key/locale/name — no list-slot fields), the missing h3, and the shared probe wiring through the bundle registration.

Deliberately not changed

  • src/agent/dsh-native.ts (host half) — untouched per issue scope; data already flows via __BILI__ / GET /bili/origin.
  • settings.section stays registered: under the bili dsh launcher posture (patch injection, package not installed as a profile bundle) there is no bundle page for this package, so the settings entry remains the only UI there. In bundle posture both entries exist; the plugin page is now the canonical one.
  • The launcher's client shim (writeDshClientShimFiles) does NOT gain inject: it is only consulted in launcher posture, where the panel can never render (no ledger bundle entry), and in mixed postures the profile-installed real package resolves first, carrying the new field.
  • Issue options a (iframe-embedded /__bili/) / b (own main+sidebar page) are future work, out of scope here.

Behavior notes

  • Additive: one new UI mount point on the dsh plugin detail page (bundle posture only, host-gated); zero wire/config-schema changes; no version bump.
  • New manifest field dsh.client.inject (dsh host-reads-it declaration, not bili user config): default is the fixed array above; no migration needed.

Verification

  • Slot contract claims reproduced from the published packages (slot-contract.d.ts, render site, configured gate, reference registration shape).
  • npm run typecheck clean; targeted tests/dsh-settings-ui.test.ts 7/7 green locally. Full suite/build/e2e via CI.

Update (rebased + old-client compat): rebased onto latest master (4e3ba1e). Dropped the planned dsh.client.inject for @deepseek-ai/dsh-client-ui-plugin-manager: on dsh ≥ 0.2.0-rc.x the slot host ships inside dsh-web-app, so the injection is redundant (verified: panel renders without it, clean console), while on older 0.1.x dsh the unknown inject target stalls the client-module scanner and freezes the whole web UI into an endless spinner. Without it, this bundle degrades gracefully on old clients — the legacy settings.section entry stays intact, the new detail-page panel simply doesn't appear.


Update (dropped my duplicate web-index fix): while this PR was in flight the same #2152 root cause landed upstream as #2180/#2182 (ef404a85 serve empty web index on pristine install, 0d30cec0 keep the #1937 stale snapshot when the data root vanishes later, 695f5c72 hermetic advisory-parity test). Their distinction is stricter than my blanket ENOENT-tolerant walk (pristine only when no override AND absent XDG data root; misconfigured explicit dirs stay loud), so my second commit was dropped and this PR is rebased onto current master. Remaining scope is exactly two files: src/agent/dsh-native-client.ts + tests/dsh-settings-ui.test.ts. Local verification on the rebased tree: web-sessions 16/16, advisory-endpoint-parity 1/1, dsh-settings-ui 8/8, typecheck clean.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-05_dsh-bundle-config-slot (2c907b7)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2252-pr.2127.8fa9d59

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2127.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 收到,正在 review #2127(分支基于最新 master,单一 commit,3 文件)。核对方向:原 issue #2125 → slot 契约声称(对照已发布包)→ 回归面(settings.section 字节一致、launcher shim、manifest 解析路径)→ 本地定向验证。结论稍后按七问给出。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

Review 结论:PR #2127(feat(dsh): mount the bili panel at plugins.bundle.config)

① 是什么问题:dsh 插件详情页为每个 bundle 预留了配置槽 plugins.bundle.config(按包名 keyed、渲染在描述与 rows 之间),billion-context 从未占用它——插件页上看不到绑定状态/Web UI 入口,而设置栏却有一个产品级入口。

② 什么原因导致:不是缺陷,是注册缺失——client 侧只注册了 settings.section,且 manifest 未声明 dsh.client.inject,slot host(plugin-manager)未被 co-load。

③ 怎么修复的:把单一 section 组件改成 panel(titled) 工厂;同一 origin-probe 面板注册进 keyed slot {name:"plugins.bundle.config", key:"billion-context", locale}(titled=false,插件页自绘标题);package.json 补 dsh.client.inject 声明 co-load slot host。完全复用既有 origin 轮询/按钮/degraded hint,零 wire/config-schema/版本号变更。

④ 是否有回归问题:无。逐项清点既有行为:

  • settings.section 渲染字节级不变(titled=true 路径与改前同构:h3 + button/degraded + hint 同一 flat DOM);
  • launcher posture:writeDshClientShimFiles 有意不加 inject——shim 仅在 launcher posture 被引用,那里 ledger 无 bundle 条目、面板永不渲染;混合 posture 下 profile 安装的真实包优先解析并携带新字段;
  • 仓内 manifest 消费方不受影响(src/dsh-channel.ts 只读 dsh.profile.bundles);
  • wire/message 形状、config schema、持久化格式未动;无语义漂移/吞错/阈值漂移——纯增量 UI 挂载,host 端 ledger.bundles.has(pkg.name) 门控;
  • CI:除 windows-latest(22) 仍在跑外全绿,含真实走通本挂载路径的 e2e lane「real dsh headless profile lane vs deterministic fake upstream」。

⑤ 是否破坏缓存:不涉及(未触碰任何缓存/重试/增量游标/去重逻辑)。

⑥ 是否改了设计方向:否。数据流不变(__BILI__ / GET /bili/origin),src/agent/dsh-native.ts(host half)按 issue scope 未动,a/b 方案明确留待后续。bundle posture 两个入口并存(插件页为 canonical),launcher posture 设置栏入口仍是唯一 UI。

⑦ 是否引入新配置:manifest 新增 dsh.client.inject: ["@deepseek-ai/dsh-client-ui-plugin-manager"]——这是 dsh host-reads-it 声明(co-load slot host),不是 bili 用户配置键;默认即上述固定数组,无需迁移。

验证证据(超出 CI 的部分):

  • 本地定向:npm run typecheck clean;tests/dsh-settings-ui.test.ts 7/7 绿(kernel/dist 构建后)。
  • 公开包逐条复核(@0.2.0-rc.2):pm slot-contract.d.ts:100 'plugins.bundle.config': { kind:'keyed', scope:'root', owner: PluginConfigViewProps };client.js bundles: keysOf(...) / configured: ledger.bundles.has(openPkg.name) / renderSlot(..., { entryKey: pkg.name });voice-input 参考注册形如 {name, key:<自身 bundle 包名>, locale},其 package.json 携带与本 PR 相同的 inject 数组。
  • slots 库语义已核实:register 对未声明 slot 会 throw、keyed 必须有 key;ctx.slots.inject 由声明生命周期驱动——plugin-manager 未加载时 provide 不触发、不会抛错(官方参考实现同款模式已在生产验证)。
  • 测试有效性:新断言有牙——精确钉住 keyed options 键集合(仅 key/locale/name,无 list-slot 字段)、h3 存在性差异、经 bundle 注册的共享 probe 接线、轮询升级路径在 bundle slot 上重跑。

判定:可合。 单一 commit、diff 收敛于 3 文件且每行都与本 issue 相关;未顺手发现需修的小问题。等最后一个 CI 作业(windows-latest 22)跑完即可合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

补充:最后一个 CI 作业(windows-latest 22)已跑完,全部 check-runs 绿。结论不变——可合,可以合并了。

@ranxianglei
ranxianglei force-pushed the 2026-10-05_dsh-bundle-config-slot branch 3 times, most recently from 7948d10 to 226219c Compare October 5, 2026 14:26
…n detail page

Register the existing origin-probe panel under the plugins.bundle.config slot so
it renders between the description and the component rows on the plugin detail
page (view:'page'), per #2125. Reuses the origin polling/bound-state logic
already present for settings.section; the legacy entry is kept as the fallback
for launcher postures where no bundle page exists.

No manifest change: deliberately do NOT add dsh.client.inject for
@deepseek-ai/dsh-client-ui-plugin-manager. The host ships built into
dsh-web-app on 0.2.x, so the injection is redundant there; on the older
0.1.x dsh the unknown inject target stalls the client-module scanner and
turns the whole web app into an endless spinner. A test locks this in: the
manifest must not declare dsh.client.inject.

Closes #2125
@ranxianglei
ranxianglei force-pushed the 2026-10-05_dsh-bundle-config-slot branch from 226219c to 2c907b7 Compare October 5, 2026 14:51
@ranxianglei
ranxianglei merged commit e5a0066 into master Oct 5, 2026
21 checks passed
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.52-master.e5a0066 (rolling master tag).

npm install -g billion-context@0.0.52-master.e5a0066  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(dsh): 设置栏入口迁到插件详情页配置区(plugins.bundle.config)

1 participant