dsh-primer 0.4.4 → 0.4.5

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 (791) hide show
  1. package/README.en.md +493 -0
  2. package/README.es.md +493 -0
  3. package/README.hi.md +493 -0
  4. package/README.md +281 -262
  5. package/README.pt.md +493 -0
  6. package/SKILL.md +1 -1
  7. package/data/facts.json +8 -7
  8. package/guide/quick-reference.es.md +1 -1
  9. package/guide/quick-reference.hi.md +1 -1
  10. package/guide/quick-reference.md +1 -1
  11. package/guide/quick-reference.pt.md +1 -1
  12. package/guide/quick-reference.zh-CN.md +1 -1
  13. package/guide/unfixed-issues.md +3 -3
  14. package/package.json +1 -1
  15. package/references/official-docs/AGENTS.md +9 -5
  16. package/references/official-docs/CLAUDE.md +0 -0
  17. package/references/official-docs/README.md +1 -1
  18. package/references/official-docs/SNAPSHOT.md +9 -7
  19. package/references/official-docs/THIRD_PARTY_NOTICES.md +22 -3
  20. package/references/official-docs/docs/AGENTS.md +3 -3
  21. package/references/official-docs/docs/agent-lifecycle.md +3 -1
  22. package/references/official-docs/docs/agent-lifecycle.zh.md +3 -1
  23. package/references/official-docs/docs/api-gateway.i18n.yaml +6 -6
  24. package/references/official-docs/docs/api-gateway.md +4 -4
  25. package/references/official-docs/docs/api-gateway.zh.md +4 -4
  26. package/references/official-docs/docs/architecture.i18n.yaml +10 -10
  27. package/references/official-docs/docs/architecture.md +14 -8
  28. package/references/official-docs/docs/architecture.zh.md +14 -8
  29. package/references/official-docs/docs/assets/ui-design-review/inline-metrics-comparison.png +0 -0
  30. package/references/official-docs/docs/assets/ui-design-review/modal-grouping-comparison.png +0 -0
  31. package/references/official-docs/docs/assets/ui-design-review/peer-content-comparison.png +0 -0
  32. package/references/official-docs/docs/assets/ui-design-review/principles-alignment.svg +15 -0
  33. package/references/official-docs/docs/assets/ui-design-review/principles-grouping.svg +1 -0
  34. package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
  35. package/references/official-docs/docs/capability-seams.md +80 -30
  36. package/references/official-docs/docs/capability-seams.zh.md +80 -30
  37. package/references/official-docs/docs/cli-help.md +15 -7
  38. package/references/official-docs/docs/cli-help.zh.md +15 -7
  39. package/references/official-docs/docs/config-catalog.md +790 -283
  40. package/references/official-docs/docs/config-catalog.zh.md +790 -283
  41. package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +6 -6
  42. package/references/official-docs/docs/cookbook/adding-a-package.md +6 -4
  43. package/references/official-docs/docs/cookbook/adding-a-package.zh.md +6 -4
  44. package/references/official-docs/docs/cookbook/adding-a-plugin-preview.i18n.yaml +18 -18
  45. package/references/official-docs/docs/cookbook/adding-a-plugin-preview.md +18 -25
  46. package/references/official-docs/docs/cookbook/adding-a-plugin-preview.zh.md +18 -25
  47. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
  48. package/references/official-docs/docs/cookbook/adding-a-tool.md +4 -3
  49. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +4 -3
  50. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
  51. package/references/official-docs/docs/cookbook/extension-cookbook.md +1 -1
  52. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +1 -1
  53. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.i18n.yaml +2 -2
  54. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.md +1 -1
  55. package/references/official-docs/docs/cookbook/reviewing-persistence-type-changes.zh.md +1 -1
  56. package/references/official-docs/docs/cookbook/reviewing-ui-design.i18n.yaml +55 -0
  57. package/references/official-docs/docs/cookbook/reviewing-ui-design.md +166 -0
  58. package/references/official-docs/docs/cookbook/reviewing-ui-design.zh.md +166 -0
  59. package/references/official-docs/docs/cordis-api/context.md +1 -1
  60. package/references/official-docs/docs/cordis-api/context.zh.md +1 -1
  61. package/references/official-docs/docs/cordis-api/events.i18n.yaml +18 -18
  62. package/references/official-docs/docs/cordis-api/events.md +9 -9
  63. package/references/official-docs/docs/cordis-api/events.zh.md +9 -9
  64. package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +39 -27
  65. package/references/official-docs/docs/cordis-api/fiber.md +85 -32
  66. package/references/official-docs/docs/cordis-api/fiber.zh.md +87 -32
  67. package/references/official-docs/docs/cordis-api/inherited.md +10 -9
  68. package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +2 -2
  69. package/references/official-docs/docs/cordis-tutorial/04-events.md +1 -1
  70. package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +1 -1
  71. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +5 -4
  72. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +5 -4
  73. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +4 -4
  74. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +3 -3
  75. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +3 -3
  76. package/references/official-docs/docs/defensive-patterns/README.i18n.yaml +0 -0
  77. package/references/official-docs/docs/defensive-patterns/README.md +0 -0
  78. package/references/official-docs/docs/defensive-patterns/README.zh.md +0 -0
  79. package/references/official-docs/docs/defensive-patterns/client-components.i18n.yaml +0 -0
  80. package/references/official-docs/docs/defensive-patterns/client-components.md +0 -0
  81. package/references/official-docs/docs/defensive-patterns/client-components.zh.md +0 -0
  82. package/references/official-docs/docs/defensive-patterns/conversation-and-session.i18n.yaml +2 -2
  83. package/references/official-docs/docs/defensive-patterns/conversation-and-session.md +2 -2
  84. package/references/official-docs/docs/defensive-patterns/conversation-and-session.zh.md +2 -2
  85. package/references/official-docs/docs/defensive-patterns/general.i18n.yaml +2 -2
  86. package/references/official-docs/docs/defensive-patterns/general.md +2 -0
  87. package/references/official-docs/docs/defensive-patterns/general.zh.md +2 -0
  88. package/references/official-docs/docs/defensive-patterns/package-surface.i18n.yaml +4 -4
  89. package/references/official-docs/docs/defensive-patterns/package-surface.md +4 -2
  90. package/references/official-docs/docs/defensive-patterns/package-surface.zh.md +4 -2
  91. package/references/official-docs/docs/defensive-patterns/remote-and-api.i18n.yaml +2 -2
  92. package/references/official-docs/docs/defensive-patterns/remote-and-api.md +6 -4
  93. package/references/official-docs/docs/defensive-patterns/remote-and-api.zh.md +6 -4
  94. package/references/official-docs/docs/development.i18n.yaml +12 -12
  95. package/references/official-docs/docs/development.md +17 -10
  96. package/references/official-docs/docs/development.zh.md +17 -10
  97. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
  98. package/references/official-docs/docs/event-producer-consumer.md +73 -56
  99. package/references/official-docs/docs/event-producer-consumer.zh.md +73 -56
  100. package/references/official-docs/docs/experimental-persistence-catalog.i18n.yaml +2 -2
  101. package/references/official-docs/docs/experimental-persistence-catalog.md +4 -0
  102. package/references/official-docs/docs/experimental-persistence-catalog.zh.md +4 -0
  103. package/references/official-docs/docs/glossary.i18n.yaml +0 -0
  104. package/references/official-docs/docs/glossary.md +0 -0
  105. package/references/official-docs/docs/glossary.zh.md +0 -0
  106. package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
  107. package/references/official-docs/docs/i18n/README.md +2 -0
  108. package/references/official-docs/docs/i18n/README.zh.md +2 -0
  109. package/references/official-docs/docs/i18n/style-samples.md +0 -0
  110. package/references/official-docs/docs/i18n/terminology.md +0 -0
  111. package/references/official-docs/docs/module-graph.md +316 -157
  112. package/references/official-docs/docs/module-graph.zh.md +316 -157
  113. package/references/official-docs/docs/persistence-catalog.i18n.yaml +427 -358
  114. package/references/official-docs/docs/persistence-catalog.md +536 -250
  115. package/references/official-docs/docs/persistence-catalog.zh.md +536 -250
  116. package/references/official-docs/docs/persistence-changes/2026-09-11-initial.schema.json +524 -13552
  117. package/references/official-docs/docs/persistence-changes/2026-09-12-auto-review-error-metadata.schema.json +53 -905
  118. package/references/official-docs/docs/persistence-changes/2026-09-13-working-directory.schema.json +10 -71
  119. package/references/official-docs/docs/persistence-changes/2026-09-14-image-offload.schema.json +232 -8473
  120. package/references/official-docs/docs/persistence-changes/2026-09-14-workspace-changes-event.schema.json +9 -67
  121. package/references/official-docs/docs/persistence-changes/2026-09-16-session-format-v4.schema.json +351 -16207
  122. package/references/official-docs/docs/persistence-changes/2026-09-18-schedule-optional-title.schema.json +25 -297
  123. package/references/official-docs/docs/persistence-changes/2026-09-19-external-subagent-catalog.schema.json +23 -285
  124. package/references/official-docs/docs/persistence-changes/2026-09-20-unknown-child-catalog.schema.json +20 -245
  125. package/references/official-docs/docs/persistence-changes/2026-09-21-user-question-reply.schema.json +232 -11400
  126. package/references/official-docs/docs/persistence-changes/2026-09-30-job-session-lifecycle.i18n.yaml +0 -0
  127. package/references/official-docs/docs/persistence-changes/2026-09-30-job-session-lifecycle.md +0 -0
  128. package/references/official-docs/docs/persistence-changes/2026-09-30-job-session-lifecycle.schema.json +24 -292
  129. package/references/official-docs/docs/persistence-changes/2026-09-30-job-session-lifecycle.zh.md +0 -0
  130. package/references/official-docs/docs/persistence-changes/2026-10-05-ptc-operation-metadata.schema.json +42 -452
  131. package/references/official-docs/docs/persistence-changes/2026-10-05-working-directory-attribution.schema.json +234 -11469
  132. package/references/official-docs/docs/persistence-changes/2026-10-07-title-reasoning-effort.schema.json +215 -2985
  133. package/references/official-docs/docs/persistence-changes/2026-10-13-deepseek-search-thinking.i18n.yaml +0 -0
  134. package/references/official-docs/docs/persistence-changes/2026-10-13-deepseek-search-thinking.md +0 -0
  135. package/references/official-docs/docs/persistence-changes/2026-10-13-deepseek-search-thinking.schema.json +23 -226
  136. package/references/official-docs/docs/persistence-changes/2026-10-13-deepseek-search-thinking.zh.md +0 -0
  137. package/references/official-docs/docs/persistence-changes/2026-10-13-liveshare-share-viewer-principal.i18n.yaml +28 -0
  138. package/references/official-docs/docs/persistence-changes/2026-10-13-liveshare-share-viewer-principal.md +60 -0
  139. package/references/official-docs/docs/persistence-changes/2026-10-13-liveshare-share-viewer-principal.schema.json +253 -0
  140. package/references/official-docs/docs/persistence-changes/2026-10-13-liveshare-share-viewer-principal.zh.md +60 -0
  141. package/references/official-docs/docs/persistence-changes/2026-10-13-user-rpc-principal.i18n.yaml +0 -0
  142. package/references/official-docs/docs/persistence-changes/2026-10-13-user-rpc-principal.md +0 -0
  143. package/references/official-docs/docs/persistence-changes/2026-10-13-user-rpc-principal.schema.json +236 -11554
  144. package/references/official-docs/docs/persistence-changes/2026-10-13-user-rpc-principal.zh.md +0 -0
  145. package/references/official-docs/docs/persistence-changes/2026-10-19-session-team-mode.i18n.yaml +28 -0
  146. package/references/official-docs/docs/persistence-changes/2026-10-19-session-team-mode.md +48 -0
  147. package/references/official-docs/docs/persistence-changes/2026-10-19-session-team-mode.schema.json +15 -0
  148. package/references/official-docs/docs/persistence-changes/2026-10-19-session-team-mode.zh.md +48 -0
  149. package/references/official-docs/docs/persistence-changes/2026-10-22-action-card-status.i18n.yaml +28 -0
  150. package/references/official-docs/docs/persistence-changes/2026-10-22-action-card-status.md +60 -0
  151. package/references/official-docs/docs/persistence-changes/2026-10-22-action-card-status.schema.json +249 -0
  152. package/references/official-docs/docs/persistence-changes/2026-10-22-action-card-status.zh.md +60 -0
  153. package/references/official-docs/docs/persistence-changes/2026-10-25-skill-catalog-incomplete.i18n.yaml +28 -0
  154. package/references/official-docs/docs/persistence-changes/2026-10-25-skill-catalog-incomplete.md +60 -0
  155. package/references/official-docs/docs/persistence-changes/2026-10-25-skill-catalog-incomplete.schema.json +249 -0
  156. package/references/official-docs/docs/persistence-changes/2026-10-25-skill-catalog-incomplete.zh.md +60 -0
  157. package/references/official-docs/docs/persistence-changes/2026-10-27-retry-control-input.i18n.yaml +28 -0
  158. package/references/official-docs/docs/persistence-changes/2026-10-27-retry-control-input.md +60 -0
  159. package/references/official-docs/docs/persistence-changes/2026-10-27-retry-control-input.schema.json +261 -0
  160. package/references/official-docs/docs/persistence-changes/2026-10-27-retry-control-input.zh.md +60 -0
  161. package/references/official-docs/docs/persistence-changes/2026-10-27-subagent-settlement-attribution.i18n.yaml +28 -0
  162. package/references/official-docs/docs/persistence-changes/2026-10-27-subagent-settlement-attribution.md +60 -0
  163. package/references/official-docs/docs/persistence-changes/2026-10-27-subagent-settlement-attribution.schema.json +259 -0
  164. package/references/official-docs/docs/persistence-changes/2026-10-27-subagent-settlement-attribution.zh.md +60 -0
  165. package/references/official-docs/docs/persistence-changes/2026-11-02-subagent-catalog-names.i18n.yaml +28 -0
  166. package/references/official-docs/docs/persistence-changes/2026-11-02-subagent-catalog-names.md +48 -0
  167. package/references/official-docs/docs/persistence-changes/2026-11-02-subagent-catalog-names.schema.json +31 -0
  168. package/references/official-docs/docs/persistence-changes/2026-11-02-subagent-catalog-names.zh.md +48 -0
  169. package/references/official-docs/docs/persistence-changes/2026-11-02-team-task-owner-names.i18n.yaml +28 -0
  170. package/references/official-docs/docs/persistence-changes/2026-11-02-team-task-owner-names.md +48 -0
  171. package/references/official-docs/docs/persistence-changes/2026-11-02-team-task-owner-names.schema.json +23 -0
  172. package/references/official-docs/docs/persistence-changes/2026-11-02-team-task-owner-names.zh.md +48 -0
  173. package/references/official-docs/docs/persistence-changes/README.i18n.yaml +2 -2
  174. package/references/official-docs/docs/persistence-changes/README.md +3 -1
  175. package/references/official-docs/docs/persistence-changes/README.zh.md +3 -1
  176. package/references/official-docs/docs/persistence-changes/historical-formats/README.i18n.yaml +6 -6
  177. package/references/official-docs/docs/persistence-changes/historical-formats/README.md +3 -3
  178. package/references/official-docs/docs/persistence-changes/historical-formats/README.zh.md +3 -3
  179. package/references/official-docs/docs/persistence-changes/historical-formats/v0.schema.json +887 -49302
  180. package/references/official-docs/docs/persistence-changes/historical-formats/v1.schema.json +887 -49405
  181. package/references/official-docs/docs/persistence-changes/historical-formats/v2.schema.json +929 -56460
  182. package/references/official-docs/docs/persistence-changes/historical-formats/v3.schema.json +997 -61301
  183. package/references/official-docs/docs/persistence-changes/releases/README.i18n.yaml +2 -2
  184. package/references/official-docs/docs/persistence-changes/releases/README.md +1 -1
  185. package/references/official-docs/docs/persistence-changes/releases/README.zh.md +1 -1
  186. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.1.schema.json +727 -39862
  187. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.2.schema.json +788 -43336
  188. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.3.schema.json +255 -19446
  189. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.4.schema.json +2 -1
  190. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.0.1-rc.5.schema.json +2 -1
  191. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.1.schema.json +2 -1
  192. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.2.schema.json +2 -1
  193. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.3.schema.json +2 -1
  194. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.5.schema.json +2 -1
  195. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.6.schema.json +2 -1
  196. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.7.schema.json +118 -5314
  197. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.0-rc.8.schema.json +287 -21252
  198. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.1.schema.json +24 -411
  199. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.1-rc.2.schema.json +351 -29666
  200. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.1.schema.json +881 -48423
  201. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.2.schema.json +881 -49341
  202. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.3.schema.json +2 -1
  203. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.4.schema.json +217 -17636
  204. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-alpha.5.schema.json +2 -1
  205. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.2-rc.1.schema.json +2 -1
  206. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.1.schema.json +441 -38672
  207. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.3-alpha.2.schema.json +31 -777
  208. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.1.schema.json +377 -24591
  209. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-alpha.2.schema.json +75 -2126
  210. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.1.schema.json +2 -1
  211. package/references/official-docs/docs/persistence-changes/releases/dsh-v0.1.5-rc.2.schema.json +2 -1
  212. package/references/official-docs/docs/persistence-schema.json +1341 -26171
  213. package/references/official-docs/docs/rescope.i18n.yaml +4 -4
  214. package/references/official-docs/docs/rescope.md +7 -5
  215. package/references/official-docs/docs/rescope.zh.md +7 -5
  216. package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
  217. package/references/official-docs/docs/subsystems/README.md +4 -2
  218. package/references/official-docs/docs/subsystems/README.zh.md +4 -2
  219. package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +13 -13
  220. package/references/official-docs/docs/subsystems/agent-team.md +38 -75
  221. package/references/official-docs/docs/subsystems/agent-team.zh.md +38 -75
  222. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +4 -4
  223. package/references/official-docs/docs/subsystems/attachment.md +36 -13
  224. package/references/official-docs/docs/subsystems/attachment.zh.md +36 -13
  225. package/references/official-docs/docs/subsystems/boot.i18n.yaml +4 -4
  226. package/references/official-docs/docs/subsystems/boot.md +187 -7
  227. package/references/official-docs/docs/subsystems/boot.zh.md +187 -7
  228. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +6 -6
  229. package/references/official-docs/docs/subsystems/client-modules.md +19 -11
  230. package/references/official-docs/docs/subsystems/client-modules.zh.md +19 -11
  231. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
  232. package/references/official-docs/docs/subsystems/compaction.md +1 -1
  233. package/references/official-docs/docs/subsystems/compaction.zh.md +1 -1
  234. package/references/official-docs/docs/subsystems/computer-use.i18n.yaml +2 -2
  235. package/references/official-docs/docs/subsystems/computer-use.md +80 -0
  236. package/references/official-docs/docs/subsystems/computer-use.zh.md +80 -0
  237. package/references/official-docs/docs/subsystems/conversation.i18n.yaml +5 -5
  238. package/references/official-docs/docs/subsystems/conversation.md +2 -0
  239. package/references/official-docs/docs/subsystems/conversation.zh.md +4 -0
  240. package/references/official-docs/docs/subsystems/core.i18n.yaml +9 -6
  241. package/references/official-docs/docs/subsystems/core.md +120 -65
  242. package/references/official-docs/docs/subsystems/core.zh.md +120 -65
  243. package/references/official-docs/docs/subsystems/credentials.i18n.yaml +6 -6
  244. package/references/official-docs/docs/subsystems/credentials.md +79 -50
  245. package/references/official-docs/docs/subsystems/credentials.zh.md +79 -50
  246. package/references/official-docs/docs/subsystems/deliverables.i18n.yaml +2 -2
  247. package/references/official-docs/docs/subsystems/deliverables.md +2 -0
  248. package/references/official-docs/docs/subsystems/deliverables.zh.md +2 -0
  249. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +20 -14
  250. package/references/official-docs/docs/subsystems/filesystem.md +202 -28
  251. package/references/official-docs/docs/subsystems/filesystem.zh.md +202 -28
  252. package/references/official-docs/docs/subsystems/forge.i18n.yaml +28 -0
  253. package/references/official-docs/docs/subsystems/forge.md +1975 -0
  254. package/references/official-docs/docs/subsystems/forge.zh.md +1977 -0
  255. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +0 -0
  256. package/references/official-docs/docs/subsystems/jobs.md +0 -0
  257. package/references/official-docs/docs/subsystems/jobs.zh.md +0 -0
  258. package/references/official-docs/docs/subsystems/liveshare.i18n.yaml +25 -0
  259. package/references/official-docs/docs/subsystems/liveshare.md +167 -0
  260. package/references/official-docs/docs/subsystems/liveshare.zh.md +167 -0
  261. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +9 -6
  262. package/references/official-docs/docs/subsystems/llm-streaming.md +95 -5
  263. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +95 -5
  264. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +5 -2
  265. package/references/official-docs/docs/subsystems/lsp.md +25 -1
  266. package/references/official-docs/docs/subsystems/lsp.zh.md +25 -1
  267. package/references/official-docs/docs/subsystems/mcp.i18n.yaml +6 -6
  268. package/references/official-docs/docs/subsystems/mcp.md +99 -2
  269. package/references/official-docs/docs/subsystems/mcp.zh.md +99 -2
  270. package/references/official-docs/docs/subsystems/office-kit.i18n.yaml +19 -0
  271. package/references/official-docs/docs/subsystems/office-kit.md +122 -0
  272. package/references/official-docs/docs/subsystems/office-kit.zh.md +122 -0
  273. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +3 -3
  274. package/references/official-docs/docs/subsystems/persistence.md +17 -7
  275. package/references/official-docs/docs/subsystems/persistence.zh.md +17 -7
  276. package/references/official-docs/docs/subsystems/plan.i18n.yaml +6 -6
  277. package/references/official-docs/docs/subsystems/plan.md +4 -4
  278. package/references/official-docs/docs/subsystems/plan.zh.md +4 -4
  279. package/references/official-docs/docs/subsystems/product-telemetry.i18n.yaml +0 -0
  280. package/references/official-docs/docs/subsystems/product-telemetry.md +0 -0
  281. package/references/official-docs/docs/subsystems/product-telemetry.zh.md +0 -0
  282. package/references/official-docs/docs/subsystems/ptc-runtime.i18n.yaml +4 -4
  283. package/references/official-docs/docs/subsystems/ptc-runtime.md +57 -10
  284. package/references/official-docs/docs/subsystems/ptc-runtime.zh.md +57 -10
  285. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +6 -6
  286. package/references/official-docs/docs/subsystems/sandbox.md +32 -7
  287. package/references/official-docs/docs/subsystems/sandbox.zh.md +32 -7
  288. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +39 -30
  289. package/references/official-docs/docs/subsystems/schedule.md +194 -430
  290. package/references/official-docs/docs/subsystems/schedule.zh.md +197 -433
  291. package/references/official-docs/docs/subsystems/scope.i18n.yaml +0 -0
  292. package/references/official-docs/docs/subsystems/scope.zh.md +0 -0
  293. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +14 -8
  294. package/references/official-docs/docs/subsystems/session-projection.md +186 -44
  295. package/references/official-docs/docs/subsystems/session-projection.zh.md +186 -44
  296. package/references/official-docs/docs/subsystems/session-query.md +11 -1
  297. package/references/official-docs/docs/subsystems/session-query.zh.md +11 -1
  298. package/references/official-docs/docs/subsystems/session-reference.md +4 -3
  299. package/references/official-docs/docs/subsystems/session-reference.zh.md +4 -3
  300. package/references/official-docs/docs/subsystems/session.i18n.yaml +10 -4
  301. package/references/official-docs/docs/subsystems/session.md +146 -32
  302. package/references/official-docs/docs/subsystems/session.zh.md +146 -32
  303. package/references/official-docs/docs/subsystems/sidebar-right.i18n.yaml +12 -12
  304. package/references/official-docs/docs/subsystems/sidebar-right.md +13 -12
  305. package/references/official-docs/docs/subsystems/sidebar-right.zh.md +13 -12
  306. package/references/official-docs/docs/subsystems/skills.i18n.yaml +6 -6
  307. package/references/official-docs/docs/subsystems/skills.md +4 -4
  308. package/references/official-docs/docs/subsystems/skills.zh.md +4 -4
  309. package/references/official-docs/docs/subsystems/slots.i18n.yaml +11 -8
  310. package/references/official-docs/docs/subsystems/slots.md +33 -3
  311. package/references/official-docs/docs/subsystems/slots.zh.md +33 -3
  312. package/references/official-docs/docs/subsystems/storage.i18n.yaml +9 -6
  313. package/references/official-docs/docs/subsystems/storage.md +26 -9
  314. package/references/official-docs/docs/subsystems/storage.zh.md +26 -9
  315. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +14 -11
  316. package/references/official-docs/docs/subsystems/subagent.md +119 -102
  317. package/references/official-docs/docs/subsystems/subagent.zh.md +119 -102
  318. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
  319. package/references/official-docs/docs/subsystems/system-prompt.md +13 -11
  320. package/references/official-docs/docs/subsystems/system-prompt.zh.md +13 -11
  321. package/references/official-docs/docs/subsystems/terminal.md +1 -1
  322. package/references/official-docs/docs/subsystems/terminal.zh.md +1 -1
  323. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +3 -0
  324. package/references/official-docs/docs/subsystems/token-meter.md +45 -0
  325. package/references/official-docs/docs/subsystems/token-meter.zh.md +45 -0
  326. package/references/official-docs/docs/subsystems/tools.i18n.yaml +8 -2
  327. package/references/official-docs/docs/subsystems/tools.md +240 -89
  328. package/references/official-docs/docs/subsystems/tools.zh.md +240 -89
  329. package/references/official-docs/docs/subsystems/translation.i18n.yaml +0 -0
  330. package/references/official-docs/docs/subsystems/translation.md +0 -0
  331. package/references/official-docs/docs/subsystems/translation.zh.md +0 -0
  332. package/references/official-docs/docs/subsystems/typert.i18n.yaml +4 -4
  333. package/references/official-docs/docs/subsystems/typert.md +21 -11
  334. package/references/official-docs/docs/subsystems/typert.zh.md +21 -11
  335. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
  336. package/references/official-docs/docs/subsystems/user-questions.md +22 -6
  337. package/references/official-docs/docs/subsystems/user-questions.zh.md +22 -6
  338. package/references/official-docs/docs/subsystems/web-client.i18n.yaml +2 -2
  339. package/references/official-docs/docs/subsystems/web-client.md +1 -1
  340. package/references/official-docs/docs/subsystems/web-client.zh.md +1 -1
  341. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +6 -6
  342. package/references/official-docs/docs/subsystems/web-server.md +68 -23
  343. package/references/official-docs/docs/subsystems/web-server.zh.md +68 -23
  344. package/references/official-docs/docs/subsystems/web.i18n.yaml +10 -10
  345. package/references/official-docs/docs/subsystems/web.md +79 -21
  346. package/references/official-docs/docs/subsystems/web.zh.md +79 -21
  347. package/references/official-docs/docs/subsystems/working-directory.md +33 -2
  348. package/references/official-docs/docs/subsystems/working-directory.zh.md +33 -2
  349. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +0 -0
  350. package/references/official-docs/docs/subsystems/workspace.md +93 -1
  351. package/references/official-docs/docs/subsystems/workspace.zh.md +93 -1
  352. package/references/official-docs/docs/subsystems/worktrees.i18n.yaml +4 -4
  353. package/references/official-docs/docs/subsystems/worktrees.md +112 -5
  354. package/references/official-docs/docs/subsystems/worktrees.zh.md +112 -5
  355. package/references/official-docs/docs/testing.i18n.yaml +2 -2
  356. package/references/official-docs/docs/testing.md +1 -1
  357. package/references/official-docs/docs/testing.zh.md +1 -1
  358. package/references/official-docs/docs/tool-catalog.i18n.yaml +100 -76
  359. package/references/official-docs/docs/tool-catalog.md +433 -395
  360. package/references/official-docs/docs/tool-catalog.zh.md +436 -399
  361. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
  362. package/references/official-docs/docs/tool-execution-pipeline.md +5 -4
  363. package/references/official-docs/docs/tool-execution-pipeline.zh.md +4 -3
  364. package/references/official-docs/docs/ui-design-review-cases.i18n.yaml +148 -0
  365. package/references/official-docs/docs/ui-design-review-cases.md +445 -0
  366. package/references/official-docs/docs/ui-design-review-cases.zh.md +445 -0
  367. package/references/official-docs/docs/ui-radius.i18n.yaml +4 -4
  368. package/references/official-docs/docs/ui-radius.md +3 -1
  369. package/references/official-docs/docs/ui-radius.zh.md +3 -1
  370. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.i18n.yaml +0 -0
  371. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.md +0 -0
  372. package/references/official-docs/docs/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.zh.md +0 -0
  373. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.i18n.yaml +0 -0
  374. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.md +0 -0
  375. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.zh.md +0 -0
  376. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.i18n.yaml +0 -0
  377. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.md +0 -0
  378. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.zh.md +0 -0
  379. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.i18n.yaml +0 -0
  380. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.md +0 -0
  381. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.zh.md +0 -0
  382. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.i18n.yaml +2 -2
  383. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +1 -1
  384. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +1 -1
  385. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.i18n.yaml +16 -0
  386. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.md +24 -0
  387. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/cordis-timer-wrappers/guide.zh.md +24 -0
  388. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.i18n.yaml +0 -0
  389. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.md +0 -0
  390. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.zh.md +0 -0
  391. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.i18n.yaml +0 -0
  392. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.md +0 -0
  393. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.zh.md +0 -0
  394. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.i18n.yaml +0 -0
  395. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.md +0 -0
  396. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.zh.md +0 -0
  397. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.i18n.yaml +0 -0
  398. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.md +0 -0
  399. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.zh.md +0 -0
  400. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.i18n.yaml +0 -0
  401. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.md +0 -0
  402. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.zh.md +0 -0
  403. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.i18n.yaml +0 -0
  404. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.md +0 -0
  405. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.zh.md +0 -0
  406. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.i18n.yaml +0 -0
  407. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.md +0 -0
  408. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.zh.md +0 -0
  409. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.i18n.yaml +0 -0
  410. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.md +0 -0
  411. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.zh.md +0 -0
  412. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.i18n.yaml +16 -0
  413. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.md +25 -0
  414. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/plugin-manager-view-fields/guide.zh.md +25 -0
  415. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.i18n.yaml +0 -0
  416. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.md +0 -0
  417. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.zh.md +0 -0
  418. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.i18n.yaml +0 -0
  419. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.md +0 -0
  420. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.zh.md +0 -0
  421. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.i18n.yaml +0 -0
  422. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md +0 -0
  423. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.zh.md +0 -0
  424. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.i18n.yaml +0 -0
  425. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.md +0 -0
  426. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.zh.md +0 -0
  427. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.i18n.yaml +16 -0
  428. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.md +30 -0
  429. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/model-switch-compaction/guide.zh.md +30 -0
  430. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.i18n.yaml +16 -0
  431. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.md +28 -0
  432. package/references/official-docs/docs/upgrade-guide/v0.2.1-alpha.4/session-model-selection/guide.zh.md +28 -0
  433. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.i18n.yaml +16 -0
  434. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.md +24 -0
  435. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.1/agent-instructions-chain-budgets/guide.zh.md +24 -0
  436. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.i18n.yaml +16 -0
  437. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.md +23 -0
  438. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.zh.md +23 -0
  439. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.i18n.yaml +16 -0
  440. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.md +20 -0
  441. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/agent-runtime-owner/guide.zh.md +20 -0
  442. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.i18n.yaml +16 -0
  443. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.md +31 -0
  444. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/agent-team-subagents/guide.zh.md +31 -0
  445. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.i18n.yaml +16 -0
  446. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.md +34 -0
  447. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/approval-projection-dependency/guide.zh.md +34 -0
  448. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.i18n.yaml +16 -0
  449. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.md +20 -0
  450. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/auto-review-shutdown/guide.zh.md +20 -0
  451. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.i18n.yaml +16 -0
  452. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.md +18 -0
  453. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/auto-review-user-sources/guide.zh.md +18 -0
  454. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.i18n.yaml +16 -0
  455. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.md +18 -0
  456. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/built-in-japanese/guide.zh.md +18 -0
  457. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.i18n.yaml +16 -0
  458. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.md +25 -0
  459. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/conditional-tools/guide.zh.md +25 -0
  460. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.i18n.yaml +16 -0
  461. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.md +23 -0
  462. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/context-menu-services/guide.zh.md +23 -0
  463. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.i18n.yaml +16 -0
  464. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.md +22 -0
  465. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-consent-storage/guide.zh.md +22 -0
  466. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.i18n.yaml +16 -0
  467. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.md +18 -0
  468. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-preset-scope/guide.zh.md +18 -0
  469. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.i18n.yaml +16 -0
  470. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.md +17 -0
  471. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/cua-relative-coordinates/guide.zh.md +17 -0
  472. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.i18n.yaml +16 -0
  473. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.md +19 -0
  474. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/file-drag-callbacks/guide.zh.md +19 -0
  475. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.i18n.yaml +16 -0
  476. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.md +27 -0
  477. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/headless-policy-composition/guide.zh.md +27 -0
  478. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.i18n.yaml +16 -0
  479. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.md +18 -0
  480. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/model-badge-package-removal/guide.zh.md +18 -0
  481. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.i18n.yaml +16 -0
  482. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.md +22 -0
  483. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/new-session-blank-reuse/guide.zh.md +22 -0
  484. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/node-24/guide.i18n.yaml +16 -0
  485. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/node-24/guide.md +17 -0
  486. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/node-24/guide.zh.md +17 -0
  487. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.i18n.yaml +16 -0
  488. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.md +18 -0
  489. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/official-bundle-lists/guide.zh.md +18 -0
  490. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.i18n.yaml +16 -0
  491. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.md +18 -0
  492. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/persistent-terminal-controls/guide.zh.md +18 -0
  493. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.i18n.yaml +16 -0
  494. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.md +18 -0
  495. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-default-capacities/guide.zh.md +18 -0
  496. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.i18n.yaml +16 -0
  497. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.md +53 -0
  498. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-model-catalog/guide.zh.md +53 -0
  499. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.i18n.yaml +16 -0
  500. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.md +30 -0
  501. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/pi-ai-protocol-replay/guide.zh.md +30 -0
  502. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.i18n.yaml +16 -0
  503. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.md +20 -0
  504. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/ptc-script-format/guide.zh.md +20 -0
  505. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.i18n.yaml +16 -0
  506. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.md +18 -0
  507. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/sdk-desktop-context/guide.zh.md +18 -0
  508. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.i18n.yaml +16 -0
  509. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.md +18 -0
  510. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/sdk-minimal-checkpoints/guide.zh.md +18 -0
  511. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.i18n.yaml +16 -0
  512. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.md +24 -0
  513. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-projection-handles/guide.zh.md +24 -0
  514. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.i18n.yaml +16 -0
  515. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.md +25 -0
  516. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-store-writes/guide.zh.md +25 -0
  517. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.i18n.yaml +16 -0
  518. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.md +22 -0
  519. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/session-team-mode/guide.zh.md +22 -0
  520. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.i18n.yaml +16 -0
  521. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.md +18 -0
  522. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-activation-options/guide.zh.md +18 -0
  523. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.i18n.yaml +16 -0
  524. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.md +19 -0
  525. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-service-methods/guide.zh.md +19 -0
  526. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.i18n.yaml +16 -0
  527. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.md +26 -0
  528. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/subagent-user-controls/guide.zh.md +26 -0
  529. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.i18n.yaml +16 -0
  530. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.md +35 -0
  531. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/tool-executor-plugins/guide.zh.md +35 -0
  532. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.i18n.yaml +16 -0
  533. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.md +21 -0
  534. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/web-fetch-private-destinations/guide.zh.md +21 -0
  535. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.i18n.yaml +16 -0
  536. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.md +17 -0
  537. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.2/webserver-index-peer/guide.zh.md +17 -0
  538. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.i18n.yaml +16 -0
  539. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.md +23 -0
  540. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/attachment-read-access/guide.zh.md +23 -0
  541. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.i18n.yaml +16 -0
  542. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.md +21 -0
  543. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/computer-use-helper-permissions/guide.zh.md +21 -0
  544. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.i18n.yaml +16 -0
  545. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.md +20 -0
  546. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/cua-bundle-id-consent/guide.zh.md +20 -0
  547. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.i18n.yaml +16 -0
  548. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.md +20 -0
  549. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/generated-worktree-names/guide.zh.md +20 -0
  550. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.i18n.yaml +16 -0
  551. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.md +19 -0
  552. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/inbox-only-agent-wait/guide.zh.md +19 -0
  553. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.i18n.yaml +16 -0
  554. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.md +23 -0
  555. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/independent-session-forks/guide.zh.md +23 -0
  556. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.i18n.yaml +16 -0
  557. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.md +20 -0
  558. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/ptc-caller-cancellation/guide.zh.md +20 -0
  559. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.i18n.yaml +16 -0
  560. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.md +21 -0
  561. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/session-follow-activation/guide.zh.md +21 -0
  562. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.i18n.yaml +16 -0
  563. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.md +21 -0
  564. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/subagent-runtime-ownership/guide.zh.md +21 -0
  565. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.i18n.yaml +16 -0
  566. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.md +18 -0
  567. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/team-mode-menu/guide.zh.md +18 -0
  568. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/team-projection/guide.i18n.yaml +16 -0
  569. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/team-projection/guide.md +20 -0
  570. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/team-projection/guide.zh.md +20 -0
  571. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.i18n.yaml +16 -0
  572. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.md +19 -0
  573. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/web-file-downloads/guide.zh.md +19 -0
  574. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.i18n.yaml +16 -0
  575. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.md +18 -0
  576. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.3/web-search-defaults/guide.zh.md +18 -0
  577. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.i18n.yaml +16 -0
  578. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.md +22 -0
  579. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/model-listing-refresh/guide.zh.md +22 -0
  580. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.i18n.yaml +16 -0
  581. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.md +20 -0
  582. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/reasoning-body-props/guide.zh.md +20 -0
  583. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.i18n.yaml +16 -0
  584. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.md +18 -0
  585. package/references/official-docs/docs/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.zh.md +18 -0
  586. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.i18n.yaml +16 -0
  587. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.md +19 -0
  588. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/context-menu-target/guide.zh.md +19 -0
  589. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.i18n.yaml +16 -0
  590. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.md +24 -0
  591. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/cordis-loader-entry-trees/guide.zh.md +24 -0
  592. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.i18n.yaml +16 -0
  593. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.md +21 -0
  594. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/css-anchored-menus/guide.zh.md +21 -0
  595. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.i18n.yaml +16 -0
  596. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.md +19 -0
  597. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/cua-source-dev-helper/guide.zh.md +19 -0
  598. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.i18n.yaml +16 -0
  599. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.md +18 -0
  600. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/desktop-stable-channel/guide.zh.md +18 -0
  601. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.i18n.yaml +16 -0
  602. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.md +21 -0
  603. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/forge-git-permissions/guide.zh.md +21 -0
  604. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.i18n.yaml +16 -0
  605. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.md +29 -0
  606. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/forge-worktree-entry/guide.zh.md +29 -0
  607. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.i18n.yaml +16 -0
  608. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.md +29 -0
  609. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/fs-observation-policy-default-off/guide.zh.md +29 -0
  610. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.i18n.yaml +16 -0
  611. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.md +18 -0
  612. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.zh.md +18 -0
  613. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.i18n.yaml +16 -0
  614. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.md +29 -0
  615. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/llm-request-purpose-declarations/guide.zh.md +29 -0
  616. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.i18n.yaml +16 -0
  617. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.md +18 -0
  618. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/pi-ai-request-image-count/guide.zh.md +18 -0
  619. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.i18n.yaml +16 -0
  620. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.md +32 -0
  621. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-event-frames/guide.zh.md +32 -0
  622. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.i18n.yaml +16 -0
  623. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.md +30 -0
  624. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-released-checkpoint/guide.zh.md +30 -0
  625. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.i18n.yaml +16 -0
  626. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.md +19 -0
  627. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/projection-snapshot-scope/guide.zh.md +19 -0
  628. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.i18n.yaml +16 -0
  629. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.md +21 -0
  630. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/retained-ptc-timeout/guide.zh.md +21 -0
  631. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.i18n.yaml +16 -0
  632. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.md +37 -0
  633. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/schedule-agent-tools/guide.zh.md +37 -0
  634. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.i18n.yaml +16 -0
  635. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.md +22 -0
  636. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/schedule-remote-host-tasks/guide.zh.md +22 -0
  637. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.i18n.yaml +16 -0
  638. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.md +24 -0
  639. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/sdk-run-commands/guide.zh.md +24 -0
  640. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.i18n.yaml +16 -0
  641. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.md +20 -0
  642. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/session-header-menu/guide.zh.md +20 -0
  643. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.i18n.yaml +16 -0
  644. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.md +20 -0
  645. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/subagent-explicit-reasoning/guide.zh.md +20 -0
  646. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.i18n.yaml +16 -0
  647. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.md +17 -0
  648. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/web-search-credential-modes/guide.zh.md +17 -0
  649. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.i18n.yaml +16 -0
  650. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.md +19 -0
  651. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.2/web-search-default-provider/guide.zh.md +19 -0
  652. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.i18n.yaml +16 -0
  653. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.md +18 -0
  654. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/chat-process-activity-context/guide.zh.md +18 -0
  655. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.i18n.yaml +16 -0
  656. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.md +34 -0
  657. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.zh.md +34 -0
  658. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.i18n.yaml +16 -0
  659. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.md +49 -0
  660. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.zh.md +49 -0
  661. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.i18n.yaml +16 -0
  662. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.md +36 -0
  663. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.zh.md +36 -0
  664. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.i18n.yaml +16 -0
  665. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.md +29 -0
  666. package/references/official-docs/docs/upgrade-guide/v0.2.2-alpha.3/subagent-names/guide.zh.md +29 -0
  667. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.i18n.yaml +16 -0
  668. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.md +26 -0
  669. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.zh.md +26 -0
  670. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.i18n.yaml +16 -0
  671. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.md +22 -0
  672. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.zh.md +22 -0
  673. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.i18n.yaml +16 -0
  674. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md +21 -0
  675. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md +21 -0
  676. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.i18n.yaml +16 -0
  677. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.md +23 -0
  678. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.zh.md +23 -0
  679. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.i18n.yaml +16 -0
  680. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.md +20 -0
  681. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.zh.md +20 -0
  682. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.i18n.yaml +16 -0
  683. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.md +18 -0
  684. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.zh.md +18 -0
  685. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.i18n.yaml +16 -0
  686. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.md +23 -0
  687. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.zh.md +23 -0
  688. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.i18n.yaml +16 -0
  689. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.md +35 -0
  690. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.zh.md +35 -0
  691. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.i18n.yaml +16 -0
  692. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.md +26 -0
  693. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.zh.md +26 -0
  694. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.i18n.yaml +16 -0
  695. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.md +26 -0
  696. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.zh.md +26 -0
  697. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.i18n.yaml +16 -0
  698. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.md +19 -0
  699. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.zh.md +19 -0
  700. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.i18n.yaml +16 -0
  701. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.md +26 -0
  702. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.zh.md +26 -0
  703. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.i18n.yaml +16 -0
  704. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.md +22 -0
  705. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.zh.md +22 -0
  706. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.i18n.yaml +16 -0
  707. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.md +25 -0
  708. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.zh.md +25 -0
  709. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.i18n.yaml +16 -0
  710. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.md +48 -0
  711. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.zh.md +48 -0
  712. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.i18n.yaml +16 -0
  713. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.md +45 -0
  714. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.zh.md +45 -0
  715. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.i18n.yaml +16 -0
  716. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.md +19 -0
  717. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.zh.md +19 -0
  718. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.i18n.yaml +16 -0
  719. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.md +17 -0
  720. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.zh.md +17 -0
  721. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.i18n.yaml +16 -0
  722. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.md +27 -0
  723. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.zh.md +27 -0
  724. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.i18n.yaml +16 -0
  725. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.md +20 -0
  726. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.zh.md +20 -0
  727. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.i18n.yaml +16 -0
  728. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.md +19 -0
  729. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.zh.md +19 -0
  730. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.i18n.yaml +16 -0
  731. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.md +41 -0
  732. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.zh.md +41 -0
  733. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.i18n.yaml +16 -0
  734. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md +21 -0
  735. package/references/official-docs/docs/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md +21 -0
  736. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +0 -0
  737. package/references/official-docs/docs/user/develop/basic/publish.md +0 -0
  738. package/references/official-docs/docs/user/develop/basic/publish.zh.md +0 -0
  739. package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +2 -2
  740. package/references/official-docs/docs/user/develop/framework/events.md +1 -1
  741. package/references/official-docs/docs/user/develop/framework/events.zh.md +1 -1
  742. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +2 -2
  743. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +1 -1
  744. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +1 -1
  745. package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +2 -2
  746. package/references/official-docs/docs/user/develop/practice/llm-adapter.md +2 -2
  747. package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +2 -2
  748. package/references/official-docs/docs/user/guide/desktop-uninstall-cleanup.i18n.yaml +16 -0
  749. package/references/official-docs/docs/user/guide/desktop-uninstall-cleanup.md +60 -0
  750. package/references/official-docs/docs/user/guide/desktop-uninstall-cleanup.zh.md +60 -0
  751. package/references/official-docs/docs/user/guide/index.i18n.yaml +2 -2
  752. package/references/official-docs/docs/user/guide/index.md +1 -0
  753. package/references/official-docs/docs/user/guide/index.zh.md +1 -0
  754. package/references/official-docs/docs/user/guide/network-proxy.i18n.yaml +2 -2
  755. package/references/official-docs/docs/user/guide/network-proxy.md +1 -1
  756. package/references/official-docs/docs/user/guide/network-proxy.zh.md +1 -1
  757. package/references/official-docs/docs/user/guide/plugin-market.i18n.yaml +24 -24
  758. package/references/official-docs/docs/user/guide/plugin-market.md +15 -13
  759. package/references/official-docs/docs/user/guide/plugin-market.zh.md +15 -13
  760. package/references/official-docs/docs/user/guide/providers.i18n.yaml +10 -10
  761. package/references/official-docs/docs/user/guide/providers.md +8 -4
  762. package/references/official-docs/docs/user/guide/providers.zh.md +8 -4
  763. package/references/official-docs/docs/user/guide/public-deployments.i18n.yaml +0 -0
  764. package/references/official-docs/docs/user/guide/public-deployments.md +0 -0
  765. package/references/official-docs/docs/user/guide/public-deployments.zh.md +0 -0
  766. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +9 -6
  767. package/references/official-docs/docs/user/guide/python-sdk.md +17 -2
  768. package/references/official-docs/docs/user/guide/python-sdk.zh.md +17 -2
  769. package/references/official-docs/docs/user/guide/schedule.i18n.yaml +16 -16
  770. package/references/official-docs/docs/user/guide/schedule.md +45 -26
  771. package/references/official-docs/docs/user/guide/schedule.zh.md +45 -26
  772. package/references/official-docs/docs/web-styling.i18n.yaml +8 -2
  773. package/references/official-docs/docs/web-styling.md +20 -2
  774. package/references/official-docs/docs/web-styling.zh.md +20 -2
  775. package/references/official-docs/packages/AGENTS.md +0 -0
  776. package/references/official-docs/packages/README.md +3 -2
  777. package/references/official-docs/vendor/README.md +39 -45
  778. package/references/official-docs/website-docs.ts +9 -1
  779. package/references/sources.md +1 -1
  780. package/scripts/check-facts.mjs +32 -25
  781. package/scripts/check-readme-parity.mjs +2 -2
  782. package/scripts/check-readme-sync.mjs +23 -16
  783. package/scripts/gen-readme-assets.py +528 -0
  784. package/scripts/verify-kit.ps1 +2 -2
  785. package/README-es.md +0 -456
  786. package/README-hi.md +0 -456
  787. package/README-pt.md +0 -456
  788. package/README-zh.md +0 -458
  789. package/references/official-docs/docs/subsystems/office-to-pdf.i18n.yaml +0 -19
  790. package/references/official-docs/docs/subsystems/office-to-pdf.md +0 -87
  791. package/references/official-docs/docs/subsystems/office-to-pdf.zh.md +0 -87
@@ -0,0 +1,1977 @@
1
+ # Forges
2
+
3
+ [English](forge.md) | 中文
4
+
5
+ 实验性的 forge 能力 seam 从代码托管平台读取变更请求(change request,即 pull request 与 merge request)。[`dsh-experimental-forge`](../../packages/experimental/forge/README.zh.md) 是 Service Definition,提供 `ctx.forge`;[`dsh-experimental-forge-github`](../../packages/experimental/forge-github/README.zh.md) 是服务 GitHub 主机的 Service Provider;[`dsh-experimental-forge-session`](../../packages/experimental/forge-session/README.zh.md) 是把变更请求绑定到 Session 的 Consumer,提供 `ctx.forgeSession`;[`dsh-experimental-client-ui-forge`](../../packages/experimental/client-ui-forge/README.zh.md) 是提供 `ctx.forgePanel` 的 GUI Consumer。默认禁用的 [forge Bundle](../../packages/experimental/forge-bundle/README.zh.md) 可从插件页面组合这四个包,同时加载[工作树模型工具](../../packages/experimental/tool-worktree/README.zh.md),并为面板附带一个隔离的 [worktree 服务](../../packages/experimental/worktree/README.zh.md);除此之外,它们只能通过显式组合加载。
6
+
7
+ ## 提供方与变更请求
8
+
9
+ 一个提供方服务一个 forge 家族,例如 `github`。它把 Git 远端 URL 映射为仓库,把变更请求 URL 映射为引用,构造规范的变更请求 URL,按 head 分支查找打开状态的变更请求,并批量读取状态。`changeRequestKey` 从引用派生一个不区分大小写的键,因此 URL 拼写不同的监听方共享同一个轮询循环。
10
+
11
+ ```ts type-equiv
12
+ /** One repository on a code host, identified the way its provider addresses it. */
13
+ interface ForgeRepository {
14
+ /** Provider family that serves the repository, such as `github`. */
15
+ readonly forge: string
16
+ /** Lowercase host name, such as `github.com`. */
17
+ readonly host: string
18
+ /** Owner or namespace path as the host spells it. */
19
+ readonly owner: string
20
+ /** Repository name as the host spells it. */
21
+ readonly name: string
22
+ }
23
+ ```
24
+
25
+ ```ts type-equiv
26
+ /** One change request (pull request or merge request) in a repository. */
27
+ interface ChangeRequestRef {
28
+ /** Repository that holds the change request. */
29
+ readonly repository: ForgeRepository
30
+ /** Host-assigned change request number. */
31
+ readonly number: number
32
+ }
33
+ ```
34
+
35
+ ```ts type-equiv
36
+ /** Canonical identity of a change request across providers; built by `changeRequestKey`. */
37
+ type ChangeRequestKey = Branded<'ChangeRequestKey'>
38
+ ```
39
+
40
+ ```ts type-equiv
41
+ /**
42
+ * Host-specific access registered with `ctx.forge`. One provider serves one
43
+ * forge family; methods that take a signal must stop work when it aborts.
44
+ */
45
+ interface ForgeProvider {
46
+ /** Forge family name stored in every repository this provider returns. */
47
+ readonly forge: string
48
+ /** Publish a comment or completed review. Omission declares that this provider cannot write reviews. */
49
+ submitReview?(ref: ChangeRequestRef, request: ForgeReviewRequest, signal: AbortSignal): Promise<ForgeReviewResult>
50
+ /**
51
+ * Read the review threads of a change request at head commit `headSha`. The threads are returned only when the
52
+ * read names `headSha` as the head; once the head is another commit, the read resolves to a `stale` failure.
53
+ * Omission declares that this provider cannot read reviews.
54
+ */
55
+ readReview?(ref: ChangeRequestRef, headSha: string, signal: AbortSignal): Promise<ForgeReviewData | ForgeFailure>
56
+ /**
57
+ * Write to the review threads or the pending review of a change request while its head is `write.headSha`; once the
58
+ * head is another commit, the write resolves to `stale` without writing. A write is never retried. Omission declares
59
+ * that this provider cannot write reviews, and its `readReview` then reports no viewer permission.
60
+ */
61
+ writeReview?(ref: ChangeRequestRef, write: ForgeReviewWrite, signal: AbortSignal): Promise<ForgeReviewWriteResult>
62
+ /** Map a Git remote URL to its repository, or undefined when this provider does not serve it. */
63
+ repositoryFromRemote(url: string): ForgeRepository | undefined
64
+ /** Map a change request web URL to its reference, or undefined when this provider does not serve it. */
65
+ changeRequestFromUrl(url: string): ChangeRequestRef | undefined
66
+ /** Build the canonical web URL of a change request this provider serves. */
67
+ changeRequestUrl(ref: ChangeRequestRef): string
68
+ /** Read the status of several change requests, returning one result per requested key. */
69
+ fetch(
70
+ refs: readonly ChangeRequestRef[],
71
+ signal: AbortSignal,
72
+ ): Promise<ReadonlyMap<ChangeRequestKey, ChangeRequestSnapshot | ForgeFailure>>
73
+ /** Read all checks for one change request on demand; omission declares that only the polling preview is available. */
74
+ fetchChecks?(ref: ChangeRequestRef, signal: AbortSignal): Promise<ChangeRequestSnapshot | ForgeFailure>
75
+ /** Find open change requests whose head is `branch` in `repository`, excluding the default branch and forks. */
76
+ findByHead(repository: ForgeRepository, branch: string, signal: AbortSignal): Promise<readonly ChangeRequestRef[]>
77
+ /** Report whether the provider can reach `host` with current credentials. */
78
+ readiness(host: string, signal: AbortSignal): Promise<ForgeReadiness>
79
+ /** Mark a draft change request ready for review, resolving to undefined once the host accepted it. */
80
+ markReady(ref: ChangeRequestRef, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
81
+ /** Merge a change request while its head is still `request.headSha`, resolving to undefined once merged. */
82
+ merge(ref: ChangeRequestRef, request: MergeRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
83
+ /**
84
+ * Read the changes of a change request at head commit `headSha` as the host computes them, as one unified
85
+ * patch with `a/` and `b/` path prefixes. A patch is returned only when it describes `headSha`; once the
86
+ * head is another commit, the read resolves to a `stale` failure. `base`, when given, is the `baseSha` the
87
+ * latest status recorded with `headSha`; a provider may start reading from it before it confirms the head.
88
+ */
89
+ diff(ref: ChangeRequestRef, headSha: string, signal: AbortSignal, base?: string): Promise<string | ForgeFailure>
90
+ /** Read the text of `path` at `commit` in the change request's repository. */
91
+ fileText(ref: ChangeRequestRef, commit: string, path: string, signal: AbortSignal): Promise<string | ForgeFailure>
92
+ /** Build the web page of `path` at `commit` in the change request's repository. */
93
+ fileUrl(ref: ChangeRequestRef, commit: string, path: string): string
94
+ /**
95
+ * List the commits of a change request at its current head. A provider implements `commits` and `compare`
96
+ * together; omitting either declares that the change request can be read only as a whole.
97
+ */
98
+ commits?(ref: ChangeRequestRef, signal: AbortSignal): Promise<ForgeCommitList | ForgeFailure>
99
+ /**
100
+ * Read the changes from commit `base` to commit `head` in the change request's repository, as one unified patch
101
+ * with `a/` and `b/` path prefixes. Both are full object names; `head` descends from `base`.
102
+ */
103
+ compare?(ref: ChangeRequestRef, base: string, head: string, signal: AbortSignal): Promise<string | ForgeFailure>
104
+ /**
105
+ * Read the signed-in user's viewed marks on the change request's files at head commit `headSha`. The marks are
106
+ * returned only when the read names `headSha` as the head; once the head is another commit, the read resolves to a
107
+ * `stale` failure. A provider implements `viewedFiles` and `setViewed` together; omitting either declares that the
108
+ * host keeps no viewed marks.
109
+ */
110
+ viewedFiles?(ref: ChangeRequestRef, headSha: string, signal: AbortSignal): Promise<ForgeViewedFiles | ForgeFailure>
111
+ /**
112
+ * Set or clear the signed-in user's viewed mark on one file while the head is still `request.headSha`, resolving to
113
+ * undefined once the host saved it.
114
+ */
115
+ setViewed?(ref: ChangeRequestRef, request: ForgeViewedRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
116
+ /**
117
+ * Rerun the failed checks of the head commit that name a `rerun` none of whose checks is pending, while the head is
118
+ * still `request.headSha`, resolving to undefined once the host accepted every rerun. Omission declares that the
119
+ * provider reruns no checks, and its snapshots then name none.
120
+ */
121
+ rerunChecks?(ref: ChangeRequestRef, request: ForgeRerunRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
122
+ /**
123
+ * Request reviews from more reviewers, resolving to undefined once the host accepted the request. A provider implements
124
+ * `requestReviews` and `reviewerCandidates` together; omitting either declares that it requests no reviews, and its
125
+ * snapshots then deny `canRequestReviews`.
126
+ */
127
+ requestReviews?(ref: ChangeRequestRef, request: ForgeReviewersRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
128
+ /** List accounts whose login or name matches `query`, the host's suggestions first, for a review request. */
129
+ reviewerCandidates?(ref: ChangeRequestRef, query: string, signal: AbortSignal): Promise<readonly ForgeReviewerCandidate[] | ForgeFailure>
130
+ /**
131
+ * Bring the base branch's new commits into the head branch while its head is still `request.headSha`, resolving to
132
+ * undefined once the host accepted the update. Omission declares that the provider updates no branches, and its
133
+ * snapshots then offer no `branchUpdates`.
134
+ */
135
+ updateBranch?(ref: ChangeRequestRef, request: BranchUpdateRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
136
+ }
137
+ ```
138
+
139
+ ```ts type-equiv
140
+ /** One commit of a change request. */
141
+ interface ForgeCommit {
142
+ /** Full commit object name. */
143
+ readonly sha: string
144
+ /** Full object name of the first parent, or null for a root commit. */
145
+ readonly parent: string | null
146
+ /** First line of the commit message. */
147
+ readonly title: string
148
+ /** Author name or login as the host reports it, or null when it reports none. */
149
+ readonly author: string | null
150
+ /** ISO 8601 time the commit was authored. */
151
+ readonly authoredAt: string
152
+ }
153
+ ```
154
+
155
+ ```ts type-equiv
156
+ /** The commits of a change request at one head commit. */
157
+ interface ForgeCommitList {
158
+ /** Head commit the list was read at. */
159
+ readonly headSha: string
160
+ /** Commits oldest first, ending with the head commit unless `truncated`. */
161
+ readonly commits: readonly ForgeCommit[]
162
+ /** Whether the change request has more commits than the provider lists; the listed ones are the oldest. */
163
+ readonly truncated: boolean
164
+ }
165
+ ```
166
+
167
+ `ctx.forge.commits` 与 `ctx.forge.compare` 委托给同时实现两者的提供方;否则 `commits` 返回 undefined,`compare` 返回 `unavailable` 失败,因此 forge 面板只在提供方能读取提交时提供提交选择器。
168
+
169
+ ```ts type-equiv
170
+ /** Whether a provider can reach one host with the current credentials. */
171
+ interface ForgeReadiness {
172
+ /** `ready`, `unauthenticated` (sign-in needed), or `unavailable` (tool missing or host unreachable). */
173
+ readonly state: 'ready' | 'unauthenticated' | 'unavailable'
174
+ /** Human-readable detail, or null when ready. */
175
+ readonly message: string | null
176
+ }
177
+ ```
178
+
179
+ ## 状态轮询
180
+
181
+ `ctx.forge.watch` 让同一变更请求的所有监听方共享一个轮询循环,并把每次结果作为更新送达。每个 forge 同时最多只有一次读取在进行。轮询节奏、退避与超时规则见[注册表 README](../../packages/experimental/forge/README.zh.md#use-this-package)。
182
+
183
+ ```ts type-equiv
184
+ /** Lifecycle state of a change request. */
185
+ type ChangeRequestState = 'open' | 'closed' | 'merged'
186
+ ```
187
+
188
+ ```ts type-equiv
189
+ /** Normalized outcome of one status check. */
190
+ type CheckState = 'pending' | 'success' | 'failure' | 'neutral' | 'skipped' | 'cancelled'
191
+ ```
192
+
193
+ ```ts type-equiv
194
+ /** One status check reported for the head commit of a change request. */
195
+ interface ChangeRequestCheck {
196
+ /** Check name as the host displays it. */
197
+ readonly name: string
198
+ /** Normalized check outcome. */
199
+ readonly state: CheckState
200
+ /** Web page for the check, or null when the host reports none. */
201
+ readonly url: string | null
202
+ /** Workflow that produced the check, or null when the host reports none. */
203
+ readonly workflow: string | null
204
+ /** ISO 8601 time the check started, or null before it starts and when the host reports none. */
205
+ readonly startedAt: string | null
206
+ /** ISO 8601 time the check completed, or null while it runs and when the host reports none. */
207
+ readonly completedAt: string | null
208
+ /**
209
+ * Identity a rerun of this check names, or null when the provider cannot rerun it, as for a commit status. Checks that
210
+ * name one identity rerun together, and their failed checks can be rerun once none of them is pending.
211
+ */
212
+ readonly rerun: ForgeCheckId | null
213
+ }
214
+ ```
215
+
216
+ ```ts type-equiv
217
+ /** Combined outcome of all checks on the head commit. */
218
+ type ChecksRollup = 'none' | 'pending' | 'success' | 'failure'
219
+ ```
220
+
221
+ ```ts type-equiv
222
+ /** Whether the change request can merge into its base without conflicts. */
223
+ type Mergeability = 'mergeable' | 'conflicting' | 'unknown'
224
+ ```
225
+
226
+ ```ts type-equiv
227
+ /** Aggregate review outcome required by the host's merge rules. */
228
+ type ReviewDecision = 'approved' | 'changes-requested' | 'review-required' | 'none'
229
+ ```
230
+
231
+ ```ts type-equiv
232
+ /** Status of one change request at the time its provider read it. */
233
+ interface ChangeRequestSnapshot {
234
+ /** Change request the snapshot describes. */
235
+ readonly ref: ChangeRequestRef
236
+ /** Web page of the change request. */
237
+ readonly url: string
238
+ /** Title as the author wrote it. */
239
+ readonly title: string
240
+ /** Lifecycle state. */
241
+ readonly state: ChangeRequestState
242
+ /** Whether the author marked the change request as a draft. */
243
+ readonly draft: boolean
244
+ /** Author login, or null when the host hides it. */
245
+ readonly author: string | null
246
+ /** Branch that carries the proposed commits. */
247
+ readonly headBranch: string
248
+ /** Commit object name at the head of the change request. */
249
+ readonly headSha: string
250
+ /** Branch the change request merges into. */
251
+ readonly baseBranch: string
252
+ /**
253
+ * Base commit the host recorded with `headSha`, whose merge base with the head starts the change request's diff;
254
+ * omitted when the provider does not report it.
255
+ */
256
+ readonly baseSha?: string
257
+ /** Lines the change request adds. */
258
+ readonly additions: number
259
+ /** Lines the change request deletes. */
260
+ readonly deletions: number
261
+ /** Merge conflict status; `unknown` while the host computes it. */
262
+ readonly mergeability: Mergeability
263
+ /**
264
+ * Whether the host would merge the change request now for the signed-in
265
+ * user: open, not a draft, and meeting the base branch's merge rules.
266
+ */
267
+ readonly mergeReady: boolean
268
+ /** Merge methods the repository accepts, the signed-in user's usual one first. */
269
+ readonly mergeMethods: readonly MergeMethod[]
270
+ /**
271
+ * Ways the signed-in user can bring the base branch's new commits into the head branch now; empty while the head is
272
+ * up to date, while the branches conflict, when the user cannot update the head branch, or when the provider cannot,
273
+ * so a head behind its base cannot be told apart from a current one for a user without the right to update it.
274
+ */
275
+ readonly branchUpdates: readonly BranchUpdateMethod[]
276
+ /** Aggregate review outcome. */
277
+ readonly reviewDecision: ReviewDecision
278
+ /** Reviewers whose review is requested, in host order, then other accounts that reviewed, each once; the author is never listed. */
279
+ readonly reviewers: readonly ChangeRequestReviewer[]
280
+ /** Whether the host reported more review requests or reviews than the provider read, so `reviewers` may be incomplete. */
281
+ readonly reviewersTruncated: boolean
282
+ /** Whether the signed-in user may request reviews of the change request through its provider. */
283
+ readonly canRequestReviews: boolean
284
+ /** Checks on the head commit in host order. */
285
+ readonly checks: readonly ChangeRequestCheck[]
286
+ /** Combined check outcome. */
287
+ readonly checksRollup: ChecksRollup
288
+ /** Whether the host reported more checks than `checks` contains. */
289
+ readonly checksTruncated: boolean
290
+ /** Whether the signed-in user may rerun the failed checks that name a `rerun`. */
291
+ readonly canRerunChecks: boolean
292
+ /** Number of counted review threads that are not resolved. */
293
+ readonly unresolvedThreads: number
294
+ /** Whether the change request has more review threads than the provider counted, so `unresolvedThreads` is a lower bound. */
295
+ readonly threadsTruncated: boolean
296
+ /** Issues linked to the change request, which the host closes once it merges, in host order. */
297
+ readonly closingIssues: readonly ChangeRequestIssue[]
298
+ /** Whether the host reported more closing issues than `closingIssues` holds. */
299
+ readonly closingIssuesTruncated: boolean
300
+ /** ISO 8601 time of the host's last update to the change request. */
301
+ readonly updatedAt: string
302
+ /** ISO 8601 time the change request was merged or closed, or null while it is open. */
303
+ readonly closedAt: string | null
304
+ }
305
+ ```
306
+
307
+ ```ts type-equiv
308
+ /** Why a provider could not read a change request. */
309
+ interface ForgeFailure {
310
+ /**
311
+ * `not-found`: the host does not expose it; `unauthenticated`: credentials are missing or rejected;
312
+ * `too-large`: the host or the provider refuses an answer over its size limit, so reading again fails
313
+ * the same way; `stale`: the head is no longer the commit the read named, so reading again at the head of
314
+ * a later status can succeed; `unsupported`: the provider does not offer the read; `unavailable`: any other failure.
315
+ */
316
+ readonly code: 'not-found' | 'unauthenticated' | 'too-large' | 'stale' | 'unsupported' | 'unavailable'
317
+ /** Human-readable cause. */
318
+ readonly message: string
319
+ }
320
+ ```
321
+
322
+ ```ts type-equiv
323
+ /** Latest polling result delivered to watchers of one change request. */
324
+ type ChangeRequestUpdate = {
325
+ /** Canonical identity of the watched change request. */
326
+ readonly key: ChangeRequestKey
327
+ /** Epoch milliseconds when the result settled. */
328
+ readonly fetchedAt: number
329
+ } & ({
330
+ /** Status read from the host. */
331
+ readonly snapshot: ChangeRequestSnapshot
332
+ } | {
333
+ /** Reason the status could not be read. */
334
+ readonly failure: ForgeFailure
335
+ })
336
+ ```
337
+
338
+ ```ts type-equiv
339
+ /**
340
+ * Receives every polling result for one watched change request.
341
+ * @param update - the settled result.
342
+ */
343
+ type ChangeRequestListener = (update: ChangeRequestUpdate) => void
344
+ ```
345
+
346
+ ## 变更请求操作
347
+
348
+ `ctx.forge.markReady` 把草稿标记为可评审,`ctx.forge.merge` 只在 head 仍是用户确认的提交时合并变更请求。主机拒绝时,两者都 resolve 为 `ForgeActionFailure` 而不是抛错,并在结束后立即轮询被监听的变更请求。快照的 `mergeReady` 与 `mergeMethods` 告诉消费方何时提供合并、可用哪些合并方式;GitHub 如何给出这两项由 [GitHub 提供方 README](../../packages/experimental/forge-github/README.zh.md#use-this-package) 说明。
349
+
350
+ ```ts type-equiv
351
+ /** A merge the user confirmed for the head commit they saw. */
352
+ interface MergeRequest {
353
+ /** How the commits enter the base branch. */
354
+ readonly method: MergeMethod
355
+ /** Commit object name the head must still have; the merge is refused once the head moves. */
356
+ readonly headSha: string
357
+ }
358
+ ```
359
+
360
+ ```ts type-equiv
361
+ /** Why a provider could not change a change request, or could not confirm that it did. */
362
+ interface ForgeActionFailure {
363
+ /**
364
+ * `unauthenticated`: credentials are missing or rejected; `stale`: the head
365
+ * moved past the confirmed commit; `failed`: the host refused or could not be reached, so nothing changed;
366
+ * `unknown`: the request reached the host but its answer did not confirm the outcome, so the change may have been
367
+ * applied and must be checked on the host before it is tried again.
368
+ */
369
+ readonly code: 'unauthenticated' | 'stale' | 'failed' | 'unknown'
370
+ /** Human-readable cause, usually the host's own message. */
371
+ readonly message: string
372
+ }
373
+ ```
374
+
375
+ `ctx.forge.submitReview` 将明确指定的评论或完整评审交给 provider;未实现此能力的 provider 返回不支持。消费者在再次提交前核对结果不明的写操作;留待之后一起提交的评论通过 `ctx.forge.writeReview` 写入代码托管平台的待提交评审。
376
+
377
+ ```ts type-equiv
378
+ /** One inline comment addressed to the old or new side of a pull request diff. */
379
+ interface ForgeLineComment {
380
+ readonly path: string
381
+ readonly side: 'L' | 'R'
382
+ readonly startLine: number
383
+ readonly endLine: number
384
+ readonly body: string
385
+ }
386
+ ```
387
+
388
+ ```ts type-equiv
389
+ /** A single published comment or one completed review containing all pending comments. */
390
+ type ForgeReviewRequest = {
391
+ /** Commit the user reviewed; providers must check it before writing and address that commit explicitly. */
392
+ readonly headSha: string
393
+ } & (
394
+ | { readonly kind: 'comment'; readonly comment: ForgeLineComment }
395
+ | { readonly kind: 'review'; readonly event: ForgeReviewEvent; readonly body: string; readonly comments: readonly ForgeLineComment[] }
396
+ )
397
+ ```
398
+
399
+ ```ts type-equiv
400
+ /** Result of a review submission; unknown outcomes must be checked on the host before another submission. */
401
+ type ForgeReviewResult =
402
+ | { readonly ok: true; readonly url: string }
403
+ | { readonly ok: false; readonly code: 'unsupported' | 'stale' | 'failed' | 'unknown'; readonly message: string }
404
+ ```
405
+
406
+ ## 评审讨论
407
+
408
+ `ctx.forge.readReview(ref, headSha, signal)` 读取变更请求在某个 head 提交处的评审讨论。只有当读取时的 head 就是 `headSha` 时,提供方才返回 `ForgeReviewData`;否则返回 `stale`,并像 diff 读取遇到 `stale` 时一样,立即重新轮询被关注的变更请求。提供方没有实现 `readReview` 时,服务返回 `unsupported`,使用方据此不显示讨论,也不报错。行级讨论有两套位置:`original` 是写下讨论时所在提交上的行,`current` 是本次读取的 head 上的行;托管平台不再把讨论放在该提交上时,`current` 为 null。显示 head diff 的使用方把讨论放在 `current` 位置,其余讨论用 `diffHunk` 展示;用 `fileText` 读取 `original.commit` 上的文件,可以看到写下讨论时的完整文件。GitHub 各字段如何映射到这两套位置,由 [GitHub 提供方 README](../../packages/experimental/forge-github/README.zh.md#use-this-package) 说明。
409
+
410
+ ```ts type-equiv
411
+ /** Opaque host identity of one review thread. */
412
+ type ForgeThreadId = Branded<'ForgeThreadId'>
413
+ ```
414
+
415
+ ```ts type-equiv
416
+ /** Opaque host identity of one review comment. */
417
+ type ForgeCommentId = Branded<'ForgeCommentId'>
418
+ ```
419
+
420
+ ```ts type-equiv
421
+ /** Consecutive lines on one side of a diff whose new side is one commit. */
422
+ interface ForgeAnchor {
423
+ /**
424
+ * Full object name of the commit the diff's new side shows: new-side (`R`) lines number this commit's file, and
425
+ * old-side (`L`) lines number the file at the diff's base.
426
+ */
427
+ readonly commit: string
428
+ /** First line, inclusive. */
429
+ readonly startLine: number
430
+ /** Last line, inclusive. */
431
+ readonly endLine: number
432
+ }
433
+ ```
434
+
435
+ ```ts type-equiv
436
+ /** Account that wrote a review comment. */
437
+ interface ForgeCommentAuthor {
438
+ /** Login as the host spells it. */
439
+ readonly login: string
440
+ /** Avatar image URL, or null when the host reports none. */
441
+ readonly avatarUrl: string | null
442
+ /** Whether the account is an app or bot rather than a person. */
443
+ readonly bot: boolean
444
+ }
445
+ ```
446
+
447
+ ```ts type-equiv
448
+ /** One comment of a review thread. */
449
+ interface ForgeReviewComment {
450
+ /** Host identity of the comment. */
451
+ readonly id: ForgeCommentId
452
+ /** Author, or null when the account no longer exists. */
453
+ readonly author: ForgeCommentAuthor | null
454
+ /** Markdown source as the author wrote it; it may contain raw HTML, which readers must not render as HTML. */
455
+ readonly body: string
456
+ /** ISO 8601 time the comment was created. */
457
+ readonly createdAt: string
458
+ /** Whether the comment belongs to the signed-in user's review that is not submitted yet, which only that user sees. */
459
+ readonly pending: boolean
460
+ /** Web page of the comment, or null when the host reports none. */
461
+ readonly url: string | null
462
+ /** Whether the signed-in user can replace the comment's text through `writeReview`; false for a provider without it. */
463
+ readonly viewerCanEdit: boolean
464
+ /** Whether the signed-in user can delete the comment through `writeReview`; false for a provider without it. */
465
+ readonly viewerCanDelete: boolean
466
+ }
467
+ ```
468
+
469
+ ```ts type-equiv
470
+ /**
471
+ * One review thread on a file of a change request. A line thread has two positions: `original` on the commit it was
472
+ * written on, and `current` on the head commit of the read. `current` is null once the host no longer places the
473
+ * thread on the head commit, as after later commits changed its lines.
474
+ */
475
+ interface ForgeReviewThread {
476
+ /** Host identity of the thread. */
477
+ readonly id: ForgeThreadId
478
+ /** Repository-relative path the thread is on. */
479
+ readonly path: string
480
+ /** Old (`L`) or new (`R`) side of the diff the lines number. */
481
+ readonly side: 'L' | 'R'
482
+ /** Whether the thread is on lines or on the whole file. */
483
+ readonly subject: 'line' | 'file'
484
+ /** Lines in the diff that ends at the head commit of the read, whose `commit` is that head; null for an outdated or file thread. */
485
+ readonly current: ForgeAnchor | null
486
+ /** Lines in the diff that ended at the commit the thread was written on; null for a file thread. */
487
+ readonly original: ForgeAnchor | null
488
+ /** Diff hunk the host recorded when the thread was written, ending at its last line; null when it recorded none. */
489
+ readonly diffHunk: string | null
490
+ /** Whether the thread is marked resolved. */
491
+ readonly resolved: boolean
492
+ /** Whether the signed-in user can reply to the thread through `writeReview`; false for a provider without it. */
493
+ readonly viewerCanReply: boolean
494
+ /**
495
+ * Whether the signed-in user can mark the thread resolved, or unresolved when `resolved`, through `writeReview`; false
496
+ * for a provider without it.
497
+ */
498
+ readonly viewerCanResolve: boolean
499
+ /** Comments oldest first; the first starts the thread. */
500
+ readonly comments: readonly ForgeReviewComment[]
501
+ }
502
+ ```
503
+
504
+ ```ts type-equiv
505
+ /** Review threads of a change request read at one head commit. */
506
+ interface ForgeReviewData {
507
+ /** Head commit the threads were read at; `current` positions number its files. */
508
+ readonly headSha: string
509
+ /** Login of the signed-in user the provider read as, or null when the host does not name one. */
510
+ readonly viewer: string | null
511
+ /** Threads in host order, at most the provider's limit. */
512
+ readonly threads: readonly ForgeReviewThread[]
513
+ /** Whether the change request has more threads than `threads` holds. */
514
+ readonly truncated: boolean
515
+ /** The signed-in user's pending review, or null without one. */
516
+ readonly pendingReview: ForgePendingReview | null
517
+ /**
518
+ * Whether the signed-in user can add comments to a pending review and submit or discard it through `writeReview`;
519
+ * false for a provider without it.
520
+ */
521
+ readonly viewerCanReview: boolean
522
+ }
523
+ ```
524
+
525
+ `ctx.forge.writeReview(ref, write, signal)` 写入评审讨论和当前登录用户的待提交评审:回复讨论,立即发布,或在 `pending` 时加入待提交评审;把讨论标记为已解决或取消解决;编辑或删除评论;在 head 上添加一条行内评论到待提交评审;以及提交或丢弃待提交评审。用户还没有待提交评审时,待提交的回复或评论会先开始一个评审。每个写操作都带有用户看到的 head 提交;提供方先检查它,head 已变化时不写入,直接返回 `stale`,并像读取遇到 `stale` 时那样重新轮询被关注的变更请求;其他结果之后,服务都会立即重新轮询被关注的变更请求。写操作从不重试;结果为 `unknown` 时,必须先在托管平台上核对,再重试。提供方没有实现 `writeReview` 时,服务返回 `unsupported`。`ForgeReviewData` 带有待提交评审,以及用户对每个讨论、每条评论和待提交评审的权限;未实现 `writeReview` 的提供方把这些权限报告为没有,使用方据此只提供能够成功的写操作。GraphQL mutation 以及它们的结果如何对应到这些返回值,由 [GitHub 提供方 README](../../packages/experimental/forge-github/README.zh.md#use-this-package) 说明。
526
+
527
+ ```ts type-equiv
528
+ /** Opaque host identity of one review. */
529
+ type ForgeReviewId = Branded<'ForgeReviewId'>
530
+ ```
531
+
532
+ ```ts type-equiv
533
+ /** The signed-in user's review of a change request that is not submitted yet, which only that user sees. */
534
+ interface ForgePendingReview {
535
+ /** Host identity of the review. */
536
+ readonly id: ForgeReviewId
537
+ /** Comments the review holds. */
538
+ readonly comments: number
539
+ }
540
+ ```
541
+
542
+ ```ts type-equiv
543
+ /** Decision a submitted review records. */
544
+ type ForgeReviewEvent = 'comment' | 'approve' | 'request-changes'
545
+ ```
546
+
547
+ ```ts type-equiv
548
+ /**
549
+ * One write to the review threads and the pending review of a change request. `pending` replies and `add-pending`
550
+ * comments join the signed-in user's pending review, which is started when the user has none. A host that adds every
551
+ * reply to an existing pending review, as GitHub does, refuses a reply with `pending: false` while one exists.
552
+ */
553
+ type ForgeReviewWrite = {
554
+ /** Head commit the user saw; providers check it before writing and refuse with `stale` once the head is another commit. */
555
+ readonly headSha: string
556
+ } & (
557
+ | { readonly kind: 'reply'; readonly thread: ForgeThreadId; readonly body: string; readonly pending: boolean }
558
+ | { readonly kind: 'resolve'; readonly thread: ForgeThreadId; readonly resolved: boolean }
559
+ | { readonly kind: 'edit-comment'; readonly comment: ForgeCommentId; readonly body: string }
560
+ /** Deleting the only comment of a thread deletes the thread. */
561
+ | { readonly kind: 'delete-comment'; readonly comment: ForgeCommentId }
562
+ /** A comment on lines of `headSha`. */
563
+ | { readonly kind: 'add-pending'; readonly comment: ForgeLineComment }
564
+ | { readonly kind: 'submit-pending'; readonly review: ForgeReviewId; readonly event: ForgeReviewEvent; readonly body: string }
565
+ /** Delete the pending review with every comment it holds. */
566
+ | { readonly kind: 'discard-pending'; readonly review: ForgeReviewId }
567
+ )
568
+ ```
569
+
570
+ ```ts type-equiv
571
+ /** Result of a review write; an `unknown` outcome must be checked on the host before the write is tried again. */
572
+ type ForgeReviewWriteResult =
573
+ | { readonly ok: true }
574
+ | { readonly ok: false; readonly code: 'unsupported' | 'stale' | 'failed' | 'unknown'; readonly message: string }
575
+ ```
576
+
577
+ <a id="overview-and-viewed-marks"></a>
578
+
579
+ ## 概览与已审阅标记
580
+
581
+ 快照还携带变更请求的概览:`reviewers` 及每位评审者最近的结论、合并后托管平台会关闭的 `closingIssues`、能让落后于基线的 head 更新到最新的 `branchUpdates`、当前登录用户能否请求评审或重跑检查,以及每个检查指出的 `rerun`。`ctx.forge.rerunChecks`、`ctx.forge.requestReviews` 与 `ctx.forge.updateBranch` 据此操作,并像上文的操作一样返回 `ForgeActionFailure`,主机的答复无法确认结果时为 `unknown`,提供方答复后立即轮询被监听的变更请求;重跑与更新指明用户看到的 head 提交,head 移动后以 `stale` 拒绝。提供方同时实现 `requestReviews` 与 `reviewerCandidates`,`ctx.forge.reviewerCandidates` 借后者列出可以请求评审的账号;提供方缺少的操作以 `failed` 失败,`reviewerCandidates` 则返回 `unsupported`。GitHub 如何填写各字段并执行这些操作见 [GitHub 提供方 README](../../packages/experimental/forge-github/README.zh.md#use-this-package)。
582
+
583
+ ```ts type-equiv
584
+ /** Opaque host identity of a status check that a rerun names. */
585
+ type ForgeCheckId = Branded<'ForgeCheckId'>
586
+ ```
587
+
588
+ ```ts type-equiv
589
+ /** How an update brings the base branch's new commits into the head branch: a merge commit, or a rebase of the head's commits. */
590
+ type BranchUpdateMethod = 'merge' | 'rebase'
591
+ ```
592
+
593
+ ```ts type-equiv
594
+ /** Outcome of a reviewer's latest submitted review. */
595
+ type ReviewVerdict = 'approved' | 'changes-requested' | 'commented' | 'dismissed'
596
+ ```
597
+
598
+ ```ts type-equiv
599
+ /** An account or team asked to review a change request, or an account that reviewed it. */
600
+ interface ChangeRequestReviewer {
601
+ /** Whether the reviewer is a person's account, an app or bot account, or a team. */
602
+ readonly kind: 'user' | 'bot' | 'team'
603
+ /** Login, or `organization/slug` for a team. */
604
+ readonly login: string
605
+ /** Avatar image URL, or null when the host reports none. */
606
+ readonly avatarUrl: string | null
607
+ /** Whether a review from the reviewer is requested now. */
608
+ readonly requested: boolean
609
+ /** Whether the host requested the review because the reviewer owns changed paths. */
610
+ readonly codeOwner: boolean
611
+ /** Outcome of the reviewer's latest submitted review, or null before the first. */
612
+ readonly verdict: ReviewVerdict | null
613
+ /** Commit the latest submitted review was on, or null before the first or when the host reports none. */
614
+ readonly reviewedSha: string | null
615
+ }
616
+ ```
617
+
618
+ ```ts type-equiv
619
+ /** One issue linked to a change request, which the host closes once the change request merges. */
620
+ interface ChangeRequestIssue {
621
+ /** Repository that holds the issue. */
622
+ readonly repository: ForgeRepository
623
+ /** Host-assigned issue number. */
624
+ readonly number: number
625
+ /** Title as the author wrote it. */
626
+ readonly title: string
627
+ /** Whether the issue is still open. */
628
+ readonly state: 'open' | 'closed'
629
+ /** Web page of the issue. */
630
+ readonly url: string
631
+ }
632
+ ```
633
+
634
+ ```ts type-equiv
635
+ /** A rerun of the failed checks of the head commit whose checks the user saw. */
636
+ interface ForgeRerunRequest {
637
+ /** Head commit whose checks the user saw; the provider refuses with `stale` once the head is another commit. */
638
+ readonly headSha: string
639
+ }
640
+ ```
641
+
642
+ ```ts type-equiv
643
+ /** Reviewers to ask in addition to those whose review is requested now; one who already reviewed is asked again. */
644
+ interface ForgeReviewersRequest {
645
+ /** The reviewers by kind and login, a team by `organization/slug`. */
646
+ readonly reviewers: readonly Pick<ChangeRequestReviewer, 'kind' | 'login'>[]
647
+ }
648
+ ```
649
+
650
+ ```ts type-equiv
651
+ /** An account a review of the change request can be requested from. */
652
+ interface ForgeReviewerCandidate {
653
+ /** Login as the host spells it. */
654
+ readonly login: string
655
+ /** Display name, or null when the account shows none. */
656
+ readonly name: string | null
657
+ /** Avatar image URL, or null when the host reports none. */
658
+ readonly avatarUrl: string | null
659
+ /** Whether the host suggests the account for this change request, as from the history of its changed files. */
660
+ readonly suggested: boolean
661
+ }
662
+ ```
663
+
664
+ ```ts type-equiv
665
+ /** A branch update the user confirmed for the head commit they saw. */
666
+ interface BranchUpdateRequest {
667
+ /** How the base branch's new commits enter the head branch. */
668
+ readonly method: BranchUpdateMethod
669
+ /** Commit object name the head must still have; the update is refused once the head moves. */
670
+ readonly headSha: string
671
+ }
672
+ ```
673
+
674
+ `ctx.forge.viewedFiles` 与 `ctx.forge.setViewed` 在一个 head 提交上读取和修改当前登录用户对变更请求各文件的已审阅标记。只有同时实现两个方法的提供方保存已审阅标记;否则 `viewedFiles` 返回 undefined,`setViewed` 失败,由使用方自行保存标记。`stale` 答复会像过期的 diff 读取一样立即轮询被监听的变更请求。
675
+
676
+ ```ts type-equiv
677
+ /**
678
+ * The signed-in user's review progress on one changed file: `viewed`, `unviewed`, or `dismissed` once the file
679
+ * changed after the user marked it viewed.
680
+ */
681
+ type ForgeViewedState = 'viewed' | 'unviewed' | 'dismissed'
682
+ ```
683
+
684
+ ```ts type-equiv
685
+ /** The signed-in user's viewed marks on the files of a change request, read at one head commit. */
686
+ interface ForgeViewedFiles {
687
+ /** Head commit the marks were read at. */
688
+ readonly headSha: string
689
+ /** State of each changed file the host listed, by repository-relative path. */
690
+ readonly files: Readonly<Record<string, ForgeViewedState>>
691
+ /** Whether the change request has more files than `files` lists. */
692
+ readonly truncated: boolean
693
+ }
694
+ ```
695
+
696
+ ```ts type-equiv
697
+ /** A viewed mark the user set or cleared on a file of the head commit they saw. */
698
+ interface ForgeViewedRequest {
699
+ /** Repository-relative path of the changed file. */
700
+ readonly path: string
701
+ /** Whether the file is viewed. */
702
+ readonly viewed: boolean
703
+ /** Head commit whose changes the user saw; the provider refuses with `stale` once the head is another commit. */
704
+ readonly headSha: string
705
+ }
706
+ ```
707
+
708
+ ## Session 绑定
709
+
710
+ `ctx.forgeSession` 从每个 Session 自己的日志派生其绑定:`gh pr create` 的结果绑定其输出的 URL,`gh pr view`、`gh pr edit` 与 `gh pr checkout` 调用绑定它们所操作的变更请求,`git push` 的结果通过 `ctx.forge` 触发按 head 分支的发现;面板也会报告其检出所跟踪的分支,触发同样的发现。track、dismiss 与发现操作都是 `plugin:forge-session/binding` 插件记录,位于模型可见对话之外。`forgeChangeRequests` 投影的客户端视图随 Session 摘要下发,列出绑定但不含其状态。识别与发现规则见 [Session 绑定 README](../../packages/experimental/forge-session/README.zh.md#use-this-package)。
711
+
712
+ ```ts type-equiv
713
+ /**
714
+ * How a change request became bound to a Session: `created` when a
715
+ * `gh pr create` result printed its URL, `referenced` when a `gh pr view`,
716
+ * `gh pr edit`, or `gh pr checkout` call named it or its result printed its
717
+ * own URL, `discovered` when a lookup found it for a branch the Session pushed
718
+ * or works on, `tracked` when a caller bound it by URL.
719
+ */
720
+ type BindingOrigin = 'created' | 'referenced' | 'discovered' | 'tracked'
721
+ ```
722
+
723
+ ```ts type-equiv
724
+ /** Payload of the `plugin:forge-session/binding` record. */
725
+ interface BindingRecord {
726
+ /**
727
+ * `track` binds or restores, `dismiss` hides, `discover` binds a branch lookup,
728
+ * and `reference` binds a CLI selector lookup without restoring dismissed entries.
729
+ */
730
+ readonly action: 'track' | 'dismiss' | 'discover' | 'reference'
731
+ /** Web URL of the change request. */
732
+ readonly url: string
733
+ }
734
+ ```
735
+
736
+ ```ts type-equiv
737
+ /** One change request bound to a Session and not dismissed, with its latest polling result. */
738
+ interface SessionChangeRequest {
739
+ /** Web URL as first recorded. */
740
+ readonly url: string
741
+ /** How the change request became bound. */
742
+ readonly origin: BindingOrigin
743
+ /** Parsed reference, or null when no registered provider serves the URL. */
744
+ readonly ref: ChangeRequestRef | null
745
+ /** Latest polling result, or null before the first poll and without a provider. */
746
+ readonly update: ChangeRequestUpdate | null
747
+ }
748
+ ```
749
+
750
+ ```ts type-equiv
751
+ /**
752
+ * Receives the complete visible list after a binding or provider change, or a polling result.
753
+ * @param changeRequests - every visible binding of the watched Session, in first-recorded order.
754
+ */
755
+ type SessionChangeRequestsListener = (changeRequests: readonly SessionChangeRequest[]) => void
756
+ ```
757
+
758
+ ## 面板
759
+
760
+ `ctx.forgePanel` 是 [forge 面板](../../packages/experimental/client-ui-forge/README.zh.md#use-this-package)的宿主 Remote。跟随一个 Session 时,它以流的形式推送 `ForgePanelState`:在 Session 执行环境中对其当前目录进行的只读 Git 检查、从上游远端或 `origin` 识别出的代码托管平台、该平台的登录状态、Session 的绑定及其轮询状态与最近的快照,以及它的 worktree 请求。它的操作可以列出基准分支、绑定和隐藏 URL、刷新、把已绑定的草稿标记为可评审或合并已绑定的变更请求、请求或撤回 worktree、停止正在进行的创建,以及恢复已删除的 worktree 或离开它回到源检出。请求是一条 `plugin:client-ui-forge/worktree` 记录。消息在 Session 的 Agent 空闲时进入其收件箱,面板会在这次投递唤醒 [Agent](../../packages/core/agent/README.zh.md) 之前启动它的维护任务,暂留这条消息的这一轮:对未完成的请求,它通过 `ctx.worktrees` 创建 worktree,尝试失败或被停止后等待下一次尝试或请求被撤回;对在所创建 worktree 中工作的 Session,它检查该 worktree,已被删除时等待它被恢复或离开。面板状态说明消息在等待什么,以及最近一次失败的尝试。对于没有被暂留的消息,由第一个步骤提议创建 worktree。第一轮开始之后的请求会被忽略。对 Session 检出的改动以其 Agent 的维护任务运行,因此其他客户端发来的消息会等它们完成。
761
+
762
+ ```ts type-equiv
763
+ /** Git facts for the checkout that contains the Session's current directory. */
764
+ interface ForgeCheckout {
765
+ /** Top-level directory of the checkout. */
766
+ readonly root: string
767
+ /** Checked-out branch, or null when HEAD is detached. */
768
+ readonly branch: string | null
769
+ /** Whether the checkout is a linked worktree of another checkout's repository. */
770
+ readonly linked: boolean
771
+ /** Abbreviated commit HEAD names, or null while the checked-out branch has no commit. */
772
+ readonly commit: string | null
773
+ }
774
+ ```
775
+
776
+ ```ts type-equiv
777
+ /** Inspection result for the Session's current directory. */
778
+ type ForgeCheckoutState =
779
+ /** The first inspection has not finished. */
780
+ | { readonly state: 'pending' }
781
+ /** The current directory is not inside a Git checkout. */
782
+ | { readonly state: 'none' }
783
+ /** Git could not run or reported an error. */
784
+ | { readonly state: 'failed'; readonly message: string }
785
+ /** The checkout facts. */
786
+ | { readonly state: 'ready'; readonly checkout: ForgeCheckout }
787
+ ```
788
+
789
+ ```ts type-equiv
790
+ /** The worktree the panel created and entered for a Session before its first step. */
791
+ interface ForgeSessionWorktree {
792
+ /** Canonical checkout directory. */
793
+ readonly path: string
794
+ /** Branch created for the checkout. */
795
+ readonly branch: string
796
+ /** Requested base branch, or null when the checkout started from HEAD of the source checkout. */
797
+ readonly from: string | null
798
+ /** Commit object name the branch started from. */
799
+ readonly baseCommit: string
800
+ /** Canonical root of the source checkout. */
801
+ readonly repositoryRoot: string
802
+ }
803
+ ```
804
+
805
+
806
+ ```ts type-equiv
807
+ /** Payload of the `plugin:client-ui-forge/worktree` record. */
808
+ type WorktreeRecord =
809
+ /** Create a worktree before the Session's first step, starting from `from`, or from HEAD when it is null. */
810
+ | { readonly action: 'request'; readonly from: string | null }
811
+ /** Withdraw the open request. */
812
+ | { readonly action: 'cancel' }
813
+ /** The requested worktree was created and became the Session's working directory. */
814
+ | { readonly action: 'created'; readonly worktree: ForgeSessionWorktree }
815
+ /** Restoration started; the checkout stays unavailable until restoration completes. */
816
+ | { readonly action: 'restoring' }
817
+ /** The recorded worktree was completely restored. */
818
+ | { readonly action: 'restored' }
819
+ ```
820
+
821
+ ```ts type-equiv
822
+ /** One open worktree request. */
823
+ interface ForgeWorktreeRequest {
824
+ /** Base branch, or null for HEAD of the source checkout. */
825
+ readonly from: string | null
826
+ }
827
+ ```
828
+
829
+ ```ts type-equiv
830
+ /** Why the Session's checkout cannot host a new worktree. */
831
+ type ForgeWorktreeBlocker =
832
+ /** The current directory is not inside a Git checkout. */
833
+ | 'not-git'
834
+ /** The Session's sandbox cannot write the checkout or its Git directory, as for a linked worktree outside the writable root. */
835
+ | 'outside-writable-root'
836
+ /** The Session runs read-only. */
837
+ | 'read-only'
838
+ ```
839
+
840
+ ```ts type-equiv
841
+ /** One running worktree creation. */
842
+ interface ForgeWorktreeCreation {
843
+ /** Running step: `prepare` validates and creates the branch, then `checkout` writes the files. */
844
+ readonly phase: 'prepare' | 'checkout'
845
+ /** Branch the attempt creates. */
846
+ readonly branch: string
847
+ /** Base branch, or null for HEAD. */
848
+ readonly from: string | null
849
+ /**
850
+ * Whether a message waits for the creation before its turn starts. Only
851
+ * such a creation can be stopped, after which the message keeps waiting; a
852
+ * creation at the first step serves a message the Session already holds.
853
+ */
854
+ readonly held: boolean
855
+ }
856
+ ```
857
+
858
+ ```ts type-equiv
859
+ /** One running restoration of the removed worktree a Session works in. */
860
+ interface ForgeWorktreeRestoration {
861
+ /** Running step: `prepare` registers the checkout again, creating a missing branch, then `checkout` writes the files. */
862
+ readonly phase: 'prepare' | 'checkout'
863
+ }
864
+ ```
865
+
866
+ ```ts type-equiv
867
+ /** The last attempt to create the requested worktree for a message, which failed. */
868
+ interface ForgeWorktreeFailure {
869
+ /** Branch the attempt created, or null when it failed before naming one. */
870
+ readonly branch: string | null
871
+ /** Base branch of the attempt, or null for HEAD. */
872
+ readonly from: string | null
873
+ /** Step that failed. */
874
+ readonly phase: 'prepare' | 'checkout'
875
+ /** Failure text. */
876
+ readonly message: string
877
+ }
878
+ ```
879
+
880
+ ```ts type-equiv
881
+ /**
882
+ * What a message waits for before its turn starts: the creation of the
883
+ * requested worktree, or the restoration or leaving of the removed worktree
884
+ * the Session works in.
885
+ */
886
+ type ForgeWorktreeWaiting = 'creation' | 'restoration'
887
+ ```
888
+
889
+ ```ts type-equiv
890
+ /** The recorded worktree whose directory is missing, invalid, or incompletely restored. */
891
+ interface ForgeMissingWorktree {
892
+ /** Whether its branch exists, or null when an incomplete restoration cannot inspect it. */
893
+ readonly branchExists: boolean | null
894
+ }
895
+ ```
896
+
897
+ ```ts type-equiv
898
+ /** Worktree facts of one Session in the panel state. */
899
+ interface ForgePanelWorktree {
900
+ /**
901
+ * Whether the Session can still request or withdraw a worktree: a worktree
902
+ * service is mounted, no turn has started, and none was created.
903
+ */
904
+ readonly editable: boolean
905
+ /** Why the checkout cannot host a worktree, or null when it can, before the first inspection, and after a failed one. */
906
+ readonly blocker: ForgeWorktreeBlocker | null
907
+ /** Open request, or null without one. */
908
+ readonly request: ForgeWorktreeRequest | null
909
+ /** Created worktree, or null before creation. */
910
+ readonly created: ForgeSessionWorktree | null
911
+ /** Running creation, or null. */
912
+ readonly creation: ForgeWorktreeCreation | null
913
+ /**
914
+ * The last failed attempt of the creation a message waits for, or null. It
915
+ * clears when another attempt starts, when the request changes or is
916
+ * withdrawn, and when the wait ends.
917
+ */
918
+ readonly failure: ForgeWorktreeFailure | null
919
+ /** The created worktree the Session works in when its directory is gone, or null. */
920
+ readonly missing: ForgeMissingWorktree | null
921
+ /** Running restoration of the removed worktree, or null. */
922
+ readonly restoration: ForgeWorktreeRestoration | null
923
+ /** What a message of the Session waits for before its turn starts, or null while none waits. */
924
+ readonly waiting: ForgeWorktreeWaiting | null
925
+ }
926
+ ```
927
+
928
+ ```ts type-equiv
929
+ /** One bound change request in the panel state. */
930
+ interface ForgePanelChangeRequest extends SessionChangeRequest {
931
+ /** Latest snapshot a poll returned, kept while later polls fail, or null before the first successful poll. */
932
+ readonly snapshot: ChangeRequestSnapshot | null
933
+ }
934
+ ```
935
+
936
+ ```ts type-equiv
937
+ /** Everything the panel shows for one Session. */
938
+ interface ForgePanelState {
939
+ /** Current working directory of the Session. */
940
+ readonly directory: string
941
+ /** Inspection result for `directory`. */
942
+ readonly checkout: ForgeCheckoutState
943
+ /** Code host repository of the checkout's upstream remote or `origin`, or null when no provider serves them. */
944
+ readonly repository: ForgeRepository | null
945
+ /** Sign-in state for the repository's host, or null before the first probe and without a repository. */
946
+ readonly readiness: ForgeReadiness | null
947
+ /** Visible change request bindings with their latest polling results, in first-recorded order. */
948
+ readonly changeRequests: readonly ForgePanelChangeRequest[]
949
+ /** Worktree request and creation state. */
950
+ readonly worktree: ForgePanelWorktree
951
+ /**
952
+ * Files the `branch` scope changes, or null before the first inspection,
953
+ * outside a checkout, and without a fork point.
954
+ */
955
+ readonly local: ForgeLocalChanges | null
956
+ }
957
+ ```
958
+
959
+ ```ts type-equiv
960
+ /** Local branches offered as the base of a new worktree. */
961
+ interface ForgeBranches {
962
+ /** Checked-out branch, or null when HEAD is detached. */
963
+ readonly current: string | null
964
+ /** Local branch names, `current` first and then most recently committed first, at most `maxBranches`. */
965
+ readonly branches: readonly string[]
966
+ }
967
+ ```
968
+
969
+ 会话列表经同一个 Remote 读取。`changeRequestStates` 以流的形式推送 `ForgeChangeRequestStatesFrame`:先是一个 `baseline`,包含调用方可读的已列出 Session 所绑定的每个变更请求最近一次已知的 `ForgeChangeRequestListState`,之后是发生变化的状态。宿主用一次运行服务所有流:已加载 Session 的绑定取自 `ctx.forgeSession`,其他 Session 的绑定取自缓存的 Session 摘要而不加载它们;每个已绑定的变更请求保持订阅,已关闭的按空闲间隔轮询以检测重新打开,每次变化都会存储,因此重启后在下次轮询之前就能显示最近已知的状态。Session 摘要还带有 `forgeWorktree` 投影的客户端视图:Session 的目录就是所创建的 worktree 或位于其下时为该 worktree,否则为 null。
970
+
971
+ ```ts type-equiv
972
+ /**
973
+ * The last polled state of one change request that a listed Session binds, as
974
+ * the Session list shows it.
975
+ */
976
+ type ForgeChangeRequestListState = Pick<
977
+ ChangeRequestSnapshot, 'url' | 'title' | 'state' | 'draft' | 'checksRollup' | 'reviewDecision' | 'mergeability'
978
+ > & {
979
+ /** Change request number on its code host. */
980
+ readonly number: number
981
+ }
982
+ ```
983
+
984
+ ```ts type-equiv
985
+ /**
986
+ * One frame of `forgePanel.changeRequestStates`: the known state of every
987
+ * change request the reader may see first, then the states that changed or
988
+ * became visible since the previous frame.
989
+ */
990
+ type ForgeChangeRequestStatesFrame =
991
+ | { readonly type: 'baseline'; readonly states: readonly ForgeChangeRequestListState[] }
992
+ | { readonly type: 'changed'; readonly states: readonly ForgeChangeRequestListState[] }
993
+ ```
994
+
995
+ 变更视图经同一个 Remote 读取。`localDiff` 读取 Session 检出的某个 `ForgeLocalScope`;`changeRequestDiff` 经提供方的 `diff` 读取已绑定变更请求在其最新状态 head 处的变更(提供方只返回描述该 head 提交的补丁),或经提供方的 `compare` 读取它指定的 `ForgeCommitRange`;两者返回的文件都已在宿主上解析为 `ForgeDiffFile` 的 hunk,并带有分层与改动摘要。`localCommits` 与 `changeRequestCommits` 列出范围可以指定的提交,提供方不读取提交时后者返回 null。`localText` 与 `changeRequestText` 读取一个文件的新版本,用来补出 hunk 之间未变更的行。每次检查还会把 `branch` 范围的规模统计为 `ForgePanelState.local`,供面板的变更卡片使用,始终以自动分叉点为准。`base` 指定了引用的 `branch` 范围改为与 HEAD 和该分支的合并基准比较;`diffBases` 列出视图可选的分支以及自动分叉点。head 已越过最新状态时,提供方返回 `stale`,`ctx.forge.diff` 立即重新轮询该变更请求(每个 head 提交一次);`changeRequestDiff` 以 `forgePanel/stale-head` 拒绝且不缓存任何内容,变更视图保持加载,直到更新的状态到达后按该状态的 head 重新读取。因此评审评论始终指向视图所显示行的那个提交。
996
+
997
+ `changeRequestReview(session, url, headSha, fresh)` 在视图所显示 diff 的 head 处读取已绑定变更请求的讨论;head 不同时以 `forgePanel/stale-head` 拒绝,提供方不支持读取讨论时返回 `forgePanel/review-unsupported`,其他失败返回 `forgePanel/review-failed`。每个变更请求在内存里保留一次读取结果,以 head 提交和状态的更新时间为键、受 `maxCachedReviewBytes` 约束,保留时间达到 `reviewRefreshMs` 后,或 `fresh` 要求时(读者刷新视图后的第一次读取就是这样)重新读取:在 GitHub 上,新评论和回复会改变 PR 的更新时间,解决讨论则不会。变更视图可见时,每收到一次状态就重新请求一次,并按[面板 README](../../packages/experimental/client-ui-forge/README.zh.md#use-this-package) 所述把讨论叠加到文件上。
998
+
999
+ `changeRequestViewed(session, url, headSha)` 在视图所示 diff 的 head 上读取已绑定变更请求的已审阅标记,提供方不保存标记时返回 null,head 不同时以 `forgePanel/stale-head` 拒绝,其他失败以 `forgePanel/viewed-failed` 拒绝;`setFileViewed` 在该 head 上保存一个文件的标记。`rerunChecks`、`requestReviews` 与 `updateBranch` 作用于已绑定的变更请求,托管平台未确认的结果以 `forgePanel/action-unknown` 拒绝,`reviewerCandidates` 列出可请求评审的账号,托管平台未列出时以 `forgePanel/reviewers-failed` 拒绝。变更视图随 diff 一起读取整个变更请求的标记,本地变更与所选提交的标记保存在浏览器中;两者以及提供这些操作的卡片行见[面板 README](../../packages/experimental/client-ui-forge/README.zh.md#use-this-package)。
1000
+
1001
+ `changeRequestReviewWrite(session, url, write)` 检查已绑定变更请求的一个 `ForgeReviewWrite` 的 head 提交、id、文字和行范围后,交给 `ctx.forge.writeReview`,并返回 `ForgeReviewWriteResult`。提供方给出答复后,无论结果如何,都会丢弃该变更请求保留的讨论,以及在此之前开始的所有读取,使下一次 `changeRequestReview` 从托管平台读取;`submitReview` 同样如此。变更视图一次只发送一个写操作,每个可能改变讨论的写操作之后都会重新读取讨论。
1002
+
1003
+ ```ts type-equiv
1004
+ /**
1005
+ * Consecutive commits a changes view shows instead of its whole comparison, named by full object names in the order
1006
+ * the commit list shows them, oldest first; the view shows the changes from the first commit's first parent to the last.
1007
+ */
1008
+ interface ForgeCommitRange {
1009
+ /** First, oldest commit shown. */
1010
+ readonly from: string
1011
+ /** Last, newest commit shown; equal to `from` for one commit. */
1012
+ readonly to: string
1013
+ }
1014
+ ```
1015
+
1016
+ ```ts type-equiv
1017
+ /** Which local changes a diff covers; each reads the Session's checkout through Git. */
1018
+ type ForgeLocalScope =
1019
+ /**
1020
+ * The working tree and untracked files against a fork point: the merge base of HEAD with the
1021
+ * `base` ref, or while `base` is null, the base commit of the worktree the Session created,
1022
+ * else the merge base of HEAD with the default branch of the code host remote. With `commits`, only the changes
1023
+ * of those commits between the fork point and HEAD, without uncommitted or untracked files.
1024
+ */
1025
+ | { readonly kind: 'branch'; readonly base: string | null; readonly commits: ForgeCommitRange | null }
1026
+ /** The working tree and untracked files against HEAD. */
1027
+ | { readonly kind: 'uncommitted' }
1028
+ /** The working tree and untracked files against the index. */
1029
+ | { readonly kind: 'unstaged' }
1030
+ /** The index against HEAD. */
1031
+ | { readonly kind: 'staged' }
1032
+ ```
1033
+
1034
+ ```ts type-equiv
1035
+ /** A branch the `branch` scope can compare with. */
1036
+ interface ForgeBaseBranch {
1037
+ /** Full ref name: `refs/heads/<branch>` or `refs/remotes/<remote>/<branch>`. */
1038
+ readonly ref: string
1039
+ /** The ref without `refs/heads/` or `refs/remotes/`, such as `master` or `origin/master`. */
1040
+ readonly name: string
1041
+ }
1042
+ ```
1043
+
1044
+ ```ts type-equiv
1045
+ /** What the `branch` scope compares with while no base branch is chosen. */
1046
+ interface ForgeAutomaticBase {
1047
+ /** The created worktree's base branch or abbreviated base commit, or the default branch of the code host remote. */
1048
+ readonly name: string
1049
+ /** Whether the fork point is the base commit of the worktree the Session created rather than a merge base. */
1050
+ readonly worktree: boolean
1051
+ }
1052
+ ```
1053
+
1054
+ ```ts type-equiv
1055
+ /** Branches the `branch` scope can compare with, whose names contain a query. */
1056
+ interface ForgeBaseBranches {
1057
+ /** The fork point used while no base branch is chosen, whatever the query; null without one. */
1058
+ readonly automatic: ForgeAutomaticBase | null
1059
+ /** Remote-tracking branches without symbolic refs such as `origin/HEAD`, most recently committed first, at most `maxBranches`. */
1060
+ readonly remote: readonly ForgeBaseBranch[]
1061
+ /** Local branches other than the checked-out one, most recently committed first, at most `maxBranches`. */
1062
+ readonly local: readonly ForgeBaseBranch[]
1063
+ }
1064
+ ```
1065
+
1066
+ ```ts type-equiv
1067
+ /** One hunk of a file diff. */
1068
+ interface ForgeDiffHunk {
1069
+ /** First old line the hunk covers, or the old line it comes before when it covers none. */
1070
+ readonly oldStart: number
1071
+ /** Old lines the hunk covers. */
1072
+ readonly oldLines: number
1073
+ /** First new line the hunk covers, or the new line it comes before when it covers none. */
1074
+ readonly newStart: number
1075
+ /** New lines the hunk covers. */
1076
+ readonly newLines: number
1077
+ /** Lines in patch form: a leading space for context, `+` for added, `-` for deleted, and `\` for a missing final newline. */
1078
+ readonly lines: readonly string[]
1079
+ }
1080
+ ```
1081
+
1082
+ ```ts type-equiv
1083
+ /** How one file changed. */
1084
+ type ForgeDiffStatus = 'added' | 'deleted' | 'modified' | 'renamed'
1085
+ ```
1086
+
1087
+ ```ts type-equiv
1088
+ /**
1089
+ * Review layer of a changed file: the layer the repository's root `.gitattributes` names with `dsh-review-layer`, else
1090
+ * `test` for a file it marks `linguist-generated`, else the first of `testPaths`, `interfacePaths`, and the built-in
1091
+ * test and interface rules that the path matches, else `implementation`.
1092
+ */
1093
+ type ForgeFileLayer = 'interface' | 'implementation' | 'test'
1094
+ ```
1095
+
1096
+ ```ts type-equiv
1097
+ /** One changed file of a diff. */
1098
+ interface ForgeDiffFile {
1099
+ /** Path relative to the repository root after the change, or before it for a deleted file. */
1100
+ readonly path: string
1101
+ /** Path before a rename, else null. */
1102
+ readonly previousPath: string | null
1103
+ /** How the file changed. */
1104
+ readonly status: ForgeDiffStatus
1105
+ /** Whether the content is binary, which carries no hunks. */
1106
+ readonly binary: boolean
1107
+ /** Whether an untracked file exceeds `maxDiffBytes`, so it carries no hunks. */
1108
+ readonly oversized: boolean
1109
+ /** Whether Git does not track the file yet; only local diffs list such files. */
1110
+ readonly untracked: boolean
1111
+ /** Lines added. */
1112
+ readonly additions: number
1113
+ /** Lines deleted. */
1114
+ readonly deletions: number
1115
+ /** Hunks in file order; none for a binary file or a change of mode or name only. */
1116
+ readonly hunks: readonly ForgeDiffHunk[]
1117
+ /** Review layer the path falls in. */
1118
+ readonly layer: ForgeFileLayer
1119
+ /**
1120
+ * Digest of the file's change: its paths, status, and hunks, plus the blob names of a binary change, or the content
1121
+ * of an untracked binary file. Equal digests describe the same change; reading the same comparison again keeps it.
1122
+ */
1123
+ readonly digest: string
1124
+ }
1125
+ ```
1126
+
1127
+ ```ts type-equiv
1128
+ /** Local changes of the Session's checkout in one scope. */
1129
+ interface ForgeLocalDiff {
1130
+ /** Ref or abbreviated commit the `branch` scope compares with, such as `origin/master`; null for other scopes. */
1131
+ readonly base: string | null
1132
+ /** Changed files in Git's path order, untracked files last. */
1133
+ readonly files: readonly ForgeDiffFile[]
1134
+ /** Untracked files left out beyond `maxUntrackedFiles`. */
1135
+ readonly omitted: number
1136
+ }
1137
+ ```
1138
+
1139
+ ```ts type-equiv
1140
+ /** Changes of a change request, or of consecutive commits of it, as its code host computes them. */
1141
+ interface ForgeChangeRequestDiff {
1142
+ /** Commit whose new side the diff describes: the head, or the last chosen commit. */
1143
+ readonly headSha: string
1144
+ /** Changed files in the host's order. */
1145
+ readonly files: readonly ForgeDiffFile[]
1146
+ /**
1147
+ * Commits the checkout's branch has beyond the head when that branch is the change request's head
1148
+ * branch and the head commit is present locally; null otherwise and for chosen commits.
1149
+ */
1150
+ readonly localAhead: number | null
1151
+ /** Web page of each changed file at `headSha`, by path. */
1152
+ readonly fileUrls: Readonly<Record<string, string>>
1153
+ }
1154
+ ```
1155
+
1156
+ ```ts type-equiv
1157
+ /** Commits of the `branch` scope at one HEAD commit, which the changes view can show one or several of. */
1158
+ interface ForgeLocalCommits {
1159
+ /** HEAD commit the list was read at. */
1160
+ readonly headSha: string
1161
+ /** Commits oldest first, ending with HEAD's commit. */
1162
+ readonly commits: readonly ForgeCommit[]
1163
+ /** Whether the branch has more commits than `maxCommits`; the listed ones are the newest. */
1164
+ readonly truncated: boolean
1165
+ }
1166
+ ```
1167
+
1168
+ ```ts type-equiv
1169
+ /** One file the `branch` scope changes, without its hunks. */
1170
+ interface ForgeChangedFile {
1171
+ /** Path relative to the repository root after the change. */
1172
+ readonly path: string
1173
+ /** Lines added, or 0 for a binary file. */
1174
+ readonly additions: number
1175
+ /** Lines deleted, or 0 for a binary file. */
1176
+ readonly deletions: number
1177
+ /** Whether the content is binary. */
1178
+ readonly binary: boolean
1179
+ }
1180
+ ```
1181
+
1182
+ ```ts type-equiv
1183
+ /** Size of the `branch` scope, which the panel's local changes card shows. */
1184
+ interface ForgeLocalChanges {
1185
+ /** Ref or abbreviated commit the scope compares with. */
1186
+ readonly base: string
1187
+ /** Changed files in Git's path order, untracked files last, at most `maxUntrackedFiles` of those. */
1188
+ readonly files: readonly ForgeChangedFile[]
1189
+ }
1190
+ ```
1191
+
1192
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
1193
+
1194
+ <a id="cordis-surface"></a>
1195
+
1196
+ ## Cordis API
1197
+
1198
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
1199
+
1200
+ <a id="ctxforge--forgeservice"></a>
1201
+
1202
+ ### `ctx.forge` — `ForgeService`
1203
+
1204
+ Registry of forge providers. Watchers of one change request share a single polling loop; each forge has at most one fetch in flight, which batches every due change request of that forge.
1205
+
1206
+ ```ts cordis-catalog
1207
+ /**
1208
+ * Register the provider of one forge family as an effect on the calling
1209
+ * fiber. Watches of that forge receive an `unavailable` failure when the
1210
+ * registration ends. Unregistering cancels and awaits its in-flight calls;
1211
+ * results from the withdrawn registration are discarded.
1212
+ * @param provider - provider to serve `provider.forge`.
1213
+ * @returns the disposer that unregisters the provider and waits for its calls to finish.
1214
+ * @throws when another provider already serves the same forge.
1215
+ */
1216
+ register(provider: ForgeProvider): () => Promise<void>
1217
+
1218
+ /**
1219
+ * Map a Git remote URL to a repository through the first provider that serves it.
1220
+ * @param url - fetch or push URL as Git reports it.
1221
+ * @returns the repository, or undefined when no provider serves the URL.
1222
+ */
1223
+ repositoryFromRemote(url: string): ForgeRepository | undefined
1224
+
1225
+ /**
1226
+ * Map a change request web URL through the first provider that serves it.
1227
+ * @param url - web URL of a pull or merge request.
1228
+ * @returns the change request, or undefined when no provider serves the URL.
1229
+ */
1230
+ changeRequestFromUrl(url: string): ChangeRequestRef | undefined
1231
+
1232
+ /**
1233
+ * Build the canonical web URL of a change request.
1234
+ * @param ref - change request served by a registered provider.
1235
+ * @returns the provider's canonical URL.
1236
+ * @throws when no provider serves the change request's forge.
1237
+ */
1238
+ changeRequestUrl(ref: ChangeRequestRef): string
1239
+
1240
+ /**
1241
+ * Find open change requests whose head is `branch`, excluding the default branch and forks.
1242
+ * @param repository - repository served by a registered provider.
1243
+ * @param branch - head branch name on the host.
1244
+ * @param signal - cancellation for the lookup.
1245
+ * @returns matching change requests, newest first as the provider reports them.
1246
+ * @throws when no provider serves the repository's forge or the lookup fails.
1247
+ */
1248
+ async findByHead(repository: ForgeRepository, branch: string, signal: AbortSignal): Promise<readonly ChangeRequestRef[]>
1249
+
1250
+ /**
1251
+ * Report whether the provider can reach the repository's host with current credentials.
1252
+ * @param repository - repository served by a registered provider.
1253
+ * @param signal - cancellation for the probe.
1254
+ * @returns the provider's readiness for the host.
1255
+ * @throws when no provider serves the repository's forge.
1256
+ */
1257
+ async readiness(repository: ForgeRepository, signal: AbortSignal): Promise<ForgeReadiness>
1258
+
1259
+ /**
1260
+ * Mark a draft change request ready for review, then poll it at once when it is watched.
1261
+ * @param ref - change request served by a registered provider.
1262
+ * @param signal - cancellation of the request.
1263
+ * @returns undefined once the host accepted the change, or why it did not.
1264
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1265
+ */
1266
+ async markReady(ref: ChangeRequestRef, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
1267
+
1268
+ /**
1269
+ * Merge a change request while its head is still `request.headSha`, then
1270
+ * poll it at once when it is watched.
1271
+ * @param ref - change request served by a registered provider.
1272
+ * @param request - merge method and the head commit the user confirmed.
1273
+ * @param signal - cancellation of the request.
1274
+ * @returns undefined once the host merged it, or why it did not.
1275
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1276
+ */
1277
+ async merge(ref: ChangeRequestRef, request: MergeRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
1278
+
1279
+ /**
1280
+ * Rerun the failed checks of a change request's head commit while the head is still `request.headSha`, then poll it
1281
+ * at once when it is watched.
1282
+ * @param ref - change request served by a registered provider.
1283
+ * @param request - the head commit whose checks the user saw.
1284
+ * @param signal - cancellation of the request.
1285
+ * @returns undefined once the host accepted the rerun, or why it did not; a provider that reruns no checks fails.
1286
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1287
+ */
1288
+ async rerunChecks(ref: ChangeRequestRef, request: ForgeRerunRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
1289
+
1290
+ /**
1291
+ * Request reviews of a change request from more reviewers, then poll it at once when it is watched.
1292
+ * @param ref - change request served by a registered provider.
1293
+ * @param request - the reviewers to ask.
1294
+ * @param signal - cancellation of the request.
1295
+ * @returns undefined once the host accepted the request, or why it did not; a provider that requests no reviews fails.
1296
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1297
+ */
1298
+ async requestReviews( ref: ChangeRequestRef, request: ForgeReviewersRequest, signal: AbortSignal, ): Promise<ForgeActionFailure | undefined>
1299
+
1300
+ /**
1301
+ * List accounts a review of a change request can be requested from.
1302
+ * @param ref - change request served by a registered provider.
1303
+ * @param query - text the login or name contains; empty for the host's suggestions and first accounts.
1304
+ * @param signal - cancellation of the read.
1305
+ * @returns the accounts, the host's suggestions first, or why the host did not list them; a provider that requests no
1306
+ * reviews returns `unsupported`.
1307
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1308
+ */
1309
+ async reviewerCandidates( ref: ChangeRequestRef, query: string, signal: AbortSignal, ): Promise<readonly ForgeReviewerCandidate[] | ForgeFailure>
1310
+
1311
+ /**
1312
+ * Bring the base branch's new commits into a change request's head branch while its head is still
1313
+ * `request.headSha`, then poll it at once when it is watched.
1314
+ * @param ref - change request served by a registered provider.
1315
+ * @param request - update method and the head commit the user confirmed.
1316
+ * @param signal - cancellation of the request.
1317
+ * @returns undefined once the host accepted the update, or why it did not; a provider that updates no branches fails.
1318
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1319
+ */
1320
+ async updateBranch(ref: ChangeRequestRef, request: BranchUpdateRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
1321
+
1322
+ /**
1323
+ * Read complete check details independently of periodic polling.
1324
+ * @param ref - change request served by a registered provider.
1325
+ * @param signal - cancellation of the detail view.
1326
+ * @returns a complete snapshot or the provider's failure; unsupported providers return unavailable.
1327
+ * @throws on cancellation, provider disposal, or expiry of this read's own `fetchTimeoutMs` deadline.
1328
+ */
1329
+ async fetchChecks(ref: ChangeRequestRef, signal: AbortSignal): Promise<ChangeRequestSnapshot | ForgeFailure>
1330
+
1331
+ /**
1332
+ * Read the changes of a change request at one head commit as its host
1333
+ * computes them. The first `stale` failure at a head commit polls a watched
1334
+ * change request again at once, so its next status names the current head;
1335
+ * later stale reads at the same commit wait for the regular poll, which
1336
+ * bounds the reads while the host's answers disagree. When the latest status of a watched change request names
1337
+ * `headSha`, its `baseSha` goes to the provider, which may then read the patch while it confirms the head.
1338
+ * @param ref - change request served by a registered provider.
1339
+ * @param headSha - head commit the patch must describe, usually the head of the latest status.
1340
+ * @param signal - cancellation of the read.
1341
+ * @returns one unified patch with `a/` and `b/` path prefixes, or why the host did not provide it at `headSha`.
1342
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1343
+ */
1344
+ async diff(ref: ChangeRequestRef, headSha: string, signal: AbortSignal): Promise<string | ForgeFailure>
1345
+
1346
+ /**
1347
+ * Read the review threads of a change request at one head commit. A
1348
+ * `stale` failure polls a watched change request again as {@link ForgeService.diff} does.
1349
+ * @param ref - change request served by a registered provider.
1350
+ * @param headSha - head commit the threads must be read at, usually the head of the displayed diff.
1351
+ * @param signal - cancellation of the read.
1352
+ * @returns the threads read at `headSha`, or why the host did not provide them; `unsupported` when the provider cannot read reviews.
1353
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1354
+ */
1355
+ async readReview(ref: ChangeRequestRef, headSha: string, signal: AbortSignal): Promise<ForgeReviewData | ForgeFailure>
1356
+
1357
+ /**
1358
+ * Write to the review threads or the pending review of a change request while its head is still `write.headSha`, then
1359
+ * poll the change request at once when it is watched, unless the provider cannot write reviews. A `stale` result polls
1360
+ * it as a stale read does.
1361
+ * @param ref - change request served by a registered provider.
1362
+ * @param write - the write and the head commit the user saw.
1363
+ * @param signal - cancellation of the write.
1364
+ * @returns whether the host took the write; `unsupported` when the provider cannot write reviews, and `unknown` when the
1365
+ * outcome must be checked on the host before the write is tried again.
1366
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1367
+ */
1368
+ async writeReview(ref: ChangeRequestRef, write: ForgeReviewWrite, signal: AbortSignal): Promise<ForgeReviewWriteResult>
1369
+
1370
+ /**
1371
+ * Read the signed-in user's viewed marks on the files of a change request at one head commit. A `stale` failure
1372
+ * polls a watched change request again as {@link ForgeService.diff} does.
1373
+ * @param ref - change request served by a registered provider.
1374
+ * @param headSha - head commit the marks must be read at, usually the head of the displayed diff.
1375
+ * @param signal - cancellation of the read.
1376
+ * @returns the marks read at `headSha`, why the host did not provide them, or undefined when the provider keeps no
1377
+ * viewed marks.
1378
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1379
+ */
1380
+ async viewedFiles(ref: ChangeRequestRef, headSha: string, signal: AbortSignal): Promise<ForgeViewedFiles | ForgeFailure | undefined>
1381
+
1382
+ /**
1383
+ * Set or clear the signed-in user's viewed mark on one file of a change request while its head is still
1384
+ * `request.headSha`. A `stale` failure polls a watched change request again as {@link ForgeService.diff} does.
1385
+ * @param ref - change request served by a registered provider.
1386
+ * @param request - the file, its mark, and the head commit the user saw.
1387
+ * @param signal - cancellation of the request.
1388
+ * @returns undefined once the host saved the mark, or why it did not; a provider that keeps no viewed marks fails.
1389
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1390
+ */
1391
+ async setViewed(ref: ChangeRequestRef, request: ForgeViewedRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>
1392
+
1393
+ /**
1394
+ * List the commits of a change request at its current head.
1395
+ * @param ref - change request served by a registered provider.
1396
+ * @param signal - cancellation of the read.
1397
+ * @returns the commits, why the host did not provide them, or undefined when the provider does not read commits.
1398
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1399
+ */
1400
+ async commits(ref: ChangeRequestRef, signal: AbortSignal): Promise<ForgeCommitList | ForgeFailure | undefined>
1401
+
1402
+ /**
1403
+ * Read the changes between two commits of a change request's repository.
1404
+ * @param ref - change request served by a registered provider.
1405
+ * @param base - full object name of the commit compared from.
1406
+ * @param head - full object name of a commit that descends from `base`.
1407
+ * @param signal - cancellation of the read.
1408
+ * @returns one unified patch with `a/` and `b/` path prefixes, or why the host did not provide it; a provider that
1409
+ * does not read commits returns `unavailable`.
1410
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1411
+ */
1412
+ async compare(ref: ChangeRequestRef, base: string, head: string, signal: AbortSignal): Promise<string | ForgeFailure>
1413
+
1414
+ /**
1415
+ * Publish one comment or a completed review, then refresh the watched status.
1416
+ * @param ref - change request served by a registered provider.
1417
+ * @param request - explicitly selected commit, comments, and review decision.
1418
+ * @param signal - request cancellation.
1419
+ * @returns a publication URL or a failure, including an unknown write outcome.
1420
+ */
1421
+ async submitReview(ref: ChangeRequestRef, request: ForgeReviewRequest, signal: AbortSignal): Promise<ForgeReviewResult>
1422
+
1423
+ /**
1424
+ * Read the text of one file at a commit of a change request's repository.
1425
+ * @param ref - change request served by a registered provider.
1426
+ * @param commit - commit object name.
1427
+ * @param path - path relative to the repository root.
1428
+ * @param signal - cancellation of the read.
1429
+ * @returns the text, or why the host did not provide it.
1430
+ * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts.
1431
+ */
1432
+ async fileText(ref: ChangeRequestRef, commit: string, path: string, signal: AbortSignal): Promise<string | ForgeFailure>
1433
+
1434
+ /**
1435
+ * Build the web page of one file at a commit of a change request's repository.
1436
+ * @param ref - change request served by a registered provider.
1437
+ * @param commit - commit object name.
1438
+ * @param path - path relative to the repository root.
1439
+ * @returns the provider's URL.
1440
+ * @throws when no provider serves the change request's forge.
1441
+ */
1442
+ fileUrl(ref: ChangeRequestRef, commit: string, path: string): string
1443
+
1444
+ /**
1445
+ * Watch one change request as an effect on the calling fiber. The first
1446
+ * watcher starts polling at once; listeners receive every later result,
1447
+ * and `latest` returns the current one. Polling stops when the last watcher
1448
+ * leaves. Listeners must not throw; a thrown error is logged and skipped.
1449
+ * @param ref - change request to poll.
1450
+ * @param listener - receives each polling result.
1451
+ * @returns the disposer that stops this watch.
1452
+ */
1453
+ watch(ref: ChangeRequestRef, listener: ChangeRequestListener): () => void
1454
+
1455
+ /**
1456
+ * Poll a watched change request at once, including after a terminal state.
1457
+ * A fetch already in flight is followed immediately by another fetch; an
1458
+ * unwatched change request is unchanged.
1459
+ * @param ref - change request to poll.
1460
+ */
1461
+ refresh(ref: ChangeRequestRef): void
1462
+
1463
+ /**
1464
+ * Read the latest polling result of a watched change request.
1465
+ * @param ref - change request to read.
1466
+ * @returns the latest result, or undefined before the first result or without a watch.
1467
+ */
1468
+ latest(ref: ChangeRequestRef): ChangeRequestUpdate | undefined
1469
+ ```
1470
+
1471
+ Source: [`packages/experimental/forge/src/index.ts`](../../packages/experimental/forge/src/index.ts)
1472
+
1473
+ <a id="ctxforgepanel--forgepanelcontroller"></a>
1474
+
1475
+ ### `ctx.forgePanel` — `ForgePanelController`
1476
+
1477
+ Serves the forge panel. Following a Session inspects the checkout of its current directory using the Session's permissions and execution world, recognizes the code host of the upstream remote or `origin`, probes sign-in for that host, and polls the Session's bound change requests through `ctx.forge` until the last follower of that Session leaves. A worktree request makes the panel create a branch and checkout through an optional `ctx.worktrees` and enter it while the Session's first message waits in the inbox, or at the first step proposal of a message no wait took. After a failed or stopped attempt the message keeps waiting for another attempt or for the request to be withdrawn. A message also waits while the worktree the Session works in is gone, until that worktree is checked out again or left for the source checkout. Changes to a Session's checkout run as Agent maintenance, so a message that arrives meanwhile waits for them.
1478
+
1479
+ ```ts cordis-catalog
1480
+ /**
1481
+ * Stream the panel state of a Session: the current state first, then each
1482
+ * later state. Intermediate states may be skipped when the reader is slower
1483
+ * than the updates. The stream ends when `signal` aborts or the Remote stops.
1484
+ * @param session - Session to follow.
1485
+ * @param signal - ends the stream.
1486
+ * @returns panel states in publication order.
1487
+ */
1488
+ @Remote({ mode: 'stream' }) async *follow(session: Session, signal: AbortSignal): AsyncIterable<ForgePanelState>
1489
+
1490
+ /**
1491
+ * Stream the last known state of every change request that a listed
1492
+ * Session the caller may read binds: the stored states first, then each
1493
+ * state a poll changes or a new binding reveals. Listing reads no Session
1494
+ * log: loaded Sessions report their bindings, others the cached Session
1495
+ * summary, and a Session without one shows nothing until it is opened.
1496
+ * Closed requests are polled at the idle cadence so reopening is observed. The
1497
+ * stream ends when `signal` aborts or the Remote stops.
1498
+ * @param signal - ends the stream.
1499
+ * @returns frames in publication order.
1500
+ * @throws when the Host lacks the Session query, projection cache, storage, or Session store service.
1501
+ */
1502
+ @Remote({ mode: 'stream' }) async *changeRequestStates(signal: AbortSignal): AsyncIterable<ForgeChangeRequestStatesFrame>
1503
+
1504
+ /**
1505
+ * Read or await the worktree service's archive cleanup of the Session's checkout.
1506
+ * @param session - Session whose cleanup is visible to the caller.
1507
+ * @param revision - null reads now; a matching revision waits for completion.
1508
+ * @returns the cleanup state, or null without a worktree service, an attempt, or a current revision.
1509
+ */
1510
+ @Remote async worktreeCleanup(session: Session, revision: number | null): Promise<WorktreeCleanup | null>
1511
+
1512
+ /**
1513
+ * List the local branches that can start a worktree of the Session's current checkout.
1514
+ * @param session - Session whose current directory is listed.
1515
+ * @param signal - request cancellation.
1516
+ * @returns the checked-out branch and at most `maxBranches` local branches, the checked-out one first.
1517
+ * @throws when the current directory is not inside a checkout or Git fails.
1518
+ */
1519
+ @Remote async branches(session: Session, signal: AbortSignal): Promise<ForgeBranches>
1520
+
1521
+ /**
1522
+ * List the branches the `branch` scope of the Session's current checkout can compare with.
1523
+ * @param session - Session whose checkout is read.
1524
+ * @param query - text the branch names must contain, ignoring case; empty for every branch.
1525
+ * @param signal - request cancellation.
1526
+ * @returns the automatic fork point and at most `maxBranches` remote-tracking and local branches each,
1527
+ * most recently committed first, without the checked-out branch.
1528
+ * @throws `forgePanel/not-a-checkout` outside a checkout; the Git error when Git fails or the listed refs exceed `maxDiffBytes`.
1529
+ */
1530
+ @Remote async diffBases(session: Session, query: string, signal: AbortSignal): Promise<ForgeBaseBranches>
1531
+
1532
+ /**
1533
+ * Bind a change request to a Session by URL, or restore a dismissed binding.
1534
+ * @param session - Session that receives the binding.
1535
+ * @param url - web URL of the change request.
1536
+ * @param signal - request cancellation.
1537
+ * @throws `forgePanel/unrecognized-url` when no registered provider serves the URL.
1538
+ */
1539
+ @Remote async track(session: Session, url: string, signal: AbortSignal): Promise<void>
1540
+
1541
+ /**
1542
+ * Hide a visible binding of a Session; other URLs leave the Session unchanged.
1543
+ * @param session - Session that owns the binding.
1544
+ * @param url - web URL of the change request.
1545
+ * @param signal - request cancellation.
1546
+ */
1547
+ @Remote async dismiss(session: Session, url: string, signal: AbortSignal): Promise<void>
1548
+
1549
+ /**
1550
+ * Reinspect a followed Session's checkout, probe sign-in again, and poll its
1551
+ * change requests at once; an unfollowed Session is unchanged.
1552
+ * @param session - Session whose panel refreshes.
1553
+ * @param signal - request cancellation.
1554
+ * @returns settles once the inspection and the sign-in probe have ended; poll results reach the panel stream later.
1555
+ */
1556
+ @Remote async refresh(session: Session, signal: AbortSignal): Promise<void>
1557
+
1558
+ /**
1559
+ * Read the changes one scope covers in the checkout of the Session's
1560
+ * current directory, with Git using the Session's sandbox policy.
1561
+ * @param session - Session whose checkout is read.
1562
+ * @param scope - which changes to read.
1563
+ * @param signal - request cancellation.
1564
+ * @returns the files, the base of the `branch` scope, and the untracked files left out.
1565
+ * @throws `forgePanel/not-a-checkout` outside a checkout; `forgePanel/base-missing` when the base branch
1566
+ * chosen for the `branch` scope does not exist; `forgePanel/no-fork-point` for the `branch` scope without
1567
+ * a fork point; `forgePanel/commits-missing` when chosen commits are not between the fork point and HEAD in order;
1568
+ * `forgePanel/commits-not-linear` when a chosen commit's first parent is not the commit listed before it;
1569
+ * `forgePanel/filter-config-failed` when filter configuration cannot be read completely, before
1570
+ * any comparison; `forgePanel/diff-too-large` over `maxDiffBytes`; the Git error when Git fails.
1571
+ */
1572
+ @Remote async localDiff(session: Session, scope: ForgeLocalScope, signal: AbortSignal): Promise<ForgeLocalDiff>
1573
+
1574
+ /**
1575
+ * List the commits of the `branch` scope of the Session's current checkout, which the changes view can show one or
1576
+ * several of instead of the whole scope.
1577
+ * @param session - Session whose checkout is read.
1578
+ * @param base - the base ref of the `branch` scope, or null for its automatic fork point.
1579
+ * @param signal - request cancellation.
1580
+ * @returns the newest `maxCommits` commits between the fork point and HEAD, oldest first, and HEAD's commit.
1581
+ * @throws `forgePanel/not-a-checkout` outside a checkout; `forgePanel/base-missing` when the base branch does not
1582
+ * exist; `forgePanel/no-fork-point` without a fork point; the Git error when Git fails or the listing exceeds `maxDiffBytes`.
1583
+ */
1584
+ @Remote async localCommits(session: Session, base: string | null, signal: AbortSignal): Promise<ForgeLocalCommits>
1585
+
1586
+ /**
1587
+ * Read the new side of one changed file in a scope, which supplies the
1588
+ * unchanged lines between its hunks: the index for `staged`, the last chosen commit for chosen commits of
1589
+ * the `branch` scope, else the working tree.
1590
+ * @param session - Session whose checkout is read.
1591
+ * @param scope - the scope the diff was read in.
1592
+ * @param path - path relative to the checkout's top-level directory, as the diff names it.
1593
+ * @param signal - request cancellation.
1594
+ * @returns the text.
1595
+ * @throws `forgePanel/not-a-checkout` outside a checkout; `forgePanel/diff-too-large` over `maxDiffBytes`;
1596
+ * `forgePanel/commits-missing` for a chosen commit that is not a full object name; an error for a path outside
1597
+ * the checkout, binary content, or a failed read.
1598
+ */
1599
+ @Remote async localText(session: Session, scope: ForgeLocalScope, path: string, signal: AbortSignal): Promise<string>
1600
+
1601
+ /**
1602
+ * Load complete checks for the change request whose list the user opened.
1603
+ * @param session - Session retaining the visible binding.
1604
+ * @param url - binding URL.
1605
+ * @param headSha - commit displayed by the card; a different head rejects the result.
1606
+ * @param signal - cancellation when the list closes.
1607
+ * @returns the complete snapshot at the displayed head.
1608
+ * @throws `forgePanel/not-bound` for an invisible binding, `forgePanel/stale-head` for a moved head,
1609
+ * or `forgePanel/checks-failed` when the provider cannot complete the read.
1610
+ */
1611
+ @Remote async changeRequestChecks(session: Session, url: string, headSha: string, signal: AbortSignal): Promise<ChangeRequestSnapshot>
1612
+
1613
+ /**
1614
+ * List the commits of a change request of a Session at its current head, which the changes view can show one or
1615
+ * several of instead of the whole change request.
1616
+ * @param session - Session the change request is bound to.
1617
+ * @param url - binding URL of the change request.
1618
+ * @param signal - request cancellation.
1619
+ * @returns the commits oldest first with the head they were read at, or null when the provider does not read commits.
1620
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1621
+ * `forgePanel/diff-failed` when the host does not list them.
1622
+ */
1623
+ @Remote async changeRequestCommits(session: Session, url: string, signal: AbortSignal): Promise<ForgeCommitList | null>
1624
+
1625
+ /**
1626
+ * Read the changes of a change request of a Session as its code host
1627
+ * computes them, with each file's layer following the root `.gitattributes`
1628
+ * of the commit the diff ends at. Without `commits` the diff covers the change
1629
+ * request at the head commit of its latest status; a patch already read at the
1630
+ * same head commit and base branch is reused from memory with its attributes, for
1631
+ * any Session, until `maxCachedDiffBytes` evicts it. With `commits`, it covers those
1632
+ * commits, from the first one's first parent to the last, and is read every time.
1633
+ * @param session - Session the change request is bound to.
1634
+ * @param url - binding URL of the change request.
1635
+ * @param commits - consecutive commits of the change request, or null for all of it.
1636
+ * @param signal - request cancellation.
1637
+ * @returns the files, the commit they end at, each file's web page, and the commits the checkout has beyond the head.
1638
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1639
+ * `forgePanel/commits-missing` when chosen commits are not among the change request's commits in order;
1640
+ * `forgePanel/commits-not-linear` when a chosen commit's first parent is not the commit listed before it;
1641
+ * `forgePanel/stale-head` without `commits` when the head moved past the latest status, which is then polled again;
1642
+ * `forgePanel/diff-too-large` when the host or its provider refuses the diff over a size limit;
1643
+ * `forgePanel/diff-failed` before its status was read, for a first chosen commit without a parent, and when the host
1644
+ * does not provide the commits, the diff, or an existing `.gitattributes` otherwise.
1645
+ */
1646
+ @Remote async changeRequestDiff( session: Session, url: string, commits: ForgeCommitRange | null, signal: AbortSignal, ): Promise<ForgeChangeRequestDiff>
1647
+
1648
+ /**
1649
+ * Read one file of a change request's repository at a commit, which
1650
+ * supplies the unchanged lines between the hunks of its diff.
1651
+ * @param session - Session the change request is bound to.
1652
+ * @param url - binding URL of the change request.
1653
+ * @param commit - commit object name, the head commit of the diff.
1654
+ * @param path - path relative to the repository root.
1655
+ * @param signal - request cancellation.
1656
+ * @returns the text.
1657
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1658
+ * `forgePanel/diff-too-large` when the host or its provider refuses the file over a size limit;
1659
+ * `forgePanel/diff-failed` when the host does not provide the file otherwise.
1660
+ */
1661
+ @Remote async changeRequestText(session: Session, url: string, commit: string, path: string, signal: AbortSignal): Promise<string>
1662
+
1663
+ /**
1664
+ * Read the signed-in user's viewed marks on the files of a change request of a Session, which the host keeps for the
1665
+ * whole change request.
1666
+ * @param session - Session the change request is bound to.
1667
+ * @param url - binding URL of the change request.
1668
+ * @param headSha - head commit of the shown diff; marks read at another head are refused.
1669
+ * @param signal - request cancellation.
1670
+ * @returns the marks at `headSha`, or null when the provider keeps no viewed marks.
1671
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1672
+ * `forgePanel/stale-head` when the head moved past `headSha`, which is then polled again; `forgePanel/viewed-failed`
1673
+ * when the host does not provide the marks otherwise.
1674
+ */
1675
+ @Remote async changeRequestViewed(session: Session, url: string, headSha: string, signal: AbortSignal): Promise<ForgeViewedFiles | null>
1676
+
1677
+ /**
1678
+ * Set or clear the signed-in user's viewed mark on one file of a change request of a Session.
1679
+ * @param session - Session the change request is bound to.
1680
+ * @param url - binding URL of the change request.
1681
+ * @param request - the file, its mark, and the head commit of the shown diff.
1682
+ * @param signal - request cancellation.
1683
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1684
+ * `forgePanel/stale-head` when the head moved past `request.headSha`; `forgePanel/action-failed` with the host's
1685
+ * reason when the host refuses, cannot be reached, or keeps no viewed marks; `forgePanel/action-unknown` when the host
1686
+ * did not confirm whether it saved the mark.
1687
+ */
1688
+ @Remote async setFileViewed(session: Session, url: string, request: ForgeViewedRequest, signal: AbortSignal): Promise<void>
1689
+
1690
+ /**
1691
+ * Read the review threads of a change request of a Session at the head commit of its displayed diff. Threads read
1692
+ * at the same head commit and update time are reused from memory, for any Session, until they are
1693
+ * `reviewRefreshMs` old, `maxCachedReviewBytes` evicts them, or a review write through this panel drops them; a read
1694
+ * again after that age, or a `fresh` read, shows threads resolved elsewhere since, which do not change a GitHub pull
1695
+ * request's update time.
1696
+ * @param session - Session the change request is bound to.
1697
+ * @param url - binding URL of the change request.
1698
+ * @param headSha - head commit of the displayed diff.
1699
+ * @param fresh - whether to read from the host even when threads at this head and update time are kept, as after the
1700
+ * reader refreshes the view; the result replaces the kept threads.
1701
+ * @param signal - request cancellation.
1702
+ * @returns the threads at `headSha`, with `current` positions numbering the files of that diff.
1703
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1704
+ * `forgePanel/stale-head` when the latest status or the host names another head, which a host answer polls again;
1705
+ * `forgePanel/review-unsupported` when the provider cannot read reviews; `forgePanel/review-failed` before the
1706
+ * status was read and when the host does not provide the threads otherwise.
1707
+ */
1708
+ @Remote async changeRequestReview(session: Session, url: string, headSha: string, fresh: boolean, signal: AbortSignal): Promise<ForgeReviewData>
1709
+
1710
+ /**
1711
+ * Publish a line comment or completed review for a visible Session binding. The threads kept for the change request
1712
+ * are dropped once the host answers, so the next read shows the comments.
1713
+ * @param session - Session retaining the change request.
1714
+ * @param url - visible binding URL.
1715
+ * @param request - reviewed head, ranges, plain text, and explicit review decision.
1716
+ * @param signal - request cancellation.
1717
+ * @returns confirmed publication or a typed failure; unknown outcomes require reconciliation on the host.
1718
+ */
1719
+ @Remote async submitReview(session: Session, url: string, request: ForgeReviewRequest, signal: AbortSignal): Promise<ForgeReviewResult>
1720
+
1721
+ /**
1722
+ * Write to the review threads or the pending review of a change request of a Session while its head is still the
1723
+ * head the user saw. The threads kept for the change request are dropped once the host answers, so the next read
1724
+ * shows the write, which a resolve does not show through a GitHub pull request's update time.
1725
+ * @param session - Session the change request is bound to.
1726
+ * @param url - binding URL of the change request.
1727
+ * @param write - the write and the head commit of the threads the user saw.
1728
+ * @param signal - request cancellation.
1729
+ * @returns whether the host took the write; `stale` once the head moved, which polls the change request again, and
1730
+ * `unknown` when the outcome must be checked on the host before the write is tried again.
1731
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves; an error
1732
+ * for a write without text, a head that is not a commit object name, or an invalid line range.
1733
+ */
1734
+ @Remote async changeRequestReviewWrite( session: Session, url: string, write: ForgeReviewWrite, signal: AbortSignal, ): Promise<ForgeReviewWriteResult>
1735
+
1736
+ /**
1737
+ * Mark a draft change request of a Session ready for review; the change
1738
+ * request is polled again once the host answers.
1739
+ * @param session - Session the change request is bound to.
1740
+ * @param url - binding URL of the change request.
1741
+ * @param signal - request cancellation.
1742
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1743
+ * `forgePanel/action-failed` with the host's reason when the host refuses or cannot be reached.
1744
+ */
1745
+ @Remote async markReady(session: Session, url: string, signal: AbortSignal): Promise<void>
1746
+
1747
+ /**
1748
+ * Merge a change request of a Session while its head is still `headSha`;
1749
+ * the change request is polled again once the host answers.
1750
+ * @param session - Session the change request is bound to.
1751
+ * @param url - binding URL of the change request.
1752
+ * @param method - how the commits enter the base branch.
1753
+ * @param headSha - head commit the user confirmed.
1754
+ * @param signal - request cancellation.
1755
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1756
+ * `forgePanel/stale-head` when the head moved past `headSha`; `forgePanel/action-failed` with the host's
1757
+ * reason when the host refuses otherwise or cannot be reached.
1758
+ */
1759
+ @Remote async merge(session: Session, url: string, method: MergeMethod, headSha: string, signal: AbortSignal): Promise<void>
1760
+
1761
+ /**
1762
+ * Rerun the failed checks of a change request of a Session while its head is still the commit whose checks the user
1763
+ * saw; the change request is polled again once the host answers.
1764
+ * @param session - Session the change request is bound to.
1765
+ * @param url - binding URL of the change request.
1766
+ * @param request - the head commit whose checks the user saw.
1767
+ * @param signal - request cancellation.
1768
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1769
+ * `forgePanel/stale-head` when the head moved past `request.headSha`; `forgePanel/action-failed` with the host's
1770
+ * reason when the host refuses, cannot be reached, or reruns no checks; `forgePanel/action-unknown` when the host did
1771
+ * not confirm whether it started the rerun.
1772
+ */
1773
+ @Remote async rerunChecks(session: Session, url: string, request: ForgeRerunRequest, signal: AbortSignal): Promise<void>
1774
+
1775
+ /**
1776
+ * Request reviews of a change request of a Session from more reviewers; the change request is polled again once the
1777
+ * host answers.
1778
+ * @param session - Session the change request is bound to.
1779
+ * @param url - binding URL of the change request.
1780
+ * @param reviewers - the reviewers to ask, by kind and login.
1781
+ * @param signal - request cancellation.
1782
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1783
+ * `forgePanel/action-failed` with the host's reason when the host refuses, cannot be reached, or requests no reviews;
1784
+ * `forgePanel/action-unknown` when the host did not confirm whether it requested the reviews.
1785
+ */
1786
+ @Remote async requestReviews( session: Session, url: string, reviewers: readonly Pick<ChangeRequestReviewer, 'kind' | 'login'>[], signal: AbortSignal, ): Promise<void>
1787
+
1788
+ /**
1789
+ * List accounts a review of a change request of a Session can be requested from.
1790
+ * @param session - Session the change request is bound to.
1791
+ * @param url - binding URL of the change request.
1792
+ * @param query - text the login or name contains; empty for the host's suggestions and first accounts.
1793
+ * @param signal - request cancellation.
1794
+ * @returns the accounts, the host's suggestions first.
1795
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1796
+ * `forgePanel/reviewers-failed` when the host does not list them.
1797
+ */
1798
+ @Remote async reviewerCandidates(session: Session, url: string, query: string, signal: AbortSignal): Promise<readonly ForgeReviewerCandidate[]>
1799
+
1800
+ /**
1801
+ * Bring the base branch's new commits into the head branch of a change request of a Session while its head is still
1802
+ * `headSha`; the change request is polled again once the host answers.
1803
+ * @param session - Session the change request is bound to.
1804
+ * @param url - binding URL of the change request.
1805
+ * @param method - merge commit or rebase.
1806
+ * @param headSha - head commit the user confirmed.
1807
+ * @param signal - request cancellation.
1808
+ * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves;
1809
+ * `forgePanel/stale-head` when the head moved past `headSha`; `forgePanel/action-failed` with the host's reason when
1810
+ * the host refuses, cannot be reached, or updates no branches; `forgePanel/action-unknown` when the host did not
1811
+ * confirm whether it started the update.
1812
+ */
1813
+ @Remote async updateBranch(session: Session, url: string, method: BranchUpdateMethod, headSha: string, signal: AbortSignal): Promise<void>
1814
+
1815
+ /**
1816
+ * Ask for a new worktree before the Session's first turn, replacing an open
1817
+ * request and forgetting a failed attempt. While the next message waits in
1818
+ * the inbox, or else at the first step proposal, the panel creates a branch
1819
+ * from `from`, or from HEAD of the current checkout when it is null, and
1820
+ * enters its checkout. A message that already waits after a failed or
1821
+ * stopped attempt keeps waiting for {@link ForgePanelController.retryWorktree}.
1822
+ * @param session - Session without a started turn.
1823
+ * @param from - local base branch, or null for HEAD.
1824
+ * @param signal - request cancellation.
1825
+ * @throws `forgePanel/invalid-branch` when `from` is empty; `forgePanel/worktrees-unavailable`
1826
+ * without a worktree service; `forgePanel/session-started` after a turn started or the worktree was
1827
+ * created; `forgePanel/session-busy` while the worktree is being created.
1828
+ */
1829
+ @Remote async requestWorktree(session: Session, from: string | null, signal: AbortSignal): Promise<void>
1830
+
1831
+ /**
1832
+ * Withdraw the open worktree request of a Session with its failed attempt,
1833
+ * which lets a waiting message go on in the current checkout; without a
1834
+ * request the Session is unchanged. Withdrawing needs no worktree service.
1835
+ * @param session - Session without a started turn.
1836
+ * @param signal - request cancellation.
1837
+ * @throws `forgePanel/session-started` after a turn started or the worktree was created;
1838
+ * `forgePanel/session-busy` while the worktree is being created.
1839
+ */
1840
+ @Remote async cancelWorktree(session: Session, signal: AbortSignal): Promise<void>
1841
+
1842
+ /**
1843
+ * Stop the creation a message of the Session waits for; the message keeps
1844
+ * waiting with the request still open. Without such a creation the Session
1845
+ * is unchanged.
1846
+ * @param session - Session whose creation stops.
1847
+ * @param signal - request cancellation.
1848
+ */
1849
+ @Remote async stopCreation(session: Session, signal: AbortSignal): Promise<void>
1850
+
1851
+ /**
1852
+ * Make another attempt, with a new branch name, at the worktree a message
1853
+ * of the Session waits for after a failed or stopped attempt.
1854
+ * @param session - Session whose message waits.
1855
+ * @param signal - request cancellation.
1856
+ * @throws `forgePanel/not-waiting` when no message waits or an attempt is running.
1857
+ */
1858
+ @Remote async retryWorktree(session: Session, signal: AbortSignal): Promise<void>
1859
+
1860
+ /**
1861
+ * Check out the created worktree of a Session again at its recorded
1862
+ * directory when that directory is gone: its branch when the branch still
1863
+ * exists, otherwise a new branch of the same name at the base commit. Changes
1864
+ * that were never committed are not recovered. Runs as Agent maintenance,
1865
+ * inside the wait of a message that waits for the restoration, which then
1866
+ * goes on; without a missing directory the Session is unchanged.
1867
+ * @param session - Session whose worktree directory is gone.
1868
+ * @param signal - request cancellation, which aborts the restoration.
1869
+ * @throws `forgePanel/no-worktree` without a created worktree; `forgePanel/worktrees-unavailable`
1870
+ * without a worktree service; `forgePanel/session-busy` while the Session's Agent is not loaded or
1871
+ * has other work; `forgePanel/restore-failed` when Git fails.
1872
+ */
1873
+ @Remote async restoreWorktree(session: Session, signal: AbortSignal): Promise<void>
1874
+
1875
+ /**
1876
+ * Move a Session from its created worktree to the source checkout the
1877
+ * worktree came from; the Session no longer works in the worktree. Runs as
1878
+ * Agent maintenance, inside the wait of a message that waits for the removed
1879
+ * worktree, which then goes on.
1880
+ * @param session - Session with a created worktree.
1881
+ * @param signal - request cancellation.
1882
+ * @throws `forgePanel/no-worktree` without a created worktree; `forgePanel/session-busy` while the
1883
+ * Session's Agent is not loaded or has other work; the working-directory service's error when the
1884
+ * source checkout no longer exists.
1885
+ */
1886
+ @Remote async continueInProject(session: Session, signal: AbortSignal): Promise<void>
1887
+ ```
1888
+
1889
+ Types: [Session](session.zh.md) · [WorktreeCleanup](worktrees.zh.md)
1890
+
1891
+ Source: [`packages/experimental/client-ui-forge/src/index.ts`](../../packages/experimental/client-ui-forge/src/index.ts)
1892
+
1893
+ <a id="ctxforgesession--forgesessionservice"></a>
1894
+
1895
+ ### `ctx.forgeSession` — `ForgeSessionService`
1896
+
1897
+ Session-scoped change request bindings. The `forgeChangeRequests` projection derives them from `gh pr create`, `gh pr view`, `gh pr edit`, `gh pr checkout`, and `git push` results and from `plugin:forge-session/binding` records. After each push result, and when a caller reports the branch a Session works on, the service looks up open change requests whose head is that branch and records the unbound ones as discovered. Watching a Session polls its visible change requests through `ctx.forge`.
1898
+
1899
+ ```ts cordis-catalog
1900
+ /**
1901
+ * List the change requests bound to a Session and not dismissed.
1902
+ * @param session - Session whose bindings are read.
1903
+ * @returns visible bindings in first-recorded order, each with its latest polling result.
1904
+ */
1905
+ changeRequests(session: Session): SessionChangeRequest[]
1906
+
1907
+ /**
1908
+ * Bind a change request to a Session by URL, or restore a dismissed binding.
1909
+ * Appends a `track` record with the provider's canonical URL unless the
1910
+ * change request is already visible.
1911
+ * @param session - Session that receives the binding.
1912
+ * @param url - web URL of the change request.
1913
+ * @throws when no registered provider recognizes the URL.
1914
+ */
1915
+ track(session: Session, url: string): void
1916
+
1917
+ /**
1918
+ * Look up open change requests whose head is a branch the Session works on,
1919
+ * and record the unbound ones as discovered, as after a push of that branch.
1920
+ * A remote that no provider recognizes changes nothing; a failed lookup is
1921
+ * logged and changes nothing.
1922
+ * @param session - Session that receives the bindings.
1923
+ * @param remote - URL of the remote that holds the branch.
1924
+ * @param branch - branch name on that remote.
1925
+ * @returns resolves once the lookup has recorded its bindings or failed.
1926
+ */
1927
+ discoverBranch(session: Session, remote: string, branch: string): Promise<void>
1928
+
1929
+ /**
1930
+ * Hide a visible binding. Appends a `dismiss` record; a URL that is not
1931
+ * visibly bound leaves the log unchanged. Discovery never restores a
1932
+ * dismissed binding; `track` does.
1933
+ * @param session - Session that owns the binding.
1934
+ * @param url - web URL of the change request.
1935
+ */
1936
+ dismiss(session: Session, url: string): void
1937
+
1938
+ /**
1939
+ * Watch a Session's visible change requests as an effect on the calling
1940
+ * fiber. Every visible change request that a provider recognizes is polled
1941
+ * through `ctx.forge` while the Session has a watcher. Listeners receive the
1942
+ * complete list after each later binding or provider change, or polling result; read the
1943
+ * current list with {@link changeRequests}. Listeners must not throw; a
1944
+ * thrown error is logged and skipped.
1945
+ * @param session - Session to watch.
1946
+ * @param listener - receives the complete visible list.
1947
+ * @returns the disposer that stops this watch.
1948
+ */
1949
+ watch(session: Session, listener: SessionChangeRequestsListener): () => void
1950
+ ```
1951
+
1952
+ Types: [Session](session.zh.md)
1953
+
1954
+ Source: [`packages/experimental/forge-session/src/index.ts`](../../packages/experimental/forge-session/src/index.ts)
1955
+
1956
+ <a id="forge-events"></a>
1957
+
1958
+ ### `forge/*` events
1959
+
1960
+ <a id="forgeproviders-changed--parallel"></a>
1961
+
1962
+ #### `forge/providers-changed` — parallel
1963
+
1964
+ Announces a provider registration or withdrawal after the registry changes. Listener failures are logged without preventing other listeners from running.
1965
+
1966
+ ```ts cordis-catalog
1967
+ /**
1968
+ * Announces a provider registration or withdrawal after the registry changes.
1969
+ * Listener failures are logged without preventing other listeners from running.
1970
+ * @param forge - family whose provider changed.
1971
+ * @mode parallel
1972
+ */
1973
+ 'forge/providers-changed'(forge: string): void | Promise<void>
1974
+ ```
1975
+
1976
+ Source: [`packages/experimental/forge/src/index.ts`](../../packages/experimental/forge/src/index.ts)
1977
+ <!-- END GENERATED cordis-surface -->