dsh-notify-tray 0.1.9 → 0.1.11

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.en.md CHANGED
@@ -92,11 +92,11 @@ In DSH, open **Plugins → Add plugin** and enter `dsh-notify-tray`. To select a
92
92
  The **Updates** card at the bottom of the sidebar settings page:
93
93
 
94
94
  - Checks when you open the page, or when you click **Check for updates**.
95
- - Offers **Update now** for a compatible, non-deprecated stable release. Clicking saves settings first, then asks DSH's native plugin manager to update.
96
- - Never installs automatically. DSH handles compatibility checks and recovery on failure. The page distinguishes completion, a required restart, restoration, and an unconfirmed outcome.
95
+ - When a compatible stable release is available, **Update in Plugins** saves pending settings and opens Whale Notify Station in DSH’s built-in plugin manager.
96
+ - Under **Versions**, select the release and confirm. DSH shows progress, the result, and any restart prompt there. The whale’s sidebar entry can disappear while DSH replaces the old version. Wait for completion before restarting.
97
97
  - Explains why local-directory and Git installations cannot use this update path. Once a release is published to npm, switch to an npm installation through plugin management to enable online updates.
98
98
 
99
- DSH's native plugin management update controls remain available. Restart DSH when requested.
99
+ If the settings page in 0.1.8 or 0.1.9 says that plugin update access or APIs are unavailable, open **Plugins → Whale Notify Station → Versions** in DSH. Expand the version list and select the release to install. Restart DSH when prompted.
100
100
 
101
101
  To develop or try unpublished code, install a local checkout:
102
102
 
package/README.md CHANGED
@@ -92,11 +92,11 @@
92
92
  侧栏设置页底部提供「版本更新」卡片:
93
93
 
94
94
  - 打开设置页时自动检查,也可以点击「检查更新」。
95
- - 发现兼容且未废弃的正式版时,显示新版本号和「立即更新」。点击后先保存设置,再交给 DSH 原生插件管理器更新。
96
- - 安装不会自动开始;DSH 负责版本兼容性检查和失败时的恢复。页面会区分更新完成、需要重启、恢复旧版和结果尚未确认。
95
+ - 发现兼容的正式版后,点击「在插件管理中更新」。小鲸鱼会先保存设置,再打开 DSH 自带的小鲸鱼插件详情。
96
+ - 展开「版本」,选择目标版本并确认。更新进度、结果和重启提示都显示在 DSH 插件管理页。旧版卸载时,小鲸鱼的侧栏入口会暂时消失,请等安装完成后再按提示重启。
97
97
  - 本地目录、Git 等非 npm 安装不支持这条在线更新流程,会显示原因。需等正式版发布到 npm 后,通过插件管理页改为 npm 安装。
98
98
 
99
- 也可以继续使用 DSH 插件管理页的原生更新功能。提示需要重启时,请重启 DSH。
99
+ 使用 0.1.8 或 0.1.9 时,如果设置页提示「当前 DSH 未提供可用的插件更新权限或接口」,请打开 DSH「插件 → 小鲸鱼通知站 → 版本」,展开版本列表并选择要更新到的版本。提示需要重启时,请重启 DSH。
100
100
 
101
101
  开发或试用尚未发布的代码,可从本地仓库安装:
102
102
 
package/README.zh-CN.md CHANGED
@@ -92,11 +92,11 @@
92
92
  侧栏设置页底部提供「版本更新」卡片:
93
93
 
94
94
  - 打开设置页时自动检查,也可以点击「检查更新」。
95
- - 发现兼容且未废弃的正式版时,显示新版本号和「立即更新」。点击后先保存设置,再交给 DSH 原生插件管理器更新。
96
- - 安装不会自动开始;DSH 负责版本兼容性检查和失败时的恢复。页面会区分更新完成、需要重启、恢复旧版和结果尚未确认。
95
+ - 发现兼容的正式版后,点击「在插件管理中更新」。小鲸鱼会先保存设置,再打开 DSH 自带的小鲸鱼插件详情。
96
+ - 展开「版本」,选择目标版本并确认。更新进度、结果和重启提示都显示在 DSH 插件管理页。旧版卸载时,小鲸鱼的侧栏入口会暂时消失,请等安装完成后再按提示重启。
97
97
  - 本地目录、Git 等非 npm 安装不支持这条在线更新流程,会显示原因。需等正式版发布到 npm 后,通过插件管理页改为 npm 安装。
98
98
 
99
- 也可以继续使用 DSH 插件管理页的原生更新功能。提示需要重启时,请重启 DSH。
99
+ 使用 0.1.8 或 0.1.9 时,如果设置页提示「当前 DSH 未提供可用的插件更新权限或接口」,请打开 DSH「插件 → 小鲸鱼通知站 → 版本」,展开版本列表并选择要更新到的版本。提示需要重启时,请重启 DSH。
100
100
 
101
101
  开发或试用尚未发布的代码,可从本地仓库安装:
102
102
 
package/lib/client.js CHANGED
@@ -112,22 +112,19 @@ window.__ModuleLoader__.load({
112
112
  fixSettings: '请检查输入后自动保存',
113
113
  retrySave: '重试保存',
114
114
  updateTitle: '版本更新',
115
- updateHint: '打开此页自动检查,发现兼容的正式版后可一键更新。',
115
+ updateHint: '打开此页会自动检查。在 DSH 插件详情的「版本」中确认更新并查看进度。',
116
116
  checkUpdate: '检查更新',
117
- installUpdate: '立即更新',
117
+ openPluginUpdate: '在插件管理中更新',
118
118
  update_idle: '准备检查更新',
119
119
  update_checking: '正在检查新版本…',
120
120
  update_available: '发现可用的新版本',
121
121
  update_current: '已是最新正式版',
122
122
  update_blocked: '有新版本,但暂无适合当前 DSH 的正式版',
123
- update_unavailable: '当前 DSH 未提供可用的插件更新权限或接口。',
124
- update_updating: '正在更新,请稍候…',
125
- update_updated: '更新已完成',
126
- update_restart: '更新已安装,重启 DSH 后生效',
127
- update_error: '检查或更新失败,可重新检查后再试',
128
- update_unknown: '更新结果尚未确认,请到插件管理页查看,避免重复操作。',
129
- update_restored: '更新失败,DSH 已恢复旧版本;如提示需要重启,请重启 DSH。',
130
- update_broken: '更新与恢复均未完成,请到插件管理页处理。',
123
+ update_unavailable: '此页无法检查更新,请在 DSH 的「插件」页查看。',
124
+ update_manual: '请打开 DSH「插件 → 小鲸鱼通知站 → 版本」,选择要更新到的版本。',
125
+ update_local: '当前插件来自本地目录或 Git 等来源。此页仅检查 npm 安装的插件。',
126
+ update_opening: '正在打开插件管理…',
127
+ update_error: '版本检查失败,请重试',
131
128
  updateSaveFirst: '设置尚未保存,请先检查输入或重试保存。',
132
129
  installedVersion: '当前版本',
133
130
  newVersion: '新版本',
@@ -292,22 +289,19 @@ window.__ModuleLoader__.load({
292
289
  fixSettings: 'Check your input to save automatically',
293
290
  retrySave: 'Retry saving',
294
291
  updateTitle: 'Updates',
295
- updateHint: 'Checks when you open this page. Install a compatible stable release with one click.',
292
+ updateHint: 'Checks when you open this page. Confirm the update and follow its progress under Versions in DSH’s plugin details.',
296
293
  checkUpdate: 'Check for updates',
297
- installUpdate: 'Update now',
294
+ openPluginUpdate: 'Update in Plugins',
298
295
  update_idle: 'Ready to check for updates',
299
296
  update_checking: 'Checking for updates…',
300
297
  update_available: 'A new version is available',
301
298
  update_current: 'You have the latest stable version',
302
299
  update_blocked: 'Newer versions exist, but no compatible stable release is available',
303
- update_unavailable: 'Plugin update access or APIs are unavailable in this DSH instance.',
304
- update_updating: 'Updating, please wait…',
305
- update_updated: 'Update complete',
306
- update_restart: 'Update installed. Restart DSH to use it.',
307
- update_error: 'Check or update failed. Check again to retry.',
308
- update_unknown: 'The update outcome is unknown. Check plugin management before trying again.',
309
- update_restored: 'Update failed; DSH restored the previous version. Restart DSH if requested.',
310
- update_broken: 'Update and recovery did not complete. Open plugin management to resolve this.',
300
+ update_unavailable: 'Open the DSH Plugins page to check for updates.',
301
+ update_manual: 'Open Plugins → Whale Notify Station → Versions in DSH and choose the version to install.',
302
+ update_local: 'This plugin was installed from a local directory, Git, or another source. This page checks npm installations only.',
303
+ update_opening: 'Opening Plugins…',
304
+ update_error: 'Version check failed. Check again to retry.',
311
305
  updateSaveFirst: 'Settings are not saved. Check your input or retry saving first.',
312
306
  installedVersion: 'Installed',
313
307
  newVersion: 'New version',
@@ -618,8 +612,9 @@ window.__ModuleLoader__.load({
618
612
  // All update decisions and package mutations belong to DSH's plugin manager.
619
613
  // The browser never runs a shell or chooses an unverified registry version.
620
614
  class UpdateController {
621
- constructor(getManager, flush) {
615
+ constructor(getManager, flush, openBundle) {
622
616
  this.getManager = getManager
617
+ this.openBundle = openBundle
623
618
  this.flush = flush
624
619
  this.listeners = new Set()
625
620
  this.snapshot = { phase: 'idle' }
@@ -637,49 +632,42 @@ window.__ModuleLoader__.load({
637
632
  }
638
633
 
639
634
  async check() {
640
- if (this.disposed || ['checking', 'updating', 'restart'].includes(this.snapshot.phase)) return
635
+ if (this.disposed || ['checking', 'opening'].includes(this.snapshot.phase)) return
641
636
  const manager = this.getManager()
642
- if (!manager?.listVersions || !manager?.updateBundle) return this.patch({ phase: 'unavailable' })
643
637
  this.patch({ phase: 'checking', candidate: undefined, error: undefined })
638
+ if (!manager?.listBundles || !manager.listVersions) return this.patch({ phase: 'unavailable' })
644
639
  try {
645
640
  const inventory = await manager.listBundles()
646
641
  if (!inventory.ok) throw new Error(inventory.error?.message || 'Plugin inventory unavailable')
647
642
  const pkg = inventory.value.find(pkg => pkg.name === 'dsh-notify-tray')
648
643
  if (!pkg) return this.patch({ phase: 'unavailable' })
649
644
  this.patch({ installed: pkg.version })
650
- if (!pkg.updatable) return this.patch({ phase: /^(?:link:|file:|git|https?:|\/)/u.test(pkg.source || '') ? 'local' : 'unavailable' })
645
+ const registry = pkg.update === undefined ? pkg.updatable === true : pkg.update === 'registry'
646
+ if (!registry) {
647
+ const local = pkg.update === 'git' || /^(?:link:|file:|git|https?:|\/)/u.test(pkg.source || '')
648
+ return this.patch({ phase: local ? 'local' : 'unavailable' })
649
+ }
651
650
  const answer = await manager.listVersions('dsh-notify-tray', {})
652
651
  if (!answer.ok) throw new Error(answer.error?.message || 'Version check failed')
653
652
  const list = answer.value
654
653
  if (list.status !== 'listed') throw new Error(list.reason || 'Version check refused')
655
654
  const candidate = list.versions.find(v => v.bundle && !v.incompatible && !v.deprecated && !v.prerelease)
656
- this.patch({ phase: candidate ? 'available' : list.versions.length ? 'blocked' : 'current', installed: list.installed, candidate: candidate?.version, registry: list.registry })
655
+ this.patch({ phase: candidate ? 'available' : list.versions.length ? 'blocked' : 'current', installed: list.installed, candidate: candidate?.version })
657
656
  } catch (error) {
658
657
  this.patch({ phase: 'error', error: String(error.message || error) })
659
658
  }
660
659
  }
661
660
 
662
- async update() {
661
+ async open() {
663
662
  if (this.disposed || this.snapshot.phase !== 'available') return
664
- const { candidate, registry } = this.snapshot
665
- this.patch({ phase: 'updating', error: undefined })
663
+ this.patch({ phase: 'opening', error: undefined })
666
664
  try {
667
665
  if (!await this.flush()) return this.patch({ phase: 'available', error: 'updateSaveFirst' })
668
666
  if (this.disposed) return
669
- const manager = this.getManager()
670
- const answer = await manager.updateBundle('dsh-notify-tray', candidate, { registry })
671
- if (!answer.ok) return this.patch({ phase: 'unknown', error: answer.error?.message })
672
- const result = answer.value
673
- const application = result.result?.application
674
- if (application === 'applied' || application === 'restart-required') {
675
- this.patch({ phase: application === 'restart-required' ? 'restart' : 'updated', installed: candidate, candidate: undefined })
676
- } else {
677
- const restored = result.restore?.application
678
- this.patch({ phase: restored === 'applied' || restored === 'restart-required' ? 'restored' : restored ? 'broken' : 'error', error: result.result?.error?.diagnostic || result.result?.error?.code || application })
679
- }
667
+ if (!this.openBundle()) return this.patch({ phase: 'manual' })
668
+ this.patch({ phase: 'available' })
680
669
  } catch (error) {
681
- // A disconnected client cannot assume an update failed; the host may still finish it.
682
- this.patch({ phase: 'unknown', error: String(error.message || error) })
670
+ this.patch({ phase: 'manual', error: String(error.message || error) })
683
671
  }
684
672
  }
685
673
 
@@ -1068,7 +1056,8 @@ window.__ModuleLoader__.load({
1068
1056
  }
1069
1057
 
1070
1058
  const PAGE_CSS = `
1071
- .dnt-page { --dnt-accent: #5085b2; --dnt-border: color-mix(in srgb, currentColor 11%, transparent); height: 100%; min-height: 0; overflow-y: auto; }
1059
+ .dnt-page { --dnt-accent: #5085b2; --dnt-border: color-mix(in srgb, currentColor 11%, transparent); flex: 1; min-height: 0; overflow-y: auto; }
1060
+ html[data-platform='darwin'] .dnt-page { margin-top: var(--dsh-frame-top-clearance, 0px); }
1072
1061
  .dnt-content { max-width: 1040px; margin: auto; padding: 30px 26px 48px; }
1073
1062
  .dnt-hero { display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 24px; border-radius: 20px; background: linear-gradient(115deg, color-mix(in srgb, var(--dnt-accent) 12%, transparent), color-mix(in srgb, var(--dnt-accent) 2%, transparent)); border: 1px solid var(--dnt-border); }
1074
1063
  .dnt-mascot { box-sizing: border-box; width: 80px; height: 80px; padding: 8px; flex: none; border-radius: 22px; border: 1px solid var(--dnt-border); background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 3px 10px #00000006; }
@@ -1153,19 +1142,19 @@ window.__ModuleLoader__.load({
1153
1142
  const t = props.t
1154
1143
  const state = props.useNotifyUpdate(snapshot => snapshot)
1155
1144
  React.useEffect(() => { props.checkUpdate() }, [])
1156
- const busy = state.phase === 'checking' || state.phase === 'updating'
1145
+ const busy = state.phase === 'checking' || state.phase === 'opening'
1157
1146
  return h(Section, { title: t('updateTitle'), icon: 'update' },
1158
1147
  h('div', { className: 'dnt-update-row' },
1159
1148
  h('div', { style: { flex: '1 1 240px', minWidth: 0 } },
1160
1149
  state.installed ? h('div', { className: 'dnt-update-version' },
1161
1150
  h('span', null, `${t('installedVersion')} ${state.installed}`),
1162
1151
  state.candidate ? h('span', null, `${t('newVersion')} ${state.candidate}`) : null) : null,
1163
- state.phase !== 'local' ? h('p', { className: 'dnt-note', role: 'status' }, t(`update_${state.phase}`)) : null,
1152
+ h('p', { className: 'dnt-note', role: 'status' }, t(`update_${state.phase}`)),
1164
1153
  state.error ? h('p', { className: 'dnt-note', style: S.error, role: 'alert' }, state.error === 'updateSaveFirst' ? t(state.error) : state.error) : null),
1165
1154
  h('div', { className: 'dnt-update-actions' },
1166
- h('button', { type: 'button', style: S.button, disabled: busy || state.phase === 'restart', onClick: props.checkUpdate }, t('checkUpdate')),
1167
- state.phase === 'available' ? h('button', { type: 'button', style: { ...S.button, background: 'var(--dnt-accent)', color: '#fff', borderColor: 'transparent' }, onClick: props.installUpdate }, t('installUpdate')) : null)),
1168
- h('p', { className: 'dnt-note', style: { marginTop: 12 } }, t('updateHint')))
1155
+ h('button', { type: 'button', style: S.button, disabled: busy, onClick: props.checkUpdate }, t('checkUpdate')),
1156
+ state.phase === 'available' ? h('button', { type: 'button', style: { ...S.button, background: 'var(--dnt-accent)', color: '#fff', borderColor: 'transparent' }, onClick: props.openPluginUpdate }, t('openPluginUpdate')) : null)),
1157
+ ['unavailable', 'manual', 'local'].includes(state.phase) ? null : h('p', { className: 'dnt-note', style: { marginTop: 12 } }, t('updateHint')))
1169
1158
  }
1170
1159
 
1171
1160
  function WhaleIcon({ size = 16 }) {
@@ -1209,7 +1198,13 @@ window.__ModuleLoader__.load({
1209
1198
  const t = ctx.locale.bind(LOCALE_NS)
1210
1199
  ctx.effect(() => ctx.locale.register(LOCALE_NS, { zh: { ...zh, CNY: '¥ 人民币', USD: '$ 美元' }, en: { ...en, CNY: '¥ CNY', USD: '$ USD' } }), 'notify-tray: settings dictionaries')
1211
1200
  const card = new Controller(ctx.configForms.get(NS))
1212
- const updater = new UpdateController(() => ctx.get?.('remote.pluginManager') || ctx.remote?.pluginManager, () => card.flush())
1201
+ // The native Plugins panel outlives this bundle when DSH unloads it mid-update.
1202
+ const updater = new UpdateController(() => ctx.get?.('remote.pluginManager') || ctx.remote?.pluginManager, () => card.flush(), () => {
1203
+ const navigation = ctx.get?.('pluginNavigation')
1204
+ if (!navigation?.openBundle) return false
1205
+ navigation.openBundle('dsh-notify-tray')
1206
+ return true
1207
+ })
1213
1208
  ctx.effect(() => () => updater.dispose(), 'notify-tray: updates')
1214
1209
  ctx.effect(() => () => card.dispose(), 'notify-tray: settings form')
1215
1210
  // DSH owns sidebar navigation and README rendering on the plugin page.
@@ -1222,7 +1217,7 @@ window.__ModuleLoader__.load({
1222
1217
  locale: LOCALE_NS,
1223
1218
  inject: () => {
1224
1219
  const face = card.inject()
1225
- return { ...face, hooks: { ...face.hooks, notifyUpdate: updater.store }, checkUpdate: () => updater.check(), installUpdate: () => updater.update() }
1220
+ return { ...face, hooks: { ...face.hooks, notifyUpdate: updater.store }, checkUpdate: () => updater.check(), openPluginUpdate: () => updater.open() }
1226
1221
  },
1227
1222
  }, Page))
1228
1223
  const stopSidebar = pageCtx.slots.inject('sidebar.panellist', () => pageCtx.slots.register({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-notify-tray",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "DeepSeek Harness 通知 + 状态栏插件:任务完成、需要输入、需要选择时弹系统通知(macOS / Windows / Linux);macOS 与 Linux(含 UOS、Deepin、麒麟)状态栏常驻小图标,显示任务进度与花费。Windows 没有状态栏,只弹通知。",
5
5
  "keywords": [
6
6
  "deepseek",