dsh-ws-recency 0.12.0 → 0.12.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.
package/README.md CHANGED
@@ -134,7 +134,7 @@ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
134
134
  或固定版本的预构建包:
135
135
 
136
136
  ```powershell
137
- dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.12.0/dsh-ws-recency-0.12.0.tgz
137
+ dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.12.1/dsh-ws-recency-0.12.1.tgz
138
138
  ```
139
139
 
140
140
  装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
package/client.js CHANGED
@@ -235,7 +235,7 @@
235
235
  "trash.purge": "彻底删除",
236
236
  "trash.confirmRestore": "恢复到原来的工作区?",
237
237
  "trash.confirmPurge": "彻底删除这份日志?不可恢复。",
238
- "trash.restored": "已恢复,并重新挂回原工作区。",
238
+ "trash.restored": "已恢复,并重新挂回原工作区。若侧栏还没出现,去「补登记游离会话」点一下扫描(或重启应用)刷新列表。",
239
239
  "trash.purged": "已彻底删除。",
240
240
  "trash.working": "处理中…",
241
241
  "trash.failed": "操作失败:",
@@ -313,7 +313,7 @@
313
313
  "trash.purge": "Delete for good",
314
314
  "trash.confirmRestore": "Restore it to its original workspace?",
315
315
  "trash.confirmPurge": "Delete this log for good? This cannot be undone.",
316
- "trash.restored": "Restored and re-attached to its workspace.",
316
+ "trash.restored": "Restored and re-attached to its workspace. If the sidebar has not picked it up, run the \"Adopt unlisted sessions\" scan (or restart the app).",
317
317
  "trash.purged": "Deleted for good.",
318
318
  "trash.working": "Working\u2026",
319
319
  "trash.failed": "Action failed: ",
package/index.js CHANGED
@@ -846,6 +846,21 @@ export async function restoreTrashEntry(ctx, name) {
846
846
  /* an old header may be refused; the files are back either way */
847
847
  }
848
848
  }
849
+ /* A restore must not resurrect the stale membership the delete left behind. */
850
+ const raw = await rawWorkspaceMembership();
851
+ for (const workspace of workspaces) {
852
+ if (owner !== undefined && workspace.id === owner.id) continue;
853
+ const record = raw === null ? undefined : raw.get(workspace.id);
854
+ const listed = record !== undefined
855
+ ? record.sessionIds.includes(sidecar.sessionId)
856
+ : Array.isArray(workspace.sessionIds) && workspace.sessionIds.includes(sidecar.sessionId);
857
+ if (!listed) continue;
858
+ try {
859
+ await workspace.detachSession(sidecar.sessionId);
860
+ } catch {
861
+ /* leave it; the scan can clean it later */
862
+ }
863
+ }
849
864
  try {
850
865
  await rm(directory, { recursive: true, force: true });
851
866
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ws-recency",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Sidebar session management for DeepSeek Harness: workspace groups sorted by latest activity, stale history folded, a global pinned section, follow-up marks, session delete into a recoverable trash, per-session token statistics split by tool, and moving a session to another workspace.",
5
5
  "license": "MIT",
6
6
  "author": "chyxhtc",