@morehao/dsh-github-trending 0.5.2 → 0.6.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 CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.6.0] - 2026-11-01
4
+
5
+ > **发版顺序**:先发布核心 `0.7.0`(含契约 0.4.0 的字段),再发布本插件——本版
6
+ > `dsh.core.version` 已指向 `0.7.0`,核心未发布前首次运行会下载失败。
7
+ > 契约包 `@morehao/trendradar-contract` 仍锁 `0.3.0`:0.4.0 的新类型(`SubscriptionItem` /
8
+ > `SubscriptionDoc` 等)先按本地声明落地(`src/ipc.ts`),契约包发布后切回包导入。
9
+
10
+ ### 新增
11
+
12
+ - **订阅页重设计**:命令栏(输入即筛选,完整 `owner/repo` 出现添加建议、回车添加)+ 四列表格
13
+ (仓库 / 最近版本 / 最近总结 / 状态,表头可排序)+ 常驻「变更」+ 批量选择(已选 N / 全选匹配 /
14
+ 取消 / 移除所选,确认框列出前 6 个)+ 空态与「无匹配」分开 + 键盘操作。
15
+ 列表只拉判断所需的最小字段,40 仓首次请求约 5 KB。
16
+ - **文档抽屉**:按仓拉取该仓库的发版记录 markdown(核心返回的是数据仓里的原文,面板只渲染、
17
+ 不二次总结),支持多卷切换(第 N 册 / 共 M 册)、加载/失败/空文档三态,限流或失败时顶部提示
18
+ 「本周未更新」。
19
+ - **发版周定时**:与日报调度独立(周几 + HH:MM + IANA 时区,60 s tick),错过时刻 6 h 内补跑,
20
+ 超窗跳过下周并入;同一 ISO 周不重复。设置页「发版订阅」新增定时与并发(自动/指定)。
21
+ - **发版运行记录**:每次发版运行落一条 `releaseRuns`(status / checked / changed / newTags /
22
+ failed / tokens / duration / commit / prUrl / error),保留最近 30 条;运行记录页新增
23
+ 「全部 / 日报 / 发版」筛选与发版明细。
24
+ - 订阅页 meta 行显示周期、下次触发与上次发版检查时间、上周有变化的仓库数。
25
+
26
+ ### 变更
27
+
28
+ - **发版检查改为每周一次**:核心每仓每周一次模型调用、一仓一份 `releases/<owner>/<repo>.md`
29
+ 文档(按周 prepend,超 600 行下一次写入开 `.02.md`)。因此 `releases.period` 只接受
30
+ `weekly`(旧的 `daily`/`monthly` 会被校验拦下并提示改成 weekly),`perRepoLimit` 默认
31
+ 5 → 10(只影响文档里列出的版本数)。
32
+ - 新增设置项:`releases.summaryMaxChars`(1200)、`releases.docMaxLines`(600)、
33
+ `releases.concurrency`(`auto` → `clamp(4, ceil(N/10), 8)`)、`releases.budgetSeconds`
34
+ (`auto` → `min(300, 30+3N)`)、`releases.schedule.*`。**发版调度只写 settings.json,
35
+ 不进核心 YAML**。
36
+ - 插件经核心 `run --stages releases` 触发发版运行:不合并 pending 订阅、不改
37
+ `subscriptions.yaml`,与日报共用单运行锁与当日分支/PR。
38
+ - `GET /subscriptions` 现在返回 `{ repos, items }`,新增
39
+ `GET /subscriptions/releases?repo=&volume=`(只读镜像核心 IPC)。
40
+
41
+ ### 修复
42
+
43
+ - 取消后的发版运行记录现在带 `errorCode=CORE_CANCELLED`,不再出现「已取消但没有原因」的记录。
44
+
3
45
  ## [v0.5.2] - 2026-10-31
4
46
 
5
47
  ### 修复
package/README.md CHANGED
@@ -52,11 +52,12 @@ dsh plugin --profile <profile> add @morehao/dsh-github-trending
52
52
 
53
53
  ## 发版订阅
54
54
 
55
- - 订阅一组仓库,之后每次运行把每个仓库「**新增的 Release**(无 Release 时回退 Tag)」写成中文 changelog,渲染到 `<output.dir>/releases/`,与榜单**同分支、同 PR** 一起提交。发版阶段**常开**;没有订阅时不产出,既有榜单产物逐字节不变。
55
+ - 订阅一组仓库,之后**每周一次**把每个仓库这一周「**新增的 Release**(无 Release 时回退 Tag)」合成一段中文总结,写到 `<output.dir>/releases/<owner>/<repo>-01.md`(每册都带两位序号,超出行数预算后下一次写入开 `-02.md`,最新一周在最上面),与榜单**同分支、同 PR** 一起提交。发版阶段**常开**;没有订阅时不产出,既有榜单产物逐字节不变。跨仓的周汇总(`releases/_weekly/<年>/<ISO周>.{md,json}`)继续生成,供外部 Web 服务的 `GET /api/v2/releases*` 消费。
56
56
  - **订阅列表随数据仓版本化**:文件在 `<repo>/<OutputRoot(output.dir)>/subscriptions.yaml`,随产物同一次 commit / PR,可审计、可复现。
57
- - **插件不直接写仓**:列表经核心 `subscribe` IPC 命令读改——`add` / `remove` 只写 `.git/trendradar-subscriptions.pending`,下一次 `run` 切分支后落盘并随 artifact 提交。插件侧的子进程只做一次 stdin 交互:`RunRequest{command:"subscribe", action, repo?, configPath}`,`list` 的仓库由核心 stdout 逐行返回后插件解析。`configPath` 由插件生成(与 `run` 同源的临时配置),保证 `subscribe` 与 `run` 解析到同一个订阅文件;代理模式下 `model.baseURL` 为空,临时配置补一个回环占位端点以通过核心 `config.Load`(订阅命令不调用模型)。
58
- - 界面:「订阅」页管理列表(增删);「设置 → 发版订阅」分区放行为参数(含预发布 / 含草稿 / notes 截断,字段旁 `?` 悬浮说明),以及「管理订阅列表 →」入口。
59
- - 周期独立:`releases.period` 默认 `daily`,不与 `trending.since` 联动。
57
+ - **插件不直接写仓**:列表经核心 `subscribe` IPC 命令读改——`add` / `remove` 只写 `.git/trendradar-subscriptions.pending`,下一次 `run` 切分支后落盘并随 artifact 提交。插件侧的子进程只做一次 stdin 交互:`RunRequest{command:"subscribe", action, repo?, volume?, configPath}`;核心把 payload 放进结果信封(`subscriptions` / `subscriptionDoc`),旧核心把 `list` 结果逐行打到信封前,插件两种都认。`configPath` 由插件生成(与 `run` 同源的临时配置),保证 `subscribe` 与 `run` 解析到同一个订阅文件;代理模式下 `model.baseURL` 为空,临时配置补一个回环占位端点以通过核心 `config.Load`(订阅命令不调用模型)。
58
+ - 界面:「订阅」页管理列表(增删 + 逐仓库状态),可展开某仓库的发版文档(`GET /subscriptions/releases?repo=&volume=`);「设置 → 发版订阅」分区放行为参数与每周触发节奏。
59
+ - 周期:0.7.0 起只支持**每周**(`releases.period=weekly`)——每个 ISO 周、每仓库一条中文摘要,文档按周累积并按行数预算自动分卷;填 `daily`/`monthly` 会被校验拦下并说明原因。
60
+ - 每周发版行程与榜单调度**互相独立**:`releases.schedule`(`enabled` / `weekday`(ISO 1=周一…7=周日)/ `time` / `timezone`)驱动 `run --stages releases`——只跑发版阶段,不抓榜单、不渲染 digest、不合并订阅 pending;成功后按 ISO 周(如 `2026-W44`)去重。
60
61
  - 历史里每条运行记录带 `releases` 摘要(仓库数 / 新发版 / 已摘要 / 降级 / 失败 / 跳过)与本次 `tokens`;旧核心没有 `releases` 块时缺省。
61
62
 
62
63
 
@@ -117,8 +118,11 @@ dsh plugin --profile <profile> add @morehao/dsh-github-trending
117
118
  | `summarize.readmeChars` | `800` | README 摘录长度(enrich=readme 时) |
118
119
  | `releases.includePrerelease` / `includeDrafts` | `false` / `false` | 是否含预发布 / 草稿(发版阶段常开,不提供 `enabled` 开关) |
119
120
  | `releases.fallbackToTags` / `baselineOnFirstRun` | `true` / `true` | 无 Release 时回退 Tag / 首次只记基线 |
120
- | `releases.perRepoLimit` / `maxNotesChars` | `5` / `4000` | 每仓单次上限(1–20)/ notes 截断(500–20000) |
121
- | `releases.period` | `daily` | 发版摘要周期(独立,不与 `trending.since` 联动) |
121
+ | `releases.perRepoLimit` / `maxNotesChars` | `10` / `4000` | 文档列出的版本条数(1–20)/ notes 截断(500–20000) |
122
+ | `releases.summaryMaxChars` / `docMaxLines` | `1200` / `600` | 每仓每周摘要字数(500–2000)/ 文档行数预算(100–2000,超了开新卷) |
123
+ | `releases.concurrency` / `budgetSeconds` | `auto` / `auto` | 订阅并发(`auto` 或 1–8)/ 模型预算秒(`auto` 或 1–300);`auto` 由插件按订阅数解析 |
124
+ | `releases.period` | `weekly` | 只支持 `weekly`(每个 ISO 周一条摘要) |
125
+ | `releases.schedule.enabled` / `weekday` / `time` / `timezone` | `true` / `1` / `08:00:00` / `Asia/Shanghai` | 每周发版行程(插件自己的 tick;`weekday` 为 ISO 1=周一…7=周日);**不写进核心 YAML** |
122
126
  | `output.dir` | `trending` | 仓库内相对目录 |
123
127
  | `schedule.enabled` / `time` / `timezone` | `true` / `08:30:00` / `Asia/Shanghai` | 插件自己的 60 s tick 驱动 |
124
128
  | `schedule.periods` | `daily,weekly,monthly` | 定时自动产出的周期:默认三周期全产出(无需勾选),日=每天、周=周日、月=月末触发;旧配置自动升级为三周期 |