@lincyaw/dsh 0.2.0-rc.113 → 0.2.0-rc.114

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.
@@ -44,6 +44,7 @@
44
44
  "../kernel/src/contracts/authoring-windows.ts",
45
45
  "../kernel/src/contracts/projects.ts",
46
46
  "../kernel/src/contracts/document-image.ts",
47
+ "../kernel/src/contracts/desktop.ts",
47
48
  "../kernel/src/contracts.ts",
48
49
  "../kernel/src/random-uuid.ts",
49
50
  "../kernel/src/access.ts",
@@ -285,6 +286,8 @@
285
286
  "src/client/paths.ts",
286
287
  "src/client/agent-requests.ts",
287
288
  "src/client/assistant-setup.tsx",
289
+ "src/client/desktop-messages.ts",
290
+ "src/client/DesktopUpdate.tsx",
288
291
  "src/client/RootLayout.tsx",
289
292
  "src/client/source-links.tsx",
290
293
  "src/client/workbench-keys.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincyaw/dsh",
3
- "version": "0.2.0-rc.113",
3
+ "version": "0.2.0-rc.114",
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/cli": "1.0.0-rc.114",
93
- "@lincyaw/kernel": "1.0.0-rc.114",
94
- "@lincyaw/skills": "1.0.0-rc.114",
95
- "@lincyaw/mcp": "1.0.0-rc.114"
92
+ "@lincyaw/skills": "1.0.0-rc.115",
93
+ "@lincyaw/kernel": "1.0.0-rc.115",
94
+ "@lincyaw/mcp": "1.0.0-rc.115",
95
+ "@lincyaw/cli": "1.0.0-rc.115"
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.114",
112
- "@lincyaw/workbench": "0.2.0-rc.115"
111
+ "@lincyaw/workbench": "0.2.0-rc.116",
112
+ "@lincyaw/design": "1.0.0-rc.115"
113
113
  },
114
114
  "scripts": {}
115
115
  }
@@ -0,0 +1,31 @@
1
+ import { useEffect, useState, useSyncExternalStore } from 'react'
2
+ import type { DesktopHost, DesktopState } from '@lincyaw/kernel'
3
+ import { PmIconButton, useWorkbenchState } from '@lincyaw/workbench'
4
+ import { DESKTOP_MESSAGES } from './desktop-messages.ts'
5
+
6
+ const absent = (): DesktopState | undefined => undefined
7
+ const noSubscription = () => () => {}
8
+
9
+ /** Browser sessions keep their ordinary app bar; the installed app supplies this bounded bridge. */
10
+ export function DesktopUpdate() {
11
+ const [host, setHost] = useState<DesktopHost | undefined>(() => window.presmiumDesktop)
12
+ const [failed, setFailed] = useState(false)
13
+ const locale = useWorkbenchState(state => state.locale)
14
+ useEffect(() => {
15
+ const ready = () => setHost(window.presmiumDesktop)
16
+ window.addEventListener('presmium-desktop-ready', ready)
17
+ ready()
18
+ return () => window.removeEventListener('presmium-desktop-ready', ready)
19
+ }, [])
20
+ const snapshot = useSyncExternalStore(host?.subscribe ?? noSubscription, host?.getSnapshot ?? absent)
21
+ if (!host || !snapshot || !snapshot.update.version) return null
22
+ const t = DESKTOP_MESSAGES[locale]
23
+ const update = snapshot.update
24
+ const phase = failed ? 'error' : update.phase
25
+ const label = phase === 'downloading' ? t.downloading(update.progress) : t[phase]
26
+ const title = [t.currentVersion(snapshot.version), ...(update.version ? [t.candidate(update.version)] : []), label].join(' · ')
27
+ const busy = ['checking', 'downloading', 'installing'].includes(phase)
28
+ const icon = phase === 'current' ? 'check' : phase === 'error' ? 'warning' : phase === 'available' || phase === 'downloading' ? 'download' : 'refresh'
29
+ return <PmIconButton icon={icon} loading={busy} disabled={busy} label={title} hint={title}
30
+ onClick={() => { setFailed(false); void host.activateUpdate().catch(() => setFailed(true)) }} />
31
+ }
@@ -6,6 +6,7 @@ import { useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalS
6
6
  import type { ReactNode, RefObject } from 'react'
7
7
  import { openMcpSettings } from './settings-opener.ts'
8
8
  import { Logo } from './brand.tsx'
9
+ import { DesktopUpdate } from './DesktopUpdate.tsx'
9
10
  import { mainViewAgentSession } from './document-context.ts'
10
11
  import { centreMinWidth, clamp, CONVERSATION_MAX, CONVERSATION_MIN, singlePaneWidth, RIGHTBAR_MAX_RATIO, RIGHTBAR_MIN, rightbarRoom, SIDE_COLLAPSE, SIDE_MAX, SIDE_MIN } from './layout.ts'
11
12
  import type { LayoutActions, LayoutState, NarrowPane } from './layout.ts'
@@ -296,7 +297,7 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
296
297
  }
297
298
 
298
299
  return (
299
- <nav className="pm-ui-appbar pmw-appbar" aria-label={t.activity}>
300
+ <nav className="pm-ui-appbar pmw-appbar" aria-label={t.activity} data-pm-window-drag>
300
301
  <span className="pmw-appbar__brand"><Logo /><span className="pmw-brand-name">{t.product}</span></span>
301
302
  <ol className="pmw-appbar__places">
302
303
  <li>
@@ -315,6 +316,7 @@ function AppBar({ workbench, info, actions, activePanel, globalPanels, pane, nar
315
316
  </ol>
316
317
  <span className="pmw-spacer" />
317
318
  <AgentActivityBar />
319
+ <DesktopUpdate />
318
320
  <span className="pmw-appbar__approvals" data-activity="approvals"><WorkbenchApprovals density={narrow ? 'touch' : 'compact'} /></span>
319
321
  <button type="button" className="pmw-appbar__button pmw-appbar__assistant" data-activity="assistant" title={t.assistant} aria-pressed={chatShown} onClick={toggleAssistant}>
320
322
  <PmIcon name="sparkle" /><span className="pmw-appbar__label">{t.assistant}</span>
@@ -0,0 +1,16 @@
1
+ export const DESKTOP_MESSAGES = {
2
+ 'zh-CN': {
3
+ currentVersion: (version: string) => `当前版本 ${version}`,
4
+ candidate: (version: string) => `可更新至 ${version}`,
5
+ idle: '检查更新', checking: '正在检查', current: '已是最新版', available: '发现更新',
6
+ downloading: (progress?: number) => progress === undefined ? '正在下载' : `正在下载 ${progress}%`,
7
+ ready: '重启安装', installing: '正在安装', error: '重试更新',
8
+ },
9
+ en: {
10
+ currentVersion: (version: string) => `Current version ${version}`,
11
+ candidate: (version: string) => `Update to ${version}`,
12
+ idle: 'Check for Updates', checking: 'Checking', current: 'Up to Date', available: 'Update Available',
13
+ downloading: (progress?: number) => progress === undefined ? 'Downloading' : `Downloading ${progress}%`,
14
+ ready: 'Restart and Install', installing: 'Installing', error: 'Retry Update',
15
+ },
16
+ }
@@ -55,6 +55,10 @@ body,
55
55
  font-size: var(--pm-text-md);
56
56
  }
57
57
 
58
+ html[data-pm-desktop='darwin']:not([data-pm-desktop-fullscreen]) .pmw-appbar {
59
+ padding-inline-start: var(--pm-desktop-controls-inset);
60
+ }
61
+
58
62
  .pmw-appbar__places {
59
63
  display: flex;
60
64
  align-items: center;