dsh-reminder-notify 0.10.2 → 0.11.0
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 +16 -1
- package/client.js +238 -2
- package/cordis.patch.yml +27 -0
- package/docs/PUBLISH.md +6 -3
- package/docs/detail.en.md +13 -1
- package/docs/detail.zh.md +16 -1
- package/host/ReminderHost.ps1 +217 -31
- package/index.js +416 -29
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,7 +21,17 @@ dsh plugin --profile desktop add link:<本目录绝对路径>
|
|
|
21
21
|
| 要用户拍板 | `notify_user(kind="decide")` |
|
|
22
22
|
| 自定义 | `notify_user(kind="raw", title="…", message="…", seconds=20, sound=false)` |
|
|
23
23
|
|
|
24
|
-
返回值是 JSON(`pid`、`host`、`audio`、`hostMode
|
|
24
|
+
返回值是 JSON(`pid`、`host`、`audio`、`hostMode`、`queued` 等),失败也不抛异常。
|
|
25
|
+
|
|
26
|
+
0.11 起卡片的行为:
|
|
27
|
+
|
|
28
|
+
- 卡片右下角有「知道了」和「稍后提醒」(`buttonsEnabled`,默认开);点「稍后」会过 `snoozeMinutes` 分钟再弹一次。
|
|
29
|
+
- 多条提醒**排队**显示(`queueEnabled`);同档位在 `mergeWindowMs` 内再次触发会**并进**排队中的那一条,不重复弹。
|
|
30
|
+
- **免打扰时段**(`quietEnabled` + `quietStart`/`quietEnd`,`quietMode: hold|skip`)只压「完成」和普通提醒,「需要你来决定」照弹。
|
|
31
|
+
- 前台是全屏应用时自动换窄卡片(`compactOnFullscreen`)。
|
|
32
|
+
- `speakEnabled` 用系统语音把标题和正文念出来(需要中文语音包)。
|
|
33
|
+
- 每条结果写进 `~/.dsh/dsh-reminder-notify/history.json`(`historyEnabled` / `historyLimit`),
|
|
34
|
+
插件页「历史与统计」里能看到总计 / 今日条数和最近记录,可以一键清空。
|
|
25
35
|
|
|
26
36
|
## 资产
|
|
27
37
|
|
|
@@ -47,6 +57,11 @@ dsh plugin --profile desktop add link:<本目录绝对路径>
|
|
|
47
57
|
`sound`、`doneAudio`/`decideAudio`、`accentDone`/`accentDecide`/`accentRaw`、`cooldownMs`(默认 1500)。
|
|
48
58
|
`hostMode` 切宿主实现,`scriptPath`/`powershellPath`/`audioDir` 一般不用动。
|
|
49
59
|
|
|
60
|
+
0.11 新增:`speakEnabled`、`buttonsEnabled`、`snoozeMinutes`(10)、`queueEnabled`、`queueMax`(5)、
|
|
61
|
+
`mergeWindowMs`(3000)、`quietEnabled`、`quietStart`(`22:00`)、`quietEnd`(`08:00`)、
|
|
62
|
+
`quietMode`(`hold`/`skip`)、`compactOnFullscreen`、`historyEnabled`、`historyLimit`(200)、
|
|
63
|
+
`historyFile`(留空 = `~/.dsh/dsh-reminder-notify/history.json`)。
|
|
64
|
+
|
|
50
65
|
## 已知限制
|
|
51
66
|
|
|
52
67
|
- 仅 Windows(`os: ["win32"]`):卡片宿主是 WinForms。
|
package/client.js
CHANGED
|
@@ -20,6 +20,8 @@ window.__ModuleLoader__.load({
|
|
|
20
20
|
const AUDIO_KEYS = ['doneAudio', 'decideAudio', 'rawAudio']
|
|
21
21
|
const PREVIEW_ROUTE = '/dsh-reminder-notify/preview'
|
|
22
22
|
const BALANCE_ROUTE = '/dsh-reminder-notify/balance'
|
|
23
|
+
// 0.11 新增:提醒历史(GET 拿统计+最近记录,POST { mode: 'clear' } 清空)。
|
|
24
|
+
const HISTORY_ROUTE = '/dsh-reminder-notify/history'
|
|
23
25
|
// 下拉按扩展名分组:wav 一组、mp3 一组……组内按文件名排序,一眼能看出格式。
|
|
24
26
|
function groupAudioFiles(files) {
|
|
25
27
|
const byExt = new Map()
|
|
@@ -244,6 +246,111 @@ window.__ModuleLoader__.load({
|
|
|
244
246
|
secondsUnit: 's',
|
|
245
247
|
}
|
|
246
248
|
|
|
249
|
+
// 0.11 新增文案:排队与合并、卡片按钮、免打扰、全屏降级、语音、历史与统计。
|
|
250
|
+
Object.assign(zh, {
|
|
251
|
+
groupQueue: '排队与免打扰',
|
|
252
|
+
groupHistory: '历史与统计',
|
|
253
|
+
speakEnabled: '朗读提醒内容',
|
|
254
|
+
buttonsEnabled: '卡片显示按钮',
|
|
255
|
+
snoozeMinutes: '「稍后提醒」延后分钟',
|
|
256
|
+
queueEnabled: '提醒排队显示',
|
|
257
|
+
queueMax: '排队上限',
|
|
258
|
+
mergeWindowMs: '合并窗口(毫秒)',
|
|
259
|
+
quietEnabled: '免打扰时段',
|
|
260
|
+
quietStart: '免打扰开始',
|
|
261
|
+
quietEnd: '免打扰结束',
|
|
262
|
+
quietMode: '免打扰处理方式',
|
|
263
|
+
quietModeHold: '留到结束后补弹',
|
|
264
|
+
quietModeSkip: '直接跳过',
|
|
265
|
+
compactOnFullscreen: '全屏时用紧凑卡片',
|
|
266
|
+
historyEnabled: '记录提醒历史',
|
|
267
|
+
historyLimit: '历史保留条数',
|
|
268
|
+
speakEnabledHint: '用系统语音把标题和正文念出来;要装中文语音包,没装就静音。',
|
|
269
|
+
buttonsEnabledHint: '卡片右下角给出「知道了」和「稍后提醒」;关掉就只剩自动关闭,点卡片仍可提前关。',
|
|
270
|
+
snoozeMinutesHint: '点「稍后提醒」后隔多久再弹一次。',
|
|
271
|
+
queueEnabledHint: '关掉后多条提醒会同时叠在屏幕上。',
|
|
272
|
+
queueMaxHint: '排队最多留几条,超出的丢掉最旧的。',
|
|
273
|
+
mergeWindowMsHint: '同档位在这段时间内再次触发,会并进排队中的那一条,不重复弹。',
|
|
274
|
+
quietEnabledHint: '时段内不再弹「完成」和普通提醒;「需要你来决定」不受影响。',
|
|
275
|
+
quietStartHint: '24 小时制,例如 22:00。',
|
|
276
|
+
quietEndHint: '跨零点会自动识别,例如 08:00。',
|
|
277
|
+
quietModeHint: '留到时段结束后补弹(holding),还是这段时间内直接不提醒。',
|
|
278
|
+
compactOnFullscreenHint: '检测到前台是全屏应用时改用窄卡片,少挡内容。',
|
|
279
|
+
historyEnabledHint: '每条提醒的结果都会记下来(自动关闭 / 点了按钮 / 稍后提醒 / 免打扰跳过)。',
|
|
280
|
+
historyLimitHint: '超过这个条数就丢掉最旧的记录。',
|
|
281
|
+
historyStatus: '提醒统计',
|
|
282
|
+
historyLoading: '读取中…',
|
|
283
|
+
historyUnavailable: '读不到历史文件:',
|
|
284
|
+
historyDisabled: '历史记录已关闭。',
|
|
285
|
+
historyTotalPrefix: '共 ',
|
|
286
|
+
historyTotalMid: ' 条 · 今天 ',
|
|
287
|
+
historyTotalSuffix: ' 条',
|
|
288
|
+
historyRefresh: '刷新',
|
|
289
|
+
historyRefreshing: '读取中…',
|
|
290
|
+
historyClear: '清空',
|
|
291
|
+
historyRecent: '最近记录',
|
|
292
|
+
historyKindDone: '完成',
|
|
293
|
+
historyKindDecide: '要你决定',
|
|
294
|
+
historyKindRaw: '普通',
|
|
295
|
+
historyActionTimeout: '自动关闭',
|
|
296
|
+
historyActionDismiss: '点了卡片',
|
|
297
|
+
historyActionOk: '知道了',
|
|
298
|
+
historyActionSnooze: '稍后提醒',
|
|
299
|
+
historyActionQuietSkip: '免打扰跳过',
|
|
300
|
+
})
|
|
301
|
+
|
|
302
|
+
Object.assign(en, {
|
|
303
|
+
groupQueue: 'Queue & quiet hours',
|
|
304
|
+
groupHistory: 'History & stats',
|
|
305
|
+
speakEnabled: 'Speak the reminder',
|
|
306
|
+
buttonsEnabled: 'Show card buttons',
|
|
307
|
+
snoozeMinutes: 'Snooze minutes',
|
|
308
|
+
queueEnabled: 'Queue reminders',
|
|
309
|
+
queueMax: 'Queue limit',
|
|
310
|
+
mergeWindowMs: 'Merge window (ms)',
|
|
311
|
+
quietEnabled: 'Quiet hours',
|
|
312
|
+
quietStart: 'Quiet from',
|
|
313
|
+
quietEnd: 'Quiet until',
|
|
314
|
+
quietMode: 'Quiet-hours behaviour',
|
|
315
|
+
quietModeHold: 'Hold until it ends',
|
|
316
|
+
quietModeSkip: 'Skip it',
|
|
317
|
+
compactOnFullscreen: 'Compact card on fullscreen',
|
|
318
|
+
historyEnabled: 'Keep reminder history',
|
|
319
|
+
historyLimit: 'History entries kept',
|
|
320
|
+
speakEnabledHint: 'Read the title and body with the system voice; needs a Chinese voice pack, otherwise silent.',
|
|
321
|
+
buttonsEnabledHint: 'Show “Got it” and “Snooze” on the card. Off means auto-dismiss only; clicking the card still closes it.',
|
|
322
|
+
snoozeMinutesHint: 'How long to wait before the snoozed reminder pops again.',
|
|
323
|
+
queueEnabledHint: 'Off means several reminders stack on screen at once.',
|
|
324
|
+
queueMaxHint: 'How many queued reminders to keep; the oldest are dropped.',
|
|
325
|
+
mergeWindowMsHint: 'Same-kind reminders within this window merge into the queued one instead of popping twice.',
|
|
326
|
+
quietEnabledHint: 'No “done” or plain reminders during this window; “needs your call” is never suppressed.',
|
|
327
|
+
quietStartHint: '24-hour clock, for example 22:00.',
|
|
328
|
+
quietEndHint: 'Midnight crossing is handled, for example 08:00.',
|
|
329
|
+
quietModeHint: 'Hold them until the window ends, or skip them entirely.',
|
|
330
|
+
compactOnFullscreenHint: 'Use a narrower card when a fullscreen app is in front.',
|
|
331
|
+
historyEnabledHint: 'Every reminder result is recorded (auto-close / button / snooze / quiet-skip).',
|
|
332
|
+
historyLimitHint: 'Older entries are dropped past this count.',
|
|
333
|
+
historyStatus: 'Reminder stats',
|
|
334
|
+
historyLoading: 'Reading…',
|
|
335
|
+
historyUnavailable: 'Cannot read the history file: ',
|
|
336
|
+
historyDisabled: 'History recording is off.',
|
|
337
|
+
historyTotalPrefix: '',
|
|
338
|
+
historyTotalMid: ' total · ',
|
|
339
|
+
historyTotalSuffix: ' today',
|
|
340
|
+
historyRefresh: 'Refresh',
|
|
341
|
+
historyRefreshing: 'Reading…',
|
|
342
|
+
historyClear: 'Clear',
|
|
343
|
+
historyRecent: 'Recent entries',
|
|
344
|
+
historyKindDone: 'done',
|
|
345
|
+
historyKindDecide: 'needs you',
|
|
346
|
+
historyKindRaw: 'plain',
|
|
347
|
+
historyActionTimeout: 'auto-closed',
|
|
348
|
+
historyActionDismiss: 'clicked',
|
|
349
|
+
historyActionOk: 'got it',
|
|
350
|
+
historyActionSnooze: 'snoozed',
|
|
351
|
+
historyActionQuietSkip: 'quiet-skip',
|
|
352
|
+
})
|
|
353
|
+
|
|
247
354
|
const CSS = `
|
|
248
355
|
.drn-panel { display: flex; flex-direction: column; gap: 18px; color: var(--dsw-alias-label-primary); }
|
|
249
356
|
.drn-head { display: flex; flex-direction: column; gap: 4px; }
|
|
@@ -305,6 +412,20 @@ window.__ModuleLoader__.load({
|
|
|
305
412
|
{ key: 'balanceThresholds', group: 'balance', kind: 'text' },
|
|
306
413
|
{ key: 'balanceCheckMinutes', group: 'balance', kind: 'number' },
|
|
307
414
|
{ key: 'balanceSpeak', group: 'balance', kind: 'boolean' },
|
|
415
|
+
// 0.11:排队与合并、卡片按钮、免打扰、全屏降级、语音。
|
|
416
|
+
{ key: 'speakEnabled', group: 'queue', kind: 'boolean' },
|
|
417
|
+
{ key: 'buttonsEnabled', group: 'queue', kind: 'boolean' },
|
|
418
|
+
{ key: 'snoozeMinutes', group: 'queue', kind: 'number' },
|
|
419
|
+
{ key: 'queueEnabled', group: 'queue', kind: 'boolean' },
|
|
420
|
+
{ key: 'queueMax', group: 'queue', kind: 'number' },
|
|
421
|
+
{ key: 'mergeWindowMs', group: 'queue', kind: 'number' },
|
|
422
|
+
{ key: 'quietEnabled', group: 'queue', kind: 'boolean' },
|
|
423
|
+
{ key: 'quietStart', group: 'queue', kind: 'text' },
|
|
424
|
+
{ key: 'quietEnd', group: 'queue', kind: 'text' },
|
|
425
|
+
{ key: 'quietMode', group: 'queue', kind: 'select', options: ['hold', 'skip'], optionLabels: ['quietModeHold', 'quietModeSkip'] },
|
|
426
|
+
{ key: 'compactOnFullscreen', group: 'queue', kind: 'boolean' },
|
|
427
|
+
{ key: 'historyEnabled', group: 'history', kind: 'boolean' },
|
|
428
|
+
{ key: 'historyLimit', group: 'history', kind: 'number' },
|
|
308
429
|
{ key: 'hostMode', group: 'host', kind: 'select', options: ['script', 'exe'], optionLabels: ['hostModeScript', 'hostModeExe'] },
|
|
309
430
|
{ key: 'scriptPath', group: 'host', kind: 'text' },
|
|
310
431
|
{ key: 'powershellPath', group: 'host', kind: 'text' },
|
|
@@ -338,10 +459,23 @@ window.__ModuleLoader__.load({
|
|
|
338
459
|
balanceThresholds: 'balanceThresholdsHint',
|
|
339
460
|
balanceCheckMinutes: 'balanceCheckHint',
|
|
340
461
|
balanceSpeak: 'balanceSpeakHint',
|
|
462
|
+
speakEnabled: 'speakEnabledHint',
|
|
463
|
+
buttonsEnabled: 'buttonsEnabledHint',
|
|
464
|
+
snoozeMinutes: 'snoozeMinutesHint',
|
|
465
|
+
queueEnabled: 'queueEnabledHint',
|
|
466
|
+
queueMax: 'queueMaxHint',
|
|
467
|
+
mergeWindowMs: 'mergeWindowMsHint',
|
|
468
|
+
quietEnabled: 'quietEnabledHint',
|
|
469
|
+
quietStart: 'quietStartHint',
|
|
470
|
+
quietEnd: 'quietEndHint',
|
|
471
|
+
quietMode: 'quietModeHint',
|
|
472
|
+
compactOnFullscreen: 'compactOnFullscreenHint',
|
|
473
|
+
historyEnabled: 'historyEnabledHint',
|
|
474
|
+
historyLimit: 'historyLimitHint',
|
|
341
475
|
}
|
|
342
476
|
|
|
343
|
-
const GROUPS = ['basic', 'audio', 'look', 'balance', 'host']
|
|
344
|
-
const GROUP_LABELS = { basic: 'groupBasic', audio: 'groupAudio', look: 'groupLook', balance: 'groupBalance', host: 'groupHost' }
|
|
477
|
+
const GROUPS = ['basic', 'audio', 'look', 'queue', 'history', 'balance', 'host']
|
|
478
|
+
const GROUP_LABELS = { basic: 'groupBasic', audio: 'groupAudio', look: 'groupLook', queue: 'groupQueue', history: 'groupHistory', balance: 'groupBalance', host: 'groupHost' }
|
|
345
479
|
|
|
346
480
|
function sameValue(a, b) {
|
|
347
481
|
return JSON.stringify(a) === JSON.stringify(b)
|
|
@@ -363,6 +497,8 @@ window.__ModuleLoader__.load({
|
|
|
363
497
|
const [audio, setAudio] = React.useState({ dir: '', files: [], error: null })
|
|
364
498
|
const [balance, setBalance] = React.useState(null)
|
|
365
499
|
const [balanceBusy, setBalanceBusy] = React.useState(false)
|
|
500
|
+
const [history, setHistory] = React.useState(null)
|
|
501
|
+
const [historyBusy, setHistoryBusy] = React.useState(false)
|
|
366
502
|
|
|
367
503
|
React.useEffect(() => {
|
|
368
504
|
if (typeof fetch !== 'function') {
|
|
@@ -422,6 +558,7 @@ window.__ModuleLoader__.load({
|
|
|
422
558
|
// 打开面板时读一次余额快照(不触发提醒,只是显示)。
|
|
423
559
|
React.useEffect(() => {
|
|
424
560
|
refreshBalance()
|
|
561
|
+
refreshHistory()
|
|
425
562
|
}, [])
|
|
426
563
|
|
|
427
564
|
if (props.view === 'summary') {
|
|
@@ -638,6 +775,61 @@ window.__ModuleLoader__.load({
|
|
|
638
775
|
balanceFetch({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'application/json' }, body: JSON.stringify({ mode: 'reset' }) })
|
|
639
776
|
}
|
|
640
777
|
|
|
778
|
+
// 历史:GET 拿统计与最近记录,POST { mode: 'clear' } 清空。
|
|
779
|
+
function historyFetch(options) {
|
|
780
|
+
setHistoryBusy(true)
|
|
781
|
+
Promise.resolve()
|
|
782
|
+
.then(() => fetch(HISTORY_ROUTE, options))
|
|
783
|
+
.then((response) => (response && typeof response.json === 'function' ? response.json() : Promise.resolve(null)))
|
|
784
|
+
.then((data) => {
|
|
785
|
+
setHistoryBusy(false)
|
|
786
|
+
if (data && typeof data === 'object') setHistory(data)
|
|
787
|
+
else setHistory({ ok: false, error: 'empty-response' })
|
|
788
|
+
})
|
|
789
|
+
.catch((error) => {
|
|
790
|
+
setHistoryBusy(false)
|
|
791
|
+
setHistory({ ok: false, error: String((error && error.message) || error) })
|
|
792
|
+
})
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
function refreshHistory() {
|
|
796
|
+
historyFetch({ headers: { accept: 'application/json' } })
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
function clearHistory() {
|
|
800
|
+
historyFetch({ method: 'POST', headers: { 'content-type': 'application/json', accept: 'application/json' }, body: JSON.stringify({ mode: 'clear' }) })
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
function historyText() {
|
|
804
|
+
const label = typeof t === 'function' ? t : (key) => key
|
|
805
|
+
if (history === null) return label('historyLoading')
|
|
806
|
+
if (history.ok === false) {
|
|
807
|
+
return label('historyUnavailable') + (history.error ? '(' + String(history.error) + ')' : '')
|
|
808
|
+
}
|
|
809
|
+
if (history.enabled === false) return label('historyDisabled')
|
|
810
|
+
const stats = history.stats || {}
|
|
811
|
+
const total = Number(stats.total) || 0
|
|
812
|
+
const today = Number(stats.today) || 0
|
|
813
|
+
return label('historyTotalPrefix') + total + label('historyTotalMid') + today + label('historyTotalSuffix')
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function entryText(entry) {
|
|
817
|
+
const label = typeof t === 'function' ? t : (key) => key
|
|
818
|
+
const kinds = { done: 'historyKindDone', decide: 'historyKindDecide', raw: 'historyKindRaw' }
|
|
819
|
+
const actions = {
|
|
820
|
+
timeout: 'historyActionTimeout',
|
|
821
|
+
dismiss: 'historyActionDismiss',
|
|
822
|
+
ok: 'historyActionOk',
|
|
823
|
+
snooze: 'historyActionSnooze',
|
|
824
|
+
'quiet-skip': 'historyActionQuietSkip',
|
|
825
|
+
}
|
|
826
|
+
const head = [shortTime(entry.at), label(kinds[entry.kind] || 'historyKindRaw'), label(actions[entry.action] || entry.action)]
|
|
827
|
+
if (entry.count > 1) head.push('×' + entry.count)
|
|
828
|
+
const text = String(entry.message || '').replace(/\s+/g, ' ').slice(0, 46)
|
|
829
|
+
if (text !== '') head.push(text)
|
|
830
|
+
return head.filter(Boolean).join(' · ')
|
|
831
|
+
}
|
|
832
|
+
|
|
641
833
|
function control(field) {
|
|
642
834
|
const value = effective[field.key]
|
|
643
835
|
const disabled = !writable || busy
|
|
@@ -744,6 +936,50 @@ window.__ModuleLoader__.load({
|
|
|
744
936
|
h('div', { className: 'drn-control' }, control(field)),
|
|
745
937
|
),
|
|
746
938
|
)
|
|
939
|
+
if (group === 'history') {
|
|
940
|
+
const label = typeof t === 'function' ? t : (key) => key
|
|
941
|
+
rows.push(
|
|
942
|
+
h(
|
|
943
|
+
'div',
|
|
944
|
+
{ className: 'drn-row', key: 'history-status' },
|
|
945
|
+
h(
|
|
946
|
+
'div',
|
|
947
|
+
{ className: 'drn-row-main' },
|
|
948
|
+
h('div', { className: 'drn-label' }, label('historyStatus')),
|
|
949
|
+
h('div', { className: 'drn-hint' }, historyText()),
|
|
950
|
+
),
|
|
951
|
+
h(
|
|
952
|
+
'div',
|
|
953
|
+
{ className: 'drn-pick' },
|
|
954
|
+
h(
|
|
955
|
+
'button',
|
|
956
|
+
{ type: 'button', className: 'drn-btn small', disabled: historyBusy, onClick: refreshHistory },
|
|
957
|
+
label(historyBusy ? 'historyRefreshing' : 'historyRefresh'),
|
|
958
|
+
),
|
|
959
|
+
h(
|
|
960
|
+
'button',
|
|
961
|
+
{ type: 'button', className: 'drn-btn small', disabled: historyBusy, onClick: clearHistory },
|
|
962
|
+
label('historyClear'),
|
|
963
|
+
),
|
|
964
|
+
),
|
|
965
|
+
),
|
|
966
|
+
)
|
|
967
|
+
const entries = history && Array.isArray(history.entries) ? history.entries.slice(0, 8) : []
|
|
968
|
+
if (entries.length > 0) {
|
|
969
|
+
rows.push(
|
|
970
|
+
h(
|
|
971
|
+
'div',
|
|
972
|
+
{ className: 'drn-row', key: 'history-list' },
|
|
973
|
+
h(
|
|
974
|
+
'div',
|
|
975
|
+
{ className: 'drn-row-main' },
|
|
976
|
+
h('div', { className: 'drn-label' }, label('historyRecent')),
|
|
977
|
+
entries.map((entry, index) => h('div', { className: 'drn-hint', key: 'h' + index }, entryText(entry))),
|
|
978
|
+
),
|
|
979
|
+
),
|
|
980
|
+
)
|
|
981
|
+
}
|
|
982
|
+
}
|
|
747
983
|
if (group === 'balance') {
|
|
748
984
|
rows.push(
|
|
749
985
|
h(
|
package/cordis.patch.yml
CHANGED
|
@@ -45,3 +45,30 @@
|
|
|
45
45
|
accentRaw: '#4C8DFF'
|
|
46
46
|
# 同档位提醒的最小间隔(毫秒),防止模型在同一轮重复调用
|
|
47
47
|
cooldownMs: 1500
|
|
48
|
+
# ===== 0.11 新增 =====
|
|
49
|
+
# 用系统语音朗读卡片内容(需要中文语音包,没装就静音)
|
|
50
|
+
speakEnabled: false
|
|
51
|
+
# 卡片右下角显示「知道了 / 稍后提醒」按钮
|
|
52
|
+
buttonsEnabled: true
|
|
53
|
+
# 点「稍后提醒」后隔多久再弹(分钟)
|
|
54
|
+
snoozeMinutes: 10
|
|
55
|
+
# 多条提醒排队显示,不同时叠在屏幕上
|
|
56
|
+
queueEnabled: true
|
|
57
|
+
# 队列最多保留几条,超出的丢最旧的
|
|
58
|
+
queueMax: 5
|
|
59
|
+
# 同档位在这段时间内再次触发会并进排队中的那一条(毫秒,0 = 不合并)
|
|
60
|
+
mergeWindowMs: 3000
|
|
61
|
+
# 免打扰时段:到点不弹「完成」和普通提醒;「需要你来决定」不受影响
|
|
62
|
+
quietEnabled: false
|
|
63
|
+
quietStart: '22:00'
|
|
64
|
+
quietEnd: '08:00'
|
|
65
|
+
# hold = 留到时段结束后补弹;skip = 这段时间内直接跳过
|
|
66
|
+
quietMode: hold
|
|
67
|
+
# 前台是全屏应用时改用窄卡片
|
|
68
|
+
compactOnFullscreen: true
|
|
69
|
+
# 记录每条提醒的结果(自动关闭 / 点按钮 / 稍后 / 免打扰跳过)
|
|
70
|
+
historyEnabled: true
|
|
71
|
+
# 历史保留条数
|
|
72
|
+
historyLimit: 200
|
|
73
|
+
# 历史文件路径;留空 = ~/.dsh/dsh-reminder-notify/history.json
|
|
74
|
+
historyFile: ''
|
package/docs/PUBLISH.md
CHANGED
|
@@ -4,17 +4,20 @@ DSH 的「插件市场 → 发现」页读的是**索引 URL**:一份 JSON(
|
|
|
4
4
|
索引本身不托管代码,只给出版本从哪儿装(`git` 仓库 + 固定提交,或 npm 包名)。
|
|
5
5
|
本目录的 `index.json` 由 `scripts/build-index.mjs` 生成,**不要手改**。
|
|
6
6
|
|
|
7
|
-
## 已发布状态(2026-11-
|
|
7
|
+
## 已发布状态(2026-11-20 更新)
|
|
8
8
|
|
|
9
9
|
| 项目 | 值 |
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| 公开仓库 | https://github.com/Jiangshuaiye1203/dsh-reminder-notify |
|
|
12
12
|
| 索引地址(他人添加这个) | `https://jiangshuaiye1203.github.io/dsh-reminder-notify/publish/index.json` |
|
|
13
13
|
| 站点首页 | https://jiangshuaiye1203.github.io/dsh-reminder-notify/ |
|
|
14
|
-
|
|
|
14
|
+
| npm 包 | https://www.npmjs.com/package/dsh-reminder-notify |
|
|
15
|
+
| 当前版本 | **0.10.2**,装源为 **npm**(`dsh-reminder-notify@0.10.2`),不再是 git 固定提交 |
|
|
15
16
|
| Pages | Deploy from a branch,`main` / `(root)` |
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
发新版(npm 源):改代码 → 升 `package.json` 版本 → `scripts\publish-npm.cmd` 发布到 npm →
|
|
19
|
+
`node scripts/build-index.mjs --npm --publish` → `git push`。
|
|
20
|
+
索引必须指向**已经发到 npm 的版本**,否则别人装下来的还是旧包(详见第 6 节)。
|
|
18
21
|
|
|
19
22
|
## 0. 结构
|
|
20
23
|
|
package/docs/detail.en.md
CHANGED
|
@@ -6,17 +6,29 @@ The card host is the bundled `host/ReminderHost.ps1`, drawn with the system Powe
|
|
|
6
6
|
|
|
7
7
|
## Settings
|
|
8
8
|
|
|
9
|
-
Open "Desktop reminder" in the Plugins page; the panel sits right under the description and has
|
|
9
|
+
Open "Desktop reminder" in the Plugins page; the panel sits right under the description and has seven groups:
|
|
10
10
|
|
|
11
11
|
- **Basics**: duration, position, sound on/off
|
|
12
12
|
- **Sounds**: audio directory ("Browse…" picks a directory), the three per-kind file names (wav / mp3). Once a directory is picked the dropdown lists the audio files in it.
|
|
13
13
|
- **Look**: background image, title icon, accent colours, title/message templates (`{title}` `{message}` `{kind}` `{time}`), plus per-kind overrides for background, icon and templates
|
|
14
|
+
- **Queue & quiet hours**: spoken alerts, card buttons, snooze minutes, queue on/off and limit, merge window, quiet hours and their behaviour, compact card on fullscreen
|
|
15
|
+
- **History & stats**: record or not, entries kept, plus the total/today counts and the last 8 entries with "Refresh" and "Clear"
|
|
14
16
|
- **Host**: script or exe host, script path, PowerShell path
|
|
15
17
|
|
|
16
18
|
Changes apply on "Save" — no restart needed.
|
|
17
19
|
|
|
18
20
|
- **DeepSeek balance**: enable, thresholds (20/10/5 % by default), check interval, spoken alerts; the panel can check now and set the current balance as the baseline
|
|
19
21
|
|
|
22
|
+
## Card behaviour (0.11+)
|
|
23
|
+
|
|
24
|
+
- **Queue**: one card at a time; later reminders wait in a queue (`queueEnabled` / `queueMax`) instead of stacking.
|
|
25
|
+
- **Merge**: the same kind fired again within `mergeWindowMs` (3 s by default) joins the queued entry — bodies are joined line by line, capped at 600 characters.
|
|
26
|
+
- **Buttons**: "Got it" closes immediately; "Snooze" re-fires in `snoozeMinutes` (10 by default). Ignoring it just auto-closes.
|
|
27
|
+
- **Quiet hours**: with `quietEnabled`, no "done" or plain reminders between `quietStart` and `quietEnd` (midnight crossing supported): `hold` delivers them after the window, `skip` drops them. **"Needs your call" always shows.**
|
|
28
|
+
- **Fullscreen fallback**: a narrower card is drawn when a fullscreen app is in front (`compactOnFullscreen`).
|
|
29
|
+
- **Speech**: `speakEnabled` reads title and body through `System.Speech` (needs a Chinese voice pack).
|
|
30
|
+
- **History**: every reminder result is appended (auto-close / card click / got it / snoozed / quiet-skip) to `~/.dsh/dsh-reminder-notify/history.json`, trimmed to `historyLimit`. The panel shows totals, the last 8 entries, and a Clear button.
|
|
31
|
+
|
|
20
32
|
## DeepSeek balance alerts
|
|
21
33
|
|
|
22
34
|
The balance comes from the signed-in DSH account on this machine (host `deepseekAccount` service); no API key is needed.
|
package/docs/detail.zh.md
CHANGED
|
@@ -6,16 +6,31 @@
|
|
|
6
6
|
|
|
7
7
|
## 设置
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
在「插件」页打开「桌面提醒」,描述下方就是设置面板,分七组:
|
|
10
10
|
|
|
11
11
|
- **基本**:停留秒数、弹窗位置、是否播放提示音
|
|
12
12
|
- **提示音**:提示音目录(可点「浏览…」选目录)、三档提示音文件名(wav / mp3),选了目录后下拉框会列出目录里的音频
|
|
13
13
|
- **外观**:背景图、标题图标、强调色、标题/正文模板(`{title}` `{message}` `{kind}` `{time}`),以及每档位单独覆盖的背景 / 图标 / 模板
|
|
14
|
+
- **排队与免打扰**:语音朗读、卡片按钮、「稍后提醒」分钟数、排队开关与上限、合并窗口、免打扰时段与处理方式、全屏时用紧凑卡片
|
|
15
|
+
- **历史与统计**:是否记录、保留条数,面板里直接显示总条数 / 今日条数与最近 8 条记录,可「刷新」和「清空」
|
|
14
16
|
- **DeepSeek 余额**:开关、阈值(默认 20,10,5 %)、检查间隔、是否语音播报;面板里能「立即查询」,也能把当前余额设为基线
|
|
15
17
|
- **宿主**:脚本模式或 exe 模式、脚本路径、PowerShell 路径
|
|
16
18
|
|
|
17
19
|
改完点「保存」,立刻生效,不用重启。
|
|
18
20
|
|
|
21
|
+
## 提醒的行为(0.11 起)
|
|
22
|
+
|
|
23
|
+
- **排队**:一次只显示一张卡,后来的进队列(`queueEnabled` / `queueMax`),不再一叠好几张。
|
|
24
|
+
- **合并**:同档位在 `mergeWindowMs`(默认 3 秒)内再次触发,会并进排队中的那一条,正文按行拼起来、最多 600 字。
|
|
25
|
+
- **按钮**:「知道了」立即关;「稍后提醒」把这条按 `snoozeMinutes`(默认 10)延后重弹。不点按钮就是到时自动关。
|
|
26
|
+
- **免打扰**:`quietEnabled` 打开后,`quietStart`–`quietEnd`(支持跨零点)内不弹「完成」和普通提醒:
|
|
27
|
+
`quietMode: hold` 留到时段结束后补弹,`skip` 直接丢弃;**「需要你来决定」任何时段都照弹**。
|
|
28
|
+
- **全屏降级**:检测到前台是全屏应用时改画窄卡片,少挡内容(`compactOnFullscreen`)。
|
|
29
|
+
- **语音朗读**:`speakEnabled` 用 `System.Speech` 念出标题与正文,需要系统装了中文语音包。
|
|
30
|
+
- **历史**:每条提醒结束都会记一条(自动关闭 / 点了卡片 / 知道了 / 稍后提醒 / 免打扰跳过),
|
|
31
|
+
存在 `~/.dsh/dsh-reminder-notify/history.json`,超过 `historyLimit` 丢最旧的。
|
|
32
|
+
面板里能看到总计与今日条数、最近 8 条,也可以清空。
|
|
33
|
+
|
|
19
34
|
## DeepSeek 余额提醒
|
|
20
35
|
|
|
21
36
|
余额数据来自本机已登录的 DSH 账号(宿主 `deepseekAccount` 服务),不需要 API key。
|