@dxos/plugin-github 0.7.4 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (642) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +784 -0
  3. package/dist/lib/GitHubCapabilities.mjs +10 -0
  4. package/dist/lib/GitHubCapabilities.mjs.map +1 -0
  5. package/dist/lib/GitHubEvents.mjs +15 -0
  6. package/dist/lib/GitHubEvents.mjs.map +1 -0
  7. package/dist/lib/GitHubOperation.mjs +384 -0
  8. package/dist/lib/GitHubOperation.mjs.map +1 -0
  9. package/dist/lib/GitHubPlugin.mjs +16 -0
  10. package/dist/lib/GitHubPlugin.mjs.map +1 -0
  11. package/dist/lib/Walkthrough.mjs +59 -0
  12. package/dist/lib/Walkthrough.mjs.map +1 -0
  13. package/dist/lib/capabilities.browser.mjs +54 -0
  14. package/dist/lib/capabilities.browser.mjs.map +1 -0
  15. package/dist/lib/capabilities.mjs +54 -0
  16. package/dist/lib/capabilities.mjs.map +1 -0
  17. package/dist/lib/capabilities.node.mjs +30 -0
  18. package/dist/lib/capabilities.node.mjs.map +1 -0
  19. package/dist/lib/capabilities.tauri.mjs +54 -0
  20. package/dist/lib/capabilities.tauri.mjs.map +1 -0
  21. package/dist/lib/capabilities.workerd.mjs +30 -0
  22. package/dist/lib/capabilities.workerd.mjs.map +1 -0
  23. package/dist/lib/chunk-ImportPullRequestDialog.mjs +116 -0
  24. package/dist/lib/chunk-ImportPullRequestDialog.mjs.map +1 -0
  25. package/dist/lib/chunk-PLUGIN.mjs +6 -0
  26. package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
  27. package/dist/lib/chunk-PullRequestArticle.mjs +1506 -0
  28. package/dist/lib/chunk-PullRequestArticle.mjs.map +1 -0
  29. package/dist/lib/chunk-PullRequestArticle2.mjs +2 -0
  30. package/dist/lib/chunk-PullRequestCardMenu.mjs +123 -0
  31. package/dist/lib/chunk-PullRequestCardMenu.mjs.map +1 -0
  32. package/dist/lib/chunk-PullRequestsArticle.mjs +594 -0
  33. package/dist/lib/chunk-PullRequestsArticle.mjs.map +1 -0
  34. package/dist/lib/chunk-WalkthroughArticle.mjs +26 -0
  35. package/dist/lib/chunk-WalkthroughArticle.mjs.map +1 -0
  36. package/dist/lib/chunk-add-pull-request-comment.mjs +19 -0
  37. package/dist/lib/chunk-add-pull-request-comment.mjs.map +1 -0
  38. package/dist/lib/chunk-add-pull-request-review-comment.mjs +25 -0
  39. package/dist/lib/chunk-add-pull-request-review-comment.mjs.map +1 -0
  40. package/dist/lib/chunk-app-graph-builder.mjs +39 -0
  41. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
  42. package/dist/lib/chunk-connector.mjs +70 -0
  43. package/dist/lib/chunk-connector.mjs.map +1 -0
  44. package/dist/lib/chunk-constants.mjs +11 -0
  45. package/dist/lib/chunk-constants.mjs.map +1 -0
  46. package/dist/lib/chunk-errors.mjs +29 -0
  47. package/dist/lib/chunk-errors.mjs.map +1 -0
  48. package/dist/lib/chunk-generate-walkthrough.mjs +86 -0
  49. package/dist/lib/chunk-generate-walkthrough.mjs.map +1 -0
  50. package/dist/lib/chunk-generate.mjs +719 -0
  51. package/dist/lib/chunk-generate.mjs.map +1 -0
  52. package/dist/lib/chunk-get-pull-request-diff.mjs +25 -0
  53. package/dist/lib/chunk-get-pull-request-diff.mjs.map +1 -0
  54. package/dist/lib/chunk-get-pull-request-status.mjs +29 -0
  55. package/dist/lib/chunk-get-pull-request-status.mjs.map +1 -0
  56. package/dist/lib/chunk-get-repositories.mjs +32 -0
  57. package/dist/lib/chunk-get-repositories.mjs.map +1 -0
  58. package/dist/lib/chunk-github-api.mjs +375 -0
  59. package/dist/lib/chunk-github-api.mjs.map +1 -0
  60. package/dist/lib/chunk-github-link.mjs +59 -0
  61. package/dist/lib/chunk-github-link.mjs.map +1 -0
  62. package/dist/lib/chunk-import-pull-request-from-snapshot.mjs +25 -0
  63. package/dist/lib/chunk-import-pull-request-from-snapshot.mjs.map +1 -0
  64. package/dist/lib/chunk-import-pull-request.mjs +171 -0
  65. package/dist/lib/chunk-import-pull-request.mjs.map +1 -0
  66. package/dist/lib/chunk-link-resolver.mjs +109 -0
  67. package/dist/lib/chunk-link-resolver.mjs.map +1 -0
  68. package/dist/lib/chunk-markdown-extension.mjs +92 -0
  69. package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
  70. package/dist/lib/chunk-materialize-target.mjs +36 -0
  71. package/dist/lib/chunk-materialize-target.mjs.map +1 -0
  72. package/dist/lib/chunk-operation-handler.mjs +12 -0
  73. package/dist/lib/chunk-operation-handler.mjs.map +1 -0
  74. package/dist/lib/chunk-page-action.mjs +22 -0
  75. package/dist/lib/chunk-page-action.mjs.map +1 -0
  76. package/dist/lib/chunk-pull-request.mjs +58 -0
  77. package/dist/lib/chunk-pull-request.mjs.map +1 -0
  78. package/dist/lib/chunk-pull-request2.mjs +110 -0
  79. package/dist/lib/chunk-pull-request2.mjs.map +1 -0
  80. package/dist/lib/chunk-react-surface.mjs +233 -0
  81. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  82. package/dist/lib/chunk-refresh-pull-requests.mjs +49 -0
  83. package/dist/lib/chunk-refresh-pull-requests.mjs.map +1 -0
  84. package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
  85. package/dist/lib/chunk-schema.mjs +15 -0
  86. package/dist/lib/chunk-schema.mjs.map +1 -0
  87. package/dist/lib/chunk-skill-definition.mjs +10 -0
  88. package/dist/lib/chunk-skill-definition.mjs.map +1 -0
  89. package/dist/lib/chunk-submit-pull-request-approval.mjs +56 -0
  90. package/dist/lib/chunk-submit-pull-request-approval.mjs.map +1 -0
  91. package/dist/lib/chunk-sync-pull-request.mjs +26 -0
  92. package/dist/lib/chunk-sync-pull-request.mjs.map +1 -0
  93. package/dist/lib/chunk-sync.mjs +481 -0
  94. package/dist/lib/chunk-sync.mjs.map +1 -0
  95. package/dist/lib/chunk-useOpenObject.mjs +43 -0
  96. package/dist/lib/chunk-useOpenObject.mjs.map +1 -0
  97. package/dist/lib/extensions.mjs +132 -0
  98. package/dist/lib/extensions.mjs.map +1 -0
  99. package/dist/lib/index.mjs +4 -0
  100. package/dist/lib/meta.mjs +47 -0
  101. package/dist/lib/meta.mjs.map +1 -0
  102. package/dist/lib/ns/Extensions.mjs +18 -0
  103. package/dist/lib/ns/Extensions.mjs.map +1 -0
  104. package/dist/lib/operations.mjs +23 -0
  105. package/dist/lib/operations.mjs.map +1 -0
  106. package/dist/lib/plugin.mjs +9 -0
  107. package/dist/lib/plugin.mjs.map +1 -0
  108. package/dist/lib/skills.mjs +44 -0
  109. package/dist/lib/skills.mjs.map +1 -0
  110. package/dist/lib/testing.mjs +189 -0
  111. package/dist/lib/testing.mjs.map +1 -0
  112. package/dist/lib/translations.mjs +136 -0
  113. package/dist/lib/translations.mjs.map +1 -0
  114. package/dist/lib/types.mjs +5 -0
  115. package/dist/types/dx.config.d.ts +28 -0
  116. package/dist/types/dx.config.d.ts.map +1 -0
  117. package/dist/types/src/Extensions.d.ts +2 -0
  118. package/dist/types/src/Extensions.d.ts.map +1 -0
  119. package/dist/types/src/GitHubPlugin.d.ts +37 -0
  120. package/dist/types/src/GitHubPlugin.d.ts.map +1 -0
  121. package/dist/types/src/GitHubPlugin.workerd.test.d.ts +2 -0
  122. package/dist/types/src/GitHubPlugin.workerd.test.d.ts.map +1 -0
  123. package/dist/types/src/approval.d.ts +21 -0
  124. package/dist/types/src/approval.d.ts.map +1 -0
  125. package/dist/types/src/approval.test.d.ts +2 -0
  126. package/dist/types/src/approval.test.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/app-graph-builder.d.ts +9 -0
  128. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/connector.d.ts +17 -0
  130. package/dist/types/src/capabilities/connector.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/gen/browser.d.ts +13 -0
  132. package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/gen/node.d.ts +13 -0
  134. package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/gen/tauri.d.ts +13 -0
  136. package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/gen/workerd.d.ts +13 -0
  138. package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/index.d.ts +13 -0
  140. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/link-resolver.d.ts +10 -0
  142. package/dist/types/src/capabilities/link-resolver.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/markdown-extension.d.ts +14 -0
  144. package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
  145. package/dist/types/src/capabilities/operation-handler.d.ts +5 -0
  146. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  147. package/dist/types/src/capabilities/page-action.d.ts +5 -0
  148. package/dist/types/src/capabilities/page-action.d.ts.map +1 -0
  149. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  150. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  151. package/dist/types/src/capabilities/schema.d.ts +12 -0
  152. package/dist/types/src/capabilities/schema.d.ts.map +1 -0
  153. package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
  154. package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
  155. package/dist/types/src/cards/GitHubCard.d.ts +11 -0
  156. package/dist/types/src/cards/GitHubCard.d.ts.map +1 -0
  157. package/dist/types/src/cards/GitHubCard.stories.d.ts +45 -0
  158. package/dist/types/src/cards/GitHubCard.stories.d.ts.map +1 -0
  159. package/dist/types/src/cards/PullRequestCard.d.ts +9 -0
  160. package/dist/types/src/cards/PullRequestCard.d.ts.map +1 -0
  161. package/dist/types/src/cards/index.d.ts +3 -0
  162. package/dist/types/src/cards/index.d.ts.map +1 -0
  163. package/dist/types/src/components/CommentComposer/CommentComposer.d.ts +30 -0
  164. package/dist/types/src/components/CommentComposer/CommentComposer.d.ts.map +1 -0
  165. package/dist/types/src/components/CommentComposer/index.d.ts +2 -0
  166. package/dist/types/src/components/CommentComposer/index.d.ts.map +1 -0
  167. package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts +8 -0
  168. package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts.map +1 -0
  169. package/dist/types/src/components/PullRequestFiles/FileTree.d.ts +17 -0
  170. package/dist/types/src/components/PullRequestFiles/FileTree.d.ts.map +1 -0
  171. package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts +23 -0
  172. package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts.map +1 -0
  173. package/dist/types/src/components/PullRequestFiles/files.d.ts +39 -0
  174. package/dist/types/src/components/PullRequestFiles/files.d.ts.map +1 -0
  175. package/dist/types/src/components/PullRequestFiles/files.test.d.ts +2 -0
  176. package/dist/types/src/components/PullRequestFiles/files.test.d.ts.map +1 -0
  177. package/dist/types/src/components/PullRequestFiles/index.d.ts +5 -0
  178. package/dist/types/src/components/PullRequestFiles/index.d.ts.map +1 -0
  179. package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts +21 -0
  180. package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts.map +1 -0
  181. package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts +18 -0
  182. package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts.map +1 -0
  183. package/dist/types/src/components/PullRequestOverview/CheckRunList.test.d.ts +2 -0
  184. package/dist/types/src/components/PullRequestOverview/CheckRunList.test.d.ts.map +1 -0
  185. package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts +10 -0
  186. package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts.map +1 -0
  187. package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts +16 -0
  188. package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts.map +1 -0
  189. package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts +28 -0
  190. package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts.map +1 -0
  191. package/dist/types/src/components/PullRequestOverview/index.d.ts +6 -0
  192. package/dist/types/src/components/PullRequestOverview/index.d.ts.map +1 -0
  193. package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts +20 -0
  194. package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts.map +1 -0
  195. package/dist/types/src/components/PullRequestStatus/index.d.ts +2 -0
  196. package/dist/types/src/components/PullRequestStatus/index.d.ts.map +1 -0
  197. package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts +18 -0
  198. package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts.map +1 -0
  199. package/dist/types/src/components/WalkthroughView/extensions.d.ts +16 -0
  200. package/dist/types/src/components/WalkthroughView/extensions.d.ts.map +1 -0
  201. package/dist/types/src/components/WalkthroughView/index.d.ts +3 -0
  202. package/dist/types/src/components/WalkthroughView/index.d.ts.map +1 -0
  203. package/dist/types/src/components/index.d.ts +5 -8
  204. package/dist/types/src/components/index.d.ts.map +1 -1
  205. package/dist/types/src/constants.d.ts +7 -0
  206. package/dist/types/src/constants.d.ts.map +1 -0
  207. package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts +6 -0
  208. package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts.map +1 -0
  209. package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts +3 -0
  210. package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts.map +1 -0
  211. package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts +15 -0
  212. package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts.map +1 -0
  213. package/dist/types/src/containers/PullRequestArticle/failure.d.ts +10 -0
  214. package/dist/types/src/containers/PullRequestArticle/failure.d.ts.map +1 -0
  215. package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts +2 -0
  216. package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts.map +1 -0
  217. package/dist/types/src/containers/PullRequestArticle/index.d.ts +2 -0
  218. package/dist/types/src/containers/PullRequestArticle/index.d.ts.map +1 -0
  219. package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts +14 -0
  220. package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts.map +1 -0
  221. package/dist/types/src/containers/PullRequestCardMenu/index.d.ts +2 -0
  222. package/dist/types/src/containers/PullRequestCardMenu/index.d.ts.map +1 -0
  223. package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts +13 -0
  224. package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts.map +1 -0
  225. package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts +44 -0
  226. package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts.map +1 -0
  227. package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts +2 -0
  228. package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts.map +1 -0
  229. package/dist/types/src/containers/PullRequestsArticle/format.d.ts +3 -0
  230. package/dist/types/src/containers/PullRequestsArticle/format.d.ts.map +1 -0
  231. package/dist/types/src/containers/PullRequestsArticle/index.d.ts +2 -0
  232. package/dist/types/src/containers/PullRequestsArticle/index.d.ts.map +1 -0
  233. package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts +13 -0
  234. package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts.map +1 -0
  235. package/dist/types/src/containers/WalkthroughArticle/index.d.ts +2 -0
  236. package/dist/types/src/containers/WalkthroughArticle/index.d.ts.map +1 -0
  237. package/dist/types/src/containers/index.d.ts +7 -0
  238. package/dist/types/src/containers/index.d.ts.map +1 -0
  239. package/dist/types/src/errors.d.ts +157 -0
  240. package/dist/types/src/errors.d.ts.map +1 -0
  241. package/dist/types/src/extensions/index.d.ts +3 -0
  242. package/dist/types/src/extensions/index.d.ts.map +1 -0
  243. package/dist/types/src/extensions/links.d.ts +21 -0
  244. package/dist/types/src/extensions/links.d.ts.map +1 -0
  245. package/dist/types/src/extensions/links.test.d.ts +2 -0
  246. package/dist/types/src/extensions/links.test.d.ts.map +1 -0
  247. package/dist/types/src/extensions/references.d.ts +23 -0
  248. package/dist/types/src/extensions/references.d.ts.map +1 -0
  249. package/dist/types/src/extensions/references.test.d.ts +2 -0
  250. package/dist/types/src/extensions/references.test.d.ts.map +1 -0
  251. package/dist/types/src/github-link.d.ts +29 -0
  252. package/dist/types/src/github-link.d.ts.map +1 -0
  253. package/dist/types/src/hooks/index.d.ts +5 -2
  254. package/dist/types/src/hooks/index.d.ts.map +1 -1
  255. package/dist/types/src/hooks/useOpenObject.d.ts +9 -0
  256. package/dist/types/src/hooks/useOpenObject.d.ts.map +1 -0
  257. package/dist/types/src/hooks/usePullRequestChecks.d.ts +10 -0
  258. package/dist/types/src/hooks/usePullRequestChecks.d.ts.map +1 -0
  259. package/dist/types/src/hooks/usePullRequestDiff.d.ts +12 -0
  260. package/dist/types/src/hooks/usePullRequestDiff.d.ts.map +1 -0
  261. package/dist/types/src/hooks/usePullRequestFiles.d.ts +22 -0
  262. package/dist/types/src/hooks/usePullRequestFiles.d.ts.map +1 -0
  263. package/dist/types/src/hooks/useSyncPullRequest.d.ts +10 -0
  264. package/dist/types/src/hooks/useSyncPullRequest.d.ts.map +1 -0
  265. package/dist/types/src/index.d.ts +3 -3
  266. package/dist/types/src/index.d.ts.map +1 -1
  267. package/dist/types/src/meta.d.ts +34 -11
  268. package/dist/types/src/meta.d.ts.map +1 -1
  269. package/dist/types/src/operations/add-pull-request-comment.d.ts +5 -0
  270. package/dist/types/src/operations/add-pull-request-comment.d.ts.map +1 -0
  271. package/dist/types/src/operations/add-pull-request-review-comment.d.ts +5 -0
  272. package/dist/types/src/operations/add-pull-request-review-comment.d.ts.map +1 -0
  273. package/dist/types/src/operations/generate-walkthrough.d.ts +11 -0
  274. package/dist/types/src/operations/generate-walkthrough.d.ts.map +1 -0
  275. package/dist/types/src/operations/get-pull-request-diff.d.ts +5 -0
  276. package/dist/types/src/operations/get-pull-request-diff.d.ts.map +1 -0
  277. package/dist/types/src/operations/get-pull-request-status.d.ts +5 -0
  278. package/dist/types/src/operations/get-pull-request-status.d.ts.map +1 -0
  279. package/dist/types/src/operations/get-repositories.d.ts +13 -0
  280. package/dist/types/src/operations/get-repositories.d.ts.map +1 -0
  281. package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts +12 -0
  282. package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts.map +1 -0
  283. package/dist/types/src/operations/import-pull-request.d.ts +63 -0
  284. package/dist/types/src/operations/import-pull-request.d.ts.map +1 -0
  285. package/dist/types/src/operations/import-pull-request.test.d.ts +2 -0
  286. package/dist/types/src/operations/import-pull-request.test.d.ts.map +1 -0
  287. package/dist/types/src/operations/index.d.ts +3 -0
  288. package/dist/types/src/operations/index.d.ts.map +1 -0
  289. package/dist/types/src/operations/materialize-target.d.ts +12 -0
  290. package/dist/types/src/operations/materialize-target.d.ts.map +1 -0
  291. package/dist/types/src/operations/pull-request.d.ts +48 -0
  292. package/dist/types/src/operations/pull-request.d.ts.map +1 -0
  293. package/dist/types/src/operations/pull-request.test.d.ts +2 -0
  294. package/dist/types/src/operations/pull-request.test.d.ts.map +1 -0
  295. package/dist/types/src/operations/refresh-pull-requests.d.ts +5 -0
  296. package/dist/types/src/operations/refresh-pull-requests.d.ts.map +1 -0
  297. package/dist/types/src/operations/refresh.d.ts +37 -0
  298. package/dist/types/src/operations/refresh.d.ts.map +1 -0
  299. package/dist/types/src/operations/refresh.test.d.ts +2 -0
  300. package/dist/types/src/operations/refresh.test.d.ts.map +1 -0
  301. package/dist/types/src/operations/submit-pull-request-approval.d.ts +5 -0
  302. package/dist/types/src/operations/submit-pull-request-approval.d.ts.map +1 -0
  303. package/dist/types/src/operations/sync-pull-request.d.ts +5 -0
  304. package/dist/types/src/operations/sync-pull-request.d.ts.map +1 -0
  305. package/dist/types/src/operations/sync.d.ts +123 -0
  306. package/dist/types/src/operations/sync.d.ts.map +1 -0
  307. package/dist/types/src/operations/sync.test.d.ts +2 -0
  308. package/dist/types/src/operations/sync.test.d.ts.map +1 -0
  309. package/dist/types/src/plugin.d.ts +4 -0
  310. package/dist/types/src/plugin.d.ts.map +1 -0
  311. package/dist/types/src/plugin.test.d.ts +2 -0
  312. package/dist/types/src/plugin.test.d.ts.map +1 -0
  313. package/dist/types/src/pull-request-body.d.ts +37 -0
  314. package/dist/types/src/pull-request-body.d.ts.map +1 -0
  315. package/dist/types/src/pull-request-body.test.d.ts +2 -0
  316. package/dist/types/src/pull-request-body.test.d.ts.map +1 -0
  317. package/dist/types/src/pull-request.d.ts +28 -0
  318. package/dist/types/src/pull-request.d.ts.map +1 -0
  319. package/dist/types/src/pull-request.test.d.ts +2 -0
  320. package/dist/types/src/pull-request.test.d.ts.map +1 -0
  321. package/dist/types/src/services/github-api.d.ts +332 -0
  322. package/dist/types/src/services/github-api.d.ts.map +1 -0
  323. package/dist/types/src/services/index.d.ts +2 -0
  324. package/dist/types/src/services/index.d.ts.map +1 -0
  325. package/dist/types/src/skills/GitHubSkill.d.ts +12 -0
  326. package/dist/types/src/skills/GitHubSkill.d.ts.map +1 -0
  327. package/dist/types/src/skills/index.d.ts +2 -0
  328. package/dist/types/src/skills/index.d.ts.map +1 -0
  329. package/dist/types/src/stories/Generate.stories.d.ts +27 -0
  330. package/dist/types/src/stories/Generate.stories.d.ts.map +1 -0
  331. package/dist/types/src/stories/Links.stories.d.ts +23 -0
  332. package/dist/types/src/stories/Links.stories.d.ts.map +1 -0
  333. package/dist/types/src/stories/PullRequestArticle.stories.d.ts +359 -0
  334. package/dist/types/src/stories/PullRequestArticle.stories.d.ts.map +1 -0
  335. package/dist/types/src/stories/PullRequestFiles.stories.d.ts +365 -0
  336. package/dist/types/src/stories/PullRequestFiles.stories.d.ts.map +1 -0
  337. package/dist/types/src/stories/PullRequestOverview.stories.d.ts +367 -0
  338. package/dist/types/src/stories/PullRequestOverview.stories.d.ts.map +1 -0
  339. package/dist/types/src/stories/PullRequestsArticle.stories.d.ts +357 -0
  340. package/dist/types/src/stories/PullRequestsArticle.stories.d.ts.map +1 -0
  341. package/dist/types/src/stories/Walkthrough.stories.d.ts +380 -0
  342. package/dist/types/src/stories/Walkthrough.stories.d.ts.map +1 -0
  343. package/dist/types/src/stories/github.d.ts +23 -0
  344. package/dist/types/src/stories/github.d.ts.map +1 -0
  345. package/dist/types/src/stories/github.test.d.ts +2 -0
  346. package/dist/types/src/stories/github.test.d.ts.map +1 -0
  347. package/dist/types/src/stories/walkthrough-fixture.d.ts +8 -0
  348. package/dist/types/src/stories/walkthrough-fixture.d.ts.map +1 -0
  349. package/dist/types/src/testing/fixtures.d.ts +14 -0
  350. package/dist/types/src/testing/fixtures.d.ts.map +1 -0
  351. package/dist/types/src/testing/index.d.ts +4 -0
  352. package/dist/types/src/testing/index.d.ts.map +1 -0
  353. package/dist/types/src/testing/plugin.d.ts +4 -0
  354. package/dist/types/src/testing/plugin.d.ts.map +1 -0
  355. package/dist/types/src/testing/pull-request-13348.d.ts +6 -0
  356. package/dist/types/src/testing/pull-request-13348.d.ts.map +1 -0
  357. package/dist/types/src/translations.d.ts +339 -53
  358. package/dist/types/src/translations.d.ts.map +1 -1
  359. package/dist/types/src/types/GitHubCapabilities.d.ts +13 -0
  360. package/dist/types/src/types/GitHubCapabilities.d.ts.map +1 -0
  361. package/dist/types/src/types/GitHubEvents.d.ts +8 -0
  362. package/dist/types/src/types/GitHubEvents.d.ts.map +1 -0
  363. package/dist/types/src/types/GitHubOperation.d.ts +281 -0
  364. package/dist/types/src/types/GitHubOperation.d.ts.map +1 -0
  365. package/dist/types/src/types/PullRequestsView.d.ts +35 -0
  366. package/dist/types/src/types/PullRequestsView.d.ts.map +1 -0
  367. package/dist/types/src/types/Walkthrough.d.ts +31 -0
  368. package/dist/types/src/types/Walkthrough.d.ts.map +1 -0
  369. package/dist/types/src/types/Walkthrough.test.d.ts +2 -0
  370. package/dist/types/src/types/Walkthrough.test.d.ts.map +1 -0
  371. package/dist/types/src/types/index.d.ts +5 -0
  372. package/dist/types/src/types/index.d.ts.map +1 -0
  373. package/dist/types/src/walkthrough/fill.d.ts +28 -0
  374. package/dist/types/src/walkthrough/fill.d.ts.map +1 -0
  375. package/dist/types/src/walkthrough/fill.test.d.ts +2 -0
  376. package/dist/types/src/walkthrough/fill.test.d.ts.map +1 -0
  377. package/dist/types/src/walkthrough/generate.d.ts +67 -0
  378. package/dist/types/src/walkthrough/generate.d.ts.map +1 -0
  379. package/dist/types/src/walkthrough/generate.test.d.ts +2 -0
  380. package/dist/types/src/walkthrough/generate.test.d.ts.map +1 -0
  381. package/dist/types/src/walkthrough/generated.d.ts +20 -0
  382. package/dist/types/src/walkthrough/generated.d.ts.map +1 -0
  383. package/dist/types/src/walkthrough/generated.test.d.ts +2 -0
  384. package/dist/types/src/walkthrough/generated.test.d.ts.map +1 -0
  385. package/dist/types/src/walkthrough/headings.d.ts +8 -0
  386. package/dist/types/src/walkthrough/headings.d.ts.map +1 -0
  387. package/dist/types/src/walkthrough/headings.test.d.ts +2 -0
  388. package/dist/types/src/walkthrough/headings.test.d.ts.map +1 -0
  389. package/dist/types/src/walkthrough/index.d.ts +9 -0
  390. package/dist/types/src/walkthrough/index.d.ts.map +1 -0
  391. package/dist/types/src/walkthrough/patch.d.ts +48 -0
  392. package/dist/types/src/walkthrough/patch.d.ts.map +1 -0
  393. package/dist/types/src/walkthrough/plan.d.ts +55 -0
  394. package/dist/types/src/walkthrough/plan.d.ts.map +1 -0
  395. package/dist/types/src/walkthrough/plan.test.d.ts +2 -0
  396. package/dist/types/src/walkthrough/plan.test.d.ts.map +1 -0
  397. package/dist/types/src/walkthrough/prompt.d.ts +33 -0
  398. package/dist/types/src/walkthrough/prompt.d.ts.map +1 -0
  399. package/dist/types/src/walkthrough/prompt.test.d.ts +2 -0
  400. package/dist/types/src/walkthrough/prompt.test.d.ts.map +1 -0
  401. package/dist/types/src/walkthrough/score.d.ts +43 -0
  402. package/dist/types/src/walkthrough/score.d.ts.map +1 -0
  403. package/dist/types/src/walkthrough/score.test.d.ts +2 -0
  404. package/dist/types/src/walkthrough/score.test.d.ts.map +1 -0
  405. package/dist/types/tsconfig.tsbuildinfo +1 -0
  406. package/dx.config.ts +39 -0
  407. package/package.json +167 -48
  408. package/src/Extensions.ts +7 -0
  409. package/src/GitHubPlugin.ts +15 -0
  410. package/src/GitHubPlugin.workerd.test.ts +23 -0
  411. package/src/approval.test.ts +40 -0
  412. package/src/approval.ts +39 -0
  413. package/src/capabilities/app-graph-builder.ts +47 -0
  414. package/src/capabilities/connector.ts +95 -0
  415. package/src/capabilities/gen/browser.ts +82 -0
  416. package/src/capabilities/gen/node.ts +43 -0
  417. package/src/capabilities/gen/tauri.ts +82 -0
  418. package/src/capabilities/gen/workerd.ts +43 -0
  419. package/src/capabilities/index.ts +71 -0
  420. package/src/capabilities/link-resolver.ts +137 -0
  421. package/src/capabilities/markdown-extension.ts +146 -0
  422. package/src/capabilities/operation-handler.ts +16 -0
  423. package/src/capabilities/page-action.ts +32 -0
  424. package/src/capabilities/react-surface.ts +98 -0
  425. package/src/capabilities/schema.ts +16 -0
  426. package/src/capabilities/skill-definition.ts +14 -0
  427. package/src/cards/GitHubCard.stories.tsx +165 -0
  428. package/src/cards/GitHubCard.tsx +93 -0
  429. package/src/cards/PullRequestCard.tsx +23 -0
  430. package/src/cards/index.ts +6 -0
  431. package/src/components/CommentComposer/CommentComposer.tsx +109 -0
  432. package/src/components/CommentComposer/index.ts +5 -0
  433. package/src/components/PullRequestFiles/DiffStat.tsx +15 -0
  434. package/src/components/PullRequestFiles/FileTree.tsx +102 -0
  435. package/src/components/PullRequestFiles/PullRequestFiles.tsx +87 -0
  436. package/src/components/PullRequestFiles/files.test.ts +59 -0
  437. package/src/components/PullRequestFiles/files.ts +115 -0
  438. package/src/components/PullRequestFiles/index.ts +8 -0
  439. package/src/components/PullRequestOverview/ArtifactPill.tsx +82 -0
  440. package/src/components/PullRequestOverview/CheckRunList.test.ts +29 -0
  441. package/src/components/PullRequestOverview/CheckRunList.tsx +141 -0
  442. package/src/components/PullRequestOverview/PullRequestDetails.tsx +15 -0
  443. package/src/components/PullRequestOverview/PullRequestOverview.tsx +110 -0
  444. package/src/components/PullRequestOverview/RelatedCards.tsx +147 -0
  445. package/src/components/PullRequestOverview/index.ts +9 -0
  446. package/src/components/PullRequestStatus/PullRequestStatus.tsx +84 -0
  447. package/src/components/PullRequestStatus/index.ts +5 -0
  448. package/src/components/WalkthroughView/WalkthroughView.tsx +62 -0
  449. package/src/components/WalkthroughView/extensions.ts +53 -0
  450. package/src/components/WalkthroughView/index.ts +6 -0
  451. package/src/components/index.ts +6 -9
  452. package/src/constants.ts +12 -0
  453. package/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.tsx +160 -0
  454. package/src/containers/ImportPullRequestDialog/index.ts +7 -0
  455. package/src/containers/PullRequestArticle/PullRequestArticle.tsx +573 -0
  456. package/src/containers/PullRequestArticle/failure.test.ts +42 -0
  457. package/src/containers/PullRequestArticle/failure.ts +16 -0
  458. package/src/containers/PullRequestArticle/index.ts +5 -0
  459. package/src/containers/PullRequestCardMenu/PullRequestCardMenu.tsx +134 -0
  460. package/src/containers/PullRequestCardMenu/index.ts +5 -0
  461. package/src/containers/PullRequestsArticle/PullRequestsArticle.tsx +361 -0
  462. package/src/containers/PullRequestsArticle/arrange.test.ts +122 -0
  463. package/src/containers/PullRequestsArticle/arrange.ts +245 -0
  464. package/src/containers/PullRequestsArticle/format.ts +31 -0
  465. package/src/containers/PullRequestsArticle/index.ts +5 -0
  466. package/src/containers/WalkthroughArticle/WalkthroughArticle.tsx +31 -0
  467. package/src/containers/WalkthroughArticle/index.ts +5 -0
  468. package/src/containers/index.ts +11 -0
  469. package/src/errors.ts +61 -0
  470. package/src/extensions/index.ts +6 -0
  471. package/src/extensions/links.test.ts +133 -0
  472. package/src/extensions/links.ts +91 -0
  473. package/src/extensions/references.test.ts +83 -0
  474. package/src/extensions/references.ts +100 -0
  475. package/src/github-link.ts +70 -0
  476. package/src/hooks/index.ts +6 -3
  477. package/src/hooks/useOpenObject.ts +48 -0
  478. package/src/hooks/usePullRequestChecks.ts +81 -0
  479. package/src/hooks/usePullRequestDiff.ts +57 -0
  480. package/src/hooks/usePullRequestFiles.ts +98 -0
  481. package/src/hooks/useSyncPullRequest.ts +51 -0
  482. package/src/index.ts +4 -6
  483. package/src/meta.ts +8 -13
  484. package/src/operations/add-pull-request-comment.ts +31 -0
  485. package/src/operations/add-pull-request-review-comment.ts +32 -0
  486. package/src/operations/generate-walkthrough.ts +124 -0
  487. package/src/operations/get-pull-request-diff.ts +37 -0
  488. package/src/operations/get-pull-request-status.ts +44 -0
  489. package/src/operations/get-repositories.ts +53 -0
  490. package/src/operations/import-pull-request-from-snapshot.ts +48 -0
  491. package/src/operations/import-pull-request.test.ts +151 -0
  492. package/src/operations/import-pull-request.ts +149 -0
  493. package/src/operations/index.ts +30 -0
  494. package/src/operations/materialize-target.ts +60 -0
  495. package/src/operations/pull-request.test.ts +120 -0
  496. package/src/operations/pull-request.ts +141 -0
  497. package/src/operations/refresh-pull-requests.ts +69 -0
  498. package/src/operations/refresh.test.ts +112 -0
  499. package/src/operations/refresh.ts +111 -0
  500. package/src/operations/submit-pull-request-approval.ts +41 -0
  501. package/src/operations/sync-pull-request.ts +34 -0
  502. package/src/operations/sync.test.ts +453 -0
  503. package/src/operations/sync.ts +807 -0
  504. package/src/plugin.test.ts +40 -0
  505. package/src/plugin.ts +37 -0
  506. package/src/pull-request-body.test.ts +61 -0
  507. package/src/pull-request-body.ts +144 -0
  508. package/src/pull-request.test.ts +67 -0
  509. package/src/pull-request.ts +80 -0
  510. package/src/services/github-api.ts +735 -0
  511. package/src/services/index.ts +5 -0
  512. package/src/skills/GitHubSkill.ts +46 -0
  513. package/src/skills/index.ts +5 -0
  514. package/src/stories/Generate.stories.tsx +152 -0
  515. package/src/stories/Links.stories.tsx +153 -0
  516. package/src/stories/PullRequestArticle.stories.tsx +107 -0
  517. package/src/stories/PullRequestFiles.stories.tsx +69 -0
  518. package/src/stories/PullRequestOverview.stories.tsx +114 -0
  519. package/src/stories/PullRequestsArticle.stories.tsx +170 -0
  520. package/src/stories/Walkthrough.stories.tsx +110 -0
  521. package/src/stories/github.test.ts +65 -0
  522. package/src/stories/github.ts +70 -0
  523. package/src/stories/walkthrough-fixture.ts +115 -0
  524. package/src/testing/fixtures.ts +99 -0
  525. package/src/testing/index.ts +7 -0
  526. package/src/testing/plugin.ts +25 -0
  527. package/src/testing/pull-request-13348.ts +104 -0
  528. package/src/testing/pull-request-13363.patch +2981 -0
  529. package/src/translations.ts +135 -63
  530. package/src/types/GitHubCapabilities.ts +27 -0
  531. package/src/types/GitHubEvents.ts +16 -0
  532. package/src/types/GitHubOperation.ts +397 -0
  533. package/src/types/PullRequestsView.ts +45 -0
  534. package/src/types/Walkthrough.test.ts +75 -0
  535. package/src/types/Walkthrough.ts +66 -0
  536. package/src/types/index.ts +8 -0
  537. package/src/vite-env.d.ts +15 -0
  538. package/src/walkthrough/fill.test.ts +337 -0
  539. package/src/walkthrough/fill.ts +246 -0
  540. package/src/walkthrough/generate.test.ts +219 -0
  541. package/src/walkthrough/generate.ts +248 -0
  542. package/src/walkthrough/generated.test.ts +70 -0
  543. package/src/walkthrough/generated.ts +70 -0
  544. package/src/walkthrough/headings.test.ts +40 -0
  545. package/src/walkthrough/headings.ts +39 -0
  546. package/src/walkthrough/index.ts +12 -0
  547. package/src/walkthrough/patch.ts +154 -0
  548. package/src/walkthrough/plan.test.ts +178 -0
  549. package/src/walkthrough/plan.ts +251 -0
  550. package/src/walkthrough/prompt.test.ts +100 -0
  551. package/src/walkthrough/prompt.ts +147 -0
  552. package/src/walkthrough/score.test.ts +272 -0
  553. package/src/walkthrough/score.ts +430 -0
  554. package/README.md +0 -15
  555. package/dist/lib/browser/chunk-S4MPSBA5.mjs +0 -21
  556. package/dist/lib/browser/chunk-S4MPSBA5.mjs.map +0 -7
  557. package/dist/lib/browser/index.css +0 -7
  558. package/dist/lib/browser/index.css.map +0 -7
  559. package/dist/lib/browser/index.mjs +0 -1535
  560. package/dist/lib/browser/index.mjs.map +0 -7
  561. package/dist/lib/browser/meta.json +0 -1
  562. package/dist/lib/browser/meta.mjs +0 -11
  563. package/dist/lib/browser/meta.mjs.map +0 -7
  564. package/dist/types/src/GithubPlugin.d.ts +0 -4
  565. package/dist/types/src/GithubPlugin.d.ts.map +0 -1
  566. package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts +0 -4
  567. package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts.map +0 -1
  568. package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts +0 -9
  569. package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts.map +0 -1
  570. package/dist/types/src/components/EmbeddedMain/index.d.ts +0 -2
  571. package/dist/types/src/components/EmbeddedMain/index.d.ts.map +0 -1
  572. package/dist/types/src/components/ExportDialog.d.ts +0 -8
  573. package/dist/types/src/components/ExportDialog.d.ts.map +0 -1
  574. package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts +0 -3
  575. package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts.map +0 -1
  576. package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts +0 -15
  577. package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts.map +0 -1
  578. package/dist/types/src/components/GithubApiProviders/index.d.ts +0 -3
  579. package/dist/types/src/components/GithubApiProviders/index.d.ts.map +0 -1
  580. package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts +0 -6
  581. package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts.map +0 -1
  582. package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts +0 -7
  583. package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts.map +0 -1
  584. package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts +0 -6
  585. package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts.map +0 -1
  586. package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts +0 -16
  587. package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts.map +0 -1
  588. package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts +0 -3
  589. package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts.map +0 -1
  590. package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts +0 -11
  591. package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts.map +0 -1
  592. package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts +0 -3
  593. package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts.map +0 -1
  594. package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts +0 -6
  595. package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts.map +0 -1
  596. package/dist/types/src/components/ImportDialog.d.ts +0 -7
  597. package/dist/types/src/components/ImportDialog.d.ts.map +0 -1
  598. package/dist/types/src/components/Issue.d.ts +0 -5
  599. package/dist/types/src/components/Issue.d.ts.map +0 -1
  600. package/dist/types/src/components/Loading/Loading.d.ts +0 -15
  601. package/dist/types/src/components/Loading/Loading.d.ts.map +0 -1
  602. package/dist/types/src/components/Loading/Loading.stories.d.ts +0 -40
  603. package/dist/types/src/components/Loading/Loading.stories.d.ts.map +0 -1
  604. package/dist/types/src/components/Loading/index.d.ts +0 -2
  605. package/dist/types/src/components/Loading/index.d.ts.map +0 -1
  606. package/dist/types/src/components/MarkdownActions.d.ts +0 -7
  607. package/dist/types/src/components/MarkdownActions.d.ts.map +0 -1
  608. package/dist/types/src/components/UrlDialog.d.ts +0 -6
  609. package/dist/types/src/components/UrlDialog.d.ts.map +0 -1
  610. package/dist/types/src/hooks/useDocGhId.d.ts +0 -6
  611. package/dist/types/src/hooks/useDocGhId.d.ts.map +0 -1
  612. package/dist/types/src/hooks/useGhIdFromUrl.d.ts +0 -2
  613. package/dist/types/src/hooks/useGhIdFromUrl.d.ts.map +0 -1
  614. package/dist/types/src/types.d.ts +0 -30
  615. package/dist/types/src/types.d.ts.map +0 -1
  616. package/src/GithubPlugin.tsx +0 -127
  617. package/src/components/EmbeddedMain/EmbeddedMain.tsx +0 -294
  618. package/src/components/EmbeddedMain/GfmPreview.tsx +0 -110
  619. package/src/components/EmbeddedMain/embedded.css +0 -3
  620. package/src/components/EmbeddedMain/index.ts +0 -5
  621. package/src/components/ExportDialog.tsx +0 -157
  622. package/src/components/GithubApiProviders/GitHubSettings.tsx +0 -72
  623. package/src/components/GithubApiProviders/OctokitProvider.tsx +0 -60
  624. package/src/components/GithubApiProviders/index.ts +0 -6
  625. package/src/components/GithubEchoResolverProviders/DocumentTreeItem.tsx +0 -26
  626. package/src/components/GithubEchoResolverProviders/ResolverContext.tsx +0 -137
  627. package/src/components/GithubEchoResolverProviders/ResolverDialog.tsx +0 -34
  628. package/src/components/GithubEchoResolverProviders/ResolverProps.ts +0 -23
  629. package/src/components/GithubEchoResolverProviders/ResolverTree.tsx +0 -86
  630. package/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.tsx +0 -105
  631. package/src/components/GithubEchoResolverProviders/index.ts +0 -6
  632. package/src/components/GithubEchoResolverProviders/spaceResolvers.ts +0 -86
  633. package/src/components/ImportDialog.tsx +0 -72
  634. package/src/components/Issue.tsx +0 -62
  635. package/src/components/Loading/Loading.stories.tsx +0 -32
  636. package/src/components/Loading/Loading.tsx +0 -70
  637. package/src/components/Loading/index.ts +0 -5
  638. package/src/components/MarkdownActions.tsx +0 -136
  639. package/src/components/UrlDialog.tsx +0 -52
  640. package/src/hooks/useDocGhId.ts +0 -38
  641. package/src/hooks/useGhIdFromUrl.ts +0 -26
  642. package/src/types.ts +0 -51
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-PullRequestsArticle.mjs","names":[],"sources":["../../src/hooks/usePullRequestChecks.ts","../../src/types/PullRequestsView.ts","../../src/containers/PullRequestsArticle/arrange.ts","../../src/containers/PullRequestsArticle/format.ts","../../src/containers/PullRequestsArticle/PullRequestsArticle.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport { Ref } from '@dxos/echo';\nimport { type SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type PullRequest } from '@dxos/types';\n\nimport { GitHubOperation } from '#types';\n\nimport { type PullRequestChecks } from '../containers/PullRequestsArticle/arrange.ts';\n\n/** How long a pull request's checks stand before they are read from GitHub again. */\nconst CHECKS_INTERVAL = 5 * 60_000;\n\n/** Status reads in flight at once: each costs three GitHub requests, and a list can hold hundreds. */\nconst CONCURRENCY = 4;\n\n// Keyed by object id and shared across mounts, so reopening the list within the interval costs nothing.\nconst cache = new Map<string, { at: number; checks: PullRequestChecks }>();\n\n/** Whether a pull request's checks still change; a merged or closed one's head is settled. */\nconst isLive = (pullRequest: PullRequest.PullRequest) => pullRequest.state === 'open' || pullRequest.state === 'draft';\n\n/**\n * The CI and review standing of every live pull request in `pullRequests`, keyed by object id and\n * filled in as each read lands. Finished pull requests are not read: their checks no longer ask\n * anything of the reader.\n */\nexport const usePullRequestChecks = (\n pullRequests: readonly PullRequest.PullRequest[],\n spaceId: SpaceId | undefined,\n): ReadonlyMap<string, PullRequestChecks> => {\n const { invokePromise } = Hooks.useOperationInvoker();\n const [checks, setChecks] = useState<ReadonlyMap<string, PullRequestChecks>>(\n () => new Map([...cache].map(([id, { checks }]) => [id, checks])),\n );\n\n useEffect(() => {\n if (!spaceId) {\n return;\n }\n\n let cancelled = false;\n const now = Date.now();\n const queue = pullRequests.filter(\n (pullRequest) => isLive(pullRequest) && now - (cache.get(pullRequest.id)?.at ?? 0) >= CHECKS_INTERVAL,\n );\n\n const worker = async () => {\n for (let pullRequest = queue.shift(); pullRequest && !cancelled; pullRequest = queue.shift()) {\n const { data, error } = await invokePromise(\n GitHubOperation.GetPullRequestStatus,\n { pullRequest: Ref.make(pullRequest) },\n { spaceId },\n );\n if (error || !data) {\n log.warn('pull request checks failed', { pullRequest: pullRequest.id, error });\n continue;\n }\n const next = { ci: data.ci, checks: data.checks, review: data.review, approvals: data.approvals };\n cache.set(pullRequest.id, { at: Date.now(), checks: next });\n // Set even once cancelled: the next run skips this pull request as freshly cached, so a read\n // that lands across a re-run would otherwise never reach the list.\n const id = pullRequest.id;\n setChecks((previous) => new Map(previous).set(id, next));\n }\n };\n\n void Promise.all(Array.from({ length: Math.min(CONCURRENCY, queue.length) }, worker));\n return () => {\n cancelled = true;\n };\n }, [invokePromise, pullRequests, spaceId]);\n\n return checks;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { ViewState } from '@dxos/react-ui-attention/types';\n\n/**\n * The fields the pull request list can be ordered by. `relevance` ranks what needs the reader first\n * (see `relevance`); `updated` and `created` are GitHub's times.\n */\nexport const SortField = Schema.Literals(['relevance', 'updated', 'created', 'number', 'title']);\nexport type SortField = Schema.Schema.Type<typeof SortField>;\n\nexport const SortDirection = Schema.Literals(['asc', 'desc']);\nexport type SortDirection = Schema.Schema.Type<typeof SortDirection>;\n\nexport const Sort = Schema.Struct({ field: SortField, direction: SortDirection });\nexport type Sort = Schema.Schema.Type<typeof Sort>;\n\n/** The fields the list can be grouped by; `none` is one ungrouped list. */\nexport const GroupField = Schema.Literals(['none', 'repo', 'state', 'checks', 'author']);\nexport type GroupField = Schema.Schema.Type<typeof GroupField>;\n\nexport const DEFAULT_SORT: Sort = { field: 'relevance', direction: 'desc' };\n\nexport const View = Schema.Struct({\n query: Schema.String,\n sort: Schema.optional(Sort),\n group: Schema.optional(GroupField),\n});\nexport type View = Schema.Schema.Type<typeof View>;\n\n/**\n * How a reader has the space's pull requests arranged, keyed by the space and held per device\n * (`local`), as a task set's list is: the filter, order and grouping are how this reader looks at the\n * list here, not a property of the space every member would see.\n */\nexport const aspect: ViewState.Aspect<View> = ViewState.define<View>({\n key: 'github-pull-requests-view',\n backend: 'local',\n schema: View,\n defaultValue: (): View => ({ query: '' }),\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Filter } from '@dxos/echo';\nimport { matchesFilter } from '@dxos/echo-query';\nimport { PullRequest, type Task } from '@dxos/types';\n\nimport { type GitHubOperation } from '#types';\n\nimport type * as PullRequestsView from '../../types/PullRequestsView.ts';\n\n/** The live part of a pull request's standing, read from GitHub rather than stored. */\nexport type PullRequestChecks = {\n ci: GitHubOperation.CiState;\n checks: GitHubOperation.CheckCounts;\n review: GitHubOperation.ReviewState;\n approvals: number;\n};\n\n/** One row of the list: the stored pull request, its live checks once they arrive, and the tasks that list it. */\nexport type PullRequestRow = {\n pullRequest: PullRequest.PullRequest;\n checks?: PullRequestChecks;\n tasks: readonly Task.Task[];\n};\n\nexport type PullRequestRowGroup = {\n id: string;\n /** A literal (a repository, an author) or a translation key in the plugin's namespace. */\n label: string;\n translate?: boolean;\n icon: string;\n hue?: string;\n rows: readonly PullRequestRow[];\n};\n\n/** What a free-text term searches: what a reader sees in the row. */\nconst rowText = (pullRequest: PullRequest.PullRequest) => [\n pullRequest.title,\n PullRequest.reference(pullRequest),\n pullRequest.author,\n pullRequest.headBranch,\n];\n\n/** The rows the toolbar's query keeps, in input order; an absent filter keeps every row. */\nexport const filterRows = (rows: readonly PullRequestRow[], filter?: Filter.Any): readonly PullRequestRow[] =>\n filter ? rows.filter(({ pullRequest }) => matchesFilter(filter, pullRequest, { text: rowText })) : rows;\n\nconst STATE_WEIGHT: Record<PullRequest.State, number> = { open: 1_000, draft: 600, merged: 100, closed: 0 };\n\n/**\n * How much a row asks of the reader now: an open pull request outranks a draft, which outranks a\n * finished one; within those, red CI or requested changes (something to fix) outrank one ready to\n * merge, which outranks one still waiting; and a pull request some task tracks is nudged up.\n */\nexport const relevance = ({ pullRequest, checks, tasks }: PullRequestRow): number => {\n let score = STATE_WEIGHT[pullRequest.state];\n if (pullRequest.state === 'open' || pullRequest.state === 'draft') {\n if (checks?.ci === 'failure') {\n score += 300;\n }\n if (checks?.review === 'changes_requested') {\n score += 250;\n }\n if (checks?.review === 'approved' && checks.ci !== 'failure' && checks.ci !== 'pending') {\n score += 200;\n }\n if (checks?.ci === 'pending') {\n score += 50;\n }\n }\n if (tasks.length > 0) {\n score += 25;\n }\n return score;\n};\n\nconst time = (value: string | undefined): number => {\n const parsed = value ? Date.parse(value) : Number.NaN;\n return Number.isNaN(parsed) ? 0 : parsed;\n};\n\n/** Newest activity GitHub reported, falling back to when it was opened. */\nconst activity = (pullRequest: PullRequest.PullRequest): number =>\n time(pullRequest.updatedAt) || time(pullRequest.createdAt);\n\nconst byRecency = (left: PullRequestRow, right: PullRequestRow): number =>\n activity(left.pullRequest) - activity(right.pullRequest) || left.pullRequest.number - right.pullRequest.number;\n\nconst compareBy: Record<PullRequestsView.SortField, (left: PullRequestRow, right: PullRequestRow) => number> = {\n // Ties broken by recency, so equally urgent rows read newest first under the default (descending) order.\n relevance: (left, right) => relevance(left) - relevance(right) || byRecency(left, right),\n updated: byRecency,\n created: (left, right) =>\n time(left.pullRequest.createdAt) - time(right.pullRequest.createdAt) ||\n left.pullRequest.number - right.pullRequest.number,\n number: (left, right) => left.pullRequest.number - right.pullRequest.number,\n title: (left, right) =>\n (left.pullRequest.title ?? '').localeCompare(right.pullRequest.title ?? '', undefined, { sensitivity: 'base' }),\n};\n\n/** The rows reordered by `sort`, ties kept in input order. */\nexport const sortRows = (rows: readonly PullRequestRow[], sort: PullRequestsView.Sort): readonly PullRequestRow[] => {\n const compare = compareBy[sort.field];\n const sign = sort.direction === 'desc' ? -1 : 1;\n const index = new Map(rows.map((row, position) => [row.pullRequest.id, position]));\n return [...rows].sort(\n (left, right) =>\n sign * compare(left, right) || (index.get(left.pullRequest.id) ?? 0) - (index.get(right.pullRequest.id) ?? 0),\n );\n};\n\nconst STATE_ORDER: readonly PullRequest.State[] = ['open', 'draft', 'merged', 'closed'];\nconst STATE_ICON: Record<PullRequest.State, string> = {\n open: 'ph--git-pull-request--regular',\n draft: 'ph--git-pull-request--regular',\n merged: 'ph--git-merge--regular',\n closed: 'ph--x-circle--regular',\n};\nexport const STATE_HUE: Record<PullRequest.State, string> = {\n open: 'green',\n closed: 'red',\n merged: 'purple',\n draft: 'neutral',\n};\n\nconst CI_ORDER: readonly GitHubOperation.CiState[] = ['failure', 'pending', 'success', 'none'];\nconst CI_ICON: Record<GitHubOperation.CiState, string> = {\n failure: 'ph--x-circle--regular',\n pending: 'ph--circle-notch--regular',\n success: 'ph--check-circle--regular',\n none: 'ph--minus-circle--regular',\n};\nexport const CI_HUE: Record<GitHubOperation.CiState, string> = {\n success: 'green',\n failure: 'red',\n pending: 'amber',\n none: 'neutral',\n};\n\n/** Rows partitioned by a string key, groups in first-seen order unless `order` ranks them; empty groups dropped. */\nconst partition = <K extends string>(\n rows: readonly PullRequestRow[],\n key: (row: PullRequestRow) => K,\n make: (key: K, rows: readonly PullRequestRow[]) => PullRequestRowGroup,\n order?: (left: K, right: K) => number,\n): PullRequestRowGroup[] => {\n const byKey = new Map<K, PullRequestRow[]>();\n for (const row of rows) {\n const value = key(row);\n byKey.set(value, [...(byKey.get(value) ?? []), row]);\n }\n const keys = [...byKey.keys()];\n if (order) {\n keys.sort(order);\n }\n return keys.map((value) => make(value, byKey.get(value) ?? []));\n};\n\nconst rankOf =\n <T extends string>(values: readonly T[]) =>\n (left: T, right: T) =>\n values.indexOf(left) - values.indexOf(right);\n\n/**\n * The rows partitioned by `field`, each group's rows in input order (so a sort applies within every\n * group). Absent for `none`: an ungrouped list has no headers.\n */\nexport const groupRows = (\n rows: readonly PullRequestRow[],\n field: PullRequestsView.GroupField,\n): PullRequestRowGroup[] | undefined => {\n switch (field) {\n case 'none':\n return undefined;\n\n case 'repo':\n return partition(\n rows,\n ({ pullRequest }) => `${pullRequest.owner}/${pullRequest.repo}`,\n (repo, rows) => ({ id: `repo-${repo}`, label: repo, icon: 'ph--git-branch--regular', rows }),\n (left, right) => left.localeCompare(right),\n );\n\n case 'state':\n return partition(\n rows,\n ({ pullRequest }) => pullRequest.state,\n (state, rows) => ({\n id: `state-${state}`,\n label: `pull-request-state.${state}.label`,\n translate: true,\n icon: STATE_ICON[state],\n hue: STATE_HUE[state],\n rows,\n }),\n rankOf(STATE_ORDER),\n );\n\n case 'checks':\n return [\n ...partition(\n rows.filter((row) => row.checks),\n ({ checks }): GitHubOperation.CiState => checks?.ci ?? 'none',\n (ci, rows) => ({\n id: `checks-${ci}`,\n label: `ci-status.${ci}.label`,\n translate: true,\n icon: CI_ICON[ci],\n hue: CI_HUE[ci],\n rows,\n }),\n rankOf(CI_ORDER),\n ),\n // Rows whose checks have not arrived (or are not fetched, e.g. a merged pull request) last.\n ...partition(\n rows.filter((row) => !row.checks),\n () => 'unknown' as const,\n (_, rows) => ({\n id: 'checks-unknown',\n label: 'ci-status.unknown.label',\n translate: true,\n icon: 'ph--question--regular',\n rows,\n }),\n ),\n ];\n\n case 'author':\n return partition(\n rows,\n ({ pullRequest }) => pullRequest.author ?? '',\n (author, rows) => ({\n id: `author-${author}`,\n label: author || 'group-no-author.label',\n translate: !author,\n icon: author ? 'ph--user--regular' : 'ph--user-circle-dashed--regular',\n rows,\n }),\n // Unknown authors last; the rest by name.\n (left, right) => (left === '' ? 1 : right === '' ? -1 : left.localeCompare(right)),\n );\n }\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nconst UNITS: readonly [Intl.RelativeTimeFormatUnit, number][] = [\n ['year', 365 * 24 * 60 * 60_000],\n ['month', 30 * 24 * 60 * 60_000],\n ['week', 7 * 24 * 60 * 60_000],\n ['day', 24 * 60 * 60_000],\n ['hour', 60 * 60_000],\n ['minute', 60_000],\n];\n\n// Built once: constructing an `Intl` formatter resolves the locale each time, and every row formats.\nlet formatter: Intl.RelativeTimeFormat | undefined;\n\n/** `5 minutes ago`, `yesterday`, `3 weeks ago` — in the largest unit that fits; empty for an invalid date. */\nexport const formatRelative = (value: string, now = Date.now()): string => {\n const date = Date.parse(value);\n if (Number.isNaN(date)) {\n return '';\n }\n formatter ??= new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' });\n const elapsed = date - now;\n for (const [unit, size] of UNITS) {\n if (Math.abs(elapsed) >= size) {\n return formatter.format(Math.round(elapsed / size), unit);\n }\n }\n return formatter.format(0, 'minute');\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { useAtomValue } from '@effect/atom-react/Hooks';\nimport * as Atom from 'effect/reactivity/Atom';\nimport React, { useCallback, useMemo, useRef } from 'react';\n\nimport { type Database, Filter, Obj, Tag, Type } from '@dxos/echo';\nimport { QueryBuilder } from '@dxos/echo-query';\nimport { useQuery } from '@dxos/echo-react';\nimport { useAttention, useViewState, useViewStateActions } from '@dxos/react-ui-attention';\nimport { type EditorController } from '@dxos/react-ui-editor';\nimport { Listbox } from '@dxos/react-ui-list';\nimport { GroupMenu, SortMenu } from '@dxos/react-ui-menu';\nimport { QueryEditor, usePersistentQuery } from '@dxos/react-ui-query';\nimport * as Button from '@dxos/react-ui/Button';\nimport * as UiHooks from '@dxos/react-ui/Hooks';\nimport * as Icon from '@dxos/react-ui/Icon';\nimport * as Layout from '@dxos/react-ui/Layout';\nimport * as Panel from '@dxos/react-ui/Panel';\nimport * as Status from '@dxos/react-ui/Status';\nimport * as Toolbar from '@dxos/react-ui/Toolbar';\nimport { PullRequest, Task } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { useOpenObject, usePullRequestChecks } from '../../hooks/index.ts';\nimport * as PullRequestsView from '../../types/PullRequestsView.ts';\nimport {\n CI_HUE,\n type PullRequestChecks,\n type PullRequestRow,\n type PullRequestRowGroup,\n STATE_HUE,\n filterRows,\n groupRows,\n sortRows,\n} from './arrange.ts';\nimport { formatRelative } from './format.ts';\n\nconst PULL_REQUEST_TYPENAME = Type.getTypename(PullRequest.PullRequest);\n\nconst SORT_ICONS: Record<PullRequestsView.SortField, string> = {\n relevance: 'ph--lightning--regular',\n updated: 'ph--clock-clockwise--regular',\n created: 'ph--calendar-plus--regular',\n number: 'ph--hash--regular',\n title: 'ph--text-aa--regular',\n};\n\nconst GROUP_ICONS: Record<PullRequestsView.GroupField, string> = {\n none: 'ph--list--regular',\n repo: 'ph--git-branch--regular',\n state: 'ph--git-pull-request--regular',\n checks: 'ph--check-circle--regular',\n author: 'ph--user--regular',\n};\n\nexport type PullRequestsArticleProps = {\n role?: string;\n attendableId: string;\n /** The space's database; absent when the type node carries no space, which renders nothing. */\n db?: Database.Database;\n};\n\n/**\n * Every pull request in a space as one list a reader triages from: repository, title, CI checks,\n * the tasks that track it and its state, ordered by relevance (what needs the reader first) or time.\n * The filter, order and grouping persist per device and per space, through the same view-state\n * aspect, query editor and sort/group menus a task set's list uses.\n */\nexport const PullRequestsArticle = ({ db, ...props }: PullRequestsArticleProps) =>\n db ? <PullRequestList db={db} {...props} /> : null;\n\nPullRequestsArticle.displayName = 'PullRequestsArticle';\n\nconst PullRequestList = ({ role, attendableId, db }: PullRequestsArticleProps & { db: Database.Database }) => {\n const { t } = UiHooks.useTranslation(meta.profile.key);\n const { hasAttention } = useAttention(attendableId);\n const editorRef = useRef<EditorController>(null);\n const contextId = db.spaceId;\n\n const [query, setQuery] = usePersistentQuery(PullRequestsView.aspect, contextId, editorRef);\n const { sort = PullRequestsView.DEFAULT_SORT, group = 'none' } = useViewState(PullRequestsView.aspect, contextId);\n const { update } = useViewStateActions(PullRequestsView.aspect, contextId);\n const handleSortChange = useCallback(\n (sort: PullRequestsView.Sort) => update((view) => ({ ...view, sort })),\n [update],\n );\n const handleGroupChange = useCallback(\n (group: PullRequestsView.GroupField) => update((view) => ({ ...view, group })),\n [update],\n );\n const handleClear = useCallback(() => setQuery(''), [setQuery]);\n\n const tags = useTagMap(db);\n // A query that does not parse matches nothing rather than everything.\n const filter = useMemo(() => {\n const text = query.trim();\n return text.length === 0 ? undefined : (new QueryBuilder(tags).build(text).filter ?? Filter.nothing());\n }, [query, tags]);\n\n const pullRequests = useQuery(db, Filter.type(PullRequest.PullRequest));\n const tasks = useQuery(db, Filter.type(Task.Task));\n const checks = usePullRequestChecks(pullRequests, db.spaceId);\n const { rows, groups } = useArrangedRows(pullRequests, tasks, checks, { filter, sort, group });\n // In display order, so keyboard order follows the groups the reader sees.\n const options = useMemo(\n () =>\n (groups ? groups.flatMap((group) => group.rows) : rows).map(({ pullRequest }) => ({\n value: pullRequest.id,\n label: pullRequest.title,\n })),\n [groups, rows],\n );\n\n const sortFields = useMemo(\n () =>\n PullRequestsView.SortField.literals.map((id) => ({\n id,\n label: t(`pull-requests-sort-${id}.label`),\n icon: SORT_ICONS[id],\n })),\n [t],\n );\n const directionLabels = useMemo(\n () => ({ asc: t('pull-requests-sort-asc.label'), desc: t('pull-requests-sort-desc.label') }),\n [t],\n );\n const groupFields = useMemo(\n () =>\n PullRequestsView.GroupField.literals.map((id) => ({\n id,\n label: t(`pull-requests-group-${id}.label`),\n icon: GROUP_ICONS[id],\n })),\n [t],\n );\n\n const openObject = useOpenObject();\n\n return (\n <Panel.Root role={role} data-testid='pull-requests'>\n <Panel.Header>\n <Toolbar.Root inactive={!hasAttention}>\n <QueryEditor\n classNames='grow min-w-0 ps-1'\n db={db}\n tags={tags}\n value={query}\n onChange={setQuery}\n ref={editorRef}\n />\n <SortMenu\n fields={sortFields}\n value={sort}\n onChange={handleSortChange}\n label={t('pull-requests-sort.label')}\n directionLabels={directionLabels}\n testId='pull-requests.sort'\n />\n <GroupMenu\n fields={groupFields}\n value={group}\n onChange={handleGroupChange}\n label={t('pull-requests-group.label')}\n none='none'\n testId='pull-requests.group'\n />\n <Button.Root\n icon='ph--x--regular'\n iconOnly\n disabled={query.trim().length === 0}\n label={t('pull-requests-filter-clear.label')}\n data-testid='pull-requests.filter.clear'\n onClick={handleClear}\n />\n </Toolbar.Root>\n </Panel.Header>\n <Panel.Body>\n {rows.length === 0 ? (\n <Status.Empty classNames='dx-expand'>\n {t(pullRequests.length === 0 ? 'pull-requests-empty.message' : 'pull-requests-no-match.message')}\n </Status.Empty>\n ) : (\n <Listbox.Root items={options}>\n <Listbox.Content\n classNames='dx-expand'\n aria-label={t('typename.label_other', { ns: PULL_REQUEST_TYPENAME })}\n >\n {groups\n ? groups\n .filter((group) => group.rows.length > 0)\n .map((group) => <GroupSection key={group.id} group={group} onOpen={openObject} />)\n : rows.map((row) => <PullRequestListRow key={row.pullRequest.id} row={row} onOpen={openObject} />)}\n </Listbox.Content>\n </Listbox.Root>\n )}\n </Panel.Body>\n </Panel.Root>\n );\n};\n\ntype OpenHandler = (object: Obj.Any) => Promise<void>;\n\nconst GroupSection = ({ group, onOpen }: { group: PullRequestRowGroup; onOpen: OpenHandler }) => {\n const { t } = UiHooks.useTranslation(meta.profile.key);\n return (\n <Listbox.ItemGroup>\n <Listbox.ItemGroupLabel>\n <Layout.Flex align='center' gap='sm'>\n <Icon.Icon icon={group.icon} classNames='dx-text' data-hue={group.hue} />\n <span className='truncate'>{group.translate ? t(group.label) : group.label}</span>\n <span className='text-description'>{group.rows.length}</span>\n </Layout.Flex>\n </Listbox.ItemGroupLabel>\n {group.rows.map((row) => (\n <PullRequestListRow key={row.pullRequest.id} row={row} onOpen={onOpen} />\n ))}\n </Listbox.ItemGroup>\n );\n};\n\n/** One pull request: its repository and number, title, author and time, then checks, tasks and state. */\nconst PullRequestListRow = ({\n row: { pullRequest, checks, tasks },\n onOpen,\n}: {\n row: PullRequestRow;\n onOpen: OpenHandler;\n}) => {\n const { t } = UiHooks.useTranslation(meta.profile.key);\n const time = pullRequest.updatedAt ?? pullRequest.createdAt;\n return (\n <Listbox.Item\n id={pullRequest.id}\n classNames='cursor-pointer py-2'\n data-testid='pull-requests.row'\n onClick={() => void onOpen(pullRequest)}\n >\n <Layout.Flex column gap='xs' grow>\n <Layout.Flex align='center' gap='sm' classNames='min-w-0'>\n <span className='dx-tag dx-tag-inline shrink-0' data-hue='neutral'>\n {PullRequest.reference(pullRequest)}\n </span>\n <span className='truncate grow'>{pullRequest.title}</span>\n <ChecksTag pullRequest={pullRequest} checks={checks} />\n <span\n className='dx-tag dx-tag-inline shrink-0'\n data-hue={STATE_HUE[pullRequest.state]}\n data-testid='pull-requests.row.state'\n >\n {t(`pull-request-state.${pullRequest.state}.label`)}\n </span>\n </Layout.Flex>\n <Layout.Flex align='center' gap='sm' classNames='min-w-0 text-xs text-description'>\n {pullRequest.author && <span className='shrink-0'>{pullRequest.author}</span>}\n {time && (\n <time className='shrink-0' dateTime={time} title={new Date(time).toLocaleString()}>\n {formatRelative(time)}\n </time>\n )}\n {tasks.length > 0 && (\n <Layout.Flex align='center' gap='xs' classNames='min-w-0' data-testid='pull-requests.row.tasks'>\n <Icon.Icon icon='ph--check-square-offset--regular' size='xs' classNames='shrink-0' />\n <span className='truncate'>{tasks.map((task) => task.title || t('untitled-task.label')).join(', ')}</span>\n </Layout.Flex>\n )}\n </Layout.Flex>\n </Layout.Flex>\n </Listbox.Item>\n );\n};\n\nconst ChecksTag = ({ pullRequest, checks }: { pullRequest: PullRequest.PullRequest; checks?: PullRequestChecks }) => {\n const { t } = UiHooks.useTranslation(meta.profile.key);\n // A finished pull request's checks are not read (see `usePullRequestChecks`), so it shows none.\n if (!checks) {\n return pullRequest.state === 'open' || pullRequest.state === 'draft' ? (\n <span className='dx-tag dx-tag-inline' data-hue='neutral' data-testid='pull-requests.row.checks'>\n {t('ci-status.unknown.label')}\n </span>\n ) : null;\n }\n\n return (\n <>\n {checks.review !== 'none' && (\n <span\n className='dx-tag dx-tag-inline'\n data-hue={checks.review === 'approved' ? 'green' : 'red'}\n data-testid='pull-requests.row.review'\n >\n {t(`review-status.${checks.review}.label`, { count: checks.approvals })}\n </span>\n )}\n <span className='dx-tag dx-tag-inline' data-hue={CI_HUE[checks.ci]} data-testid='pull-requests.row.checks'>\n {t(`ci-status.${checks.ci}.label`)}\n {checks.checks.total > 0 && ` ${checks.checks.passed}/${checks.checks.total}`}\n </span>\n </>\n );\n};\n\ntype ArrangeOptions = {\n filter: Filter.Any | undefined;\n sort: PullRequestsView.Sort;\n group: PullRequestsView.GroupField;\n};\n\n/**\n * The rows the toolbar keeps, in the order it asks for, partitioned into its groups. Read through\n * atoms so a re-sync (a new state, a new title) or a task gaining the pull request as an artifact\n * re-arranges the list without the queries re-emitting.\n */\nconst useArrangedRows = (\n pullRequests: readonly PullRequest.PullRequest[],\n tasks: readonly Task.Task[],\n checks: ReadonlyMap<string, PullRequestChecks>,\n { filter, sort, group }: ArrangeOptions,\n): { rows: readonly PullRequestRow[]; groups?: PullRequestRowGroup[] } => {\n const atom = useMemo(\n () =>\n Atom.make((get) => {\n pullRequests.forEach((pullRequest) => get(Obj.atom(pullRequest)));\n const tasksByPullRequest = new Map<string, Task.Task[]>();\n for (const task of tasks) {\n for (const ref of get(Obj.atomProperty(task, 'artifacts')) ?? []) {\n const id = Task.refEntityId(ref);\n if (id) {\n tasksByPullRequest.set(id, [...(tasksByPullRequest.get(id) ?? []), task]);\n }\n }\n }\n const all = pullRequests.map((pullRequest) => ({\n pullRequest,\n checks: checks.get(pullRequest.id),\n tasks: tasksByPullRequest.get(pullRequest.id) ?? [],\n }));\n const rows = sortRows(filterRows(all, filter), sort);\n return { rows, groups: groupRows(rows, group) };\n }),\n [pullRequests, tasks, checks, filter, sort, group],\n );\n\n return useAtomValue(atom);\n};\n\n/** Tag registry keyed by the `Tag` object's uri — the id space `#tag` terms and `meta.tags` share. */\nconst useTagMap = (db: Database.Database): Tag.Map => {\n const tags = useQuery(db, Filter.type(Tag.Tag));\n return useMemo(\n () =>\n tags.reduce<Tag.Map>((acc, tag) => {\n acc[Obj.getURI(tag).toString()] = tag;\n return acc;\n }, {}),\n [tags],\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAM,kBAAkB;;AAGxB,IAAM,cAAc;AAGpB,IAAM,wBAAQ,IAAI,IAAuD;;AAGzE,IAAM,UAAU,gBAAyC,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AS,gBAAgB,IAAI,IAAI,KAAK,WAAW,CAAC,CAAC;EAChE,MAAM,qCAAqB,IAAI,IAAyB;EACxD,KAAK,MAAM,QAAQ,OACjB,KAAK,MAAM,OAAO,IAAI,IAAI,aAAa,MAAM,WAAW,CAAC,KAAK,CAAC,GAAG;GAChE,MAAM,KAAK,KAAK,YAAY,GAAG;GAC/B,IAAI,IACF,mBAAmB,IAAI,IAAI,CAAC,GAAI,mBAAmB,IAAI,EAAE,KAAK,CAAC,GAAI,IAAI,CAAC;EAE5E;EAOF,MAAM,OAAO,SAAS,WALV,aAAa,KAAK,iBAAiB;GAC7C;GACA,QAAQ,OAAO,IAAI,YAAY,EAAE;GACjC,OAAO,mBAAmB,IAAI,YAAY,EAAE,KAAK,CAAC;EACpD,EACiC,GAAK,MAAM,GAAG,IAAI;EACnD,OAAO;GAAE;GAAM,QAAQ,UAAU,MAAM,KAAK;EAAE;CAChD,CAAC,GACH;EAAC;EAAc;EAAO;EAAQ;EAAQ;EAAM;CAAK,CACnD;CAEA,OAAO,aAAa,IAAI;AAC1B;;AAGA,IAAM,aAAa,OAAmC;CACpD,MAAM,OAAO,SAAS,IAAI,OAAO,KAAK,IAAI,GAAG,CAAC;CAC9C,OAAO,cAEH,KAAK,QAAiB,KAAK,QAAQ;EACjC,IAAI,IAAI,OAAO,GAAG,CAAC,CAAC,SAAS,KAAK;EAClC,OAAO;CACT,GAAG,CAAC,CAAC,GACP,CAAC,IAAI,CACP;AACF"}
@@ -0,0 +1,26 @@
1
+ import { t as PullRequestArticle } from "./chunk-PullRequestArticle.mjs";
2
+ import "react";
3
+ import { PullRequest } from "@dxos/types";
4
+ import { Filter, Obj } from "@dxos/echo";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { useObject, useQuery } from "@dxos/echo-react";
7
+ //#region src/containers/WalkthroughArticle/WalkthroughArticle.tsx
8
+ /**
9
+ * A walkthrough opened directly — from a search result, or a link written before the pull request
10
+ * became the subject — shown as the review of the pull request it narrates.
11
+ *
12
+ * The ref is resolved to a snapshot and the live object queried back by id: the article writes to
13
+ * the pull request (approve, comment) through a ref of its own, which a snapshot cannot give.
14
+ */
15
+ var WalkthroughArticle = ({ subject, ...props }) => {
16
+ const [target] = useObject(subject.pullRequest);
17
+ const pullRequest = useQuery(Obj.getDatabase(subject), target ? Filter.id(target.id) : Filter.nothing()).find(PullRequest.instanceOf);
18
+ return pullRequest ? /* @__PURE__ */ jsx(PullRequestArticle, {
19
+ ...props,
20
+ subject: pullRequest
21
+ }) : null;
22
+ };
23
+ //#endregion
24
+ export { WalkthroughArticle as default };
25
+
26
+ //# sourceMappingURL=chunk-WalkthroughArticle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-WalkthroughArticle.mjs","names":[],"sources":["../../src/containers/WalkthroughArticle/WalkthroughArticle.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport type * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport { Filter, Obj } from '@dxos/echo';\nimport { useObject, useQuery } from '@dxos/echo-react';\nimport { PullRequest } from '@dxos/types';\n\nimport { type Walkthrough } from '#types';\n\nimport { PullRequestArticle } from '../PullRequestArticle/PullRequestArticle.tsx';\n\nexport type WalkthroughArticleProps = AppSurface.ObjectArticleProps<Walkthrough.Walkthrough>;\n\n/**\n * A walkthrough opened directly — from a search result, or a link written before the pull request\n * became the subject — shown as the review of the pull request it narrates.\n *\n * The ref is resolved to a snapshot and the live object queried back by id: the article writes to\n * the pull request (approve, comment) through a ref of its own, which a snapshot cannot give.\n */\nexport const WalkthroughArticle = ({ subject, ...props }: WalkthroughArticleProps) => {\n const [target] = useObject(subject.pullRequest);\n const objects = useQuery(Obj.getDatabase(subject), target ? Filter.id(target.id) : Filter.nothing());\n const pullRequest = objects.find(PullRequest.instanceOf);\n\n return pullRequest ? <PullRequestArticle {...props} subject={pullRequest} /> : null;\n};\n"],"mappings":";;;;;;;;;;;;;;AAwBA,IAAa,sBAAsB,EAAE,SAAS,GAAG,YAAqC;CACpF,MAAM,CAAC,UAAU,UAAU,QAAQ,WAAW;CAE9C,MAAM,cADU,SAAS,IAAI,YAAY,OAAO,GAAG,SAAS,OAAO,GAAG,OAAO,EAAE,IAAI,OAAO,QAAQ,CAC9E,CAAA,CAAQ,KAAK,YAAY,UAAU;CAEvD,OAAO,cAAc,oBAAC,oBAAD;EAAoB,GAAI;EAAO,SAAS;CAAc,CAAA,IAAI;AACjF"}
@@ -0,0 +1,19 @@
1
+ import { r as createIssueComment } from "./chunk-github-api.mjs";
2
+ import { r as resolvePullRequest } from "./chunk-pull-request2.mjs";
3
+ import { GitHubOperation } from "#types";
4
+ import * as Operation from "@dxos/compute/Operation";
5
+ import * as Effect from "effect/Effect";
6
+ import * as FetchHttpClient from "effect/http/FetchHttpClient";
7
+ //#region src/operations/add-pull-request-comment.ts
8
+ var handler = GitHubOperation.AddPullRequestComment.pipe(Operation.withHandler(Effect.fn(function* ({ pullRequest: ref, body }) {
9
+ const { pullRequest, credentials } = yield* resolvePullRequest(ref);
10
+ const comment = yield* createIssueComment(pullRequest.owner, pullRequest.repo, pullRequest.number, body).pipe(Effect.provide(credentials));
11
+ return {
12
+ commentId: comment.id,
13
+ url: comment.html_url ?? void 0
14
+ };
15
+ }, Effect.provide(FetchHttpClient.layer))));
16
+ //#endregion
17
+ export { handler as default };
18
+
19
+ //# sourceMappingURL=chunk-add-pull-request-comment.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-add-pull-request-comment.mjs","names":[],"sources":["../../src/operations/add-pull-request-comment.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as FetchHttpClient from 'effect/http/FetchHttpClient';\n\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { GitHubOperation } from '#types';\n\nimport { GitHubApi } from '../services/index.ts';\nimport { resolvePullRequest } from './pull-request.ts';\n\nconst handler: Operation.WithHandler<typeof GitHubOperation.AddPullRequestComment> =\n GitHubOperation.AddPullRequestComment.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ pullRequest: ref, body }) {\n const { pullRequest, credentials } = yield* resolvePullRequest(ref);\n const comment = yield* GitHubApi.createIssueComment(\n pullRequest.owner,\n pullRequest.repo,\n pullRequest.number,\n body,\n ).pipe(Effect.provide(credentials));\n return { commentId: comment.id, url: comment.html_url ?? undefined };\n }, Effect.provide(FetchHttpClient.layer)),\n ),\n );\n\nexport default handler;\n"],"mappings":";;;;;;;AAcA,IAAM,UACJ,gBAAgB,sBAAsB,KACpC,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,aAAa,KAAK,QAAQ;CAC/C,MAAM,EAAE,aAAa,gBAAgB,OAAO,mBAAmB,GAAG;CAClE,MAAM,UAAU,OAAO,mBACrB,YAAY,OACZ,YAAY,MACZ,YAAY,QACZ,IACF,CAAC,CAAC,KAAK,OAAO,QAAQ,WAAW,CAAC;CAClC,OAAO;EAAE,WAAW,QAAQ;EAAI,KAAK,QAAQ,YAAY,KAAA;CAAU;AACrE,GAAG,OAAO,QAAQ,gBAAgB,KAAK,CAAC,CAC1C,CACF"}
@@ -0,0 +1,25 @@
1
+ import { i as createReviewComment } from "./chunk-github-api.mjs";
2
+ import { r as resolvePullRequest } from "./chunk-pull-request2.mjs";
3
+ import { GitHubOperation } from "#types";
4
+ import * as Operation from "@dxos/compute/Operation";
5
+ import * as Effect from "effect/Effect";
6
+ import * as FetchHttpClient from "effect/http/FetchHttpClient";
7
+ //#region src/operations/add-pull-request-review-comment.ts
8
+ var handler = GitHubOperation.AddPullRequestReviewComment.pipe(Operation.withHandler(Effect.fn(function* ({ pullRequest: ref, body, commit, path, line, side }) {
9
+ const { pullRequest, credentials } = yield* resolvePullRequest(ref);
10
+ const comment = yield* createReviewComment(pullRequest.owner, pullRequest.repo, pullRequest.number, {
11
+ body,
12
+ commit_id: commit,
13
+ path,
14
+ line,
15
+ side
16
+ }).pipe(Effect.provide(credentials));
17
+ return {
18
+ commentId: comment.id,
19
+ url: comment.html_url ?? void 0
20
+ };
21
+ }, Effect.provide(FetchHttpClient.layer))));
22
+ //#endregion
23
+ export { handler as default };
24
+
25
+ //# sourceMappingURL=chunk-add-pull-request-review-comment.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-add-pull-request-review-comment.mjs","names":[],"sources":["../../src/operations/add-pull-request-review-comment.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as FetchHttpClient from 'effect/http/FetchHttpClient';\n\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { GitHubOperation } from '#types';\n\nimport { GitHubApi } from '../services/index.ts';\nimport { resolvePullRequest } from './pull-request.ts';\n\nconst handler: Operation.WithHandler<typeof GitHubOperation.AddPullRequestReviewComment> =\n GitHubOperation.AddPullRequestReviewComment.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ pullRequest: ref, body, commit, path, line, side }) {\n const { pullRequest, credentials } = yield* resolvePullRequest(ref);\n const comment = yield* GitHubApi.createReviewComment(pullRequest.owner, pullRequest.repo, pullRequest.number, {\n body,\n commit_id: commit,\n path,\n line,\n side,\n }).pipe(Effect.provide(credentials));\n return { commentId: comment.id, url: comment.html_url ?? undefined };\n }, Effect.provide(FetchHttpClient.layer)),\n ),\n );\n\nexport default handler;\n"],"mappings":";;;;;;;AAcA,IAAM,UACJ,gBAAgB,4BAA4B,KAC1C,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,aAAa,KAAK,MAAM,QAAQ,MAAM,MAAM,QAAQ;CACzE,MAAM,EAAE,aAAa,gBAAgB,OAAO,mBAAmB,GAAG;CAClE,MAAM,UAAU,OAAO,oBAA8B,YAAY,OAAO,YAAY,MAAM,YAAY,QAAQ;EAC5G;EACA,WAAW;EACX;EACA;EACA;CACF,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ,WAAW,CAAC;CACnC,OAAO;EAAE,WAAW,QAAQ;EAAI,KAAK,QAAQ,YAAY,KAAA;CAAU;AACrE,GAAG,OAAO,QAAQ,gBAAgB,KAAK,CAAC,CAC1C,CACF"}
@@ -0,0 +1,39 @@
1
+ import * as Capability from "@dxos/app-framework/Capability";
2
+ import { IMPORT_PULL_REQUEST_DIALOG, meta } from "#meta";
3
+ import { GitHubOperation } from "#types";
4
+ import * as Operation from "@dxos/compute/Operation";
5
+ import * as Effect from "effect/Effect";
6
+ import * as AppGraphBuilder from "@dxos/app-graph/AppGraphBuilder";
7
+ import * as AppGraphNode from "@dxos/app-graph/AppGraphNode";
8
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
9
+ import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
10
+ import * as GraphNodeMatcher from "@dxos/graph/GraphNodeMatcher";
11
+ //#region src/capabilities/app-graph-builder.ts
12
+ /**
13
+ * Contributes "Import pull request" to the root, so the commands dialog carries it: a reviewer who
14
+ * has a link in hand should not have to sync a repository to read the change.
15
+ */
16
+ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
17
+ const extensions = yield* AppGraphBuilder.createExtension({
18
+ id: "importPullRequest",
19
+ match: GraphNodeMatcher.whenRoot,
20
+ actions: () => Effect.succeed([AppGraphNode.makeAction({
21
+ id: GitHubOperation.ImportPullRequest.meta.key,
22
+ data: Effect.fnUntraced(function* () {
23
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
24
+ subject: IMPORT_PULL_REQUEST_DIALOG,
25
+ blockAlign: "start"
26
+ });
27
+ }),
28
+ properties: {
29
+ label: ["import-pull-request.label", { ns: meta.profile.key }],
30
+ icon: "ph--git-pull-request--regular"
31
+ }
32
+ })])
33
+ });
34
+ return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);
35
+ }));
36
+ //#endregion
37
+ export { app_graph_builder_default as default };
38
+
39
+ //# sourceMappingURL=chunk-app-graph-builder.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppGraphBuilder from '@dxos/app-graph/AppGraphBuilder';\nimport * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as GraphNodeMatcher from '@dxos/graph/GraphNodeMatcher';\n\nimport { IMPORT_PULL_REQUEST_DIALOG, meta } from '#meta';\nimport { GitHubOperation } from '#types';\n\n/**\n * Contributes \"Import pull request\" to the root, so the commands dialog carries it: a reviewer who\n * has a link in hand should not have to sync a repository to read the change.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* AppGraphBuilder.createExtension({\n id: 'importPullRequest',\n match: GraphNodeMatcher.whenRoot,\n actions: () =>\n Effect.succeed([\n AppGraphNode.makeAction({\n id: GitHubOperation.ImportPullRequest.meta.key,\n data: Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.UpdateDialog, {\n subject: IMPORT_PULL_REQUEST_DIALOG,\n blockAlign: 'start',\n });\n }),\n properties: {\n label: ['import-pull-request.label', { ns: meta.profile.key }],\n icon: 'ph--git-pull-request--regular',\n },\n }),\n ]),\n });\n\n return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,aAAa,OAAO,gBAAgB,gBAAgB;EACxD,IAAI;EACJ,OAAO,iBAAiB;EACxB,eACE,OAAO,QAAQ,CACb,aAAa,WAAW;GACtB,IAAI,gBAAgB,kBAAkB,KAAK;GAC3C,MAAM,OAAO,WAAW,aAAa;IACnC,OAAO,UAAU,OAAO,gBAAgB,cAAc;KACpD,SAAS;KACT,YAAY;IACd,CAAC;GACH,CAAC;GACD,YAAY;IACV,OAAO,CAAC,6BAA6B,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IAC7D,MAAM;GACR;EACF,CAAC,CACH,CAAC;CACL,CAAC;CAED,OAAO,WAAW,WAAW,gBAAgB,iBAAiB,UAAU;AAC1E,CAAC,CACH"}
@@ -0,0 +1,70 @@
1
+ import { n as GITHUB_PROVIDER_ID, r as GITHUB_SOURCE } from "./chunk-constants.mjs";
2
+ import { h as fetchUser, t as GitHubCredentials } from "./chunk-github-api.mjs";
3
+ import * as Capability from "@dxos/app-framework/Capability";
4
+ import * as ConnectorSpec from "@dxos/plugin-connector/ConnectorSpec";
5
+ import { GitHubOperation } from "#types";
6
+ import * as Effect from "effect/Effect";
7
+ import { Obj } from "@dxos/echo";
8
+ import * as Layer from "effect/Layer";
9
+ import * as Credential from "@dxos/compute/Credential";
10
+ import * as ConnectorError from "@dxos/plugin-connector/ConnectorError";
11
+ import { OAuthProvider } from "@dxos/protocols";
12
+ //#region src/capabilities/connector.ts
13
+ /**
14
+ * Service-specific token-created hook for GitHub.
15
+ *
16
+ * Calls GitHub's `/user` to populate `accessToken.account` with the
17
+ * authenticated user's login (falling back to email). Failures are elevated
18
+ * with {@link Effect.orDie}; plugin-connector logs defects from the runner
19
+ * and continues so a failed `/user` cannot block the Connection already
20
+ * created.
21
+ */
22
+ var onTokenCreated = ({ accessToken }) => Effect.gen(function* () {
23
+ if (accessToken.account) return;
24
+ const token = yield* Credential.getApiKeyValue({ accessTokenId: accessToken.id });
25
+ const user = yield* fetchUser().pipe(Effect.provide(Layer.succeed(GitHubCredentials, { token })));
26
+ Obj.update(accessToken, (accessToken) => {
27
+ accessToken.account = user.login ?? user.email;
28
+ });
29
+ }).pipe(Effect.orDie);
30
+ /**
31
+ * GitHub `testConnection`: `GET /user` with the stored token. A rejected token
32
+ * (401/403 on a revoked grant) or transport failure surfaces as a user-facing
33
+ * error so the connection UI can offer to reauthenticate.
34
+ */
35
+ var testConnection = ({ accessToken }) => Effect.flatMap(Credential.getApiKeyValue({ accessTokenId: accessToken.id }), (token) => fetchUser().pipe(Effect.provide(Layer.succeed(GitHubCredentials, { token })))).pipe(Effect.asVoid, Effect.mapError(() => new ConnectorError.ConnectionTestError({ message: "GitHub rejected the credential. Reauthenticate to continue syncing." })));
36
+ /**
37
+ * Contributes a single `ConnectorSpec.Connector` entry that wires GitHub's two operations,
38
+ * its target materializer, and the token-created hook to the `'github.com'`
39
+ * source. plugin-connector routes by `connectorId`.
40
+ *
41
+ * Sync targets are repositories, not organizations — orgs and their members
42
+ * are auto-pulled as a side effect of syncing any repo they own.
43
+ *
44
+ * `scopes` is intentionally empty: this is a GitHub *App* (not a classic
45
+ * OAuth App), so permissions are declared in the App's settings on github.com
46
+ * and OAuth scope strings are ignored on the user-authorization flow.
47
+ */
48
+ var connector_default = Capability.makeModule(Effect.fnUntraced(function* () {
49
+ return Capability.contribute(ConnectorSpec.Connector, [{
50
+ id: GITHUB_PROVIDER_ID,
51
+ source: GITHUB_SOURCE,
52
+ label: "GitHub",
53
+ oauth: {
54
+ provider: OAuthProvider.GITHUB,
55
+ scopes: []
56
+ },
57
+ sync: {
58
+ operation: GitHubOperation.SyncGitHubRepositories,
59
+ getTargets: GitHubOperation.GetGitHubRepositories,
60
+ materializeTarget: GitHubOperation.MaterializeGitHubTarget,
61
+ optionsSchema: GitHubOperation.SyncOptions
62
+ },
63
+ onTokenCreated,
64
+ testConnection
65
+ }]);
66
+ }));
67
+ //#endregion
68
+ export { connector_default as default };
69
+
70
+ //# sourceMappingURL=chunk-connector.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-connector.mjs","names":[],"sources":["../../src/capabilities/connector.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Credential from '@dxos/compute/Credential';\nimport { Obj } from '@dxos/echo';\nimport * as ConnectorError from '@dxos/plugin-connector/ConnectorError';\nimport * as ConnectorSpec from '@dxos/plugin-connector/ConnectorSpec';\nimport { OAuthProvider } from '@dxos/protocols';\n\nimport { GitHubOperation } from '#types';\n\nimport { GITHUB_PROVIDER_ID, GITHUB_SOURCE } from '../constants.ts';\nimport { GitHubApi } from '../services/index.ts';\n\n/**\n * Service-specific token-created hook for GitHub.\n *\n * Calls GitHub's `/user` to populate `accessToken.account` with the\n * authenticated user's login (falling back to email). Failures are elevated\n * with {@link Effect.orDie}; plugin-connector logs defects from the runner\n * and continues so a failed `/user` cannot block the Connection already\n * created.\n */\nconst onTokenCreated: ConnectorSpec.OnTokenCreated = ({ accessToken }) =>\n Effect.gen(function* () {\n if (accessToken.account) {\n return;\n }\n const token = yield* Credential.getApiKeyValue({ accessTokenId: accessToken.id });\n const user = yield* GitHubApi.fetchUser().pipe(\n Effect.provide(Layer.succeed(GitHubApi.GitHubCredentials, { token })),\n );\n Obj.update(accessToken, (accessToken) => {\n accessToken.account = user.login ?? user.email;\n });\n }).pipe(Effect.orDie);\n\n/**\n * GitHub `testConnection`: `GET /user` with the stored token. A rejected token\n * (401/403 on a revoked grant) or transport failure surfaces as a user-facing\n * error so the connection UI can offer to reauthenticate.\n */\nconst testConnection: ConnectorSpec.TestConnection = ({ accessToken }) =>\n Effect.flatMap(Credential.getApiKeyValue({ accessTokenId: accessToken.id }), (token) =>\n GitHubApi.fetchUser().pipe(Effect.provide(Layer.succeed(GitHubApi.GitHubCredentials, { token }))),\n ).pipe(\n Effect.asVoid,\n Effect.mapError(\n () =>\n new ConnectorError.ConnectionTestError({\n message: 'GitHub rejected the credential. Reauthenticate to continue syncing.',\n }),\n ),\n );\n\n/**\n * Contributes a single `ConnectorSpec.Connector` entry that wires GitHub's two operations,\n * its target materializer, and the token-created hook to the `'github.com'`\n * source. plugin-connector routes by `connectorId`.\n *\n * Sync targets are repositories, not organizations — orgs and their members\n * are auto-pulled as a side effect of syncing any repo they own.\n *\n * `scopes` is intentionally empty: this is a GitHub *App* (not a classic\n * OAuth App), so permissions are declared in the App's settings on github.com\n * and OAuth scope strings are ignored on the user-authorization flow.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contribute(ConnectorSpec.Connector, [\n {\n id: GITHUB_PROVIDER_ID,\n source: GITHUB_SOURCE,\n label: 'GitHub',\n oauth: {\n provider: OAuthProvider.GITHUB,\n scopes: [],\n },\n sync: {\n operation: GitHubOperation.SyncGitHubRepositories,\n getTargets: GitHubOperation.GetGitHubRepositories,\n materializeTarget: GitHubOperation.MaterializeGitHubTarget,\n optionsSchema: GitHubOperation.SyncOptions,\n },\n onTokenCreated,\n testConnection,\n },\n ]);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,IAAM,kBAAgD,EAAE,kBACtD,OAAO,IAAI,aAAa;CACtB,IAAI,YAAY,SACd;CAEF,MAAM,QAAQ,OAAO,WAAW,eAAe,EAAE,eAAe,YAAY,GAAG,CAAC;CAChF,MAAM,OAAO,OAAO,UAAoB,CAAC,CAAC,KACxC,OAAO,QAAQ,MAAM,QAAQ,mBAA6B,EAAE,MAAM,CAAC,CAAC,CACtE;CACA,IAAI,OAAO,cAAc,gBAAgB;EACvC,YAAY,UAAU,KAAK,SAAS,KAAK;CAC3C,CAAC;AACH,CAAC,CAAC,CAAC,KAAK,OAAO,KAAK;;;;;;AAOtB,IAAM,kBAAgD,EAAE,kBACtD,OAAO,QAAQ,WAAW,eAAe,EAAE,eAAe,YAAY,GAAG,CAAC,IAAI,UAC5E,UAAoB,CAAC,CAAC,KAAK,OAAO,QAAQ,MAAM,QAAQ,mBAA6B,EAAE,MAAM,CAAC,CAAC,CAAC,CAClG,CAAC,CAAC,KACA,OAAO,QACP,OAAO,eAEH,IAAI,eAAe,oBAAoB,EACrC,SAAS,sEACX,CAAC,CACL,CACF;;;;;;;;;;;;;AAcF,IAAA,oBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,WAAW,cAAc,WAAW,CACpD;EACE,IAAI;EACJ,QAAQ;EACR,OAAO;EACP,OAAO;GACL,UAAU,cAAc;GACxB,QAAQ,CAAC;EACX;EACA,MAAM;GACJ,WAAW,gBAAgB;GAC3B,YAAY,gBAAgB;GAC5B,mBAAmB,gBAAgB;GACnC,eAAe,gBAAgB;EACjC;EACA;EACA;CACF,CACF,CAAC;AACH,CAAC,CACH"}
@@ -0,0 +1,11 @@
1
+ //#region src/constants.ts
2
+ /** Source string used in `AccessToken.source` and `Obj.Meta.keys[i].source` for GitHub. */
3
+ var GITHUB_SOURCE = "github.com";
4
+ /** Connector id matching the `ConnectorEntry.id` contributed by this plugin. */
5
+ var GITHUB_PROVIDER_ID = "github";
6
+ /** Base URL for the GitHub REST API. */
7
+ var GITHUB_API_BASE = "https://api.github.com";
8
+ //#endregion
9
+ export { GITHUB_PROVIDER_ID as n, GITHUB_SOURCE as r, GITHUB_API_BASE as t };
10
+
11
+ //# sourceMappingURL=chunk-constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-constants.mjs","names":[],"sources":["../../src/constants.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n/** Source string used in `AccessToken.source` and `Obj.Meta.keys[i].source` for GitHub. */\nexport const GITHUB_SOURCE = 'github.com';\n\n/** Connector id matching the `ConnectorEntry.id` contributed by this plugin. */\nexport const GITHUB_PROVIDER_ID = 'github';\n\n/** Base URL for the GitHub REST API. */\nexport const GITHUB_API_BASE = 'https://api.github.com';\n"],"mappings":";;AAKA,IAAa,gBAAgB;;AAG7B,IAAa,qBAAqB;;AAGlC,IAAa,kBAAkB"}
@@ -0,0 +1,29 @@
1
+ import * as Predicate from "effect/Predicate";
2
+ import { BaseError } from "@dxos/errors";
3
+ //#region src/errors.ts
4
+ /** The binding names no repository: no `externalId` and no GitHub foreign key on the target. */
5
+ var GitHubRepoUnresolvedError = class extends BaseError.extend("GitHubRepoUnresolvedError", "Binding does not name a GitHub repository.") {};
6
+ /** The connection's token cannot see the repository the binding names (un-shared or revoked). */
7
+ var GitHubRepoInaccessibleError = class extends BaseError.extend("GitHubRepoInaccessibleError", "Repository is not accessible to the connection token.") {};
8
+ /** The pull request is not stored: a preview card mints one in memory, and it has no database. */
9
+ var GitHubPullRequestUnstoredError = class extends BaseError.extend("GitHubPullRequestUnstoredError", "Pull request is not stored in a space.") {};
10
+ /** The text a user typed names no pull request: neither a github.com URL nor `owner/repo#123`. */
11
+ var GitHubPullRequestReferenceError = class extends BaseError.extend("GitHubPullRequestReferenceError", "Not a pull request reference.") {};
12
+ /** The local Project could not be re-resolved after its upsert. */
13
+ var GitHubProjectMissingError = class extends BaseError.extend("GitHubProjectMissingError", "Local project missing after upsert.") {};
14
+ /**
15
+ * User-facing / persisted diagnostic string for failures from GitHub sync paths.
16
+ */
17
+ var formatGitHubSyncFailure = (error) => {
18
+ if (error instanceof BaseError) return Object.keys(error.context).length > 0 ? `${error.name}: ${JSON.stringify(error.context)}` : error.name;
19
+ if (Predicate.isObject(error) && typeof error._tag === "string") {
20
+ if (error._tag === "ResponseError" && Predicate.isObject(error.response) && typeof error.response.status === "number") return `HTTP ${error.response.status}`;
21
+ return error._tag;
22
+ }
23
+ if (error instanceof Error) return error.message;
24
+ return String(error);
25
+ };
26
+ //#endregion
27
+ export { GitHubRepoUnresolvedError as a, GitHubRepoInaccessibleError as i, GitHubPullRequestReferenceError as n, formatGitHubSyncFailure as o, GitHubPullRequestUnstoredError as r, GitHubProjectMissingError as t };
28
+
29
+ //# sourceMappingURL=chunk-errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-errors.mjs","names":[],"sources":["../../src/errors.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Predicate from 'effect/Predicate';\n\nimport { BaseError } from '@dxos/errors';\n\n/** The binding names no repository: no `externalId` and no GitHub foreign key on the target. */\nexport class GitHubRepoUnresolvedError extends BaseError.extend(\n 'GitHubRepoUnresolvedError',\n 'Binding does not name a GitHub repository.',\n) {}\n\n/** The connection's token cannot see the repository the binding names (un-shared or revoked). */\nexport class GitHubRepoInaccessibleError extends BaseError.extend(\n 'GitHubRepoInaccessibleError',\n 'Repository is not accessible to the connection token.',\n) {}\n\n/** The pull request is not stored: a preview card mints one in memory, and it has no database. */\nexport class GitHubPullRequestUnstoredError extends BaseError.extend(\n 'GitHubPullRequestUnstoredError',\n 'Pull request is not stored in a space.',\n) {}\n\n/** The text a user typed names no pull request: neither a github.com URL nor `owner/repo#123`. */\nexport class GitHubPullRequestReferenceError extends BaseError.extend(\n 'GitHubPullRequestReferenceError',\n 'Not a pull request reference.',\n) {}\n\n/** The local Project could not be re-resolved after its upsert. */\nexport class GitHubProjectMissingError extends BaseError.extend(\n 'GitHubProjectMissingError',\n 'Local project missing after upsert.',\n) {}\n\n/**\n * User-facing / persisted diagnostic string for failures from GitHub sync paths.\n */\nexport const formatGitHubSyncFailure = (error: unknown): string => {\n if (error instanceof BaseError) {\n const keys = Object.keys(error.context);\n return keys.length > 0 ? `${error.name}: ${JSON.stringify(error.context)}` : error.name;\n }\n if (Predicate.isObject(error) && typeof error._tag === 'string') {\n if (\n error._tag === 'ResponseError' &&\n Predicate.isObject(error.response) &&\n typeof error.response.status === 'number'\n ) {\n return `HTTP ${error.response.status}`;\n }\n return error._tag;\n }\n if (error instanceof Error) {\n return error.message;\n }\n return String(error);\n};\n"],"mappings":";;;;AASA,IAAa,4BAAb,cAA+C,UAAU,OACvD,6BACA,4CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,8BAAb,cAAiD,UAAU,OACzD,+BACA,uDACF,CAAC,CAAC,CAAC;;AAGH,IAAa,iCAAb,cAAoD,UAAU,OAC5D,kCACA,wCACF,CAAC,CAAC,CAAC;;AAGH,IAAa,kCAAb,cAAqD,UAAU,OAC7D,mCACA,+BACF,CAAC,CAAC,CAAC;;AAGH,IAAa,4BAAb,cAA+C,UAAU,OACvD,6BACA,qCACF,CAAC,CAAC,CAAC;;;;AAKH,IAAa,2BAA2B,UAA2B;CACjE,IAAI,iBAAiB,WAEnB,OADa,OAAO,KAAK,MAAM,OACxB,CAAA,CAAK,SAAS,IAAI,GAAG,MAAM,KAAK,IAAI,KAAK,UAAU,MAAM,OAAO,MAAM,MAAM;CAErF,IAAI,UAAU,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS,UAAU;EAC/D,IACE,MAAM,SAAS,mBACf,UAAU,SAAS,MAAM,QAAQ,KACjC,OAAO,MAAM,SAAS,WAAW,UAEjC,OAAO,QAAQ,MAAM,SAAS;EAEhC,OAAO,MAAM;CACf;CACA,IAAI,iBAAiB,OACnB,OAAO,MAAM;CAEf,OAAO,OAAO,KAAK;AACrB"}
@@ -0,0 +1,86 @@
1
+ import { l as fetchPullRequest, t as GitHubCredentials, u as fetchPullRequestDiff } from "./chunk-github-api.mjs";
2
+ import { t as generateWalkthrough } from "./chunk-generate.mjs";
3
+ import { r as GitHubPullRequestUnstoredError } from "./chunk-errors.mjs";
4
+ import { n as githubToken } from "./chunk-pull-request2.mjs";
5
+ import { GitHubOperation } from "#types";
6
+ import * as Operation from "@dxos/compute/Operation";
7
+ import * as Effect from "effect/Effect";
8
+ import { PullRequest } from "@dxos/types";
9
+ import { Database, Obj, Ref } from "@dxos/echo";
10
+ import { AiService } from "@dxos/ai";
11
+ import * as Trace from "@dxos/compute/Trace";
12
+ import * as Layer from "effect/Layer";
13
+ import * as Cause from "effect/Cause";
14
+ import * as FetchHttpClient from "effect/http/FetchHttpClient";
15
+ import * as Progress from "@dxos/app-toolkit/Progress";
16
+ import * as LanguageModel from "effect/ai/LanguageModel";
17
+ import * as Exit from "effect/Exit";
18
+ //#region src/operations/generate-walkthrough.ts
19
+ /**
20
+ * One-shot for now; a multi-turn agent that reads the repository is the obvious next step.
21
+ *
22
+ * The prompt's diff budget matters more than it looks: this model's output allowance covers its
23
+ * reasoning as well as its answer, so an unbounded diff yields a response that is all reasoning and
24
+ * no walkthrough. See `DEFAULT_MAX_DIFF_CHARS`.
25
+ */
26
+ var MODEL = "com.anthropic.model.claude-sonnet-5.default";
27
+ /**
28
+ * Generate a walkthrough of a pull request.
29
+ *
30
+ * Only the I/O is here — fetch the pull request, fetch its diff, run the model — because that is the
31
+ * part a test cannot reach. The decisions live in {@link generateWalkthrough}.
32
+ */
33
+ var handler = GitHubOperation.GenerateWalkthrough.pipe(Operation.withHandler(Effect.fn(function* ({ pullRequest: pullRequestRef, force }) {
34
+ const pullRequest = pullRequestRef.target;
35
+ const db = pullRequest ? Obj.getDatabase(pullRequest) : void 0;
36
+ if (!pullRequest || !db) return yield* Effect.die(new GitHubPullRequestUnstoredError());
37
+ const traceWriter = yield* Trace.TraceService;
38
+ const progressKey = GitHubOperation.createWalkthroughProgressKey(pullRequest);
39
+ const label = `Walkthrough of ${PullRequest.reference(pullRequest)}`;
40
+ const report = (message, current) => traceWriter.write(Trace.StatusUpdate, {
41
+ message,
42
+ progress: {
43
+ key: progressKey,
44
+ current,
45
+ total: 5
46
+ }
47
+ });
48
+ return yield* Effect.gen(function* () {
49
+ report(label, 0);
50
+ const { owner, repo, number } = pullRequest;
51
+ const credentials = Layer.succeed(GitHubCredentials, { token: yield* githubToken() });
52
+ report(`${label}: reading the pull request`, 1);
53
+ const remote = yield* fetchPullRequest(owner, repo, number).pipe(Effect.provide(credentials));
54
+ report(`${label}: fetching the diff`, 2);
55
+ const diff = yield* fetchPullRequestDiff(owner, repo, number).pipe(Effect.provide(credentials));
56
+ const result = yield* generateWalkthrough({
57
+ pullRequest,
58
+ remote: {
59
+ title: remote.title,
60
+ description: remote.body ?? void 0,
61
+ baseBranch: remote.base?.ref,
62
+ headBranch: remote.head?.ref,
63
+ commit: remote.head?.sha
64
+ },
65
+ diff,
66
+ force,
67
+ model: MODEL,
68
+ report,
69
+ narrate: (prompt) => LanguageModel.generateText({ prompt }).pipe(Effect.map((response) => response.text), Effect.provide(AiService.languageModel(MODEL).pipe(Layer.orDie)), Effect.orDie)
70
+ });
71
+ return {
72
+ walkthrough: Ref.make(result.walkthrough),
73
+ generated: result.generated,
74
+ covered: result.covered,
75
+ total: result.total
76
+ };
77
+ }).pipe(Effect.onExit((exit) => Effect.sync(() => {
78
+ if (Exit.isSuccess(exit)) return;
79
+ const terminal = Cause.hasInterrupts(exit.cause) ? Progress.STATUS_CANCELLED : Progress.STATUS_FAILED;
80
+ report(terminal, 5);
81
+ })), Effect.provide(Database.layer(db)));
82
+ }, Effect.provide(FetchHttpClient.layer))));
83
+ //#endregion
84
+ export { handler as default };
85
+
86
+ //# sourceMappingURL=chunk-generate-walkthrough.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-generate-walkthrough.mjs","names":[],"sources":["../../src/operations/generate-walkthrough.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as LanguageModel from 'effect/ai/LanguageModel';\nimport * as Cause from 'effect/Cause';\nimport * as Effect from 'effect/Effect';\nimport * as Exit from 'effect/Exit';\nimport * as FetchHttpClient from 'effect/http/FetchHttpClient';\nimport * as Layer from 'effect/Layer';\n\nimport { AiService } from '@dxos/ai';\nimport * as Progress from '@dxos/app-toolkit/Progress';\nimport * as Operation from '@dxos/compute/Operation';\nimport * as Trace from '@dxos/compute/Trace';\nimport { Database, Obj, Ref } from '@dxos/echo';\nimport { PullRequest } from '@dxos/types';\n\nimport { GitHubOperation } from '#types';\n\nimport { GitHubPullRequestUnstoredError } from '../errors.ts';\nimport { GitHubApi } from '../services/index.ts';\nimport { GENERATE_PHASES, generateWalkthrough } from '../walkthrough/index.ts';\nimport { githubToken } from './pull-request.ts';\n\n/**\n * One-shot for now; a multi-turn agent that reads the repository is the obvious next step.\n *\n * The prompt's diff budget matters more than it looks: this model's output allowance covers its\n * reasoning as well as its answer, so an unbounded diff yields a response that is all reasoning and\n * no walkthrough. See `DEFAULT_MAX_DIFF_CHARS`.\n */\nconst MODEL = 'com.anthropic.model.claude-sonnet-5.default';\n\n/**\n * Generate a walkthrough of a pull request.\n *\n * Only the I/O is here — fetch the pull request, fetch its diff, run the model — because that is the\n * part a test cannot reach. The decisions live in {@link generateWalkthrough}.\n */\nconst handler: Operation.WithHandler<typeof GitHubOperation.GenerateWalkthrough> =\n GitHubOperation.GenerateWalkthrough.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ pullRequest: pullRequestRef, force }) {\n // The invoker carries no database resolver, so the handler derives one from its input, as\n // every other operation in this plugin does.\n const pullRequest = pullRequestRef.target;\n const db = pullRequest ? Obj.getDatabase(pullRequest) : undefined;\n if (!pullRequest || !db) {\n // A preview card mints a pull request in memory rather than storing it, and there is\n // nowhere to put a walkthrough of one.\n return yield* Effect.die(new GitHubPullRequestUnstoredError());\n }\n\n const traceWriter = yield* Trace.TraceService;\n const progressKey = GitHubOperation.createWalkthroughProgressKey(pullRequest);\n const label = `Walkthrough of ${PullRequest.reference(pullRequest)}`;\n // Phase-first, since several meters on one object otherwise truncate to the same text.\n const report = (message: string, current: number) =>\n traceWriter.write(Trace.StatusUpdate, {\n message,\n progress: { key: progressKey, current, total: GENERATE_PHASES },\n });\n\n return yield* Effect.gen(function* () {\n report(label, 0);\n const { owner, repo, number } = pullRequest;\n const credentials = Layer.succeed(GitHubApi.GitHubCredentials, { token: yield* githubToken() });\n\n report(`${label}: reading the pull request`, 1);\n const remote = yield* GitHubApi.fetchPullRequest(owner, repo, number).pipe(Effect.provide(credentials));\n\n report(`${label}: fetching the diff`, 2);\n const diff = yield* GitHubApi.fetchPullRequestDiff(owner, repo, number).pipe(Effect.provide(credentials));\n\n const result = yield* generateWalkthrough({\n pullRequest,\n remote: {\n title: remote.title,\n description: remote.body ?? undefined,\n baseBranch: remote.base?.ref,\n headBranch: remote.head?.ref,\n commit: remote.head?.sha,\n },\n diff,\n force,\n model: MODEL,\n report,\n narrate: (prompt) =>\n LanguageModel.generateText({ prompt }).pipe(\n Effect.map((response) => response.text),\n Effect.provide(AiService.languageModel(MODEL).pipe(Layer.orDie)),\n Effect.orDie,\n ),\n });\n\n return {\n walkthrough: Ref.make(result.walkthrough),\n generated: result.generated,\n covered: result.covered,\n total: result.total,\n };\n }).pipe(\n // The meter stays open forever without a terminal, and the sentinel is all the UI shows —\n // the failure itself goes to the log.\n // `onExit`, not `tapError`: the model call and the database both surface as DEFECTS rather\n // than typed errors, and interruption raises neither. A meter with no terminal stays open\n // and leaves the action disabled.\n Effect.onExit((exit) =>\n Effect.sync(() => {\n if (Exit.isSuccess(exit)) {\n return;\n }\n const terminal = Cause.hasInterrupts(exit.cause) ? Progress.STATUS_CANCELLED : Progress.STATUS_FAILED;\n report(terminal, GENERATE_PHASES);\n }),\n ),\n Effect.provide(Database.layer(db)),\n );\n }, Effect.provide(FetchHttpClient.layer)),\n ),\n );\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,QAAQ;;;;;;;AAQd,IAAM,UACJ,gBAAgB,oBAAoB,KAClC,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,aAAa,gBAAgB,SAAS;CAG3D,MAAM,cAAc,eAAe;CACnC,MAAM,KAAK,cAAc,IAAI,YAAY,WAAW,IAAI,KAAA;CACxD,IAAI,CAAC,eAAe,CAAC,IAGnB,OAAO,OAAO,OAAO,IAAI,IAAI,+BAA+B,CAAC;CAG/D,MAAM,cAAc,OAAO,MAAM;CACjC,MAAM,cAAc,gBAAgB,6BAA6B,WAAW;CAC5E,MAAM,QAAQ,kBAAkB,YAAY,UAAU,WAAW;CAEjE,MAAM,UAAU,SAAiB,YAC/B,YAAY,MAAM,MAAM,cAAc;EACpC;EACA,UAAU;GAAE,KAAK;GAAa;GAAS,OAAA;EAAuB;CAChE,CAAC;CAEH,OAAO,OAAO,OAAO,IAAI,aAAa;EACpC,OAAO,OAAO,CAAC;EACf,MAAM,EAAE,OAAO,MAAM,WAAW;EAChC,MAAM,cAAc,MAAM,QAAQ,mBAA6B,EAAE,OAAO,OAAO,YAAY,E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