@deepseek-ai/dsh-client-ui-workspace 0.2.1-alpha.2 → 0.2.1-alpha.3
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.i18n.yaml +10 -10
- package/README.md +15 -9
- package/README.zh.md +15 -9
- package/lib/client.js +420 -176
- package/lib/types/client/contract/slots.d.ts +29 -17
- package/lib/types/client/contract/toast.d.ts +67 -0
- package/lib/types/client/index.d.ts +4 -1
- package/lib/types/client/locales.d.ts +6 -0
- package/lib/types/client/navigation.d.ts +35 -10
- package/lib/types/client/rows/WorkspaceBrowser.d.ts +1 -1
- package/lib/types/client/session-actions/ForkSession.d.ts +5 -4
- package/lib/types/client/session-actions/RowActionToast.d.ts +5 -4
- package/lib/types/client/session-actions/SessionId.d.ts +8 -0
- package/lib/types/client/shortcuts.d.ts +2 -7
- package/lib/types/client/toast/Toast.d.ts +21 -0
- package/lib/types/client/toast/register.d.ts +10 -0
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +33 -29
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
* row of a Session's "..." menu is an entry of
|
|
27
27
|
* `sidebar.workspaces.session.menu.item`, and every hover button at the row's
|
|
28
28
|
* end is an entry of `sidebar.workspaces.session.row.action`. The shipped
|
|
29
|
-
* actions — pin, rename, fork, archive — are ordinary entries
|
|
30
|
-
*
|
|
29
|
+
* actions — pin, rename, fork, archive, copy ID — are ordinary entries
|
|
30
|
+
* registered from `apply`, each carrying its own behavior in its own inject
|
|
31
31
|
* face and reading its own Host state through hooks that face injects, so a
|
|
32
32
|
* client plugin's action lands beside them by `order` and needs nothing from
|
|
33
33
|
* the browser beyond the row identity.
|
|
@@ -137,8 +137,8 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
137
137
|
/**
|
|
138
138
|
* The rows of one Session's "..." menu, in ascending `order`. ui-workspace
|
|
139
139
|
* registers the shipped rows here — `pin` (100), `rename` (200), `fork`
|
|
140
|
-
* (300), `archive` (400) — so a plugin row is placed
|
|
141
|
-
* among them. Use a package-namespaced `id`; reusing a shipped id at
|
|
140
|
+
* (300), `archive` (400), and `session-id` (450) — so a plugin row is placed
|
|
141
|
+
* by its own `order` among them. Use a package-namespaced `id`; reusing a shipped id at
|
|
142
142
|
* another `priority` shadows that row. Each entry renders one
|
|
143
143
|
* `role="menuitem"` `<button>` (the shipped rows use ui-primitives'
|
|
144
144
|
* `MenuItemButton`, which adds the host styling and `separatorBefore`),
|
|
@@ -150,14 +150,17 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
150
150
|
* return {
|
|
151
151
|
* inject: ['slots'],
|
|
152
152
|
* apply(ctx) {
|
|
153
|
-
* const copyLabel = 'Copy
|
|
153
|
+
* const copyLabel = 'Copy session title' // Localize in the contributing package.
|
|
154
154
|
* ctx.slots.inject('sidebar.workspaces.session.menu.item', () => ctx.slots.register(
|
|
155
|
-
* { name: 'sidebar.workspaces.session.menu.item', id: 'copy-session-
|
|
156
|
-
* ({
|
|
155
|
+
* { name: 'sidebar.workspaces.session.menu.item', id: 'copy-session-title', order: 500 },
|
|
156
|
+
* ({ displayTitle, useMenuOpenState }) => {
|
|
157
157
|
* const [, setMenuOpen] = useMenuOpenState()
|
|
158
158
|
* return React.createElement(
|
|
159
159
|
* 'button',
|
|
160
|
-
* {
|
|
160
|
+
* {
|
|
161
|
+
* type: 'button', role: 'menuitem',
|
|
162
|
+
* onClick: () => { setMenuOpen(false); void navigator.clipboard.writeText(displayTitle) },
|
|
163
|
+
* },
|
|
161
164
|
* copyLabel,
|
|
162
165
|
* )
|
|
163
166
|
* },
|
|
@@ -234,8 +237,6 @@ export type WorkspaceBrowserInjected = {
|
|
|
234
237
|
closeAddWorkspace: () => void;
|
|
235
238
|
/** Publish directory interaction occupancy for command availability. */
|
|
236
239
|
setDirectoryBusy: (busy: boolean) => void;
|
|
237
|
-
/** Dismiss the shortcut's fork-failure notification. */
|
|
238
|
-
dismissForkError: () => void;
|
|
239
240
|
/**
|
|
240
241
|
* Create a fresh Session, or preserve a reusable blank with explicit draft options.
|
|
241
242
|
* Without an explicit Workspace, inherit the current Session Workspace,
|
|
@@ -287,6 +288,10 @@ export type RowToast = {
|
|
|
287
288
|
} | {
|
|
288
289
|
kind: 'stoppedAndArchived';
|
|
289
290
|
sessionId: SessionId;
|
|
291
|
+
} | {
|
|
292
|
+
kind: 'sessionIdCopied';
|
|
293
|
+
} | {
|
|
294
|
+
kind: 'sessionIdCopyFailed';
|
|
290
295
|
} | {
|
|
291
296
|
kind: 'pinFailed';
|
|
292
297
|
} | {
|
|
@@ -298,6 +303,9 @@ export type RowToast = {
|
|
|
298
303
|
} | {
|
|
299
304
|
kind: 'forkRequiresOpen';
|
|
300
305
|
sessionId: SessionId;
|
|
306
|
+
} | {
|
|
307
|
+
kind: 'shortcutForkFailed';
|
|
308
|
+
reason: 'unavailable' | 'failed';
|
|
301
309
|
}
|
|
302
310
|
/**
|
|
303
311
|
* An explicit New Session request that failed. `message` is untranslated:
|
|
@@ -392,6 +400,11 @@ export interface RenameSessionInjected {
|
|
|
392
400
|
/** Ask for the rename dialog, seeded with the row's current title. */
|
|
393
401
|
requestSessionRename: (sessionId: SessionId, currentTitle: string) => void;
|
|
394
402
|
}
|
|
403
|
+
/** Session ID action share; copying does not open the Session. */
|
|
404
|
+
export interface SessionIdInjected {
|
|
405
|
+
/** Copy the complete id and report acceptance or failure through the global toast. */
|
|
406
|
+
copySessionId: (sessionId: SessionId) => Promise<void>;
|
|
407
|
+
}
|
|
395
408
|
/** A Session rename the rename action asked for; the dialog entry opens on it. */
|
|
396
409
|
export interface SessionRenameTarget {
|
|
397
410
|
/** Session to rename. */
|
|
@@ -410,7 +423,7 @@ export interface SessionRenameDialogInjected {
|
|
|
410
423
|
/** Rename a Session (explicit user title; resolves on host acceptance). */
|
|
411
424
|
renameSession: (sessionId: SessionId, title: string) => Promise<void>;
|
|
412
425
|
}
|
|
413
|
-
/**
|
|
426
|
+
/** Existing overlay share: the current notice and its dismissal. */
|
|
414
427
|
export interface RowToastInjected {
|
|
415
428
|
hooks: {
|
|
416
429
|
/** The notice on display, or none. */
|
|
@@ -418,6 +431,9 @@ export interface RowToastInjected {
|
|
|
418
431
|
};
|
|
419
432
|
/** Take the notice down. */
|
|
420
433
|
dismissToast: () => void;
|
|
434
|
+
}
|
|
435
|
+
/** Business callbacks injected into their keyed Toast presentations. */
|
|
436
|
+
export interface RowToastActions {
|
|
421
437
|
/** Undo an archive from its notice. */
|
|
422
438
|
undoArchive: (sessionId: SessionId) => void;
|
|
423
439
|
/** Switch the archived filter to "show" so the archived row is back in view. */
|
|
@@ -429,12 +445,8 @@ export interface RowToastInjected {
|
|
|
429
445
|
export type SessionRenameDialogProps = PropsRuntime<'shell.overlay'> & PropsLocale<'workspace'> & Omit<SessionRenameDialogInjected, 'hooks'> & PropsHooks<SessionRenameDialogInjected['hooks']>;
|
|
430
446
|
/** Props of the stop-and-archive dialog entry in `shell.overlay`. */
|
|
431
447
|
export type SessionArchiveConfirmProps = PropsRuntime<'shell.overlay'> & PropsLocale<'workspace'> & Omit<SessionArchiveConfirmInjected, 'hooks'> & PropsHooks<SessionArchiveConfirmInjected['hooks']>;
|
|
432
|
-
/**
|
|
433
|
-
|
|
434
|
-
* carries the archived filter; the archived notice omits its filter action
|
|
435
|
-
* when archived rows are already visible.
|
|
436
|
-
*/
|
|
437
|
-
export type RowToastProps = PropsRuntime<'shell.overlay'> & PropsLocale<'workspace'> & PropsStore<WorkspaceViewStoreHandle> & Omit<RowToastInjected, 'hooks'> & PropsHooks<RowToastInjected['hooks']>;
|
|
448
|
+
/** Props of the existing overlay's keyed notice dispatcher. */
|
|
449
|
+
export type RowToastProps = PropsRuntime<'shell.overlay'> & PropsRenderSlots<'workspace.toast'> & Pick<RowToastInjected, 'dismissToast'> & PropsHooks<RowToastInjected['hooks']>;
|
|
438
450
|
/** Full browser props: shell owner share + viewing store + injected actions + the locale seat. */
|
|
439
451
|
export type WorkspaceBrowserProps = PropsRuntime<'sidebar.workspaces'> & PropsRenderSlots<'sidebar.workspaces.directoryFlow' | 'sidebar.workspaces.session.menu.item' | 'sidebar.workspaces.session.row.action' | 'sidebar.session.row.leading' | 'sidebar.session.row.hover'> & PropsStore<WorkspaceViewStoreHandle> & Omit<WorkspaceBrowserInjected, 'hooks'> & PropsHooks<WorkspaceBrowserInjected['hooks']> & PropsLocale<'workspace'>;
|
|
440
452
|
/**
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** Keyed Workspace notices and the shared Toast Factory's display data. */
|
|
2
|
+
import type { FactoryComponentPropsOf, InjectFace, PropsLocale, PropsRenderFactories, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
|
+
import type { RowToastState, WorkspaceViewStoreHandle } from './slots.ts';
|
|
4
|
+
/** Business key of one existing Workspace notice. */
|
|
5
|
+
export type ToastKind = RowToastState['kind'];
|
|
6
|
+
/** Notice payload selected by the keyed registration. */
|
|
7
|
+
export type ToastNotice<K extends ToastKind> = Extract<RowToastState, {
|
|
8
|
+
kind: K;
|
|
9
|
+
}>;
|
|
10
|
+
/** Plain display fields consumed by the shared Factory. */
|
|
11
|
+
export interface ToastDisplay {
|
|
12
|
+
text: string;
|
|
13
|
+
tone: 'plain' | 'warning' | 'success';
|
|
14
|
+
holdMs?: number;
|
|
15
|
+
actions?: readonly {
|
|
16
|
+
label: string;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
onClick: () => void;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
/** Per-display identity and dismissal; neither changes when localized content updates. */
|
|
22
|
+
export interface ToastOccurrence extends ToastDisplay {
|
|
23
|
+
seq: number;
|
|
24
|
+
onDone: () => void;
|
|
25
|
+
}
|
|
26
|
+
/** Pure localized display mapping owned by a keyed notice registration. */
|
|
27
|
+
export interface ToastDisplayInjected<K extends ToastKind> {
|
|
28
|
+
display: (notice: ToastNotice<K>, t: PropsLocale<'workspace'>['t'], dismiss: () => void) => ToastDisplay;
|
|
29
|
+
}
|
|
30
|
+
/** Shared adapter props; each registration narrows its notice payload. */
|
|
31
|
+
export type ToastEntryProps<P extends PropsRuntime<'workspace.toast'>> = P & PropsLocale<'workspace'> & PropsRenderFactories & InjectFace<{
|
|
32
|
+
display: (notice: P, t: PropsLocale<'workspace'>['t'], dismiss: () => void) => ToastDisplay;
|
|
33
|
+
}>;
|
|
34
|
+
/** Archive adapters additionally read the existing viewing store. */
|
|
35
|
+
export interface ArchiveToastInjected extends ToastDisplayInjected<'archived' | 'stoppedAndArchived'> {
|
|
36
|
+
filterAction: (t: PropsLocale<'workspace'>['t'], dismiss: () => void) => NonNullable<ToastDisplay['actions']>[number];
|
|
37
|
+
}
|
|
38
|
+
/** Archive adapter props with its injected action and viewing-state seats. */
|
|
39
|
+
export type ArchiveToastEntryProps = PropsRuntime<'workspace.toast', 'archived' | 'stoppedAndArchived'> & PropsLocale<'workspace'> & PropsRenderFactories & PropsStore<WorkspaceViewStoreHandle> & InjectFace<ArchiveToastInjected>;
|
|
40
|
+
/** Complete props of the shared Workspace Toast Factory. */
|
|
41
|
+
export type WorkspaceToastProps = FactoryComponentPropsOf<'workspace.toast.content'>;
|
|
42
|
+
/** Owner operations available to every keyed Workspace notice. */
|
|
43
|
+
export interface WorkspaceToastOwnerProps {
|
|
44
|
+
/** Dismiss the displayed notice. */
|
|
45
|
+
dismissToast: () => void;
|
|
46
|
+
}
|
|
47
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
48
|
+
interface SlotMap {
|
|
49
|
+
/** Workspace notices selected by their existing business discriminator. */
|
|
50
|
+
'workspace.toast': {
|
|
51
|
+
kind: 'keyed';
|
|
52
|
+
scope: 'root';
|
|
53
|
+
owner: WorkspaceToastOwnerProps;
|
|
54
|
+
keyProps: {
|
|
55
|
+
[K in ToastKind]: ToastNotice<K>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
interface SlotFactoryMap {
|
|
60
|
+
/** Shared Toast presentation; business registrations supply only display data and callbacks. */
|
|
61
|
+
'workspace.toast.content': {
|
|
62
|
+
scope: 'root';
|
|
63
|
+
props: ToastOccurrence;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type { WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client';
|
|
2
|
+
import type { WorkspaceId, WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client';
|
|
3
|
+
import type { RemoteEndpoint } from '@deepseek-ai/dsh-api-remote-access/client';
|
|
3
4
|
import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
5
|
import { type WorkspaceKey } from './locales.ts';
|
|
5
6
|
export type { StartSessionOptions, UiWorkspace } from './navigation.ts';
|
|
@@ -9,6 +10,8 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
9
10
|
interface GlobalStandardProps {
|
|
10
11
|
/** Selector hook over the pure Workspace Controller snapshot. */
|
|
11
12
|
useWorkspaces: SnapshotSelectorHook<WorkspaceSnapshot>;
|
|
13
|
+
/** Whether the current Peer may call `action` on one Workspace resource. */
|
|
14
|
+
useWorkspaceAccess: (workspaceId: WorkspaceId, action: RemoteEndpoint) => boolean;
|
|
12
15
|
}
|
|
13
16
|
interface LocaleNamespaceMap {
|
|
14
17
|
/** The workspace browsing region and pick/create flow copy. */
|
|
@@ -62,6 +62,9 @@ export declare const zh: {
|
|
|
62
62
|
'menu.unarchiveSession': string;
|
|
63
63
|
'menu.pinSession': string;
|
|
64
64
|
'menu.unpinSession': string;
|
|
65
|
+
'menu.sessionId': string;
|
|
66
|
+
'toast.sessionIdCopied': string;
|
|
67
|
+
'toast.sessionIdCopyFailed': string;
|
|
65
68
|
'row.archived': string;
|
|
66
69
|
'row.pinned': string;
|
|
67
70
|
'toast.archivedNotOpenable': string;
|
|
@@ -183,6 +186,9 @@ export declare const en: {
|
|
|
183
186
|
'menu.unarchiveSession': string;
|
|
184
187
|
'menu.pinSession': string;
|
|
185
188
|
'menu.unpinSession': string;
|
|
189
|
+
'menu.sessionId': string;
|
|
190
|
+
'toast.sessionIdCopied': string;
|
|
191
|
+
'toast.sessionIdCopyFailed': string;
|
|
186
192
|
'row.archived': string;
|
|
187
193
|
'row.pinned': string;
|
|
188
194
|
'toast.archivedNotOpenable': string;
|
|
@@ -7,8 +7,11 @@ import type { SessionId } from '@deepseek-ai/dsh-session/types';
|
|
|
7
7
|
import type { DraftInitializationOptions } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
8
8
|
import type { RowToast } from './contract/slots.ts';
|
|
9
9
|
import type { WorkspaceViewStoreActions } from './stores.ts';
|
|
10
|
-
/**
|
|
11
|
-
export
|
|
10
|
+
/** Content preparation and Agent preset for the Session a Workspace flow opens. */
|
|
11
|
+
export interface StartSessionOptions extends DraftInitializationOptions {
|
|
12
|
+
/** Agent preset the Session runs; the Host default when omitted. */
|
|
13
|
+
readonly agentPreset?: string;
|
|
14
|
+
}
|
|
12
15
|
/** Workspace archive and directory operations consumed by Client UI domains. */
|
|
13
16
|
export interface UiWorkspace {
|
|
14
17
|
/**
|
|
@@ -21,11 +24,12 @@ export interface UiWorkspace {
|
|
|
21
24
|
* @param workspaceId - target Workspace.
|
|
22
25
|
* @param beforeOpen - optional synchronous preparation for the selected Session,
|
|
23
26
|
* skipped after supersession; a throw aborts the open and releases the retained reference.
|
|
27
|
+
* @param options - choices for the Session the connection creates or reuses.
|
|
24
28
|
* @returns completion; a superseded request may create a Session but does not open it.
|
|
25
29
|
* @throws on failure; a refused creation is also shown through the Workspace
|
|
26
30
|
* notice unless a later navigation or disposal superseded the request.
|
|
27
31
|
*/
|
|
28
|
-
openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void): Promise<void>;
|
|
32
|
+
openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void, options?: Pick<StartSessionOptions, 'agentPreset'>): Promise<void>;
|
|
29
33
|
/**
|
|
30
34
|
* Fork a Session without changing the current selection.
|
|
31
35
|
* @param sessionId - source Session.
|
|
@@ -35,16 +39,20 @@ export interface UiWorkspace {
|
|
|
35
39
|
*/
|
|
36
40
|
forkSession(sessionId: SessionId, onCreated?: (childId: SessionId) => void, options?: Pick<Parameters<ISessions['fork']>[0], 'allowMigration'>): Promise<SessionId>;
|
|
37
41
|
/**
|
|
38
|
-
* Resolve the
|
|
42
|
+
* Resolve the Session for a new conversation in a Workspace: the Host reuses
|
|
43
|
+
* the first listed blank member while it is reusable and otherwise creates one,
|
|
44
|
+
* under the requested preset or the Host default.
|
|
39
45
|
* @param workspaceId - target Workspace.
|
|
46
|
+
* @param options - choices for the created or reused Session.
|
|
40
47
|
* @returns a Session already addressable through the Session Controller.
|
|
41
48
|
*/
|
|
42
|
-
connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
|
|
49
|
+
connectWorkspace(workspaceId: WorkspaceId, options?: Pick<StartSessionOptions, 'agentPreset'>): Promise<SessionId>;
|
|
43
50
|
/**
|
|
44
51
|
* Create a fresh Session, or reuse a blank when preparing an explicit draft. A creation the Host
|
|
45
52
|
* refuses is shown through the Workspace notice and leaves the selection as it was.
|
|
46
53
|
* @param workspaceId - explicit target; absent inherits the current or most recent Workspace.
|
|
47
|
-
* @param options - initial content; existing text or attachments
|
|
54
|
+
* @param options - initial content and the reused blank's preset; existing text or attachments
|
|
55
|
+
* are preserved unless clearPreviousDraft is true.
|
|
48
56
|
*/
|
|
49
57
|
startSession(workspaceId?: WorkspaceId, options?: StartSessionOptions): void;
|
|
50
58
|
/**
|
|
@@ -113,6 +121,7 @@ declare class UiWorkspaceService extends Service implements UiWorkspace {
|
|
|
113
121
|
private readonly sessions;
|
|
114
122
|
private readonly view;
|
|
115
123
|
private readonly notify;
|
|
124
|
+
/** The latest in-flight connection per Workspace; a request joins it only when both name the same preset. */
|
|
116
125
|
private readonly connecting;
|
|
117
126
|
private readonly lifetime;
|
|
118
127
|
private readonly selection;
|
|
@@ -126,12 +135,28 @@ declare class UiWorkspaceService extends Service implements UiWorkspace {
|
|
|
126
135
|
* @param notify - show one notice through the Workspace notice channel.
|
|
127
136
|
*/
|
|
128
137
|
constructor(ctx: Context, directoryPicker: ClientRemote['directoryPicker'], workspaces: IWorkspaces, sessions: ISessions, view: Pick<WorkspaceViewStoreActions, 'pinSessionOrder'>, notify: (toast: RowToast) => void);
|
|
129
|
-
connectWorkspace(workspaceId: WorkspaceId): Promise<SessionId>;
|
|
138
|
+
connectWorkspace(workspaceId: WorkspaceId, options?: Pick<StartSessionOptions, 'agentPreset'>): Promise<SessionId>;
|
|
139
|
+
/**
|
|
140
|
+
* @param reuse - preset for the reused or created blank; absent creates a fresh Session.
|
|
141
|
+
*/
|
|
130
142
|
private connectBlank;
|
|
131
|
-
private
|
|
132
|
-
|
|
143
|
+
private createInWorkspace;
|
|
144
|
+
/**
|
|
145
|
+
* Create through the Host. A named blank the Host declined may still read as
|
|
146
|
+
* blank from stale cached list metadata, which hides it from the Session tree;
|
|
147
|
+
* its projections are reloaded so the row reflects its log.
|
|
148
|
+
*/
|
|
149
|
+
private createNamed;
|
|
150
|
+
/**
|
|
151
|
+
* Reopen a saved blank Session under the preset its log recorded, or under
|
|
152
|
+
* the Host default once that preset no longer activates. Listed values are
|
|
153
|
+
* cached hints that can lag the log after an unclean Host exit, so the
|
|
154
|
+
* Session's projections are reloaded before the preset is read; a Session
|
|
155
|
+
* that still awaits a format migration reloads only those cached hints.
|
|
156
|
+
*/
|
|
157
|
+
private restoreBlank;
|
|
133
158
|
openSession(target: SessionTarget): void;
|
|
134
|
-
openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void): Promise<void>;
|
|
159
|
+
openWorkspace(workspaceId: WorkspaceId, beforeOpen?: (sessionId: SessionId) => void, options?: Pick<StartSessionOptions, 'agentPreset'>): Promise<void>;
|
|
135
160
|
private openWorkspaceSession;
|
|
136
161
|
forkSession(sessionId: SessionId, onCreated?: (childId: SessionId) => void, options?: Pick<Parameters<ISessions['fork']>[0], 'allowMigration'>): Promise<SessionId>;
|
|
137
162
|
startSession(workspaceId?: WorkspaceId, options?: StartSessionOptions): void;
|
|
@@ -4,5 +4,5 @@ import type { WorkspaceBrowserProps } from '../contract/slots.ts';
|
|
|
4
4
|
* @param props - composed slot props (shell owner share + store + injected actions).
|
|
5
5
|
* @returns the region element tree.
|
|
6
6
|
*/
|
|
7
|
-
export declare function WorkspaceBrowser({ wide, usePanelInfo, expandSidebar, useSessions, useSessionStatus, useWorkspaces, useStore, actions, startSession, open, requestSessionRename, notifyArchivedNotOpenable, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, unarchiveSession, createWorkspace, searchSessions, searchResultLimit, useDirectoryFlow, useHostInfo, useShortcuts, useWorkspaceShortcuts, requestSearch, requestAddWorkspace, closeAddWorkspace, setDirectoryBusy,
|
|
7
|
+
export declare function WorkspaceBrowser({ wide, usePanelInfo, expandSidebar, useSessions, useSessionStatus, useWorkspaces, useStore, actions, startSession, open, requestSessionRename, notifyArchivedNotOpenable, renameWorkspace, deleteWorkspace, insertWorkspaceBefore, unarchiveSession, createWorkspace, searchSessions, searchResultLimit, useDirectoryFlow, useHostInfo, useShortcuts, useWorkspaceShortcuts, requestSearch, requestAddWorkspace, closeAddWorkspace, setDirectoryBusy, renderSlot, t, }: WorkspaceBrowserProps): import("react").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=WorkspaceBrowser.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ForkSessionInjected, SessionMenuItemProps } from '../contract/slots.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Menu row (order 300): fork at the Session's last completed turn; the child
|
|
4
|
-
* arrives through the Host list beside its source.
|
|
5
|
-
*
|
|
6
|
-
* @
|
|
4
|
+
* arrives through the Host list beside its source. Absent when the access
|
|
5
|
+
* snapshot excludes `session/fork` for this Session.
|
|
6
|
+
* @param props - owner share, menu open state, access Hook, and the fork share.
|
|
7
|
+
* @returns the row, or nothing when the caller may not fork this Session.
|
|
7
8
|
*/
|
|
8
|
-
export declare function ForkSessionMenuItem({ sessionId, useMenuOpenState, useShortcuts, forkSession, t, }: SessionMenuItemProps<ForkSessionInjected>): import("react").JSX.Element;
|
|
9
|
+
export declare function ForkSessionMenuItem({ sessionId, useMenuOpenState, useShortcuts, useSessionAccess, forkSession, t, }: SessionMenuItemProps<ForkSessionInjected>): import("react").JSX.Element | null;
|
|
9
10
|
//# sourceMappingURL=ForkSession.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/** The existing overlay dispatches the latest Workspace notice to its keyed presentation. */
|
|
1
2
|
import type { RowToastProps } from '../contract/slots.ts';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param props - notice
|
|
5
|
-
* @returns
|
|
4
|
+
* Dispatch the current notice without interpreting its business payload.
|
|
5
|
+
* @param props - Current notice, dismissal, and the declared keyed renderer.
|
|
6
|
+
* @returns The selected notice presentation, or nothing.
|
|
6
7
|
*/
|
|
7
|
-
export declare function RowActionToast({ useToast,
|
|
8
|
+
export declare function RowActionToast({ useToast, dismissToast, renderSlot }: RowToastProps): import("react").ReactNode;
|
|
8
9
|
//# sourceMappingURL=RowActionToast.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionIdInjected, SessionMenuItemProps } from '../contract/slots.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Copy the complete ID after dismissing the row menu.
|
|
4
|
+
* @param props - Row identity, menu dismissal, clipboard action, and locale.
|
|
5
|
+
* @returns The final built-in menu item.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SessionIdMenuItem({ sessionId, useMenuOpenState, copySessionId, t }: SessionMenuItemProps<SessionIdInjected>): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=SessionId.d.ts.map
|
|
@@ -12,10 +12,6 @@ export interface WorkspaceShortcutState {
|
|
|
12
12
|
readonly sessionId: SessionId;
|
|
13
13
|
readonly currentTitle: string;
|
|
14
14
|
} | null;
|
|
15
|
-
readonly forkError: {
|
|
16
|
-
readonly reason: 'unavailable' | 'failed';
|
|
17
|
-
readonly seq: number;
|
|
18
|
-
} | null;
|
|
19
15
|
}
|
|
20
16
|
interface WorkspaceShortcutControls {
|
|
21
17
|
state: SnapshotStore<WorkspaceShortcutState>;
|
|
@@ -25,8 +21,6 @@ interface WorkspaceShortcutControls {
|
|
|
25
21
|
directoryBusy: (busy: boolean) => void;
|
|
26
22
|
rename: (sessionId: SessionId, currentTitle: string) => void;
|
|
27
23
|
closeRename: () => void;
|
|
28
|
-
forkFailed: (reason: 'unavailable' | 'failed') => void;
|
|
29
|
-
dismissForkError: () => void;
|
|
30
24
|
}
|
|
31
25
|
/**
|
|
32
26
|
* Create the private browser request source shared by commands and controls.
|
|
@@ -40,7 +34,8 @@ export declare function createWorkspaceShortcutControls(): WorkspaceShortcutCont
|
|
|
40
34
|
* @param navigation - session creation and forking from the pointer controls' navigation service.
|
|
41
35
|
* @param controls - browser-owned opening requests.
|
|
42
36
|
* @param archiveSession - shared archive action, including running-work confirmation and notices.
|
|
37
|
+
* @param reportForkFailure - publish a classified failure through the frame-wide notice channel.
|
|
43
38
|
*/
|
|
44
|
-
export declare function installWorkspaceShortcuts(ctx: Context, navigation: Pick<UiWorkspace, 'startSession' | 'forkSession'>, controls: ReturnType<typeof createWorkspaceShortcutControls>, archiveSession: (sessionId: SessionId) => void): void;
|
|
39
|
+
export declare function installWorkspaceShortcuts(ctx: Context, navigation: Pick<UiWorkspace, 'startSession' | 'forkSession'>, controls: ReturnType<typeof createWorkspaceShortcutControls>, archiveSession: (sessionId: SessionId) => void, reportForkFailure: (reason: 'unavailable' | 'failed') => void): void;
|
|
45
40
|
export {};
|
|
46
41
|
//# sourceMappingURL=shortcuts.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
import type { ArchiveToastEntryProps, ToastEntryProps, WorkspaceToastProps } from '../contract/toast.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Render one notice using the shared Factory.
|
|
5
|
+
* @param props - Keyed payload, injected display mapping, locale, and Factory renderer.
|
|
6
|
+
* @returns The shared Toast occurrence.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ToastEntry<P extends PropsRuntime<'workspace.toast'>>(props: ToastEntryProps<P>): import("react").ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Keep the archive filter action reactive without subscribing unrelated notices.
|
|
11
|
+
* @param props - Archive notice, display mapping, and the existing viewing store.
|
|
12
|
+
* @returns The shared Toast occurrence with its current actions.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ArchiveToastEntry(props: ArchiveToastEntryProps): import("react").ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Present plain display data with the shared primitive's timing and portal.
|
|
17
|
+
* @param props - Localized display fields, display identity, and dismissal.
|
|
18
|
+
* @returns One Toast, remounted only for a new display identity.
|
|
19
|
+
*/
|
|
20
|
+
export declare function WorkspaceToast({ seq, text, tone, holdMs, actions, onDone }: WorkspaceToastProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Business-owned mappings into the keyed Workspace Toast slot. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { RowToastActions, WorkspaceViewStoreHandle } from '../contract/slots.ts';
|
|
4
|
+
/** Register notice presentations with their business-owned display fields and actions.
|
|
5
|
+
* @param ctx - Workspace plugin context.
|
|
6
|
+
* @param viewStore - Viewing store, read only by archive notices.
|
|
7
|
+
* @param actions - Archive and source-opening callbacks.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerToasts(ctx: Context, viewStore: WorkspaceViewStoreHandle, actions: Pick<RowToastActions, 'undoArchive' | 'showArchived' | 'openForkSource'>): void;
|
|
10
|
+
//# sourceMappingURL=register.d.ts.map
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-workspace",
|
|
3
3
|
"description": "Workspace picker plugin: one WorkspacePicker registered into the sidebar and empty-state workspace slots",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
"default": "./lib/client.js"
|
|
24
24
|
},
|
|
25
25
|
"./src/*": "./src/*",
|
|
26
|
-
"./package.json": "./package.json"
|
|
26
|
+
"./package.json": "./package.json",
|
|
27
|
+
"./locale/*.json": "./locale/*.json"
|
|
27
28
|
},
|
|
28
29
|
"dsh": {
|
|
29
30
|
"client": {
|
|
30
31
|
"inject": [
|
|
32
|
+
"@deepseek-ai/dsh-api-remote-access",
|
|
31
33
|
"@deepseek-ai/dsh-api-remotes",
|
|
32
34
|
"@deepseek-ai/dsh-api-session-controller",
|
|
33
35
|
"@deepseek-ai/dsh-api-workspace-controller",
|
|
@@ -45,39 +47,41 @@
|
|
|
45
47
|
},
|
|
46
48
|
"license": "MIT",
|
|
47
49
|
"peerDependencies": {
|
|
48
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
50
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
|
-
"@deepseek-ai/
|
|
52
|
-
"@deepseek-ai/
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-client-
|
|
59
|
-
"@deepseek-ai/dsh-client-
|
|
60
|
-
"@deepseek-ai/dsh-client-
|
|
61
|
-
"@deepseek-ai/dsh-client-
|
|
62
|
-
"@deepseek-ai/dsh-client-ui-
|
|
63
|
-
"@deepseek-ai/dsh-client-ui-
|
|
64
|
-
"@deepseek-ai/dsh-client-ui-
|
|
65
|
-
"@deepseek-ai/dsh-client-ui-
|
|
66
|
-
"@deepseek-ai/dsh-client-ui-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
72
|
-
"@deepseek-ai/dsh-
|
|
73
|
-
"@deepseek-ai/dsh-
|
|
74
|
-
"@
|
|
53
|
+
"@deepseek-ai/dsh-api-remote-access": "0.2.1-alpha.3",
|
|
54
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.3",
|
|
56
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.3",
|
|
57
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.1-alpha.3",
|
|
58
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.1-alpha.3",
|
|
59
|
+
"@deepseek-ai/dsh-api-workspace-controller": "0.2.1-alpha.3",
|
|
60
|
+
"@deepseek-ai/dsh-client-connection": "0.2.1-alpha.3",
|
|
61
|
+
"@deepseek-ai/dsh-client-locale": "0.2.1-alpha.3",
|
|
62
|
+
"@deepseek-ai/dsh-client-store": "0.2.1-alpha.3",
|
|
63
|
+
"@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.3",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.3",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.2.1-alpha.3",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.3",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.3",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.1-alpha.3",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.1-alpha.3",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.3",
|
|
71
|
+
"@deepseek-ai/dsh-jobs": "0.2.1-alpha.3",
|
|
72
|
+
"@deepseek-ai/dsh-schedule": "0.2.1-alpha.3",
|
|
73
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.3",
|
|
74
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.3",
|
|
75
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.3",
|
|
76
|
+
"@deepseek-ai/dsh-util-values": "0.2.1-alpha.3",
|
|
77
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.1-alpha.3",
|
|
75
78
|
"clsx": "^2.0.0",
|
|
76
79
|
"react": "^18.2.0",
|
|
77
|
-
"@deepseek-ai/dsh-client-shortcuts": "0.2.1-alpha.
|
|
78
|
-
"@deepseek-ai/dsh-client-product-analytics": "0.2.1-alpha.
|
|
80
|
+
"@deepseek-ai/dsh-client-shortcuts": "0.2.1-alpha.3",
|
|
81
|
+
"@deepseek-ai/dsh-client-product-analytics": "0.2.1-alpha.3"
|
|
79
82
|
},
|
|
80
83
|
"files": [
|
|
84
|
+
"locale/*.json",
|
|
81
85
|
"lib/index.js",
|
|
82
86
|
"lib/client.js",
|
|
83
87
|
"lib/types/**/*.d.ts"
|