@deepseek-ai/dsh-experimental-client-ui-forge 0.2.2-rc.5 → 0.2.3-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/README.i18n.yaml +12 -12
  2. package/README.md +47 -30
  3. package/README.zh.md +47 -30
  4. package/lib/client.js +18 -8
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +2444 -406
  7. package/lib/typert.host.js +3433 -950
  8. package/lib/typert.remote-client.d.ts +89 -14
  9. package/lib/typert.remote-client.d.ts.map +1 -1
  10. package/lib/typert.remote-client.js +3155 -978
  11. package/lib/types/branch-name.d.ts +30 -0
  12. package/lib/types/branch-name.d.ts.map +1 -0
  13. package/lib/types/branch-name.js.map +1 -0
  14. package/lib/types/client/AttentionIndicator.d.ts +22 -0
  15. package/lib/types/client/AttentionIndicator.d.ts.map +1 -0
  16. package/lib/types/client/AttentionIndicator.js.map +1 -0
  17. package/lib/types/client/BaseMenu.d.ts.map +1 -1
  18. package/lib/types/client/BaseMenu.js.map +1 -1
  19. package/lib/types/client/ChangeRequestCard.d.ts +87 -9
  20. package/lib/types/client/ChangeRequestCard.d.ts.map +1 -1
  21. package/lib/types/client/ChangeRequestCard.js.map +1 -1
  22. package/lib/types/client/ChangeRequestOverview.d.ts +126 -10
  23. package/lib/types/client/ChangeRequestOverview.d.ts.map +1 -1
  24. package/lib/types/client/ChangeRequestOverview.js.map +1 -1
  25. package/lib/types/client/ChangeRequestsSection.d.ts +76 -0
  26. package/lib/types/client/ChangeRequestsSection.d.ts.map +1 -0
  27. package/lib/types/client/ChangeRequestsSection.js.map +1 -0
  28. package/lib/types/client/ChangedFiles.d.ts +6 -2
  29. package/lib/types/client/ChangedFiles.d.ts.map +1 -1
  30. package/lib/types/client/ChangedFiles.js.map +1 -1
  31. package/lib/types/client/ChangesLoading.d.ts +14 -0
  32. package/lib/types/client/ChangesLoading.d.ts.map +1 -0
  33. package/lib/types/client/ChangesLoading.js.map +1 -0
  34. package/lib/types/client/ChangesTab.d.ts +62 -14
  35. package/lib/types/client/ChangesTab.d.ts.map +1 -1
  36. package/lib/types/client/ChangesTab.js.map +1 -1
  37. package/lib/types/client/ChangesTabTitle.js.map +1 -1
  38. package/lib/types/client/DiffFile.d.ts +23 -4
  39. package/lib/types/client/DiffFile.d.ts.map +1 -1
  40. package/lib/types/client/DiffFile.js.map +1 -1
  41. package/lib/types/client/EnvironmentRows.d.ts +79 -0
  42. package/lib/types/client/EnvironmentRows.d.ts.map +1 -0
  43. package/lib/types/client/EnvironmentRows.js.map +1 -0
  44. package/lib/types/client/FileTreePane.d.ts +5 -2
  45. package/lib/types/client/FileTreePane.d.ts.map +1 -1
  46. package/lib/types/client/FileTreePane.js.map +1 -1
  47. package/lib/types/client/LensFilter.d.ts +50 -0
  48. package/lib/types/client/LensFilter.d.ts.map +1 -0
  49. package/lib/types/client/LensFilter.js.map +1 -0
  50. package/lib/types/client/ReasonButton.d.ts +15 -0
  51. package/lib/types/client/ReasonButton.d.ts.map +1 -0
  52. package/lib/types/client/ReasonButton.js.map +1 -0
  53. package/lib/types/client/ReviewComposer.d.ts +11 -4
  54. package/lib/types/client/ReviewComposer.d.ts.map +1 -1
  55. package/lib/types/client/ReviewComposer.js.map +1 -1
  56. package/lib/types/client/ReviewControls.d.ts +18 -7
  57. package/lib/types/client/ReviewControls.d.ts.map +1 -1
  58. package/lib/types/client/ReviewControls.js.map +1 -1
  59. package/lib/types/client/ReviewThread.d.ts +3 -1
  60. package/lib/types/client/ReviewThread.d.ts.map +1 -1
  61. package/lib/types/client/ReviewThread.js.map +1 -1
  62. package/lib/types/client/ReviewThreads.d.ts +32 -2
  63. package/lib/types/client/ReviewThreads.d.ts.map +1 -1
  64. package/lib/types/client/ReviewThreads.js.map +1 -1
  65. package/lib/types/client/SessionHoverForge.d.ts.map +1 -1
  66. package/lib/types/client/SessionHoverForge.js.map +1 -1
  67. package/lib/types/client/SubmitReview.d.ts +4 -4
  68. package/lib/types/client/SubmitReview.d.ts.map +1 -1
  69. package/lib/types/client/SubmitReview.js.map +1 -1
  70. package/lib/types/client/ThreadList.js.map +1 -1
  71. package/lib/types/client/ViewOptionsMenu.d.ts +7 -1
  72. package/lib/types/client/ViewOptionsMenu.d.ts.map +1 -1
  73. package/lib/types/client/ViewOptionsMenu.js.map +1 -1
  74. package/lib/types/client/WorktreeNameDialog.d.ts +38 -0
  75. package/lib/types/client/WorktreeNameDialog.d.ts.map +1 -0
  76. package/lib/types/client/WorktreeNameDialog.js.map +1 -0
  77. package/lib/types/client/WorktreeProgress.d.ts +14 -3
  78. package/lib/types/client/WorktreeProgress.d.ts.map +1 -1
  79. package/lib/types/client/WorktreeProgress.js.map +1 -1
  80. package/lib/types/client/WorktreeToggle.d.ts +22 -15
  81. package/lib/types/client/WorktreeToggle.d.ts.map +1 -1
  82. package/lib/types/client/WorktreeToggle.js.map +1 -1
  83. package/lib/types/client/action-notices.d.ts +25 -0
  84. package/lib/types/client/action-notices.d.ts.map +1 -0
  85. package/lib/types/client/action-notices.js.map +1 -0
  86. package/lib/types/client/annotations.d.ts +41 -0
  87. package/lib/types/client/annotations.d.ts.map +1 -0
  88. package/lib/types/client/annotations.js.map +1 -0
  89. package/lib/types/client/branch-search.d.ts +38 -0
  90. package/lib/types/client/branch-search.d.ts.map +1 -0
  91. package/lib/types/client/branch-search.js.map +1 -0
  92. package/lib/types/client/change-requests-store.d.ts +25 -0
  93. package/lib/types/client/change-requests-store.d.ts.map +1 -0
  94. package/lib/types/client/change-requests-store.js.map +1 -0
  95. package/lib/types/client/changes-address.d.ts +3 -1
  96. package/lib/types/client/changes-address.d.ts.map +1 -1
  97. package/lib/types/client/changes-address.js.map +1 -1
  98. package/lib/types/client/changes-service.d.ts +119 -0
  99. package/lib/types/client/changes-service.d.ts.map +1 -0
  100. package/lib/types/client/changes-service.js.map +1 -0
  101. package/lib/types/client/changes-store.d.ts +6 -2
  102. package/lib/types/client/changes-store.d.ts.map +1 -1
  103. package/lib/types/client/changes-store.js.map +1 -1
  104. package/lib/types/client/checkout.d.ts.map +1 -1
  105. package/lib/types/client/checkout.js.map +1 -1
  106. package/lib/types/client/diff-rows.d.ts +49 -7
  107. package/lib/types/client/diff-rows.d.ts.map +1 -1
  108. package/lib/types/client/diff-rows.js.map +1 -1
  109. package/lib/types/client/file-tree.d.ts +7 -0
  110. package/lib/types/client/file-tree.d.ts.map +1 -1
  111. package/lib/types/client/file-tree.js.map +1 -1
  112. package/lib/types/client/forge-copy.d.ts +29 -0
  113. package/lib/types/client/forge-copy.d.ts.map +1 -0
  114. package/lib/types/client/forge-copy.js.map +1 -0
  115. package/lib/types/client/format.d.ts +8 -0
  116. package/lib/types/client/format.d.ts.map +1 -1
  117. package/lib/types/client/format.js.map +1 -1
  118. package/lib/types/client/glyphs.d.ts +3 -3
  119. package/lib/types/client/glyphs.d.ts.map +1 -1
  120. package/lib/types/client/glyphs.js.map +1 -1
  121. package/lib/types/client/highlight-context.d.ts +73 -0
  122. package/lib/types/client/highlight-context.d.ts.map +1 -0
  123. package/lib/types/client/highlight-context.js.map +1 -0
  124. package/lib/types/client/index.d.ts +9 -5
  125. package/lib/types/client/index.d.ts.map +1 -1
  126. package/lib/types/client/index.js.map +1 -1
  127. package/lib/types/client/lens-filter.d.ts +69 -0
  128. package/lib/types/client/lens-filter.d.ts.map +1 -0
  129. package/lib/types/client/lens-filter.js.map +1 -0
  130. package/lib/types/client/locales.d.ts +188 -36
  131. package/lib/types/client/locales.d.ts.map +1 -1
  132. package/lib/types/client/locales.js.map +1 -1
  133. package/lib/types/client/mount.d.ts +0 -4
  134. package/lib/types/client/mount.d.ts.map +1 -1
  135. package/lib/types/client/mount.js.map +1 -1
  136. package/lib/types/client/review-page/ReviewChat.d.ts +112 -0
  137. package/lib/types/client/review-page/ReviewChat.d.ts.map +1 -0
  138. package/lib/types/client/review-page/ReviewChat.js.map +1 -0
  139. package/lib/types/client/review-page/ReviewDetail.d.ts +56 -0
  140. package/lib/types/client/review-page/ReviewDetail.d.ts.map +1 -0
  141. package/lib/types/client/review-page/ReviewDetail.js.map +1 -0
  142. package/lib/types/client/review-page/ReviewLabels.d.ts +32 -0
  143. package/lib/types/client/review-page/ReviewLabels.d.ts.map +1 -0
  144. package/lib/types/client/review-page/ReviewLabels.js.map +1 -0
  145. package/lib/types/client/review-page/ReviewList.d.ts +68 -0
  146. package/lib/types/client/review-page/ReviewList.d.ts.map +1 -0
  147. package/lib/types/client/review-page/ReviewList.js.map +1 -0
  148. package/lib/types/client/review-page/ReviewNav.d.ts +28 -0
  149. package/lib/types/client/review-page/ReviewNav.d.ts.map +1 -0
  150. package/lib/types/client/review-page/ReviewNav.js.map +1 -0
  151. package/lib/types/client/review-page/ReviewPage.d.ts +61 -0
  152. package/lib/types/client/review-page/ReviewPage.d.ts.map +1 -0
  153. package/lib/types/client/review-page/ReviewPage.js.map +1 -0
  154. package/lib/types/client/review-page/ReviewStatus.d.ts +37 -0
  155. package/lib/types/client/review-page/ReviewStatus.d.ts.map +1 -0
  156. package/lib/types/client/review-page/ReviewStatus.js.map +1 -0
  157. package/lib/types/client/review-page/host-stream.d.ts +24 -0
  158. package/lib/types/client/review-page/host-stream.d.ts.map +1 -0
  159. package/lib/types/client/review-page/host-stream.js.map +1 -0
  160. package/lib/types/client/review-page/review-lists.d.ts +116 -0
  161. package/lib/types/client/review-page/review-lists.d.ts.map +1 -0
  162. package/lib/types/client/review-page/review-lists.js.map +1 -0
  163. package/lib/types/client/review-page/review-mount.d.ts +50 -0
  164. package/lib/types/client/review-page/review-mount.d.ts.map +1 -0
  165. package/lib/types/client/review-page/review-mount.js.map +1 -0
  166. package/lib/types/client/review-page/review-store.d.ts +79 -0
  167. package/lib/types/client/review-page/review-store.d.ts.map +1 -0
  168. package/lib/types/client/review-page/review-store.js.map +1 -0
  169. package/lib/types/client/review-queue.d.ts +19 -0
  170. package/lib/types/client/review-queue.d.ts.map +1 -1
  171. package/lib/types/client/review-queue.js.map +1 -1
  172. package/lib/types/client/review-threads.d.ts +0 -8
  173. package/lib/types/client/review-threads.d.ts.map +1 -1
  174. package/lib/types/client/review-threads.js.map +1 -1
  175. package/lib/types/client/review.d.ts +18 -0
  176. package/lib/types/client/review.d.ts.map +1 -1
  177. package/lib/types/client/review.js.map +1 -1
  178. package/lib/types/client/slots.d.ts +114 -0
  179. package/lib/types/client/slots.d.ts.map +1 -0
  180. package/lib/types/client/slots.js.map +1 -0
  181. package/lib/types/client/source.d.ts +29 -23
  182. package/lib/types/client/source.d.ts.map +1 -1
  183. package/lib/types/client/source.js.map +1 -1
  184. package/lib/types/client/status.d.ts +13 -2
  185. package/lib/types/client/status.d.ts.map +1 -1
  186. package/lib/types/client/status.js.map +1 -1
  187. package/lib/types/git.d.ts +4 -15
  188. package/lib/types/git.d.ts.map +1 -1
  189. package/lib/types/git.js.map +1 -1
  190. package/lib/types/index.d.ts +346 -28
  191. package/lib/types/index.d.ts.map +1 -1
  192. package/lib/types/index.js.map +1 -1
  193. package/lib/types/lens-version.d.ts +14 -0
  194. package/lib/types/lens-version.d.ts.map +1 -0
  195. package/lib/types/lens-version.js.map +1 -0
  196. package/lib/types/lenses.d.ts +122 -0
  197. package/lib/types/lenses.d.ts.map +1 -0
  198. package/lib/types/lenses.js.map +1 -0
  199. package/lib/types/local-diff.d.ts +16 -0
  200. package/lib/types/local-diff.d.ts.map +1 -1
  201. package/lib/types/local-diff.js.map +1 -1
  202. package/lib/types/panel.d.ts +59 -8
  203. package/lib/types/panel.d.ts.map +1 -1
  204. package/lib/types/panel.js.map +1 -1
  205. package/lib/types/parse.d.ts +24 -8
  206. package/lib/types/parse.d.ts.map +1 -1
  207. package/lib/types/parse.js.map +1 -1
  208. package/lib/types/review-cache.d.ts +29 -19
  209. package/lib/types/review-cache.d.ts.map +1 -1
  210. package/lib/types/review-cache.js.map +1 -1
  211. package/lib/types/states.d.ts +11 -7
  212. package/lib/types/states.d.ts.map +1 -1
  213. package/lib/types/states.js.map +1 -1
  214. package/lib/types/types.d.ts +266 -20
  215. package/lib/types/types.d.ts.map +1 -1
  216. package/lib/types/viewer-lists.d.ts +113 -0
  217. package/lib/types/viewer-lists.d.ts.map +1 -0
  218. package/lib/types/viewer-lists.js.map +1 -0
  219. package/lib/types/worktree.d.ts +20 -11
  220. package/lib/types/worktree.d.ts.map +1 -1
  221. package/lib/types/worktree.js.map +1 -1
  222. package/locale/de.json +1 -1
  223. package/locale/en.json +1 -1
  224. package/locale/es.json +1 -1
  225. package/locale/fr.json +1 -1
  226. package/locale/ja.json +1 -1
  227. package/locale/pt.json +1 -1
  228. package/locale/ru.json +1 -1
  229. package/locale/zh.json +1 -1
  230. package/package.json +58 -49
  231. package/src/branch-name.ts +74 -0
  232. package/src/client/AttentionIndicator.tsx +37 -0
  233. package/src/client/BaseMenu.module.css +0 -20
  234. package/src/client/BaseMenu.tsx +9 -52
  235. package/src/client/ChangeRequestCard.tsx +276 -131
  236. package/src/client/ChangeRequestOverview.module.css +1 -1
  237. package/src/client/ChangeRequestOverview.tsx +183 -67
  238. package/src/client/ChangeRequestsSection.tsx +234 -0
  239. package/src/client/ChangedFiles.module.css +5 -1
  240. package/src/client/ChangedFiles.tsx +72 -36
  241. package/src/client/ChangesLoading.module.css +110 -0
  242. package/src/client/ChangesLoading.tsx +69 -0
  243. package/src/client/ChangesTab.module.css +83 -114
  244. package/src/client/ChangesTab.tsx +331 -100
  245. package/src/client/ChangesTabTitle.tsx +3 -3
  246. package/src/client/DiffFile.tsx +241 -45
  247. package/src/client/EnvironmentRows.tsx +263 -0
  248. package/src/client/FileLabel.tsx +1 -1
  249. package/src/client/FileTreePane.tsx +11 -6
  250. package/src/client/{ForgeTab.module.css → Forge.module.css} +130 -275
  251. package/src/client/LensFilter.module.css +87 -0
  252. package/src/client/LensFilter.tsx +105 -0
  253. package/src/client/ReasonButton.tsx +23 -0
  254. package/src/client/ReviewComposer.module.css +2 -8
  255. package/src/client/ReviewComposer.tsx +27 -8
  256. package/src/client/ReviewControls.module.css +39 -0
  257. package/src/client/ReviewControls.tsx +71 -15
  258. package/src/client/ReviewThread.tsx +55 -30
  259. package/src/client/ReviewThreads.module.css +24 -0
  260. package/src/client/ReviewThreads.tsx +56 -21
  261. package/src/client/SessionHoverForge.tsx +2 -1
  262. package/src/client/SubmitReview.tsx +11 -8
  263. package/src/client/ThreadList.tsx +1 -1
  264. package/src/client/ViewOptionsMenu.tsx +19 -4
  265. package/src/client/WorktreeNameDialog.module.css +53 -0
  266. package/src/client/WorktreeNameDialog.tsx +93 -0
  267. package/src/client/WorktreeProgress.tsx +100 -35
  268. package/src/client/WorktreeToggle.module.css +121 -5
  269. package/src/client/WorktreeToggle.tsx +178 -61
  270. package/src/client/action-notices.ts +38 -0
  271. package/src/client/annotations.ts +105 -0
  272. package/src/client/branch-search.tsx +77 -0
  273. package/src/client/change-requests-store.ts +50 -0
  274. package/src/client/changes-address.ts +3 -1
  275. package/src/client/changes-service.ts +173 -0
  276. package/src/client/changes-store.ts +103 -91
  277. package/src/client/checkout.ts +2 -1
  278. package/src/client/diff-rows.ts +100 -16
  279. package/src/client/file-tree.ts +29 -0
  280. package/src/client/forge-copy.ts +49 -0
  281. package/src/client/format.ts +14 -0
  282. package/src/client/glyphs.tsx +12 -13
  283. package/src/client/highlight-context.ts +213 -0
  284. package/src/client/index.ts +20 -5
  285. package/src/client/lens-filter.ts +136 -0
  286. package/src/client/locales.ts +1504 -288
  287. package/src/client/mount.ts +228 -109
  288. package/src/client/review-page/ReviewChat.tsx +311 -0
  289. package/src/client/review-page/ReviewDetail.tsx +331 -0
  290. package/src/client/review-page/ReviewLabels.tsx +94 -0
  291. package/src/client/review-page/ReviewList.tsx +461 -0
  292. package/src/client/review-page/ReviewNav.tsx +47 -0
  293. package/src/client/review-page/ReviewPage.module.css +946 -0
  294. package/src/client/review-page/ReviewPage.tsx +287 -0
  295. package/src/client/review-page/ReviewStatus.tsx +259 -0
  296. package/src/client/review-page/host-stream.ts +63 -0
  297. package/src/client/review-page/review-lists.ts +207 -0
  298. package/src/client/review-page/review-mount.ts +228 -0
  299. package/src/client/review-page/review-store.ts +94 -0
  300. package/src/client/review-queue.ts +30 -0
  301. package/src/client/review-threads.ts +0 -12
  302. package/src/client/review.ts +27 -0
  303. package/src/client/slots.ts +92 -0
  304. package/src/client/source.ts +67 -43
  305. package/src/client/status.ts +16 -4
  306. package/src/git.ts +16 -38
  307. package/src/index.ts +900 -152
  308. package/src/lens-version.ts +27 -0
  309. package/src/lenses.ts +284 -0
  310. package/src/local-diff.ts +48 -1
  311. package/src/panel.ts +123 -28
  312. package/src/parse.ts +86 -10
  313. package/src/review-cache.ts +57 -37
  314. package/src/states.ts +38 -18
  315. package/src/types.ts +267 -21
  316. package/src/viewer-lists.ts +375 -0
  317. package/src/worktree.ts +64 -34
  318. package/lib/types/client/ForgeTab.d.ts +0 -65
  319. package/lib/types/client/ForgeTab.d.ts.map +0 -1
  320. package/lib/types/client/ForgeTab.js.map +0 -1
  321. package/lib/types/client/ForgeTabTitle.d.ts +0 -11
  322. package/lib/types/client/ForgeTabTitle.d.ts.map +0 -1
  323. package/lib/types/client/ForgeTabTitle.js.map +0 -1
  324. package/lib/types/client/HeaderButton.d.ts +0 -27
  325. package/lib/types/client/HeaderButton.d.ts.map +0 -1
  326. package/lib/types/client/HeaderButton.js.map +0 -1
  327. package/lib/types/client/LocalChangesCard.d.ts +0 -29
  328. package/lib/types/client/LocalChangesCard.d.ts.map +0 -1
  329. package/lib/types/client/LocalChangesCard.js.map +0 -1
  330. package/src/client/ForgeTab.tsx +0 -263
  331. package/src/client/ForgeTabTitle.tsx +0 -21
  332. package/src/client/HeaderButton.module.css +0 -29
  333. package/src/client/HeaderButton.tsx +0 -68
  334. package/src/client/LocalChangesCard.tsx +0 -83
package/src/types.ts CHANGED
@@ -1,7 +1,11 @@
1
1
  /** Browser-safe panel state, the worktree request record, Remote error codes, and Host configuration of the forge panel. */
2
2
 
3
3
  import type {} from '@deepseek-ai/dsh-typert-protocol'
4
- import type { ChangeRequestSnapshot, ForgeCommit, ForgeReadiness, ForgeRepository } from '@deepseek-ai/dsh-experimental-forge/types'
4
+ import type { Branded } from '@deepseek-ai/dsh-brand'
5
+ import type {
6
+ ChangeRequestRef, ChangeRequestSnapshot, ChangeRequestSummary, ChangeRequestUpdate, ForgeCommit, ForgeDescription, ForgeFailure,
7
+ ForgeReadiness, ForgeRepository, ForgeViewerFilter,
8
+ } from '@deepseek-ai/dsh-experimental-forge/types'
5
9
  import type { SessionChangeRequest } from '@deepseek-ai/dsh-experimental-forge-session/types'
6
10
 
7
11
  /** Git facts for the checkout that contains the Session's current directory. */
@@ -33,7 +37,10 @@ export interface ForgeSessionWorktree {
33
37
  readonly path: string
34
38
  /** Branch created for the checkout. */
35
39
  readonly branch: string
36
- /** Requested base branch, or null when the checkout started from HEAD of the source checkout. */
40
+ /**
41
+ * Requested base: the full name of a local or remote-tracking branch, a short branch name that earlier panels
42
+ * recorded, or null when the checkout started from HEAD of the source checkout.
43
+ */
37
44
  readonly from: string | null
38
45
  /** Commit object name the branch started from. */
39
46
  readonly baseCommit: string
@@ -43,8 +50,11 @@ export interface ForgeSessionWorktree {
43
50
 
44
51
  /** Payload of the `plugin:client-ui-forge/worktree` record. */
45
52
  export type WorktreeRecord =
46
- /** Create a worktree before the Session's first step, starting from `from`, or from HEAD when it is null. */
47
- | { readonly action: 'request'; readonly from: string | null }
53
+ /**
54
+ * Create a worktree before the Session's first step, starting from `from`, or from HEAD when it is null, on the
55
+ * branch `name`, or on a generated branch name when `name` is absent.
56
+ */
57
+ | { readonly action: 'request'; readonly from: string | null; readonly name?: string }
48
58
  /** Withdraw the open request. */
49
59
  | { readonly action: 'cancel' }
50
60
  /** The requested worktree was created and became the Session's working directory. */
@@ -56,8 +66,13 @@ export type WorktreeRecord =
56
66
 
57
67
  /** One open worktree request. */
58
68
  export interface ForgeWorktreeRequest {
59
- /** Base branch, or null for HEAD of the source checkout. */
69
+ /**
70
+ * Base: the full name of a local or remote-tracking branch, a short branch name that earlier panels recorded, or
71
+ * null for HEAD of the source checkout. A remote-tracking branch is fetched before each attempt that does not skip it.
72
+ */
60
73
  readonly from: string | null
74
+ /** New branch name the user chose, which every attempt uses, or null for a generated name per attempt. */
75
+ readonly name: string | null
61
76
  }
62
77
 
63
78
  /** Host-only state of the `forgeWorktree` projection. */
@@ -87,12 +102,17 @@ export type ForgeWorktreeBlocker =
87
102
 
88
103
  /** One running worktree creation. */
89
104
  export interface ForgeWorktreeCreation {
90
- /** Running step: `prepare` validates and creates the branch, then `checkout` writes the files. */
91
- readonly phase: 'prepare' | 'checkout'
105
+ /**
106
+ * Running step: `fetch` fetches a remote base branch, `prepare` validates and creates the branch, then
107
+ * `checkout` writes the files.
108
+ */
109
+ readonly phase: 'fetch' | 'prepare' | 'checkout'
92
110
  /** Branch the attempt creates. */
93
111
  readonly branch: string
94
- /** Base branch, or null for HEAD. */
112
+ /** Base as the request names it, or null for HEAD. */
95
113
  readonly from: string | null
114
+ /** Whether the attempt fetches its remote base branch first. */
115
+ readonly fetch: boolean
96
116
  /**
97
117
  * Whether a message waits for the creation before its turn starts. Only
98
118
  * such a creation can be stopped, after which the message keeps waiting; a
@@ -111,12 +131,16 @@ export interface ForgeWorktreeRestoration {
111
131
  export interface ForgeWorktreeFailure {
112
132
  /** Branch the attempt created, or null when it failed before naming one. */
113
133
  readonly branch: string | null
114
- /** Base branch of the attempt, or null for HEAD. */
134
+ /** Base of the attempt as the request names it, or null for HEAD. */
115
135
  readonly from: string | null
136
+ /** Whether the attempt fetched, or tried to fetch, its remote base branch first. */
137
+ readonly fetch: boolean
116
138
  /** Step that failed. */
117
- readonly phase: 'prepare' | 'checkout'
139
+ readonly phase: 'fetch' | 'prepare' | 'checkout'
118
140
  /** Failure text. */
119
141
  readonly message: string
142
+ /** Whether the branch or the checkout directory of that name already existed, which another name avoids. */
143
+ readonly exists: boolean
120
144
  }
121
145
 
122
146
  /**
@@ -141,6 +165,8 @@ export interface ForgePanelWorktree {
141
165
  readonly editable: boolean
142
166
  /** Why the checkout cannot host a worktree, or null when it can, before the first inspection, and after a failed one. */
143
167
  readonly blocker: ForgeWorktreeBlocker | null
168
+ /** Prefix of generated branch names, the Config `worktreePrefix`, which a name the user types starts from. */
169
+ readonly namePrefix: string
144
170
  /** Open request, or null without one. */
145
171
  readonly request: ForgeWorktreeRequest | null
146
172
  /** Created worktree, or null before creation. */
@@ -181,10 +207,71 @@ export type ForgeChangeRequestStatesFrame =
181
207
  | { readonly type: 'baseline'; readonly states: readonly ForgeChangeRequestListState[] }
182
208
  | { readonly type: 'changed'; readonly states: readonly ForgeChangeRequestListState[] }
183
209
 
210
+ /** One list of the review page: the latest successful read of one viewer list on one host, and the latest failure. */
211
+ export interface ForgeReviewList {
212
+ /** Change requests most recently updated first, from the latest successful read, or null before the first. */
213
+ readonly items: readonly ChangeRequestSummary[] | null
214
+ /** Size of the whole list the host reported with `items`; 0 before the first successful read. */
215
+ readonly total: number
216
+ /** Epoch milliseconds of the read `items` come from, or null before the first successful read. */
217
+ readonly fetchedAt: number | null
218
+ /** Why the latest read failed, or null when it succeeded or none settled yet. */
219
+ readonly failure: ForgeFailure | null
220
+ }
221
+
222
+ /** The review page's lists on one host of one provider. */
223
+ export interface ForgeReviewHost {
224
+ /** Forge family of the provider. */
225
+ readonly forge: string
226
+ /** Lowercase host name. */
227
+ readonly host: string
228
+ /** Login of the signed-in user the latest successful read named, or null before one. */
229
+ readonly viewer: string | null
230
+ /** Each list the provider offers on the host; a list it does not offer is absent. */
231
+ readonly lists: Partial<Readonly<Record<ForgeViewerFilter, ForgeReviewList>>>
232
+ }
233
+
234
+ /** Everything the review page lists, as one frame. */
235
+ export interface ForgeReviewFrame {
236
+ /** Each host a provider lists change requests on, in registration and configuration order. */
237
+ readonly hosts: readonly ForgeReviewHost[]
238
+ /** Whether a read is in flight. */
239
+ readonly reading: boolean
240
+ }
241
+
242
+ /** The number the review page's navigation entry shows. */
243
+ export interface ForgeReviewCountFrame {
244
+ /** Open change requests that ask the signed-in user for a review, summed over the hosts read, or null before any count. */
245
+ readonly reviewRequested: number | null
246
+ }
247
+
248
+ /** One change request the review page shows in full, with its latest polling result. */
249
+ export interface ForgeReviewChangeRequest {
250
+ /** Web URL the page asked for. */
251
+ readonly url: string
252
+ /** Parsed reference. */
253
+ readonly ref: ChangeRequestRef
254
+ /** How readers name the change request's code host and its change requests, or null once its provider left. */
255
+ readonly forge: ForgeDescription | null
256
+ /** Latest polling result, or null before the first poll. */
257
+ readonly update: ChangeRequestUpdate | null
258
+ /** Latest snapshot a poll returned, kept while later polls fail, or null before the first successful poll. */
259
+ readonly snapshot: ChangeRequestSnapshot | null
260
+ /** Number of review changes `forge/review-changed` announced for the change request since the panel host started. */
261
+ readonly reviewRevision: number
262
+ }
263
+
184
264
  /** One bound change request in the panel state. */
185
265
  export interface ForgePanelChangeRequest extends SessionChangeRequest {
266
+ /** How readers name the change request's code host and its change requests, or null when no provider serves its URL. */
267
+ readonly forge: ForgeDescription | null
186
268
  /** Latest snapshot a poll returned, kept while later polls fail, or null before the first successful poll. */
187
269
  readonly snapshot: ChangeRequestSnapshot | null
270
+ /**
271
+ * Number of review changes `forge/review-changed` announced for the change request since the panel host started; it
272
+ * grows when any plugin's write is accepted, so a reader shows threads and viewed marks read after it.
273
+ */
274
+ readonly reviewRevision: number
188
275
  }
189
276
 
190
277
  /** Everything the panel shows for one Session. */
@@ -208,12 +295,35 @@ export interface ForgePanelState {
208
295
  readonly local: ForgeLocalChanges | null
209
296
  }
210
297
 
211
- /** Local branches offered as the base of a new worktree. */
212
- export interface ForgeBranches {
213
- /** Checked-out branch, or null when HEAD is detached. */
214
- readonly current: string | null
215
- /** Local branch names, `current` first and then most recently committed first, at most `maxBranches`. */
216
- readonly branches: readonly string[]
298
+ /** Branches offered as the base of a new worktree whose names contain a query. */
299
+ export interface ForgeWorktreeBases {
300
+ /** Checked-out branch, or null when HEAD is detached or its name does not contain the query. */
301
+ readonly current: ForgeBaseBranch | null
302
+ /** Default branch of each remote that names one with `refs/remotes/<remote>/HEAD`, in remote order. */
303
+ readonly defaults: readonly ForgeRemoteDefault[]
304
+ /** Other local branches, most recently committed first, at most `maxBranches`. */
305
+ readonly local: readonly ForgeBaseBranch[]
306
+ /**
307
+ * Remote-tracking branches of each configured remote in remote order: the remote the checked-out branch tracks,
308
+ * then `origin`, then the others as Git lists them. Remotes without a matching branch are left out.
309
+ */
310
+ readonly remotes: readonly ForgeRemoteBranches[]
311
+ }
312
+
313
+ /** A remote's default branch, which `refs/remotes/<remote>/HEAD` names. */
314
+ export interface ForgeRemoteDefault extends ForgeBaseBranch {
315
+ /** Remote the branch belongs to; it may contain `/`. */
316
+ readonly remote: string
317
+ }
318
+
319
+ /** Remote-tracking branches of one remote, without its default branch. */
320
+ export interface ForgeRemoteBranches {
321
+ /** Remote name such as `origin`; it may contain `/`. */
322
+ readonly name: string
323
+ /** `owner/name` of the repository a provider recognizes from the remote's URLs, else its fetch URL, or null without one. */
324
+ readonly repository: string | null
325
+ /** Branches named `<remote>/<branch>`, most recently committed first, at most `maxBranches`. */
326
+ readonly branches: readonly ForgeBaseBranch[]
217
327
  }
218
328
 
219
329
  /** A branch the `branch` scope can compare with. */
@@ -347,6 +457,102 @@ export interface ForgeChangeRequestDiff {
347
457
  readonly fileUrls: Readonly<Record<string, string>>
348
458
  }
349
459
 
460
+ /** Opaque identity of a filter lens, chosen by the plugin that registers it, such as `example/public-interface`. */
461
+ export type ForgeLensId = Branded<'ForgeLensId'>
462
+
463
+ /** One changed file a lens classifies: the diff's description of it, without the lines. */
464
+ export type ForgeLensFile = Pick<ForgeDiffFile, 'path' | 'previousPath' | 'status' | 'binary' | 'layer' | 'hunks' | 'digest'>
465
+
466
+ /** Lines `start` through `end` of one side of a file, both inclusive and 1-based. */
467
+ export interface ForgeLineRange {
468
+ readonly start: number
469
+ readonly end: number
470
+ }
471
+
472
+ /** What a lens keeps of one file. */
473
+ export interface ForgeLensKeep {
474
+ /**
475
+ * Lines the lens is about on each side; hunks that touch none of them fold into one row the reader can expand.
476
+ * Omitted: every hunk of the file shows.
477
+ */
478
+ readonly ranges?: { readonly old: readonly ForgeLineRange[]; readonly new: readonly ForgeLineRange[] }
479
+ }
480
+
481
+ /** The files a lens keeps, by path; a file the result does not name is filtered out. */
482
+ export interface ForgeLensResult {
483
+ readonly files: Readonly<Record<string, ForgeLensKeep>>
484
+ }
485
+
486
+ /** What a changes view shows, as a lens sees it. */
487
+ export type ForgeLensSource =
488
+ /** Local changes of a Session's checkout in one scope. */
489
+ | { readonly kind: 'local'; readonly scope: ForgeLocalScope }
490
+ /** A change request at one head commit, whole or as consecutive commits. */
491
+ | { readonly kind: 'change'; readonly ref: ChangeRequestRef; readonly headSha: string; readonly commits: ForgeCommitRange | null }
492
+
493
+ /** What one `classify` call receives. */
494
+ export interface ForgeLensInput {
495
+ /** What the view shows. */
496
+ readonly source: ForgeLensSource
497
+ /** Every file of the diff in display order, with the layer the panel gave it. */
498
+ readonly files: readonly ForgeLensFile[]
499
+ /**
500
+ * Read one side of a file of `files`, by its `path`: the old side reads `previousPath` for a renamed file. Resolves to
501
+ * null when the side does not exist, as the old side of an added file, or holds binary content. Rejects for a path not
502
+ * in `files`, once the reads of one call exceed the panel's `maxLensReadBytes`, for an old side the provider cannot
503
+ * locate, and when the read fails.
504
+ */
505
+ text(side: 'old' | 'new', path: string, signal: AbortSignal): Promise<string | null>
506
+ /** Report how many of `total` units the lens finished; the changes view shows it while the lens runs. */
507
+ progress(done: number, total: number): void
508
+ }
509
+
510
+ /** A filter over the files of a changes view, which a plugin registers with `ctx.forgePanel.registerLens()`. */
511
+ export interface ForgeLens {
512
+ /** Identity the plugin chooses; one registration holds an id at a time. */
513
+ readonly id: ForgeLensId
514
+ /** Changes whenever `classify` may answer differently for the same input, which drops results kept under another version. */
515
+ readonly version: string
516
+ /**
517
+ * Decide which files the lens keeps and which lines it is about. The signal aborts when the reader stops waiting, the
518
+ * registration ends, or `lensTimeoutMs` passes; a rejection fails the request without a partial result.
519
+ */
520
+ classify(input: ForgeLensInput, signal: AbortSignal): Promise<ForgeLensResult>
521
+ }
522
+
523
+ /** What a changes view asks a lens to classify: its source, the version of the files it shows, and the lens. */
524
+ export interface ForgeLensRequest {
525
+ /** The view's source: local changes in a scope, or a binding URL with its chosen commits. */
526
+ readonly source:
527
+ | { readonly kind: 'local'; readonly scope: ForgeLocalScope }
528
+ | { readonly kind: 'change'; readonly url: string; readonly commits: ForgeCommitRange | null }
529
+ /** `lensVersion` of the files the view shows; files read since with another version refuse the request. */
530
+ readonly version: string
531
+ /** Identity of the registered lens. */
532
+ readonly lens: string
533
+ }
534
+
535
+ /** One frame of a lens request: how far the lens is, then what it keeps. */
536
+ export type ForgeLensFrame =
537
+ | { readonly kind: 'progress'; readonly done: number; readonly total: number }
538
+ | { readonly kind: 'result'; readonly files: Readonly<Record<string, ForgeLensKeep>> }
539
+
540
+ /** A registered lens as changes views see it. */
541
+ export interface ForgeRegisteredLens {
542
+ /** Identity of the lens. */
543
+ readonly id: string
544
+ /** The lens's `version`; a view does not reuse results of another version. */
545
+ readonly version: string
546
+ }
547
+
548
+ /** Facts about the panel's extensions that every changes view reads. */
549
+ export interface ForgeExtensionState {
550
+ /** The registered lenses, in registration order. */
551
+ readonly lenses: readonly ForgeRegisteredLens[]
552
+ /** Most line annotations a changes view shows in one file, across every annotation source. */
553
+ readonly maxAnnotationsPerFile: number
554
+ }
555
+
350
556
  /** Commits of the `branch` scope at one HEAD commit, which the changes view can show one or several of. */
351
557
  export interface ForgeLocalCommits {
352
558
  /** HEAD commit the list was read at. */
@@ -369,7 +575,7 @@ export interface ForgeChangedFile {
369
575
  readonly binary: boolean
370
576
  }
371
577
 
372
- /** Size of the `branch` scope, which the panel's local changes card shows. */
578
+ /** Size of the `branch` scope, which the Session panel's local changes row shows. */
373
579
  export interface ForgeLocalChanges {
374
580
  /** Ref or abbreviated commit the scope compares with. */
375
581
  readonly base: string
@@ -398,7 +604,7 @@ export interface Config {
398
604
  worktreePrefix?: string
399
605
  /** Largest diff, file read to show unchanged lines, or list of base branch refs, in bytes. */
400
606
  maxDiffBytes?: number
401
- /** Most untracked files a local diff or the local changes card includes. */
607
+ /** Most untracked files a local diff or the local changes row includes. */
402
608
  maxUntrackedFiles?: number
403
609
  /** Most UTF-8 bytes of change request diffs kept in memory for later reads at the same head commit and base branch. */
404
610
  maxCachedDiffBytes?: number
@@ -414,13 +620,38 @@ export interface Config {
414
620
  * `testPaths` and before the built-in rules.
415
621
  */
416
622
  interfacePaths?: string[]
417
- /** Most UTF-8 bytes, as JSON, of change request review threads kept in memory for later reads at the same head commit and update time. */
623
+ /**
624
+ * Most UTF-8 bytes, as JSON, of change request review threads kept in memory for later reads at the same head commit
625
+ * and update time, and, counted apart, of viewed marks kept for later reads at the same head commit.
626
+ */
418
627
  maxCachedReviewBytes?: number
419
628
  /**
420
- * Age in milliseconds at which review threads kept in memory are read from the code host again; a GitHub pull
421
- * request's update time does not change when a thread is resolved.
629
+ * Age in milliseconds at which review threads and viewed marks kept in memory are read from the code host again; a
630
+ * GitHub pull request's update time does not change when a thread is resolved, and nothing announces a mark changed
631
+ * on the code host itself.
422
632
  */
423
633
  reviewRefreshMs?: number
634
+ /**
635
+ * Age in milliseconds past which the status of a change request is read at once when a Session's panel or the
636
+ * review page starts to show it.
637
+ */
638
+ statusMaxAgeMs?: number
639
+ /** Deadline in milliseconds for one lens `classify` call. */
640
+ lensTimeoutMs?: number
641
+ /** Most UTF-8 bytes of file text one lens `classify` call may read. */
642
+ maxLensReadBytes?: number
643
+ /** Most UTF-8 bytes, as JSON, of lens results kept in memory for later requests with the same files, lens, and lens version. */
644
+ maxCachedLensBytes?: number
645
+ /** Most line annotations a changes view shows in one file, across every annotation source. */
646
+ maxAnnotationsPerFile?: number
647
+ /** Milliseconds between two reads of the review page's lists while the page is open. */
648
+ reviewListIntervalMs?: number
649
+ /** Milliseconds between two reads of the review page's navigation count while it is shown. */
650
+ reviewCountIntervalMs?: number
651
+ /** Largest delay in milliseconds between two reads of the review page's lists or count after consecutive failures. */
652
+ reviewMaxBackoffMs?: number
653
+ /** Most change requests one review page list shows, capped by each provider's own limit. */
654
+ reviewPageSize?: number
424
655
  }
425
656
 
426
657
  declare module '@deepseek-ai/dsh-typert-protocol' {
@@ -433,6 +664,10 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
433
664
  'forgePanel/worktrees-unavailable': Record<string, never>
434
665
  /** The requested base branch name is empty. */
435
666
  'forgePanel/invalid-branch': Record<string, never>
667
+ /** The requested new branch name breaks one of Git's branch-name rules, or the worktree service's refusal of a leading `-`. */
668
+ 'forgePanel/invalid-name': Record<string, never>
669
+ /** A local branch with the requested new branch name exists in the Session's checkout. */
670
+ 'forgePanel/branch-exists': Record<string, never>
436
671
  /** The Session has no created worktree to restore or leave. */
437
672
  'forgePanel/no-worktree': Record<string, never>
438
673
  /** The Session's Agent is not loaded or has other work, so its checkout cannot change now. */
@@ -482,10 +717,21 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
482
717
  'forgePanel/viewed-failed': Record<string, never>
483
718
  /** The code host did not list the accounts a review can be requested from; the message says why. */
484
719
  'forgePanel/reviewers-failed': Record<string, never>
720
+ /** The code host did not provide a change request's description; the message says why. */
721
+ 'forgePanel/description-failed': Record<string, never>
485
722
  /** The code host's provider cannot read review threads, so the changes view shows none. */
486
723
  'forgePanel/review-unsupported': Record<string, never>
487
724
  /** The code host did not provide the change request's review threads, or its status has not been read yet; the message says why. */
488
725
  'forgePanel/review-failed': Record<string, never>
726
+ /** No lens with the requested identity is registered, as after its plugin unloaded. */
727
+ 'forgePanel/lens-missing': Record<string, never>
728
+ /** The files the view shows are no longer the files the panel reads, so the view reads them again before asking. */
729
+ 'forgePanel/lens-stale': Record<string, never>
730
+ /**
731
+ * The lens failed, ran past `lensTimeoutMs`, read more than `maxLensReadBytes`, or answered over `maxCachedLensBytes`;
732
+ * the message says which.
733
+ */
734
+ 'forgePanel/lens-failed': Record<string, never>
489
735
  }
490
736
  }
491
737