dsh-inbox-bridge 0.0.0-stage → 2.16.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/CHANGELOG.md +257 -0
- package/LICENSE +21 -0
- package/README.en.md +101 -0
- package/README.md +100 -2
- package/ROADMAP.md +68 -0
- package/client.js +1194 -0
- package/cordis.patch.yml +8 -0
- package/docs/DETAIL.md +44 -0
- package/docs/DETAIL.zh.md +44 -0
- package/docs/assets/chip.png +0 -0
- package/docs/assets/icon-180.png +0 -0
- package/docs/assets/panel.png +0 -0
- package/docs/assets/social-preview.png +0 -0
- package/docs/configuration.md +121 -0
- package/docs/design/routing-and-identity.md +74 -0
- package/docs/how-it-works.md +97 -0
- package/docs/icon.svg +1 -0
- package/docs/index.html +144 -0
- package/docs/index.json +67 -0
- package/icon.svg +1 -0
- package/index.js +1345 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +67 -4
- package/screenshots.json +3 -0
- package/scripts/build-market-index.mjs +152 -0
- package/scripts/clear-inbox.mjs +329 -0
- package/scripts/github-inbox.mjs +1311 -0
- package/scripts/github-inbox.test.mjs +886 -0
- package/scripts/inbox-bridge.mjs +489 -0
- package/scripts/inbox-bridge.test.mjs +264 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
## 2.16.0
|
|
2
|
+
|
|
3
|
+
- 回合进行中的轮询间隔默认值从 10 分钟改为 1 分钟:CI 跑完一两分钟内就能进上下文,赶在 agent 还没走远时返工。仍只在回合内轮询,空闲不发请求;需要更快可以改 intervalMs(下限 5 秒)。
|
|
4
|
+
# Changelog
|
|
5
|
+
|
|
6
|
+
Format: keep a short entry per released version. Dates are UTC.
|
|
7
|
+
|
|
8
|
+
## 2.15.3
|
|
9
|
+
|
|
10
|
+
- 为插件市场准备:新增 screenshots.json(指向 docs/assets/panel.png)与 180px 方形图标 docs/assets/icon-180.png,便于目录与商店类市场展示卡片与截图。
|
|
11
|
+
## 2.15.2
|
|
12
|
+
|
|
13
|
+
- 修掉「几小时前的旧条目一直挂在待处理里」:每次轮询都对比上一次的结果,某个 key 这次不再被报出来(检查变绿、PR 合了、issue 关了),说明这条事实已经不成立,直接收口。队列里只留此刻仍然成立的事。
|
|
14
|
+
- 已经投出去而没人收口的条目,6 小时后最多重提一次,再之后就沉默,不再无限循环地回到列表顶部。
|
|
15
|
+
- 胶囊上的数字只数还没投出去的条目;已投递的在列表里带「已投递」标记,不再点亮角标。
|
|
16
|
+
- 新增 closeResolved() 纯函数,配三个单测:关闭陈旧事实、不碰没轮询到的仓库、只重提一次后沉默。
|
|
17
|
+
|
|
18
|
+
## 2.15.1
|
|
19
|
+
|
|
20
|
+
- 文档补上「为什么需要它」:说明插件想解决的问题——CI 与评审发生在对话之外,agent 看不见,等发现时已过最佳时机;装它的意义是让 agent 像维护者一样盯着仓库。README 中英、市场详情页与插件市场里的简介都改成这个说法。
|
|
21
|
+
|
|
22
|
+
## 2.15.0
|
|
23
|
+
|
|
24
|
+
- 插件在会话进行中装载时立刻接管并轮询:以前只登记不排程,重载后整轮都不取数,面板里的「上次轮询」会停在重载之前。
|
|
25
|
+
- 面板不再自己关闭:指针从胶囊移到面板、或点进输入框时,计时器先复查指针位置;失焦到面板内部也不收起。
|
|
26
|
+
- 消息清理合并成一档三态(关闭 / 已读 / 归档),一个选择同时决定标已读与归档。
|
|
27
|
+
- 订阅支持整条仓库链接:https://github.com/owner/repo、…/repo.git、git@github.com:owner/repo.git 都按 owner/repo 处理;输入框独占一行,不再被仓库名挤掉。
|
|
28
|
+
- 每个按钮加了悬停说明;胶囊图标在有未处理事件时显示蓝点。
|
|
29
|
+
- 修复桌面应用里轮询一直失败的两处:插件进程内跑子命令时用的是宿主二进制,只有设置 `ELECTRON_RUN_AS_NODE` 才会像 node 一样执行;`--repo a,b` 现在按两个仓库处理(以前被当成一个非法名字,整次轮询失败)。
|
|
30
|
+
|
|
31
|
+
## 2.14.0
|
|
32
|
+
|
|
33
|
+
- 归档所用的浏览器在 macOS 与 Linux 上也能找到(Chrome、Edge、Chromium、Brave);找不到时列出的候选名会写进错误信息。
|
|
34
|
+
- CI 改为三平台矩阵(Ubuntu、Windows、macOS),市场索引的校验单独一个任务。
|
|
35
|
+
- 新增项目主页(`docs/index.html`)与市场详情页(`docs/DETAIL.md`、`docs/DETAIL.zh.md`);README 补了截图、徽章与市场索引地址。
|
|
36
|
+
## 2.13.1
|
|
37
|
+
|
|
38
|
+
- 修复:面板里改完设置后返回的状态漏掉了会话 id,于是订阅列表在刷新前显示为空。
|
|
39
|
+
## 2.13.0
|
|
40
|
+
|
|
41
|
+
- 面板文案:`可唤醒` → `主动唤醒`;`清理范围` → `消息清理`,从三选一改成两个开关(已读 / 归档)。
|
|
42
|
+
- 清理只作用于订阅的仓库:去掉 `clear: "all"`(清整个账号),旧配置里的 `all` 按 `repo` 载入,CLI 也拒绝 `--clear all`。
|
|
43
|
+
- 订阅按会话保存(`prefs.sessionRepos`):每个会话默认只订阅自己所在的仓库,可自行增减;卡片里可输入 `owner/name` 手动添加,实例的轮询集合随之扩展。
|
|
44
|
+
## 2.12.2
|
|
45
|
+
|
|
46
|
+
- 通知首行的身份段多了一个冒号(`读取身份:本机 gh:`),去掉。
|
|
47
|
+
- README 的示例通知与 `scripts/github-inbox.mjs` 的实际输出对齐(`review requested from you`,不再意译)。
|
|
48
|
+
- README「界面」一节的清理范围改回 `订阅的仓库`,与面板一致。
|
|
49
|
+
## 2.12.1
|
|
50
|
+
|
|
51
|
+
- README 与面板文案改成陈述句:先说它是什么、读什么、什么时候注入,不再用比喻解释行为。
|
|
52
|
+
- 面板标签改为直述:提醒方式(仅注入 / 可唤醒)、清理范围(不清理 / 本仓库 / 整个账号)、身份 / 订阅仓库 / 上次轮询。
|
|
53
|
+
## 2.12.0
|
|
54
|
+
|
|
55
|
+
- 卡片里能直接改三件事:提醒方式(只排队 / 有事开轮)、清理强度(不碰 / 标已读 / 整个账号,以及归档到 Done)、订阅哪些仓库(退订一个,或把当前会话的仓库加进来)。
|
|
56
|
+
- 这些改动记在插件自己的覆盖层 .work/inbox-bridge/prefs.json,不写回宿主配置;优先级是页面 > profile > 默认,卡片上的「恢复配置」一键退回。
|
|
57
|
+
- 改动走同源 GET /inbox-bridge/prefs,带每次启动重新生成的 token;宿主的资源只应答 GET/HEAD,所以参数走查询串。
|
|
58
|
+
|
|
59
|
+
## 2.11.2
|
|
60
|
+
|
|
61
|
+
- 浮层底部改成三行标签(读取 / 订阅 / 上次同步)加一行动作。之前仓库名被印了两遍——一次作为说明、一次作为值,看起来像重复。会话的仓库不在订阅里时,订阅那行标出订阅的是什么、并且不再显示一个没有意义的上次同步。
|
|
62
|
+
|
|
63
|
+
## 2.11.1
|
|
64
|
+
|
|
65
|
+
- 胶囊回到它原来的位置:`conversation.composer.dock`(输入框下方那行状态,和「N 轮 · N tok/s」同一行)。这个槽位声明为 `scope: session`,注册时通过 `inject: (sessionId) => …` 就能拿到会话,所以按会话显示不必换位置。
|
|
66
|
+
|
|
67
|
+
## 2.11.0
|
|
68
|
+
|
|
69
|
+
- 状态行改成按会话显示:挂到宿主的 `conversation.input.dock`,由槽位把 `sessionId` 交给插件,页面每次取数都带上它。切到别的会话,看到的是那个会话的仓库与角色,不再永远是同一个仓库。
|
|
70
|
+
- 会话的仓库不在订阅列表里时,浮层直接说明「此会话的 owner/name 不在订阅列表」,而不是给出一个看起来像「一切安静」的空列表。
|
|
71
|
+
- 位置从自造的 `conversation.composer.dock` 换到宿主自己的输入区 dock,字号与间距因此与旁边的统计信息同源。
|
|
72
|
+
|
|
73
|
+
## 2.10.6
|
|
74
|
+
|
|
75
|
+
- 客户端半边在 `apply` 前声明 `inject: ["slots"]`。服务是显式申请的:少了这一句,`ctx.slots` 在注册时就抛错,整行从未注册,页面里什么都没有——宿主也不会为此报错。
|
|
76
|
+
- 页面诊断改走 `GET /inbox-bridge/client-log?m=…`。宿主的路由只应答 GET/HEAD,之前用 POST 上报一律 405,所以「模块没跑」与「跑了没画出来」在日志里无法区分。
|
|
77
|
+
|
|
78
|
+
## 2.10.5
|
|
79
|
+
|
|
80
|
+
- `exports` 里补回 `"./package.json"`。宿主按 Node 的解析规则读插件的 manifest 才能发现 `dsh.client`;`exports` 一旦存在却没列 manifest,解析会直接抛错,客户端入口于是被安静地跳过——页面里既没有胶囊,也没有任何一条错误。所有内建客户端包都导出了这份 manifest。
|
|
81
|
+
|
|
82
|
+
## 2.10.4
|
|
83
|
+
|
|
84
|
+
- 客户端模块在导入 React 之前就先报一声,导入之后再报一次(含 React 版本与 portal 能力);React/react-dom 的模块形状(本体还是 { default })两种都接受。之前一旦导入失败,整行会毫无痕迹地消失。
|
|
85
|
+
|
|
86
|
+
## 2.10.3
|
|
87
|
+
|
|
88
|
+
- 客户端模块在加载的第一行就向 Host 报告自己已经执行(连同 React 版本),用来区分「模块没跑到」和「跑了但没画出东西」。这两种情况以前在日志里长得一样。
|
|
89
|
+
|
|
90
|
+
## 2.10.2
|
|
91
|
+
|
|
92
|
+
- 胶囊外面加了一层兜底:渲染出错时它退化成只有图标和名字的胶囊,并把原因写进 plugin.log,而不是整行凭空消失。
|
|
93
|
+
|
|
94
|
+
## 2.10.1
|
|
95
|
+
|
|
96
|
+
- 挂载时的那次诊断上报改成不会抛错的写法,并且先记一行 client: mounted。它原本写在挂载 effect 里:一旦读取容器信息出错,React 会把整行连同胶囊一起卸载——这正是「刷新后状态行里什么都没有」的一种可能。
|
|
97
|
+
|
|
98
|
+
## 2.10.0
|
|
99
|
+
|
|
100
|
+
- 状态行里的胶囊改成宿主自己的度量:字号、行高、内边距、圆角和颜色都取 StatsPills 用的那几个值,所以它和旁边的轮数、token 统计看起来是同一行里的东西,而不是外挂上去的按钮。
|
|
101
|
+
- 浮层改用宿主菜单的外观:--dsw-specific-menu 表面、磨砂、--dsw-elevation-prominent 阴影、标题下的半像素分隔线、右对齐的数字列表——也就是统计面板那一套,不再自造白底卡片。
|
|
102
|
+
- 悬停就打开(120ms),移开就收起(200ms);点一下可以按住,再点一下收起,Esc、点别处也会收。
|
|
103
|
+
- 位置改为按胶囊实测矩形计算并夹在视口内:宿主的 nchor() 回退链在插件里复现不完整,照抄会把面板拉成满屏。
|
|
104
|
+
- 面板高度按胶囊上方的实际空间收窄,空间不够时内部滚动,不会顶出窗口。
|
|
105
|
+
|
|
106
|
+
## 2.9.1
|
|
107
|
+
|
|
108
|
+
- 卡片默认更宽(380px,窄屏按视口收),底行各项不再从中间断行。
|
|
109
|
+
- 没有标题的事件不再把整条 key 当标题:按 key 说的是什么显示「PR #23 · reviewer」「Issue #3 · author」「run 4394…」。
|
|
110
|
+
|
|
111
|
+
## 2.9.0
|
|
112
|
+
|
|
113
|
+
- 状态行只留一个胶囊:状态点、计数、标签。宽度不够时截断,不折行,也不再和 DSH 自己的状态行抢空间。
|
|
114
|
+
- 鼠标移上去就浮出清单,不用点赞开;点空白处或 Esc 收回,也可以点住固定。
|
|
115
|
+
- 清单改成挂在自己建的全屏浮层里。状态行的容器常带 overflow: hidden,面板留在那一行里会被裁掉——窗口一窄或两侧边栏一开就看不见。
|
|
116
|
+
- 位置按胶囊的真实矩形算:卡片底边贴着胶囊上方,横向越界会拉回视口内,高度不超过胶囊上方的空间。
|
|
117
|
+
- 每次打开都量一次几何,窗口大小或侧边栏变化后仍贴合。
|
|
118
|
+
- 新增 POST /inbox-bridge/client-log:页面首次挂载时上报容器尺寸,写进 plugin.log,方便排查位置问题。
|
|
119
|
+
- 角色与仓库的显示名改由 Host 下发(status.labels),客户端不再自己写中文词表。
|
|
120
|
+
|
|
121
|
+
## 2.8.4
|
|
122
|
+
|
|
123
|
+
- 清理命令需要登录时会明确说出来:clear-inbox --login 等满二十分钟仍在登录页时以退出码 2 结束,不再假装「收件箱已空」;插件看到退出码 2 会记一行「需要一次性登录」,而不是当成崩溃。
|
|
124
|
+
|
|
125
|
+
## 2.8.3
|
|
126
|
+
|
|
127
|
+
- 卡片头行右侧多一个「打开收件箱」,直接跳到 GitHub 的通知收件箱;行悬停有底色,每条事件右侧显示相对时间。
|
|
128
|
+
|
|
129
|
+
## 2.8.2
|
|
130
|
+
|
|
131
|
+
- 状态行改成紧凑胶囊:只显示状态点、待处理数量和一个箭头,窄窗口下只截断不折行。详情改成浮在输入框上方的卡片,有遮罩、Esc 可关,不再把宿主的状态行挤成一条窄缝。
|
|
132
|
+
- 卡片里每条事件带仓库短名、角色标签和相对时间;鼠标移上去有高亮。为空时不再重复两遍「没有待处理的事」。
|
|
133
|
+
|
|
134
|
+
## 2.8.1
|
|
135
|
+
|
|
136
|
+
- 修掉「每次都要重新登录」:之前启动的浏览器被直接杀掉,profile 里的会话根本没落盘;现在先让它自己关(Browser.close),再清残留进程。
|
|
137
|
+
- 页面那条状态路由加了低频读日志(首次与每十次一次,带 origin),用来确认页面确实在取数据。
|
|
138
|
+
|
|
139
|
+
## 2.8.0
|
|
140
|
+
|
|
141
|
+
- 新增视觉入口:输入框上方一行显示「几条在等 / 没有待处理的事」,点开是清单(谁、哪个仓库、什么时候同步的)。只读,不占对话,拉不到数据就整行不显示。
|
|
142
|
+
- 页面数据走同源命名路由 GET /inbox-bridge/status.json(ctx.webServer 注册,只读、无凭据、无第二个端口),内容与 status 命令一致。
|
|
143
|
+
- uildUiPayload 成为可测的纯函数:截 20 条未收口事件、按时间倒序、done 不进页面。
|
|
144
|
+
|
|
145
|
+
## 2.7.1
|
|
146
|
+
|
|
147
|
+
- 启动日志写明是否在归档收件箱(sweep events),和 clear 并列,免得要靠猜。
|
|
148
|
+
|
|
149
|
+
## 2.7.0
|
|
150
|
+
|
|
151
|
+
- 新增 sweep:抓到东西的回合里顺手把通知归档进 Done;空回合不跑,所以安静时零成本。
|
|
152
|
+
- 新增 scripts/clear-inbox.mjs:GitHub 没有 Done 的公开接口,所以它用一次自带浏览器会话完成归档,跑完自己关掉。先 --login 登录一次,之后全在后台跑;--dry-run/--json 可查可脚本化。
|
|
153
|
+
- 插件把 sweep 的结果写进日志(swept the notification inbox: archived N thread(s)),失败也只记一行,不影响投递。
|
|
154
|
+
|
|
155
|
+
## 2.6.1
|
|
156
|
+
|
|
157
|
+
- `runtime.json` 与启动日志里写明 `clear` 的范围:清理是默认行为,看不见就等于不存在。
|
|
158
|
+
|
|
159
|
+
## 2.6.0
|
|
160
|
+
|
|
161
|
+
- 轮询读过的通知线程会被标为已读,未读角标不再只增不减。`clear` 控制范围:`repo`(默认,只清盯着的仓库)、`all`(整个账号)、`off`(不碰)。
|
|
162
|
+
- GitHub 没有“完成”的公开接口:REST 只有 `PATCH /notifications/threads/{id}`,标记的是已读,收件箱历史保留。
|
|
163
|
+
- CLI 增加 `--clear off|repo|all`,输出里报告清掉了几条。
|
|
164
|
+
|
|
165
|
+
## 2.5.0
|
|
166
|
+
|
|
167
|
+
- CI 不再只看默认分支:我自己开的 PR 所在分支也会被读,分支上的失败同样会成为事件;别人分支上的失败仍然不打扰。
|
|
168
|
+
- 为此 gh run list 改为一次抓全部分支(上限 40 条),再按「默认分支 + 我的 PR 分支」过滤。
|
|
169
|
+
|
|
170
|
+
## 2.4.2
|
|
171
|
+
|
|
172
|
+
- 启动日志与通知里的轮询间隔改成可读写法:不足一分钟显示秒(poll every 20 秒),不再出现 poll 0 min。
|
|
173
|
+
|
|
174
|
+
## 2.4.1
|
|
175
|
+
|
|
176
|
+
- 修复 2.3.0 引入的读取缺陷:多仓库状态文件被当成单仓库状态读回,于是每次轮询都从空的 已见 列表开始,lastRun 也每次重算。表现为旧的红运行反复被当成新事件、恢复通知无法触发。现在读回整个文件再按仓库取分片,并加了回归测试。
|
|
177
|
+
- 测试清理在 Windows 上遇到仍被占用目录时会重试,不再偶发 EBUSY。
|
|
178
|
+
|
|
179
|
+
## 2.4.0
|
|
180
|
+
|
|
181
|
+
- README 改成产品向叙述:讲它替你挡住什么、你会看到什么、默认有多安静;版本变更、配置全表、已知边界不再堆在首页。
|
|
182
|
+
- 新增两份深入文档:[如何工作](docs/how-it-works.md)、[配置与命令](docs/configuration.md),`README.en.md` 同步改写。
|
|
183
|
+
- 通知里的收口命令默认带上插件自身的绝对路径,新装用户照抄即可执行(以前是个裸命令)。
|
|
184
|
+
- 命令行帮助与 `list` 脚注不再引用宿主项目的 npm 脚本写法。
|
|
185
|
+
|
|
186
|
+
## 2.3.1
|
|
187
|
+
|
|
188
|
+
- 一次轮询失败会在 `plugin.log` 里留一行 `poll skipped: <reason>`。以前它和「收件箱是空的」长得一模一样。
|
|
189
|
+
- 新增 `debug` 开关(默认关):打开后 `plugin.log` 记录每个边界事件(会话注册、回合开始/结束、用户消息、每次轮询的进出),用来判断是没触发还是触发后没结果。
|
|
190
|
+
|
|
191
|
+
## 2.3.0
|
|
192
|
+
|
|
193
|
+
- `repos`:一个实例订阅一组仓库。队列共用,状态按仓库分片(`state.json` 的 `repos`),事件 key 带仓库前缀 `owner/name#…`——同一个 PR 号在不同仓库是两个事件。
|
|
194
|
+
- `--repo` 可重复、`INBOX_REPO` 接受逗号或空格分隔的列表;`status` 逐个仓库显示上次轮询的身份、耗时与事件数。
|
|
195
|
+
- 2.0/2.1 的旧单仓库状态文件按它上次轮询的仓库自动收编,不会把历史事件重发一遍。
|
|
196
|
+
- 启动时写一行日志(注册的会话数、回合内轮询间隔、投递方式、仓库),装完能直接确认插件活着。
|
|
197
|
+
|
|
198
|
+
## 2.2.0
|
|
199
|
+
|
|
200
|
+
- 轮询改成跟回合走:回合开始一次、进行中每 `intervalMs` 一次、结束一次;空闲时不轮询、不留下定时器。`intervalMs` 因此从「固定轮询间隔」变成「回合内间隔」,默认 45 秒 → 10 分钟。
|
|
201
|
+
- `wakeup` 重做为可审计的四道门:`wakeOn` 角色白名单(默认空 = 永不唤醒)、`wakeAfterIdleMs`(默认 15 分钟)、`wakesPerHour`(默认 2)、每会话 `maxConsecutiveWakes`。每次唤醒写 `woke <session> because <role>:<key>`,被拒时写 `no wakeup: <why>`。
|
|
202
|
+
- 删掉唤醒文案里那句不存在的空闲承诺:现在文案复述的是同一个判断所用的规则。
|
|
203
|
+
- 新增 `status` 子命令:仓库、身份、角色、投递方式、队列计数、上次轮询(身份 / 耗时 / 事件数),只读本地文件。
|
|
204
|
+
- `.work/inbox-bridge/runtime.json` 记录插件本轮生效的配置,`status` 因此能看到插件真实生效值而不是默认值。
|
|
205
|
+
- 仓库状态里记下 `lastPoll`:谁读的、多久、几个事件。
|
|
206
|
+
- 首次轮询只按分支当前状态报一次:新工作区的第一次 poll 不再把窗口里几天前的红运行逐个翻出来。
|
|
207
|
+
- 删掉 Windows 通知弹窗与 `--no-toast`:通知只走 DSH 会话。
|
|
208
|
+
- 环境变量统一为 `INBOX_REPO` / `INBOX_GH` / `INBOX_IDENTITY_*`。
|
|
209
|
+
- 文档重写为按定位叙述(运输层通用、来源当前只有 GitHub),不再讲项目来历。
|
|
210
|
+
|
|
211
|
+
## 2.1.0
|
|
212
|
+
|
|
213
|
+
- 新增 `identity`:poller 以某个身份读 GitHub(本机 `gh` 登录,或 App 安装令牌),并从身份推导每条事件的角色。
|
|
214
|
+
- 新增 `roles`:本机只接受哪些角色(`author` / `reviewer` / `assignee` / `mention` / `ci`);空数组表示全部接受。
|
|
215
|
+
- 事件按角色过滤:别人欠的评审、别人作者的 PR 失败不再变成我的通知;`REVIEW_REQUIRED` 单独不再成事件,只有**我被请求评审**才提醒。
|
|
216
|
+
- 事件 key 带角色段(`pr:131:author:…`、`comment:6885266487:mention`、`issue:150:assignee:…`);`repo` 与 `role` 写进每条事件,投递侧不再从会话 cwd 猜。
|
|
217
|
+
- 修复:只 ack 真正投出去的 key,之前没投出去的事件会被误标 `delivered`,因此永远不再重投。
|
|
218
|
+
- 修复:`delivery: wakeup` 的通知文案不再承诺「长时间没人发言才开一轮」——当前没有空闲门槛,文案改为如实描述。
|
|
219
|
+
- App 身份跳过 `/notifications`(App 没有用户收件箱,该接口返回 403),只读仓库状态。
|
|
220
|
+
- 新增 `ROADMAP.md`;README 明确定位:运输层通用、来源层当前只有 GitHub。
|
|
221
|
+
|
|
222
|
+
## 2.0.4
|
|
223
|
+
|
|
224
|
+
- 描述以「队列 + 回合边界投递」为主语,轮询只作为采集实现写进「工作原理」:2.0.0 之后的产品语义是事件收件箱,不是“轮询一个外部来源”。
|
|
225
|
+
|
|
226
|
+
## 2.0.3
|
|
227
|
+
|
|
228
|
+
- 统一对外描述:插件只读 GitHub(CI、PR、issue),不再宣称“任意外部来源 / 邮件 / 本地命令”;标题、描述、README 与市场索引使用同一句话,版本与用例数同步。
|
|
229
|
+
|
|
230
|
+
## 2.0.2
|
|
231
|
+
|
|
232
|
+
- PR 事件摘要只看“需要你处理的状态”(失败检查 + 评审决定):进行中/成功完成的检查不再进入事件 key,同一个 PR 在检查跑完前不会反复触发通知与唤醒。
|
|
233
|
+
|
|
234
|
+
## 2.0.1
|
|
235
|
+
|
|
236
|
+
- 轮询直接抓取仓库的 open issues:GitHub notifications 只覆盖你订阅的线程,别人新开的 issue 以前会被静默漏掉(#156 / #152)。
|
|
237
|
+
|
|
238
|
+
## 2.0.0
|
|
239
|
+
|
|
240
|
+
- Breaking: `wake` became `delivery` (`quiet` by default). A notice now only queues for the session's next turn; `wakeup` opts into opening a turn, bounded by `maxConsecutiveWakes` and reset by any human-authored message. The old `wake` key fails loudly instead of changing behaviour silently.
|
|
241
|
+
- Notices only go to sessions whose workspace `origin` matches the watched repository, so an idle session in another repository no longer receives this repository's CI.
|
|
242
|
+
- PR event keys no longer contain completion timestamps: an unchanged check set no longer mints a new key on every poll and re-reports the same PR.
|
|
243
|
+
- The "no repository to watch" reminder only reaches sessions that cannot name a repository themselves.
|
|
244
|
+
|
|
245
|
+
## 1.5.1
|
|
246
|
+
|
|
247
|
+
- Fix: wake messages now hand the whole message to `followup()` and `inject()`, so the session log keeps `role` and the conversation can be reopened.
|
|
248
|
+
|
|
249
|
+
## 1.5.0
|
|
250
|
+
|
|
251
|
+
- Wake one idle session (configurable) with `followup()` instead of only injecting context.
|
|
252
|
+
- Poll every 45 seconds by default instead of 120 seconds.
|
|
253
|
+
|
|
254
|
+
## 1.4.0
|
|
255
|
+
|
|
256
|
+
- Standalone project: plugin, CLI and GitHub collector ship as one package.
|
|
257
|
+
- Three-state bookkeeping (pending / delivered / done), resurfacing after six hours, and automatic closing of resolved failures.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Noema-Harness contributors
|
|
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.en.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# GitHub inbox
|
|
2
|
+
|
|
3
|
+
[](https://github.com/c3115644151/dsh-inbox-bridge/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://c3115644151.github.io/dsh-inbox-bridge/index.json)
|
|
6
|
+
|
|
7
|
+
English | [中文](README.md)
|
|
8
|
+
|
|
9
|
+
`dsh-inbox-bridge` is a DSH plugin. For each session it looks at the GitHub repositories that session subscribes to, collects the events that concern you (failed checks, review requests, issues assigned to you, comments mentioning you), and delivers them as one message at the next turn boundary. It reads only, never acts on your behalf, and does not start a turn on its own.
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="https://c3115644151.github.io/dsh-inbox-bridge/assets/panel.png" width="300" alt="The chip in the status row and the panel it opens">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
## Why it exists
|
|
16
|
+
|
|
17
|
+
When an agent writes the code, the repository does not move in step with the conversation. A CI run takes minutes to half an hour; meanwhile the agent is editing something else and does not see the failure happen. A pull request waits for review, an issue waits for an answer, and nobody picks them up. By the time anyone looks, the cheapest moment to fix it has passed.
|
|
18
|
+
|
|
19
|
+
This plugin hands that loop to the agent: once per turn it reads the repository and puts the facts that need action into the context — a failing check gets fixed, a review request gets reviewed, an assigned issue gets taken. Product work and repository upkeep stop interrupting each other, and the agent keeps the repository in shape the way a maintainer does instead of waiting for you to check.
|
|
20
|
+
|
|
21
|
+
That is also why it only reads: its job is to make the agent aware. The work happens in a turn you can watch, not in the background on your behalf.
|
|
22
|
+
|
|
23
|
+
## What it does
|
|
24
|
+
|
|
25
|
+
- **Relevance comes from your identity.** It queries the repositories as your `gh` login (or a configured App identity) and keeps only events where you are the author, the reviewer, the assignee, or are mentioned. Failed checks on someone else's PR, and unrelated repositories, never enter the queue.
|
|
26
|
+
- **It reads repositories, not the notification inbox.** GitHub's notification inbox pushes per account and cannot tell one session or repository from another; querying repository state directly keeps two repositories on the same account apart.
|
|
27
|
+
- **Polling follows turns.** Once when a session starts, every minute while a turn runs, once when it ends. An idle session makes no request.
|
|
28
|
+
- **It is injected into the context and does not interrupt the tool loop.** A notice arrives at the next safe injection point, is marked `delivered`, and unhandled events come back once after six hours.
|
|
29
|
+
|
|
30
|
+
## What you will see
|
|
31
|
+
|
|
32
|
+
At the top of a turn:
|
|
33
|
+
|
|
34
|
+
> External inbox (background poll, not a question from the user) · read as: c3115644151:
|
|
35
|
+
> - [PR/reviewer] #23 review requested: fix: retry on flaky upload https://github.com/…
|
|
36
|
+
> - [CI] run 43934997486 failed: chore: release 2.3.1 https://github.com/…
|
|
37
|
+
>
|
|
38
|
+
> Act only where it affects the current work; when done, run `node "...\dsh-inbox-bridge\scripts\inbox-bridge.mjs" ack --done -- <key>`.
|
|
39
|
+
|
|
40
|
+
The bracket states the relation to that identity: `reviewer` means it waits for your review, `author` means you opened it, `assignee` means it is assigned to you, `mention` means a comment mentions you. Run the `ack` command when you are done; an unacknowledged event is repeated after six hours rather than piling up.
|
|
41
|
+
|
|
42
|
+
## The panel
|
|
43
|
+
|
|
44
|
+
The status row under the composer carries a chip: when something is waiting, a blue dot appears on the icon and the count follows. Hovering it opens a panel with:
|
|
45
|
+
|
|
46
|
+
- the events: role, repository, title (link), time;
|
|
47
|
+
- the identity and the last poll;
|
|
48
|
+
- three controls: delivery (queue only / may wake), message clearing (off / mark read / archive to Done — one choice), and which repositories this session subscribes to (paste a repository link or type `owner/name`; one list per session).
|
|
49
|
+
|
|
50
|
+
Each control explains itself on hover. Changes apply immediately and are stored in `<cwd>/.work/inbox-bridge/prefs.json`; they do not rewrite the DSH plugin configuration, and a reset returns to the configured values. The panel is per session: switching sessions shows that session's repositories, and says so plainly when they are not subscribed.
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
You need DSH and a `gh` that is already logged in on this machine (`gh auth status` should pass). Windows, macOS and Linux are supported.
|
|
55
|
+
|
|
56
|
+
**From the plugin market** (DSH's Plugins → Discover): add an index source with the address
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
https://c3115644151.github.io/dsh-inbox-bridge/index.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
GitHub inbox then shows up in the list and installs from there.
|
|
63
|
+
|
|
64
|
+
**From source:**
|
|
65
|
+
|
|
66
|
+
```powershell
|
|
67
|
+
git clone https://github.com/c3115644151/dsh-inbox-bridge
|
|
68
|
+
dsh plugin add ./dsh-inbox-bridge
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then give it a working directory (`cwd`) in the plugin configuration. The repository and the identity are read from that directory's `git remote` and from `gh`; nothing else needs filling in.
|
|
72
|
+
|
|
73
|
+
## Configuration
|
|
74
|
+
|
|
75
|
+
| Key | Default | Effect |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `cwd` | DSH process directory | where state lives; where the repository is inferred from |
|
|
78
|
+
| `repo` / `repos` | inferred from `origin` | one or several `owner/name` repositories to watch; non-empty `repos` wins |
|
|
79
|
+
| `delivery` | `quiet` | `quiet` queues only; `wakeup` may start a turn while the session is idle |
|
|
80
|
+
| `wakeOn` | empty | roles allowed to wake under `wakeup`; empty never wakes |
|
|
81
|
+
| `clear` | `repo` | mark read after a poll: `repo` / `off`. Only the subscribed repositories, never the whole account |
|
|
82
|
+
| `sweep` | off | archive the inbox into Done on turns that found something; needs a one-time browser sign-in |
|
|
83
|
+
|
|
84
|
+
The panel's "message clearing" choice sets both: **off** (neither), **read** (clear the blue dot), **archive** (mark read and move to Done).
|
|
85
|
+
|
|
86
|
+
Full configuration, CLI and state files: [configuration](docs/configuration.md).
|
|
87
|
+
|
|
88
|
+
## Boundaries
|
|
89
|
+
|
|
90
|
+
- **Read-only.** It does not merge, comment, or change anything.
|
|
91
|
+
- **No turn by default.** Only `delivery: wakeup` with a matching `wakeOn` role may start one.
|
|
92
|
+
- **Done archiving needs one browser sign-in.** GitHub has no archive API; `scripts/clear-inbox.mjs` drives a local Chromium-based browser (Edge, Chrome or Chromium) and needs a single `--login`.
|
|
93
|
+
- **State is local.** It lives under `.work/` in the working directory and is not synced across machines.
|
|
94
|
+
|
|
95
|
+
## Further reading
|
|
96
|
+
|
|
97
|
+
- Polling, relevance, state machine and known limits: [how it works](docs/how-it-works.md)
|
|
98
|
+
- All configuration, CLI, identity and roles: [configuration](docs/configuration.md)
|
|
99
|
+
- Version history: [CHANGELOG.md](CHANGELOG.md)
|
|
100
|
+
- What comes next: [ROADMAP.md](ROADMAP.md)
|
|
101
|
+
- Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
|
package/README.md
CHANGED
|
@@ -1,3 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GitHub inbox
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/c3115644151/dsh-inbox-bridge/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://c3115644151.github.io/dsh-inbox-bridge/index.json)
|
|
6
|
+
|
|
7
|
+
[English](README.en.md) | 中文
|
|
8
|
+
|
|
9
|
+
`dsh-inbox-bridge` 是一个 DSH 插件。它按会话订阅的 GitHub 仓库,收集与你相关、需要你处理的事件(失败的 CI、待你评审的 PR、指派给你的 issue、@你的评论),汇总成一条消息,在回合边界注入会话上下文。它只读 GitHub,不代替你操作,也不会主动开启一轮对话。
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="https://c3115644151.github.io/dsh-inbox-bridge/assets/panel.png" width="300" alt="状态行里的胶囊与悬停展开的面板">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
## 为什么需要它
|
|
16
|
+
|
|
17
|
+
用 agent 写代码,仓库里的工作并不跟着对话走。一次 CI 要跑几分钟到几十分钟,这期间 agent 已经在改别的东西,失败发生时它看不见;PR 等人评审、issue 等人回应,同样没人接手。等想起来去翻,往往已经过了最该修的时候。
|
|
18
|
+
|
|
19
|
+
它的意图是把这件事交给 agent:每轮取一次数,把「需要你动手」的事实带进上下文——CI 挂了就修,有人请你评审就审,指派给你的 issue 就接。开发本身和仓库维护不再互相打断,agent 像维护者一样把仓库维持在健康状态,而不是等你回来看。
|
|
20
|
+
|
|
21
|
+
这也是它只读的原因:它负责让 agent 知道该做什么;动手的是 agent 在你眼前的那一轮,而不是在后台替你改仓库。
|
|
22
|
+
|
|
23
|
+
## 它做什么
|
|
24
|
+
|
|
25
|
+
- **按身份判断相关性。** 用 `gh` 的登录身份(或配置的 App 身份)查询仓库,只保留以你为作者、评审人、指派对象或提及对象的事件;其他 PR 的检查失败、无关仓库的变动不会进入队列。
|
|
26
|
+
- **只看仓库,不看通知箱。** GitHub 的通知箱(`/notifications`)按账号推送,无法区分是哪个会话、哪个仓库;这里直接查仓库状态,因此同一个账号下的两个仓库互不干扰。
|
|
27
|
+
- **轮询跟随回合。** 会话开始时一次、进行中每 1 分钟一次、结束时一次;空闲会话不发请求。
|
|
28
|
+
- **注入到上下文,不打断工具循环。** 消息在下一次安全注入点进入会话;送达后标为 `delivered`,未处理的 6 小时后重新提醒一次。
|
|
29
|
+
|
|
30
|
+
## 你会看到什么
|
|
31
|
+
|
|
32
|
+
出现在回合开头:
|
|
33
|
+
|
|
34
|
+
> 外部收件箱(后台轮询,不是用户提问)· 读取身份:c3115644151:
|
|
35
|
+
> - [PR/reviewer] #23 review requested from you:fix: retry on flaky upload https://github.com/…
|
|
36
|
+
> - [CI] run 43934997486 failed: chore: release 2.3.1 https://github.com/…
|
|
37
|
+
>
|
|
38
|
+
> 只在它影响当前工作时处理;处理完运行 `node "...\dsh-inbox-bridge\scripts\inbox-bridge.mjs" ack --done -- <key>` 标记完成。
|
|
39
|
+
|
|
40
|
+
方括号里是事件与该身份的关系:`reviewer` 表示你是评审人,`author` 表示你是作者,`assignee` 表示指派给你,`mention` 表示评论中提到你。处理完执行提示里的 `ack` 命令;未 ack 的事件在 6 小时后重新提示,不会重复累积。
|
|
41
|
+
|
|
42
|
+
## 界面
|
|
43
|
+
|
|
44
|
+
输入框下方的状态行里有一个胶囊:有未处理事件时,图标右上角出现一个蓝点,旁边是数量。鼠标悬停展开面板:
|
|
45
|
+
|
|
46
|
+
- 事件列表:角色、仓库、标题(可点开)、时间。
|
|
47
|
+
- 身份、上次轮询时间。
|
|
48
|
+
- 三组开关:提醒方式(仅注入 / 主动唤醒)、消息清理(关闭 / 已读 / 归档,一档三态)、订阅仓库(粘贴仓库链接或写 `owner/name` 添加,每个会话各有一份)。
|
|
49
|
+
|
|
50
|
+
每个按钮的悬停提示写明了它的作用。改动立即生效,记录在 `<cwd>/.work/inbox-bridge/prefs.json`,不修改 DSH 的插件配置;重置后回到配置里的值。面板按会话取数:切换会话显示该会话订阅的仓库;仓库未订阅时直接说明。
|
|
51
|
+
|
|
52
|
+
## 安装
|
|
53
|
+
|
|
54
|
+
需要 DSH,以及一个已在本机登录的 `gh`(`gh auth status` 可验证)。支持 Windows、macOS 与 Linux。
|
|
55
|
+
|
|
56
|
+
**从插件市场**(DSH 内置「插件 → 发现」):添加索引源,地址填
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
https://c3115644151.github.io/dsh-inbox-bridge/index.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
列表里会出现 GitHub inbox,安装后即可用。
|
|
63
|
+
|
|
64
|
+
**从源码:**
|
|
65
|
+
|
|
66
|
+
```powershell
|
|
67
|
+
git clone https://github.com/c3115644151/dsh-inbox-bridge
|
|
68
|
+
dsh plugin add ./dsh-inbox-bridge
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
安装后在插件配置里指定工作目录 `cwd`。仓库名与身份都从该目录的 `git remote` 与 `gh` 读取,不需要另外填写。
|
|
72
|
+
|
|
73
|
+
## 配置
|
|
74
|
+
|
|
75
|
+
| 键 | 默认 | 作用 |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `cwd` | DSH 进程工作目录 | 状态文件位置;推断仓库的起点 |
|
|
78
|
+
| `repo` / `repos` | 从 `origin` 推断 | 订阅一个或一组 `owner/name`;非空 `repos` 优先 |
|
|
79
|
+
| `delivery` | `quiet` | `quiet` 只入队;`wakeup` 可在会话空闲时主动开启一轮 |
|
|
80
|
+
| `wakeOn` | 空 | `wakeup` 下允许唤醒的角色白名单;为空则永不唤醒 |
|
|
81
|
+
| `clear` | `repo` | 将订阅仓库里读过的通知标为已读:`repo` / `off`。只清订阅的仓库,不动整个账号 |
|
|
82
|
+
| `sweep` | 关 | 有发现的回合把收件箱归档到 Done,需要先登录一次浏览器 |
|
|
83
|
+
|
|
84
|
+
面板里的「消息清理」一档同时管这两件事:**关闭**(都不做)、**已读**(清蓝点)、**归档**(标已读并存进 Done)。
|
|
85
|
+
|
|
86
|
+
完整配置、命令行与状态文件见 [配置与命令](docs/configuration.md)。
|
|
87
|
+
|
|
88
|
+
## 边界
|
|
89
|
+
|
|
90
|
+
- **只读。** 不合并、不评论、不修改仓库。
|
|
91
|
+
- **默认不主动开启对话。** 只有显式设置 `delivery: wakeup` 且命中 `wakeOn` 时才会。
|
|
92
|
+
- **Done 归档依赖一次浏览器登录。** GitHub 没有归档 API,`scripts/clear-inbox.mjs` 通过本机浏览器(Edge / Chrome / Chromium)完成,需要执行一次 `--login`。
|
|
93
|
+
- **状态在本机。** 存放在工作目录的 `.work/` 下,不跨机器同步。
|
|
94
|
+
|
|
95
|
+
## 更多
|
|
96
|
+
|
|
97
|
+
- 轮询时机、相关性判断、状态机与已知限制:[工作原理](docs/how-it-works.md)
|
|
98
|
+
- 全部配置项、命令行、身份与角色:[配置与命令](docs/configuration.md)
|
|
99
|
+
- 版本变更:[CHANGELOG.md](CHANGELOG.md)
|
|
100
|
+
- 后续计划:[ROADMAP.md](ROADMAP.md)
|
|
101
|
+
- 参与开发:[CONTRIBUTING.md](CONTRIBUTING.md)
|
package/ROADMAP.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# 路线图
|
|
2
|
+
|
|
3
|
+
这份文件回答两个问题:插件想成为什么,以及现在离那里还差什么。它是承诺清单,不是愿望清单——写进来的条目已经有明确的验收方式,没写的就当作不做。
|
|
4
|
+
|
|
5
|
+
## 定位
|
|
6
|
+
|
|
7
|
+
**运输层通用,来源层目前只有 GitHub。**
|
|
8
|
+
|
|
9
|
+
运输层负责「事件怎么进入对话」:三态队列(`pending` / `delivered` / `done`)、回合边界投递、去重与再提醒、恢复收口、ack 记账。它与事件来自哪里无关。
|
|
10
|
+
|
|
11
|
+
来源层负责「从外部取出事件」:一个适配器,读某个来源,吐出统一格式的事件。内置的适配器只有 GitHub(经 `gh` 只读仓库状态)。
|
|
12
|
+
|
|
13
|
+
这两层之间只有一个契约:
|
|
14
|
+
|
|
15
|
+
```jsonc
|
|
16
|
+
// poll 命令向 stdout 打一行 JSON
|
|
17
|
+
{ "events": [ /* 见下 */ ], "skipped": null }
|
|
18
|
+
|
|
19
|
+
// 一条事件
|
|
20
|
+
{
|
|
21
|
+
"key": "pr:131:author:failed[verify]|review:NONE", // 稳定、幂等:同一事实只出现一次
|
|
22
|
+
"kind": "pr", // ci | recovered | infra | pr | comment | issue
|
|
23
|
+
"role": "author", // author | reviewer | assignee | mention | ci | any
|
|
24
|
+
"repo": "owner/name", // 事件来自哪个仓库
|
|
25
|
+
"title": "一句话",
|
|
26
|
+
"url": "https://…",
|
|
27
|
+
"ref": "PR #131", // 可选
|
|
28
|
+
"at": "2026-11-16T…Z", // 可选
|
|
29
|
+
"group": "Desktop checks|main" // 可选:恢复收口按它配对
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
ack 命令从 `INBOX_BRIDGE_KEYS`(JSON 数组)接收 key,收到 `--done` 表示「已处理,不要再提醒」。
|
|
34
|
+
|
|
35
|
+
**这个契约是稳定的**:字段可以增加,不能让两个已有字段改变含义;`key` 的生成规则属于适配器,但「同一事实同一个 key」是硬要求——它决定了会不会刷屏。
|
|
36
|
+
|
|
37
|
+
## 现在有什么
|
|
38
|
+
|
|
39
|
+
- GitHub 适配器:默认分支的 CI 运行、开放 PR 的检查与评审、issue、评论;按身份角色过滤(见 README「身份(`identity`)」)。
|
|
40
|
+
- 身份:本机 `gh` 登录,或 GitHub App 安装令牌。
|
|
41
|
+
- 投递:`quiet`(默认,只排队)与 `wakeup`(可替你开一轮;`wakeOn` 角色白名单 + 空闲门槛 + 每小时预算,默认不唤醒)。
|
|
42
|
+
- 轮询:跟回合边界走,空闲时不起子进程、不留定时器。
|
|
43
|
+
- 可观察:`status` 打印身份、仓库、角色、队列与上次轮询;日志记下每次唤醒的理由。
|
|
44
|
+
- 状态与日志:工作区 `.work/inbox-bridge/`。
|
|
45
|
+
|
|
46
|
+
## 接下来
|
|
47
|
+
|
|
48
|
+
按顺序做,一次一件事;每条都要有测试和一次真实轮询的验证。
|
|
49
|
+
|
|
50
|
+
1. ~~**轮询跟着回合走**~~(2.2.0 已完成:回合开始一次、进行中每 `intervalMs` 一次、结束一次;空闲完全不轮询)。
|
|
51
|
+
2. ~~**`wakeup` 重做**~~(2.2.0 已完成:`wakeOn` + `wakeAfterIdleMs` + `wakesPerHour` + 每会话上限,日志写 `woke … because …`)。
|
|
52
|
+
3. ~~**`dsh-inbox-bridge status`**~~(2.2.0 已完成:仓库、身份、角色、投递方式、队列计数、上次轮询,只读本地文件)。
|
|
53
|
+
4. ~~**多仓库**~~(2.3.0 已完成:`repos` 让一个实例订阅一组仓库;状态按仓库分片,事件 key 带仓库前缀 `owner/name#…`,会话仍只收自己仓库的事件;`INBOX_REPO` 支持逗号分隔,`--repo` 可重复)。
|
|
54
|
+
5. **第二个来源**。候选按成本排序:GitLab/Gitea(同一套 REST 形状,约 100 行适配器)、IM webhook(Slack/Discord/飞书,约几十行,只读进来)、RSS(解析后按 `guid` 去重,约几十行)。做完第一个,才会知道契约是否真的够用;在那之前不承诺第三个。
|
|
55
|
+
|
|
56
|
+
## 不做
|
|
57
|
+
|
|
58
|
+
- **邮件**:认证、线程、引用剥离、垃圾内容,成本远大于收益;需要邮件通知的项目应该在邮件系统里解决。
|
|
59
|
+
- **自动审批**:给 PR 自动点批准是另一种风险级别,不属于通知插件。
|
|
60
|
+
- **写 GitHub**:本插件只读;标已读、加标签、评论都不做。
|
|
61
|
+
- **跨机器同步**:状态是本地 `.work/`,不同步到云端。
|
|
62
|
+
|
|
63
|
+
## 怎么算做到了
|
|
64
|
+
|
|
65
|
+
- 任意来源的事件都能用同一个 `poll` / `ack` 契约接入,接入方式写在 README 里、有可运行的示例;
|
|
66
|
+
- 空闲时没有 `gh` 子进程、没有定时器(2.2.0 起成立,`status` 与日志可查);
|
|
67
|
+
- `wakeup` 的每一次唤醒都能在日志里回答「凭什么」;
|
|
68
|
+
- 所有角色路由与去重规则有测试,且测试失败会指出是哪条规则。
|