dsh-mishu 0.7.2 → 0.7.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 +34 -4
- package/lib/client.js +670 -308
- package/lib/core/ask.js +16 -0
- package/lib/core/board.js +15 -3
- package/lib/core/brief.js +16 -0
- package/lib/core/index.js +4 -0
- package/lib/core/schedule/tasks.js +149 -0
- package/lib/core/watch/fetch.js +169 -0
- package/lib/core/watch/source.js +116 -0
- package/lib/core/watch/sync.js +171 -0
- package/lib/dsh/api.js +136 -4
- package/lib/dsh/plugin.js +9 -0
- package/lib/dsh/runtime.js +43 -2
- package/lib/dsh/schedule.js +221 -0
- package/lib/types/core/ask.d.ts +5 -0
- package/lib/types/core/board.d.ts +12 -1
- package/lib/types/core/brief.d.ts +5 -0
- package/lib/types/core/index.d.ts +4 -0
- package/lib/types/core/schedule/tasks.d.ts +89 -0
- package/lib/types/core/watch/fetch.d.ts +50 -0
- package/lib/types/core/watch/source.d.ts +68 -0
- package/lib/types/core/watch/sync.d.ts +51 -0
- package/lib/types/dsh/runtime.d.ts +19 -1
- package/lib/types/dsh/schedule.d.ts +113 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,15 +55,28 @@
|
|
|
55
55
|
|
|
56
56
|
同一封邮件的往来回复算一件事。你在邮件客户端里看过之后,对应的事项会自动关闭。
|
|
57
57
|
|
|
58
|
+
**自己关注的**:GitHub 和邮箱之外,你也可以在设置页填任意一个网址让小秘书盯着:产品公告页、价格页、招聘页、RSS 订阅、JSON 接口都行。可以填几个"关注哪些字"(比如"上新、补丁、面试"),填了就只在出现这些字时提醒,不填就是有变化就提醒。检查间隔 15 分钟到 24 小时,默认一小时。
|
|
59
|
+
|
|
60
|
+
| 理由码 | 意思 |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `watch-keyword` | 页面内容提到了你关注的字 |
|
|
63
|
+
| `watch-new` | 订阅源里出现了新的条目 |
|
|
64
|
+
| `watch-changed` | 普通网页的正文变了(比如价格) |
|
|
65
|
+
| `watch-removed` | 你删掉了这个关注,还没处理的事项一并关掉 |
|
|
66
|
+
|
|
67
|
+
一个关注项算一张卡片,不会因为一天更新十条就刷一屏。刚添加时第一次检查只记下"现在有什么",不报警;但填了关键词的,第一次命中就告诉你。读不到(断网、404、要登录)会写清原因,卡片不会因此凭空出现。
|
|
68
|
+
|
|
58
69
|
**密码放在系统钥匙串**:macOS 钥匙串、Windows 凭据管理器、Linux 密钥环(Secret Service)。密码只在设置页输入一次,直接交给钥匙串,不写进任何文件,接口也从不返回它。没有钥匙串的电脑(比如没有桌面的 Linux 服务器),密码和 token 存进记事本目录里的 `secrets.json`:权限 600,只有你的系统账号能读,但没有加密,设置页会写明这一点和原因。
|
|
59
70
|
|
|
71
|
+
**关注一个网址**:点"+ 关注一个网址",填网址(和想关注的字),点"先试读一下"当场看读到什么,再"保存并看一次"。
|
|
72
|
+
|
|
60
73
|
**添加邮箱**:点"+ 添加邮箱"弹出向导。填了地址就自动选好服务商,显示去哪里开 IMAP、拿授权码,带"打开设置页";授权码位数不对会提醒;"测试并保存"连得上才保存。
|
|
61
74
|
|
|
62
75
|
### 用法
|
|
63
76
|
|
|
64
77
|
**看板**:点 DSH 左侧栏的"小秘书",打开整页看板。顶部是一句话总结和四个数字(要你处理、7 天内到期、今天替你关掉、待你核对),下面分三栏:
|
|
65
78
|
|
|
66
|
-
看板上方可以按来源筛选:全部、GitHub
|
|
79
|
+
看板上方可以按来源筛选:全部、GitHub、邮件、关注、交代。
|
|
67
80
|
|
|
68
81
|
- **要你处理**:现在需要你的事。卡片平时是收起的,只显示标题;点标题展开,一次只展开一张,点另一张时前一张自动收起。展开后写明**是什么、问题在哪、怎么办**(比如 CI 失败在哪个 job 的哪一步、上次成功是什么时候),主按钮直接打开该看的地方("看失败日志""去关掉 Actions""去审查"),还有办完了、明天再说、忽略。
|
|
69
82
|
- **我记着**:说过"明天再说"的事,以及还没到提醒时间的交代。底部可以直接交代新的事,填写时会实时显示小秘书理解成了什么。
|
|
@@ -73,7 +86,7 @@
|
|
|
73
86
|
|
|
74
87
|
卡片可以拖动:拖到"替你办了"就是办完,拖到"我记着"就是明天再提醒,从"我记着"拖回"要你处理"就是现在处理。三栏之间的分隔条也能拖动调宽度,双击恢复等宽。
|
|
75
88
|
|
|
76
|
-
**设置**:点页面顶部的"设置",按秘书的活分成四块:① 它看哪里(GitHub
|
|
89
|
+
**设置**:点页面顶部的"设置",按秘书的活分成四块:① 它看哪里(GitHub、邮箱、自己关注的网址);② 什么事要告诉你(哪些算急事、各类别提前几天);③ 什么时候、怎么告诉你(主动提醒,见下);④ 能替你办什么(在 GitHub 上标已读的方式;邮件一律只读)。最后是语言和密码存在哪。每块都是折叠的卡片,平时只显示标题,点开才展开,一次只开一张;里面的邮箱账户、通知渠道也是同样可折叠的卡片,开关就在标题右边,不展开也能点。
|
|
77
90
|
|
|
78
91
|
**主动提醒**:不用打开看板也能知道。
|
|
79
92
|
- 每日简报:每天到点(默认 09:00)发一份"要你处理"和"快到期"的清单;没事就不发。
|
|
@@ -82,6 +95,8 @@
|
|
|
82
95
|
- 时间按你浏览器所在的时区算,DSH 跑在别的时区的服务器上也不会错。
|
|
83
96
|
- 发到:这台电脑的系统通知(macOS、Windows、Linux 桌面;服务器上没有),以及飞书群机器人(建一个只有你的群、加一个自定义机器人,把 Webhook 地址粘贴过来;支持签名校验)。飞书的地址和密钥当密码存;提醒内容会经过飞书的服务器。
|
|
84
97
|
|
|
98
|
+
**交给 DSH 的自动化任务**:设置页 ③ 里还有一个开关,把每日简报改成 DSH 自己的定时任务——到点它不弹通知,而是在 DSH 里出现一条对话,你下次打开就能看见,手机上装 DSH 客户端也一样。这一条用的是 DSH 自带的 `schedule` 服务,小秘书只建这一个任务,标题是"小秘书 · 每日简报";改简报时间会跟着改,取消就删掉。下面同时列出 DSH 里所有定时任务(包括你自己在"自动化任务"页建的),每个都能"现在跑一次"或删除。DSH 没装这个服务时,这一块只说一句"这个 DSH 没有自动化任务服务",不影响桌面通知。
|
|
99
|
+
|
|
85
100
|
**重启 DSH**:页面顶部"设置"后面的按键。重装或升级插件后点它,桌面版会按正常方式退出(有任务在跑时会先问你),再自动打开。用 dsh-vps 装在服务器上的 DSH,由 dsh-gate 网关托管:点了之后 DSH 正常退出,网关几秒内把它重新拉起,页面断开一会儿后自动刷新。直接用 `dsh` 命令启动的 DSH 没法从页面重启(新的登录地址只会打印在那个终端里),按键会告诉你回终端按 Ctrl+C 再运行一次。Windows 和 Linux 桌面版的重启还没在真机上测过。
|
|
86
101
|
|
|
87
102
|
**文字命令**:
|
|
@@ -197,15 +212,28 @@ Default warning times: documents 90 days, bills 3, birthdays 7, renewals 7, ever
|
|
|
197
212
|
|
|
198
213
|
A thread of replies is one item. Once you read it in your mail client, its item closes by itself.
|
|
199
214
|
|
|
215
|
+
**Things you watch yourself**: beyond GitHub and mail, you can give the secretary any address on the settings page — a product announcements page, a price, a job posting, an RSS feed, a JSON endpoint. You can list a few words to watch for (say "release, patch, interview"): with words it only tells you when they show up, without words any change is worth a card. The interval runs from 15 minutes to 24 hours, one hour by default.
|
|
216
|
+
|
|
217
|
+
| Reason | Meaning |
|
|
218
|
+
|---|---|
|
|
219
|
+
| `watch-keyword` | the content mentions a word you watch for |
|
|
220
|
+
| `watch-new` | the feed has entries you have not seen |
|
|
221
|
+
| `watch-changed` | the text of a plain page changed (a price, say) |
|
|
222
|
+
| `watch-removed` | you deleted the watch; anything it left open is closed |
|
|
223
|
+
|
|
224
|
+
One watch is one card, so a feed that updates ten times a day does not flood the board. The first look only writes down what is there and says nothing — unless you gave it words, in which case a hit is reported at once. A read that fails (offline, 404, behind a login) says why, and never invents a card.
|
|
225
|
+
|
|
200
226
|
**Passwords live in the system keychain**: the macOS Keychain, Windows Credential Manager or the Linux keyring (Secret Service). You type a password once on the settings page; it goes straight to the keychain, is never written to a file and is never returned by any endpoint. On a computer without one (a Linux server with no desktop, say), passwords and tokens go to `secrets.json` in the notebook directory: mode 600, readable by your system account only, but not encrypted, and the settings page says so and why.
|
|
201
227
|
|
|
228
|
+
**Watching an address**: "+ Watch an address" asks for the address and, if you want, the words to watch for; "Read it once" shows what it finds before you save it, then "Save and look once".
|
|
229
|
+
|
|
202
230
|
**Adding a mail account**: "+ Add a mail account" opens a short guide. The address picks the provider; it says where to turn on IMAP and get the app password, with a button that opens that page; it warns when the password has the wrong length; "Test and save" keeps only an account that connects.
|
|
203
231
|
|
|
204
232
|
### Usage
|
|
205
233
|
|
|
206
234
|
**The board**: click "Secretary" in DSH's left sidebar to open a full-page board. On top: one summary sentence and four numbers (to handle, due in 7 days, closed today, to review). Below, three columns:
|
|
207
235
|
|
|
208
|
-
Filter the board by source: All, GitHub, Mail, Noted.
|
|
236
|
+
Filter the board by source: All, GitHub, Mail, Watching, Noted.
|
|
209
237
|
|
|
210
238
|
- **To handle**: what needs you now. Cards stay folded and show only the title; click a title to unfold it — one at a time, so opening another folds the first. Unfolded, a card says **what it is, where the problem is and what to do** (for a failing CI: which job and step, when it last passed), and its main button opens the right place ("Open the failing log", "Turn off Actions", "Review it"), next to done, tomorrow and dismiss.
|
|
211
239
|
- **Keeping for you**: things you put off until tomorrow, and things you told it that are not due for a reminder yet. Add a new one at the bottom, with a live preview of what was understood.
|
|
@@ -217,7 +245,7 @@ Cards can be dragged: onto "Done for you" to mark done, onto "Keeping for you" t
|
|
|
217
245
|
|
|
218
246
|
**Settings**: the "Settings" tab at the top of the page: language, warning days per category, GitHub (on/off, where the token comes from, connection test, how to mark read), mail accounts (add, test, check now, edit, delete). Every block is a folded card that shows only its title until you click it, and only one is open at a time; mail accounts and notification channels fold the same way, with their switch on the title row so you can flip it without opening the card.
|
|
219
247
|
|
|
220
|
-
The settings follow the secretary's job in four parts: 1. where it looks (GitHub, mail); 2. what to tell you about (what counts as urgent, warning days per category); 3. when and how to tell you (reminders, below); 4. what it may do for you (marking read on GitHub; mail is always read-only). Then language and where secrets are kept.
|
|
248
|
+
The settings follow the secretary's job in four parts: 1. where it looks (GitHub, mail, addresses you watch); 2. what to tell you about (what counts as urgent, warning days per category); 3. when and how to tell you (reminders, below); 4. what it may do for you (marking read on GitHub; mail is always read-only). Then language and where secrets are kept.
|
|
221
249
|
|
|
222
250
|
**Reminders**, without opening the board:
|
|
223
251
|
- Daily brief: at its time (09:00 by default) a list of what needs you and what is coming up; nothing is sent when there is nothing.
|
|
@@ -226,6 +254,8 @@ The settings follow the secretary's job in four parts: 1. where it looks (GitHub
|
|
|
226
254
|
- Times follow your browser's time zone, so DSH on a server in another zone still gets them right.
|
|
227
255
|
- Sent to this computer's notifications (macOS, Windows, a Linux desktop; a server has none) and to a Feishu / Lark group bot (a group of just you, a custom bot, its webhook address pasted in; signature verification supported). The bot's address and secret are kept like passwords; what reminders say passes through Feishu's servers.
|
|
228
256
|
|
|
257
|
+
**Handing the brief to DSH's scheduled tasks**: part 3 of the settings page can turn the daily brief into one of DSH's own scheduled tasks — instead of a notification it arrives as a conversation turn, there the next time you open DSH (including the mobile client). It uses DSH's built-in `schedule` service; the secretary creates exactly one task, titled "Secretary · daily brief", moves it when you change the brief's time, and deletes it when you turn it off. Below it, every scheduled task on this DSH is listed — including ones you made on DSH's own automation page — each with "run now" and delete. A DSH without that service says so in one line and keeps the desktop notification.
|
|
258
|
+
|
|
229
259
|
**Restart DSH**: the button after "Settings" at the top of the page. After reinstalling or upgrading plugins, click it: the desktop app quits the normal way (asking first if a task is running) and opens again. On a server set up with dsh-vps, DSH runs under the dsh-gate gateway: DSH exits cleanly, the gateway starts it again within seconds, and the page reloads once it is back. DSH started directly with the `dsh` command cannot be restarted from the page (its new sign-in address is printed only in that terminal), so the button tells you to press Ctrl+C there and run it again. Restarting the Windows and Linux desktop apps is not yet tested on real machines.
|
|
230
260
|
|
|
231
261
|
**Text commands**:
|