dsh-mishu 0.5.4 → 0.6.2
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 +18 -6
- package/lib/client.js +542 -284
- package/lib/core/github/device.js +129 -0
- package/lib/core/github/token.js +2 -0
- package/lib/core/index.js +5 -4
- package/lib/core/mail/account.js +61 -5
- package/lib/core/mail/sync.js +34 -5
- package/lib/core/restart.js +35 -5
- package/lib/core/secrets.js +102 -2
- package/lib/core/settings.js +2 -2
- package/lib/dsh/api.js +34 -7
- package/lib/dsh/config.js +2 -1
- package/lib/dsh/runtime.js +7 -4
- package/lib/types/core/github/device.d.ts +64 -0
- package/lib/types/core/github/token.d.ts +2 -0
- package/lib/types/core/index.d.ts +6 -4
- package/lib/types/core/mail/account.d.ts +25 -1
- package/lib/types/core/mail/sync.d.ts +8 -2
- package/lib/types/core/restart.d.ts +22 -7
- package/lib/types/core/secrets.d.ts +50 -4
- package/lib/types/dsh/config.d.ts +2 -0
- package/lib/types/dsh/runtime.d.ts +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
[](#)
|
|
10
10
|
[](tsconfig.json)
|
|
11
11
|
[](docs/调研与设计.md#用户数据安全)
|
|
12
|
+
[](https://dsh-plugin.org/plugins/aicivilization/dsh-mishu)
|
|
12
13
|
|
|
13
14
|
`提醒` `通知` `待办` `收件箱` `秘书` `GitHub` `邮件` `飞书` `Telegram` · `reminder` `notifications` `todo` `inbox` `triage` `secretary`
|
|
14
15
|
|
|
@@ -54,7 +55,9 @@
|
|
|
54
55
|
|
|
55
56
|
同一封邮件的往来回复算一件事。你在邮件客户端里看过之后,对应的事项会自动关闭。
|
|
56
57
|
|
|
57
|
-
**密码放在系统钥匙串**:macOS 钥匙串、Windows 凭据管理器、Linux 密钥环(Secret Service)。密码只在设置页输入一次,直接交给钥匙串,不写进任何文件,接口也从不返回它。没有钥匙串的电脑(比如没有桌面的 Linux
|
|
58
|
+
**密码放在系统钥匙串**:macOS 钥匙串、Windows 凭据管理器、Linux 密钥环(Secret Service)。密码只在设置页输入一次,直接交给钥匙串,不写进任何文件,接口也从不返回它。没有钥匙串的电脑(比如没有桌面的 Linux 服务器),密码和 token 存进记事本目录里的 `secrets.json`:权限 600,只有你的系统账号能读,但没有加密,设置页会写明这一点和原因。
|
|
59
|
+
|
|
60
|
+
**添加邮箱**:点"+ 添加邮箱"弹出向导。填了地址就自动选好服务商,显示去哪里开 IMAP、拿授权码,带"打开设置页";授权码位数不对会提醒;"测试并保存"连得上才保存。
|
|
58
61
|
|
|
59
62
|
### 用法
|
|
60
63
|
|
|
@@ -72,7 +75,7 @@
|
|
|
72
75
|
|
|
73
76
|
**设置**:点页面顶部的"设置":语言、各类别提前几天提醒、GitHub(开关、token 从哪来、测试连接、在 GitHub 上标已读的方式)、邮箱账户(添加、测试连接、现在收一次、编辑、删除)。飞书即将接入。
|
|
74
77
|
|
|
75
|
-
**重启 DSH**:页面顶部"设置"后面的按键。重装或升级插件后点它,桌面版会按正常方式退出(有任务在跑时会先问你),再自动打开。用 `dsh` 命令启动的 DSH 没法从页面重启(新的登录地址只会打印在那个终端里),按键会告诉你回终端按 Ctrl+C 再运行一次。Windows 和 Linux 桌面版的重启还没在真机上测过。
|
|
78
|
+
**重启 DSH**:页面顶部"设置"后面的按键。重装或升级插件后点它,桌面版会按正常方式退出(有任务在跑时会先问你),再自动打开。用 dsh-vps 装在服务器上的 DSH,由 dsh-gate 网关托管:点了之后 DSH 正常退出,网关几秒内把它重新拉起,页面断开一会儿后自动刷新。直接用 `dsh` 命令启动的 DSH 没法从页面重启(新的登录地址只会打印在那个终端里),按键会告诉你回终端按 Ctrl+C 再运行一次。Windows 和 Linux 桌面版的重启还没在真机上测过。
|
|
76
79
|
|
|
77
80
|
**文字命令**:
|
|
78
81
|
|
|
@@ -102,7 +105,7 @@ agent 可用的工具:`mishu_add`(交代,需要你审批)、`mishu_list`
|
|
|
102
105
|
按顺序取,token 不写进任何文件:
|
|
103
106
|
|
|
104
107
|
1. 环境变量(默认 `GITHUB_TOKEN`)
|
|
105
|
-
2.
|
|
108
|
+
2. 在设置页"用 GitHub 登录"拿到的 token(GitHub 设备登录:显示一个登录码,你在 github.com/login/device 输入并授权,手机或别的电脑上都行),或者你粘贴的 token:先拿到 GitHub 上检查,再存进系统钥匙串(没钥匙串时存进 `secrets.json`)。要用 classic token,勾选 `notifications`(看私有仓库再勾 `repo`);GitHub 的通知接口不认 fine-grained token
|
|
106
109
|
3. `gh auth token`:装了 GitHub CLI,并运行过 `gh auth login` 就行。从 Dock、开始菜单启动的 DSH 拿到的 PATH 往往很短,所以小秘书除了 PATH,还会去 Homebrew、`~/.local/bin`、winget、Scoop 等常见安装位置找 `gh`
|
|
107
110
|
|
|
108
111
|
### 安装和配置
|
|
@@ -140,6 +143,13 @@ dsh plugin --profile <name> add dsh-mishu
|
|
|
140
143
|
- Outlook / Hotmail:微软只允许 OAuth 登录 IMAP,暂不支持。
|
|
141
144
|
- Windows 和 Linux 的钥匙串已经按各自系统的方式实现,但还没在真机上测过。
|
|
142
145
|
|
|
146
|
+
### 收录渠道
|
|
147
|
+
|
|
148
|
+
- [DSH Plugin Hub(dsh-plugin.org 社区插件市场)](https://dsh-plugin.org/plugins/aicivilization/dsh-mishu)
|
|
149
|
+
- [awesome-dsh-plugin 精选列表](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
|
|
150
|
+
- dsh-plugin-shop 插件商店(每日自动收录)
|
|
151
|
+
- 52DSH / tuofangzhe 插件目录(证据分级收录)
|
|
152
|
+
|
|
143
153
|
---
|
|
144
154
|
|
|
145
155
|
## English
|
|
@@ -180,7 +190,9 @@ Default warning times: documents 90 days, bills 3, birthdays 7, renewals 7, ever
|
|
|
180
190
|
|
|
181
191
|
A thread of replies is one item. Once you read it in your mail client, its item closes by itself.
|
|
182
192
|
|
|
183
|
-
**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), the
|
|
193
|
+
**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.
|
|
194
|
+
|
|
195
|
+
**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.
|
|
184
196
|
|
|
185
197
|
### Usage
|
|
186
198
|
|
|
@@ -198,7 +210,7 @@ Cards can be dragged: onto "Done for you" to mark done, onto "Keeping for you" t
|
|
|
198
210
|
|
|
199
211
|
**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). Feishu / Lark is coming.
|
|
200
212
|
|
|
201
|
-
**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. DSH started 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.
|
|
213
|
+
**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.
|
|
202
214
|
|
|
203
215
|
**Text commands**:
|
|
204
216
|
|
|
@@ -228,7 +240,7 @@ Tools for the agent: `mishu_add` (needs your approval), `mishu_list`, `mishu_det
|
|
|
228
240
|
It uses, in order, and never writes a token to a file:
|
|
229
241
|
|
|
230
242
|
1. an environment variable (default `GITHUB_TOKEN`)
|
|
231
|
-
2. a token
|
|
243
|
+
2. a token from "Sign in with GitHub" on the settings page (GitHub's device flow: it shows a code you enter at github.com/login/device, from a phone or another computer if you like), or one you paste: checked with GitHub first, then kept in the system keychain (in `secrets.json` without one). Use a classic token with the `notifications` scope (plus `repo` for private repositories); GitHub's notifications API does not take fine-grained tokens
|
|
232
244
|
3. `gh auth token`: if the GitHub CLI is installed and you have run `gh auth login`. DSH started from the Dock or Start menu often gets a short PATH, so besides PATH the secretary looks for `gh` where Homebrew, `~/.local/bin`, winget and Scoop put it
|
|
233
245
|
|
|
234
246
|
### Install and configure
|