@huanlin/dsh-plugin-ya-workspace-sidebar 0.6.0 → 0.7.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.
@@ -1,113 +1,133 @@
1
- /** Product copy for the replacement workspace browser. */
2
- export declare const zh: {
3
- workspaces: string;
4
- sessions: string;
5
- recent: string;
6
- ungrouped: string;
7
- newSession: string;
8
- addWorkspace: string;
9
- addWorkspaceMenu: string;
10
- search: string;
11
- searchPlaceholder: string;
12
- clearSearch: string;
13
- searching: string;
14
- searchUnavailable: string;
15
- noMatches: string;
16
- noSessions: string;
17
- noWorkspaces: string;
18
- loading: string;
19
- rename: string;
20
- renameWorkspace: string;
21
- renameSession: string;
22
- deleteWorkspace: string;
23
- deleteDescription: string;
24
- fork: string;
25
- archive: string;
26
- archiveMode: string;
27
- deleteMode: string;
28
- deleteSession: string;
29
- deleteSessionTitle: string;
30
- deleteSessionConfirm: string;
31
- toggleActionMode: string;
32
- actionModeLabel: string;
33
- cancel: string;
34
- confirm: string;
35
- retry: string;
36
- folderError: string;
37
- workspaceName: string;
38
- sessionName: string;
39
- count: string;
40
- now: string;
41
- minutes: string;
42
- hours: string;
43
- days: string;
44
- months: string;
45
- years: string;
46
- running: string;
47
- waiting: string;
48
- completed: string;
49
- collapse: string;
50
- expand: string;
51
- resizeRecent: string;
52
- today: string;
53
- yesterday: string;
54
- date: string;
55
- dateYear: string;
56
- };
57
- export type YaWorkspaceKey = keyof typeof zh;
58
- export declare const en: {
59
- workspaces: string;
60
- sessions: string;
61
- recent: string;
62
- ungrouped: string;
63
- newSession: string;
64
- addWorkspace: string;
65
- addWorkspaceMenu: string;
66
- search: string;
67
- searchPlaceholder: string;
68
- clearSearch: string;
69
- searching: string;
70
- searchUnavailable: string;
71
- noMatches: string;
72
- noSessions: string;
73
- noWorkspaces: string;
74
- loading: string;
75
- rename: string;
76
- renameWorkspace: string;
77
- renameSession: string;
78
- deleteWorkspace: string;
79
- deleteDescription: string;
80
- fork: string;
81
- archive: string;
82
- archiveMode: string;
83
- deleteMode: string;
84
- deleteSession: string;
85
- deleteSessionTitle: string;
86
- deleteSessionConfirm: string;
87
- toggleActionMode: string;
88
- actionModeLabel: string;
89
- cancel: string;
90
- confirm: string;
91
- retry: string;
92
- folderError: string;
93
- workspaceName: string;
94
- sessionName: string;
95
- count: string;
96
- now: string;
97
- minutes: string;
98
- hours: string;
99
- days: string;
100
- months: string;
101
- years: string;
102
- running: string;
103
- waiting: string;
104
- completed: string;
105
- collapse: string;
106
- expand: string;
107
- resizeRecent: string;
108
- today: string;
109
- yesterday: string;
110
- date: string;
111
- dateYear: string;
112
- };
113
- export declare const NS = "ya-workspace-sidebar";
1
+ /** Product copy for the replacement workspace browser. */
2
+ export declare const zh: {
3
+ workspaces: string;
4
+ sessions: string;
5
+ recent: string;
6
+ ungrouped: string;
7
+ newSession: string;
8
+ addWorkspace: string;
9
+ addWorkspaceMenu: string;
10
+ search: string;
11
+ searchPlaceholder: string;
12
+ clearSearch: string;
13
+ searching: string;
14
+ searchUnavailable: string;
15
+ noMatches: string;
16
+ noSessions: string;
17
+ noWorkspaces: string;
18
+ loading: string;
19
+ rename: string;
20
+ renameWorkspace: string;
21
+ renameSession: string;
22
+ deleteWorkspace: string;
23
+ deleteDescription: string;
24
+ fork: string;
25
+ archive: string;
26
+ archiveMode: string;
27
+ deleteMode: string;
28
+ deleteSession: string;
29
+ deleteSessionTitle: string;
30
+ deleteSessionConfirm: string;
31
+ toggleActionMode: string;
32
+ actionModeLabel: string;
33
+ cancel: string;
34
+ confirm: string;
35
+ retry: string;
36
+ folderError: string;
37
+ workspaceName: string;
38
+ sessionName: string;
39
+ count: string;
40
+ now: string;
41
+ minutes: string;
42
+ hours: string;
43
+ days: string;
44
+ months: string;
45
+ years: string;
46
+ running: string;
47
+ waiting: string;
48
+ completed: string;
49
+ collapse: string;
50
+ expand: string;
51
+ resizeRecent: string;
52
+ today: string;
53
+ yesterday: string;
54
+ date: string;
55
+ dateYear: string;
56
+ pin: string;
57
+ unpin: string;
58
+ pinnedGroup: string;
59
+ markUnread: string;
60
+ markRead: string;
61
+ revealInExplorer: string;
62
+ copyPath: string;
63
+ copySessionDir: string;
64
+ copyLogPath: string;
65
+ copySessionId: string;
66
+ };
67
+ export type YaWorkspaceKey = keyof typeof zh;
68
+ export declare const en: {
69
+ workspaces: string;
70
+ sessions: string;
71
+ recent: string;
72
+ ungrouped: string;
73
+ newSession: string;
74
+ addWorkspace: string;
75
+ addWorkspaceMenu: string;
76
+ search: string;
77
+ searchPlaceholder: string;
78
+ clearSearch: string;
79
+ searching: string;
80
+ searchUnavailable: string;
81
+ noMatches: string;
82
+ noSessions: string;
83
+ noWorkspaces: string;
84
+ loading: string;
85
+ rename: string;
86
+ renameWorkspace: string;
87
+ renameSession: string;
88
+ deleteWorkspace: string;
89
+ deleteDescription: string;
90
+ fork: string;
91
+ archive: string;
92
+ archiveMode: string;
93
+ deleteMode: string;
94
+ deleteSession: string;
95
+ deleteSessionTitle: string;
96
+ deleteSessionConfirm: string;
97
+ toggleActionMode: string;
98
+ actionModeLabel: string;
99
+ cancel: string;
100
+ confirm: string;
101
+ retry: string;
102
+ folderError: string;
103
+ workspaceName: string;
104
+ sessionName: string;
105
+ count: string;
106
+ now: string;
107
+ minutes: string;
108
+ hours: string;
109
+ days: string;
110
+ months: string;
111
+ years: string;
112
+ running: string;
113
+ waiting: string;
114
+ completed: string;
115
+ collapse: string;
116
+ expand: string;
117
+ resizeRecent: string;
118
+ today: string;
119
+ yesterday: string;
120
+ date: string;
121
+ dateYear: string;
122
+ pin: string;
123
+ unpin: string;
124
+ pinnedGroup: string;
125
+ markUnread: string;
126
+ markRead: string;
127
+ revealInExplorer: string;
128
+ copyPath: string;
129
+ copySessionDir: string;
130
+ copyLogPath: string;
131
+ copySessionId: string;
132
+ };
133
+ export declare const NS = "ya-workspace-sidebar";
@@ -1,87 +1,96 @@
1
- /** Pure sidebar projections shared by the browser and unit tests. */
2
- import type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
3
- import type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client';
4
- import type { SessionId } from '@deepseek-ai/dsh-session/types';
5
- /** Pending-interaction kinds surfaced as a row status dot. */
6
- export type PendingInteractionKind = 'approval' | 'plan-review' | 'question';
7
- /** Renderer-visible view of ui-session's pending-interaction snapshot entries. */
8
- export type PendingInteractionEntry = {
9
- readonly kind: string;
10
- };
11
- /** Pending-interaction snapshot consumed by the derive functions. */
12
- export type PendingInteractionMap = ReadonlyMap<SessionId, PendingInteractionEntry>;
13
- /** Navigation key for sessions not accounted to a real workspace. */
14
- export declare const UNGROUPED: "__ya_ungrouped__";
15
- /** One sidebar session row. */
16
- export interface SessionRow {
17
- id: SessionId;
18
- title: string;
19
- blank: boolean;
20
- running: boolean;
21
- pendingInteraction?: PendingInteractionKind;
22
- completed: boolean;
23
- updatedAt: number;
24
- workspaceKey: WorkspaceId | typeof UNGROUPED;
25
- workspaceTitle: string;
26
- }
27
- /** One date-bucketed group. Empty `dateKey` is the undated trailing bucket. */
28
- export interface DateGroup<T> {
29
- /** Local calendar date `YYYY-MM-DD`, or `''` for rows with no timestamp. */
30
- dateKey: string;
31
- /** Days between today's local date and this group's local date (0=today, 1=yesterday, …). */
32
- dayOffset: number;
33
- rows: T[];
34
- }
35
- /** One date-bucketed group of session rows for the real-workspace level. */
36
- export type SessionDateGroup = DateGroup<SessionRow>;
37
- /** One date-bucketed group of first-level workspace rows. */
38
- export type WorkspaceDateGroup = DateGroup<WorkspaceRow>;
39
- /** One first-level workspace row. */
40
- export interface WorkspaceRow {
41
- key: WorkspaceId | typeof UNGROUPED;
42
- title: string;
43
- path?: string;
44
- createdAt?: string;
45
- /** Newest visible session `updatedAt`; empty real workspaces fall back to `createdAt`. */
46
- lastUsedAt?: number;
47
- count: number;
48
- real: boolean;
49
- }
50
- /** Resolve the first/second-level destination for one session. */
51
- export declare function workspaceKeyForSession(sessionId: SessionId | undefined, workspaces: readonly WorkspaceView[]): WorkspaceId | typeof UNGROUPED | null;
52
- /** Derive global recent sessions, newest first. */
53
- export declare function deriveRecent(list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, limit?: number): SessionRow[];
54
- /** Fixed occupied height of one recent-sessions row: 33px two-line row + 2px vertical margins. */
55
- export declare const RECENT_ROW_STRIDE = 35;
56
- /** Half-open render window `[start, end)` of a fixed-stride virtual list. */
57
- export interface VirtualWindow {
58
- start: number;
59
- end: number;
60
- }
61
- /**
62
- * Windowing math for the recent-sessions virtual list (fixed row stride).
63
- *
64
- * Clamps `scrollTop` into the valid range, then pads the visible row range
65
- * with `overscan` rows on both edges. Before the viewport has been measured
66
- * (`viewportHeight <= 0`) it still returns a small head window so the first
67
- * paint is never blank.
68
- */
69
- export declare function virtualWindow(scrollTop: number, viewportHeight: number, count: number, stride?: number, overscan?: number): VirtualWindow;
70
- /** Derive first-level workspaces plus Ungrouped, newest session activity first. */
71
- export declare function deriveWorkspaces(list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[]): WorkspaceRow[];
72
- /** Derive the selected workspace's sessions in its canonical order. */
73
- export declare function deriveWorkspaceSessions(key: WorkspaceId | typeof UNGROUPED, list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap): SessionRow[];
74
- /**
75
- * Derive the selected real workspace's sessions grouped by local calendar date.
76
- *
77
- * - Only real workspaces: `Ungrouped` falls back to {@link deriveWorkspaceSessions}.
78
- * - Groups are ordered by date descending; rows within a group by `updatedAt` descending.
79
- * - {@link visible} filter is reused (archived / subagent / blank visibility).
80
- * - Future timestamps clamp to today's bucket (`dayOffset` 0).
81
- * - `now` is the reference timestamp for "today"; pass `Date.now()` in production.
82
- */
83
- export declare function deriveWorkspaceSessionGroups(key: WorkspaceId | typeof UNGROUPED, list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, now: number): SessionDateGroup[];
84
- /** Group root workspace rows by local calendar date of `lastUsedAt`; undated rows trail with empty `dateKey`. */
85
- export declare function deriveWorkspaceGroups(rows: readonly WorkspaceRow[], now: number): WorkspaceDateGroup[];
86
- /** Case-insensitive local title/workspace matching used beside Host content search. */
87
- export declare function localMatches(rows: readonly SessionRow[], query: string): SessionRow[];
1
+ /** Pure sidebar projections shared by the browser and unit tests. */
2
+ import type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
3
+ import type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client';
4
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
5
+ /** Pending-interaction kinds surfaced as a row status dot. */
6
+ export type PendingInteractionKind = 'approval' | 'plan-review' | 'question';
7
+ /** Renderer-visible view of ui-session's pending-interaction snapshot entries. */
8
+ export type PendingInteractionEntry = {
9
+ readonly kind: string;
10
+ };
11
+ /** Pending-interaction snapshot consumed by the derive functions. */
12
+ export type PendingInteractionMap = ReadonlyMap<SessionId, PendingInteractionEntry>;
13
+ /** Navigation key for sessions not accounted to a real workspace. */
14
+ export declare const UNGROUPED: "__ya_ungrouped__";
15
+ /** One sidebar session row. */
16
+ export interface SessionRow {
17
+ id: SessionId;
18
+ title: string;
19
+ blank: boolean;
20
+ running: boolean;
21
+ pendingInteraction?: PendingInteractionKind;
22
+ completed: boolean;
23
+ updatedAt: number;
24
+ workspaceKey: WorkspaceId | typeof UNGROUPED;
25
+ workspaceTitle: string;
26
+ /** Session working directory; feeds the context menu's path actions. */
27
+ cwd?: string;
28
+ }
29
+ /** One date-bucketed group. Empty `dateKey` is the undated trailing bucket. */
30
+ export interface DateGroup<T> {
31
+ /** Local calendar date `YYYY-MM-DD`, or `''` for rows with no timestamp. */
32
+ dateKey: string;
33
+ /** Days between today's local date and this group's local date (0=today, 1=yesterday, …). */
34
+ dayOffset: number;
35
+ rows: T[];
36
+ }
37
+ /** One date-bucketed group of session rows for the real-workspace level. */
38
+ export type SessionDateGroup = DateGroup<SessionRow>;
39
+ /** One date-bucketed group of first-level workspace rows. */
40
+ export type WorkspaceDateGroup = DateGroup<WorkspaceRow>;
41
+ /** One first-level workspace row. */
42
+ export interface WorkspaceRow {
43
+ key: WorkspaceId | typeof UNGROUPED;
44
+ title: string;
45
+ path?: string;
46
+ createdAt?: string;
47
+ /** Newest visible session `updatedAt`; empty real workspaces fall back to `createdAt`. */
48
+ lastUsedAt?: number;
49
+ count: number;
50
+ real: boolean;
51
+ }
52
+ /** Resolve the first/second-level destination for one session. */
53
+ export declare function workspaceKeyForSession(sessionId: SessionId | undefined, workspaces: readonly WorkspaceView[]): WorkspaceId | typeof UNGROUPED | null;
54
+ /** Derive global recent sessions, newest first. */
55
+ export declare function deriveRecent(list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, limit?: number): SessionRow[];
56
+ /** Lift pinned rows (in pinned order) to the front; the rest keep their order. */
57
+ export declare function applyPinned(rows: readonly SessionRow[], pinnedOrder: readonly SessionId[]): SessionRow[];
58
+ /** Split date-grouped rows into a leading pinned list (pinned order) and the remaining groups (emptied groups dropped). */
59
+ export declare function extractPinnedGroups(groups: readonly SessionDateGroup[], pinnedOrder: readonly SessionId[]): {
60
+ pinned: SessionRow[];
61
+ groups: SessionDateGroup[];
62
+ };
63
+ /** Fixed occupied height of one recent-sessions row: 33px two-line row + 2px vertical margins. */
64
+ export declare const RECENT_ROW_STRIDE = 35;
65
+ /** Half-open render window `[start, end)` of a fixed-stride virtual list. */
66
+ export interface VirtualWindow {
67
+ start: number;
68
+ end: number;
69
+ }
70
+ /**
71
+ * Windowing math for the recent-sessions virtual list (fixed row stride).
72
+ *
73
+ * Clamps `scrollTop` into the valid range, then pads the visible row range
74
+ * with `overscan` rows on both edges. Before the viewport has been measured
75
+ * (`viewportHeight <= 0`) it still returns a small head window so the first
76
+ * paint is never blank.
77
+ */
78
+ export declare function virtualWindow(scrollTop: number, viewportHeight: number, count: number, stride?: number, overscan?: number): VirtualWindow;
79
+ /** Derive first-level workspaces plus Ungrouped, newest session activity first. */
80
+ export declare function deriveWorkspaces(list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[]): WorkspaceRow[];
81
+ /** 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[];
83
+ /**
84
+ * Derive the selected real workspace's sessions grouped by local calendar date.
85
+ *
86
+ * - Only real workspaces: `Ungrouped` falls back to {@link deriveWorkspaceSessions}.
87
+ * - Groups are ordered by date descending; rows within a group by `updatedAt` descending.
88
+ * - {@link visible} filter is reused (archived / subagent / blank visibility).
89
+ * - Future timestamps clamp to today's bucket (`dayOffset` 0).
90
+ * - `now` is the reference timestamp for "today"; pass `Date.now()` in production.
91
+ */
92
+ export declare function deriveWorkspaceSessionGroups(key: WorkspaceId | typeof UNGROUPED, list: SessionListState, workspaces: readonly WorkspaceView[], archivedSessionIds: readonly SessionId[], pending: PendingInteractionMap, now: number): SessionDateGroup[];
93
+ /** Group root workspace rows by local calendar date of `lastUsedAt`; undated rows trail with empty `dateKey`. */
94
+ export declare function deriveWorkspaceGroups(rows: readonly WorkspaceRow[], now: number): WorkspaceDateGroup[];
95
+ /** Case-insensitive local title/workspace matching used beside Host content search. */
96
+ export declare function localMatches(rows: readonly SessionRow[], query: string): SessionRow[];
@@ -1,45 +1,45 @@
1
- /**
2
- * Stand-in for the `uiWorkspace` navigation service owned by the official
3
- * ui-workspace client entry, which this bundle's patch disables.
4
- *
5
- * Since DSH v0.1.2-alpha.1 the ui-sidebar, ui-conversation, ui-agent-preset,
6
- * and the composed directory-picker client entries all inject `uiWorkspace`;
7
- * without a provider their fibers park forever and the whole WebUI boot
8
- * deadlocks. This port carries the semantics that moved here from the
9
- * pre-split client runtime: reuse-or-create Workspace connection, the
10
- * explicit/current/recent New Session fallback, archived-current clearing,
11
- * boot auto-selection, and the directory-picking wire calls.
12
- */
13
- import { Service, type Context } from '@deepseek-ai/cordis';
14
- import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
15
- import type { ClientRemote, DirectoryListing } from '@deepseek-ai/dsh-api-remotes/client';
16
- import type { IWorkspaces, WorkspaceId } from '@deepseek-ai/dsh-api-workspace-controller/client';
17
- import type { UiWorkspace } from '@deepseek-ai/dsh-client-ui-workspace/client';
18
- import type { SessionId } from '@deepseek-ai/dsh-session/types';
19
- /** Implements Workspace navigation and directory UI operations. */
20
- export declare class YaWorkspaceNavigation extends Service implements UiWorkspace {
21
- private readonly directoryPicker;
22
- private readonly workspaces;
23
- private readonly sessions;
24
- private readonly connecting;
25
- private readonly lifetime;
26
- /**
27
- * @param ctx - Client root Context.
28
- * @param directoryPicker - the directory-picking Remote namespace.
29
- * @param workspaces - pure Workspace Controller.
30
- * @param sessions - pure Session Controller.
31
- */
32
- constructor(ctx: Context, directoryPicker: ClientRemote['directoryPicker'], workspaces: IWorkspaces, sessions: ISessions);
33
- connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
34
- openSession(sessionId: SessionId): void;
35
- openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void): Promise<void>;
36
- forkSession(sessionId: SessionId): Promise<void>;
37
- startSession(workspaceId?: WorkspaceId): void;
38
- archiveSession(sessionId: SessionId): Promise<void>;
39
- pickDirectory(): Promise<string | null>;
40
- listDirectory(path?: string, signal?: AbortSignal): Promise<DirectoryListing>;
41
- createDirectory(path: string, name: string): Promise<string>;
42
- private watchNavigation;
43
- /** @returns true when an archived current selection was cleared. */
44
- private clearArchivedCurrent;
45
- }
1
+ /**
2
+ * Stand-in for the `uiWorkspace` navigation service owned by the official
3
+ * ui-workspace client entry, which this bundle's patch disables.
4
+ *
5
+ * Since DSH v0.1.2-alpha.1 the ui-sidebar, ui-conversation, ui-agent-preset,
6
+ * and the composed directory-picker client entries all inject `uiWorkspace`;
7
+ * without a provider their fibers park forever and the whole WebUI boot
8
+ * deadlocks. This port carries the semantics that moved here from the
9
+ * pre-split client runtime: reuse-or-create Workspace connection, the
10
+ * explicit/current/recent New Session fallback, archived-current clearing,
11
+ * boot auto-selection, and the directory-picking wire calls.
12
+ */
13
+ import { Service, type Context } from '@deepseek-ai/cordis';
14
+ import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
15
+ import type { ClientRemote, DirectoryListing } from '@deepseek-ai/dsh-api-remotes/client';
16
+ import type { IWorkspaces, WorkspaceId } from '@deepseek-ai/dsh-api-workspace-controller/client';
17
+ import type { UiWorkspace } from '@deepseek-ai/dsh-client-ui-workspace/client';
18
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
19
+ /** Implements Workspace navigation and directory UI operations. */
20
+ export declare class YaWorkspaceNavigation extends Service implements UiWorkspace {
21
+ private readonly directoryPicker;
22
+ private readonly workspaces;
23
+ private readonly sessions;
24
+ private readonly connecting;
25
+ private readonly lifetime;
26
+ /**
27
+ * @param ctx - Client root Context.
28
+ * @param directoryPicker - the directory-picking Remote namespace.
29
+ * @param workspaces - pure Workspace Controller.
30
+ * @param sessions - pure Session Controller.
31
+ */
32
+ constructor(ctx: Context, directoryPicker: ClientRemote['directoryPicker'], workspaces: IWorkspaces, sessions: ISessions);
33
+ connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
34
+ openSession(sessionId: SessionId): void;
35
+ openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void): Promise<void>;
36
+ forkSession(sessionId: SessionId): Promise<void>;
37
+ startSession(workspaceId?: WorkspaceId): void;
38
+ archiveSession(sessionId: SessionId): Promise<void>;
39
+ pickDirectory(): Promise<string | null>;
40
+ listDirectory(path?: string, signal?: AbortSignal): Promise<DirectoryListing>;
41
+ createDirectory(path: string, name: string): Promise<string>;
42
+ private watchNavigation;
43
+ /** @returns true when an archived current selection was cleared. */
44
+ private clearArchivedCurrent;
45
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Browser-local pinned/unread session flags for the sidebar rows.
3
+ *
4
+ * Pinned order is an array (index 0 renders first); unread is a set. Both
5
+ * persist to localStorage like the action-mode preference: per-browser by
6
+ * design, never synced, never sent to the Host. Storage failures fall back
7
+ * to the in-memory value driving the current page.
8
+ */
9
+ import { SessionId } from '@deepseek-ai/dsh-session/types';
10
+ /** Current pinned order (newest pin first). */
11
+ export declare function getPinnedOrder(): readonly SessionId[];
12
+ /** Whether one session is pinned. */
13
+ export declare function isPinned(id: SessionId): boolean;
14
+ /** Pin one session to the front, or unpin it when already pinned. */
15
+ export declare function togglePinned(id: SessionId): void;
16
+ /** Subscribe to pinned changes; returns an unsubscribe disposer. */
17
+ export declare function subscribePinned(listener: () => void): () => void;
18
+ /** Current unread set snapshot. */
19
+ export declare function getUnread(): ReadonlySet<SessionId>;
20
+ /** Whether one session is marked unread. */
21
+ export declare function isUnread(id: SessionId): boolean;
22
+ /** Mark one session unread (idempotent). */
23
+ export declare function markUnread(id: SessionId): void;
24
+ /** Clear one session's unread mark (no-op, no notification, when already read). */
25
+ export declare function markRead(id: SessionId): void;
26
+ /** Subscribe to unread changes; returns an unsubscribe disposer. */
27
+ export declare function subscribeUnread(listener: () => void): () => void;
28
+ /** Test-only: drop in-memory state and reload from storage. */
29
+ export declare function __resetSessionFlagsForTest(): void;
@@ -1,37 +1,37 @@
1
- /**
2
- * Browser-local preference controlling whether the session row's destructive
3
- * action presents as Archive (default) or Delete. Delete mode renders the
4
- * row action red with a trash icon and gates the call behind a confirmation
5
- * modal; the underlying Host verb remains `archiveSession` (the only
6
- * session-level destructive API exposed by `ctx.workspaces`), which hides
7
- * the session from grouping surfaces while preserving its log.
8
- *
9
- * The preference is persisted to `localStorage` so it survives reloads and
10
- * remounts without host-side plumbing. Cross-device sync is intentionally
11
- * out of scope: this is a per-browser UX preference, not a deployment knob.
12
- */
13
- /** How the session row's destructive action presents and behaves. */
14
- export type SessionActionMode = 'archive' | 'delete';
15
- /** Current action mode snapshot. */
16
- export declare function getActionMode(): SessionActionMode;
17
- /** Switch the action mode and notify subscribers. */
18
- export declare function setActionMode(mode: SessionActionMode): void;
19
- /** Subscribe to action mode changes; returns an unsubscribe disposer. */
20
- export declare function subscribeActionMode(listener: () => void): () => void;
21
- /**
22
- * Browser-local height (px) of the recent-sessions virtual viewport, set by
23
- * dragging the separator between the recent block and the workspace browser
24
- * (or nudging it with arrow keys). `undefined` means "never adjusted" and the
25
- * stylesheet default (`min(280px, 40vh)`) applies. Persisted to
26
- * `localStorage` like the action mode; per-browser by design.
27
- */
28
- /** Lower bound of the recent-sessions viewport (about two rows). */
29
- export declare const RECENT_MIN_HEIGHT = 70;
30
- /** Absolute cap as a sanity net; the live drag clamps against free space. */
31
- export declare const RECENT_MAX_HEIGHT = 640;
32
- /** Current recent-sessions viewport height preference, if the user set one. */
33
- export declare function getRecentViewportHeight(): number | undefined;
34
- /** Store (or clear with `undefined`) the height preference and notify subscribers. */
35
- export declare function setRecentViewportHeight(height: number | undefined): void;
36
- /** Subscribe to recent height changes; returns an unsubscribe disposer. */
37
- export declare function subscribeRecentViewportHeight(listener: () => void): () => void;
1
+ /**
2
+ * Browser-local preference controlling whether the session row's destructive
3
+ * action presents as Archive (default) or Delete. Delete mode renders the
4
+ * row action red with a trash icon and gates the call behind a confirmation
5
+ * modal; the underlying Host verb remains `archiveSession` (the only
6
+ * session-level destructive API exposed by `ctx.workspaces`), which hides
7
+ * the session from grouping surfaces while preserving its log.
8
+ *
9
+ * The preference is persisted to `localStorage` so it survives reloads and
10
+ * remounts without host-side plumbing. Cross-device sync is intentionally
11
+ * out of scope: this is a per-browser UX preference, not a deployment knob.
12
+ */
13
+ /** How the session row's destructive action presents and behaves. */
14
+ export type SessionActionMode = 'archive' | 'delete';
15
+ /** Current action mode snapshot. */
16
+ export declare function getActionMode(): SessionActionMode;
17
+ /** Switch the action mode and notify subscribers. */
18
+ export declare function setActionMode(mode: SessionActionMode): void;
19
+ /** Subscribe to action mode changes; returns an unsubscribe disposer. */
20
+ export declare function subscribeActionMode(listener: () => void): () => void;
21
+ /**
22
+ * Browser-local height (px) of the recent-sessions virtual viewport, set by
23
+ * dragging the separator between the recent block and the workspace browser
24
+ * (or nudging it with arrow keys). `undefined` means "never adjusted" and the
25
+ * stylesheet default (`min(280px, 40vh)`) applies. Persisted to
26
+ * `localStorage` like the action mode; per-browser by design.
27
+ */
28
+ /** Lower bound of the recent-sessions viewport (about two rows). */
29
+ export declare const RECENT_MIN_HEIGHT = 70;
30
+ /** Absolute cap as a sanity net; the live drag clamps against free space. */
31
+ export declare const RECENT_MAX_HEIGHT = 640;
32
+ /** Current recent-sessions viewport height preference, if the user set one. */
33
+ export declare function getRecentViewportHeight(): number | undefined;
34
+ /** Store (or clear with `undefined`) the height preference and notify subscribers. */
35
+ export declare function setRecentViewportHeight(height: number | undefined): void;
36
+ /** Subscribe to recent height changes; returns an unsubscribe disposer. */
37
+ export declare function subscribeRecentViewportHeight(listener: () => void): () => void;