@sunshaobei/dsh-session-manager 3.0.7 → 3.0.8

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/client.js +9 -11
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -2139,8 +2139,9 @@ window.__ModuleLoader__.load({
2139
2139
  // 约等于视口 < 800px)就整项消失,这正是「设置里没有会话回收站」的真正原因。
2140
2140
  // 25 落在 20(mnemon「Memory System」)与 30(cost-meter「Cost」)之间,
2141
2141
  // 属于最上面几项,任何能看见设置导航的窗口都能看见它。
2142
- // 插件管理二级页(plugins.bundle.config,同 dsh-context)
2143
- const CFG_NS = 'session-trash'; // 与 cordis patch 行 id 一致
2142
+ // 插件管理二级页(plugins.bundle.config,同 dsh-context):
2143
+ // key 必须等于插件包名(页面用 configured = bundles.has(pkg.name) 决定是否渲染配置区)。
2144
+ const CFG_KEY = '@sunshaobei/dsh-session-manager';
2144
2145
  const settingsStore = (() => {
2145
2146
  let form; let state = {}; const listeners = new Set();
2146
2147
  const notify = () => listeners.forEach((fn) => fn());
@@ -2153,16 +2154,13 @@ window.__ModuleLoader__.load({
2153
2154
  })();
2154
2155
  const registerPluginsPageCard = (env) => {
2155
2156
  const cf = env && env.configForms;
2156
- if (!cf || typeof cf.get !== 'function' || typeof cf.whileServed !== 'function') return;
2157
- ctx.effect(() => settingsStore.attach(cf.get(CFG_NS)), 'session-trash: config forms');
2158
- ctx.effect(() => cf.whileServed([CFG_NS], () =>
2159
- ctx.slots.inject('plugins.bundle.config', () =>
2160
- ctx.slots.register(
2161
- { name: 'plugins.bundle.config', key: CFG_NS, inject: () => ({ hooks: { sessionTrash: settingsStore }, set: (k, v) => settingsStore.set(k, v) }) },
2162
- (props) => TrashTab({ ...props, ctx })
2163
- )
2157
+ if (cf && typeof cf.get === 'function') { try { settingsStore.attach(cf.get(CFG_KEY)); } catch {} }
2158
+ ctx.slots.inject('plugins.bundle.config', () =>
2159
+ ctx.slots.register(
2160
+ { name: 'plugins.bundle.config', key: CFG_KEY, inject: () => ({ hooks: { sessionTrash: settingsStore }, set: (k, v) => settingsStore.set(k, v) }) },
2161
+ (props) => TrashTab({ ...props, ctx })
2164
2162
  )
2165
- ), 'session-trash: plugins-page card');
2163
+ );
2166
2164
  };
2167
2165
  if (typeof ctx.inject === 'function') ctx.inject(['configForms'], registerPluginsPageCard);
2168
2166
  else registerPluginsPageCard(ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunshaobei/dsh-session-manager",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "description": "DSH 会话回收站:会话详情归档入口、回收站多选还原/彻底删除、活跃会话保护。 · Session trash & permanent delete for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "index.js",