@huanlin/dsh-plugin-ya-workspace-sidebar 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.
@@ -71,10 +71,16 @@ export type SidebarInjected = DirectoryInjected & {
71
71
  cwd?: string;
72
72
  }) => Promise<SessionPaths>;
73
73
  revealInExplorer: (cwd: string) => Promise<void>;
74
+ /** Current main-view Session (dsh 0.1.7-rc.1: owned by the uiWorkspace service). */
75
+ hooks: {
76
+ currentSession: HostObservable<SessionId | undefined>;
77
+ };
74
78
  };
75
79
  /** Full sidebar component props. */
76
80
  export type SidebarProps = PropsRuntime<'sidebar.workspaces'> & PropsRenderSlots<'sidebar.workspaces.directoryFlow'> & Omit<SidebarInjected, 'hooks'> & {
77
81
  useDirectoryFlow: SnapshotSelectorHook<boolean>;
82
+ } & {
83
+ useCurrentSession: SnapshotSelectorHook<SessionId | undefined>;
78
84
  } & PropsLocale<'ya-workspace-sidebar'>;
79
85
  /** Conversation hero picker operations. */
80
86
  export type PickerInjected = DirectoryInjected & {
@@ -4,12 +4,24 @@ import type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-
4
4
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
5
5
  /** Pending-interaction kinds surfaced as a row status dot. */
6
6
  export type PendingInteractionKind = 'approval' | 'plan-review' | 'question';
7
- /** Renderer-visible view of ui-session's pending-interaction snapshot entries. */
7
+ /** Renderer-visible view of ui-session's unified Session status entries. */
8
8
  export type PendingInteractionEntry = {
9
- readonly kind: string;
9
+ readonly pendingInteraction?: {
10
+ readonly kind: string;
11
+ };
12
+ /** dsh 0.1.7's ui-session status: an unread completion awaiting acknowledgement. */
13
+ readonly completionUnread?: boolean;
10
14
  };
11
15
  /** Pending-interaction snapshot consumed by the derive functions. */
12
16
  export type PendingInteractionMap = ReadonlyMap<SessionId, PendingInteractionEntry>;
17
+ /**
18
+ * Session Controller list plus the selection the sidebar filters/highlights
19
+ * against. dsh 0.1.7-rc.1 moved the selection out of `SessionListState` into
20
+ * the `uiWorkspace` service; callers merge it back in for these projections.
21
+ */
22
+ export type SessionListView = SessionListState & {
23
+ current?: SessionId;
24
+ };
13
25
  /** Navigation key for sessions not accounted to a real workspace. */
14
26
  export declare const UNGROUPED: "__ya_ungrouped__";
15
27
  /** One sidebar session row. */
@@ -52,7 +64,7 @@ export interface WorkspaceRow {
52
64
  /** Resolve the first/second-level destination for one session. */
53
65
  export declare function workspaceKeyForSession(sessionId: SessionId | undefined, workspaces: readonly WorkspaceView[]): WorkspaceId | typeof UNGROUPED | null;
54
66
  /** Derive global recent sessions, newest first. */
55
- export declare function deriveRecent(list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, limit?: number): SessionRow[];
67
+ export declare function deriveRecent(list: SessionListView, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, limit?: number): SessionRow[];
56
68
  /** Lift pinned rows (in pinned order) to the front; the rest keep their order. */
57
69
  export declare function applyPinned(rows: readonly SessionRow[], pinnedOrder: readonly SessionId[]): SessionRow[];
58
70
  /** Split date-grouped rows into a leading pinned list (pinned order) and the remaining groups (emptied groups dropped). */
@@ -77,9 +89,9 @@ export interface VirtualWindow {
77
89
  */
78
90
  export declare function virtualWindow(scrollTop: number, viewportHeight: number, count: number, stride?: number, overscan?: number): VirtualWindow;
79
91
  /** Derive first-level workspaces plus Ungrouped, newest session activity first. */
80
- export declare function deriveWorkspaces(list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[]): WorkspaceRow[];
92
+ export declare function deriveWorkspaces(list: SessionListView, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[]): WorkspaceRow[];
81
93
  /** Derive the selected workspace's sessions in its canonical order. */
82
- export declare function deriveWorkspaceSessions(key: WorkspaceId | typeof UNGROUPED, list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap): SessionRow[];
94
+ export declare function deriveWorkspaceSessions(key: WorkspaceId | typeof UNGROUPED, list: SessionListView, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap): SessionRow[];
83
95
  /**
84
96
  * Derive the selected real workspace's sessions grouped by local calendar date.
85
97
  *
@@ -89,7 +101,7 @@ export declare function deriveWorkspaceSessions(key: WorkspaceId | typeof UNGROU
89
101
  * - Future timestamps clamp to today's bucket (`dayOffset` 0).
90
102
  * - `now` is the reference timestamp for "today"; pass `Date.now()` in production.
91
103
  */
92
- export declare function deriveWorkspaceSessionGroups(key: WorkspaceId | typeof UNGROUPED, list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, now: number): SessionDateGroup[];
104
+ export declare function deriveWorkspaceSessionGroups(key: WorkspaceId | typeof UNGROUPED, list: SessionListView, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, now: number): SessionDateGroup[];
93
105
  /** Group root workspace rows by local calendar date of `lastUsedAt`; undated rows trail with empty `dateKey`. */
94
106
  export declare function deriveWorkspaceGroups(rows: readonly WorkspaceRow[], now: number): WorkspaceDateGroup[];
95
107
  /** Case-insensitive local title/workspace matching used beside Host content search. */
@@ -9,13 +9,24 @@
9
9
  * pre-split client runtime: reuse-or-create Workspace connection, the
10
10
  * explicit/current/recent New Session fallback, archived-current clearing,
11
11
  * boot auto-selection, and the directory-picking wire calls.
12
+ *
13
+ * dsh 0.1.7-rc.1 moved the Session selection out of the Session Controller
14
+ * (`SessionListState.current` / `ISessions.open` / `ISessions.clear` are gone)
15
+ * into this service: a retained `mainReference` plus a persisted selection
16
+ * store (`dsh.sessions.current`). This port mirrors the shipped
17
+ * `UiWorkspaceService` selection mechanics.
12
18
  */
13
19
  import { Service, type Context } from '@deepseek-ai/cordis';
14
- import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
20
+ import type { ISessions, SessionTarget } from '@deepseek-ai/dsh-api-session-controller/client';
15
21
  import type { ClientRemote, DirectoryListing } from '@deepseek-ai/dsh-api-remotes/client';
16
22
  import type { IWorkspaces, WorkspaceId } from '@deepseek-ai/dsh-api-workspace-controller/client';
17
23
  import type { UiWorkspace } from '@deepseek-ai/dsh-client-ui-workspace/client';
18
24
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
25
+ /** One persisted selection: the current Session and its optional subagent address. */
26
+ export interface SessionSelection {
27
+ readonly sessionId?: SessionId;
28
+ readonly subagentAddress?: SessionTarget;
29
+ }
19
30
  /** Implements Workspace navigation and directory UI operations. */
20
31
  export declare class YaWorkspaceNavigation extends Service implements UiWorkspace {
21
32
  private readonly directoryPicker;
@@ -23,6 +34,8 @@ export declare class YaWorkspaceNavigation extends Service implements UiWorkspac
23
34
  private readonly sessions;
24
35
  private readonly connecting;
25
36
  private readonly lifetime;
37
+ private readonly selection;
38
+ private mainReference;
26
39
  /**
27
40
  * @param ctx - Client root Context.
28
41
  * @param directoryPicker - the directory-picking Remote namespace.
@@ -30,16 +43,30 @@ export declare class YaWorkspaceNavigation extends Service implements UiWorkspac
30
43
  * @param sessions - pure Session Controller.
31
44
  */
32
45
  constructor(ctx: Context, directoryPicker: ClientRemote['directoryPicker'], workspaces: IWorkspaces, sessions: ISessions);
46
+ /** The Session currently shown in the main view, or undefined. */
47
+ get currentSessionId(): SessionId | undefined;
48
+ /** Observe the current selection (the sidebar's blank-row filter and highlight). */
49
+ subscribeSelection(listener: () => void): () => void;
33
50
  connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
34
- openSession(sessionId: SessionId): void;
51
+ private reuseOrCreateBlank;
52
+ private reuseBlank;
53
+ openSession(target: SessionTarget): void;
35
54
  openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void): Promise<void>;
36
55
  forkSession(sessionId: SessionId): Promise<void>;
37
56
  startSession(workspaceId?: WorkspaceId): void;
38
- archiveSession(sessionId: SessionId): Promise<void>;
57
+ archiveSession(sessionId: SessionId, options?: {
58
+ readonly stopActivity?: boolean;
59
+ }): Promise<void>;
60
+ unarchiveSession(sessionId: SessionId): Promise<void>;
61
+ pinSession(sessionId: SessionId): Promise<void>;
62
+ unpinSession(sessionId: SessionId): Promise<void>;
39
63
  pickDirectory(): Promise<string | null>;
40
64
  listDirectory(path?: string, signal?: AbortSignal): Promise<DirectoryListing>;
41
65
  createDirectory(path: string, name: string): Promise<string>;
42
66
  private watchNavigation;
67
+ private restoreSelection;
43
68
  /** @returns true when an archived current selection was cleared. */
44
69
  private clearArchivedCurrent;
70
+ private clearMain;
71
+ private replaceMain;
45
72
  }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "YA Workspace Sidebar",
4
+ "description": "Replaces the DSH workspace sidebar: a global virtual-scrolled Recent Sessions list on top, a draggable separator, and a two-level Workspace → Session browser with breadcrumb navigation, local-date grouping, relative last-used times, pinning, unread dots, and right-click menus; add/rename/delete/fork/archive still use native host abilities."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "YA 工作区侧栏",
4
+ "description": "DSH 工作区侧栏替代插件:顶部虚拟滚动展示全局最近会话完整列表,分隔条可拖拽调整高度;下方 Workspace → Session 二级浏览带面包屑导航,会话按本地日期分组、显示相对最近使用时间,支持置顶、未读蓝点与右键菜单;搜索、添加/重命名/删除工作区、Fork 与归档沿用 DSH 原生能力。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huanlin/dsh-plugin-ya-workspace-sidebar",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -22,10 +22,12 @@
22
22
  "default": "./lib/client.js"
23
23
  },
24
24
  "./src/*": "./src/*",
25
+ "./locale/*.json": "./locale/*.json",
25
26
  "./package.json": "./package.json"
26
27
  },
27
28
  "files": [
28
29
  "lib/",
30
+ "locale/",
29
31
  "cordis.patch.yml"
30
32
  ],
31
33
  "dsh": {
@@ -50,21 +52,22 @@
50
52
  }
51
53
  },
52
54
  "peerDependencies": {
53
- "@deepseek-ai/cordis": "^0.1.5-rc.1",
54
- "@deepseek-ai/dsh-api-remotes": "^0.1.5-rc.1",
55
- "@deepseek-ai/dsh-api-session-controller": "^0.1.5-rc.1",
56
- "@deepseek-ai/dsh-api-workspace-controller": "^0.1.5-rc.1",
57
- "@deepseek-ai/dsh-client-locale": "^0.1.5-rc.1",
58
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.1",
59
- "@deepseek-ai/dsh-client-ui-layout": "^0.1.5-rc.1",
60
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.1",
61
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.1",
62
- "@deepseek-ai/dsh-client-ui-session": "^0.1.5-rc.1",
63
- "@deepseek-ai/dsh-client-ui-sidebar": "^0.1.5-rc.1",
64
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.1",
65
- "@deepseek-ai/dsh-client-ui-workspace": "^0.1.5-rc.1",
66
- "@deepseek-ai/dsh-session": "^0.1.5-rc.1",
67
- "@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.1",
55
+ "@deepseek-ai/cordis": "^4.0.1",
56
+ "@deepseek-ai/dsh-api-remotes": "^0.1.7-rc.1",
57
+ "@deepseek-ai/dsh-api-session-controller": "^0.1.7-rc.1",
58
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.1.7-rc.1",
59
+ "@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1",
60
+ "@deepseek-ai/dsh-client-store": "^0.1.7-rc.1",
61
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.1",
62
+ "@deepseek-ai/dsh-client-ui-layout": "^0.1.7-rc.1",
63
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1",
64
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.1",
65
+ "@deepseek-ai/dsh-client-ui-session": "^0.1.7-rc.1",
66
+ "@deepseek-ai/dsh-client-ui-sidebar": "^0.1.7-rc.1",
67
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1",
68
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.1.7-rc.1",
69
+ "@deepseek-ai/dsh-session": "^0.1.7-rc.1",
70
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.7-rc.1",
68
71
  "react": "^18.2.0"
69
72
  },
70
73
  "peerDependenciesMeta": {
@@ -83,6 +86,9 @@
83
86
  "@deepseek-ai/dsh-client-locale": {
84
87
  "optional": true
85
88
  },
89
+ "@deepseek-ai/dsh-client-store": {
90
+ "optional": true
91
+ },
86
92
  "@deepseek-ai/dsh-client-ui-conversation": {
87
93
  "optional": true
88
94
  },
@@ -124,6 +130,7 @@
124
130
  "@deepseek-ai/dsh-api-session-controller": "link:D:/Projects/deepseek-harness/dsh/packages/api/session-controller",
125
131
  "@deepseek-ai/dsh-api-workspace-controller": "link:D:/Projects/deepseek-harness/dsh/packages/api/workspace-controller",
126
132
  "@deepseek-ai/dsh-client-locale": "link:D:/Projects/deepseek-harness/dsh/packages/client/locale",
133
+ "@deepseek-ai/dsh-client-store": "link:D:/Projects/deepseek-harness/dsh/packages/client/store",
127
134
  "@deepseek-ai/dsh-client-ui-conversation": "link:D:/Projects/deepseek-harness/dsh/packages/client/ui-conversation",
128
135
  "@deepseek-ai/dsh-client-ui-layout": "link:D:/Projects/deepseek-harness/dsh/packages/client/ui-layout",
129
136
  "@deepseek-ai/dsh-client-ui-primitives": "link:D:/Projects/deepseek-harness/dsh/packages/client/ui-primitives",