@dxos/plugin-github 0.7.4 → 0.13.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 (628) 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 +358 -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 +1486 -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 +96 -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-rolldown-runtime.mjs +13 -0
  83. package/dist/lib/chunk-schema.mjs +15 -0
  84. package/dist/lib/chunk-schema.mjs.map +1 -0
  85. package/dist/lib/chunk-skill-definition.mjs +10 -0
  86. package/dist/lib/chunk-skill-definition.mjs.map +1 -0
  87. package/dist/lib/chunk-submit-pull-request-approval.mjs +56 -0
  88. package/dist/lib/chunk-submit-pull-request-approval.mjs.map +1 -0
  89. package/dist/lib/chunk-sync-pull-request.mjs +24 -0
  90. package/dist/lib/chunk-sync-pull-request.mjs.map +1 -0
  91. package/dist/lib/chunk-sync.mjs +481 -0
  92. package/dist/lib/chunk-sync.mjs.map +1 -0
  93. package/dist/lib/chunk-useOpenObject.mjs +43 -0
  94. package/dist/lib/chunk-useOpenObject.mjs.map +1 -0
  95. package/dist/lib/extensions.mjs +132 -0
  96. package/dist/lib/extensions.mjs.map +1 -0
  97. package/dist/lib/index.mjs +4 -0
  98. package/dist/lib/meta.mjs +47 -0
  99. package/dist/lib/meta.mjs.map +1 -0
  100. package/dist/lib/ns/Extensions.mjs +18 -0
  101. package/dist/lib/ns/Extensions.mjs.map +1 -0
  102. package/dist/lib/operations.mjs +22 -0
  103. package/dist/lib/operations.mjs.map +1 -0
  104. package/dist/lib/plugin.mjs +9 -0
  105. package/dist/lib/plugin.mjs.map +1 -0
  106. package/dist/lib/skills.mjs +44 -0
  107. package/dist/lib/skills.mjs.map +1 -0
  108. package/dist/lib/testing.mjs +189 -0
  109. package/dist/lib/testing.mjs.map +1 -0
  110. package/dist/lib/translations.mjs +136 -0
  111. package/dist/lib/translations.mjs.map +1 -0
  112. package/dist/lib/types.mjs +5 -0
  113. package/dist/types/dx.config.d.ts +28 -0
  114. package/dist/types/dx.config.d.ts.map +1 -0
  115. package/dist/types/src/Extensions.d.ts +2 -0
  116. package/dist/types/src/Extensions.d.ts.map +1 -0
  117. package/dist/types/src/GitHubPlugin.d.ts +37 -0
  118. package/dist/types/src/GitHubPlugin.d.ts.map +1 -0
  119. package/dist/types/src/GitHubPlugin.workerd.test.d.ts +2 -0
  120. package/dist/types/src/GitHubPlugin.workerd.test.d.ts.map +1 -0
  121. package/dist/types/src/approval.d.ts +21 -0
  122. package/dist/types/src/approval.d.ts.map +1 -0
  123. package/dist/types/src/approval.test.d.ts +2 -0
  124. package/dist/types/src/approval.test.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/app-graph-builder.d.ts +9 -0
  126. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/connector.d.ts +17 -0
  128. package/dist/types/src/capabilities/connector.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/gen/browser.d.ts +13 -0
  130. package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/gen/node.d.ts +13 -0
  132. package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/gen/tauri.d.ts +13 -0
  134. package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/gen/workerd.d.ts +13 -0
  136. package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/index.d.ts +13 -0
  138. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/link-resolver.d.ts +10 -0
  140. package/dist/types/src/capabilities/link-resolver.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/markdown-extension.d.ts +14 -0
  142. package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/operation-handler.d.ts +5 -0
  144. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  145. package/dist/types/src/capabilities/page-action.d.ts +5 -0
  146. package/dist/types/src/capabilities/page-action.d.ts.map +1 -0
  147. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  148. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  149. package/dist/types/src/capabilities/schema.d.ts +12 -0
  150. package/dist/types/src/capabilities/schema.d.ts.map +1 -0
  151. package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
  152. package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
  153. package/dist/types/src/cards/GitHubCard.d.ts +11 -0
  154. package/dist/types/src/cards/GitHubCard.d.ts.map +1 -0
  155. package/dist/types/src/cards/GitHubCard.stories.d.ts +45 -0
  156. package/dist/types/src/cards/GitHubCard.stories.d.ts.map +1 -0
  157. package/dist/types/src/cards/PullRequestCard.d.ts +9 -0
  158. package/dist/types/src/cards/PullRequestCard.d.ts.map +1 -0
  159. package/dist/types/src/cards/index.d.ts +3 -0
  160. package/dist/types/src/cards/index.d.ts.map +1 -0
  161. package/dist/types/src/components/CommentComposer/CommentComposer.d.ts +30 -0
  162. package/dist/types/src/components/CommentComposer/CommentComposer.d.ts.map +1 -0
  163. package/dist/types/src/components/CommentComposer/index.d.ts +2 -0
  164. package/dist/types/src/components/CommentComposer/index.d.ts.map +1 -0
  165. package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts +8 -0
  166. package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts.map +1 -0
  167. package/dist/types/src/components/PullRequestFiles/FileTree.d.ts +17 -0
  168. package/dist/types/src/components/PullRequestFiles/FileTree.d.ts.map +1 -0
  169. package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts +23 -0
  170. package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts.map +1 -0
  171. package/dist/types/src/components/PullRequestFiles/files.d.ts +39 -0
  172. package/dist/types/src/components/PullRequestFiles/files.d.ts.map +1 -0
  173. package/dist/types/src/components/PullRequestFiles/files.test.d.ts +2 -0
  174. package/dist/types/src/components/PullRequestFiles/files.test.d.ts.map +1 -0
  175. package/dist/types/src/components/PullRequestFiles/index.d.ts +5 -0
  176. package/dist/types/src/components/PullRequestFiles/index.d.ts.map +1 -0
  177. package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts +21 -0
  178. package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts.map +1 -0
  179. package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts +15 -0
  180. package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts.map +1 -0
  181. package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts +10 -0
  182. package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts.map +1 -0
  183. package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts +16 -0
  184. package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts.map +1 -0
  185. package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts +28 -0
  186. package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts.map +1 -0
  187. package/dist/types/src/components/PullRequestOverview/index.d.ts +6 -0
  188. package/dist/types/src/components/PullRequestOverview/index.d.ts.map +1 -0
  189. package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts +20 -0
  190. package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts.map +1 -0
  191. package/dist/types/src/components/PullRequestStatus/index.d.ts +2 -0
  192. package/dist/types/src/components/PullRequestStatus/index.d.ts.map +1 -0
  193. package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts +18 -0
  194. package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts.map +1 -0
  195. package/dist/types/src/components/WalkthroughView/extensions.d.ts +16 -0
  196. package/dist/types/src/components/WalkthroughView/extensions.d.ts.map +1 -0
  197. package/dist/types/src/components/WalkthroughView/index.d.ts +3 -0
  198. package/dist/types/src/components/WalkthroughView/index.d.ts.map +1 -0
  199. package/dist/types/src/components/index.d.ts +5 -8
  200. package/dist/types/src/components/index.d.ts.map +1 -1
  201. package/dist/types/src/constants.d.ts +7 -0
  202. package/dist/types/src/constants.d.ts.map +1 -0
  203. package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts +6 -0
  204. package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts.map +1 -0
  205. package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts +3 -0
  206. package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts.map +1 -0
  207. package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts +15 -0
  208. package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts.map +1 -0
  209. package/dist/types/src/containers/PullRequestArticle/failure.d.ts +10 -0
  210. package/dist/types/src/containers/PullRequestArticle/failure.d.ts.map +1 -0
  211. package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts +2 -0
  212. package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts.map +1 -0
  213. package/dist/types/src/containers/PullRequestArticle/index.d.ts +2 -0
  214. package/dist/types/src/containers/PullRequestArticle/index.d.ts.map +1 -0
  215. package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts +14 -0
  216. package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts.map +1 -0
  217. package/dist/types/src/containers/PullRequestCardMenu/index.d.ts +2 -0
  218. package/dist/types/src/containers/PullRequestCardMenu/index.d.ts.map +1 -0
  219. package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts +13 -0
  220. package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts.map +1 -0
  221. package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts +44 -0
  222. package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts.map +1 -0
  223. package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts +2 -0
  224. package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts.map +1 -0
  225. package/dist/types/src/containers/PullRequestsArticle/format.d.ts +3 -0
  226. package/dist/types/src/containers/PullRequestsArticle/format.d.ts.map +1 -0
  227. package/dist/types/src/containers/PullRequestsArticle/index.d.ts +2 -0
  228. package/dist/types/src/containers/PullRequestsArticle/index.d.ts.map +1 -0
  229. package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts +13 -0
  230. package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts.map +1 -0
  231. package/dist/types/src/containers/WalkthroughArticle/index.d.ts +2 -0
  232. package/dist/types/src/containers/WalkthroughArticle/index.d.ts.map +1 -0
  233. package/dist/types/src/containers/index.d.ts +7 -0
  234. package/dist/types/src/containers/index.d.ts.map +1 -0
  235. package/dist/types/src/errors.d.ts +157 -0
  236. package/dist/types/src/errors.d.ts.map +1 -0
  237. package/dist/types/src/extensions/index.d.ts +3 -0
  238. package/dist/types/src/extensions/index.d.ts.map +1 -0
  239. package/dist/types/src/extensions/links.d.ts +21 -0
  240. package/dist/types/src/extensions/links.d.ts.map +1 -0
  241. package/dist/types/src/extensions/links.test.d.ts +2 -0
  242. package/dist/types/src/extensions/links.test.d.ts.map +1 -0
  243. package/dist/types/src/extensions/references.d.ts +23 -0
  244. package/dist/types/src/extensions/references.d.ts.map +1 -0
  245. package/dist/types/src/extensions/references.test.d.ts +2 -0
  246. package/dist/types/src/extensions/references.test.d.ts.map +1 -0
  247. package/dist/types/src/github-link.d.ts +29 -0
  248. package/dist/types/src/github-link.d.ts.map +1 -0
  249. package/dist/types/src/hooks/index.d.ts +5 -2
  250. package/dist/types/src/hooks/index.d.ts.map +1 -1
  251. package/dist/types/src/hooks/useOpenObject.d.ts +9 -0
  252. package/dist/types/src/hooks/useOpenObject.d.ts.map +1 -0
  253. package/dist/types/src/hooks/usePullRequestChecks.d.ts +10 -0
  254. package/dist/types/src/hooks/usePullRequestChecks.d.ts.map +1 -0
  255. package/dist/types/src/hooks/usePullRequestDiff.d.ts +12 -0
  256. package/dist/types/src/hooks/usePullRequestDiff.d.ts.map +1 -0
  257. package/dist/types/src/hooks/usePullRequestFiles.d.ts +22 -0
  258. package/dist/types/src/hooks/usePullRequestFiles.d.ts.map +1 -0
  259. package/dist/types/src/hooks/useSyncPullRequest.d.ts +10 -0
  260. package/dist/types/src/hooks/useSyncPullRequest.d.ts.map +1 -0
  261. package/dist/types/src/index.d.ts +3 -3
  262. package/dist/types/src/index.d.ts.map +1 -1
  263. package/dist/types/src/meta.d.ts +34 -11
  264. package/dist/types/src/meta.d.ts.map +1 -1
  265. package/dist/types/src/operations/add-pull-request-comment.d.ts +5 -0
  266. package/dist/types/src/operations/add-pull-request-comment.d.ts.map +1 -0
  267. package/dist/types/src/operations/add-pull-request-review-comment.d.ts +5 -0
  268. package/dist/types/src/operations/add-pull-request-review-comment.d.ts.map +1 -0
  269. package/dist/types/src/operations/generate-walkthrough.d.ts +11 -0
  270. package/dist/types/src/operations/generate-walkthrough.d.ts.map +1 -0
  271. package/dist/types/src/operations/get-pull-request-diff.d.ts +5 -0
  272. package/dist/types/src/operations/get-pull-request-diff.d.ts.map +1 -0
  273. package/dist/types/src/operations/get-pull-request-status.d.ts +5 -0
  274. package/dist/types/src/operations/get-pull-request-status.d.ts.map +1 -0
  275. package/dist/types/src/operations/get-repositories.d.ts +13 -0
  276. package/dist/types/src/operations/get-repositories.d.ts.map +1 -0
  277. package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts +12 -0
  278. package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts.map +1 -0
  279. package/dist/types/src/operations/import-pull-request.d.ts +63 -0
  280. package/dist/types/src/operations/import-pull-request.d.ts.map +1 -0
  281. package/dist/types/src/operations/import-pull-request.test.d.ts +2 -0
  282. package/dist/types/src/operations/import-pull-request.test.d.ts.map +1 -0
  283. package/dist/types/src/operations/index.d.ts +3 -0
  284. package/dist/types/src/operations/index.d.ts.map +1 -0
  285. package/dist/types/src/operations/materialize-target.d.ts +12 -0
  286. package/dist/types/src/operations/materialize-target.d.ts.map +1 -0
  287. package/dist/types/src/operations/pull-request.d.ts +48 -0
  288. package/dist/types/src/operations/pull-request.d.ts.map +1 -0
  289. package/dist/types/src/operations/pull-request.test.d.ts +2 -0
  290. package/dist/types/src/operations/pull-request.test.d.ts.map +1 -0
  291. package/dist/types/src/operations/submit-pull-request-approval.d.ts +5 -0
  292. package/dist/types/src/operations/submit-pull-request-approval.d.ts.map +1 -0
  293. package/dist/types/src/operations/sync-pull-request.d.ts +5 -0
  294. package/dist/types/src/operations/sync-pull-request.d.ts.map +1 -0
  295. package/dist/types/src/operations/sync.d.ts +123 -0
  296. package/dist/types/src/operations/sync.d.ts.map +1 -0
  297. package/dist/types/src/operations/sync.test.d.ts +2 -0
  298. package/dist/types/src/operations/sync.test.d.ts.map +1 -0
  299. package/dist/types/src/plugin.d.ts +4 -0
  300. package/dist/types/src/plugin.d.ts.map +1 -0
  301. package/dist/types/src/plugin.test.d.ts +2 -0
  302. package/dist/types/src/plugin.test.d.ts.map +1 -0
  303. package/dist/types/src/pull-request-body.d.ts +37 -0
  304. package/dist/types/src/pull-request-body.d.ts.map +1 -0
  305. package/dist/types/src/pull-request-body.test.d.ts +2 -0
  306. package/dist/types/src/pull-request-body.test.d.ts.map +1 -0
  307. package/dist/types/src/pull-request.d.ts +28 -0
  308. package/dist/types/src/pull-request.d.ts.map +1 -0
  309. package/dist/types/src/pull-request.test.d.ts +2 -0
  310. package/dist/types/src/pull-request.test.d.ts.map +1 -0
  311. package/dist/types/src/services/github-api.d.ts +332 -0
  312. package/dist/types/src/services/github-api.d.ts.map +1 -0
  313. package/dist/types/src/services/index.d.ts +2 -0
  314. package/dist/types/src/services/index.d.ts.map +1 -0
  315. package/dist/types/src/skills/GitHubSkill.d.ts +12 -0
  316. package/dist/types/src/skills/GitHubSkill.d.ts.map +1 -0
  317. package/dist/types/src/skills/index.d.ts +2 -0
  318. package/dist/types/src/skills/index.d.ts.map +1 -0
  319. package/dist/types/src/stories/Generate.stories.d.ts +27 -0
  320. package/dist/types/src/stories/Generate.stories.d.ts.map +1 -0
  321. package/dist/types/src/stories/Links.stories.d.ts +23 -0
  322. package/dist/types/src/stories/Links.stories.d.ts.map +1 -0
  323. package/dist/types/src/stories/PullRequestArticle.stories.d.ts +359 -0
  324. package/dist/types/src/stories/PullRequestArticle.stories.d.ts.map +1 -0
  325. package/dist/types/src/stories/PullRequestFiles.stories.d.ts +365 -0
  326. package/dist/types/src/stories/PullRequestFiles.stories.d.ts.map +1 -0
  327. package/dist/types/src/stories/PullRequestOverview.stories.d.ts +367 -0
  328. package/dist/types/src/stories/PullRequestOverview.stories.d.ts.map +1 -0
  329. package/dist/types/src/stories/PullRequestsArticle.stories.d.ts +357 -0
  330. package/dist/types/src/stories/PullRequestsArticle.stories.d.ts.map +1 -0
  331. package/dist/types/src/stories/Walkthrough.stories.d.ts +380 -0
  332. package/dist/types/src/stories/Walkthrough.stories.d.ts.map +1 -0
  333. package/dist/types/src/stories/github.d.ts +23 -0
  334. package/dist/types/src/stories/github.d.ts.map +1 -0
  335. package/dist/types/src/stories/github.test.d.ts +2 -0
  336. package/dist/types/src/stories/github.test.d.ts.map +1 -0
  337. package/dist/types/src/stories/walkthrough-fixture.d.ts +8 -0
  338. package/dist/types/src/stories/walkthrough-fixture.d.ts.map +1 -0
  339. package/dist/types/src/testing/fixtures.d.ts +14 -0
  340. package/dist/types/src/testing/fixtures.d.ts.map +1 -0
  341. package/dist/types/src/testing/index.d.ts +4 -0
  342. package/dist/types/src/testing/index.d.ts.map +1 -0
  343. package/dist/types/src/testing/plugin.d.ts +4 -0
  344. package/dist/types/src/testing/plugin.d.ts.map +1 -0
  345. package/dist/types/src/testing/pull-request-13348.d.ts +6 -0
  346. package/dist/types/src/testing/pull-request-13348.d.ts.map +1 -0
  347. package/dist/types/src/translations.d.ts +339 -53
  348. package/dist/types/src/translations.d.ts.map +1 -1
  349. package/dist/types/src/types/GitHubCapabilities.d.ts +13 -0
  350. package/dist/types/src/types/GitHubCapabilities.d.ts.map +1 -0
  351. package/dist/types/src/types/GitHubEvents.d.ts +8 -0
  352. package/dist/types/src/types/GitHubEvents.d.ts.map +1 -0
  353. package/dist/types/src/types/GitHubOperation.d.ts +270 -0
  354. package/dist/types/src/types/GitHubOperation.d.ts.map +1 -0
  355. package/dist/types/src/types/PullRequestsView.d.ts +35 -0
  356. package/dist/types/src/types/PullRequestsView.d.ts.map +1 -0
  357. package/dist/types/src/types/Walkthrough.d.ts +31 -0
  358. package/dist/types/src/types/Walkthrough.d.ts.map +1 -0
  359. package/dist/types/src/types/Walkthrough.test.d.ts +2 -0
  360. package/dist/types/src/types/Walkthrough.test.d.ts.map +1 -0
  361. package/dist/types/src/types/index.d.ts +5 -0
  362. package/dist/types/src/types/index.d.ts.map +1 -0
  363. package/dist/types/src/walkthrough/fill.d.ts +28 -0
  364. package/dist/types/src/walkthrough/fill.d.ts.map +1 -0
  365. package/dist/types/src/walkthrough/fill.test.d.ts +2 -0
  366. package/dist/types/src/walkthrough/fill.test.d.ts.map +1 -0
  367. package/dist/types/src/walkthrough/generate.d.ts +67 -0
  368. package/dist/types/src/walkthrough/generate.d.ts.map +1 -0
  369. package/dist/types/src/walkthrough/generate.test.d.ts +2 -0
  370. package/dist/types/src/walkthrough/generate.test.d.ts.map +1 -0
  371. package/dist/types/src/walkthrough/generated.d.ts +20 -0
  372. package/dist/types/src/walkthrough/generated.d.ts.map +1 -0
  373. package/dist/types/src/walkthrough/generated.test.d.ts +2 -0
  374. package/dist/types/src/walkthrough/generated.test.d.ts.map +1 -0
  375. package/dist/types/src/walkthrough/headings.d.ts +8 -0
  376. package/dist/types/src/walkthrough/headings.d.ts.map +1 -0
  377. package/dist/types/src/walkthrough/headings.test.d.ts +2 -0
  378. package/dist/types/src/walkthrough/headings.test.d.ts.map +1 -0
  379. package/dist/types/src/walkthrough/index.d.ts +9 -0
  380. package/dist/types/src/walkthrough/index.d.ts.map +1 -0
  381. package/dist/types/src/walkthrough/patch.d.ts +48 -0
  382. package/dist/types/src/walkthrough/patch.d.ts.map +1 -0
  383. package/dist/types/src/walkthrough/plan.d.ts +55 -0
  384. package/dist/types/src/walkthrough/plan.d.ts.map +1 -0
  385. package/dist/types/src/walkthrough/plan.test.d.ts +2 -0
  386. package/dist/types/src/walkthrough/plan.test.d.ts.map +1 -0
  387. package/dist/types/src/walkthrough/prompt.d.ts +33 -0
  388. package/dist/types/src/walkthrough/prompt.d.ts.map +1 -0
  389. package/dist/types/src/walkthrough/prompt.test.d.ts +2 -0
  390. package/dist/types/src/walkthrough/prompt.test.d.ts.map +1 -0
  391. package/dist/types/src/walkthrough/score.d.ts +43 -0
  392. package/dist/types/src/walkthrough/score.d.ts.map +1 -0
  393. package/dist/types/src/walkthrough/score.test.d.ts +2 -0
  394. package/dist/types/src/walkthrough/score.test.d.ts.map +1 -0
  395. package/dist/types/tsconfig.tsbuildinfo +1 -0
  396. package/dx.config.ts +39 -0
  397. package/package.json +167 -48
  398. package/src/Extensions.ts +7 -0
  399. package/src/GitHubPlugin.ts +15 -0
  400. package/src/GitHubPlugin.workerd.test.ts +23 -0
  401. package/src/approval.test.ts +40 -0
  402. package/src/approval.ts +39 -0
  403. package/src/capabilities/app-graph-builder.ts +47 -0
  404. package/src/capabilities/connector.ts +95 -0
  405. package/src/capabilities/gen/browser.ts +82 -0
  406. package/src/capabilities/gen/node.ts +43 -0
  407. package/src/capabilities/gen/tauri.ts +82 -0
  408. package/src/capabilities/gen/workerd.ts +43 -0
  409. package/src/capabilities/index.ts +71 -0
  410. package/src/capabilities/link-resolver.ts +137 -0
  411. package/src/capabilities/markdown-extension.ts +146 -0
  412. package/src/capabilities/operation-handler.ts +16 -0
  413. package/src/capabilities/page-action.ts +32 -0
  414. package/src/capabilities/react-surface.ts +98 -0
  415. package/src/capabilities/schema.ts +16 -0
  416. package/src/capabilities/skill-definition.ts +14 -0
  417. package/src/cards/GitHubCard.stories.tsx +165 -0
  418. package/src/cards/GitHubCard.tsx +93 -0
  419. package/src/cards/PullRequestCard.tsx +23 -0
  420. package/src/cards/index.ts +6 -0
  421. package/src/components/CommentComposer/CommentComposer.tsx +109 -0
  422. package/src/components/CommentComposer/index.ts +5 -0
  423. package/src/components/PullRequestFiles/DiffStat.tsx +15 -0
  424. package/src/components/PullRequestFiles/FileTree.tsx +102 -0
  425. package/src/components/PullRequestFiles/PullRequestFiles.tsx +87 -0
  426. package/src/components/PullRequestFiles/files.test.ts +59 -0
  427. package/src/components/PullRequestFiles/files.ts +115 -0
  428. package/src/components/PullRequestFiles/index.ts +8 -0
  429. package/src/components/PullRequestOverview/ArtifactPill.tsx +82 -0
  430. package/src/components/PullRequestOverview/CheckRunList.tsx +120 -0
  431. package/src/components/PullRequestOverview/PullRequestDetails.tsx +15 -0
  432. package/src/components/PullRequestOverview/PullRequestOverview.tsx +110 -0
  433. package/src/components/PullRequestOverview/RelatedCards.tsx +147 -0
  434. package/src/components/PullRequestOverview/index.ts +9 -0
  435. package/src/components/PullRequestStatus/PullRequestStatus.tsx +81 -0
  436. package/src/components/PullRequestStatus/index.ts +5 -0
  437. package/src/components/WalkthroughView/WalkthroughView.tsx +62 -0
  438. package/src/components/WalkthroughView/extensions.ts +53 -0
  439. package/src/components/WalkthroughView/index.ts +6 -0
  440. package/src/components/index.ts +6 -9
  441. package/src/constants.ts +12 -0
  442. package/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.tsx +160 -0
  443. package/src/containers/ImportPullRequestDialog/index.ts +7 -0
  444. package/src/containers/PullRequestArticle/PullRequestArticle.tsx +573 -0
  445. package/src/containers/PullRequestArticle/failure.test.ts +42 -0
  446. package/src/containers/PullRequestArticle/failure.ts +16 -0
  447. package/src/containers/PullRequestArticle/index.ts +5 -0
  448. package/src/containers/PullRequestCardMenu/PullRequestCardMenu.tsx +134 -0
  449. package/src/containers/PullRequestCardMenu/index.ts +5 -0
  450. package/src/containers/PullRequestsArticle/PullRequestsArticle.tsx +361 -0
  451. package/src/containers/PullRequestsArticle/arrange.test.ts +122 -0
  452. package/src/containers/PullRequestsArticle/arrange.ts +245 -0
  453. package/src/containers/PullRequestsArticle/format.ts +31 -0
  454. package/src/containers/PullRequestsArticle/index.ts +5 -0
  455. package/src/containers/WalkthroughArticle/WalkthroughArticle.tsx +31 -0
  456. package/src/containers/WalkthroughArticle/index.ts +5 -0
  457. package/src/containers/index.ts +11 -0
  458. package/src/errors.ts +61 -0
  459. package/src/extensions/index.ts +6 -0
  460. package/src/extensions/links.test.ts +133 -0
  461. package/src/extensions/links.ts +91 -0
  462. package/src/extensions/references.test.ts +83 -0
  463. package/src/extensions/references.ts +100 -0
  464. package/src/github-link.ts +70 -0
  465. package/src/hooks/index.ts +6 -3
  466. package/src/hooks/useOpenObject.ts +48 -0
  467. package/src/hooks/usePullRequestChecks.ts +81 -0
  468. package/src/hooks/usePullRequestDiff.ts +57 -0
  469. package/src/hooks/usePullRequestFiles.ts +98 -0
  470. package/src/hooks/useSyncPullRequest.ts +51 -0
  471. package/src/index.ts +4 -6
  472. package/src/meta.ts +8 -13
  473. package/src/operations/add-pull-request-comment.ts +31 -0
  474. package/src/operations/add-pull-request-review-comment.ts +32 -0
  475. package/src/operations/generate-walkthrough.ts +124 -0
  476. package/src/operations/get-pull-request-diff.ts +37 -0
  477. package/src/operations/get-pull-request-status.ts +44 -0
  478. package/src/operations/get-repositories.ts +53 -0
  479. package/src/operations/import-pull-request-from-snapshot.ts +48 -0
  480. package/src/operations/import-pull-request.test.ts +151 -0
  481. package/src/operations/import-pull-request.ts +141 -0
  482. package/src/operations/index.ts +29 -0
  483. package/src/operations/materialize-target.ts +60 -0
  484. package/src/operations/pull-request.test.ts +120 -0
  485. package/src/operations/pull-request.ts +141 -0
  486. package/src/operations/submit-pull-request-approval.ts +41 -0
  487. package/src/operations/sync-pull-request.ts +37 -0
  488. package/src/operations/sync.test.ts +453 -0
  489. package/src/operations/sync.ts +807 -0
  490. package/src/plugin.test.ts +40 -0
  491. package/src/plugin.ts +37 -0
  492. package/src/pull-request-body.test.ts +61 -0
  493. package/src/pull-request-body.ts +144 -0
  494. package/src/pull-request.test.ts +67 -0
  495. package/src/pull-request.ts +80 -0
  496. package/src/services/github-api.ts +735 -0
  497. package/src/services/index.ts +5 -0
  498. package/src/skills/GitHubSkill.ts +46 -0
  499. package/src/skills/index.ts +5 -0
  500. package/src/stories/Generate.stories.tsx +152 -0
  501. package/src/stories/Links.stories.tsx +153 -0
  502. package/src/stories/PullRequestArticle.stories.tsx +107 -0
  503. package/src/stories/PullRequestFiles.stories.tsx +69 -0
  504. package/src/stories/PullRequestOverview.stories.tsx +113 -0
  505. package/src/stories/PullRequestsArticle.stories.tsx +170 -0
  506. package/src/stories/Walkthrough.stories.tsx +110 -0
  507. package/src/stories/github.test.ts +65 -0
  508. package/src/stories/github.ts +70 -0
  509. package/src/stories/walkthrough-fixture.ts +115 -0
  510. package/src/testing/fixtures.ts +99 -0
  511. package/src/testing/index.ts +7 -0
  512. package/src/testing/plugin.ts +25 -0
  513. package/src/testing/pull-request-13348.ts +104 -0
  514. package/src/testing/pull-request-13363.patch +2981 -0
  515. package/src/translations.ts +135 -63
  516. package/src/types/GitHubCapabilities.ts +27 -0
  517. package/src/types/GitHubEvents.ts +16 -0
  518. package/src/types/GitHubOperation.ts +371 -0
  519. package/src/types/PullRequestsView.ts +45 -0
  520. package/src/types/Walkthrough.test.ts +75 -0
  521. package/src/types/Walkthrough.ts +66 -0
  522. package/src/types/index.ts +8 -0
  523. package/src/vite-env.d.ts +15 -0
  524. package/src/walkthrough/fill.test.ts +337 -0
  525. package/src/walkthrough/fill.ts +246 -0
  526. package/src/walkthrough/generate.test.ts +219 -0
  527. package/src/walkthrough/generate.ts +248 -0
  528. package/src/walkthrough/generated.test.ts +70 -0
  529. package/src/walkthrough/generated.ts +70 -0
  530. package/src/walkthrough/headings.test.ts +40 -0
  531. package/src/walkthrough/headings.ts +39 -0
  532. package/src/walkthrough/index.ts +12 -0
  533. package/src/walkthrough/patch.ts +154 -0
  534. package/src/walkthrough/plan.test.ts +178 -0
  535. package/src/walkthrough/plan.ts +251 -0
  536. package/src/walkthrough/prompt.test.ts +100 -0
  537. package/src/walkthrough/prompt.ts +147 -0
  538. package/src/walkthrough/score.test.ts +272 -0
  539. package/src/walkthrough/score.ts +430 -0
  540. package/README.md +0 -15
  541. package/dist/lib/browser/chunk-S4MPSBA5.mjs +0 -21
  542. package/dist/lib/browser/chunk-S4MPSBA5.mjs.map +0 -7
  543. package/dist/lib/browser/index.css +0 -7
  544. package/dist/lib/browser/index.css.map +0 -7
  545. package/dist/lib/browser/index.mjs +0 -1535
  546. package/dist/lib/browser/index.mjs.map +0 -7
  547. package/dist/lib/browser/meta.json +0 -1
  548. package/dist/lib/browser/meta.mjs +0 -11
  549. package/dist/lib/browser/meta.mjs.map +0 -7
  550. package/dist/types/src/GithubPlugin.d.ts +0 -4
  551. package/dist/types/src/GithubPlugin.d.ts.map +0 -1
  552. package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts +0 -4
  553. package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts.map +0 -1
  554. package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts +0 -9
  555. package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts.map +0 -1
  556. package/dist/types/src/components/EmbeddedMain/index.d.ts +0 -2
  557. package/dist/types/src/components/EmbeddedMain/index.d.ts.map +0 -1
  558. package/dist/types/src/components/ExportDialog.d.ts +0 -8
  559. package/dist/types/src/components/ExportDialog.d.ts.map +0 -1
  560. package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts +0 -3
  561. package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts.map +0 -1
  562. package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts +0 -15
  563. package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts.map +0 -1
  564. package/dist/types/src/components/GithubApiProviders/index.d.ts +0 -3
  565. package/dist/types/src/components/GithubApiProviders/index.d.ts.map +0 -1
  566. package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts +0 -6
  567. package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts.map +0 -1
  568. package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts +0 -7
  569. package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts.map +0 -1
  570. package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts +0 -6
  571. package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts.map +0 -1
  572. package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts +0 -16
  573. package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts.map +0 -1
  574. package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts +0 -3
  575. package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts.map +0 -1
  576. package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts +0 -11
  577. package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts.map +0 -1
  578. package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts +0 -3
  579. package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts.map +0 -1
  580. package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts +0 -6
  581. package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts.map +0 -1
  582. package/dist/types/src/components/ImportDialog.d.ts +0 -7
  583. package/dist/types/src/components/ImportDialog.d.ts.map +0 -1
  584. package/dist/types/src/components/Issue.d.ts +0 -5
  585. package/dist/types/src/components/Issue.d.ts.map +0 -1
  586. package/dist/types/src/components/Loading/Loading.d.ts +0 -15
  587. package/dist/types/src/components/Loading/Loading.d.ts.map +0 -1
  588. package/dist/types/src/components/Loading/Loading.stories.d.ts +0 -40
  589. package/dist/types/src/components/Loading/Loading.stories.d.ts.map +0 -1
  590. package/dist/types/src/components/Loading/index.d.ts +0 -2
  591. package/dist/types/src/components/Loading/index.d.ts.map +0 -1
  592. package/dist/types/src/components/MarkdownActions.d.ts +0 -7
  593. package/dist/types/src/components/MarkdownActions.d.ts.map +0 -1
  594. package/dist/types/src/components/UrlDialog.d.ts +0 -6
  595. package/dist/types/src/components/UrlDialog.d.ts.map +0 -1
  596. package/dist/types/src/hooks/useDocGhId.d.ts +0 -6
  597. package/dist/types/src/hooks/useDocGhId.d.ts.map +0 -1
  598. package/dist/types/src/hooks/useGhIdFromUrl.d.ts +0 -2
  599. package/dist/types/src/hooks/useGhIdFromUrl.d.ts.map +0 -1
  600. package/dist/types/src/types.d.ts +0 -30
  601. package/dist/types/src/types.d.ts.map +0 -1
  602. package/src/GithubPlugin.tsx +0 -127
  603. package/src/components/EmbeddedMain/EmbeddedMain.tsx +0 -294
  604. package/src/components/EmbeddedMain/GfmPreview.tsx +0 -110
  605. package/src/components/EmbeddedMain/embedded.css +0 -3
  606. package/src/components/EmbeddedMain/index.ts +0 -5
  607. package/src/components/ExportDialog.tsx +0 -157
  608. package/src/components/GithubApiProviders/GitHubSettings.tsx +0 -72
  609. package/src/components/GithubApiProviders/OctokitProvider.tsx +0 -60
  610. package/src/components/GithubApiProviders/index.ts +0 -6
  611. package/src/components/GithubEchoResolverProviders/DocumentTreeItem.tsx +0 -26
  612. package/src/components/GithubEchoResolverProviders/ResolverContext.tsx +0 -137
  613. package/src/components/GithubEchoResolverProviders/ResolverDialog.tsx +0 -34
  614. package/src/components/GithubEchoResolverProviders/ResolverProps.ts +0 -23
  615. package/src/components/GithubEchoResolverProviders/ResolverTree.tsx +0 -86
  616. package/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.tsx +0 -105
  617. package/src/components/GithubEchoResolverProviders/index.ts +0 -6
  618. package/src/components/GithubEchoResolverProviders/spaceResolvers.ts +0 -86
  619. package/src/components/ImportDialog.tsx +0 -72
  620. package/src/components/Issue.tsx +0 -62
  621. package/src/components/Loading/Loading.stories.tsx +0 -32
  622. package/src/components/Loading/Loading.tsx +0 -70
  623. package/src/components/Loading/index.ts +0 -5
  624. package/src/components/MarkdownActions.tsx +0 -136
  625. package/src/components/UrlDialog.tsx +0 -52
  626. package/src/hooks/useDocGhId.ts +0 -38
  627. package/src/hooks/useGhIdFromUrl.ts +0 -26
  628. package/src/types.ts +0 -51
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-pull-request2.mjs","names":[],"sources":["../../src/operations/pull-request.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\n\nimport { Database, Filter, Obj, type Ref } from '@dxos/echo';\nimport { Connection } from '@dxos/link';\nimport { type PullRequest } from '@dxos/types';\n\nimport { type GitHubOperation } from '#types';\n\nimport { GITHUB_PROVIDER_ID } from '../constants.ts';\nimport { GitHubPullRequestUnstoredError } from '../errors.ts';\nimport { GitHubApi } from '../services/index.ts';\n\n/**\n * The GitHub connection whose token requests are sent with: the first one holding a token. Shared by\n * the handlers and by the UI that sends the user to reconnect, so both name the same connection.\n */\nexport const githubConnection = () =>\n Effect.gen(function* () {\n const connections = yield* Database.query(Filter.type(Connection.Connection)).run;\n for (const connection of connections) {\n if (connection.connectorId !== GITHUB_PROVIDER_ID) {\n continue;\n }\n const accessToken = yield* Database.load(connection.accessToken);\n if (accessToken.token) {\n return { connection, token: accessToken.token };\n }\n }\n\n return undefined;\n });\n\n/**\n * The token of {@link githubConnection}, or empty for anonymous — which reaches any public pull\n * request, and is the only option in a space that has not connected GitHub.\n */\nexport const githubToken = () => githubConnection().pipe(Effect.map((selected) => selected?.token ?? ''));\n\n/**\n * The stored pull request behind an operation's input and credentials for its space.\n *\n * The invoker carries no database resolver, so handlers derive one from the pull request itself; a\n * preview card's in-memory pull request has none and cannot be acted on.\n */\nexport const resolvePullRequest = (ref: Ref.Ref<PullRequest.PullRequest>) =>\n Effect.gen(function* () {\n const pullRequest = ref.target;\n const db = pullRequest ? Obj.getDatabase(pullRequest) : undefined;\n if (!pullRequest || !db) {\n return yield* Effect.die(new GitHubPullRequestUnstoredError());\n }\n const token = yield* githubToken().pipe(Effect.provide(Database.layer(db)));\n return { pullRequest, db, credentials: Layer.succeed(GitHubApi.GitHubCredentials, { token }) };\n });\n\n// `stale` is a completed run GitHub never re-ran, which branch protection does not count as passing.\nconst FAILED_CONCLUSIONS = new Set([\n 'failure',\n 'cancelled',\n 'timed_out',\n 'action_required',\n 'startup_failure',\n 'stale',\n]);\n\n/** One check run as the article lists it: its outcome folded the way {@link summarizeCheckRuns} counts it. */\nexport const toCheckRun = (run: GitHubApi.GitHubCheckRun): GitHubOperation.CheckRun => {\n const outcome: GitHubOperation.CheckOutcome =\n run.status !== 'completed'\n ? 'pending'\n : run.conclusion && FAILED_CONCLUSIONS.has(run.conclusion)\n ? 'failure'\n : run.conclusion === 'skipped'\n ? 'skipped'\n : run.conclusion === 'neutral'\n ? 'neutral'\n : 'success';\n const url = run.details_url ?? run.html_url;\n return {\n name: run.name,\n outcome,\n ...(run.conclusion ? { conclusion: run.conclusion } : {}),\n ...(url ? { url } : {}),\n ...(run.started_at ? { startedAt: run.started_at } : {}),\n ...(run.completed_at ? { completedAt: run.completed_at } : {}),\n };\n};\n\n/** Folds a commit's check runs into one outcome: any failure fails, then any unfinished run is pending. */\nexport const summarizeCheckRuns = (\n runs: readonly GitHubApi.GitHubCheckRun[],\n): { ci: GitHubOperation.CiState; checks: GitHubOperation.CheckCounts } => {\n const checks = { total: runs.length, passed: 0, failed: 0, pending: 0 };\n for (const run of runs) {\n if (run.status !== 'completed') {\n checks.pending++;\n } else if (run.conclusion && FAILED_CONCLUSIONS.has(run.conclusion)) {\n checks.failed++;\n } else {\n checks.passed++;\n }\n }\n\n const ci: GitHubOperation.CiState =\n checks.total === 0 ? 'none' : checks.failed > 0 ? 'failure' : checks.pending > 0 ? 'pending' : 'success';\n return { ci, checks };\n};\n\n/** Review states that set a reviewer's standing verdict; a comment leaves the previous one in place. */\nconst VERDICT_STATES = new Set(['APPROVED', 'CHANGES_REQUESTED', 'DISMISSED']);\n\n/**\n * Folds a pull request's reviews into where they stand, from each reviewer's latest verdict — the\n * way GitHub reads them: a later approval clears that reviewer's request for changes, and a dismissal\n * withdraws whichever verdict it replaced.\n */\nexport const summarizeReviews = (\n reviews: readonly GitHubApi.GitHubSubmittedReview[],\n): { review: GitHubOperation.ReviewState; approvals: number } => {\n const verdicts = new Map<string, string>();\n for (const review of reviews) {\n const login = review.user?.login;\n if (login && VERDICT_STATES.has(review.state)) {\n verdicts.set(login, review.state);\n }\n }\n\n const states = [...verdicts.values()];\n const approvals = states.filter((state) => state === 'APPROVED').length;\n const review: GitHubOperation.ReviewState = states.includes('CHANGES_REQUESTED')\n ? 'changes_requested'\n : approvals > 0\n ? 'approved'\n : 'none';\n return { review, approvals };\n};\n"],"mappings":";;;;;;;;;;;;AAqBA,IAAa,yBACX,OAAO,IAAI,aAAa;CACtB,MAAM,cAAc,OAAO,SAAS,MAAM,OAAO,KAAK,WAAW,UAAU,CAAC,CAAC,CAAC;CAC9E,KAAK,MAAM,cAAc,aAAa;EACpC,IAAI,WAAW,gBAAA,UACb;EAEF,MAAM,cAAc,OAAO,SAAS,KAAK,WAAW,WAAW;EAC/D,IAAI,YAAY,OACd,OAAO;GAAE;GAAY,OAAO,YAAY;EAAM;CAElD;AAGF,CAAC;;;;;AAMH,IAAa,oBAAoB,iBAAiB,CAAC,CAAC,KAAK,OAAO,KAAK,aAAa,UAAU,SAAS,EAAE,CAAC;;;;;;;AAQxG,IAAa,sBAAsB,QACjC,OAAO,IAAI,aAAa;CACtB,MAAM,cAAc,IAAI;CACxB,MAAM,KAAK,cAAc,IAAI,YAAY,WAAW,IAAI,KAAA;CACxD,IAAI,CAAC,eAAe,CAAC,IACnB,OAAO,OAAO,OAAO,IAAI,IAAI,+BAA+B,CAAC;CAE/D,MAAM,QAAQ,OAAO,YAAY,CAAC,CAAC,KAAK,OAAO,QAAQ,SAAS,MAAM,EAAE,CAAC,CAAC;CAC1E,OAAO;EAAE;EAAa;EAAI,aAAa,MAAM,QAAQ,mBAA6B,EAAE,MAAM,CAAC;CAAE;AAC/F,CAAC;AAGH,IAAM,qCAAqB,IAAI,IAAI;CACjC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,IAAa,cAAc,QAA4D;CACrF,MAAM,UACJ,IAAI,WAAW,cACX,YACA,IAAI,cAAc,mBAAmB,IAAI,IAAI,UAAU,IACrD,YACA,IAAI,eAAe,YACjB,YACA,IAAI,eAAe,YACjB,YACA;CACZ,MAAM,MAAM,IAAI,eAAe,IAAI;CACnC,OAAO;EACL,MAAM,IAAI;EACV;EACA,GAAI,IAAI,aAAa,EAAE,YAAY,IAAI,WAAW,IAAI,CAAC;EACvD,GAAI,MAAM,EAAE,IAAI,IAAI,CAAC;EACrB,GAAI,IAAI,aAAa,EAAE,WAAW,IAAI,WAAW,IAAI,CAAC;EACtD,GAAI,IAAI,eAAe,EAAE,aAAa,IAAI,aAAa,IAAI,CAAC;CAC9D;AACF;;AAGA,IAAa,sBACX,SACyE;CACzE,MAAM,SAAS;EAAE,OAAO,KAAK;EAAQ,QAAQ;EAAG,QAAQ;EAAG,SAAS;CAAE;CACtE,KAAK,MAAM,OAAO,MAChB,IAAI,IAAI,WAAW,aACjB,OAAO;MACF,IAAI,IAAI,cAAc,mBAAmB,IAAI,IAAI,UAAU,GAChE,OAAO;MAEP,OAAO;CAMX,OAAO;EAAE,IADP,OAAO,UAAU,IAAI,SAAS,OAAO,SAAS,IAAI,YAAY,OAAO,UAAU,IAAI,YAAY;EACpF;CAAO;AACtB;;AAGA,IAAM,iCAAiB,IAAI,IAAI;CAAC;CAAY;CAAqB;AAAW,CAAC;;;;;;AAO7E,IAAa,oBACX,YAC+D;CAC/D,MAAM,2BAAW,IAAI,IAAoB;CACzC,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,QAAQ,OAAO,MAAM;EAC3B,IAAI,SAAS,eAAe,IAAI,OAAO,KAAK,GAC1C,SAAS,IAAI,OAAO,OAAO,KAAK;CAEpC;CAEA,MAAM,SAAS,CAAC,GAAG,SAAS,OAAO,CAAC;CACpC,MAAM,YAAY,OAAO,QAAQ,UAAU,UAAU,UAAU,CAAC,CAAC;CAMjE,OAAO;EAAE,QALmC,OAAO,SAAS,mBAAmB,IAC3E,sBACA,YAAY,IACV,aACA;EACW;CAAU;AAC7B"}
@@ -0,0 +1,233 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import * as Capability from "@dxos/app-framework/Capability";
3
+ import { IMPORT_PULL_REQUEST_DIALOG, meta } from "#meta";
4
+ import { lazy, useEffect } from "react";
5
+ import { GitHubOperation, Walkthrough } from "#types";
6
+ import * as Effect from "effect/Effect";
7
+ import { Issue, PullRequest, Repo } from "@dxos/types";
8
+ import { Obj, Ref, Type } from "@dxos/echo";
9
+ import { log } from "@dxos/log";
10
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
11
+ import * as Surface from "@dxos/app-framework/Surface";
12
+ import * as AppSurface from "@dxos/app-toolkit/AppSurface";
13
+ import { isSpace } from "@dxos/react-client/echo";
14
+ import * as Position from "@dxos/util/Position";
15
+ import * as Card from "@dxos/react-ui/Card";
16
+ import * as Hooks$1 from "@dxos/react-ui/Hooks";
17
+ import * as Layout from "@dxos/react-ui/Layout";
18
+ import * as Tag$1 from "@dxos/react-ui/Tag";
19
+ import { jsx, jsxs } from "react/jsx-runtime";
20
+ import { useObject } from "@dxos/echo-react";
21
+ import * as Hooks from "@dxos/app-framework/Hooks";
22
+ //#region src/cards/GitHubCard.tsx
23
+ var stateHue = {
24
+ open: "green",
25
+ closed: "red",
26
+ merged: "purple",
27
+ draft: "neutral"
28
+ };
29
+ /**
30
+ * Card content for a repository, pull request or issue: reference, state or branch, author, diff size, description and
31
+ * the link out. Each row leads with an icon in the card's start rail, so the text lines up with the title.
32
+ */
33
+ var GitHubCard = ({ subject }) => {
34
+ const { t } = Hooks$1.useTranslation(meta.profile.key);
35
+ const { owner, number, state, author, additions, deletions, defaultBranch, description, url } = subject;
36
+ const name = "name" in subject ? subject.name : subject.repo;
37
+ return /* @__PURE__ */ jsxs(Card.Body, { children: [
38
+ /* @__PURE__ */ jsx(Card.Row, {
39
+ icon: "ph--github-logo--regular",
40
+ trailing: state ? /* @__PURE__ */ jsx(Tag$1.Tag, {
41
+ hue: stateHue[state],
42
+ children: state
43
+ }) : defaultBranch ? /* @__PURE__ */ jsx(Tag$1.Tag, {
44
+ hue: "neutral",
45
+ children: defaultBranch
46
+ }) : void 0,
47
+ children: /* @__PURE__ */ jsx(Card.Text, {
48
+ variant: "muted",
49
+ children: [`${owner}/${name}`, number].filter(Boolean).join("#")
50
+ })
51
+ }),
52
+ author && /* @__PURE__ */ jsx(Card.Row, {
53
+ icon: "ph--user--regular",
54
+ children: /* @__PURE__ */ jsx(Card.Text, {
55
+ variant: "muted",
56
+ children: author
57
+ })
58
+ }),
59
+ (additions !== void 0 || deletions !== void 0) && /* @__PURE__ */ jsx(Card.Row, {
60
+ icon: "ph--plus-minus--regular",
61
+ children: /* @__PURE__ */ jsxs(Layout.Flex, {
62
+ gap: "sm",
63
+ align: "center",
64
+ children: [additions !== void 0 && /* @__PURE__ */ jsxs("span", {
65
+ className: "text-green-500",
66
+ children: ["+", additions]
67
+ }), deletions !== void 0 && /* @__PURE__ */ jsxs("span", {
68
+ className: "text-red-500",
69
+ children: ["−", deletions]
70
+ })]
71
+ })
72
+ }),
73
+ description && /* @__PURE__ */ jsx(Card.Row, {
74
+ icon: "ph--text-align-left--regular",
75
+ children: /* @__PURE__ */ jsx(Card.Text, {
76
+ lines: 3,
77
+ variant: "muted",
78
+ children: description
79
+ })
80
+ }),
81
+ url && /* @__PURE__ */ jsx(Card.Row, {
82
+ icon: "ph--arrow-square-out--regular",
83
+ children: /* @__PURE__ */ jsx("a", {
84
+ className: "dx-link-accent",
85
+ href: url,
86
+ target: "_blank",
87
+ rel: "noopener noreferrer",
88
+ children: t("open-on-github.label")
89
+ })
90
+ })
91
+ ] });
92
+ };
93
+ //#endregion
94
+ //#region src/hooks/useSyncPullRequest.ts
95
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-github/src/hooks/useSyncPullRequest.ts";
96
+ /** How long a re-sync stands before the pull request is read from GitHub again. */
97
+ var SYNC_INTERVAL = 3e5;
98
+ var lastSynced = /* @__PURE__ */ new Map();
99
+ var markSynced = (id, now) => {
100
+ for (const [key, syncedAt] of lastSynced) if (now - syncedAt >= SYNC_INTERVAL) lastSynced.delete(key);
101
+ lastSynced.set(id, now);
102
+ };
103
+ /**
104
+ * Refreshes a stored pull request from GitHub when it is shown, since whatever shows it is the moment
105
+ * its fields are worth trusting: a repository sync may be days old, and an import is never re-synced.
106
+ *
107
+ * A pull request held by no database (a link preview) is skipped, as there is nothing to write back to,
108
+ * and one synced within {@link SYNC_INTERVAL} is skipped too.
109
+ */
110
+ var useSyncPullRequest = (pullRequest) => {
111
+ const { invokePromise } = Hooks.useOperationInvoker();
112
+ const spaceId = Obj.getDatabase(pullRequest)?.spaceId;
113
+ useEffect(() => {
114
+ const now = Date.now();
115
+ if (!spaceId || now - (lastSynced.get(pullRequest.id) ?? 0) < SYNC_INTERVAL) return;
116
+ markSynced(pullRequest.id, now);
117
+ invokePromise(GitHubOperation.SyncPullRequest, { pullRequest: Ref.make(pullRequest) }, { spaceId }).then(({ error }) => error && log.warn("pull request sync failed", { error }, {
118
+ "~LogMeta": "~LogMeta",
119
+ F: __dxlog_file,
120
+ L: 48,
121
+ S: void 0
122
+ }));
123
+ }, [
124
+ invokePromise,
125
+ pullRequest,
126
+ spaceId
127
+ ]);
128
+ };
129
+ //#endregion
130
+ //#region src/cards/PullRequestCard.tsx
131
+ /**
132
+ * A pull request's card, re-synced from GitHub whenever it is shown: the card is often where a stale
133
+ * pull request is first read, e.g. in a task list's popover.
134
+ */
135
+ var PullRequestCard = ({ role, subject }) => {
136
+ useObject(subject);
137
+ useSyncPullRequest(subject);
138
+ return /* @__PURE__ */ jsx(GitHubCard, {
139
+ role,
140
+ subject
141
+ });
142
+ };
143
+ //#endregion
144
+ //#region src/containers/index.ts
145
+ var ImportPullRequestDialog = lazy(() => import("./chunk-ImportPullRequestDialog.mjs"));
146
+ var PullRequestCardMenu = lazy(() => import("./chunk-PullRequestCardMenu.mjs"));
147
+ var PullRequestArticle = lazy(() => import("./chunk-PullRequestArticle2.mjs"));
148
+ var PullRequestsArticle = lazy(() => import("./chunk-PullRequestsArticle.mjs"));
149
+ var WalkthroughArticle = lazy(() => import("./chunk-WalkthroughArticle.mjs"));
150
+ //#endregion
151
+ //#region src/capabilities/react-surface.ts
152
+ var react_surface_exports = /* @__PURE__ */ __exportAll({ default: () => react_surface_default });
153
+ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contribute(Capabilities.ReactSurface, [
154
+ Surface.create({
155
+ id: "repoCard",
156
+ position: Position.first,
157
+ filter: AppSurface.object(AppSurface.CardContent, Repo.Repo),
158
+ component: GitHubCard,
159
+ props: ({ role, data: { subject } }) => ({
160
+ role,
161
+ subject
162
+ })
163
+ }),
164
+ Surface.create({
165
+ id: "issueCard",
166
+ position: Position.first,
167
+ filter: AppSurface.object(AppSurface.CardContent, Issue.Issue),
168
+ component: GitHubCard,
169
+ props: ({ role, data: { subject } }) => ({
170
+ role,
171
+ subject
172
+ })
173
+ }),
174
+ Surface.create({
175
+ id: "pullRequestCard",
176
+ position: Position.first,
177
+ filter: AppSurface.object(AppSurface.CardContent, PullRequest.PullRequest),
178
+ component: PullRequestCard,
179
+ props: ({ role, data: { subject } }) => ({
180
+ role,
181
+ subject
182
+ })
183
+ }),
184
+ Surface.create({
185
+ id: "pullRequestCardMenu",
186
+ filter: AppSurface.object(AppSurface.CardMenu, PullRequest.PullRequest),
187
+ component: PullRequestCardMenu,
188
+ props: ({ data: { subject, menu } }) => ({
189
+ subject,
190
+ menu
191
+ })
192
+ }),
193
+ Surface.create({
194
+ id: "pullRequestArticle",
195
+ filter: AppSurface.object(AppSurface.Article, PullRequest.PullRequest),
196
+ component: PullRequestArticle,
197
+ props: ({ role, data }) => ({
198
+ role,
199
+ ...data
200
+ })
201
+ }),
202
+ Surface.create({
203
+ id: "pullRequestsArticle",
204
+ position: Position.first,
205
+ filter: AppSurface.subject(AppSurface.Article, isPullRequestType),
206
+ component: PullRequestsArticle,
207
+ props: ({ role, data: { attendableId, properties } }) => ({
208
+ role,
209
+ attendableId,
210
+ db: isSpace(properties?.space) ? properties.space.db : void 0
211
+ })
212
+ }),
213
+ Surface.create({
214
+ id: "walkthroughArticle",
215
+ filter: AppSurface.object(AppSurface.Article, Walkthrough.Walkthrough),
216
+ component: WalkthroughArticle,
217
+ props: ({ role, data }) => ({
218
+ role,
219
+ ...data
220
+ })
221
+ }),
222
+ Surface.create({
223
+ id: IMPORT_PULL_REQUEST_DIALOG,
224
+ filter: AppSurface.component(AppSurface.Dialog, IMPORT_PULL_REQUEST_DIALOG),
225
+ component: ImportPullRequestDialog
226
+ })
227
+ ])));
228
+ var PULL_REQUEST_TYPENAME = Type.getTypename(PullRequest.PullRequest);
229
+ var isPullRequestType = (subject) => Type.isType(subject) && Type.getTypename(subject) === PULL_REQUEST_TYPENAME;
230
+ //#endregion
231
+ export { react_surface_default as default, useSyncPullRequest as n, react_surface_exports as t };
232
+
233
+ //# sourceMappingURL=chunk-react-surface.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/cards/GitHubCard.tsx","../../src/hooks/useSyncPullRequest.ts","../../src/cards/PullRequestCard.tsx","../../src/containers/index.ts","../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport type * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport * as Card from '@dxos/react-ui/Card';\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport * as Layout from '@dxos/react-ui/Layout';\nimport * as Tag from '@dxos/react-ui/Tag';\nimport { type Issue, type PullRequest, type Repo } from '@dxos/types';\n\nimport { meta } from '#meta';\n\ntype Subject = Repo.Repo | Issue.Issue | PullRequest.PullRequest;\n\n/**\n * What the card reads off any of the three types: each field is present on some of them and\n * optional here, so one render path shows whatever the subject carries.\n */\ntype Fields = {\n owner: string;\n number?: number;\n state?: PullRequest.State;\n author?: string;\n additions?: number;\n deletions?: number;\n defaultBranch?: string;\n description?: string;\n url?: string;\n};\n\nconst stateHue: Record<PullRequest.State, Tag.TagHue> = {\n open: 'green',\n closed: 'red',\n merged: 'purple',\n draft: 'neutral',\n};\n\n/**\n * Card content for a repository, pull request or issue: reference, state or branch, author, diff size, description and\n * the link out. Each row leads with an icon in the card's start rail, so the text lines up with the title.\n */\nexport const GitHubCard = ({ subject }: AppSurface.ObjectCardProps<Subject>) => {\n const { t } = Hooks.useTranslation(meta.profile.key);\n const { owner, number, state, author, additions, deletions, defaultBranch, description, url }: Fields = subject;\n const name = 'name' in subject ? subject.name : subject.repo;\n\n return (\n <Card.Body>\n <Card.Row\n icon='ph--github-logo--regular'\n trailing={\n state ? (\n <Tag.Tag hue={stateHue[state]}>{state}</Tag.Tag>\n ) : defaultBranch ? (\n <Tag.Tag hue='neutral'>{defaultBranch}</Tag.Tag>\n ) : undefined\n }\n >\n <Card.Text variant='muted'>{[`${owner}/${name}`, number].filter(Boolean).join('#')}</Card.Text>\n </Card.Row>\n {author && (\n <Card.Row icon='ph--user--regular'>\n <Card.Text variant='muted'>{author}</Card.Text>\n </Card.Row>\n )}\n {(additions !== undefined || deletions !== undefined) && (\n <Card.Row icon='ph--plus-minus--regular'>\n <Layout.Flex gap='sm' align='center'>\n {additions !== undefined && <span className='text-green-500'>+{additions}</span>}\n {deletions !== undefined && <span className='text-red-500'>−{deletions}</span>}\n </Layout.Flex>\n </Card.Row>\n )}\n {description && (\n <Card.Row icon='ph--text-align-left--regular'>\n <Card.Text lines={3} variant='muted'>\n {description}\n </Card.Text>\n </Card.Row>\n )}\n {url && (\n <Card.Row icon='ph--arrow-square-out--regular'>\n <a className='dx-link-accent' href={url} target='_blank' rel='noopener noreferrer'>\n {t('open-on-github.label')}\n </a>\n </Card.Row>\n )}\n </Card.Body>\n );\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport { Obj, Ref } from '@dxos/echo';\nimport { log } from '@dxos/log';\nimport { type PullRequest } from '@dxos/types';\n\nimport { GitHubOperation } from '#types';\n\n/** How long a re-sync stands before the pull request is read from GitHub again. */\nconst SYNC_INTERVAL = 5 * 60_000;\n\n// Keyed by object id: a board of pull request cards would otherwise spend one GitHub request per\n// card each time it mounts, and an anonymous caller has only 60 an hour. Entries past the interval\n// are pruned on every write, so the map holds only pull requests synced within it.\nconst lastSynced = new Map<string, number>();\n\nconst markSynced = (id: string, now: number) => {\n for (const [key, syncedAt] of lastSynced) {\n if (now - syncedAt >= SYNC_INTERVAL) {\n lastSynced.delete(key);\n }\n }\n lastSynced.set(id, now);\n};\n\n/**\n * Refreshes a stored pull request from GitHub when it is shown, since whatever shows it is the moment\n * its fields are worth trusting: a repository sync may be days old, and an import is never re-synced.\n *\n * A pull request held by no database (a link preview) is skipped, as there is nothing to write back to,\n * and one synced within {@link SYNC_INTERVAL} is skipped too.\n */\nexport const useSyncPullRequest = (pullRequest: PullRequest.PullRequest): void => {\n const { invokePromise } = Hooks.useOperationInvoker();\n const spaceId = Obj.getDatabase(pullRequest)?.spaceId;\n useEffect(() => {\n const now = Date.now();\n if (!spaceId || now - (lastSynced.get(pullRequest.id) ?? 0) < SYNC_INTERVAL) {\n return;\n }\n markSynced(pullRequest.id, now);\n void invokePromise(GitHubOperation.SyncPullRequest, { pullRequest: Ref.make(pullRequest) }, { spaceId }).then(\n ({ error }) => error && log.warn('pull request sync failed', { error }),\n );\n }, [invokePromise, pullRequest, spaceId]);\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport type * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport { useObject } from '@dxos/echo-react';\nimport { type PullRequest } from '@dxos/types';\n\nimport { useSyncPullRequest } from '../hooks/index.ts';\nimport { GitHubCard } from './GitHubCard.tsx';\n\n/**\n * A pull request's card, re-synced from GitHub whenever it is shown: the card is often where a stale\n * pull request is first read, e.g. in a task list's popover.\n */\nexport const PullRequestCard = ({ role, subject }: AppSurface.ObjectCardProps<PullRequest.PullRequest>) => {\n // Subscribed so the fields the sync writes back re-render the card.\n useObject(subject);\n useSyncPullRequest(subject);\n return <GitHubCard role={role} subject={subject} />;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const ImportPullRequestDialog: ComponentType<any> = lazy(() => import('./ImportPullRequestDialog/index.ts'));\nexport const PullRequestCardMenu: ComponentType<any> = lazy(() => import('./PullRequestCardMenu/index.ts'));\nexport const PullRequestArticle: ComponentType<any> = lazy(() => import('./PullRequestArticle/index.ts'));\nexport const PullRequestsArticle: ComponentType<any> = lazy(() => import('./PullRequestsArticle/index.ts'));\nexport const WalkthroughArticle: ComponentType<any> = lazy(() => import('./WalkthroughArticle/index.ts'));\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Surface from '@dxos/app-framework/Surface';\nimport * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport { Type } from '@dxos/echo';\nimport { isSpace } from '@dxos/react-client/echo';\nimport { Issue, PullRequest, Repo } from '@dxos/types';\nimport * as Position from '@dxos/util/Position';\n\nimport { IMPORT_PULL_REQUEST_DIALOG } from '#meta';\nimport { Walkthrough } from '#types';\n\nimport { GitHubCard, PullRequestCard } from '../cards/index.ts';\nimport {\n ImportPullRequestDialog,\n PullRequestArticle,\n PullRequestCardMenu,\n PullRequestsArticle,\n WalkthroughArticle,\n} from '../containers/index.ts';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: 'repoCard',\n position: Position.first,\n filter: AppSurface.object(AppSurface.CardContent, Repo.Repo),\n component: GitHubCard,\n props: ({ role, data: { subject } }) => ({ role, subject }),\n }),\n Surface.create({\n id: 'issueCard',\n position: Position.first,\n filter: AppSurface.object(AppSurface.CardContent, Issue.Issue),\n component: GitHubCard,\n props: ({ role, data: { subject } }) => ({ role, subject }),\n }),\n Surface.create({\n id: 'pullRequestCard',\n position: Position.first,\n filter: AppSurface.object(AppSurface.CardContent, PullRequest.PullRequest),\n component: PullRequestCard,\n props: ({ role, data: { subject } }) => ({ role, subject }),\n }),\n Surface.create({\n id: 'pullRequestCardMenu',\n filter: AppSurface.object(AppSurface.CardMenu, PullRequest.PullRequest),\n component: PullRequestCardMenu,\n props: ({ data: { subject, menu } }) => ({ subject, menu }),\n }),\n // The pull request is the article's subject, and the walkthrough it may have is something the\n // article renders — so a pull request with no narration yet still opens, and offers to write one.\n Surface.create({\n id: 'pullRequestArticle',\n filter: AppSurface.object(AppSurface.Article, PullRequest.PullRequest),\n component: PullRequestArticle,\n props: ({ role, data }) => ({ role, ...data }),\n }),\n // The pull request type's node (the space's Database section) opens as the triage list rather\n // than the generic type collection, which knows nothing of checks, tasks or relevance.\n Surface.create({\n id: 'pullRequestsArticle',\n position: Position.first,\n filter: AppSurface.subject(AppSurface.Article, isPullRequestType),\n component: PullRequestsArticle,\n props: ({ role, data: { attendableId, properties } }) => ({\n role,\n attendableId,\n db: isSpace(properties?.space) ? properties.space.db : undefined,\n }),\n }),\n // A walkthrough opened by id (an older link, a search result) resolves to the same review.\n Surface.create({\n id: 'walkthroughArticle',\n filter: AppSurface.object(AppSurface.Article, Walkthrough.Walkthrough),\n component: WalkthroughArticle,\n props: ({ role, data }) => ({ role, ...data }),\n }),\n Surface.create({\n id: IMPORT_PULL_REQUEST_DIALOG,\n filter: AppSurface.component(AppSurface.Dialog, IMPORT_PULL_REQUEST_DIALOG),\n component: ImportPullRequestDialog,\n }),\n ]),\n ),\n);\n\nconst PULL_REQUEST_TYPENAME = Type.getTypename(PullRequest.PullRequest);\n\nconst isPullRequestType = (subject: unknown): subject is Type.AnyEntity =>\n Type.isType(subject) && Type.getTypename(subject) === PULL_REQUEST_TYPENAME;\n"],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -0,0 +1,15 @@
1
+ import { Walkthrough } from "#types";
2
+ import { PullRequest } from "@dxos/types";
3
+ //#region src/capabilities/schema.ts
4
+ /**
5
+ * Schemas this plugin registers, in a module of their own so they are loaded on demand rather than
6
+ * from the plugin body's graph.
7
+ *
8
+ * `PullRequest` comes with `Walkthrough` because a walkthrough holds a ref to one, and a space that
9
+ * can read the walkthrough has to be able to resolve what it points at.
10
+ */
11
+ var schema_default = [Walkthrough.Walkthrough, PullRequest.PullRequest];
12
+ //#endregion
13
+ export { schema_default as default };
14
+
15
+ //# sourceMappingURL=chunk-schema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-schema.mjs","names":[],"sources":["../../src/capabilities/schema.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { PullRequest } from '@dxos/types';\n\nimport { Walkthrough } from '#types';\n\n/**\n * Schemas this plugin registers, in a module of their own so they are loaded on demand rather than\n * from the plugin body's graph.\n *\n * `PullRequest` comes with `Walkthrough` because a walkthrough holds a ref to one, and a space that\n * can read the walkthrough has to be able to resolve what it points at.\n */\nexport default [Walkthrough.Walkthrough, PullRequest.PullRequest];\n"],"mappings":";;;;;;;;;;AAeA,IAAA,iBAAe,CAAC,YAAY,aAAa,YAAY,WAAW"}
@@ -0,0 +1,10 @@
1
+ import * as Capability from "@dxos/app-framework/Capability";
2
+ import * as Effect from "effect/Effect";
3
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
4
+ import { GitHubSkill } from "#skills";
5
+ //#region src/capabilities/skill-definition.ts
6
+ var skillDefinition = () => Effect.succeed([Capability.contribute(AppCapabilities.SkillDefinition, GitHubSkill)]);
7
+ //#endregion
8
+ export { skillDefinition as default };
9
+
10
+ //# sourceMappingURL=chunk-skill-definition.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-skill-definition.mjs","names":[],"sources":["../../src/capabilities/skill-definition.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 AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\n\nimport { GitHubSkill } from '#skills';\n\nconst skillDefinition = () => Effect.succeed([Capability.contribute(AppCapabilities.SkillDefinition, GitHubSkill)]);\n\nexport default skillDefinition;\n"],"mappings":";;;;;AAWA,IAAM,wBAAwB,OAAO,QAAQ,CAAC,WAAW,WAAW,gBAAgB,iBAAiB,WAAW,CAAC,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { n as approvePullRequest, r as createIssueComment, y as responseStatus } 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
+ import * as Option from "effect/Option";
8
+ //#region src/approval.ts
9
+ /**
10
+ * Machine-readable marker carried by an approval posted as a comment.
11
+ *
12
+ * An HTML comment renders as nothing on GitHub, so the marker is invisible to a human reader while
13
+ * remaining an exact string for an agent polling the conversation — which is the point: a comment
14
+ * fallback has to be as detectable as the review state it stands in for.
15
+ */
16
+ var APPROVAL_MARKER = "<!-- dxos:approval state=approved -->";
17
+ /** Prose shown above the marker; states why the approval is a comment rather than a review. */
18
+ var APPROVAL_TEXT = "Approved — good to land.\n\n_GitHub declined an approving review from this connection (a pull request cannot be approved by its own author, and some tokens carry no review permission), so the approval is recorded here._";
19
+ /** Body of the fallback comment: the reviewer's own summary, the standing text, and the marker. */
20
+ var approvalCommentBody = (body) => [
21
+ body?.trim(),
22
+ APPROVAL_TEXT,
23
+ APPROVAL_MARKER
24
+ ].filter(Boolean).join("\n\n");
25
+ /**
26
+ * Whether an approving review failed for a reason a comment can stand in for.
27
+ *
28
+ * `422` is GitHub's answer to approving one's own pull request, `403` to a token without review
29
+ * permission on the repository. Anything else (a rejected credential, a deleted pull request, a
30
+ * network fault) is a real failure and must surface rather than turn into a comment.
31
+ */
32
+ var isApprovalRefused = (error) => {
33
+ const status = responseStatus(error);
34
+ return status === 403 || status === 422;
35
+ };
36
+ //#endregion
37
+ //#region src/operations/submit-pull-request-approval.ts
38
+ var handler = GitHubOperation.SubmitPullRequestApproval.pipe(Operation.withHandler(Effect.fn(function* ({ pullRequest: ref, body }) {
39
+ const { pullRequest, credentials } = yield* resolvePullRequest(ref);
40
+ const { owner, repo, number } = pullRequest;
41
+ const review = yield* approvePullRequest(owner, repo, number, body).pipe(Effect.provide(credentials), Effect.asSome, Effect.catchIf(isApprovalRefused, () => Effect.succeedNone));
42
+ if (Option.isSome(review)) return {
43
+ reviewId: review.value.id,
44
+ commented: false
45
+ };
46
+ const comment = yield* createIssueComment(owner, repo, number, approvalCommentBody(body)).pipe(Effect.provide(credentials));
47
+ return {
48
+ commentId: comment.id,
49
+ url: comment.html_url ?? void 0,
50
+ commented: true
51
+ };
52
+ }, Effect.provide(FetchHttpClient.layer))));
53
+ //#endregion
54
+ export { handler as default };
55
+
56
+ //# sourceMappingURL=chunk-submit-pull-request-approval.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-submit-pull-request-approval.mjs","names":[],"sources":["../../src/approval.ts","../../src/operations/submit-pull-request-approval.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { GitHubApi } from './services/index.ts';\n\n/**\n * Machine-readable marker carried by an approval posted as a comment.\n *\n * An HTML comment renders as nothing on GitHub, so the marker is invisible to a human reader while\n * remaining an exact string for an agent polling the conversation — which is the point: a comment\n * fallback has to be as detectable as the review state it stands in for.\n */\nexport const APPROVAL_MARKER = '<!-- dxos:approval state=approved -->';\n\n/** Prose shown above the marker; states why the approval is a comment rather than a review. */\nconst APPROVAL_TEXT =\n 'Approved — good to land.\\n\\n' +\n '_GitHub declined an approving review from this connection (a pull request cannot be approved by ' +\n 'its own author, and some tokens carry no review permission), so the approval is recorded here._';\n\n/** Body of the fallback comment: the reviewer's own summary, the standing text, and the marker. */\nexport const approvalCommentBody = (body?: string): string =>\n [body?.trim(), APPROVAL_TEXT, APPROVAL_MARKER].filter(Boolean).join('\\n\\n');\n\n/** Whether a comment body records an approval — the detector an agent runs over a PR's comments. */\nexport const isApprovalComment = (body: string): boolean => body.includes(APPROVAL_MARKER);\n\n/**\n * Whether an approving review failed for a reason a comment can stand in for.\n *\n * `422` is GitHub's answer to approving one's own pull request, `403` to a token without review\n * permission on the repository. Anything else (a rejected credential, a deleted pull request, a\n * network fault) is a real failure and must surface rather than turn into a comment.\n */\nexport const isApprovalRefused = (error: unknown): boolean => {\n const status = GitHubApi.responseStatus(error);\n return status === 403 || status === 422;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as FetchHttpClient from 'effect/http/FetchHttpClient';\nimport * as Option from 'effect/Option';\n\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { GitHubOperation } from '#types';\n\nimport { approvalCommentBody, isApprovalRefused } from '../approval.ts';\nimport { GitHubApi } from '../services/index.ts';\nimport { resolvePullRequest } from './pull-request.ts';\n\nconst handler: Operation.WithHandler<typeof GitHubOperation.SubmitPullRequestApproval> =\n GitHubOperation.SubmitPullRequestApproval.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ pullRequest: ref, body }) {\n const { pullRequest, credentials } = yield* resolvePullRequest(ref);\n const { owner, repo, number } = pullRequest;\n const review = yield* GitHubApi.approvePullRequest(owner, repo, number, body).pipe(\n Effect.provide(credentials),\n Effect.asSome,\n // Only a refusal to review becomes a comment; every other failure stays a failure.\n Effect.catchIf(isApprovalRefused, () => Effect.succeedNone),\n );\n if (Option.isSome(review)) {\n return { reviewId: review.value.id, commented: false };\n }\n\n const comment = yield* GitHubApi.createIssueComment(owner, repo, number, approvalCommentBody(body)).pipe(\n Effect.provide(credentials),\n );\n return { commentId: comment.id, url: comment.html_url ?? undefined, commented: true };\n }, Effect.provide(FetchHttpClient.layer)),\n ),\n );\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAa,kBAAkB;;AAG/B,IAAM,gBACJ;;AAKF,IAAa,uBAAuB,SAClC;CAAC,MAAM,KAAK;CAAG;CAAe;AAAe,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,MAAM;;;;;;;;AAY5E,IAAa,qBAAqB,UAA4B;CAC5D,MAAM,SAAS,eAAyB,KAAK;CAC7C,OAAO,WAAW,OAAO,WAAW;AACtC;;;ACtBA,IAAM,UACJ,gBAAgB,0BAA0B,KACxC,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,aAAa,KAAK,QAAQ;CAC/C,MAAM,EAAE,aAAa,gBAAgB,OAAO,mBAAmB,GAAG;CAClE,MAAM,EAAE,OAAO,MAAM,WAAW;CAChC,MAAM,SAAS,OAAO,mBAA6B,OAAO,MAAM,QAAQ,IAAI,CAAC,CAAC,KAC5E,OAAO,QAAQ,WAAW,GAC1B,OAAO,QAEP,OAAO,QAAQ,yBAAyB,OAAO,WAAW,CAC5D;CACA,IAAI,OAAO,OAAO,MAAM,GACtB,OAAO;EAAE,UAAU,OAAO,MAAM;EAAI,WAAW;CAAM;CAGvD,MAAM,UAAU,OAAO,mBAA6B,OAAO,MAAM,QAAQ,oBAAoB,IAAI,CAAC,CAAC,CAAC,KAClG,OAAO,QAAQ,WAAW,CAC5B;CACA,OAAO;EAAE,WAAW,QAAQ;EAAI,KAAK,QAAQ,YAAY,KAAA;EAAW,WAAW;CAAK;AACtF,GAAG,OAAO,QAAQ,gBAAgB,KAAK,CAAC,CAC1C,CACF"}
@@ -0,0 +1,24 @@
1
+ import { t as pullRequestChanges } from "./chunk-pull-request.mjs";
2
+ import { n as githubToken, r as resolvePullRequest } from "./chunk-pull-request2.mjs";
3
+ import { fetchPullRequestWithFallback } from "./chunk-import-pull-request.mjs";
4
+ import { GitHubOperation } from "#types";
5
+ import * as Operation from "@dxos/compute/Operation";
6
+ import * as Effect from "effect/Effect";
7
+ import { Database, Obj } from "@dxos/echo";
8
+ import * as FetchHttpClient from "effect/http/FetchHttpClient";
9
+ //#region src/operations/sync-pull-request.ts
10
+ var handler = GitHubOperation.SyncPullRequest.pipe(Operation.withHandler(Effect.fn(function* ({ pullRequest: ref }) {
11
+ const { pullRequest, db } = yield* resolvePullRequest(ref);
12
+ const token = yield* githubToken().pipe(Effect.provide(Database.layer(db)));
13
+ const pull = yield* fetchPullRequestWithFallback(pullRequest, token);
14
+ const changes = pullRequestChanges(pullRequest, pull);
15
+ const updated = Object.keys(changes);
16
+ if (updated.length > 0) Obj.update(pullRequest, (pullRequest) => {
17
+ Object.assign(pullRequest, changes);
18
+ });
19
+ return { updated };
20
+ }, Effect.provide(FetchHttpClient.layer))));
21
+ //#endregion
22
+ export { handler as default };
23
+
24
+ //# sourceMappingURL=chunk-sync-pull-request.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-sync-pull-request.mjs","names":[],"sources":["../../src/operations/sync-pull-request.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';\nimport { Database, Obj } from '@dxos/echo';\n\nimport { GitHubOperation } from '#types';\n\nimport { pullRequestChanges } from '../pull-request.ts';\nimport { fetchPullRequestWithFallback } from './import-pull-request.ts';\nimport { githubToken, resolvePullRequest } from './pull-request.ts';\n\nconst handler: Operation.WithHandler<typeof GitHubOperation.SyncPullRequest> = GitHubOperation.SyncPullRequest.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ pullRequest: ref }) {\n const { pullRequest, db } = yield* resolvePullRequest(ref);\n const token = yield* githubToken().pipe(Effect.provide(Database.layer(db)));\n // With the anonymous fallback, so a public pull request still refreshes behind a revoked token.\n const pull = yield* fetchPullRequestWithFallback(pullRequest, token);\n const changes = pullRequestChanges(pullRequest, pull);\n const updated = Object.keys(changes);\n if (updated.length > 0) {\n Obj.update(pullRequest, (pullRequest) => {\n Object.assign(pullRequest, changes);\n });\n }\n\n return { updated };\n }, Effect.provide(FetchHttpClient.layer)),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;AAgBA,IAAM,UAAyE,gBAAgB,gBAAgB,KAC7G,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,aAAa,OAAO;CACzC,MAAM,EAAE,aAAa,OAAO,OAAO,mBAAmB,GAAG;CACzD,MAAM,QAAQ,OAAO,YAAY,CAAC,CAAC,KAAK,OAAO,QAAQ,SAAS,MAAM,EAAE,CAAC,CAAC;CAE1E,MAAM,OAAO,OAAO,6BAA6B,aAAa,KAAK;CACnE,MAAM,UAAU,mBAAmB,aAAa,IAAI;CACpD,MAAM,UAAU,OAAO,KAAK,OAAO;CACnC,IAAI,QAAQ,SAAS,GACnB,IAAI,OAAO,cAAc,gBAAgB;EACvC,OAAO,OAAO,aAAa,OAAO;CACpC,CAAC;CAGH,OAAO,EAAE,QAAQ;AACnB,GAAG,OAAO,QAAQ,gBAAgB,KAAK,CAAC,CAC1C,CACF"}