@huanlin/dsh-plugin-ya-workspace-sidebar 0.8.0 → 0.8.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.
@@ -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/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.8.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -50,21 +50,22 @@
50
50
  }
51
51
  },
52
52
  "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",
53
+ "@deepseek-ai/cordis": "^4.0.1",
54
+ "@deepseek-ai/dsh-api-remotes": "^0.1.7-rc.1",
55
+ "@deepseek-ai/dsh-api-session-controller": "^0.1.7-rc.1",
56
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.1.7-rc.1",
57
+ "@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1",
58
+ "@deepseek-ai/dsh-client-store": "^0.1.7-rc.1",
59
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.1",
60
+ "@deepseek-ai/dsh-client-ui-layout": "^0.1.7-rc.1",
61
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1",
62
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.1",
63
+ "@deepseek-ai/dsh-client-ui-session": "^0.1.7-rc.1",
64
+ "@deepseek-ai/dsh-client-ui-sidebar": "^0.1.7-rc.1",
65
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1",
66
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.1.7-rc.1",
67
+ "@deepseek-ai/dsh-session": "^0.1.7-rc.1",
68
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.7-rc.1",
68
69
  "react": "^18.2.0"
69
70
  },
70
71
  "peerDependenciesMeta": {
@@ -83,6 +84,9 @@
83
84
  "@deepseek-ai/dsh-client-locale": {
84
85
  "optional": true
85
86
  },
87
+ "@deepseek-ai/dsh-client-store": {
88
+ "optional": true
89
+ },
86
90
  "@deepseek-ai/dsh-client-ui-conversation": {
87
91
  "optional": true
88
92
  },
@@ -124,6 +128,7 @@
124
128
  "@deepseek-ai/dsh-api-session-controller": "link:D:/Projects/deepseek-harness/dsh/packages/api/session-controller",
125
129
  "@deepseek-ai/dsh-api-workspace-controller": "link:D:/Projects/deepseek-harness/dsh/packages/api/workspace-controller",
126
130
  "@deepseek-ai/dsh-client-locale": "link:D:/Projects/deepseek-harness/dsh/packages/client/locale",
131
+ "@deepseek-ai/dsh-client-store": "link:D:/Projects/deepseek-harness/dsh/packages/client/store",
127
132
  "@deepseek-ai/dsh-client-ui-conversation": "link:D:/Projects/deepseek-harness/dsh/packages/client/ui-conversation",
128
133
  "@deepseek-ai/dsh-client-ui-layout": "link:D:/Projects/deepseek-harness/dsh/packages/client/ui-layout",
129
134
  "@deepseek-ai/dsh-client-ui-primitives": "link:D:/Projects/deepseek-harness/dsh/packages/client/ui-primitives",