@tea-agent/loop-agent 0.53.0-next.1 → 0.53.0-next.3

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.
Files changed (117) hide show
  1. package/CHANGELOG.md +18 -52
  2. package/dist/build-stamp.json +3 -3
  3. package/dist/shared/pi-context-pressure/compaction-policy.js +22 -34
  4. package/dist/shared/pi-context-pressure/index.js +1 -1
  5. package/dist/worker/console/automation-actions.js +62 -7
  6. package/dist/worker/console/chat/api-workbench-core.js +131 -4
  7. package/dist/worker/console/chat/api-workbench-schema.js +278 -0
  8. package/dist/worker/console/chat/api-workbench-spring.js +333 -0
  9. package/dist/worker/console/chat/api-workbench.js +88 -2
  10. package/dist/worker/console/chat/human-gate-card.js +16 -1
  11. package/dist/worker/console/chat/image-cache.js +39 -8
  12. package/dist/worker/console/chat/pi-runtime/custom-tools/apiworkbench-tools.js +120 -5
  13. package/dist/worker/console/chat/pi-runtime.js +2 -3
  14. package/dist/worker/console/chat/provider-error.js +12 -2
  15. package/dist/worker/console/chat/repo-walk.js +8 -0
  16. package/dist/worker/console/chat/routes.js +125 -13
  17. package/dist/worker/console/chat/todo-diff.js +90 -0
  18. package/dist/worker/console/chat/turn-process.js +3 -0
  19. package/dist/worker/console/network-proxy-settings.js +67 -1
  20. package/dist/worker/console/operator-actions.js +25 -0
  21. package/dist/worker/console/pi-compaction-settings.js +16 -13
  22. package/dist/worker/console/server.js +20 -0
  23. package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-CR1jj_rz.js → abnfDiagram-N423BO3Z-9YdcTSkA.js} +1 -1
  24. package/dist/worker/console/static/assets/{arc-CjxcQfEu.js → arc-5o9a24RM.js} +1 -1
  25. package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-D-3u2qFL.js → architectureDiagram-T3A2C74G-kk-Y4K8w.js} +1 -1
  26. package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-Bdr7gWVo.js → blockDiagram-VBNYF7ZC-BuMyp-i-.js} +1 -1
  27. package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-hQHNe5T3.js → c4Diagram-5PPSVZJV-BnAbUXQM.js} +1 -1
  28. package/dist/worker/console/static/assets/channel-DzpJs7JM.js +1 -0
  29. package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-BEg_su6q.js → chunk-2GRJ4B5K-sQ2VjuFx.js} +1 -1
  30. package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-DZnV6VTC.js → chunk-2Q5K7J3B-CbkqzTV8.js} +1 -1
  31. package/dist/worker/console/static/assets/{chunk-5RXB4S5H-Dg0LzAqO.js → chunk-5RXB4S5H-CaP8JTC3.js} +1 -1
  32. package/dist/worker/console/static/assets/{chunk-5VM5RSS4-D2vqr52W.js → chunk-5VM5RSS4-D7yUFtwu.js} +1 -1
  33. package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-D8We_g6R.js → chunk-6Q2QTUOP-zowLlgmO.js} +1 -1
  34. package/dist/worker/console/static/assets/{chunk-GF5L2VYU-DbEU8drD.js → chunk-GF5L2VYU-KGzLFdSC.js} +1 -1
  35. package/dist/worker/console/static/assets/{chunk-JWPE2WC7-Boi8TJYN.js → chunk-JWPE2WC7-DuVIxg_I.js} +1 -1
  36. package/dist/worker/console/static/assets/{chunk-KBJHAD2P-CjJmKa9f.js → chunk-KBJHAD2P-CXP8iZrQ.js} +1 -1
  37. package/dist/worker/console/static/assets/{chunk-RYQCIY6F-C-KV-ag7.js → chunk-RYQCIY6F-DASfOCYV.js} +1 -1
  38. package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DZlTonsZ.js → chunk-XXDRQBXY-DFwLDf-r.js} +1 -1
  39. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-ClK7LSSv.js +1 -0
  40. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-ClK7LSSv.js +1 -0
  41. package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-BIvFe3yn.js → cose-bilkent-JH36ORCC-CIrJSuNM.js} +1 -1
  42. package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-BOBPfv8u.js → cynefinDiagram-MW4NZA55-BrI5M-XP.js} +1 -1
  43. package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-BF54orLO.js → dagre-VZM6K2ZE-BEJlUQi2.js} +1 -1
  44. package/dist/worker/console/static/assets/{diagram-7IWD3JNH-CxjAP2AP.js → diagram-7IWD3JNH-Buw7nAqS.js} +1 -1
  45. package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-BXYkuNGt.js → diagram-B4RE2ZJO-DHURLBbb.js} +1 -1
  46. package/dist/worker/console/static/assets/{diagram-LBJQPF4R-DQTu-2Iy.js → diagram-LBJQPF4R-CEFuptxk.js} +1 -1
  47. package/dist/worker/console/static/assets/{diagram-Q27KOJAE-DNURuIYc.js → diagram-Q27KOJAE-Cejgl71p.js} +1 -1
  48. package/dist/worker/console/static/assets/{diagram-UB23O5K3-D69uANY8.js → diagram-UB23O5K3-Bwxq3Xoa.js} +1 -1
  49. package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-C658EcrV.js → ebnfDiagram-BXEA7PRR-i4NNenm0.js} +1 -1
  50. package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-BRccYtAl.js → erDiagram-JOGREHBK-BaSp03BR.js} +1 -1
  51. package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-DnIR4sLs.js → flowDiagram-UKHOOZJN-CQtgCCPg.js} +1 -1
  52. package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-Bo3eWFVC.js → ganttDiagram-PKOTCBZU-DkS9Vbt8.js} +1 -1
  53. package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-EyWDCNU_.js → gitGraphDiagram-DS77QQ5N-Dm64UQgY.js} +1 -1
  54. package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-B0Eld9u0.js → infoDiagram-6WML65LV-BpcLrRRV.js} +1 -1
  55. package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-DsJQiJ27.js → ishikawaDiagram-WSZJBQD7-DFjxaE3Q.js} +1 -1
  56. package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-fpE0yqjC.js → journeyDiagram-NVQOT4AX-G6kuLGYK.js} +1 -1
  57. package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-Dq9IrDdT.js → kanban-definition-27J2QSJJ-DistDdnp.js} +1 -1
  58. package/dist/worker/console/static/assets/{linear-CFV4BDyf.js → linear-Cadcj4Jf.js} +1 -1
  59. package/dist/worker/console/static/assets/main-CKu0wCrM.js +654 -0
  60. package/dist/worker/console/static/assets/main-DpBoCiky.css +1 -0
  61. package/dist/worker/console/static/assets/{mermaid.core-BMMXqtrB.js → mermaid.core-CVqQBsGx.js} +4 -4
  62. package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-DurrK_Gi.js → mindmap-definition-FAOFIHXS-oIAAXLn3.js} +1 -1
  63. package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-CzZayNy2.js → pegDiagram-VL7TDLO6-BgBPFLA0.js} +1 -1
  64. package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-B1W7Y0cE.js → pieDiagram-7S7Q4E2Y-RTyZdL9S.js} +1 -1
  65. package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-BdbL83CU.js → quadrantDiagram-CIZ2JOQS-BHEYQMZx.js} +1 -1
  66. package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-W-bQpd18.js → railroadDiagram-AXF67PYL-B2JIrks2.js} +1 -1
  67. package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-C9bi4tQJ.js → requirementDiagram-LRYGKXZP-TJ5_MWbY.js} +1 -1
  68. package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-D4kO56Wd.js → sankeyDiagram-W5VNT64P-BzjUsr0j.js} +1 -1
  69. package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-CIbesK1e.js → sequenceDiagram-SI44F4Z6-DrmrPPVE.js} +1 -1
  70. package/dist/worker/console/static/assets/{sheet-workbook-kFN3yUBr.js → sheet-workbook-DCQgjy0Q.js} +1 -1
  71. package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-Dk4XAK7C.js → sizeCapture-X5ZJPWSS-BLp8F5fC.js} +1 -1
  72. package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-Bz9B6UZ7.js → stateDiagram-OKZ733FA-5MNm447q.js} +1 -1
  73. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-gP-t-MQJ.js +1 -0
  74. package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-qLEds93n.js → swimlanes-SLNWSIFB-Cs2RUkNq.js} +2 -2
  75. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-D6MJJUTV.js +8 -0
  76. package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-C9rVFC0h.js → timeline-definition-Z64GVDOM-BoeTHoWc.js} +1 -1
  77. package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-CoKJ9hU0.js → vennDiagram-T6HMQDX7-DFWej-Mm.js} +1 -1
  78. package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-tHz_S7-L.js → wardleyDiagram-T6FBY63Y-BcD0_2m5.js} +1 -1
  79. package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-DKzKYnvG.js → xychartDiagram-ELKLHX3M-y4PQYZiq.js} +1 -1
  80. package/dist/worker/console/static/index.html +2 -2
  81. package/dist/worker/console/static-src/markdown-incremental.js +138 -0
  82. package/dist/worker/console/static-src/operator-chat/automation-catalog-model.js +43 -0
  83. package/dist/worker/console/static-src/operator-chat/composer-drop.js +138 -0
  84. package/dist/worker/console/static-src/operator-chat/composer-image-paths.js +25 -5
  85. package/dist/worker/console/static-src/operator-chat/composer-image-preview.js +115 -0
  86. package/dist/worker/console/static-src/operator-chat/composer-session-ledger.js +44 -2
  87. package/dist/worker/console/static-src/operator-chat/composer-upload.js +115 -0
  88. package/dist/worker/console/static-src/operator-chat/gate-expiry.js +43 -0
  89. package/dist/worker/console/static-src/operator-chat/process-label.js +15 -2
  90. package/dist/worker/console/static-src/operator-chat/schedule-relative-time.js +54 -0
  91. package/dist/worker/console/static-src/operator-chat/schedule-rule-summary.js +213 -0
  92. package/dist/worker/console/static-src/operator-chat/tasks-model.js +4 -0
  93. package/dist/worker/console/static-src/operator-chat/turn-group-equality.js +8 -0
  94. package/dist/worker/console/static-src/operator-chat/turn-process-disclosure.js +12 -0
  95. package/dist/worker/console/static-src/operator-chat/turn-state-projection.js +51 -0
  96. package/dist/worker/console/static-src/operator-chat/useChatStream.js +22 -2
  97. package/dist/worker/console/static-src/operator-chat/useChatThread.js +15 -1
  98. package/dist/worker/console/static-src/operator-chat/useComposer.js +290 -21
  99. package/dist/worker/console/static-src/operator-chat/useSessionAutomationCounts.js +98 -0
  100. package/dist/worker/console/static-src/pages/api-request-template.js +144 -0
  101. package/dist/worker/console/static-src/session-search-shortcut.js +38 -0
  102. package/dist/worker/console/version-notes-comparison.js +52 -0
  103. package/dist/worker/console/version-notes.js +16 -1
  104. package/dist/worker/console/workspace-context.js +10 -0
  105. package/dist/worker/observe/static/console-theme.css +50 -3
  106. package/dist/worker/observe/static/console-theme.js +86 -1
  107. package/dist/worker/scheduler/automation-across-workspaces.js +120 -0
  108. package/docs/README.md +1 -0
  109. package/docs/operations/README.md +1 -0
  110. package/package.json +3 -3
  111. package/dist/worker/console/static/assets/channel-CBlJfald.js +0 -1
  112. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-mNUYCdDo.js +0 -1
  113. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-mNUYCdDo.js +0 -1
  114. package/dist/worker/console/static/assets/main-D-ZQ4gLb.css +0 -1
  115. package/dist/worker/console/static/assets/main-Dwhb3ZRq.js +0 -645
  116. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BBRlxIq8.js +0 -1
  117. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CRBvOMCQ.js +0 -8
package/CHANGELOG.md CHANGED
@@ -4,60 +4,13 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
- ### 重点更新
8
-
9
- - 移除了旧的 JSON 工作流命令:`dag workflow-plan`、`dag workflow-validate`、`dag workflow-compile`、`workflow save|run|diff|replay`。
10
- - 编写脚本工作流改用 JavaScript,任务执行仍在 DAG 里进行。
11
- - 移除了任务级 `loop` 与 `loop-benchmark` 命令。持续目标改在对话里用 `/goal` 推进,不再使用单独的 loop 状态。
12
-
13
- ### 改进
7
+ ## [0.53.0-next.3] - 2026-10-26
14
8
 
15
- - Console 更新为较慢的依赖安装预留更多时间,失败后区分原因并提供明确重试入口;修复进度一直停在 0% 的问题,并按更新阶段显示百分比与用时。有对话、DAG 或 Worker 正在执行时,可确认中断风险后继续更新。
16
- - 对话详情在历史无新事件时优先复用投影检查点,长对话二次打开和切换更迅速。
17
- - 重命名或归档会话立即在列表中生效,不再因后台网络刷新延迟而闪烁旧标题。
18
- - 工作区切换和首次加载文件目录时复用本地缓存并合并并发请求,浏览和选择项目更快。
19
- - 新建对话后模型栏和上下文概览立即显示,不再等待插件加载完成,点开后可以直接输入。
20
- - 右侧栏任务管理可按树状或拓扑图查看子代理,拓扑图的连线从主会话卡片底部成扇形连到各子代理,穿过卡片的部分由卡片遮挡,不再有线条挤在列间缝隙里。
21
- - 任务管理底部的后台任务列表改为单行显示,每行依次是状态点、终端类型、任务名、状态和耗时;运行中的任务显示数量并用强调色标出。
22
- - 点击后台任务会打开可拖动、可缩放的输出窗口,按终端配色显示完整输出,可复制、跟随最新输出,运行中的任务还能在窗口内终止;窗口可随时关闭。
23
- - 子代理详情改为顶部概览、可滚动正文和底部输入三段式,连续调用的同类工具折叠显示,长内容可以上下滚动。
24
- - 子代理运行中可以停止,第一次点击变为「确认停止」,三秒内再次点击才真正停止,避免误触。
25
- - 会话中出现子代理时右侧栏自动打开任务管理;已经打开的侧栏不会被接管,窗口宽度小于 768 像素时不会自动打开。设置中新增「侧边栏」分区可以分别关闭这些行为。
26
- - 对话正文和右侧栏的字号统一为一套层级,正文不再比代码更大;文件路径按等宽字体显示,鼠标移上去才高亮。
27
- - 右侧栏打开的文件在模型改动后会显示最新内容;预览顶部新增重新读取按钮,用外部工具改完文件也能立刻看到。
28
- - 会话的调用记录不再固定占用一个标签页,需要时可在洞察页点「查看调用记录」打开。
29
- - 顶层回复完成后展示已编辑文件汇总卡片,并可直接在右侧栏定位和预览改动。
30
- - 侧边栏的文件预览现在能直接打开 Word 文档(`.docx`),按页显示正文、标题、表格、图片、页眉页脚和脚注。打开后在预览里划词选中一段文字,就能像引用源码和表格那样把它连同评论一起引用到对话里。旧版 `.doc` 格式仍不在支持范围。
31
- - 视觉卡片不再使用超粗的展示字体。标题与数据默认改用系统字体,字重限制在常规与半粗之间,之前那种糊成一团的黑字不会再出现。
32
- - 视觉卡片可以按需选用系统宋体、楷体和等宽字体,macOS 与 Windows 都能直接显示,不必再为不同系统分别指定字体。
33
- - 视觉卡片的字体文件从 5 个减到 3 个,随包体积减少约 4.5 MB;移除的字体不再随安装包下载。
34
- - 在 macOS 上选择工作区目录时,可以在对话框的「前往文件夹」「搜索」「标签」输入框里粘贴、全选和使用撤销,之前这些框无法粘贴路径。
35
-
36
- ### 修复
37
-
38
- - 修复继续之前的对话后,本次会话按需加载的工具(例如脚本工具和工具搜索)会丢失、需要重新启用的问题。
39
- - 修复未安装 Python 时,检查后端代码的测试参数无法自动改对的问题。
40
- - 修复会话列表因历史遗留的已删除工作区而变慢的问题,打开和刷新列表更快。
41
- - 修复任务管理把已收起的子代理仍然画在图上,导致聚合卡片和成员卡片同时出现、连线交叉杂乱的问题。
42
- - 修复点击子代理详情后跳到仓库文件页而不是子代理内容的问题。
43
- - 修复自建网关在模型声明的上下文窗口之下就拒绝请求时,压缩始终不触发、长对话只能退回本地摘要的问题。设置里可调整「触发窗口比例」与「额外余量」,换用其他窗口大小的模型同样适用。
44
- - 修复压缩时网关连摘要请求一起拒绝后界面没有任何说明的问题;现在消息流会说明这次用的是本地摘要以及原因。
45
- - 无法请求模型摘要时的本地兜底摘要保留更多内容:范围更大的近期对话、更长的上一轮摘要,待办列表不再挤占目标与文件清单的空间;中文对话拿到的篇幅与英文一致。
46
- - 修复轨迹面板显示大量「模型步骤完成」这类空行的问题。
47
- - 修复会话列表在后台刷新时顺序跳动的问题;设置里可以把当前顺序固定下来。
48
- - 修复只有最新一轮对话可以分叉的问题;现在每个已结束的轮次都能分叉。
49
- - 修复终端输出窗口丢失命令首行的问题。
50
- - 修复扩展自带的界面主题不生效的问题。
51
- - 修复向上翻阅历史后发送消息,看不到自己刚发内容的问题;现在发送后自动回到底部。
52
- - 修复每轮用量里缓存命中率可能算错的问题;缓存写入部分现在计入分母,部分命中不会显示成 100%。
53
- - 修复 PDF、压缩包等非图片附件显示成「图片加载失败」的问题;现在按文件卡片显示名称与大小。
54
- - 修复思考过程中手动收起后又被自动展开的问题;收起状态不再被流式输出打断。
55
- - 修复模型返回无法识别的新内容块时聊天流里完全看不到的问题;现在会显示可展开的原始内容。
56
- - 系统级条目不再显示成模型的回答。
9
+ 本预发布快照记录构建时已整理的待发布变化,不表示相对上一构建全部新增。
57
10
 
58
- ## [0.53.0-next.1] - 2026-10-26
11
+ 未记录新增用户可见变化。
59
12
 
60
- 本预发布快照记录构建时已整理的待发布变化,不表示相对上一构建全部新增。
13
+ ## [0.52.0] - 2026-10-25
61
14
 
62
15
  ### 重点更新
63
16
 
@@ -87,15 +40,25 @@
87
40
  - 视觉卡片可以按需选用系统宋体、楷体和等宽字体,macOS 与 Windows 都能直接显示,不必再为不同系统分别指定字体。
88
41
  - 视觉卡片的字体文件从 5 个减到 3 个,随包体积减少约 4.5 MB;移除的字体不再随安装包下载。
89
42
  - 在 macOS 上选择工作区目录时,可以在对话框的「前往文件夹」「搜索」「标签」输入框里粘贴、全选和使用撤销,之前这些框无法粘贴路径。
43
+ - 接口调试台能直接调 Spring 项目:自动构建并启动项目、读出它自带的接口文档,请求参数、请求体字段和响应结构都按真实定义显示。以前的扫描方式遇到路径写成常量的接口会给出并不存在的地址。构建或启动失败时保留原来的代码扫描结果。
44
+ - 接口调试台的点选流程更顺手:选中接口后按接口文档预填请求体和路径参数,打开就是可以直接发送的内容;接口说明移到参数后面并默认收起,一屏内能完成选接口、填参数、发请求。
45
+ - 接口调试台里已经有接口文档时,不再把代码扫描出的同一批接口重复列一遍;扫描结果只补充文档里没有的接口,并标出哪些是扫描得到的。
46
+ - 接口调试台新增两项说明:每个请求标签页会说明用途,右侧栏底部原本含混的「高级功能」拆成「重放浏览器里的请求」和「批量执行一组请求」,各自写明什么时候用。
47
+ - 接口调试台会在代码变化后自动更新:从编辑器切回浏览器标签页时,如果项目里新增或改动了接口,列表会自动刷新并提示,不需要再手动点「重新扫描」。当前选中的接口和已填内容会保留。
48
+ - 对话里的代码块把「折行」「复制」收成一组放在右上角,长代码块的展开入口改为底部一行并说明还剩多少行,不再用一个独立按钮压住代码。
49
+ - 网络设置页改写为按用途说明,并新增「测试连接」按钮,保存后可以直接确认当前的代理配置能否连出去;以前保存完没有任何办法验证。
90
50
 
91
51
  ### 修复
92
52
 
53
+ - 查看预发布版本更新时,默认只展示相对已安装版本新增或调整的说明,避免重复列出已有内容;完整说明仍可展开查看。
54
+
93
55
  - 修复继续之前的对话后,本次会话按需加载的工具(例如脚本工具和工具搜索)会丢失、需要重新启用的问题。
94
56
  - 修复未安装 Python 时,检查后端代码的测试参数无法自动改对的问题。
95
57
  - 修复会话列表因历史遗留的已删除工作区而变慢的问题,打开和刷新列表更快。
96
58
  - 修复任务管理把已收起的子代理仍然画在图上,导致聚合卡片和成员卡片同时出现、连线交叉杂乱的问题。
97
59
  - 修复点击子代理详情后跳到仓库文件页而不是子代理内容的问题。
98
- - 修复自建网关在模型声明的上下文窗口之下就拒绝请求时,压缩始终不触发、长对话只能退回本地摘要的问题。设置里可调整「触发窗口比例」与「额外余量」,换用其他窗口大小的模型同样适用。
60
+ - 修复自建网关在模型声明的上下文窗口之下就拒绝请求时,压缩始终不触发、长对话只能退回本地摘要的问题。换用其他窗口大小的模型同样适用。
61
+ - 修复压缩设置里的「触发窗口比例」与实际触发点对不上的问题:以前还有一项「额外余量」会在比例之前先扣掉一大块窗口,128K 的模型即使把比例设成 100%,实际仍在 48K 左右就压缩。这项设置已移除,比例现在就是触发点,默认 85%;设置页会直接显示当前窗口下大约在多少 K 触发。
99
62
  - 修复压缩时网关连摘要请求一起拒绝后界面没有任何说明的问题;现在消息流会说明这次用的是本地摘要以及原因。
100
63
  - 无法请求模型摘要时的本地兜底摘要保留更多内容:范围更大的近期对话、更长的上一轮摘要,待办列表不再挤占目标与文件清单的空间;中文对话拿到的篇幅与英文一致。
101
64
  - 修复轨迹面板显示大量「模型步骤完成」这类空行的问题。
@@ -109,6 +72,9 @@
109
72
  - 修复思考过程中手动收起后又被自动展开的问题;收起状态不再被流式输出打断。
110
73
  - 修复模型返回无法识别的新内容块时聊天流里完全看不到的问题;现在会显示可展开的原始内容。
111
74
  - 系统级条目不再显示成模型的回答。
75
+ - 修复自动化任务在别的项目里建好之后,从这里点进去会提示任务不存在的问题;现在会到任务所属的项目里查找。
76
+ - 自动化任务详情能看出任务投递到哪个对话,直接显示对话名称;之前只在折叠区里放一串看不懂的编号。
77
+ - 修复自动化任务的运行时间卡片不显示时区的问题。
112
78
 
113
79
  ## [0.51.0] - 2026-10-17
114
80
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "0.53.0-next.1",
4
- "gitSha": "001e6fa8ebfc281270abc719563cd89a4906aa28",
5
- "builtAt": "2026-10-25T16:38:23.658Z"
3
+ "version": "0.53.0-next.3",
4
+ "gitSha": "307ec35405a952badd86dd3bdea0e5bb519d9faf",
5
+ "builtAt": "2026-10-26T03:51:26.239Z"
6
6
  }
@@ -15,22 +15,15 @@ export const PI_DEFAULT_RESERVE_TOKENS = 16_384;
15
15
  * far more often than intended. A fixed conservative reservation avoids that.
16
16
  */
17
17
  export const DEFAULT_RESERVED_COMPLETION_TOKENS = 8_192;
18
- /** DSH defaults, adopted verbatim. See `compaction-basic/src/config.ts`. */
19
- export const DEFAULT_THRESHOLD_RATIO = 0.8;
20
- /*
21
- * 20,000 instead of DSH's 65,536.
22
- *
23
- * DSH's value is an absolute distance from the top, chosen for its large
24
- * windows. On a 150k window it costs 43.7% of the budget, so the `min()` term
25
- * that actually decides the trigger is the headroom, not `thresholdRatio`:
26
- * the line landed on 50.8% and the configured 80% never applied. At 20,000 the
27
- * ratio term wins again (trigger = 120,000 = 80.0%), which is what the ratio
28
- * field promises.
18
+ /**
19
+ * Fraction of the window at which compaction triggers.
29
20
  *
30
- * Still an absolute value on purpose: a deployment whose gateway rejects below
31
- * the declared window raises this to pull the trigger under the real ceiling.
21
+ * 0.85 rather than DSH's 0.8: the ratio is now the ONLY thing that decides the
22
+ * trigger, so it has to express what an operator actually wants. At 0.85 a 128K
23
+ * window compacts at 109K and a 150K window at 128K, which is the reading
24
+ * operators give the number.
32
25
  */
33
- export const DEFAULT_HEADROOM_TOKENS = 20_000;
26
+ export const DEFAULT_THRESHOLD_RATIO = 0.85;
34
27
  export const DEFAULT_RETAIN_RATIO = 0.16;
35
28
  export function parseCompactionPolicy(env = process.env) {
36
29
  const diagnostics = [];
@@ -40,9 +33,6 @@ export function parseCompactionPolicy(env = process.env) {
40
33
  const ratio = parseBoundedNumber(env.HARNESS_COMPACTION_THRESHOLD_RATIO, DEFAULT_THRESHOLD_RATIO, 0.05, 1);
41
34
  if (ratio.diagnostic)
42
35
  diagnostics.push(ratio.diagnostic);
43
- const headroom = parseBoundedNumber(env.HARNESS_COMPACTION_HEADROOM_TOKENS, DEFAULT_HEADROOM_TOKENS, 0, 10_000_000);
44
- if (headroom.diagnostic)
45
- diagnostics.push(headroom.diagnostic);
46
36
  const retain = parseBoundedNumber(env.HARNESS_COMPACTION_RETAIN_RATIO, DEFAULT_RETAIN_RATIO, 0.01, 0.99);
47
37
  if (retain.diagnostic)
48
38
  diagnostics.push(retain.diagnostic);
@@ -52,7 +42,6 @@ export function parseCompactionPolicy(env = process.env) {
52
42
  return {
53
43
  mode: modeResult.mode,
54
44
  thresholdRatio: ratio.value,
55
- headroomTokens: headroom.value,
56
45
  retainRatio: retain.value,
57
46
  reservedCompletionTokens: reserved.value,
58
47
  diagnostics,
@@ -64,9 +53,7 @@ export function parseCompactionPolicy(env = process.env) {
64
53
  * Mirrors DSH's `resolveCompactSpec`:
65
54
  *
66
55
  * messageBudget = contextWindow - reservedCompletion
67
- * pressureBudget = messageBudget - headroomTokens
68
- * thresholdTokens = min(contextWindow × thresholdRatio, pressureBudget)
69
- * retainTokens = messageBudget × retainRatio
56
+ * thresholdTokens = min(contextWindow × thresholdRatio, messageBudget)
70
57
  *
71
58
  * DSH throws when the window cannot support the policy, because it is a
72
59
  * library and the host can fix its configuration. The Console must keep the
@@ -99,19 +86,20 @@ export function resolveCompactSpec(contextWindow, policy) {
99
86
  diagnostics: ["reserved-completion-exhausts-window"],
100
87
  };
101
88
  }
102
- const pressureBudget = messageBudget - policy.headroomTokens;
103
- if (pressureBudget <= 0) {
104
- const thresholdTokens = Math.max(0, declared - PI_DEFAULT_RESERVE_TOKENS);
105
- return {
106
- thresholdTokens,
107
- retainTokens: Math.max(0, Math.floor(thresholdTokens * policy.retainRatio)),
108
- contextWindow: declared,
109
- messageBudgetTokens: messageBudget,
110
- fallback: true,
111
- diagnostics: ["headroom-exhausts-message-budget"],
112
- };
113
- }
114
- const thresholdTokens = Math.floor(Math.min(declared * policy.thresholdRatio, pressureBudget));
89
+ /*
90
+ * The ratio decides, bounded only by what the window can physically hold.
91
+ *
92
+ * thresholdTokens = min(contextWindow × thresholdRatio, messageBudget)
93
+ *
94
+ * There used to be a second subtraction here: an absolute `headroomTokens` taken
95
+ * off the message budget before the ratio applied. It made the ratio unreachable —
96
+ * a 128K window configured at 100% triggered at 48K because the default headroom
97
+ * was 65,536 — and it was redundant besides: `reservedCompletionTokens` already
98
+ * covers the output a summarization needs. Two knobs that fight over the same line,
99
+ * where the one an operator can reason about always lost, is not a configuration
100
+ * worth keeping. Only the ratio remains.
101
+ */
102
+ const thresholdTokens = Math.floor(Math.min(declared * policy.thresholdRatio, messageBudget));
115
103
  if (thresholdTokens <= 0) {
116
104
  return {
117
105
  thresholdTokens: 0,
@@ -1,5 +1,5 @@
1
1
  export { isContextOverflow, CONTEXT_OVERFLOW_PHRASES, OVERFLOW_FIXTURES, NORMALIZED_OVERFLOW_PREFIX, shouldRewriteAssistantOverflow, normalizeOverflowErrorMessage, buildGeneratedOverflowClassifierSource, } from "./overflow.js";
2
- export { parseCompactionPolicy, resolveCompactSpec, piReserveTokensFor, conservativeTokenEstimate, projectPromptPressure, applyProcessCompactionOverride, inMemoryCompactionSettings, PI_DEFAULT_RESERVE_TOKENS, DEFAULT_THRESHOLD_RATIO, DEFAULT_HEADROOM_TOKENS, DEFAULT_RETAIN_RATIO, DEFAULT_RESERVED_COMPLETION_TOKENS, } from "./compaction-policy.js";
2
+ export { parseCompactionPolicy, resolveCompactSpec, piReserveTokensFor, conservativeTokenEstimate, projectPromptPressure, applyProcessCompactionOverride, inMemoryCompactionSettings, PI_DEFAULT_RESERVE_TOKENS, DEFAULT_THRESHOLD_RATIO, DEFAULT_RETAIN_RATIO, DEFAULT_RESERVED_COMPLETION_TOKENS, } from "./compaction-policy.js";
3
3
  export { buildOverflowCheckpoint, normalizeCompactionPreparation, } from "./checkpoint.js";
4
4
  export { deriveCompactionAccounting, readCompactionAccounting, } from "./compaction-accounting.js";
5
5
  export { PI_TOOL_RESULT_PRUNE_MARKER, DEFAULT_PI_TOOL_RESULT_PRUNE_CONFIG, resolvePiToolResultPruneConfig, parsePiToolResultPruneConfig, piCodePointLength, prunePiToolResultMessages, } from "./tool-result-pruner.js";
@@ -2,6 +2,23 @@ import { automationActionSchemas } from "../../shared/automation/actions.js";
2
2
  import { ScheduleError } from "../../shared/automation/time.js";
3
3
  import { scheduledGoalHash } from "../scheduler/scheduled-goal-store.js";
4
4
  import { getScheduledGoalBooking } from "./chat/scheduled-goal-booking.js";
5
+ /**
6
+ * The scope to use against a store that may belong to another workspace.
7
+ *
8
+ * `visible()` admits everything under the `workspace` scope and only the session's
9
+ * own tasks under `session`. When a task was located in a different repository,
10
+ * the caller's session does not live there, so a `session` scope would hide the
11
+ * very task we just found. Crossing repositories therefore reads under
12
+ * `workspace`; staying inside the caller's own store keeps whatever scope the
13
+ * caller chose.
14
+ *
15
+ * @param callerScope - the scope the caller asked with.
16
+ * @param owner - the resolved store, when a different workspace owns it.
17
+ * @returns the scope to read with.
18
+ */
19
+ function scopeFor(callerScope, owner) {
20
+ return owner === undefined ? callerScope : { kind: "workspace" };
21
+ }
5
22
  /** Typed service shared by root-model tools and the authenticated workspace UI.
6
23
  * No request parameter can select owner, workspace, repository or confirmation. */
7
24
  export async function executeAutomationAction(action, input, deps) {
@@ -20,12 +37,32 @@ export async function executeAutomationAction(action, input, deps) {
20
37
  if (action === "schedule_list") {
21
38
  const request = automationActionSchemas.schedule_list.parse(input);
22
39
  if (request.id) {
23
- const task = await store.getTask(scope, request.id);
24
- return { task, history: await store.history(scope, request.id, request.cursor, request.limit),
25
- ...(task.executionKind === "workflow-goal" ? { booking: await getScheduledGoalBooking(task.id, store) } : {}) };
40
+ /*
41
+ * The detail may belong to any workspace in the list, so the store is
42
+ * resolved from the id first. Falling back to the caller's store keeps the
43
+ * single-repository behaviour when nothing is registered for the lookup.
44
+ */
45
+ const owner = deps.storeForTask ? await deps.storeForTask(request.id) : undefined;
46
+ if (deps.storeForTask && !owner)
47
+ throw new ScheduleError("schedule_not_found");
48
+ const readStore = owner ?? store;
49
+ const task = await readStore.getTask(scopeFor(scope, owner), request.id);
50
+ return { task, history: await readStore.history(scopeFor(scope, owner), request.id, request.cursor, request.limit),
51
+ ...(task.executionKind === "workflow-goal" ? { booking: await getScheduledGoalBooking(task.id, readStore) } : {}) };
26
52
  }
27
53
  const query = request.search?.toLocaleLowerCase() ?? "";
28
- const all = await store.listTasks(scope);
54
+ /*
55
+ * The list spans every registered workspace.
56
+ *
57
+ * Each task is stored in its own repository's ledger, so a single-store read
58
+ * only answers for one workspace — which is why switching workspace used to
59
+ * hide the others' tasks entirely. The aggregation names the workspace on
60
+ * every row instead. A workspace whose ledger cannot be read is reported
61
+ * rather than dropped silently.
62
+ */
63
+ const across = deps.listAcrossWorkspaces ? await deps.listAcrossWorkspaces() : undefined;
64
+ const all = across ? across.tasks : await store.listTasks(scope);
65
+ const failedWorkspaceIds = across?.failedWorkspaceIds.length ? [...across.failedWorkspaceIds] : undefined;
29
66
  const reminderCounts = new Map();
30
67
  for (const task of all)
31
68
  if (task.executionKind === "pi-reminder" && task.view === "enabled")
@@ -34,18 +71,36 @@ export async function executeAutomationAction(action, input, deps) {
34
71
  const tasks = all.filter(task => (!request.view || request.view === "all" || task.view === request.view)
35
72
  && (!query || [task.title, task.prompt, task.id, task.owner.sessionId].some(value => value.toLocaleLowerCase().includes(query))));
36
73
  const start = request.cursor ?? 0, limit = request.limit ?? 30;
37
- return { tasks: tasks.slice(start, start + limit), total: tasks.length, counts, activeReminders: Object.fromEntries(reminderCounts), ...(start + limit < tasks.length ? { nextCursor: start + limit } : {}) };
74
+ return {
75
+ tasks: tasks.slice(start, start + limit), total: tasks.length, counts,
76
+ activeReminders: Object.fromEntries(reminderCounts),
77
+ ...(failedWorkspaceIds ? { failedWorkspaceIds } : {}),
78
+ ...(start + limit < tasks.length ? { nextCursor: start + limit } : {}),
79
+ };
38
80
  }
39
81
  if (action === "schedule_update") {
40
82
  const request = automationActionSchemas.schedule_update.parse(input);
41
- const result = await store.updateTask(scope, request.id, request.expectedRecord, request.changes);
83
+ /*
84
+ * Writes are resolved the same way reads are: the id decides the ledger. A
85
+ * task listed from another workspace has to be editable there, otherwise the
86
+ * row is clickable and then refuses.
87
+ */
88
+ const owner = deps.storeForTask ? await deps.storeForTask(request.id) : undefined;
89
+ if (deps.storeForTask && !owner)
90
+ throw new ScheduleError("schedule_not_found");
91
+ const writeStore = owner ?? store;
92
+ const result = await writeStore.updateTask(scopeFor(scope, owner), request.id, request.expectedRecord, request.changes);
42
93
  deps.onChanged?.();
43
94
  return result;
44
95
  }
45
96
  if (action === "schedule_delete") {
46
97
  const request = automationActionSchemas.schedule_delete.parse(input);
47
98
  const confirmed = deps.deleteConsent?.id === request.id && deps.deleteConsent.expectedHash === scheduledGoalHash(request.expectedRecord);
48
- const result = await store.deleteTask(scope, request.id, request.expectedRecord, confirmed);
99
+ const owner = deps.storeForTask ? await deps.storeForTask(request.id) : undefined;
100
+ if (deps.storeForTask && !owner)
101
+ throw new ScheduleError("schedule_not_found");
102
+ const writeStore = owner ?? store;
103
+ const result = await writeStore.deleteTask(scopeFor(scope, owner), request.id, request.expectedRecord, confirmed);
49
104
  deps.onChanged?.();
50
105
  return result;
51
106
  }
@@ -1,4 +1,6 @@
1
+ import { createHash } from "node:crypto";
1
2
  import { resolveRequestTemplate } from "./api-workbench-templates.js";
3
+ import { projectRequestBody, projectResponses } from "./api-workbench-schema.js";
2
4
  import { ApiWorkbenchCollections } from "./api-workbench-collections.js";
3
5
  import { parseAssertions, evaluateAssertions, parseExtractions, extractScalars } from "./api-workbench-assertions.js";
4
6
  import { STATUS_CODES } from "node:http";
@@ -14,7 +16,7 @@ export { ApiWorkbenchCoreError, parseEnvironmentsPayload } from "./api-workbench
14
16
  * workspace-owned history, durable environments and credential references.
15
17
  * HTTP and model tools share the same injected service.
16
18
  */
17
- import { open, readFile, stat } from "node:fs/promises";
19
+ import { open, readFile, readdir, stat } from "node:fs/promises";
18
20
  import path from "node:path";
19
21
  import { walkRepoFiles } from "./repo-walk.js";
20
22
  import { parse as parseYaml } from "yaml";
@@ -119,12 +121,24 @@ function collectParameters(operation) {
119
121
  if (location !== "path" && location !== "query" && location !== "header" && location !== "cookie")
120
122
  continue;
121
123
  const schema = record.schema && typeof record.schema === "object" ? record.schema : undefined;
124
+ /*
125
+ * The example travels with the parameter so the panel can prefill it.
126
+ *
127
+ * `@Parameter(example = "v1")` lands on the parameter object; a plain
128
+ * `@Schema(example = …)` on the parameter's schema. Both are checked, because
129
+ * springdoc emits whichever the author wrote.
130
+ */
131
+ const example = typeof record.example === "string" ? record.example
132
+ : schema !== undefined && typeof schema.example === "string" ? schema.example
133
+ : schema !== undefined && schema.example !== undefined ? JSON.stringify(schema.example)
134
+ : undefined;
122
135
  parameters.push({
123
136
  name,
124
137
  in: location,
125
138
  required: record.required === true,
126
139
  ...(schema && typeof schema.type === "string" ? { type: schema.type } : {}),
127
140
  ...(typeof record.description === "string" ? { description: record.description } : {}),
141
+ ...(example !== undefined && example !== "" ? { example } : {}),
128
142
  });
129
143
  }
130
144
  return parameters;
@@ -145,6 +159,17 @@ function endpointsFromSpec(spec, specId) {
145
159
  continue;
146
160
  const operation = rawOperation;
147
161
  const summary = typeof operation.summary === "string" ? operation.summary : typeof operation.description === "string" ? operation.description.split("\n")[0] : undefined;
162
+ /*
163
+ * The body half comes from the document's own components.
164
+ *
165
+ * springdoc reflects over the Java type system, so field types, required
166
+ * flags, descriptions, examples and ranges are already resolved here. A
167
+ * source-level scan cannot reconstruct them, which is why a Spring project
168
+ * is worth the cost of generating a document rather than parsing its code.
169
+ */
170
+ const components = specComponents(spec);
171
+ const requestBody = projectRequestBody(operation, components);
172
+ const responses = projectResponses(operation, components);
148
173
  endpoints.push({
149
174
  id: endpointId(specId, method, endpointPath),
150
175
  specId,
@@ -153,6 +178,8 @@ function endpointsFromSpec(spec, specId) {
153
178
  ...(summary ? { summary: summary.slice(0, 200) } : {}),
154
179
  ...(typeof operation.operationId === "string" ? { operationId: operation.operationId } : {}),
155
180
  parameters: collectParameters(operation),
181
+ ...(requestBody ? { requestBody } : {}),
182
+ ...(responses.length > 0 ? { responses } : {}),
156
183
  });
157
184
  if (endpoints.length >= MAX_ENDPOINTS_PER_SPEC)
158
185
  return endpoints;
@@ -160,6 +187,29 @@ function endpointsFromSpec(spec, specId) {
160
187
  }
161
188
  return endpoints;
162
189
  }
190
+ /**
191
+ * The document's reusable schemas.
192
+ *
193
+ * OpenAPI 3 keeps them under `components.schemas`; Swagger 2 called the same map
194
+ * `definitions`. Both shapes appear in the wild, so both are read.
195
+ *
196
+ * @param spec - the parsed document.
197
+ * @returns the schema map, or undefined when the document defines none.
198
+ */
199
+ function specComponents(spec) {
200
+ const components = spec.components;
201
+ if (components !== null && typeof components === "object" && !Array.isArray(components)) {
202
+ const schemas = components.schemas;
203
+ if (schemas !== null && typeof schemas === "object" && !Array.isArray(schemas)) {
204
+ return schemas;
205
+ }
206
+ }
207
+ const definitions = spec.definitions;
208
+ if (definitions !== null && typeof definitions === "object" && !Array.isArray(definitions)) {
209
+ return definitions;
210
+ }
211
+ return undefined;
212
+ }
163
213
  function specInfo(spec) {
164
214
  const info = spec.info;
165
215
  if (!info || typeof info !== "object" || Array.isArray(info))
@@ -369,6 +419,44 @@ function isCodeScanEligible(repoRelative) {
369
419
  return false;
370
420
  return true;
371
421
  }
422
+ /**
423
+ * A cheap digest of everything the scan would read.
424
+ *
425
+ * The panel scans once when it mounts, so an endpoint added in the editor stays
426
+ * invisible until someone presses 重新扫描 — while the model's tools, which rescan on
427
+ * every call, see it immediately. This is what lets the panel notice on its own.
428
+ *
429
+ * `path:size:mtime` only — no file contents are read. Sizes and mtimes change on every
430
+ * edit an editor makes, including ones that leave the length equal, and stat is orders
431
+ * of magnitude cheaper than the parse that follows.
432
+ *
433
+ * It covers exactly the files the scan consumes, so a change to an unrelated file (a
434
+ * README, a lock file, a test) does not trigger a rescan.
435
+ *
436
+ * @param repoRoot - workspace root.
437
+ * @returns a stable hex digest, or an empty string when the walk failed.
438
+ */
439
+ export async function computeScanFingerprint(repoRoot) {
440
+ const walked = await walkRepoFiles(repoRoot, { maxFiles: 20000 });
441
+ const parts = [];
442
+ for (const file of walked) {
443
+ const relative = file.repoRelative.replace(/\\/g, "/");
444
+ // Same eligibility the scan applies: spec files by name, code routes by rule.
445
+ if (!isSpecBasename(relative) && !isCodeScanEligible(relative))
446
+ continue;
447
+ try {
448
+ const info = await stat(file.abs);
449
+ parts.push(`${relative}:${info.size}:${Math.floor(info.mtimeMs)}`);
450
+ }
451
+ catch {
452
+ // A file that vanished mid-walk will show up as absent on the next check.
453
+ parts.push(`${relative}:missing`);
454
+ }
455
+ }
456
+ // Sorted so two walks over the same tree cannot disagree on order.
457
+ parts.sort();
458
+ return createHash("sha256").update(parts.join("\n")).digest("hex").slice(0, 32);
459
+ }
372
460
  function codeScanPriority(repoRelative) {
373
461
  const normalized = repoRelative.replace(/\\/g, "/").toLowerCase();
374
462
  const base = normalized.split("/").pop() ?? "";
@@ -418,8 +506,23 @@ async function scanCodeRoutes(walked) {
418
506
  }));
419
507
  return { endpoints, filesRead };
420
508
  }
421
- /** Shared scan entry: repo spec discovery + code-route scan. Read-only. */
422
- export async function scanSpecsSnapshot(repoRoot) {
509
+ /**
510
+ * Shared scan entry: repo spec discovery + code-route scan + generated documents.
511
+ *
512
+ * `generatedDir` holds OpenAPI documents produced by running a Spring project
513
+ * (`api-workbench-spring.ts`). They are read from the Console's own storage rather
514
+ * than the repository, because the file is derived and regenerable — writing into
515
+ * the user's source tree is not this feature's call to make.
516
+ *
517
+ * Generated documents sort first: when a Spring project supplies a document, its
518
+ * reflection-accurate paths should be what the panel shows, with the static scan
519
+ * remaining as the fallback it was meant to be.
520
+ *
521
+ * @param repoRoot - workspace root.
522
+ * @param options - optional generated-document directory.
523
+ * @returns specs, scan statistics, and the scan time.
524
+ */
525
+ export async function scanSpecsSnapshot(repoRoot, options = {}) {
423
526
  const stats = { ...EMPTY_SCAN_STATS };
424
527
  const walked = await walkRepoFiles(repoRoot, { maxFiles: 20000 });
425
528
  stats.walkTruncated = walked.length >= 20000;
@@ -441,6 +544,26 @@ export async function scanSpecsSnapshot(repoRoot) {
441
544
  stats.matchedByContent = probed.length;
442
545
  const specFiles = [...byName, ...probed].slice(0, MAX_SPEC_CANDIDATES_PER_SCAN);
443
546
  const specs = await Promise.all(specFiles.map((file) => parseSpecFile(file.abs, file.repoRelative, specFileFormat(file.repoRelative))));
547
+ /*
548
+ * Documents produced by running a Spring project come first.
549
+ *
550
+ * They carry the request and response schemas that springdoc resolved from the
551
+ * Java type system; the static scan below stays as the fallback for projects that
552
+ * cannot be built or run.
553
+ */
554
+ if (options.generatedDir !== undefined) {
555
+ try {
556
+ const names = (await readdir(options.generatedDir)).filter((name) => name.endsWith(".json")).sort();
557
+ const generated = await Promise.all(names.slice(0, 12).map(async (name) => {
558
+ const abs = path.join(options.generatedDir, name);
559
+ return parseSpecFile(abs, `generated/${name}`, "json");
560
+ }));
561
+ specs.unshift(...generated.filter((spec) => spec.endpoints.length > 0));
562
+ }
563
+ catch {
564
+ // No generated directory yet is the normal first-run case.
565
+ }
566
+ }
444
567
  const codeScan = await scanCodeRoutes(walked);
445
568
  stats.codeEndpoints = codeScan.endpoints.length;
446
569
  stats.codeFiles = codeScan.filesRead;
@@ -454,7 +577,11 @@ export async function scanSpecsSnapshot(repoRoot) {
454
577
  endpoints: codeScan.endpoints,
455
578
  });
456
579
  }
457
- return { specs, stats, scannedAt: new Date().toISOString() };
580
+ /*
581
+ * The fingerprint travels with the scan so a later cheap check can tell whether
582
+ * anything this read has changed.
583
+ */
584
+ return { specs, stats, scannedAt: new Date().toISOString(), fingerprint: await computeScanFingerprint(repoRoot) };
458
585
  }
459
586
  export function parseQueryParams(raw) {
460
587
  if (raw === undefined)