@sunshaobei/dsh-session-manager 3.1.2 → 3.1.3

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 +3 -1
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -224,7 +224,9 @@ window.__ModuleLoader__.load({
224
224
  let hostTranslate;
225
225
 
226
226
  function attachHostLocale(ctx) {
227
- hostLocale = typeof ctx?.get === 'function' ? ctx.get('locale') : undefined;
227
+ // 宿主暴露方式因版本而异:0.2.x 直接挂在 ctx.locale;旧版经 ctx.get('locale')。两种都试。
228
+ hostLocale = (ctx && ctx.locale && typeof ctx.locale.register === 'function') ? ctx.locale : undefined;
229
+ if (!hostLocale && typeof ctx?.get === 'function') { try { hostLocale = ctx.get('locale'); } catch { /* keep undefined */ } }
228
230
  if (!hostLocale || typeof hostLocale.register !== 'function' || typeof hostLocale.bind !== 'function') return;
229
231
  try {
230
232
  const dispose = hostLocale.register(LOCALE_NS, MESSAGES);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunshaobei/dsh-session-manager",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "DSH 会话回收站:会话详情归档入口、回收站多选还原/彻底删除、活跃会话保护。 · Session trash & permanent delete for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "index.js",