dsh-composer-plus 0.8.0 → 0.9.0

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 (3) hide show
  1. package/README.md +4 -2
  2. package/client.js +44 -0
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -21,7 +21,7 @@ dsh plugin --profile web add dsh-composer-plus
21
21
 
22
22
  Then restart dsh. (The CLI can't install into the desktop profile; the app manages it.)
23
23
 
24
- > dsh's pnpm skips versions younger than 24 hours. Right after a release, add the version: `dsh-composer-plus@0.8.0`.
24
+ > dsh's pnpm skips versions younger than 24 hours. Right after a release, add the version: `dsh-composer-plus@0.9.0`.
25
25
 
26
26
  ## Features
27
27
 
@@ -35,6 +35,7 @@ Then restart dsh. (The CLI can't install into the desktop profile; the app manag
35
35
  | **Copy deeplink** | Right-click a chat in the sidebar → **Copy deeplink**. Paste the `dsh-session:…` link into another chat to attach that chat as read-only context. |
36
36
  | **Allow for this chat** | When Auto Review asks you, the approval card gets **Allow for this chat**: the same tool in the same chat is allowed from then on, with any arguments. A header chip lists the grants and revokes them. Grants survive a restart. |
37
37
  | **Project status** | A project row in the sidebar shows the same spinner / waiting / done marker as its chats, so a collapsed project still tells you a chat inside is working or needs you. Hover it for details. |
38
+ | **Active projects first** | When a chat starts running or needs you, its project moves to the top of the sidebar with dsh's own row animation (the same move as dragging it there). Finished projects stay where they are; drag them anywhere as usual. |
38
39
  | **Background notifications** | While dsh is in the background you get a notification when a turn finishes (first line of the reply), or when a chat needs an approval (tool name), an answer (the question) or a plan review. The Dock/taskbar badge counts waiting chats. Clicking opens that chat. |
39
40
 
40
41
  All text — buttons, tooltips, notices, notifications and the Continue message — follows the language selected in dsh (English or Chinese, the two languages dsh ships). Switching the language in dsh settings updates it live.
@@ -64,13 +65,14 @@ Tested on dsh `0.2.0-rc.2` (desktop and web) and `0.2.1-alpha.2` (web). CI runs
64
65
 
65
66
  - **No notifications on macOS:** System Settings → Notifications → DeepSeek Harness → allow. Choose **Alerts** to keep them on screen.
66
67
  - **▶, queue grips, project status, Allow for this chat or right-click missing after a dsh update:** these attach to dsh's current HTML because dsh has no slot for them yet. If dsh changes that markup they hide themselves; nothing else breaks. Please open an [issue](https://github.com/furkancak1r/dsh-composer-plus/issues).
67
- - **Install fails right after a release:** add the version (`dsh-composer-plus@0.8.0`), see the install note above.
68
+ - **Install fails right after a release:** add the version (`dsh-composer-plus@0.9.0`), see the install note above.
68
69
 
69
70
  ## Limits
70
71
 
71
72
  - dsh's queue has no `move` action, so a reorder rewrites the affected rows' text. If the agent picks up a row mid-move, the move is undone and nothing is lost. Messages with images or files can't be moved.
72
73
  - A deeplink works inside chats; clicking it does not open the chat.
73
74
  - A notification sent before a restart only brings dsh to the front when clicked.
75
+ - Active projects are moved with dsh's saved project order, so the new order is kept after a restart. Chats outside any project ("Ungrouped") can't be moved; dsh always lists them last.
74
76
  - Built-in support is requested upstream: queue `move` in [#773](https://github.com/deepseek-ai/deepseek-harness/discussions/773), a Continue state in [#9269](https://github.com/deepseek-ai/deepseek-harness/discussions/9269).
75
77
 
76
78
  ## Development
package/client.js CHANGED
@@ -605,6 +605,46 @@ window.__ModuleLoader__.load({
605
605
  if (done > 0) return { state: 'done' };
606
606
  return null;
607
607
  }
608
+ /** Moves that bring active projects (running or waiting for the user) to the top, keeping their relative order:
609
+ * each active project that sits below an idle one goes before the first idle project. */
610
+ function activeFirstMoves(items, active) {
611
+ const firstIdle = items.findIndex((item) => !active.has(item.workspaceId));
612
+ if (firstIdle === -1) return [];
613
+ const anchor = items[firstIdle].workspaceId;
614
+ return items.slice(firstIdle + 1).filter((item) => active.has(item.workspaceId)).map((item) => [item.workspaceId, anchor]);
615
+ }
616
+ /** Keeps active projects at the top of the sidebar with dsh's own reorder (the same move as dragging a project,
617
+ * so dsh animates the rows). Projects are only ever moved up; finished ones stay where they are. */
618
+ function watchActiveProjects(workspaces, sessionsList, status) {
619
+ let moving = false; let again = false;
620
+ const run = async () => {
621
+ if (moving) { again = true; return; }
622
+ moving = true;
623
+ try {
624
+ do {
625
+ again = false;
626
+ const snapshot = workspaces.list.getSnapshot();
627
+ const list = sessionsList.getSnapshot();
628
+ const statuses = status.getSnapshot();
629
+ if (snapshot?.items === undefined || list === undefined || statuses === undefined) break;
630
+ const archived = new Set(snapshot.archivedSessionIds ?? []);
631
+ const active = new Set(snapshot.items.filter((item) => {
632
+ const state = projectStatus(item.sessionIds, list, statuses, archived);
633
+ return state !== null && state.state !== 'done';
634
+ }).map((item) => item.workspaceId));
635
+ for (const [id, before] of activeFirstMoves(snapshot.items, active)) await workspaces.insertBefore(id, before);
636
+ } while (again);
637
+ } catch (error) {
638
+ console.warn('dsh-composer-plus: project reorder rejected', error);
639
+ } finally {
640
+ moving = false;
641
+ }
642
+ };
643
+ const schedule = () => { queueMicrotask(run); };
644
+ const stops = [workspaces.list.subscribe(schedule), sessionsList.subscribe(schedule), status.subscribe(schedule)];
645
+ schedule();
646
+ return () => { for (const stop of stops) stop(); };
647
+ }
608
648
  const PROJECT_STATUS = 'data-composer-plus-project-status';
609
649
  /** Shows the session status (spinner / waiting / done dot) on each project row, so a collapsed project still says
610
650
  * that one of its chats is working. dsh has no project-row slot.
@@ -909,6 +949,10 @@ window.__ModuleLoader__.load({
909
949
  // First use asks the OS once; a denied permission stays denied (re-enable it in System Settings).
910
950
  if (typeof Notification !== 'undefined' && Notification.permission === 'default') Notification.requestPermission().catch(() => {});
911
951
  });
952
+ if (ctx.inject !== undefined) ctx.inject(['workspaces', 'uiSession', 'sessions'], (scope) => {
953
+ scope.effect(() => watchActiveProjects(scope.workspaces, scope.sessions.list, scope.uiSession.sessionStatus),
954
+ 'dsh-composer-plus: active projects first');
955
+ });
912
956
  if (ctx.inject !== undefined) ctx.inject(['sidebarRight', 'sidebarRightTabs'], (scope) => {
913
957
  const t = ctx.locale.bind(LOCALE_NS);
914
958
  scope.effect(() => scope.sidebarRightTabs.register({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-composer-plus",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "DeepSeek Harness helpers: Codex-style Changes panel, input history, Shift+Tab /plan, one-click Continue, queue drag-and-drop, Copy deeplink, Auto Review allow-for-chat, background notifications",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,6 +39,7 @@
39
39
  "@deepseek-ai/dsh-client-ui-conversation",
40
40
  "@deepseek-ai/dsh-client-ui-workspace",
41
41
  "@deepseek-ai/dsh-client-ui-layout",
42
+ "@deepseek-ai/dsh-api-workspace-controller",
42
43
  "@deepseek-ai/dsh-client-ui-sidebar-right",
43
44
  "@deepseek-ai/dsh-client-ui-session",
44
45
  "@deepseek-ai/dsh-api-remotes",