@mhfire/dsh-im-bridge 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +6 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhfire/dsh-im-bridge",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "企业微信智能机器人 ⇄ DeepSeek Harness Agent 桥接插件:进程内创建 Agent(per-sender 持久会话),会话在 GUI 实时可见;含 Settings 插件配置卡片",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/index.js CHANGED
@@ -95,11 +95,13 @@ export function apply(ctx, config) {
95
95
  const persona = resolvePersona(config)
96
96
 
97
97
  // ── 设置命名空间: 用户可在 GUI 插件配置页 / settings.yaml 覆盖字段(热生效) ──
98
- const settings = ctx.get('settings')
98
+ // 规范做法(与 @deepseek-ai/dsh-settings installSettingsSection 一致):
99
+ // 用 ctx.inject(['settings'], cb) 延迟到 settings 服务可用时再注册,
100
+ // 避免 apply 时 settings 尚未挂载导致命名空间缺失(GUI 卡片显示"命名空间不可用")。
99
101
  let scope
100
- if (settings !== undefined) {
101
- scope = settings.register('im-bridge', Config, { base: { ...config } })
102
- }
102
+ ctx.inject(['settings'], (sctx) => {
103
+ scope = sctx.settings.register('im-bridge', Config, { base: { ...config } })
104
+ })
103
105
  /** 有效配置: 默认值 → cordis patch(base) → 用户 settings.yaml, 热更新 */
104
106
  const cfg = () => scope?.value ?? config
105
107