dsh-long-plugins 2.6.0 → 2.6.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.
File without changes
File without changes
File without changes
File without changes
package/dsh.plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-long-plugins",
3
3
  "description": "Merged DSH web plugins: upload manager (drag-and-drop attach any file to the message), workspace output files, skill docs, account balance, Markdown-to-Word (md2docx), and polished file preview (Word & PowerPoint real preview with zoom/pan, rendered Markdown), plus an auto-repair install for DSH core patches (reverse-proxy WebSocket heartbeat, upgrade relink). | 一个插件整合 DSH Web 的常用增强:上传管理(拖放上传:拖任意文件到会话框直接附加)、工作区「输出文件」面板、技能文档浏览、账户余额显示、Markdown 转 Word(md2docx)、Word/PowerPoint 真实预览(可缩放、翻页);并自带修复安装,自动重连 DSH 核心补丁(反代 WebSocket 心跳、升级重连)。",
4
- "version": "2.4.6",
4
+ "version": "2.6.1",
5
5
  "entry": {
6
6
  "name": "dsh-long-plugins",
7
7
  "inject": [
package/lib/index.js CHANGED
@@ -2778,13 +2778,25 @@ export async function apply(ctx, config = {}) {
2778
2778
  }
2779
2779
  const session = ctx.sessions?.get(sessionId);
2780
2780
  let events;
2781
- if (session !== undefined) {
2781
+ if (session !== undefined && typeof session.snapshotEvents === "function") {
2782
+ // DSH 0.1.2-alpha.5 Session exposes snapshotEvents() (the the .events
2783
+ // property is not part of the live Session surface). The legacy
2784
+ // .events array is kept as a fallback for older DSH builds.
2785
+ events = session.snapshotEvents();
2786
+ } else if (session !== undefined && Array.isArray(session.events)) {
2782
2787
  events = session.events;
2783
2788
  } else if (ctx.sessionPersistence !== undefined) {
2784
2789
  // Cold (historical) session: restore through the durable persistence
2785
2790
  // backend. inspect() prefers the live store and falls back to disk.
2786
- const inspected = await ctx.sessionPersistence.inspect(sessionId);
2787
- events = inspected && Array.isArray(inspected.events) ? inspected.events : undefined;
2791
+ // It throws for a session whose live turn is still open; treat that
2792
+ // as "no usable events" instead of a 500 so the chip degrades to
2793
+ // balance-only rather than erroring.
2794
+ try {
2795
+ const inspected = await ctx.sessionPersistence.inspect(sessionId);
2796
+ events = inspected && Array.isArray(inspected.events) ? inspected.events : undefined;
2797
+ } catch {
2798
+ events = undefined;
2799
+ }
2788
2800
  }
2789
2801
  if (events === undefined) {
2790
2802
  sendJson(res, 404, { ok: false, error: "session not found" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-long-plugins",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Merged DSH web plugins: upload manager (drag-and-drop attach any file to the message), workspace output files, skill docs, account balance, and polished file preview (Word & PowerPoint real preview with zoom/pan, rendered Markdown), plus an auto-repair install for DSH core patches (reverse-proxy WebSocket heartbeat, upgrade relink). | 一个插件整合 DSH Web 的常用增强:上传管理(拖放上传:拖任意文件到会话框直接附加)、工作区「输出文件」面板、技能文档浏览、账户余额显示、Word/PowerPoint 真实预览(可缩放、翻页);并自带修复安装,自动重连 DSH 核心补丁(反代 WebSocket 心跳、升级重连)。Office 读取/生成已独立到 dsh-office-reader;RA-Span 已独立到 dsh-span。",
5
5
  "type": "module",
6
6
  "license": "MIT",
File without changes
File without changes
File without changes