dsh-notify-tray 0.1.10 → 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,8 +92,8 @@ 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
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.
package/README.md CHANGED
@@ -92,8 +92,8 @@
92
92
  侧栏设置页底部提供「版本更新」卡片:
93
93
 
94
94
  - 打开设置页时自动检查,也可以点击「检查更新」。
95
- - 发现兼容且未废弃的正式版时,显示新版本号和「立即更新」。点击后先保存设置,再交给 DSH 原生插件管理器更新。
96
- - 安装不会自动开始;DSH 负责版本兼容性检查和失败时的恢复。页面会区分更新完成、需要重启、恢复旧版和结果尚未确认。
95
+ - 发现兼容的正式版后,点击「在插件管理中更新」。小鲸鱼会先保存设置,再打开 DSH 自带的小鲸鱼插件详情。
96
+ - 展开「版本」,选择目标版本并确认。更新进度、结果和重启提示都显示在 DSH 插件管理页。旧版卸载时,小鲸鱼的侧栏入口会暂时消失,请等安装完成后再按提示重启。
97
97
  - 本地目录、Git 等非 npm 安装不支持这条在线更新流程,会显示原因。需等正式版发布到 npm 后,通过插件管理页改为 npm 安装。
98
98
 
99
99
  使用 0.1.8 或 0.1.9 时,如果设置页提示「当前 DSH 未提供可用的插件更新权限或接口」,请打开 DSH「插件 → 小鲸鱼通知站 → 版本」,展开版本列表并选择要更新到的版本。提示需要重启时,请重启 DSH。
package/README.zh-CN.md CHANGED
@@ -92,8 +92,8 @@
92
92
  侧栏设置页底部提供「版本更新」卡片:
93
93
 
94
94
  - 打开设置页时自动检查,也可以点击「检查更新」。
95
- - 发现兼容且未废弃的正式版时,显示新版本号和「立即更新」。点击后先保存设置,再交给 DSH 原生插件管理器更新。
96
- - 安装不会自动开始;DSH 负责版本兼容性检查和失败时的恢复。页面会区分更新完成、需要重启、恢复旧版和结果尚未确认。
95
+ - 发现兼容的正式版后,点击「在插件管理中更新」。小鲸鱼会先保存设置,再打开 DSH 自带的小鲸鱼插件详情。
96
+ - 展开「版本」,选择目标版本并确认。更新进度、结果和重启提示都显示在 DSH 插件管理页。旧版卸载时,小鲸鱼的侧栏入口会暂时消失,请等安装完成后再按提示重启。
97
97
  - 本地目录、Git 等非 npm 安装不支持这条在线更新流程,会显示原因。需等正式版发布到 npm 后,通过插件管理页改为 npm 安装。
98
98
 
99
99
  使用 0.1.8 或 0.1.9 时,如果设置页提示「当前 DSH 未提供可用的插件更新权限或接口」,请打开 DSH「插件 → 小鲸鱼通知站 → 版本」,展开版本列表并选择要更新到的版本。提示需要重启时,请重启 DSH。
package/lib/client.js CHANGED
@@ -112,23 +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
123
  update_unavailable: '此页无法检查更新,请在 DSH 的「插件」页查看。',
124
+ update_manual: '请打开 DSH「插件 → 小鲸鱼通知站 → 版本」,选择要更新到的版本。',
124
125
  update_local: '当前插件来自本地目录或 Git 等来源。此页仅检查 npm 安装的插件。',
125
- update_updating: '正在更新,请稍候…',
126
- update_updated: '更新已完成',
127
- update_restart: '更新已安装,重启 DSH 后生效',
128
- update_error: '检查或更新失败,可重新检查后再试',
129
- update_unknown: '更新结果尚未确认,请到插件管理页查看,避免重复操作。',
130
- update_restored: '更新失败,DSH 已恢复旧版本;如提示需要重启,请重启 DSH。',
131
- update_broken: '更新与恢复均未完成,请到插件管理页处理。',
126
+ update_opening: '正在打开插件管理…',
127
+ update_error: '版本检查失败,请重试',
132
128
  updateSaveFirst: '设置尚未保存,请先检查输入或重试保存。',
133
129
  installedVersion: '当前版本',
134
130
  newVersion: '新版本',
@@ -293,23 +289,19 @@ window.__ModuleLoader__.load({
293
289
  fixSettings: 'Check your input to save automatically',
294
290
  retrySave: 'Retry saving',
295
291
  updateTitle: 'Updates',
296
- 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.',
297
293
  checkUpdate: 'Check for updates',
298
- installUpdate: 'Update now',
294
+ openPluginUpdate: 'Update in Plugins',
299
295
  update_idle: 'Ready to check for updates',
300
296
  update_checking: 'Checking for updates…',
301
297
  update_available: 'A new version is available',
302
298
  update_current: 'You have the latest stable version',
303
299
  update_blocked: 'Newer versions exist, but no compatible stable release is available',
304
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.',
305
302
  update_local: 'This plugin was installed from a local directory, Git, or another source. This page checks npm installations only.',
306
- update_updating: 'Updating, please wait…',
307
- update_updated: 'Update complete',
308
- update_restart: 'Update installed. Restart DSH to use it.',
309
- update_error: 'Check or update failed. Check again to retry.',
310
- update_unknown: 'The update outcome is unknown. Check plugin management before trying again.',
311
- update_restored: 'Update failed; DSH restored the previous version. Restart DSH if requested.',
312
- update_broken: 'Update and recovery did not complete. Open plugin management to resolve this.',
303
+ update_opening: 'Opening Plugins…',
304
+ update_error: 'Version check failed. Check again to retry.',
313
305
  updateSaveFirst: 'Settings are not saved. Check your input or retry saving first.',
314
306
  installedVersion: 'Installed',
315
307
  newVersion: 'New version',
@@ -620,8 +612,9 @@ window.__ModuleLoader__.load({
620
612
  // All update decisions and package mutations belong to DSH's plugin manager.
621
613
  // The browser never runs a shell or chooses an unverified registry version.
622
614
  class UpdateController {
623
- constructor(getManager, flush) {
615
+ constructor(getManager, flush, openBundle) {
624
616
  this.getManager = getManager
617
+ this.openBundle = openBundle
625
618
  this.flush = flush
626
619
  this.listeners = new Set()
627
620
  this.snapshot = { phase: 'idle' }
@@ -639,10 +632,10 @@ window.__ModuleLoader__.load({
639
632
  }
640
633
 
641
634
  async check() {
642
- if (this.disposed || ['checking', 'updating', 'restart'].includes(this.snapshot.phase)) return
635
+ if (this.disposed || ['checking', 'opening'].includes(this.snapshot.phase)) return
643
636
  const manager = this.getManager()
644
637
  this.patch({ phase: 'checking', candidate: undefined, error: undefined })
645
- if (!manager?.listBundles || !manager.listVersions || !manager.updateBundle) return this.patch({ phase: 'unavailable' })
638
+ if (!manager?.listBundles || !manager.listVersions) return this.patch({ phase: 'unavailable' })
646
639
  try {
647
640
  const inventory = await manager.listBundles()
648
641
  if (!inventory.ok) throw new Error(inventory.error?.message || 'Plugin inventory unavailable')
@@ -659,33 +652,22 @@ window.__ModuleLoader__.load({
659
652
  const list = answer.value
660
653
  if (list.status !== 'listed') throw new Error(list.reason || 'Version check refused')
661
654
  const candidate = list.versions.find(v => v.bundle && !v.incompatible && !v.deprecated && !v.prerelease)
662
- 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 })
663
656
  } catch (error) {
664
657
  this.patch({ phase: 'error', error: String(error.message || error) })
665
658
  }
666
659
  }
667
660
 
668
- async update() {
661
+ async open() {
669
662
  if (this.disposed || this.snapshot.phase !== 'available') return
670
- const { candidate, registry } = this.snapshot
671
- this.patch({ phase: 'updating', error: undefined })
663
+ this.patch({ phase: 'opening', error: undefined })
672
664
  try {
673
665
  if (!await this.flush()) return this.patch({ phase: 'available', error: 'updateSaveFirst' })
674
666
  if (this.disposed) return
675
- const manager = this.getManager()
676
- const answer = await manager.updateBundle('dsh-notify-tray', candidate, { registry })
677
- if (!answer.ok) return this.patch({ phase: 'unknown', error: answer.error?.message })
678
- const result = answer.value
679
- const application = result.result?.application
680
- if (application === 'applied' || application === 'restart-required') {
681
- this.patch({ phase: application === 'restart-required' ? 'restart' : 'updated', installed: candidate, candidate: undefined })
682
- } else {
683
- const restored = result.restore?.application
684
- this.patch({ phase: restored === 'applied' || restored === 'restart-required' ? 'restored' : restored ? 'broken' : 'error', error: result.result?.error?.diagnostic || result.result?.error?.code || application })
685
- }
667
+ if (!this.openBundle()) return this.patch({ phase: 'manual' })
668
+ this.patch({ phase: 'available' })
686
669
  } catch (error) {
687
- // A disconnected client cannot assume an update failed; the host may still finish it.
688
- this.patch({ phase: 'unknown', error: String(error.message || error) })
670
+ this.patch({ phase: 'manual', error: String(error.message || error) })
689
671
  }
690
672
  }
691
673
 
@@ -1160,7 +1142,7 @@ window.__ModuleLoader__.load({
1160
1142
  const t = props.t
1161
1143
  const state = props.useNotifyUpdate(snapshot => snapshot)
1162
1144
  React.useEffect(() => { props.checkUpdate() }, [])
1163
- const busy = state.phase === 'checking' || state.phase === 'updating'
1145
+ const busy = state.phase === 'checking' || state.phase === 'opening'
1164
1146
  return h(Section, { title: t('updateTitle'), icon: 'update' },
1165
1147
  h('div', { className: 'dnt-update-row' },
1166
1148
  h('div', { style: { flex: '1 1 240px', minWidth: 0 } },
@@ -1170,9 +1152,9 @@ window.__ModuleLoader__.load({
1170
1152
  h('p', { className: 'dnt-note', role: 'status' }, t(`update_${state.phase}`)),
1171
1153
  state.error ? h('p', { className: 'dnt-note', style: S.error, role: 'alert' }, state.error === 'updateSaveFirst' ? t(state.error) : state.error) : null),
1172
1154
  h('div', { className: 'dnt-update-actions' },
1173
- h('button', { type: 'button', style: S.button, disabled: busy || state.phase === 'restart', onClick: props.checkUpdate }, t('checkUpdate')),
1174
- state.phase === 'available' ? h('button', { type: 'button', style: { ...S.button, background: 'var(--dnt-accent)', color: '#fff', borderColor: 'transparent' }, onClick: props.installUpdate }, t('installUpdate')) : null)),
1175
- state.phase === 'unavailable' || state.phase === 'local' ? null : 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')))
1176
1158
  }
1177
1159
 
1178
1160
  function WhaleIcon({ size = 16 }) {
@@ -1216,7 +1198,13 @@ window.__ModuleLoader__.load({
1216
1198
  const t = ctx.locale.bind(LOCALE_NS)
1217
1199
  ctx.effect(() => ctx.locale.register(LOCALE_NS, { zh: { ...zh, CNY: '¥ 人民币', USD: '$ 美元' }, en: { ...en, CNY: '¥ CNY', USD: '$ USD' } }), 'notify-tray: settings dictionaries')
1218
1200
  const card = new Controller(ctx.configForms.get(NS))
1219
- 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
+ })
1220
1208
  ctx.effect(() => () => updater.dispose(), 'notify-tray: updates')
1221
1209
  ctx.effect(() => () => card.dispose(), 'notify-tray: settings form')
1222
1210
  // DSH owns sidebar navigation and README rendering on the plugin page.
@@ -1229,7 +1217,7 @@ window.__ModuleLoader__.load({
1229
1217
  locale: LOCALE_NS,
1230
1218
  inject: () => {
1231
1219
  const face = card.inject()
1232
- 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() }
1233
1221
  },
1234
1222
  }, Page))
1235
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.10",
3
+ "version": "0.1.11",
4
4
  "description": "DeepSeek Harness 通知 + 状态栏插件:任务完成、需要输入、需要选择时弹系统通知(macOS / Windows / Linux);macOS 与 Linux(含 UOS、Deepin、麒麟)状态栏常驻小图标,显示任务进度与花费。Windows 没有状态栏,只弹通知。",
5
5
  "keywords": [
6
6
  "deepseek",