fix(apes-sidebar): inject 改空数组(修 DSH entry pending → 恢复模式)

根因:inject: ['logger'] 声明了 logger 为硬依赖 service,但 DSH host
没有 provider 注册 logger service → entry 永远 pending →
'1 entry did not activate' → 插件树加载失败 → 恢复模式循环。

对比 dsh-better-sidebar:其 inject 是 host 实际提供的 service
(webServer/sessions/webRuntime/tools)。apes-sidebar host half 只用
ctx.logger 做可选链调用(log?.info?.() 在 try/catch 里),logger 是
软便利不是硬依赖——不该出现在 inject 列表里。

修正:inject 改空数组 [],host half 不声明任何硬依赖 service。
同步更新 smoke.spec.ts 断言(inject toEqual([]))+
verify-mount.cjs 检查(inject === [])。

门禁:typecheck rc=0 · build rc=0 · test 29/29
This commit is contained in:
figmar
2026-09-04 21:21:56 +08:00
parent cfc9d3c884
commit 0b79269b2c
3 changed files with 18 additions and 4 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ try {
check('host entry 加载成功', true)
check('导出 name (string)', typeof host.name === 'string', 'got ' + typeof host.name)
check('导出 inject (string[])', Array.isArray(host.inject), 'got ' + typeof host.inject)
check('inject === [logger]', JSON.stringify(host.inject) === '["logger"]', JSON.stringify(host.inject))
check('inject === [] (无硬依赖 service)', JSON.stringify(host.inject) === '[]', JSON.stringify(host.inject))
check('导出 apply (function)', typeof host.apply === 'function')
check('无 default export(namespace 规则)', !('default' in host))
console.log(' name =', JSON.stringify(host.name))