dsh-mishu 0.0.1 → 0.5.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/LICENSE +21 -0
- package/README.md +271 -0
- package/cordis.patch.yml +5 -0
- package/lib/client.js +1242 -0
- package/lib/core/ask.js +132 -0
- package/lib/core/board.js +200 -0
- package/lib/core/brief.js +208 -0
- package/lib/core/explain.js +71 -0
- package/lib/core/fold.js +89 -0
- package/lib/core/github/client.js +142 -0
- package/lib/core/github/facts.js +173 -0
- package/lib/core/github/rules.js +274 -0
- package/lib/core/github/sync.js +112 -0
- package/lib/core/i18n.js +54 -0
- package/lib/core/index.js +65 -0
- package/lib/core/mail/account.js +76 -0
- package/lib/core/mail/imap.js +98 -0
- package/lib/core/mail/rules.js +69 -0
- package/lib/core/mail/sync.js +69 -0
- package/lib/core/manual.js +157 -0
- package/lib/core/matters.js +54 -0
- package/lib/core/recur.js +73 -0
- package/lib/core/secrets.js +122 -0
- package/lib/core/settings.js +95 -0
- package/lib/core/store.js +322 -0
- package/lib/core/time.js +111 -0
- package/lib/dsh/api.js +264 -0
- package/lib/dsh/config.js +23 -0
- package/lib/dsh/plugin.js +167 -0
- package/lib/dsh/runtime.js +116 -0
- package/lib/dsh/tools.js +184 -0
- package/lib/index.js +11 -0
- package/lib/types/core/ask.d.ts +40 -0
- package/lib/types/core/board.d.ts +108 -0
- package/lib/types/core/brief.d.ts +33 -0
- package/lib/types/core/explain.d.ts +22 -0
- package/lib/types/core/fold.d.ts +28 -0
- package/lib/types/core/github/client.d.ts +150 -0
- package/lib/types/core/github/facts.d.ts +104 -0
- package/lib/types/core/github/rules.d.ts +39 -0
- package/lib/types/core/github/sync.d.ts +37 -0
- package/lib/types/core/i18n.d.ts +31 -0
- package/lib/types/core/index.d.ts +42 -0
- package/lib/types/core/mail/account.d.ts +72 -0
- package/lib/types/core/mail/imap.d.ts +44 -0
- package/lib/types/core/mail/rules.d.ts +12 -0
- package/lib/types/core/mail/sync.d.ts +30 -0
- package/lib/types/core/manual.d.ts +54 -0
- package/lib/types/core/matters.d.ts +32 -0
- package/lib/types/core/recur.d.ts +30 -0
- package/lib/types/core/secrets.d.ts +35 -0
- package/lib/types/core/settings.d.ts +37 -0
- package/lib/types/core/store.d.ts +143 -0
- package/lib/types/core/time.d.ts +37 -0
- package/lib/types/dsh/api.d.ts +20 -0
- package/lib/types/dsh/config.d.ts +25 -0
- package/lib/types/dsh/plugin.d.ts +13 -0
- package/lib/types/dsh/runtime.d.ts +38 -0
- package/lib/types/dsh/tools.d.ts +43 -0
- package/lib/types/index.d.ts +11 -0
- package/package.json +50 -4
- package/docs//350/260/203/347/240/224/344/270/216/350/256/276/350/256/241.md +0 -90
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AIcivilization
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# dsh-mishu
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-mishu)
|
|
4
|
+
[](https://www.npmjs.com/package/dsh-mishu)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
8
|
+
[](#)
|
|
9
|
+
[](#)
|
|
10
|
+
[](tsconfig.json)
|
|
11
|
+
[](docs/调研与设计.md#用户数据安全)
|
|
12
|
+
|
|
13
|
+
`提醒` `通知` `待办` `收件箱` `秘书` `GitHub` `邮件` `飞书` `Telegram` · `reminder` `notifications` `todo` `inbox` `triage` `secretary`
|
|
14
|
+
|
|
15
|
+
[中文](#中文) · [English](#english)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 中文
|
|
20
|
+
|
|
21
|
+
**DSH 小秘书,[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)插件。**替你盯着 GitHub 通知,也记住你交代的事(账单、续费、证件到期、生日)。它会查清楚哪些事已经结束、替你关掉,只把真要你处理的留给你。
|
|
22
|
+
|
|
23
|
+
支持 macOS / Windows / Linux,界面中英双语。设计见 [docs/调研与设计.md](docs/调研与设计.md),需求全景见 [docs/需求清单.md](docs/需求清单.md)。
|
|
24
|
+
|
|
25
|
+
### 能做什么
|
|
26
|
+
|
|
27
|
+
**GitHub 通知**:每 15 分钟拉一次全部未读通知,**查对象现在的状态**再判断,不看通知文字。
|
|
28
|
+
|
|
29
|
+
| 理由码 | 意思 |
|
|
30
|
+
|---|---|
|
|
31
|
+
| `merged` / `closed` | PR 已合并,或 issue / PR 已关闭 |
|
|
32
|
+
| `recovered` | 同一工作流在同一分支上后来通过了 |
|
|
33
|
+
| `superseded` | 旧版本 tag 失败了,但后面的 main 或更新的 tag 已经通过 |
|
|
34
|
+
| `ref-gone` | 失败的那个分支已经删了 |
|
|
35
|
+
| `fork-upstream-schedule` | fork 没有自己的提交,却在跑上游的定时任务,失败通知全是噪音;合成一件事:关掉这个 fork 的 Actions |
|
|
36
|
+
| `ci-failing` | 最近一次还是失败,交给你 |
|
|
37
|
+
| `review-requested` / `mentioned` / `assigned` / `your-pr` / `commit-comment` | 交给你 |
|
|
38
|
+
|
|
39
|
+
几十条通知会合并成"事项":同一工作流在同一分支上的失败算一件事,同一个 fork 的噪音也算一件事。
|
|
40
|
+
|
|
41
|
+
**手动交代**:在任何 DSH 对话里说一句,比如"护照 2027 年 3 月 10 日到期"或"每月 15 号交房租"。模型会整理出日期、重复方式和提前多久提醒,**DSH 弹出审批卡片让你核对,你同意了才存**。到了提醒那天,它出现在待处理里。你说办了,这一期就关闭,下一期按周期自动出现。
|
|
42
|
+
|
|
43
|
+
默认提前量:证件 90 天,账单 3 天,生日纪念日 7 天,续费续保 7 天,其他 1 天。
|
|
44
|
+
|
|
45
|
+
**邮件**:在设置页添加邮箱(QQ、163、126、Gmail、iCloud,或自己填 IMAP 服务器),小秘书定时看收件箱里最近的未读邮件。**只读**:以只读方式打开收件箱,只看发件人、收件人、标题和几个邮件头,不读正文,也不会把邮件标成已读。
|
|
46
|
+
|
|
47
|
+
| 理由码 | 意思 |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `mail-to-you` | 直接写给你、没有群发或自动发送标记的邮件,可能在等你回复 |
|
|
50
|
+
| `mail-invite` | 会议或日程邀请,等你回应 |
|
|
51
|
+
| `mail-bill` | 标题里有账单、还款、缴费、续费、发票之类的字眼(哪怕是群发的) |
|
|
52
|
+
| `mail-newsletter` / `mail-automated` | 群发邮件、系统自动邮件:折叠起来,不打扰你 |
|
|
53
|
+
| `mail-code` / `mail-github` / `mail-cc` | 验证码、GitHub 通知邮件(GitHub 来源已经在管)、只是抄送你 |
|
|
54
|
+
|
|
55
|
+
同一封邮件的往来回复算一件事。你在邮件客户端里看过之后,对应的事项会自动关闭。
|
|
56
|
+
|
|
57
|
+
**密码放在系统钥匙串**:macOS 钥匙串、Windows 凭据管理器、Linux 密钥环(Secret Service)。密码只在设置页输入一次,直接交给钥匙串,不写进任何文件,接口也从不返回它。没有钥匙串的电脑,可以改用环境变量 `DSH_MISHU_SECRET_MAIL_<编号>`。
|
|
58
|
+
|
|
59
|
+
### 用法
|
|
60
|
+
|
|
61
|
+
**看板**:点 DSH 左侧栏的"小秘书",打开整页看板。顶部是一句话总结和四个数字(要你处理、7 天内到期、今天替你关掉、待你核对),下面分三栏:
|
|
62
|
+
|
|
63
|
+
看板上方可以按来源筛选:全部、GitHub、邮件、交代。
|
|
64
|
+
|
|
65
|
+
- **要你处理**:现在需要你的事。每张卡片写明**是什么、问题在哪、怎么办**(比如 CI 失败在哪个 job 的哪一步、上次成功是什么时候),主按钮直接打开该看的地方("看失败日志""去关掉 Actions""去审查"),还有办完了、明天再说、忽略。
|
|
66
|
+
- **我记着**:说过"明天再说"的事,以及还没到提醒时间的交代。底部可以直接交代新的事,填写时会实时显示小秘书理解成了什么。
|
|
67
|
+
- **替你办了**:最近 7 天关掉的事,按理由分组。点"怎么回事"能看到它是什么、为什么关掉(附证据链接)、小秘书做了什么、来自哪几条通知。判错了就点"恢复"。
|
|
68
|
+
|
|
69
|
+
**+AI**:看不明白就点彩色的"+AI"。它会开一个新对话,把这件事的说明、链接和相关通知放进输入框(不会自动发送),你看过、补上自己的问题再按发送。看板上的每张卡片、顶部总结、来源报错、设置页里各邮箱服务商的开通说明都有这个按钮。对话里的 AI 可以用 `mishu_detail` 查一件事的完整记录;要改状态时会先问你。
|
|
70
|
+
|
|
71
|
+
卡片可以拖动:拖到"替你办了"就是办完,拖到"我记着"就是明天再提醒,从"我记着"拖回"要你处理"就是现在处理。三栏之间的分隔条也能拖动调宽度,双击恢复等宽。
|
|
72
|
+
|
|
73
|
+
**设置**:点页面顶部的"设置":语言、各类别提前几天提醒、GitHub(开关、token 从哪来、测试连接、在 GitHub 上标已读的方式)、邮箱账户(添加、测试连接、现在收一次、编辑、删除)。飞书即将接入。
|
|
74
|
+
|
|
75
|
+
**文字命令**:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
/mishu 简报:要处理的、快到了的、最近替你关掉了什么
|
|
79
|
+
/mishu 同步 立刻同步一次 GitHub
|
|
80
|
+
/mishu 完成 12 把 #12 标为完成(还有:忽略 12、恢复 12)
|
|
81
|
+
/mishu 已关闭 最近 3 天关掉的事项和理由
|
|
82
|
+
/mishu 交代 你交代过、还在进行的事
|
|
83
|
+
/mishu 停止 3 交代 #3 以后不再提醒
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
英文命令也能用:`sync`、`done`、`dismiss`、`reopen`、`closed`、`series`、`stop`、`help`。
|
|
87
|
+
|
|
88
|
+
agent 可用的工具:`mishu_add`(交代,需要你审批)、`mishu_list`、`mishu_detail`、`mishu_update`、`mishu_stop`。
|
|
89
|
+
|
|
90
|
+
### 不会做的事
|
|
91
|
+
|
|
92
|
+
- **默认不在 GitHub 上标已读。**`markRead` 默认是 `shadow`:只记下"如果打开,会把哪些通知标成已读",一条也不真标。核对过 `/mishu 已关闭` 后,再改成 `on`。还在待处理里的事项,永远不会被标已读。
|
|
93
|
+
- **通知文字不会触发任何动作。**只看查到的状态。
|
|
94
|
+
- **你改过的状态,不会被同样的证据改回去。**只有来源出现更新的动态,才会重新判断。
|
|
95
|
+
- **你重新打开一件被规则关掉的事,算一次纠正。**一条规则关掉的事项满 10 件、被纠正的比例超过 20%,这条规则就降级:之后它的结论只给你看,不再自动关闭。
|
|
96
|
+
- **不动你的邮箱。**只读打开,不读正文,不标已读,不删不移,不发信。
|
|
97
|
+
|
|
98
|
+
### GitHub token
|
|
99
|
+
|
|
100
|
+
mishu 自己不保存 token。按顺序取:
|
|
101
|
+
|
|
102
|
+
1. 环境变量(默认 `GITHUB_TOKEN`)
|
|
103
|
+
2. `gh auth token`:装了 GitHub CLI,并运行过 `gh auth login` 就行
|
|
104
|
+
|
|
105
|
+
### 安装和配置
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
dsh plugin --profile <name> add dsh-mishu
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
在 profile 的 `cordis.patch.yml` 里可以覆盖配置:
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
- id: dsh-mishu
|
|
115
|
+
name: dsh-mishu
|
|
116
|
+
config:
|
|
117
|
+
home: ~/.mishu # 记事本目录,在 DSH 之外
|
|
118
|
+
language: auto # auto(跟系统语言)/ zh / en
|
|
119
|
+
github:
|
|
120
|
+
enabled: true
|
|
121
|
+
intervalMinutes: 15
|
|
122
|
+
tokenEnv: GITHUB_TOKEN
|
|
123
|
+
useGhCli: true
|
|
124
|
+
markRead: shadow # off / shadow / on
|
|
125
|
+
markReadReasons: [merged, closed, recovered, superseded, ref-gone]
|
|
126
|
+
leadDays: { document: 90, bill: 3, birthday: 7, renewal: 7, other: 1 }
|
|
127
|
+
upcomingDays: 30 # 简报里"快到了"往后看多少天
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
记事本是 `~/.mishu/mishu.db`(SQLite),只存元数据和简短备注,不存邮件正文和 token。在 macOS / Linux 上,这个目录只有你本人能读写。卸载插件不会删它。
|
|
131
|
+
|
|
132
|
+
### 还没做
|
|
133
|
+
|
|
134
|
+
- 推送到手机(渠道还没定)。现在简报只能在 DSH 里看。
|
|
135
|
+
- 规则认不出的通知(`unclassified`)先直接交给你,还没接模型。
|
|
136
|
+
- 飞书;邮件里的"你发出去没人回""你答应别人的事"(要读已发送文件夹)。
|
|
137
|
+
- Outlook / Hotmail:微软只允许 OAuth 登录 IMAP,暂不支持。
|
|
138
|
+
- Windows 和 Linux 的钥匙串已经按各自系统的方式实现,但还没在真机上测过。
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## English
|
|
143
|
+
|
|
144
|
+
**A secretary plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh).** It watches your GitHub notifications and remembers the dated things you tell it (bills, renewals, document expiries, birthdays). It checks which of them are already resolved and closes those for you, so only what actually needs you stays on the list.
|
|
145
|
+
|
|
146
|
+
Runs on macOS, Windows and Linux. Speaks Chinese and English.
|
|
147
|
+
|
|
148
|
+
### What it does
|
|
149
|
+
|
|
150
|
+
**GitHub notifications**: every 15 minutes it pulls all unread notifications and judges each one by **the current state of what it is about**, never by the notification text.
|
|
151
|
+
|
|
152
|
+
| Reason | Meaning |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `merged` / `closed` | The PR was merged, or the issue / PR was closed |
|
|
155
|
+
| `recovered` | The same workflow later passed on the same branch |
|
|
156
|
+
| `superseded` | An old release tag failed, but main or a newer tag has passed since |
|
|
157
|
+
| `ref-gone` | The failing branch has been deleted |
|
|
158
|
+
| `fork-upstream-schedule` | A fork with no commits of its own runs its parent's scheduled workflows; every failure is noise, folded into one item: turn off Actions on the fork |
|
|
159
|
+
| `ci-failing` | The latest run still fails; handed to you |
|
|
160
|
+
| `review-requested` / `mentioned` / `assigned` / `your-pr` / `commit-comment` | Handed to you |
|
|
161
|
+
|
|
162
|
+
Dozens of notifications fold into a few *items*: all failures of one workflow on one branch are one item, and all noise from one fork is one item.
|
|
163
|
+
|
|
164
|
+
**Things you tell it**: in any DSH chat, say "my passport expires on 2027-03-10" or "rent is due on the 15th every month". The model works out the date, the repeat and how early to remind you; **DSH shows an approval card with exactly what was understood, and nothing is saved until you approve it**. On the reminder day the item appears on your list. When you say it is done, that occurrence closes and the next one appears on its own schedule.
|
|
165
|
+
|
|
166
|
+
Default warning times: documents 90 days, bills 3, birthdays 7, renewals 7, everything else 1.
|
|
167
|
+
|
|
168
|
+
**Mail**: add a mailbox on the settings page (QQ, 163, 126, Gmail, iCloud, or your own IMAP server) and the secretary looks at recent unread mail in your inbox. **Read-only**: the inbox is opened read-only; only sender, recipients, subject and a few headers are read — never the body — and nothing is marked read.
|
|
169
|
+
|
|
170
|
+
| Reason | Meaning |
|
|
171
|
+
|---|---|
|
|
172
|
+
| `mail-to-you` | Written to you directly, with no bulk or automated markers; someone may be waiting |
|
|
173
|
+
| `mail-invite` | A meeting or calendar invitation waiting for your answer |
|
|
174
|
+
| `mail-bill` | The subject mentions a bill, payment, renewal or invoice (even in bulk mail) |
|
|
175
|
+
| `mail-newsletter` / `mail-automated` | Bulk or automated mail, folded away |
|
|
176
|
+
| `mail-code` / `mail-github` / `mail-cc` | Verification codes, GitHub notification mail (the GitHub source has it), mail you are only copied on |
|
|
177
|
+
|
|
178
|
+
A thread of replies is one item. Once you read it in your mail client, its item closes by itself.
|
|
179
|
+
|
|
180
|
+
**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. Without a keychain, use the environment variable `DSH_MISHU_SECRET_MAIL_<id>`.
|
|
181
|
+
|
|
182
|
+
### Usage
|
|
183
|
+
|
|
184
|
+
**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:
|
|
185
|
+
|
|
186
|
+
Filter the board by source: All, GitHub, Mail, Noted.
|
|
187
|
+
|
|
188
|
+
- **To handle**: what needs you now. Every 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.
|
|
189
|
+
- **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.
|
|
190
|
+
- **Done for you**: what was closed in the last 7 days, grouped by reason. "What happened" shows what it was, why it was closed (with the evidence link), what the secretary did and which notifications it came from. Reopen any that are wrong.
|
|
191
|
+
|
|
192
|
+
**+AI**: when something is unclear, press the colourful "+AI". It opens a new chat with the item's explanation, link and related notifications in the input box — unsent — so you can read it, add your question and press send. Every card, the summary, source errors and each mail provider's setup note have one. In that chat the AI can use `mishu_detail` to look an item up in full, and asks you before changing anything.
|
|
193
|
+
|
|
194
|
+
Cards can be dragged: onto "Done for you" to mark done, onto "Keeping for you" to snooze until tomorrow, from "Keeping for you" back to "To handle" to handle it now. The dividers between the columns can be dragged too; double-click one to make the columns equal.
|
|
195
|
+
|
|
196
|
+
**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.
|
|
197
|
+
|
|
198
|
+
**Text commands**:
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
/mishu brief: what needs you, what is coming up, what was closed for you
|
|
202
|
+
/mishu sync sync GitHub now
|
|
203
|
+
/mishu done 12 mark #12 done (also: dismiss 12, reopen 12)
|
|
204
|
+
/mishu closed items closed in the last 3 days, with reasons
|
|
205
|
+
/mishu series things you told me that are still in play
|
|
206
|
+
/mishu stop 3 stop reminding series #3
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Chinese commands work too: `同步`, `完成`, `忽略`, `恢复`, `已关闭`, `交代`, `停止`, `帮助`.
|
|
210
|
+
|
|
211
|
+
Tools for the agent: `mishu_add` (needs your approval), `mishu_list`, `mishu_detail`, `mishu_update`, `mishu_stop`.
|
|
212
|
+
|
|
213
|
+
### What it will not do
|
|
214
|
+
|
|
215
|
+
- **It does not mark anything read on GitHub by default.** `markRead` starts as `shadow`: it records which notifications it *would* mark read and touches none. Check `/mishu closed`, then switch to `on`. Items still on your list are never marked read.
|
|
216
|
+
- **Notification text never triggers an action.** Only verified state does.
|
|
217
|
+
- **Your own decision is not overturned by the same evidence.** Only newer activity at the source re-opens the question.
|
|
218
|
+
- **Reopening something a rule closed counts as a correction.** A rule that has closed at least 10 items and been corrected on more than 20% of them is demoted: from then on its conclusions are shown to you instead of closing items.
|
|
219
|
+
- **It does not touch your mailbox.** Read-only: no bodies, no marking read, no deleting or moving, no sending.
|
|
220
|
+
|
|
221
|
+
### GitHub token
|
|
222
|
+
|
|
223
|
+
mishu never stores a token. It uses, in order:
|
|
224
|
+
|
|
225
|
+
1. an environment variable (default `GITHUB_TOKEN`)
|
|
226
|
+
2. `gh auth token`: if the GitHub CLI is installed and you have run `gh auth login`
|
|
227
|
+
|
|
228
|
+
### Install and configure
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
dsh plugin --profile <name> add dsh-mishu
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Override settings in the profile's `cordis.patch.yml` (see the Chinese section for the full example; the keys are the same). `language` is `auto` (follow the system locale), `zh` or `en`.
|
|
235
|
+
|
|
236
|
+
The notebook is `~/.mishu/mishu.db` (SQLite). It keeps metadata and short notes only, never email bodies or tokens. On macOS and Linux the directory is readable and writable by you alone. Uninstalling the plugin leaves it in place.
|
|
237
|
+
|
|
238
|
+
### Not done yet
|
|
239
|
+
|
|
240
|
+
- Push to your phone (channels not chosen yet). For now the brief is only in DSH.
|
|
241
|
+
- Notifications the rules do not recognise (`unclassified`) are handed to you; no model triage yet.
|
|
242
|
+
- Feishu / Lark; "you sent it and nobody replied" and "things you promised" from mail (needs the Sent folder).
|
|
243
|
+
- Outlook / Hotmail: Microsoft only allows OAuth for IMAP; not supported yet.
|
|
244
|
+
- The Windows and Linux keychains are implemented the way each system documents, but not yet tested on real machines.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Development · 开发
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
npm install
|
|
252
|
+
npm test # node:test runs the TypeScript directly (Node ≥ 22.18); the time zone is pinned in tests/setup.ts
|
|
253
|
+
npm run build
|
|
254
|
+
npm run record # record a real, read-only sync of your own account into tests/fixtures/local/
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Test data · 测试数据**
|
|
258
|
+
|
|
259
|
+
- The committed tests use a made-up GitHub account built in `tests/fixtures/synthetic.ts` (`example-org`, `upstream-org`, `demo-*`): a fork running its parent's schedules, superseded release tags, recovered failures, a deleted branch, a red feature branch, a bot comment on a commit, PRs and issues in every state.
|
|
260
|
+
- 仓库里的测试只用编造的账号(`tests/fixtures/synthetic.ts`),覆盖所有规则要处理的情况。
|
|
261
|
+
- `npm run record` writes a recording of **your own** account to `tests/fixtures/local/`. Git ignores that folder; never commit it. When it exists, `npm test` also checks it (every notification judged, every closure has a known reason); when it does not, those checks are skipped.
|
|
262
|
+
- `npm run record` 录下的是**你自己账号的真实数据**,放在 `tests/fixtures/local/`,git 会忽略这个目录,绝不提交。本机有这份数据时,`npm test` 会多跑一组检查;没有就跳过。
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
src/core/ notebook, items, things you tell it, GitHub rules, brief, board, i18n — node: built-ins only, no DSH imports
|
|
266
|
+
src/core/github/ client (REST) → facts (current state) → rules (pure) → sync (fold into items)
|
|
267
|
+
src/dsh/ plugin shell: config, timers, /mishu, agent tools, approval gate, board API
|
|
268
|
+
src/client/ browser half: left-sidebar entry and the board page (React, bundled by scripts/build-client.mjs)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Test in a separate profile: `npm pack`, then `dsh plugin --profile mishu-test add ./dsh-mishu-x.y.z.tgz` with `home: ~/.mishu-test`.
|