dsh-mac-pet 0.9.2 → 0.9.4

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.md CHANGED
@@ -1,4 +1,4 @@
1
- <h1 align="center">DSH Pet</h1>
1
+ <h1 align="center">dsh-mac-pet</h1>
2
2
 
3
3
  <p align="center">
4
4
  以鲸鱼娘的像素形象,把 DeepSeek Harness 的 Agent 状态带到 macOS 桌面<br>
@@ -19,7 +19,7 @@
19
19
 
20
20
  ## 这是什么?
21
21
 
22
- **DSH Pet** 是 DeepSeek Harness 的 macOS 桌面伴侣。它默认以鲸鱼娘的形象显示 Agent 状态:
22
+ **dsh-mac-pet** 是 DeepSeek Harness 的 macOS 桌面伴侣项目,包含 **DSH Pet** 应用和同名桥接插件。它默认以鲸鱼娘的形象显示 Agent 状态:
23
23
  待机、思考、等待授权或回答、完成和失败都有对应动作。你可以把桌宠拖到屏幕任意位置,
24
24
  通过状态气泡和任务卡片了解进度,也能直接从桌面向 Harness 发送消息;浏览器最小化后仍可使用。
25
25
 
@@ -31,7 +31,7 @@
31
31
  - **DSH Pet 桥接插件**(包名 `dsh-mac-pet`):订阅 Agent 会话事件,提供 HTTP/状态 Socket 兼容接口、用户级命令 Socket,以及安装桌宠引导和桌宠会话跳转;无插件设置项
32
32
 
33
33
  旧名称和数据位置保留必要的兼容处理。安装脚本会清理旧版 `MoodBall.app`。
34
- 当前源码对应的桌面 App 版本为 **v0.9.3**,桥接插件版本为 **v0.9.2**。已发布的 `DSH-Pet.app.zip` 安装包可从 [GitHub Releases](https://github.com/sundusk/dsh-pet/releases/latest) 下载;安装脚本也会自动获取最新发布的安装包。
34
+ 当前源码对应的桌面 App 版本为 **v0.9.4**,桥接插件版本为 **v0.9.4**。已发布的 `DSH-Pet.app.zip` 安装包可从 [GitHub Releases](https://github.com/sundusk/dsh-mac-pet/releases/latest) 下载;安装脚本也会自动获取最新发布的安装包。
35
35
 
36
36
  一切配置都在 app 的设置面板里完成。新版设置面板包含六个页面:「桌宠外观」「交互与提醒」「快捷键」「宠物管理」「Harness 连接」和「关于与更新」。
37
37
 
@@ -79,8 +79,8 @@ pnpm dsh web
79
79
  也可以使用安装脚本。另开一个终端执行:
80
80
 
81
81
  ```bash
82
- git clone --depth 1 https://github.com/sundusk/dsh-pet.git
83
- cd dsh-pet
82
+ git clone --depth 1 https://github.com/sundusk/dsh-mac-pet.git
83
+ cd dsh-mac-pet
84
84
  bash install.sh
85
85
  ```
86
86
 
@@ -257,8 +257,8 @@ pnpm dsh plugin --profile web add dsh-mac-pet
257
257
  ### 卸载
258
258
 
259
259
  ```bash
260
- git clone --depth 1 https://github.com/sundusk/dsh-pet.git
261
- cd dsh-pet
260
+ git clone --depth 1 https://github.com/sundusk/dsh-mac-pet.git
261
+ cd dsh-mac-pet
262
262
  bash uninstall.sh
263
263
  ```
264
264
 
package/cordis.patch.yml CHANGED
@@ -1,4 +1,4 @@
1
- # dsh-pet bundle patch: inserts the host-only plugin row into the
1
+ # dsh-mac-pet bundle patch: inserts the host-only plugin row into the
2
2
  # web profile roster. Applied as a profile bundle layer (the `dsh.bundle.patch`
3
3
  # manifest field); install with
4
4
  # `dsh plugin --profile web add dsh-mac-pet`.
package/lib/client.js CHANGED
@@ -24,21 +24,26 @@ function apply(ctx) {
24
24
  // The desktop shell spawns its Host locally and exclusively forwards this origin to it.
25
25
  const localDesktop = window.location?.protocol === 'dsh-app:' && window.location?.hostname === 'app'
26
26
  && typeof window.dshDesktopBoot?.ready === 'function'
27
- let hostStatus = 'unknown'
27
+ let detection = { status: 'unknown', checking: false, checked: false }
28
28
  let stopped = false
29
29
  let requestId = 0
30
30
  const listeners = new Set()
31
31
  const subscribe = listener => { listeners.add(listener); return () => listeners.delete(listener) }
32
- const refreshStatus = async () => {
32
+ const refreshStatus = async (manual = false) => {
33
+ if (detection.checking) return
33
34
  const current = ++requestId
35
+ if (manual) {
36
+ detection = { ...detection, checking: true, checked: false }
37
+ for (const listener of listeners) listener()
38
+ }
34
39
  let next = 'unknown'
35
40
  try {
36
41
  const response = await fetch(new URL('api/dsh-pet/install-status', document.baseURI).href, { cache: 'no-store', headers: { accept: 'application/json' } })
37
42
  const payload = response.ok ? await response.json() : null
38
43
  if (['installed', 'not-found'].includes(payload?.status)) next = payload.status
39
44
  } catch { /* Keep the installation entry available when detection fails. */ }
40
- if (stopped || current !== requestId || next === hostStatus) return
41
- hostStatus = next
45
+ if (stopped || current !== requestId || (!manual && next === detection.status)) return
46
+ detection = { status: next, checking: false, checked: manual }
42
47
  for (const listener of listeners) listener()
43
48
  }
44
49
 
@@ -54,7 +59,7 @@ function apply(ctx) {
54
59
  }
55
60
 
56
61
  function InstallPage() {
57
- const status = React.useSyncExternalStore(subscribe, () => hostStatus)
62
+ const { status, checking, checked } = React.useSyncExternalStore(subscribe, () => detection)
58
63
  const hostLabel = status === 'installed' ? '已检测到 DSH Pet' : status === 'not-found' ? '未检测到 DSH Pet' : '无法确认'
59
64
  const section = { marginTop: '28px' }
60
65
  return h('main', { style: { height: '100%', overflow: 'auto', boxSizing: 'border-box', color: 'var(--dsw-alias-label-primary)', background: 'var(--dsw-alias-bg-base)' } },
@@ -62,8 +67,8 @@ function apply(ctx) {
62
67
  h('h1', { style: { fontSize: '20px', lineHeight: '28px', fontWeight: 500, margin: 0 } }, '安装 DSH Pet 桌宠'),
63
68
  h('p', null, '安装桌面应用后,桌宠可以留在桌面显示 Harness 的任务状态。'),
64
69
  h('p', null, '系统要求:macOS 14 或更新版本,Apple 芯片 Mac。'),
65
- h('a', { href: 'https://github.com/sundusk/dsh-pet/releases/latest/download/DSH-Pet.app.zip', target: '_blank', rel: 'noopener noreferrer', style: { display: 'inline-block', padding: '8px 16px', borderRadius: '8px', background: 'var(--dsw-alias-accent, #4d76ff)', color: '#fff', textDecoration: 'none' } }, '下载 DSH Pet'),
66
- h('p', null, h('a', { href: 'https://github.com/sundusk/dsh-pet/releases/latest', target: '_blank', rel: 'noopener noreferrer' }, '下载失败?打开 GitHub Release 页面')),
70
+ h('a', { href: 'https://github.com/sundusk/dsh-mac-pet/releases/latest/download/DSH-Pet.app.zip', target: '_blank', rel: 'noopener noreferrer', style: { display: 'inline-block', padding: '8px 16px', borderRadius: '8px', background: 'var(--dsw-alias-accent, #4d76ff)', color: '#fff', textDecoration: 'none' } }, '下载 DSH Pet'),
71
+ h('p', null, h('a', { href: 'https://github.com/sundusk/dsh-mac-pet/releases/latest', target: '_blank', rel: 'noopener noreferrer' }, '下载失败?打开 GitHub Release 页面')),
67
72
  h('section', { style: section },
68
73
  h('h2', { style: { fontSize: '16px' } }, '安装步骤'),
69
74
  h('ol', { style: { paddingLeft: '22px' } },
@@ -71,12 +76,14 @@ function apply(ctx) {
71
76
  h('li', null, '将 DSH Pet.app 拖入「应用程序」文件夹,然后打开。'),
72
77
  h('li', null, '在桌宠的「设置」→「Harness 连接」中检查连接状态。'),
73
78
  h('li', null, '如果 Harness 提示需要重启才能加载插件,请在当前任务完成后重启。')),
74
- h('p', null, '首次打开时,如果 macOS 阻止运行,请根据系统提示在「系统设置」→「隐私与安全性」中处理。')),
79
+ h('p', null, '首次打开时,如果 macOS 提示无法验证开发者,请打开「系统设置」→「隐私与安全性」,向下找到 DSH Pet,点击「仍要打开」,并在提示中确认打开。')),
75
80
  h('section', { style: section },
76
81
  h('h2', { style: { fontSize: '16px' } }, '安装状态'),
77
- h('p', { role: 'status' }, `${localDesktop ? '本机' : 'Harness 所在设备'}:${hostLabel}。`),
82
+ h('p', { role: 'status' }, checking ? '正在检测…' : `${checked ? '检测完成。' : ''}${localDesktop ? '本机' : 'Harness 所在设备'}:${hostLabel}。`),
78
83
  localDesktop ? null : h('p', null, '无法确认你当前使用的设备是否就是 Harness 所在设备,请在本机检查 DSH Pet 是否已安装。'),
79
- h('button', { type: 'button', onClick: () => { void refreshStatus() } }, '重新检测'))))
84
+ h('button', { type: 'button', disabled: checking, onClick: () => { void refreshStatus(true) } }, checking ? '检测中…' : '重新检测'),
85
+ status === 'installed' && !checking && typeof scope.layout?.selectPanel === 'function'
86
+ ? h('button', { type: 'button', style: { marginLeft: '12px' }, onClick: () => scope.layout.selectPanel(null) }, '完成,返回会话') : null)))
80
87
  }
81
88
 
82
89
  scope.slots.inject('main', () => scope.slots.register({ name: 'main', key: panelId }, InstallPage))
@@ -85,7 +92,7 @@ function apply(ctx) {
85
92
  const panelInfo = scope.layout?.panelInfo
86
93
  const canTrackPanel = typeof panelInfo?.getSnapshot === 'function' && typeof panelInfo?.subscribe === 'function'
87
94
  const update = () => {
88
- const visible = !localDesktop || hostStatus !== 'installed' || !canTrackPanel || panelInfo.getSnapshot().activePanelId === panelId
95
+ const visible = !localDesktop || detection.status !== 'installed' || !canTrackPanel || panelInfo.getSnapshot().activePanelId === panelId
89
96
  if (visible && unregister === undefined) unregister = scope.slots.register({ name: 'sidebar.panellist', id: panelId, order: 90, label: '安装桌宠' }, InstallIcon)
90
97
  else if (!visible && unregister !== undefined) { unregister(); unregister = undefined }
91
98
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * dsh-pet host plugin — a Harness status bridge (no rendered browser UI, no
2
+ * dsh-mac-pet host plugin — a Harness status bridge (no rendered browser UI, no
3
3
  * settings namespace) that tracks agent activity, serves a stable snapshot over
4
4
  * HTTP and a local Unix socket, and queues Session-open requests for the tiny
5
5
  * browser half.
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "dsh-mac-pet",
3
3
  "description": "DeepSeek Harness status and command bridge for DSH Pet, with a desktop app installation guide and session navigation.",
4
- "version": "0.9.2",
4
+ "version": "0.9.4",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/sundusk/dsh-pet.git"
8
+ "url": "https://github.com/sundusk/dsh-mac-pet.git"
9
9
  },
10
- "homepage": "https://github.com/sundusk/dsh-pet#readme",
10
+ "homepage": "https://github.com/sundusk/dsh-mac-pet#readme",
11
11
  "bugs": {
12
- "url": "https://github.com/sundusk/dsh-pet/issues"
12
+ "url": "https://github.com/sundusk/dsh-mac-pet/issues"
13
13
  },
14
14
  "keywords": [
15
15
  "dsh-plugin",
16
16
  "deepseek-harness",
17
17
  "deepseek",
18
18
  "web-ui",
19
+ "dsh-mac-pet",
19
20
  "dsh-pet",
20
21
  "status",
21
22
  "desktop"