@lincyaw/dsh 0.2.0-rc.119 → 0.2.0-rc.120
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/build/dist/client.js +199 -199
- package/build/dist/client.json +8 -0
- package/package.json +7 -7
- package/src/client/RootLayout.tsx +25 -4
- package/src/client/layout.ts +10 -5
- package/src/client/messages.ts +4 -2
- package/src/client/navigation-shell.tsx +1 -1
- package/src/client/workspace-events.ts +1 -1
package/build/dist/client.json
CHANGED
|
@@ -148,6 +148,7 @@
|
|
|
148
148
|
"../design/src/index.ts",
|
|
149
149
|
"../workbench/src/base-controls.tsx",
|
|
150
150
|
"../workbench/src/sortable-list.tsx",
|
|
151
|
+
"../workbench/src/knowledge-components.tsx",
|
|
151
152
|
"../workbench/src/components.tsx",
|
|
152
153
|
"../workbench/src/schema-form/context.ts",
|
|
153
154
|
"../workbench/src/schema-form/fields.tsx",
|
|
@@ -159,7 +160,10 @@
|
|
|
159
160
|
"../workbench/src/media-messages.ts",
|
|
160
161
|
"../workbench/src/media-time.ts",
|
|
161
162
|
"../workbench/src/MediaClipEditor.tsx",
|
|
163
|
+
"../workbench/src/tree-messages.ts",
|
|
162
164
|
"../workbench/src/context.tsx",
|
|
165
|
+
"../workbench/src/panels/WorkspaceSidebar.tsx",
|
|
166
|
+
"../workbench/src/document-tree.ts",
|
|
163
167
|
"../workbench/src/places.ts",
|
|
164
168
|
"../workbench/src/preview.ts",
|
|
165
169
|
"../workbench/src/document-draft-store.ts",
|
|
@@ -186,6 +190,7 @@
|
|
|
186
190
|
"../workbench/src/production-playback.ts",
|
|
187
191
|
"../workbench/src/workbench.ts",
|
|
188
192
|
"../workbench/src/container-layout.ts",
|
|
193
|
+
"../workbench/src/panels/ReferencesPanel.tsx",
|
|
189
194
|
"../workbench/src/outline.ts",
|
|
190
195
|
"../workbench/src/panels/ExportPanel.tsx",
|
|
191
196
|
"../workbench/src/panels/HistoryPanel.tsx",
|
|
@@ -245,6 +250,7 @@
|
|
|
245
250
|
"../workbench/src/panels/ProductionPanel.tsx",
|
|
246
251
|
"../workbench/src/panels/PageRenameDialog.tsx",
|
|
247
252
|
"../workbench/src/panels/PageDeleteDialog.tsx",
|
|
253
|
+
"../workbench/src/document-editor/references.tsx",
|
|
248
254
|
"../workbench/src/document-editor/agent-targets.ts",
|
|
249
255
|
"../workbench/src/document-editor/projection.ts",
|
|
250
256
|
"../workbench/src/document-editor/insertion-place.ts",
|
|
@@ -262,6 +268,7 @@
|
|
|
262
268
|
"../workbench/src/panels/DocumentView.tsx",
|
|
263
269
|
"../workbench/src/import-messages.ts",
|
|
264
270
|
"../workbench/src/panels/DocumentImportDialog.tsx",
|
|
271
|
+
"../workbench/src/panels/WorkspaceHome.tsx",
|
|
265
272
|
"../workbench/src/panels/HomePanel.tsx",
|
|
266
273
|
"../workbench/src/speech-settings-messages.ts",
|
|
267
274
|
"../workbench/src/panels/SpeechSettingsPanel.tsx",
|
|
@@ -311,6 +318,7 @@
|
|
|
311
318
|
"../workbench/src/step-production.css",
|
|
312
319
|
"../workbench/src/component-properties.css",
|
|
313
320
|
"../workbench/src/caption-timing.css",
|
|
321
|
+
"../workbench/src/knowledge.css",
|
|
314
322
|
"../workbench/src/styles.css",
|
|
315
323
|
"src/client/frame.css",
|
|
316
324
|
"src/client/styles.css"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/dsh",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.120",
|
|
4
4
|
"description": "Presmium's bundle for DeepSeek Harness: the workbench of presmium studio, its host side (Presmium's tools, approvals, document context, skills and routes) and its client side (the root layout and the workbench's panels, precompiled) (experimental)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -89,10 +89,10 @@
|
|
|
89
89
|
"node-addon-require-builtin": "0.1.9",
|
|
90
90
|
"ws": "8.22.0",
|
|
91
91
|
"zod": "4.4.3",
|
|
92
|
-
"@lincyaw/
|
|
93
|
-
"@lincyaw/
|
|
94
|
-
"@lincyaw/
|
|
95
|
-
"@lincyaw/skills": "1.0.0-rc.
|
|
92
|
+
"@lincyaw/cli": "1.0.0-rc.121",
|
|
93
|
+
"@lincyaw/mcp": "1.0.0-rc.121",
|
|
94
|
+
"@lincyaw/kernel": "1.0.0-rc.121",
|
|
95
|
+
"@lincyaw/skills": "1.0.0-rc.121"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
98
|
"@deepseek-ai/dsh": "0.2.1-alpha.4"
|
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
"react": "18.3.1",
|
|
109
109
|
"react-dom": "18.3.1",
|
|
110
110
|
"react-resizable-panels": "^4.14.5",
|
|
111
|
-
"@lincyaw/design": "1.0.0-rc.
|
|
112
|
-
"@lincyaw/workbench": "0.2.0-rc.
|
|
111
|
+
"@lincyaw/design": "1.0.0-rc.121",
|
|
112
|
+
"@lincyaw/workbench": "0.2.0-rc.122"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {}
|
|
115
115
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStartupReady } from './startup.ts'
|
|
2
2
|
import { Group, Panel, Separator, usePanelRef } from 'react-resizable-panels'
|
|
3
|
-
import { AgentActivityBar, DocumentView, HomePanel, PmDialog, PmIcon, PmMenu, SHORTCUTS, useWorkbenchState, WorkbenchApprovals, WorkbenchProvider } from '@lincyaw/workbench'
|
|
3
|
+
import { AgentActivityBar, DocumentBreadcrumb, DocumentView, HomePanel, PmDialog, PmDrawer, PmIcon, PmIconButton, PmMenu, SHORTCUTS, useTreeMessages, useWorkbenchState, WorkbenchApprovals, WorkbenchProvider, WorkbenchToast, WorkspaceSidebar } from '@lincyaw/workbench'
|
|
4
4
|
import type { Workbench } from '@lincyaw/workbench'
|
|
5
5
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'
|
|
6
6
|
import type { ReactNode, RefObject } from 'react'
|
|
@@ -148,6 +148,8 @@ function RootLayout({ useStore, useSessions, usePanelInfo, actions, renderSlot,
|
|
|
148
148
|
const frame = useRef<HTMLDivElement>(null)
|
|
149
149
|
const rightbarTrack = useRef<HTMLDivElement>(null)
|
|
150
150
|
const [helpOpen, setHelpOpen] = useState(false)
|
|
151
|
+
const [drawerOpen, setDrawerOpen] = useState(false)
|
|
152
|
+
const tt = useTreeMessages()
|
|
151
153
|
const geometry = solveGeometry(info)
|
|
152
154
|
const { narrow, collapsed } = geometry
|
|
153
155
|
const conversationPanel = usePanelRef()
|
|
@@ -186,6 +188,14 @@ function RootLayout({ useStore, useSessions, usePanelInfo, actions, renderSlot,
|
|
|
186
188
|
const panel = activePanel !== null ? renderSlot('main', {}, { entryKey: activePanel }) : null
|
|
187
189
|
const rightbar = renderSlot('rightbar', { width: rightbarBox?.width ?? geometry.rightbar, viewportWidth: geometry.viewport, canShow: geometry.rightbar > 0 })
|
|
188
190
|
|
|
191
|
+
const showHome = () => {
|
|
192
|
+
actions.selectPanel(null)
|
|
193
|
+
workbench.closeDocument()
|
|
194
|
+
if (narrow) actions.showNarrowPane('documents')
|
|
195
|
+
}
|
|
196
|
+
useEffect(() => { if (!narrow) setDrawerOpen(false) }, [narrow])
|
|
197
|
+
useEffect(() => { void workbench.tree.load() }, [workbench])
|
|
198
|
+
|
|
189
199
|
const pane: NarrowPane = narrow ? info.narrowPane : 'documents'
|
|
190
200
|
const documentShown = panel === null && document_ !== undefined && (!narrow || pane === 'preview')
|
|
191
201
|
const centre = <>
|
|
@@ -206,7 +216,11 @@ function RootLayout({ useStore, useSessions, usePanelInfo, actions, renderSlot,
|
|
|
206
216
|
data-rightbar-fullscreen={info.isRightbarFullscreen || undefined}
|
|
207
217
|
>
|
|
208
218
|
<a className="pmw-frame__skip" href="#pmw-centre">{t.skip}</a>
|
|
209
|
-
<AppBar workbench={workbench} info={info} actions={actions} activePanel={activePanel} globalPanels={globalPanels} pane={pane} narrow={narrow} openSettings={openSettings} openHelp={() => setHelpOpen(true)} />
|
|
219
|
+
<AppBar workbench={workbench} info={info} actions={actions} activePanel={activePanel} globalPanels={globalPanels} pane={pane} narrow={narrow} openSettings={openSettings} openHelp={() => setHelpOpen(true)} openDrawer={() => setDrawerOpen(true)} />
|
|
220
|
+
<PmDrawer open={narrow && drawerOpen} label={tt.tree} size="sidebar" onClose={() => setDrawerOpen(false)}>
|
|
221
|
+
<WorkspaceSidebar onHome={showHome} onNavigate={() => setDrawerOpen(false)} closeLabel={tt.closeSidebar} onClose={() => setDrawerOpen(false)} />
|
|
222
|
+
</PmDrawer>
|
|
223
|
+
<WorkbenchToast />
|
|
210
224
|
|
|
211
225
|
<RuntimeDiagnosticsNotice workbench={workbench} />
|
|
212
226
|
<Group className="pmw-frame__panels" disabled={narrow} onLayoutChanged={(layout, meta) => {
|
|
@@ -222,7 +236,10 @@ function RootLayout({ useStore, useSessions, usePanelInfo, actions, renderSlot,
|
|
|
222
236
|
}}>
|
|
223
237
|
{/* Collapsed, not hidden, on a wide screen: a hidden panel's box sits at the page's corner, and react-resizable-panels takes the gap from it to the centre (the activity bar) for a handle. */}
|
|
224
238
|
<Panel id="sessions" panelRef={sidePanelRef} groupResizeBehavior="preserve-pixel-size" collapsible collapsedSize={0} defaultSize={info.sideWidth} minSize={narrow ? 0 : SIDE_MIN} maxSize={SIDE_MAX} className="pmw-frame__side-panel" hidden={narrow && pane !== 'sessions'}>
|
|
225
|
-
<div className="pmw-frame__sidebar" data-pmw-slot="sidebar" data-shown={(narrow ? pane === 'sessions' : sideShown) || undefined}>
|
|
239
|
+
<div className="pmw-frame__sidebar" data-pmw-slot="sidebar" data-activity={info.activity} data-shown={(narrow ? pane === 'sessions' : sideShown) || undefined}>
|
|
240
|
+
<div className="pmw-frame__history" hidden={!narrow && info.activity !== 'sessions'}>{sidebar}</div>
|
|
241
|
+
{!narrow && info.activity !== 'sessions' && <WorkspaceSidebar onHome={showHome} />}
|
|
242
|
+
</div>
|
|
226
243
|
</Panel>
|
|
227
244
|
{sideShown && <Separator className="pmw-frame__handle" data-side="side" aria-label={t.resize} />}
|
|
228
245
|
<Panel id="centre" minSize={narrow ? 0 : centreMinWidth()} className="pmw-frame__centre-panel" hidden={narrow && (pane === 'sessions' || pane === 'conversation') && panel === null}>
|
|
@@ -263,6 +280,7 @@ interface AppBarProps {
|
|
|
263
280
|
narrow: boolean
|
|
264
281
|
openSettings(): void
|
|
265
282
|
openHelp(): void
|
|
283
|
+
openDrawer(): void
|
|
266
284
|
}
|
|
267
285
|
|
|
268
286
|
/**
|
|
@@ -270,7 +288,8 @@ interface AppBarProps {
|
|
|
270
288
|
* global panel), then operations waiting for the author's approval, the AI assistant, more (plugins, automation), settings and help. On a narrow screen the places
|
|
271
289
|
* are the panes it switches between.
|
|
272
290
|
*/
|
|
273
|
-
function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, narrow, openSettings, openHelp }: AppBarProps) {
|
|
291
|
+
function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, narrow, openSettings, openHelp, openDrawer }: AppBarProps) {
|
|
292
|
+
const tt = useTreeMessages()
|
|
274
293
|
const t = useClientMessages(workbench)
|
|
275
294
|
const document_ = useWorkbenchState(state => state.document)
|
|
276
295
|
const documentTitle = useWorkbenchState(state => state.documents?.documents.find(doc => doc.dir === state.document)?.title)
|
|
@@ -298,6 +317,7 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
|
|
|
298
317
|
|
|
299
318
|
return (
|
|
300
319
|
<nav className="pm-ui-appbar pmw-appbar" aria-label={t.activity} data-pm-window-drag>
|
|
320
|
+
{narrow && <PmIconButton icon="menu" label={tt.openSidebar} onClick={openDrawer} />}
|
|
301
321
|
<span className="pmw-appbar__brand"><Logo /><span className="pmw-brand-name">{t.product}</span></span>
|
|
302
322
|
<ol className="pmw-appbar__places">
|
|
303
323
|
<li>
|
|
@@ -305,6 +325,7 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
|
|
|
305
325
|
<PmIcon name="folder" /><span className="pmw-appbar__label">{t.documents}</span>
|
|
306
326
|
</button>
|
|
307
327
|
</li>
|
|
328
|
+
{document_ !== undefined && <DocumentBreadcrumb compact={narrow} />}
|
|
308
329
|
{document_ !== undefined && (
|
|
309
330
|
<li>
|
|
310
331
|
<button type="button" className="pmw-appbar__place pmw-appbar__title" data-activity="document" title={documentTitle ?? t.document} aria-current={atDocument ? 'page' : undefined} onClick={showDocument}>
|
package/src/client/layout.ts
CHANGED
|
@@ -25,8 +25,8 @@ export function rightbarRoom(viewport: number, side: number, conversation: numbe
|
|
|
25
25
|
return viewport - side - conversation - centreMinWidth() - handles * HANDLE
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
/** What the side panel shows: the chat history (DeepSeek Harness's sessions). */
|
|
29
|
-
export type Activity = 'sessions'
|
|
28
|
+
/** What the side panel shows: the workspace's document tree, or the chat history (DeepSeek Harness's sessions). */
|
|
29
|
+
export type Activity = 'documents' | 'sessions'
|
|
30
30
|
/** What a narrow screen shows, one at a time. */
|
|
31
31
|
export type NarrowPane = 'documents' | 'preview' | 'sessions' | 'conversation'
|
|
32
32
|
|
|
@@ -75,7 +75,7 @@ export function createLayoutStore() {
|
|
|
75
75
|
panelInfo: { activePanelId: null },
|
|
76
76
|
layoutInfo: {
|
|
77
77
|
viewportWidth: window.innerWidth,
|
|
78
|
-
isSideOpen:
|
|
78
|
+
isSideOpen: true,
|
|
79
79
|
isSideExpanded: false,
|
|
80
80
|
sideWidth: SIDE_DEFAULT,
|
|
81
81
|
conversationWidth: CONVERSATION_DEFAULT,
|
|
@@ -84,7 +84,7 @@ export function createLayoutStore() {
|
|
|
84
84
|
isRightbarOpen: false,
|
|
85
85
|
hasRightbarTrack: false,
|
|
86
86
|
isRightbarFullscreen: false,
|
|
87
|
-
activity: '
|
|
87
|
+
activity: 'documents',
|
|
88
88
|
narrowPane: 'documents',
|
|
89
89
|
},
|
|
90
90
|
}),
|
|
@@ -130,7 +130,7 @@ export function createLayoutStore() {
|
|
|
130
130
|
} else {
|
|
131
131
|
const historyShown = info.activity === 'sessions' && (info.viewportWidth < SIDE_COLLAPSE ? info.isSideExpanded : info.isSideOpen)
|
|
132
132
|
if (historyShown && info.viewportWidth < SIDE_COLLAPSE) revealConversation(d)
|
|
133
|
-
else if (historyShown && info.isConversationOpen) info.
|
|
133
|
+
else if (historyShown && info.isConversationOpen) info.activity = 'documents'
|
|
134
134
|
else showHistory(d)
|
|
135
135
|
}
|
|
136
136
|
},
|
|
@@ -165,6 +165,11 @@ export function createLayoutStore() {
|
|
|
165
165
|
}
|
|
166
166
|
d.layoutInfo.narrowPane = activity
|
|
167
167
|
},
|
|
168
|
+
/** Back from the chat history to the document tree, keeping the side panel open. */
|
|
169
|
+
showDocumentTree: (d: LayoutState) => {
|
|
170
|
+
d.layoutInfo.activity = 'documents'
|
|
171
|
+
if (d.layoutInfo.narrowPane === 'sessions') d.layoutInfo.narrowPane = 'conversation'
|
|
172
|
+
},
|
|
168
173
|
showNarrowPane: (d: LayoutState, pane: NarrowPane) => {
|
|
169
174
|
d.layoutInfo.narrowPane = pane
|
|
170
175
|
d.layoutInfo.isSideExpanded = false
|
package/src/client/messages.ts
CHANGED
|
@@ -41,7 +41,8 @@ const zh = {
|
|
|
41
41
|
'直接在文稿中输入即可修改。修改自动保存,文稿上方显示“已保存”。',
|
|
42
42
|
'选中文字会出现格式工具栏:段落样式、加粗、对齐、颜色、“插入链接”与“新建批注”。“新建批注”在选中的文字上留下批注,“批注”窗格列出全部批注。动画、图表的预览工具栏里有“本步批注”,可以对整个内容块或其中一步批注。',
|
|
43
43
|
'鼠标移到一段内容上,旁边的“插入内容块”可插入标题、列表、表格、图片等内容,“打开内容块菜单”可删除这一段或修改它的颜色。',
|
|
44
|
-
'
|
|
44
|
+
'右栏的“目录”列出全部页面:“新建页面”添加一页,页面旁的“更多”可以重命名、复制、上移、下移或删除这一页。“引用”列出引用了本文的文稿。',
|
|
45
|
+
'左侧的文稿树列出工作区的全部文稿:拖动可调整上下级与顺序,行上的“+”新建子文稿,“更多”可以重命名、移动或移到回收站。在正文中输入 @ 可插入指向另一份文稿的引用。',
|
|
45
46
|
'“撤消”({undo})与“恢复”({redo})逐步撤消或恢复修改。“版本历史”列出保存过的每次修改,“撤消此更改”单独撤消其中一次。',
|
|
46
47
|
'“放映”按幻灯片逐步展示文稿;“导出”可导出网站、幻灯片网站、Notebook、幻灯片 PDF、幻灯片图片或幻灯片 PowerPoint;“视频制作”制作讲授视频。',
|
|
47
48
|
'“AI 助手”显示或隐藏与 AI 的对话。用自己的话告诉它要改什么,它处理的是当前打开的文稿。第一次使用前,请在“设置”的“模型”中设置模型。',
|
|
@@ -115,7 +116,8 @@ const en: ClientMessages = {
|
|
|
115
116
|
'Type directly in the document to change it. Changes save automatically, and the top of the document shows Saved.',
|
|
116
117
|
'Select text to show the formatting toolbar: paragraph style, Bold, alignment, Colors, Insert Link, and New Comment. New Comment leaves a comment on the selected text; the Comments pane lists them all. An animation or chart preview also has Comment on step, for the whole content block or one step.',
|
|
117
118
|
'Point at a paragraph: Insert Block, beside it, inserts a heading, list, table, picture, and more; Open Block Menu deletes the paragraph or changes its colors.',
|
|
118
|
-
'
|
|
119
|
+
'Outline in the right pane lists the pages: New Page adds one, and More beside a page renames, duplicates, moves, or deletes it. References lists the documents that cite this one.',
|
|
120
|
+
'The document tree on the left lists every document in the workspace: drag to change parents and order, + on a row adds a child document, and More renames, moves, or moves it to the trash. Type @ in the text to insert a reference to another document.',
|
|
119
121
|
'Undo ({undo}) and Redo ({redo}) step back and forth through your changes. Version History lists every saved change; Undo This Change reverses one of them.',
|
|
120
122
|
'Present shows the document as slides, step by step; Export makes a website, slides website, Notebook, slides as PDF, slides as pictures, or slides as PowerPoint; Video Production makes a lecture video with voiceover.',
|
|
121
123
|
'AI Assistant shows or hides the chat with the AI. Tell it in your own words what to change; it works on the document you have open. Before the first use, set up a model under Models in Settings.',
|
|
@@ -24,7 +24,7 @@ export function registerNavigationShell(ctx: DshClientContext, workbench: Workbe
|
|
|
24
24
|
ctx.slots.inject('sidebar.panellist', updatePanels)
|
|
25
25
|
const closeHistory = () => {
|
|
26
26
|
if (layout.getSnapshot().layoutInfo.viewportWidth < SIDE_COLLAPSE) actions.revealConversation()
|
|
27
|
-
else actions.
|
|
27
|
+
else actions.showDocumentTree()
|
|
28
28
|
}
|
|
29
29
|
function Sidebar({ renderSlot }: SidebarProps) {
|
|
30
30
|
const t = useClientMessages(workbench)
|
|
@@ -6,7 +6,7 @@ import { WORKSPACE_EVENTS_PATH, workspaceEventMessage } from '../workspace-event
|
|
|
6
6
|
import type { WorkspaceEventTopic, WorkspaceEventCommand } from '../workspace-events.ts'
|
|
7
7
|
|
|
8
8
|
const TOPICS: Readonly<Record<string, WorkspaceEventTopic>> = {
|
|
9
|
-
document: 'document', diagnostics: 'diagnostics', review: 'review', revision: 'ir', job: 'jobs', 'viewer-site': 'viewer-site', 'viewer-control': 'viewer-control', approvals: 'approvals', 'agent-activity': 'agent-activity',
|
|
9
|
+
document: 'document', diagnostics: 'diagnostics', review: 'review', revision: 'ir', job: 'jobs', 'viewer-site': 'viewer-site', 'viewer-control': 'viewer-control', approvals: 'approvals', 'agent-activity': 'agent-activity', tree: 'tree',
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/** Each live reader owns one logical subscription; the library owns physical reconnect timing. */
|