dsh-inbox-bridge 2.16.4 → 2.17.1

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 CHANGED
@@ -1,3 +1,14 @@
1
+ ## 2.17.1
2
+
3
+ - 安全告警改成每个来源一条:一个依赖就可能带二十条开着的告警,逐条报告会把队列淹掉、把一次修复变成二十条通知。现在一条里写明条数、严重度分布和涉及的两三个包名,修完最后一条自动收口。
4
+ - `code-scanning` 读不到时不再复述 gh 那句误导性的 `admin:repo_hook` 提示,改为指出真正需要的 `security_events` 权限。
5
+ ## 2.17.0
6
+
7
+ - 新命令 `doctor`:逐项自检身份(App 安装令牌一小时过期,过期时这里直接 fail)、订阅的仓库是否可读、每个仓库上次轮询离现在多久、队列积压与过期投递、归档登录是否还在。有 fail 时退出码 1,适合放进脚本。
8
+ - 新命令 `explain <key>`:回答「这件事走到哪一步了」——没被报出、被 `roles` 挡住、仓库不在订阅里、在等你这一轮、已投递还在重提窗口里,或者已经收口。
9
+ - 事件来源多了两类:开着的 Dependabot 与 code scanning 告警(每个来源一条,带条数与严重度分布,修完最后一条后下一次轮询自动收口);我作为作者或指派人的 PR 与基分支冲突或落后。仓库没开 Dependabot、或令牌没有 `security_events` 权限时只记一笔,不会跳过整次轮询。
10
+ - 干净的 PR 的 key 不变,新增的合并状态不会让已投递的事实重新提醒。
11
+
1
12
  ## 2.16.4
2
13
 
3
14
  - 商店与设置页里的简介还写着「空闲时不发请求」,而 2.16.2 起唤醒模式必须空闲取数才能叫醒你。改成按模式说明:为唤醒服务的空闲取数只在能开轮的模式里发生,默认的只注入模式空闲时依旧不发任何请求。
@@ -16,10 +27,10 @@
16
27
  ## 2.16.0
17
28
 
18
29
  - 回合进行中的轮询间隔默认值从 10 分钟改为 1 分钟:CI 跑完一两分钟内就能进上下文,赶在 agent 还没走远时返工。仍只在回合内轮询,空闲不发请求;需要更快可以改 intervalMs(下限 5 秒)。
19
- # Changelog
20
-
21
- Format: keep a short entry per released version. Dates are UTC.
22
-
30
+ # Changelog
31
+
32
+ Format: keep a short entry per released version. Dates are UTC.
33
+
23
34
  ## 2.15.3
24
35
 
25
36
  - 为插件市场准备:新增 screenshots.json(指向 docs/assets/panel.png)与 180px 方形图标 docs/assets/icon-180.png,便于目录与商店类市场展示卡片与截图。
@@ -182,91 +193,91 @@ Format: keep a short entry per released version. Dates are UTC.
182
193
  - CI 不再只看默认分支:我自己开的 PR 所在分支也会被读,分支上的失败同样会成为事件;别人分支上的失败仍然不打扰。
183
194
  - 为此 gh run list 改为一次抓全部分支(上限 40 条),再按「默认分支 + 我的 PR 分支」过滤。
184
195
 
185
- ## 2.4.2
186
-
187
- - 启动日志与通知里的轮询间隔改成可读写法:不足一分钟显示秒(poll every 20 秒),不再出现 poll 0 min。
188
-
189
- ## 2.4.1
190
-
191
- - 修复 2.3.0 引入的读取缺陷:多仓库状态文件被当成单仓库状态读回,于是每次轮询都从空的 已见 列表开始,lastRun 也每次重算。表现为旧的红运行反复被当成新事件、恢复通知无法触发。现在读回整个文件再按仓库取分片,并加了回归测试。
192
- - 测试清理在 Windows 上遇到仍被占用目录时会重试,不再偶发 EBUSY。
193
-
194
- ## 2.4.0
195
-
196
- - README 改成产品向叙述:讲它替你挡住什么、你会看到什么、默认有多安静;版本变更、配置全表、已知边界不再堆在首页。
197
- - 新增两份深入文档:[如何工作](docs/how-it-works.md)、[配置与命令](docs/configuration.md),`README.en.md` 同步改写。
198
- - 通知里的收口命令默认带上插件自身的绝对路径,新装用户照抄即可执行(以前是个裸命令)。
199
- - 命令行帮助与 `list` 脚注不再引用宿主项目的 npm 脚本写法。
200
-
201
- ## 2.3.1
202
-
203
- - 一次轮询失败会在 `plugin.log` 里留一行 `poll skipped: <reason>`。以前它和「收件箱是空的」长得一模一样。
204
- - 新增 `debug` 开关(默认关):打开后 `plugin.log` 记录每个边界事件(会话注册、回合开始/结束、用户消息、每次轮询的进出),用来判断是没触发还是触发后没结果。
205
-
206
- ## 2.3.0
207
-
208
- - `repos`:一个实例订阅一组仓库。队列共用,状态按仓库分片(`state.json` 的 `repos`),事件 key 带仓库前缀 `owner/name#…`——同一个 PR 号在不同仓库是两个事件。
209
- - `--repo` 可重复、`INBOX_REPO` 接受逗号或空格分隔的列表;`status` 逐个仓库显示上次轮询的身份、耗时与事件数。
210
- - 2.0/2.1 的旧单仓库状态文件按它上次轮询的仓库自动收编,不会把历史事件重发一遍。
211
- - 启动时写一行日志(注册的会话数、回合内轮询间隔、投递方式、仓库),装完能直接确认插件活着。
212
-
213
- ## 2.2.0
214
-
215
- - 轮询改成跟回合走:回合开始一次、进行中每 `intervalMs` 一次、结束一次;空闲时不轮询、不留下定时器。`intervalMs` 因此从「固定轮询间隔」变成「回合内间隔」,默认 45 秒 → 10 分钟。
216
- - `wakeup` 重做为可审计的四道门:`wakeOn` 角色白名单(默认空 = 永不唤醒)、`wakeAfterIdleMs`(默认 15 分钟)、`wakesPerHour`(默认 2)、每会话 `maxConsecutiveWakes`。每次唤醒写 `woke <session> because <role>:<key>`,被拒时写 `no wakeup: <why>`。
217
- - 删掉唤醒文案里那句不存在的空闲承诺:现在文案复述的是同一个判断所用的规则。
218
- - 新增 `status` 子命令:仓库、身份、角色、投递方式、队列计数、上次轮询(身份 / 耗时 / 事件数),只读本地文件。
219
- - `.work/inbox-bridge/runtime.json` 记录插件本轮生效的配置,`status` 因此能看到插件真实生效值而不是默认值。
220
- - 仓库状态里记下 `lastPoll`:谁读的、多久、几个事件。
221
- - 首次轮询只按分支当前状态报一次:新工作区的第一次 poll 不再把窗口里几天前的红运行逐个翻出来。
222
- - 删掉 Windows 通知弹窗与 `--no-toast`:通知只走 DSH 会话。
223
- - 环境变量统一为 `INBOX_REPO` / `INBOX_GH` / `INBOX_IDENTITY_*`。
224
- - 文档重写为按定位叙述(运输层通用、来源当前只有 GitHub),不再讲项目来历。
225
-
226
- ## 2.1.0
227
-
228
- - 新增 `identity`:poller 以某个身份读 GitHub(本机 `gh` 登录,或 App 安装令牌),并从身份推导每条事件的角色。
229
- - 新增 `roles`:本机只接受哪些角色(`author` / `reviewer` / `assignee` / `mention` / `ci`);空数组表示全部接受。
230
- - 事件按角色过滤:别人欠的评审、别人作者的 PR 失败不再变成我的通知;`REVIEW_REQUIRED` 单独不再成事件,只有**我被请求评审**才提醒。
231
- - 事件 key 带角色段(`pr:131:author:…`、`comment:6885266487:mention`、`issue:150:assignee:…`);`repo` 与 `role` 写进每条事件,投递侧不再从会话 cwd 猜。
232
- - 修复:只 ack 真正投出去的 key,之前没投出去的事件会被误标 `delivered`,因此永远不再重投。
233
- - 修复:`delivery: wakeup` 的通知文案不再承诺「长时间没人发言才开一轮」——当前没有空闲门槛,文案改为如实描述。
234
- - App 身份跳过 `/notifications`(App 没有用户收件箱,该接口返回 403),只读仓库状态。
235
- - 新增 `ROADMAP.md`;README 明确定位:运输层通用、来源层当前只有 GitHub。
236
-
237
- ## 2.0.4
238
-
239
- - 描述以「队列 + 回合边界投递」为主语,轮询只作为采集实现写进「工作原理」:2.0.0 之后的产品语义是事件收件箱,不是“轮询一个外部来源”。
240
-
241
- ## 2.0.3
242
-
243
- - 统一对外描述:插件只读 GitHub(CI、PR、issue),不再宣称“任意外部来源 / 邮件 / 本地命令”;标题、描述、README 与市场索引使用同一句话,版本与用例数同步。
244
-
245
- ## 2.0.2
246
-
247
- - PR 事件摘要只看“需要你处理的状态”(失败检查 + 评审决定):进行中/成功完成的检查不再进入事件 key,同一个 PR 在检查跑完前不会反复触发通知与唤醒。
248
-
249
- ## 2.0.1
250
-
251
- - 轮询直接抓取仓库的 open issues:GitHub notifications 只覆盖你订阅的线程,别人新开的 issue 以前会被静默漏掉(#156 / #152)。
252
-
253
- ## 2.0.0
254
-
255
- - 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.
256
- - 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.
257
- - 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.
258
- - The "no repository to watch" reminder only reaches sessions that cannot name a repository themselves.
259
-
260
- ## 1.5.1
261
-
262
- - Fix: wake messages now hand the whole message to `followup()` and `inject()`, so the session log keeps `role` and the conversation can be reopened.
263
-
264
- ## 1.5.0
265
-
266
- - Wake one idle session (configurable) with `followup()` instead of only injecting context.
267
- - Poll every 45 seconds by default instead of 120 seconds.
268
-
269
- ## 1.4.0
270
-
271
- - Standalone project: plugin, CLI and GitHub collector ship as one package.
272
- - Three-state bookkeeping (pending / delivered / done), resurfacing after six hours, and automatic closing of resolved failures.
196
+ ## 2.4.2
197
+
198
+ - 启动日志与通知里的轮询间隔改成可读写法:不足一分钟显示秒(poll every 20 秒),不再出现 poll 0 min。
199
+
200
+ ## 2.4.1
201
+
202
+ - 修复 2.3.0 引入的读取缺陷:多仓库状态文件被当成单仓库状态读回,于是每次轮询都从空的 已见 列表开始,lastRun 也每次重算。表现为旧的红运行反复被当成新事件、恢复通知无法触发。现在读回整个文件再按仓库取分片,并加了回归测试。
203
+ - 测试清理在 Windows 上遇到仍被占用目录时会重试,不再偶发 EBUSY。
204
+
205
+ ## 2.4.0
206
+
207
+ - README 改成产品向叙述:讲它替你挡住什么、你会看到什么、默认有多安静;版本变更、配置全表、已知边界不再堆在首页。
208
+ - 新增两份深入文档:[如何工作](docs/how-it-works.md)、[配置与命令](docs/configuration.md),`README.en.md` 同步改写。
209
+ - 通知里的收口命令默认带上插件自身的绝对路径,新装用户照抄即可执行(以前是个裸命令)。
210
+ - 命令行帮助与 `list` 脚注不再引用宿主项目的 npm 脚本写法。
211
+
212
+ ## 2.3.1
213
+
214
+ - 一次轮询失败会在 `plugin.log` 里留一行 `poll skipped: <reason>`。以前它和「收件箱是空的」长得一模一样。
215
+ - 新增 `debug` 开关(默认关):打开后 `plugin.log` 记录每个边界事件(会话注册、回合开始/结束、用户消息、每次轮询的进出),用来判断是没触发还是触发后没结果。
216
+
217
+ ## 2.3.0
218
+
219
+ - `repos`:一个实例订阅一组仓库。队列共用,状态按仓库分片(`state.json` 的 `repos`),事件 key 带仓库前缀 `owner/name#…`——同一个 PR 号在不同仓库是两个事件。
220
+ - `--repo` 可重复、`INBOX_REPO` 接受逗号或空格分隔的列表;`status` 逐个仓库显示上次轮询的身份、耗时与事件数。
221
+ - 2.0/2.1 的旧单仓库状态文件按它上次轮询的仓库自动收编,不会把历史事件重发一遍。
222
+ - 启动时写一行日志(注册的会话数、回合内轮询间隔、投递方式、仓库),装完能直接确认插件活着。
223
+
224
+ ## 2.2.0
225
+
226
+ - 轮询改成跟回合走:回合开始一次、进行中每 `intervalMs` 一次、结束一次;空闲时不轮询、不留下定时器。`intervalMs` 因此从「固定轮询间隔」变成「回合内间隔」,默认 45 秒 → 10 分钟。
227
+ - `wakeup` 重做为可审计的四道门:`wakeOn` 角色白名单(默认空 = 永不唤醒)、`wakeAfterIdleMs`(默认 15 分钟)、`wakesPerHour`(默认 2)、每会话 `maxConsecutiveWakes`。每次唤醒写 `woke <session> because <role>:<key>`,被拒时写 `no wakeup: <why>`。
228
+ - 删掉唤醒文案里那句不存在的空闲承诺:现在文案复述的是同一个判断所用的规则。
229
+ - 新增 `status` 子命令:仓库、身份、角色、投递方式、队列计数、上次轮询(身份 / 耗时 / 事件数),只读本地文件。
230
+ - `.work/inbox-bridge/runtime.json` 记录插件本轮生效的配置,`status` 因此能看到插件真实生效值而不是默认值。
231
+ - 仓库状态里记下 `lastPoll`:谁读的、多久、几个事件。
232
+ - 首次轮询只按分支当前状态报一次:新工作区的第一次 poll 不再把窗口里几天前的红运行逐个翻出来。
233
+ - 删掉 Windows 通知弹窗与 `--no-toast`:通知只走 DSH 会话。
234
+ - 环境变量统一为 `INBOX_REPO` / `INBOX_GH` / `INBOX_IDENTITY_*`。
235
+ - 文档重写为按定位叙述(运输层通用、来源当前只有 GitHub),不再讲项目来历。
236
+
237
+ ## 2.1.0
238
+
239
+ - 新增 `identity`:poller 以某个身份读 GitHub(本机 `gh` 登录,或 App 安装令牌),并从身份推导每条事件的角色。
240
+ - 新增 `roles`:本机只接受哪些角色(`author` / `reviewer` / `assignee` / `mention` / `ci`);空数组表示全部接受。
241
+ - 事件按角色过滤:别人欠的评审、别人作者的 PR 失败不再变成我的通知;`REVIEW_REQUIRED` 单独不再成事件,只有**我被请求评审**才提醒。
242
+ - 事件 key 带角色段(`pr:131:author:…`、`comment:6885266487:mention`、`issue:150:assignee:…`);`repo` 与 `role` 写进每条事件,投递侧不再从会话 cwd 猜。
243
+ - 修复:只 ack 真正投出去的 key,之前没投出去的事件会被误标 `delivered`,因此永远不再重投。
244
+ - 修复:`delivery: wakeup` 的通知文案不再承诺「长时间没人发言才开一轮」——当前没有空闲门槛,文案改为如实描述。
245
+ - App 身份跳过 `/notifications`(App 没有用户收件箱,该接口返回 403),只读仓库状态。
246
+ - 新增 `ROADMAP.md`;README 明确定位:运输层通用、来源层当前只有 GitHub。
247
+
248
+ ## 2.0.4
249
+
250
+ - 描述以「队列 + 回合边界投递」为主语,轮询只作为采集实现写进「工作原理」:2.0.0 之后的产品语义是事件收件箱,不是“轮询一个外部来源”。
251
+
252
+ ## 2.0.3
253
+
254
+ - 统一对外描述:插件只读 GitHub(CI、PR、issue),不再宣称“任意外部来源 / 邮件 / 本地命令”;标题、描述、README 与市场索引使用同一句话,版本与用例数同步。
255
+
256
+ ## 2.0.2
257
+
258
+ - PR 事件摘要只看“需要你处理的状态”(失败检查 + 评审决定):进行中/成功完成的检查不再进入事件 key,同一个 PR 在检查跑完前不会反复触发通知与唤醒。
259
+
260
+ ## 2.0.1
261
+
262
+ - 轮询直接抓取仓库的 open issues:GitHub notifications 只覆盖你订阅的线程,别人新开的 issue 以前会被静默漏掉(#156 / #152)。
263
+
264
+ ## 2.0.0
265
+
266
+ - 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.
267
+ - 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.
268
+ - 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.
269
+ - The "no repository to watch" reminder only reaches sessions that cannot name a repository themselves.
270
+
271
+ ## 1.5.1
272
+
273
+ - Fix: wake messages now hand the whole message to `followup()` and `inject()`, so the session log keeps `role` and the conversation can be reopened.
274
+
275
+ ## 1.5.0
276
+
277
+ - Wake one idle session (configurable) with `followup()` instead of only injecting context.
278
+ - Poll every 45 seconds by default instead of 120 seconds.
279
+
280
+ ## 1.4.0
281
+
282
+ - Standalone project: plugin, CLI and GitHub collector ship as one package.
283
+ - Three-state bookkeeping (pending / delivered / done), resurfacing after six hours, and automatic closing of resolved failures.
package/README.en.md CHANGED
@@ -26,6 +26,7 @@ That is also why it only reads: its job is to make the agent aware. The work hap
26
26
  - **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.
27
27
  - **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.
28
28
  - **Polling follows turns.** Once when a session starts, every minute while a turn runs, once when it ends; an idle session makes no request. Only with `delivery: wakeup` does it also read on that interval while idle — without that it could never wake you while you are away.
29
+ - **It also watches security and merge state.** Open Dependabot and code-scanning alerts, and a pull request of yours that conflicts with the base branch or is behind it, matter as much as a red check.
29
30
  - **It goes into the context, and opens a turn only when it has to.** By default a notice arrives at the next safe injection point and does not interrupt the tool loop; with `delivery: wakeup` it opens a turn only for a listed `wakeOn` role, with the session idle for 15 minutes, at most 3 times in a row per session, and at most 2 times an hour — anything else keeps queueing. A notice is marked `delivered`, and unhandled events come back once after six hours.
30
31
 
31
32
  ## What you will see
@@ -38,7 +39,7 @@ At the top of a turn:
38
39
  >
39
40
  > Act only where it affects the current work; when done, run `node "...\dsh-inbox-bridge\scripts\inbox-bridge.mjs" ack --done -- <key>`.
40
41
 
41
- 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.
42
+ `[Dependabot]` is an open dependency advisory and `[Code scanning]` an open code-scanning alert. The rest of 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.
42
43
 
43
44
  ## The panel
44
45
 
@@ -79,6 +80,8 @@ All three routes install the same package; versions live on [npm](https://www.np
79
80
 
80
81
  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.
81
82
 
83
+ To see what it can actually see: `node scripts/inbox-bridge.mjs doctor` walks the identity, repository access, each repository's last poll and the queue; for one event that never reached you, `node scripts/inbox-bridge.mjs explain <key>` says where it stopped.
84
+
82
85
  ## Configuration
83
86
 
84
87
  | Key | Default | Effect |
package/README.md CHANGED
@@ -26,6 +26,7 @@
26
26
  - **按身份判断相关性。** 用 `gh` 的登录身份(或配置的 App 身份)查询仓库,只保留以你为作者、评审人、指派对象或提及对象的事件;其他 PR 的检查失败、无关仓库的变动不会进入队列。
27
27
  - **只看仓库,不看通知箱。** GitHub 的通知箱(`/notifications`)按账号推送,无法区分是哪个会话、哪个仓库;这里直接查仓库状态,因此同一个账号下的两个仓库互不干扰。
28
28
  - **轮询跟随回合。** 会话开始时一次、进行中每 1 分钟一次、结束时一次,空闲会话不发请求;开启 `delivery: wakeup` 后空闲时也按同一间隔读一次,否则它没机会在你不在时叫醒你。
29
+ - **也看安全与合并状态。** 开着的 Dependabot 告警、code scanning 告警,以及我这些 PR 与基分支的冲突或落后,和 CI 失败一样是要紧的事。
29
30
  - **送进上下文,必要时才开一轮。** 默认只在这一轮的下一次安全注入点进入会话,不打断工具循环;开启 `delivery: wakeup` 后,只有命中 `wakeOn` 的角色、会话空闲满 15 分钟、每会话连续不超过 3 次、每小时不超过 2 次时才主动开一轮,其余情况仍然排队。送达后标为 `delivered`,未处理的 6 小时后重新提醒一次。
30
31
 
31
32
  ## 你会看到什么
@@ -38,7 +39,7 @@
38
39
  >
39
40
  > 只在它影响当前工作时处理;处理完运行 `node "...\dsh-inbox-bridge\scripts\inbox-bridge.mjs" ack --done -- <key>` 标记完成。
40
41
 
41
- 方括号里是事件与该身份的关系:`reviewer` 表示你是评审人,`author` 表示你是作者,`assignee` 表示指派给你,`mention` 表示评论中提到你。处理完执行提示里的 `ack` 命令;未 ack 的事件在 6 小时后重新提示,不会重复累积。
42
+ `[Dependabot]` 表示一条开着的依赖告警,`[Code scanning]` 表示一条开着的代码告警。方括号里其余部分是该事件与该身份的关系:`reviewer` 表示你是评审人,`author` 表示你是作者,`assignee` 表示指派给你,`mention` 表示评论中提到你。处理完执行提示里的 `ack` 命令;未 ack 的事件在 6 小时后重新提示,不会重复累积。
42
43
 
43
44
  ## 界面
44
45
 
@@ -79,6 +80,8 @@ dsh plugin add dsh-inbox-bridge
79
80
 
80
81
  安装后在插件配置里指定工作目录 `cwd`。仓库名与身份都从该目录的 `git remote` 与 `gh` 读取,不需要另外填写。
81
82
 
83
+ 想确认它到底能看见什么:`node scripts/inbox-bridge.mjs doctor` 逐项检查身份、仓库可读性、每个仓库的上次轮询与队列;某件事没到眼前,用 `node scripts/inbox-bridge.mjs explain <key>` 看它卡在哪一步。
84
+
82
85
  ## 配置
83
86
 
84
87
  | 键 | 默认 | 作用 |
package/client.js CHANGED
@@ -110,6 +110,7 @@ window.__ModuleLoader__.load({
110
110
  none: "未配置仓库",
111
111
  open: "打开收件箱",
112
112
  more: (n) => `还有 ${n} 条`,
113
+ kinds: { Dependabot: "依赖告警", "Code scanning": "代码告警" },
113
114
  roles: { author: "作者", reviewer: "评审", assignee: "指派", mention: "提及", ci: "CI", any: "" },
114
115
  ago: { now: "刚刚", minutes: (n) => `${n} 分钟前`, hours: (n) => `${n} 小时前`, days: (n) => `${n} 天前` },
115
116
  pick: {
@@ -161,6 +162,7 @@ window.__ModuleLoader__.load({
161
162
  none: "no repositories configured",
162
163
  open: "open the inbox",
163
164
  more: (n) => `${n} more`,
165
+ kinds: { Dependabot: "Dependabot", "Code scanning": "Code scan" },
164
166
  roles: { author: "author", reviewer: "reviewer", assignee: "assignee", mention: "mention", ci: "CI", any: "" },
165
167
  ago: { now: "just now", minutes: (n) => `${n}m ago`, hours: (n) => `${n}h ago`, days: (n) => `${n}d ago` },
166
168
  pick: {
@@ -570,7 +572,7 @@ window.__ModuleLoader__.load({
570
572
  }
571
573
 
572
574
  function Role({ role, text }) {
573
- const label = text.roles[role] ?? "";
575
+ const label = text.roles[role] ?? text.kinds?.[role] ?? "";
574
576
  if (!label) return null;
575
577
  return h("span", { style: styles.tag }, label);
576
578
  }
@@ -591,7 +593,7 @@ window.__ModuleLoader__.load({
591
593
  h(
592
594
  "span",
593
595
  { style: { display: "inline-flex", gap: "6px", alignItems: "baseline", minWidth: 0 } },
594
- h(Role, { role: event.kind === "ci" ? "ci" : event.role, text }),
596
+ h(Role, { role: event.role && event.role !== "any" ? event.role : event.kind, text }),
595
597
  event.repo
596
598
  ? h("span", { style: styles.tag, title: event.repo }, event.repo.split("/").pop())
597
599
  : null,
@@ -93,6 +93,8 @@ node scripts/inbox-bridge.mjs status # 仓库、身份、角色、投
93
93
  node scripts/inbox-bridge.mjs poll # 立刻抓一次
94
94
  node scripts/inbox-bridge.mjs ack --done -- <key> # 划掉一条,并停止提醒
95
95
  node scripts/inbox-bridge.mjs ack --all-delivered --done # 把所有 delivered 一次划掉
96
+ node scripts/inbox-bridge.mjs doctor # 逐项自检:身份、仓库可读性、上次轮询、队列、归档登录
97
+ node scripts/inbox-bridge.mjs explain <key> # 某件事走到哪一步了,为什么没到你眼前 # 把所有 delivered 一次划掉
96
98
  ```
97
99
 
98
100
  `ack` 不带 `--done` 只把它们标成 delivered,意思是「给过了但还没处理」——6 小时后会再提。经 `npm run` 转发时,`--done` 必须写在 `--` 之后,否则被 npm 吞掉。
@@ -66,6 +66,8 @@ DSH 插件 (index.js) 调度与投递:什么时候去取、取回来给
66
66
  | 评论 | 不是我自己发的,且 @我 |
67
67
  | CI | 默认分支,以及我自己 PR 那条分支;红的才出声,恢复时给一条「已恢复」 |
68
68
  | 基础设施失败 | 只提醒一次,因为再改代码也修不好它 |
69
+ | 安全告警 | 开着的 Dependabot 与 code scanning 告警;每个来源合成一条(条数与严重度分布),修完最后一条后下一次轮询就收口 |
70
+ | PR 变脏 | 我是作者或指派人,且 PR 与基分支冲突或落后;评审人不算,合并是作者的事 |
69
71
 
70
72
  同一条事实不会因为检查状态变来变去就变成好几条通知:key 只由「需要你处理的状态」构成,`QUEUED → IN_PROGRESS → SUCCESS` 全程同一个 key。
71
73
 
@@ -88,6 +90,12 @@ DSH 插件 (index.js) 调度与投递:什么时候去取、取回来给
88
90
 
89
91
  每次唤醒写一行 `woke <session> because <role>:<key>`,被拒绝写 `no wakeup: <原因>`。这样「它为什么叫我」和「它为什么没叫我」都能查。
90
92
 
93
+ ## 出问题时先看两条命令
94
+
95
+ `doctor` 逐项自检:插件是否在这台机器跑过、身份能不能用(App 安装令牌一小时过期,过期时这里是 fail)、订阅的仓库是否可读、每个仓库上次轮询离现在多久、队列积压、归档登录是否还在。
96
+
97
+ `explain <key>` 回答一个更具体的问题:这件事走到哪一步了——没被报出、被 `roles` 挡住、仓库不在订阅里、在等你这一轮、已投递还在重提窗口里,或者已经收口。
98
+
91
99
  ## 已知边界
92
100
 
93
101
  - **只读 GitHub**:不改仓库、不评论、不合并;自动审批不该长在通知插件里。
package/docs/index.json CHANGED
@@ -28,8 +28,8 @@
28
28
  "zh": "GitHub 收件箱"
29
29
  },
30
30
  "description": {
31
- "en": "Lets the agent keep watch over your repository the way a maintainer would: it reads the GitHub repositories a session subscribes to, keeps the events that concern you — failed checks, reviews waiting for you, issues assigned to you, comments that mention you — and puts them in front of the agent in its own turn, opening one by itself when the session is idle and the fact matters, so a broken check gets fixed and a review request gets reviewed without waiting for you. A chip in the status row lists them and switches delivery, message clearing and subscriptions. Read-only; waking is opt-in and gated; no request while idle.",
32
- "zh": "让 agent 像维护者一样盯着你的仓库:按会话订阅的 GitHub 仓库取数,只保留与你有关、需要你处理的事件(失败的 CI、待你评审的 PR、指派给你的 issue、@你的评论),在自己的回合送进上下文——CI 挂了就修,有人请你评审就审,不用等你回来看;会话空闲又遇到要紧的事,它也会主动开一轮。状态行里的胶囊可查看待处理项,并切换提醒方式、消息清理与订阅仓库。只读 GitHub,主动开轮需显式开启且有四道门,空闲时不发请求。"
31
+ "en": "Lets the agent keep watch over your repository the way a maintainer would: it reads the GitHub repositories a session subscribes to, keeps the events that concern you — failed checks, reviews waiting for you, issues assigned to you, comments that mention you, open security alerts, and pull requests that conflict with the base branch — and puts them in front of the agent in its own turn, opening one by itself when the session is idle and the fact matters, so a broken check gets fixed and a review request gets reviewed without waiting for you. A chip in the status row lists them and switches delivery, message clearing and subscriptions. Read-only; waking is opt-in and gated, and reading while idle happens only in the mode that can wake — the default queue-only mode makes no request while idle.",
32
+ "zh": "让 agent 像维护者一样盯着你的仓库:按会话订阅的 GitHub 仓库取数,只保留与你有关、需要你处理的事件(失败的 CI、待你评审的 PR、指派给你的 issue、@你的评论、开着的安全告警、与基分支冲突的 PR),在自己的回合送进上下文——CI 挂了就修,有人请你评审就审,不用等你回来看;会话空闲又遇到要紧的事,它也会主动开一轮。状态行里的胶囊可查看待处理项,并切换提醒方式、消息清理与订阅仓库。只读 GitHub;主动开轮需显式开启且有四道门,为它服务的空闲取数也随模式而定——默认的只注入模式空闲时不发任何请求。"
33
33
  },
34
34
  "icon": "icon.svg",
35
35
  "author": "c3115644151",
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "versions": [
52
52
  {
53
- "version": "2.16.3",
54
- "publishTimestamp": 1794908614,
53
+ "version": "2.17.1",
54
+ "publishTimestamp": 1794913490,
55
55
  "source": {
56
56
  "type": "git",
57
57
  "url": "https://github.com/c3115644151/dsh-inbox-bridge",
58
- "commit": "e20dbbb20b1b2d0b5043d888fea51af3eef2d0e1"
58
+ "commit": "d2191625a4e1c02b1e4d5e1b79fa8e8d8198f6e5"
59
59
  },
60
60
  "engines": {
61
61
  "dsh": ">=0.1.0"
package/index.js CHANGED
@@ -321,7 +321,7 @@ export function apply(ctx, config) {
321
321
  for (const event of events) {
322
322
  recent.delete(event.key);
323
323
  recent.set(event.key, {
324
- kind: event.kind ?? null,
324
+ kind: event.label ?? event.kind ?? null,
325
325
  role: event.role ?? null,
326
326
  title: event.title ?? null,
327
327
  url: event.url ?? null,
@@ -1362,7 +1362,7 @@ export function buildMessage(count, text, label = "外部收件箱") {
1362
1362
  }
1363
1363
 
1364
1364
  function describeEvent(event) {
1365
- const kind = event.kind ?? "event";
1365
+ const kind = event.label ?? event.kind ?? "event";
1366
1366
  const role = event.role && event.role !== "any" && event.role !== "ci" ? `/${event.role}` : "";
1367
1367
  const ref = event.ref ? `${event.ref} ` : "";
1368
1368
  const url = event.url ? ` ${event.url}` : "";
package/locale/en.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "GitHub inbox",
4
- "description": "Lets the agent keep watch over your repository the way a maintainer would: it reads the GitHub repositories a session subscribes to, keeps the events that concern you — failed checks, reviews waiting for you, issues assigned to you, comments that mention you — and puts them in front of the agent in its own turn, opening one by itself when the session is idle and the fact matters, so a broken check gets fixed and a review request gets reviewed without waiting for you. A chip in the status row lists them and switches delivery, message clearing and subscriptions. Read-only; waking is opt-in and gated, and reading while idle happens only in the mode that can wake — the default queue-only mode makes no request while idle.",
4
+ "description": "Lets the agent keep watch over your repository the way a maintainer would: it reads the GitHub repositories a session subscribes to, keeps the events that concern you — failed checks, reviews waiting for you, issues assigned to you, comments that mention you, open security alerts, and pull requests that conflict with the base branch — and puts them in front of the agent in its own turn, opening one by itself when the session is idle and the fact matters, so a broken check gets fixed and a review request gets reviewed without waiting for you. A chip in the status row lists them and switches delivery, message clearing and subscriptions. Read-only; waking is opt-in and gated, and reading while idle happens only in the mode that can wake — the default queue-only mode makes no request while idle.",
5
5
  "detail": "docs/DETAIL.md"
6
6
  }
7
7
  }
package/locale/zh.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "GitHub 收件箱",
4
- "description": "让 agent 像维护者一样盯着你的仓库:按会话订阅的 GitHub 仓库取数,只保留与你有关、需要你处理的事件(失败的 CI、待你评审的 PR、指派给你的 issue、@你的评论),在自己的回合送进上下文——CI 挂了就修,有人请你评审就审,不用等你回来看;会话空闲又遇到要紧的事,它也会主动开一轮。状态行里的胶囊可查看待处理项,并切换提醒方式、消息清理与订阅仓库。只读 GitHub;主动开轮需显式开启且有四道门,为它服务的空闲取数也随模式而定——默认的只注入模式空闲时不发任何请求。",
4
+ "description": "让 agent 像维护者一样盯着你的仓库:按会话订阅的 GitHub 仓库取数,只保留与你有关、需要你处理的事件(失败的 CI、待你评审的 PR、指派给你的 issue、@你的评论、开着的安全告警、与基分支冲突的 PR),在自己的回合送进上下文——CI 挂了就修,有人请你评审就审,不用等你回来看;会话空闲又遇到要紧的事,它也会主动开一轮。状态行里的胶囊可查看待处理项,并切换提醒方式、消息清理与订阅仓库。只读 GitHub;主动开轮需显式开启且有四道门,为它服务的空闲取数也随模式而定——默认的只注入模式空闲时不发任何请求。",
5
5
  "detail": "docs/DETAIL.zh.md"
6
6
  }
7
7
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dsh-inbox-bridge",
3
- "version": "2.16.4",
3
+ "version": "2.17.1",
4
4
  "displayName": "GitHub inbox",
5
- "description": "DSH 插件:让 agent 像维护者一样盯着你的仓库——按会话订阅仓库,取回与你有关、需要你处理的事件(失败的 CI、待评审的 PR、指派给你的 issue、@你的评论),在自己的回合送进上下文;会话空闲又遇到要紧的事时也能主动开一轮,让 agent 自己去修、去审、去接。",
5
+ "description": "DSH 插件:让 agent 像维护者一样盯着你的仓库——按会话订阅仓库,取回与你有关、需要你处理的事件(失败的 CI、待评审的 PR、指派给你的 issue、@你的评论、开着的安全告警),在自己的回合送进上下文;会话空闲又遇到要紧的事时也能主动开一轮,让 agent 自己去修、去审、去接。",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "author": "c3115644151",