dsh-session-superagent 0.8.81 → 0.8.83

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
@@ -2,6 +2,44 @@
2
2
 
3
3
  格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [0.8.83] - 2026-11-02 —— CI 红绿:上一轮的顾虑被实测推翻
6
+
7
+ ### 学到的(知识库第 32 条)
8
+ 上一轮我说"取 CI 状态可能要多一轮查询,先不做"。**实测推翻了这个顾虑**:
9
+ 把 `statusCheckRollup { state }` 加进**已有的** cross-reference 查询,请求数不变
10
+ (拿到 `"statusCheckRollup":{"state":"SUCCESS"}`)。
11
+ <https://docs.github.com/en/graphql/reference/objects#pullrequest>
12
+
13
+ ### 改了什么
14
+ `·CI 失败`(FAILURE/ERROR)、`·CI 运行中`(PENDING/EXPECTED)叠加进 PR 提示;
15
+ **`SUCCESS` 不显示**(绿的不用提,避免噪音)。
16
+
17
+ ### 测试
18
+ - 用例扩充(FAILURE/PENDING 显示、SUCCESS 不显示)。合计 **132 例**。
19
+
20
+ ## [0.8.82] - 2026-11-02 —— 关联 PR 要说清"卡在哪"
21
+
22
+ ### 学到的(知识库第 31 条)
23
+ `reviewDecision`(REVIEW_REQUIRED / APPROVED / CHANGES_REQUESTED)+ `mergeable`(MERGEABLE / CONFLICTING)。
24
+ 本机实测 `cli/cli` 前 3 个 open PR:2 个 `CONFLICTING`、全部 `REVIEW_REQUIRED`、全部草稿。
25
+ <https://docs.github.com/en/graphql/reference/objects#pullrequest>
26
+
27
+ ### 为什么值得
28
+ 「已有 PR」还不足以判断**该不该接管**:
29
+ - 有冲突 → 可能该接手;
30
+ - 等 review → 通常不该插手;
31
+ - 被要求修改 → 作者要动,别抢。
32
+
33
+ ### 改了什么
34
+ 状态**叠加**(不是互斥,一个 PR 可以又草稿又有冲突还等 review):
35
+ ```
36
+ 已有 PR #25(进行中·草稿·有冲突·等 review)
37
+ ```
38
+ 只在 `state === 'OPEN'` 时附加这些后缀。
39
+
40
+ ### 测试
41
+ - 用例扩充(单个状态 / 三状态叠加 / merged 不加后缀)。合计 **132 例**。
42
+
5
43
  ## [0.8.81] - 2026-11-02 —— 草稿 PR 要标出来,别当成"有人在推进"
6
44
 
7
45
  ### 学到的(知识库第 30 条)
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img src="assets/icon-180.png" width="88" height="88" alt="">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.8.81-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.8.83-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
7
7
  [![npm](https://img.shields.io/npm/v/dsh-session-superagent.svg)](https://www.npmjs.com/package/dsh-session-superagent)
8
8
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-plugin-orange.svg)](https://github.com/topics/dsh-plugin)
9
9
 
package/client.js CHANGED
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
14
14
  const { useCallback, useEffect, useRef, useState } = React
15
15
 
16
16
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
17
- const CLIENT_VERSION = '0.8.81'
17
+ const CLIENT_VERSION = '0.8.83'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
 
31
31
  export const name = 'dsh-session-superagent'
32
32
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
33
- export const SERVER_VERSION = '0.8.81'
33
+ export const SERVER_VERSION = '0.8.83'
34
34
  export const inject = ['tools', 'agents', 'webServer']
35
35
 
36
36
  /** 仅供测试:读写状态文件(生产代码不要用)。 */
package/lib/watch.js CHANGED
@@ -720,7 +720,7 @@ export function buildCommentBatchQuery(count) {
720
720
  parts.push(' i' + i + ': issue(number: $n' + i + ') { number'
721
721
  + ' comments(last: 1) { nodes { author { login } createdAt } }'
722
722
  + ' timelineItems(last: 5, itemTypes: [CROSS_REFERENCED_EVENT]) { nodes { ... on CrossReferencedEvent {'
723
- + ' source { __typename ... on PullRequest { number state url isDraft } } } } } }')
723
+ + ' source { __typename ... on PullRequest { number state url isDraft reviewDecision mergeable statusCheckRollup { state } } } } } }')
724
724
  }
725
725
  const vars = Array.from({ length: n }, (_, i) => '$n' + i + ': Int!').join(', ')
726
726
  return 'query($owner: String!, $name: String!' + (n > 0 ? ', ' + vars : '') + ') {'
@@ -846,7 +846,15 @@ export function pickLinkedPullRequests(nodes) {
846
846
  if (!source || source.__typename !== 'PullRequest' || !source.number) continue
847
847
  if (seen.has(source.number)) continue
848
848
  seen.add(source.number)
849
- out.push({ number: source.number, state: String(source.state || ''), url: String(source.url || ''), draft: source.isDraft === true })
849
+ out.push({
850
+ number: source.number,
851
+ state: String(source.state || ''),
852
+ url: String(source.url || ''),
853
+ draft: source.isDraft === true,
854
+ review: String(source.reviewDecision || ''),
855
+ mergeable: String(source.mergeable || ''),
856
+ ci: String((source.statusCheckRollup && source.statusCheckRollup.state) || ''),
857
+ })
850
858
  }
851
859
  // open 的排前面(说明真在做),merged 其次,closed 最后
852
860
  const rank = { OPEN: 0, MERGED: 1, CLOSED: 2 }
@@ -861,6 +869,15 @@ export function linkedPrNote(linked) {
861
869
  const stateText = first.state === 'OPEN' ? '进行中' : first.state === 'MERGED' ? '已合并' : first.state === 'CLOSED' ? '已关闭' : String(first.state || '')
862
870
  // 草稿 PR 说明"还没准备好":别让会话以为对方在推进
863
871
  const draftText = first.state === 'OPEN' && first.draft === true ? '·草稿' : ''
864
- return '已有 PR #' + first.number + (stateText || draftText ? '(' + stateText + draftText + ')' : '')
872
+ // 「卡在哪」比「有 PR」更有用:有冲突 / 等 review 是会话接管前最该知道的
873
+ const blocked = first.state === 'OPEN'
874
+ ? (first.mergeable === 'CONFLICTING' ? '·有冲突' : '')
875
+ + (first.review === 'REVIEW_REQUIRED' ? '·等 review' : '')
876
+ + (first.review === 'CHANGES_REQUESTED' ? '·被要求修改' : '')
877
+ // CI 状态同样是"该不该接管"的依据:失败可能是可修的,运行中等它出结果
878
+ + (first.ci === 'FAILURE' || first.ci === 'ERROR' ? '·CI 失败' : '')
879
+ + (first.ci === 'PENDING' || first.ci === 'EXPECTED' ? '·CI 运行中' : '')
880
+ : ''
881
+ return '已有 PR #' + first.number + (stateText || draftText || blocked ? '(' + stateText + draftText + blocked + ')' : '')
865
882
  + (list.length > 1 ? ' 等 ' + list.length + ' 个' : '')
866
883
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.8.81",
3
+ "version": "0.8.83",
4
4
  "description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",