@ghx-dev/core 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (480) hide show
  1. package/README.md +14 -2
  2. package/dist/agent.d.ts +32 -7
  3. package/dist/agent.js +29 -12
  4. package/dist/agent.js.map +1 -1
  5. package/dist/{chunk-JH6GM6XU.js → chunk-OL4ARD3R.js} +116 -7
  6. package/dist/chunk-OL4ARD3R.js.map +1 -0
  7. package/dist/chunk-PJ2JKKQE.js +4148 -0
  8. package/dist/chunk-PJ2JKKQE.js.map +1 -0
  9. package/dist/{chunk-4PLVKNCF.js → chunk-SCIJMW5P.js} +14 -4
  10. package/dist/chunk-SCIJMW5P.js.map +1 -0
  11. package/dist/cli/assets/skills/ghx/SKILL.md +57 -0
  12. package/dist/cli/index.js +373 -41
  13. package/dist/cli/index.js.map +1 -1
  14. package/dist/{core/contracts/envelope.d.ts → envelope-BpF6MNCv.d.ts} +15 -3
  15. package/dist/index.d.ts +470 -22
  16. package/dist/index.js +6 -30
  17. package/package.json +11 -9
  18. package/dist/agent-interface/prompt/main-skill.d.ts +0 -3
  19. package/dist/agent-interface/prompt/main-skill.js +0 -7
  20. package/dist/agent-interface/prompt/main-skill.js.map +0 -1
  21. package/dist/agent-interface/tools/execute-tool.d.ts +0 -16
  22. package/dist/agent-interface/tools/execute-tool.js +0 -7
  23. package/dist/agent-interface/tools/execute-tool.js.map +0 -1
  24. package/dist/agent-interface/tools/explain-tool.d.ts +0 -11
  25. package/dist/agent-interface/tools/explain-tool.js +0 -9
  26. package/dist/agent-interface/tools/explain-tool.js.map +0 -1
  27. package/dist/agent-interface/tools/list-capabilities-tool.d.ts +0 -7
  28. package/dist/agent-interface/tools/list-capabilities-tool.js +0 -9
  29. package/dist/agent-interface/tools/list-capabilities-tool.js.map +0 -1
  30. package/dist/chunk-22WWCK6A.js +0 -92
  31. package/dist/chunk-22WWCK6A.js.map +0 -1
  32. package/dist/chunk-2W4L5YCC.js +0 -116
  33. package/dist/chunk-2W4L5YCC.js.map +0 -1
  34. package/dist/chunk-3MRJX72M.js +0 -209
  35. package/dist/chunk-3MRJX72M.js.map +0 -1
  36. package/dist/chunk-4PLVKNCF.js.map +0 -1
  37. package/dist/chunk-573MDG3I.js +0 -18
  38. package/dist/chunk-573MDG3I.js.map +0 -1
  39. package/dist/chunk-5JRLVOF2.js +0 -50
  40. package/dist/chunk-5JRLVOF2.js.map +0 -1
  41. package/dist/chunk-B6RLMKS4.js +0 -41
  42. package/dist/chunk-B6RLMKS4.js.map +0 -1
  43. package/dist/chunk-D746VR3B.js +0 -38
  44. package/dist/chunk-D746VR3B.js.map +0 -1
  45. package/dist/chunk-DJIEG6K7.js +0 -20
  46. package/dist/chunk-DJIEG6K7.js.map +0 -1
  47. package/dist/chunk-DLKIQBK6.js +0 -106
  48. package/dist/chunk-DLKIQBK6.js.map +0 -1
  49. package/dist/chunk-EBRDO4Y6.js +0 -31
  50. package/dist/chunk-EBRDO4Y6.js.map +0 -1
  51. package/dist/chunk-FXN6IIT5.js +0 -14
  52. package/dist/chunk-FXN6IIT5.js.map +0 -1
  53. package/dist/chunk-GMTG7X2L.js +0 -16
  54. package/dist/chunk-GMTG7X2L.js.map +0 -1
  55. package/dist/chunk-HQ2VRCH7.js +0 -42
  56. package/dist/chunk-HQ2VRCH7.js.map +0 -1
  57. package/dist/chunk-JH6GM6XU.js.map +0 -1
  58. package/dist/chunk-JLDU462R.js +0 -1352
  59. package/dist/chunk-JLDU462R.js.map +0 -1
  60. package/dist/chunk-MGNGSGMF.js +0 -203
  61. package/dist/chunk-MGNGSGMF.js.map +0 -1
  62. package/dist/chunk-NFF5VF4U.js +0 -28
  63. package/dist/chunk-NFF5VF4U.js.map +0 -1
  64. package/dist/chunk-QEAMC4IJ.js +0 -34
  65. package/dist/chunk-QEAMC4IJ.js.map +0 -1
  66. package/dist/chunk-QZZC53HF.js +0 -38
  67. package/dist/chunk-QZZC53HF.js.map +0 -1
  68. package/dist/chunk-RUQXGZ35.js +0 -34
  69. package/dist/chunk-RUQXGZ35.js.map +0 -1
  70. package/dist/chunk-SA2D4A5U.js +0 -1496
  71. package/dist/chunk-SA2D4A5U.js.map +0 -1
  72. package/dist/chunk-SD7U4BNA.js +0 -174
  73. package/dist/chunk-SD7U4BNA.js.map +0 -1
  74. package/dist/chunk-SJR2SACI.js +0 -30
  75. package/dist/chunk-SJR2SACI.js.map +0 -1
  76. package/dist/chunk-TCLMLVUQ.js +0 -38
  77. package/dist/chunk-TCLMLVUQ.js.map +0 -1
  78. package/dist/chunk-TDTKOJKN.js +0 -52
  79. package/dist/chunk-TDTKOJKN.js.map +0 -1
  80. package/dist/chunk-UGWIZ3RI.js +0 -7
  81. package/dist/chunk-UGWIZ3RI.js.map +0 -1
  82. package/dist/chunk-UOJWOHRM.js +0 -16
  83. package/dist/chunk-UOJWOHRM.js.map +0 -1
  84. package/dist/chunk-VD5NXQP7.js +0 -42
  85. package/dist/chunk-VD5NXQP7.js.map +0 -1
  86. package/dist/chunk-W2TKG2UL.js +0 -37
  87. package/dist/chunk-W2TKG2UL.js.map +0 -1
  88. package/dist/chunk-W6ROKCY5.js +0 -28
  89. package/dist/chunk-W6ROKCY5.js.map +0 -1
  90. package/dist/chunk-XNMM64WU.js +0 -221
  91. package/dist/chunk-XNMM64WU.js.map +0 -1
  92. package/dist/cli/commands/capabilities-explain.d.ts +0 -3
  93. package/dist/cli/commands/capabilities-explain.js +0 -10
  94. package/dist/cli/commands/capabilities-explain.js.map +0 -1
  95. package/dist/cli/commands/capabilities-list.d.ts +0 -3
  96. package/dist/cli/commands/capabilities-list.js +0 -10
  97. package/dist/cli/commands/capabilities-list.js.map +0 -1
  98. package/dist/cli/commands/doctor.d.ts +0 -3
  99. package/dist/cli/commands/doctor.js +0 -7
  100. package/dist/cli/commands/doctor.js.map +0 -1
  101. package/dist/cli/commands/routes.d.ts +0 -3
  102. package/dist/cli/commands/routes.js +0 -7
  103. package/dist/cli/commands/routes.js.map +0 -1
  104. package/dist/cli/commands/run.d.ts +0 -3
  105. package/dist/cli/commands/run.js +0 -31
  106. package/dist/cli/commands/run.js.map +0 -1
  107. package/dist/cli/commands/setup.d.ts +0 -3
  108. package/dist/cli/commands/setup.js +0 -7
  109. package/dist/cli/commands/setup.js.map +0 -1
  110. package/dist/cli/formatters/json.d.ts +0 -3
  111. package/dist/cli/formatters/json.js +0 -8
  112. package/dist/cli/formatters/json.js.map +0 -1
  113. package/dist/cli/formatters/table.d.ts +0 -3
  114. package/dist/cli/formatters/table.js +0 -8
  115. package/dist/cli/formatters/table.js.map +0 -1
  116. package/dist/core/contracts/envelope.js +0 -1
  117. package/dist/core/contracts/envelope.js.map +0 -1
  118. package/dist/core/contracts/task.d.ts +0 -7
  119. package/dist/core/contracts/task.js +0 -1
  120. package/dist/core/contracts/task.js.map +0 -1
  121. package/dist/core/contracts/tasks/check_run.annotations.list.d.ts +0 -5
  122. package/dist/core/contracts/tasks/check_run.annotations.list.js +0 -8
  123. package/dist/core/contracts/tasks/check_run.annotations.list.js.map +0 -1
  124. package/dist/core/contracts/tasks/issue.assignees.update.d.ts +0 -5
  125. package/dist/core/contracts/tasks/issue.assignees.update.js +0 -8
  126. package/dist/core/contracts/tasks/issue.assignees.update.js.map +0 -1
  127. package/dist/core/contracts/tasks/issue.blocked_by.add.d.ts +0 -5
  128. package/dist/core/contracts/tasks/issue.blocked_by.add.js +0 -8
  129. package/dist/core/contracts/tasks/issue.blocked_by.add.js.map +0 -1
  130. package/dist/core/contracts/tasks/issue.blocked_by.remove.d.ts +0 -5
  131. package/dist/core/contracts/tasks/issue.blocked_by.remove.js +0 -8
  132. package/dist/core/contracts/tasks/issue.blocked_by.remove.js.map +0 -1
  133. package/dist/core/contracts/tasks/issue.close.d.ts +0 -5
  134. package/dist/core/contracts/tasks/issue.close.js +0 -8
  135. package/dist/core/contracts/tasks/issue.close.js.map +0 -1
  136. package/dist/core/contracts/tasks/issue.comments.create.d.ts +0 -5
  137. package/dist/core/contracts/tasks/issue.comments.create.js +0 -8
  138. package/dist/core/contracts/tasks/issue.comments.create.js.map +0 -1
  139. package/dist/core/contracts/tasks/issue.comments.list.d.ts +0 -5
  140. package/dist/core/contracts/tasks/issue.comments.list.js +0 -8
  141. package/dist/core/contracts/tasks/issue.comments.list.js.map +0 -1
  142. package/dist/core/contracts/tasks/issue.create.d.ts +0 -5
  143. package/dist/core/contracts/tasks/issue.create.js +0 -8
  144. package/dist/core/contracts/tasks/issue.create.js.map +0 -1
  145. package/dist/core/contracts/tasks/issue.delete.d.ts +0 -5
  146. package/dist/core/contracts/tasks/issue.delete.js +0 -8
  147. package/dist/core/contracts/tasks/issue.delete.js.map +0 -1
  148. package/dist/core/contracts/tasks/issue.labels.update.d.ts +0 -5
  149. package/dist/core/contracts/tasks/issue.labels.update.js +0 -8
  150. package/dist/core/contracts/tasks/issue.labels.update.js.map +0 -1
  151. package/dist/core/contracts/tasks/issue.linked_prs.list.d.ts +0 -5
  152. package/dist/core/contracts/tasks/issue.linked_prs.list.js +0 -8
  153. package/dist/core/contracts/tasks/issue.linked_prs.list.js.map +0 -1
  154. package/dist/core/contracts/tasks/issue.list.d.ts +0 -5
  155. package/dist/core/contracts/tasks/issue.list.js +0 -8
  156. package/dist/core/contracts/tasks/issue.list.js.map +0 -1
  157. package/dist/core/contracts/tasks/issue.milestone.set.d.ts +0 -5
  158. package/dist/core/contracts/tasks/issue.milestone.set.js +0 -8
  159. package/dist/core/contracts/tasks/issue.milestone.set.js.map +0 -1
  160. package/dist/core/contracts/tasks/issue.parent.remove.d.ts +0 -5
  161. package/dist/core/contracts/tasks/issue.parent.remove.js +0 -8
  162. package/dist/core/contracts/tasks/issue.parent.remove.js.map +0 -1
  163. package/dist/core/contracts/tasks/issue.parent.set.d.ts +0 -5
  164. package/dist/core/contracts/tasks/issue.parent.set.js +0 -8
  165. package/dist/core/contracts/tasks/issue.parent.set.js.map +0 -1
  166. package/dist/core/contracts/tasks/issue.relations.get.d.ts +0 -5
  167. package/dist/core/contracts/tasks/issue.relations.get.js +0 -8
  168. package/dist/core/contracts/tasks/issue.relations.get.js.map +0 -1
  169. package/dist/core/contracts/tasks/issue.reopen.d.ts +0 -5
  170. package/dist/core/contracts/tasks/issue.reopen.js +0 -8
  171. package/dist/core/contracts/tasks/issue.reopen.js.map +0 -1
  172. package/dist/core/contracts/tasks/issue.update.d.ts +0 -5
  173. package/dist/core/contracts/tasks/issue.update.js +0 -8
  174. package/dist/core/contracts/tasks/issue.update.js.map +0 -1
  175. package/dist/core/contracts/tasks/issue.view.d.ts +0 -5
  176. package/dist/core/contracts/tasks/issue.view.js +0 -8
  177. package/dist/core/contracts/tasks/issue.view.js.map +0 -1
  178. package/dist/core/contracts/tasks/pr.assignees.update.d.ts +0 -5
  179. package/dist/core/contracts/tasks/pr.assignees.update.js +0 -8
  180. package/dist/core/contracts/tasks/pr.assignees.update.js.map +0 -1
  181. package/dist/core/contracts/tasks/pr.branch.update.d.ts +0 -5
  182. package/dist/core/contracts/tasks/pr.branch.update.js +0 -8
  183. package/dist/core/contracts/tasks/pr.branch.update.js.map +0 -1
  184. package/dist/core/contracts/tasks/pr.checks.get_failed.d.ts +0 -5
  185. package/dist/core/contracts/tasks/pr.checks.get_failed.js +0 -8
  186. package/dist/core/contracts/tasks/pr.checks.get_failed.js.map +0 -1
  187. package/dist/core/contracts/tasks/pr.checks.rerun_all.d.ts +0 -5
  188. package/dist/core/contracts/tasks/pr.checks.rerun_all.js +0 -8
  189. package/dist/core/contracts/tasks/pr.checks.rerun_all.js.map +0 -1
  190. package/dist/core/contracts/tasks/pr.checks.rerun_failed.d.ts +0 -5
  191. package/dist/core/contracts/tasks/pr.checks.rerun_failed.js +0 -8
  192. package/dist/core/contracts/tasks/pr.checks.rerun_failed.js.map +0 -1
  193. package/dist/core/contracts/tasks/pr.comment.reply.d.ts +0 -5
  194. package/dist/core/contracts/tasks/pr.comment.reply.js +0 -8
  195. package/dist/core/contracts/tasks/pr.comment.reply.js.map +0 -1
  196. package/dist/core/contracts/tasks/pr.comment.resolve.d.ts +0 -5
  197. package/dist/core/contracts/tasks/pr.comment.resolve.js +0 -8
  198. package/dist/core/contracts/tasks/pr.comment.resolve.js.map +0 -1
  199. package/dist/core/contracts/tasks/pr.comment.unresolve.d.ts +0 -5
  200. package/dist/core/contracts/tasks/pr.comment.unresolve.js +0 -8
  201. package/dist/core/contracts/tasks/pr.comment.unresolve.js.map +0 -1
  202. package/dist/core/contracts/tasks/pr.comments.list.d.ts +0 -5
  203. package/dist/core/contracts/tasks/pr.comments.list.js +0 -8
  204. package/dist/core/contracts/tasks/pr.comments.list.js.map +0 -1
  205. package/dist/core/contracts/tasks/pr.diff.list_files.d.ts +0 -5
  206. package/dist/core/contracts/tasks/pr.diff.list_files.js +0 -8
  207. package/dist/core/contracts/tasks/pr.diff.list_files.js.map +0 -1
  208. package/dist/core/contracts/tasks/pr.list.d.ts +0 -5
  209. package/dist/core/contracts/tasks/pr.list.js +0 -8
  210. package/dist/core/contracts/tasks/pr.list.js.map +0 -1
  211. package/dist/core/contracts/tasks/pr.merge.execute.d.ts +0 -5
  212. package/dist/core/contracts/tasks/pr.merge.execute.js +0 -8
  213. package/dist/core/contracts/tasks/pr.merge.execute.js.map +0 -1
  214. package/dist/core/contracts/tasks/pr.mergeability.view.d.ts +0 -5
  215. package/dist/core/contracts/tasks/pr.mergeability.view.js +0 -8
  216. package/dist/core/contracts/tasks/pr.mergeability.view.js.map +0 -1
  217. package/dist/core/contracts/tasks/pr.ready_for_review.set.d.ts +0 -5
  218. package/dist/core/contracts/tasks/pr.ready_for_review.set.js +0 -8
  219. package/dist/core/contracts/tasks/pr.ready_for_review.set.js.map +0 -1
  220. package/dist/core/contracts/tasks/pr.review.submit_approve.d.ts +0 -5
  221. package/dist/core/contracts/tasks/pr.review.submit_approve.js +0 -8
  222. package/dist/core/contracts/tasks/pr.review.submit_approve.js.map +0 -1
  223. package/dist/core/contracts/tasks/pr.review.submit_comment.d.ts +0 -5
  224. package/dist/core/contracts/tasks/pr.review.submit_comment.js +0 -8
  225. package/dist/core/contracts/tasks/pr.review.submit_comment.js.map +0 -1
  226. package/dist/core/contracts/tasks/pr.review.submit_request_changes.d.ts +0 -5
  227. package/dist/core/contracts/tasks/pr.review.submit_request_changes.js +0 -8
  228. package/dist/core/contracts/tasks/pr.review.submit_request_changes.js.map +0 -1
  229. package/dist/core/contracts/tasks/pr.reviewers.request.d.ts +0 -5
  230. package/dist/core/contracts/tasks/pr.reviewers.request.js +0 -8
  231. package/dist/core/contracts/tasks/pr.reviewers.request.js.map +0 -1
  232. package/dist/core/contracts/tasks/pr.reviews.list.d.ts +0 -5
  233. package/dist/core/contracts/tasks/pr.reviews.list.js +0 -8
  234. package/dist/core/contracts/tasks/pr.reviews.list.js.map +0 -1
  235. package/dist/core/contracts/tasks/pr.status.checks.d.ts +0 -5
  236. package/dist/core/contracts/tasks/pr.status.checks.js +0 -8
  237. package/dist/core/contracts/tasks/pr.status.checks.js.map +0 -1
  238. package/dist/core/contracts/tasks/pr.view.d.ts +0 -5
  239. package/dist/core/contracts/tasks/pr.view.js +0 -8
  240. package/dist/core/contracts/tasks/pr.view.js.map +0 -1
  241. package/dist/core/contracts/tasks/project_v2.fields.list.d.ts +0 -5
  242. package/dist/core/contracts/tasks/project_v2.fields.list.js +0 -8
  243. package/dist/core/contracts/tasks/project_v2.fields.list.js.map +0 -1
  244. package/dist/core/contracts/tasks/project_v2.item.add_issue.d.ts +0 -5
  245. package/dist/core/contracts/tasks/project_v2.item.add_issue.js +0 -8
  246. package/dist/core/contracts/tasks/project_v2.item.add_issue.js.map +0 -1
  247. package/dist/core/contracts/tasks/project_v2.item.field.update.d.ts +0 -5
  248. package/dist/core/contracts/tasks/project_v2.item.field.update.js +0 -8
  249. package/dist/core/contracts/tasks/project_v2.item.field.update.js.map +0 -1
  250. package/dist/core/contracts/tasks/project_v2.items.list.d.ts +0 -5
  251. package/dist/core/contracts/tasks/project_v2.items.list.js +0 -8
  252. package/dist/core/contracts/tasks/project_v2.items.list.js.map +0 -1
  253. package/dist/core/contracts/tasks/project_v2.org.get.d.ts +0 -5
  254. package/dist/core/contracts/tasks/project_v2.org.get.js +0 -8
  255. package/dist/core/contracts/tasks/project_v2.org.get.js.map +0 -1
  256. package/dist/core/contracts/tasks/project_v2.user.get.d.ts +0 -5
  257. package/dist/core/contracts/tasks/project_v2.user.get.js +0 -8
  258. package/dist/core/contracts/tasks/project_v2.user.get.js.map +0 -1
  259. package/dist/core/contracts/tasks/release.create_draft.d.ts +0 -5
  260. package/dist/core/contracts/tasks/release.create_draft.js +0 -8
  261. package/dist/core/contracts/tasks/release.create_draft.js.map +0 -1
  262. package/dist/core/contracts/tasks/release.get.d.ts +0 -5
  263. package/dist/core/contracts/tasks/release.get.js +0 -8
  264. package/dist/core/contracts/tasks/release.get.js.map +0 -1
  265. package/dist/core/contracts/tasks/release.list.d.ts +0 -5
  266. package/dist/core/contracts/tasks/release.list.js +0 -8
  267. package/dist/core/contracts/tasks/release.list.js.map +0 -1
  268. package/dist/core/contracts/tasks/release.publish_draft.d.ts +0 -5
  269. package/dist/core/contracts/tasks/release.publish_draft.js +0 -8
  270. package/dist/core/contracts/tasks/release.publish_draft.js.map +0 -1
  271. package/dist/core/contracts/tasks/release.update.d.ts +0 -5
  272. package/dist/core/contracts/tasks/release.update.js +0 -8
  273. package/dist/core/contracts/tasks/release.update.js.map +0 -1
  274. package/dist/core/contracts/tasks/repo.issue_types.list.d.ts +0 -5
  275. package/dist/core/contracts/tasks/repo.issue_types.list.js +0 -8
  276. package/dist/core/contracts/tasks/repo.issue_types.list.js.map +0 -1
  277. package/dist/core/contracts/tasks/repo.labels.list.d.ts +0 -5
  278. package/dist/core/contracts/tasks/repo.labels.list.js +0 -8
  279. package/dist/core/contracts/tasks/repo.labels.list.js.map +0 -1
  280. package/dist/core/contracts/tasks/repo.view.d.ts +0 -5
  281. package/dist/core/contracts/tasks/repo.view.js +0 -8
  282. package/dist/core/contracts/tasks/repo.view.js.map +0 -1
  283. package/dist/core/contracts/tasks/workflow.get.d.ts +0 -5
  284. package/dist/core/contracts/tasks/workflow.get.js +0 -8
  285. package/dist/core/contracts/tasks/workflow.get.js.map +0 -1
  286. package/dist/core/contracts/tasks/workflow.list.d.ts +0 -5
  287. package/dist/core/contracts/tasks/workflow.list.js +0 -8
  288. package/dist/core/contracts/tasks/workflow.list.js.map +0 -1
  289. package/dist/core/contracts/tasks/workflow_dispatch.run.d.ts +0 -5
  290. package/dist/core/contracts/tasks/workflow_dispatch.run.js +0 -8
  291. package/dist/core/contracts/tasks/workflow_dispatch.run.js.map +0 -1
  292. package/dist/core/contracts/tasks/workflow_job.logs.analyze.d.ts +0 -5
  293. package/dist/core/contracts/tasks/workflow_job.logs.analyze.js +0 -8
  294. package/dist/core/contracts/tasks/workflow_job.logs.analyze.js.map +0 -1
  295. package/dist/core/contracts/tasks/workflow_job.logs.get.d.ts +0 -5
  296. package/dist/core/contracts/tasks/workflow_job.logs.get.js +0 -8
  297. package/dist/core/contracts/tasks/workflow_job.logs.get.js.map +0 -1
  298. package/dist/core/contracts/tasks/workflow_run.artifacts.list.d.ts +0 -5
  299. package/dist/core/contracts/tasks/workflow_run.artifacts.list.js +0 -8
  300. package/dist/core/contracts/tasks/workflow_run.artifacts.list.js.map +0 -1
  301. package/dist/core/contracts/tasks/workflow_run.cancel.d.ts +0 -5
  302. package/dist/core/contracts/tasks/workflow_run.cancel.js +0 -8
  303. package/dist/core/contracts/tasks/workflow_run.cancel.js.map +0 -1
  304. package/dist/core/contracts/tasks/workflow_run.get.d.ts +0 -5
  305. package/dist/core/contracts/tasks/workflow_run.get.js +0 -8
  306. package/dist/core/contracts/tasks/workflow_run.get.js.map +0 -1
  307. package/dist/core/contracts/tasks/workflow_run.jobs.list.d.ts +0 -5
  308. package/dist/core/contracts/tasks/workflow_run.jobs.list.js +0 -8
  309. package/dist/core/contracts/tasks/workflow_run.jobs.list.js.map +0 -1
  310. package/dist/core/contracts/tasks/workflow_run.rerun_all.d.ts +0 -5
  311. package/dist/core/contracts/tasks/workflow_run.rerun_all.js +0 -8
  312. package/dist/core/contracts/tasks/workflow_run.rerun_all.js.map +0 -1
  313. package/dist/core/contracts/tasks/workflow_run.rerun_failed.d.ts +0 -5
  314. package/dist/core/contracts/tasks/workflow_run.rerun_failed.js +0 -8
  315. package/dist/core/contracts/tasks/workflow_run.rerun_failed.js.map +0 -1
  316. package/dist/core/contracts/tasks/workflow_runs.list.d.ts +0 -5
  317. package/dist/core/contracts/tasks/workflow_runs.list.js +0 -8
  318. package/dist/core/contracts/tasks/workflow_runs.list.js.map +0 -1
  319. package/dist/core/errors/codes.d.ts +0 -13
  320. package/dist/core/errors/codes.js +0 -7
  321. package/dist/core/errors/codes.js.map +0 -1
  322. package/dist/core/errors/map-error.d.ts +0 -5
  323. package/dist/core/errors/map-error.js +0 -8
  324. package/dist/core/errors/map-error.js.map +0 -1
  325. package/dist/core/errors/retryability.d.ts +0 -3
  326. package/dist/core/errors/retryability.js +0 -8
  327. package/dist/core/errors/retryability.js.map +0 -1
  328. package/dist/core/execute/execute.d.ts +0 -28
  329. package/dist/core/execute/execute.js +0 -11
  330. package/dist/core/execute/execute.js.map +0 -1
  331. package/dist/core/execution/adapters/cli-adapter.d.ts +0 -22
  332. package/dist/core/execution/adapters/cli-adapter.js +0 -69
  333. package/dist/core/execution/adapters/cli-adapter.js.map +0 -1
  334. package/dist/core/execution/adapters/cli-capability-adapter.d.ts +0 -16
  335. package/dist/core/execution/adapters/cli-capability-adapter.js +0 -11
  336. package/dist/core/execution/adapters/cli-capability-adapter.js.map +0 -1
  337. package/dist/core/execution/adapters/graphql-adapter.d.ts +0 -25
  338. package/dist/core/execution/adapters/graphql-adapter.js +0 -44
  339. package/dist/core/execution/adapters/graphql-adapter.js.map +0 -1
  340. package/dist/core/execution/adapters/graphql-capability-adapter.d.ts +0 -20
  341. package/dist/core/execution/adapters/graphql-capability-adapter.js +0 -11
  342. package/dist/core/execution/adapters/graphql-capability-adapter.js.map +0 -1
  343. package/dist/core/execution/adapters/rest-adapter.d.ts +0 -3
  344. package/dist/core/execution/adapters/rest-adapter.js +0 -8
  345. package/dist/core/execution/adapters/rest-adapter.js.map +0 -1
  346. package/dist/core/execution/cli/safe-runner.d.ts +0 -12
  347. package/dist/core/execution/cli/safe-runner.js +0 -7
  348. package/dist/core/execution/cli/safe-runner.js.map +0 -1
  349. package/dist/core/execution/normalizer.d.ts +0 -13
  350. package/dist/core/execution/normalizer.js +0 -9
  351. package/dist/core/execution/normalizer.js.map +0 -1
  352. package/dist/core/execution/preflight.d.ts +0 -24
  353. package/dist/core/execution/preflight.js +0 -8
  354. package/dist/core/execution/preflight.js.map +0 -1
  355. package/dist/core/registry/index.d.ts +0 -15
  356. package/dist/core/registry/index.js +0 -12
  357. package/dist/core/registry/index.js.map +0 -1
  358. package/dist/core/registry/operation-card-schema.d.ts +0 -167
  359. package/dist/core/registry/operation-card-schema.js +0 -7
  360. package/dist/core/registry/operation-card-schema.js.map +0 -1
  361. package/dist/core/registry/schema-validator.d.ts +0 -16
  362. package/dist/core/registry/schema-validator.js +0 -9
  363. package/dist/core/registry/schema-validator.js.map +0 -1
  364. package/dist/core/registry/types.d.ts +0 -51
  365. package/dist/core/registry/types.js +0 -1
  366. package/dist/core/registry/types.js.map +0 -1
  367. package/dist/core/routing/capability-registry.d.ts +0 -8
  368. package/dist/core/routing/capability-registry.js +0 -15
  369. package/dist/core/routing/capability-registry.js.map +0 -1
  370. package/dist/core/routing/engine.d.ts +0 -32
  371. package/dist/core/routing/engine.js +0 -23
  372. package/dist/core/routing/engine.js.map +0 -1
  373. package/dist/core/routing/policy.d.ts +0 -3
  374. package/dist/core/routing/policy.js +0 -7
  375. package/dist/core/routing/policy.js.map +0 -1
  376. package/dist/core/routing/reason-codes.d.ts +0 -4
  377. package/dist/core/routing/reason-codes.js +0 -15
  378. package/dist/core/routing/reason-codes.js.map +0 -1
  379. package/dist/core/telemetry/logger.d.ts +0 -8
  380. package/dist/core/telemetry/logger.js +0 -9
  381. package/dist/core/telemetry/logger.js.map +0 -1
  382. package/dist/core/telemetry/metrics.d.ts +0 -7
  383. package/dist/core/telemetry/metrics.js +0 -1
  384. package/dist/core/telemetry/metrics.js.map +0 -1
  385. package/dist/gql/client.d.ts +0 -314
  386. package/dist/gql/client.js +0 -19
  387. package/dist/gql/client.js.map +0 -1
  388. package/dist/gql/generated/common-types.d.ts +0 -36
  389. package/dist/gql/generated/common-types.js +0 -1
  390. package/dist/gql/generated/common-types.js.map +0 -1
  391. package/dist/gql/operations/issue-assignees-update.generated.d.ts +0 -33
  392. package/dist/gql/operations/issue-assignees-update.generated.js +0 -28
  393. package/dist/gql/operations/issue-assignees-update.generated.js.map +0 -1
  394. package/dist/gql/operations/issue-blocked-by-add.generated.d.ts +0 -30
  395. package/dist/gql/operations/issue-blocked-by-add.generated.js +0 -26
  396. package/dist/gql/operations/issue-blocked-by-add.generated.js.map +0 -1
  397. package/dist/gql/operations/issue-blocked-by-remove.generated.d.ts +0 -30
  398. package/dist/gql/operations/issue-blocked-by-remove.generated.js +0 -26
  399. package/dist/gql/operations/issue-blocked-by-remove.generated.js.map +0 -1
  400. package/dist/gql/operations/issue-close.generated.d.ts +0 -27
  401. package/dist/gql/operations/issue-close.generated.js +0 -25
  402. package/dist/gql/operations/issue-close.generated.js.map +0 -1
  403. package/dist/gql/operations/issue-comment-create.generated.d.ts +0 -31
  404. package/dist/gql/operations/issue-comment-create.generated.js +0 -27
  405. package/dist/gql/operations/issue-comment-create.generated.js.map +0 -1
  406. package/dist/gql/operations/issue-comments-list.generated.d.ts +0 -59
  407. package/dist/gql/operations/issue-comments-list.generated.js +0 -9
  408. package/dist/gql/operations/issue-comments-list.generated.js.map +0 -1
  409. package/dist/gql/operations/issue-create.generated.d.ts +0 -31
  410. package/dist/gql/operations/issue-create.generated.js +0 -27
  411. package/dist/gql/operations/issue-create.generated.js.map +0 -1
  412. package/dist/gql/operations/issue-delete.generated.d.ts +0 -22
  413. package/dist/gql/operations/issue-delete.generated.js +0 -21
  414. package/dist/gql/operations/issue-delete.generated.js.map +0 -1
  415. package/dist/gql/operations/issue-labels-update.generated.d.ts +0 -33
  416. package/dist/gql/operations/issue-labels-update.generated.js +0 -28
  417. package/dist/gql/operations/issue-labels-update.generated.js.map +0 -1
  418. package/dist/gql/operations/issue-linked-prs-list.generated.d.ts +0 -132
  419. package/dist/gql/operations/issue-linked-prs-list.generated.js +0 -39
  420. package/dist/gql/operations/issue-linked-prs-list.generated.js.map +0 -1
  421. package/dist/gql/operations/issue-list.generated.d.ts +0 -40
  422. package/dist/gql/operations/issue-list.generated.js +0 -9
  423. package/dist/gql/operations/issue-list.generated.js.map +0 -1
  424. package/dist/gql/operations/issue-milestone-set.generated.d.ts +0 -30
  425. package/dist/gql/operations/issue-milestone-set.generated.js +0 -26
  426. package/dist/gql/operations/issue-milestone-set.generated.js.map +0 -1
  427. package/dist/gql/operations/issue-parent-remove.generated.d.ts +0 -30
  428. package/dist/gql/operations/issue-parent-remove.generated.js +0 -26
  429. package/dist/gql/operations/issue-parent-remove.generated.js.map +0 -1
  430. package/dist/gql/operations/issue-parent-set.generated.d.ts +0 -30
  431. package/dist/gql/operations/issue-parent-set.generated.js +0 -26
  432. package/dist/gql/operations/issue-parent-set.generated.js.map +0 -1
  433. package/dist/gql/operations/issue-relations-get.generated.d.ts +0 -49
  434. package/dist/gql/operations/issue-relations-get.generated.js +0 -40
  435. package/dist/gql/operations/issue-relations-get.generated.js.map +0 -1
  436. package/dist/gql/operations/issue-reopen.generated.d.ts +0 -27
  437. package/dist/gql/operations/issue-reopen.generated.js +0 -25
  438. package/dist/gql/operations/issue-reopen.generated.js.map +0 -1
  439. package/dist/gql/operations/issue-update.generated.d.ts +0 -31
  440. package/dist/gql/operations/issue-update.generated.js +0 -27
  441. package/dist/gql/operations/issue-update.generated.js.map +0 -1
  442. package/dist/gql/operations/issue-view.generated.d.ts +0 -31
  443. package/dist/gql/operations/issue-view.generated.js +0 -9
  444. package/dist/gql/operations/issue-view.generated.js.map +0 -1
  445. package/dist/gql/operations/pr-comment-reply.generated.d.ts +0 -26
  446. package/dist/gql/operations/pr-comment-reply.generated.js +0 -25
  447. package/dist/gql/operations/pr-comment-reply.generated.js.map +0 -1
  448. package/dist/gql/operations/pr-comment-resolve.generated.d.ts +0 -26
  449. package/dist/gql/operations/pr-comment-resolve.generated.js +0 -24
  450. package/dist/gql/operations/pr-comment-resolve.generated.js.map +0 -1
  451. package/dist/gql/operations/pr-comment-unresolve.generated.d.ts +0 -26
  452. package/dist/gql/operations/pr-comment-unresolve.generated.js +0 -24
  453. package/dist/gql/operations/pr-comment-unresolve.generated.js.map +0 -1
  454. package/dist/gql/operations/pr-comments-list.generated.d.ts +0 -84
  455. package/dist/gql/operations/pr-comments-list.generated.js +0 -58
  456. package/dist/gql/operations/pr-comments-list.generated.js.map +0 -1
  457. package/dist/gql/operations/pr-diff-list-files.generated.d.ts +0 -42
  458. package/dist/gql/operations/pr-diff-list-files.generated.js +0 -9
  459. package/dist/gql/operations/pr-diff-list-files.generated.js.map +0 -1
  460. package/dist/gql/operations/pr-list.generated.d.ts +0 -40
  461. package/dist/gql/operations/pr-list.generated.js +0 -9
  462. package/dist/gql/operations/pr-list.generated.js.map +0 -1
  463. package/dist/gql/operations/pr-reviews-list.generated.d.ts +0 -64
  464. package/dist/gql/operations/pr-reviews-list.generated.js +0 -9
  465. package/dist/gql/operations/pr-reviews-list.generated.js.map +0 -1
  466. package/dist/gql/operations/pr-view.generated.d.ts +0 -31
  467. package/dist/gql/operations/pr-view.generated.js +0 -9
  468. package/dist/gql/operations/pr-view.generated.js.map +0 -1
  469. package/dist/gql/operations/repo-view.generated.d.ts +0 -33
  470. package/dist/gql/operations/repo-view.generated.js +0 -9
  471. package/dist/gql/operations/repo-view.generated.js.map +0 -1
  472. package/dist/shared/constants.d.ts +0 -3
  473. package/dist/shared/constants.js +0 -6
  474. package/dist/shared/constants.js.map +0 -1
  475. package/dist/shared/types.d.ts +0 -3
  476. package/dist/shared/types.js +0 -1
  477. package/dist/shared/types.js.map +0 -1
  478. package/dist/shared/utils.d.ts +0 -3
  479. package/dist/shared/utils.js +0 -8
  480. package/dist/shared/utils.js.map +0 -1
@@ -1,1352 +0,0 @@
1
- import {
2
- getSdk as getSdk8
3
- } from "./chunk-EBRDO4Y6.js";
4
- import {
5
- getSdk as getSdk4
6
- } from "./chunk-RUQXGZ35.js";
7
- import {
8
- getSdk as getSdk6
9
- } from "./chunk-TCLMLVUQ.js";
10
- import {
11
- getSdk as getSdk5
12
- } from "./chunk-VD5NXQP7.js";
13
- import {
14
- getSdk as getSdk7
15
- } from "./chunk-NFF5VF4U.js";
16
- import {
17
- getSdk as getSdk2
18
- } from "./chunk-D746VR3B.js";
19
- import {
20
- getSdk as getSdk3
21
- } from "./chunk-W6ROKCY5.js";
22
- import {
23
- getSdk
24
- } from "./chunk-QZZC53HF.js";
25
-
26
- // src/gql/client.ts
27
- import { print } from "graphql";
28
- function assertRepoInput(input) {
29
- if (input.owner.trim().length === 0 || input.name.trim().length === 0) {
30
- throw new Error("Repository owner and name are required");
31
- }
32
- }
33
- function assertIssueInput(input) {
34
- if (input.owner.trim().length === 0 || input.name.trim().length === 0) {
35
- throw new Error("Repository owner and name are required");
36
- }
37
- if (!Number.isInteger(input.issueNumber) || input.issueNumber <= 0) {
38
- throw new Error("Issue number must be a positive integer");
39
- }
40
- }
41
- function assertIssueListInput(input) {
42
- if (input.owner.trim().length === 0 || input.name.trim().length === 0) {
43
- throw new Error("Repository owner and name are required");
44
- }
45
- if (!Number.isInteger(input.first) || input.first <= 0) {
46
- throw new Error("List page size must be a positive integer");
47
- }
48
- }
49
- function assertIssueCommentsListInput(input) {
50
- if (input.owner.trim().length === 0 || input.name.trim().length === 0) {
51
- throw new Error("Repository owner and name are required");
52
- }
53
- if (!Number.isInteger(input.issueNumber) || input.issueNumber <= 0) {
54
- throw new Error("Issue number must be a positive integer");
55
- }
56
- if (!Number.isInteger(input.first) || input.first <= 0) {
57
- throw new Error("List page size must be a positive integer");
58
- }
59
- if (input.after !== void 0 && input.after !== null && typeof input.after !== "string") {
60
- throw new Error("After cursor must be a string");
61
- }
62
- }
63
- function assertNonEmptyString(value, fieldName) {
64
- if (typeof value !== "string" || value.trim().length === 0) {
65
- throw new Error(`${fieldName} is required`);
66
- }
67
- return value;
68
- }
69
- function assertOptionalString(value, fieldName) {
70
- if (value === void 0) {
71
- return void 0;
72
- }
73
- if (typeof value !== "string") {
74
- throw new Error(`${fieldName} must be a string`);
75
- }
76
- return value;
77
- }
78
- function assertStringArray(value, fieldName) {
79
- if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string" || entry.trim().length === 0)) {
80
- throw new Error(`${fieldName} must be an array of non-empty strings`);
81
- }
82
- return value;
83
- }
84
- function assertIssueCreateInput(input) {
85
- assertRepoInput({ owner: input.owner, name: input.name });
86
- assertNonEmptyString(input.title, "Issue title");
87
- assertOptionalString(input.body, "Issue body");
88
- }
89
- function assertIssueUpdateInput(input) {
90
- assertNonEmptyString(input.issueId, "Issue id");
91
- if (input.title === void 0 && input.body === void 0) {
92
- throw new Error("Issue update requires at least one field");
93
- }
94
- if (input.title !== void 0) {
95
- assertOptionalString(input.title, "Issue title");
96
- }
97
- if (input.body !== void 0) {
98
- assertOptionalString(input.body, "Issue body");
99
- }
100
- }
101
- function assertIssueMutationInput(input) {
102
- assertNonEmptyString(input.issueId, "Issue id");
103
- }
104
- function assertIssueLabelsUpdateInput(input) {
105
- assertIssueMutationInput({ issueId: input.issueId });
106
- assertStringArray(input.labels, "Labels");
107
- }
108
- function assertIssueAssigneesUpdateInput(input) {
109
- assertIssueMutationInput({ issueId: input.issueId });
110
- assertStringArray(input.assignees, "Assignees");
111
- }
112
- function assertIssueMilestoneSetInput(input) {
113
- assertIssueMutationInput({ issueId: input.issueId });
114
- if (input.milestoneNumber !== null && (!Number.isInteger(input.milestoneNumber) || input.milestoneNumber <= 0)) {
115
- throw new Error("Milestone number must be a positive integer or null");
116
- }
117
- }
118
- function assertIssueCommentCreateInput(input) {
119
- assertIssueMutationInput({ issueId: input.issueId });
120
- assertNonEmptyString(input.body, "Issue comment body");
121
- }
122
- function assertIssueLinkedPrsListInput(input) {
123
- assertIssueInput(input);
124
- }
125
- function assertIssueRelationsGetInput(input) {
126
- assertIssueInput(input);
127
- }
128
- function assertIssueParentSetInput(input) {
129
- assertIssueMutationInput({ issueId: input.issueId });
130
- assertNonEmptyString(input.parentIssueId, "Parent issue id");
131
- }
132
- function assertIssueParentRemoveInput(input) {
133
- assertIssueMutationInput({ issueId: input.issueId });
134
- }
135
- function assertIssueBlockedByInput(input) {
136
- assertIssueMutationInput({ issueId: input.issueId });
137
- assertNonEmptyString(input.blockedByIssueId, "Blocked-by issue id");
138
- }
139
- function assertPrInput(input) {
140
- if (input.owner.trim().length === 0 || input.name.trim().length === 0) {
141
- throw new Error("Repository owner and name are required");
142
- }
143
- if (!Number.isInteger(input.prNumber) || input.prNumber <= 0) {
144
- throw new Error("PR number must be a positive integer");
145
- }
146
- }
147
- function assertPrListInput(input) {
148
- if (input.owner.trim().length === 0 || input.name.trim().length === 0) {
149
- throw new Error("Repository owner and name are required");
150
- }
151
- if (!Number.isInteger(input.first) || input.first <= 0) {
152
- throw new Error("List page size must be a positive integer");
153
- }
154
- }
155
- function assertPrReviewsListInput(input) {
156
- if (typeof input.owner !== "string" || typeof input.name !== "string" || input.owner.trim().length === 0 || input.name.trim().length === 0) {
157
- throw new Error("Repository owner and name are required");
158
- }
159
- if (!Number.isInteger(input.prNumber) || input.prNumber <= 0) {
160
- throw new Error("PR number must be a positive integer");
161
- }
162
- if (!Number.isInteger(input.first) || input.first <= 0) {
163
- throw new Error("List page size must be a positive integer");
164
- }
165
- }
166
- function assertPrDiffListFilesInput(input) {
167
- if (typeof input.owner !== "string" || typeof input.name !== "string" || input.owner.trim().length === 0 || input.name.trim().length === 0) {
168
- throw new Error("Repository owner and name are required");
169
- }
170
- if (!Number.isInteger(input.prNumber) || input.prNumber <= 0) {
171
- throw new Error("PR number must be a positive integer");
172
- }
173
- if (!Number.isInteger(input.first) || input.first <= 0) {
174
- throw new Error("List page size must be a positive integer");
175
- }
176
- }
177
- function assertPrCommentsListInput(input) {
178
- if (typeof input.owner !== "string" || typeof input.name !== "string" || input.owner.trim().length === 0 || input.name.trim().length === 0) {
179
- throw new Error("Repository owner and name are required");
180
- }
181
- if (!Number.isInteger(input.prNumber) || input.prNumber <= 0) {
182
- throw new Error("PR number must be a positive integer");
183
- }
184
- if (!Number.isInteger(input.first) || input.first <= 0) {
185
- throw new Error("List page size must be a positive integer");
186
- }
187
- if (input.unresolvedOnly !== void 0 && typeof input.unresolvedOnly !== "boolean") {
188
- throw new Error("unresolvedOnly must be a boolean");
189
- }
190
- if (input.includeOutdated !== void 0 && typeof input.includeOutdated !== "boolean") {
191
- throw new Error("includeOutdated must be a boolean");
192
- }
193
- if (input.after !== void 0 && input.after !== null && typeof input.after !== "string") {
194
- throw new Error("After cursor must be a string");
195
- }
196
- }
197
- var PR_COMMENTS_LIST_QUERY = `
198
- query PrCommentsList($owner: String!, $name: String!, $prNumber: Int!, $first: Int!, $after: String) {
199
- repository(owner: $owner, name: $name) {
200
- pullRequest(number: $prNumber) {
201
- reviewThreads(first: $first, after: $after) {
202
- edges {
203
- cursor
204
- node {
205
- id
206
- path
207
- line
208
- startLine
209
- diffSide
210
- subjectType
211
- isResolved
212
- isOutdated
213
- viewerCanReply
214
- viewerCanResolve
215
- viewerCanUnresolve
216
- resolvedBy {
217
- login
218
- }
219
- comments(first: 20) {
220
- nodes {
221
- id
222
- body
223
- createdAt
224
- url
225
- author {
226
- login
227
- }
228
- }
229
- }
230
- }
231
- }
232
- pageInfo {
233
- endCursor
234
- hasNextPage
235
- }
236
- }
237
- }
238
- }
239
- }
240
- `;
241
- var PR_COMMENT_REPLY_MUTATION = `
242
- mutation PrCommentReply($threadId: ID!, $body: String!) {
243
- addPullRequestReviewThreadReply(input: { pullRequestReviewThreadId: $threadId, body: $body }) {
244
- comment {
245
- id
246
- }
247
- }
248
- }
249
- `;
250
- var PR_COMMENT_RESOLVE_MUTATION = `
251
- mutation PrCommentResolve($threadId: ID!) {
252
- resolveReviewThread(input: { threadId: $threadId }) {
253
- thread {
254
- id
255
- isResolved
256
- }
257
- }
258
- }
259
- `;
260
- var PR_COMMENT_UNRESOLVE_MUTATION = `
261
- mutation PrCommentUnresolve($threadId: ID!) {
262
- unresolveReviewThread(input: { threadId: $threadId }) {
263
- thread {
264
- id
265
- isResolved
266
- }
267
- }
268
- }
269
- `;
270
- var REVIEW_THREAD_STATE_QUERY = `
271
- query ReviewThreadState($threadId: ID!) {
272
- node(id: $threadId) {
273
- ... on PullRequestReviewThread {
274
- id
275
- isResolved
276
- }
277
- }
278
- }
279
- `;
280
- var ISSUE_CREATE_REPOSITORY_ID_QUERY = `
281
- query IssueCreateRepositoryId($owner: String!, $name: String!) {
282
- repository(owner: $owner, name: $name) {
283
- id
284
- }
285
- }
286
- `;
287
- var ISSUE_CREATE_MUTATION = `
288
- mutation IssueCreate($repositoryId: ID!, $title: String!, $body: String) {
289
- createIssue(input: { repositoryId: $repositoryId, title: $title, body: $body }) {
290
- issue {
291
- id
292
- number
293
- title
294
- state
295
- url
296
- }
297
- }
298
- }
299
- `;
300
- var ISSUE_UPDATE_MUTATION = `
301
- mutation IssueUpdate($issueId: ID!, $title: String, $body: String) {
302
- updateIssue(input: { id: $issueId, title: $title, body: $body }) {
303
- issue {
304
- id
305
- number
306
- title
307
- state
308
- url
309
- }
310
- }
311
- }
312
- `;
313
- var ISSUE_CLOSE_MUTATION = `
314
- mutation IssueClose($issueId: ID!) {
315
- closeIssue(input: { issueId: $issueId }) {
316
- issue {
317
- id
318
- number
319
- state
320
- }
321
- }
322
- }
323
- `;
324
- var ISSUE_REOPEN_MUTATION = `
325
- mutation IssueReopen($issueId: ID!) {
326
- reopenIssue(input: { issueId: $issueId }) {
327
- issue {
328
- id
329
- number
330
- state
331
- }
332
- }
333
- }
334
- `;
335
- var ISSUE_DELETE_MUTATION = `
336
- mutation IssueDelete($issueId: ID!) {
337
- deleteIssue(input: { issueId: $issueId }) {
338
- clientMutationId
339
- }
340
- }
341
- `;
342
- var ISSUE_LABELS_UPDATE_MUTATION = `
343
- mutation IssueLabelsUpdate($issueId: ID!, $labelIds: [ID!]!) {
344
- updateIssue(input: { id: $issueId, labelIds: $labelIds }) {
345
- issue {
346
- id
347
- labels(first: 50) {
348
- nodes {
349
- name
350
- }
351
- }
352
- }
353
- }
354
- }
355
- `;
356
- var ISSUE_ASSIGNEES_UPDATE_MUTATION = `
357
- mutation IssueAssigneesUpdate($issueId: ID!, $assigneeIds: [ID!]!) {
358
- updateIssue(input: { id: $issueId, assigneeIds: $assigneeIds }) {
359
- issue {
360
- id
361
- assignees(first: 50) {
362
- nodes {
363
- login
364
- }
365
- }
366
- }
367
- }
368
- }
369
- `;
370
- var ISSUE_MILESTONE_SET_MUTATION = `
371
- mutation IssueMilestoneSet($issueId: ID!, $milestoneId: ID) {
372
- updateIssue(input: { id: $issueId, milestoneId: $milestoneId }) {
373
- issue {
374
- id
375
- milestone {
376
- number
377
- }
378
- }
379
- }
380
- }
381
- `;
382
- var ISSUE_LABELS_LOOKUP_QUERY = `
383
- query IssueLabelsLookup($issueId: ID!) {
384
- node(id: $issueId) {
385
- ... on Issue {
386
- repository {
387
- labels(first: 100) {
388
- nodes {
389
- id
390
- name
391
- }
392
- }
393
- }
394
- }
395
- }
396
- }
397
- `;
398
- var ISSUE_ASSIGNEES_LOOKUP_QUERY = `
399
- query IssueAssigneesLookup($issueId: ID!) {
400
- node(id: $issueId) {
401
- ... on Issue {
402
- repository {
403
- assignableUsers(first: 100) {
404
- nodes {
405
- id
406
- login
407
- }
408
- }
409
- }
410
- }
411
- }
412
- }
413
- `;
414
- var ISSUE_MILESTONE_LOOKUP_QUERY = `
415
- query IssueMilestoneLookup($issueId: ID!, $milestoneNumber: Int!) {
416
- node(id: $issueId) {
417
- ... on Issue {
418
- repository {
419
- milestone(number: $milestoneNumber) {
420
- id
421
- }
422
- }
423
- }
424
- }
425
- }
426
- `;
427
- var ISSUE_COMMENT_CREATE_MUTATION = `
428
- mutation IssueCommentCreate($issueId: ID!, $body: String!) {
429
- addComment(input: { subjectId: $issueId, body: $body }) {
430
- commentEdge {
431
- node {
432
- id
433
- body
434
- url
435
- }
436
- }
437
- }
438
- }
439
- `;
440
- var ISSUE_LINKED_PRS_LIST_QUERY = `
441
- query IssueLinkedPrsList($owner: String!, $name: String!, $issueNumber: Int!) {
442
- repository(owner: $owner, name: $name) {
443
- issue(number: $issueNumber) {
444
- timelineItems(first: 50, itemTypes: [CONNECTED_EVENT]) {
445
- nodes {
446
- __typename
447
- ... on ConnectedEvent {
448
- subject {
449
- __typename
450
- ... on PullRequest {
451
- id
452
- number
453
- title
454
- state
455
- url
456
- }
457
- }
458
- }
459
- }
460
- }
461
- }
462
- }
463
- }
464
- `;
465
- var ISSUE_RELATIONS_GET_QUERY = `
466
- query IssueRelationsGet($owner: String!, $name: String!, $issueNumber: Int!) {
467
- repository(owner: $owner, name: $name) {
468
- issue(number: $issueNumber) {
469
- id
470
- number
471
- parent {
472
- id
473
- number
474
- }
475
- subIssues(first: 50) {
476
- nodes {
477
- id
478
- number
479
- }
480
- }
481
- blockedBy(first: 50) {
482
- nodes {
483
- id
484
- number
485
- }
486
- }
487
- }
488
- }
489
- }
490
- `;
491
- var ISSUE_PARENT_LOOKUP_QUERY = `
492
- query IssueParentLookup($issueId: ID!) {
493
- node(id: $issueId) {
494
- ... on Issue {
495
- id
496
- parent {
497
- id
498
- }
499
- }
500
- }
501
- }
502
- `;
503
- var ISSUE_PARENT_SET_MUTATION = `
504
- mutation IssueParentSet($issueId: ID!, $parentIssueId: ID!) {
505
- addSubIssue(input: { issueId: $parentIssueId, subIssueId: $issueId }) {
506
- issue { id }
507
- subIssue { id }
508
- }
509
- }
510
- `;
511
- var ISSUE_PARENT_REMOVE_MUTATION = `
512
- mutation IssueParentRemove($issueId: ID!, $parentIssueId: ID!) {
513
- removeSubIssue(input: { issueId: $parentIssueId, subIssueId: $issueId }) {
514
- issue { id }
515
- subIssue { id }
516
- }
517
- }
518
- `;
519
- var ISSUE_BLOCKED_BY_ADD_MUTATION = `
520
- mutation IssueBlockedByAdd($issueId: ID!, $blockedByIssueId: ID!) {
521
- addBlockedBy(input: { issueId: $issueId, blockingIssueId: $blockedByIssueId }) {
522
- issue { id }
523
- blockingIssue { id }
524
- }
525
- }
526
- `;
527
- var ISSUE_BLOCKED_BY_REMOVE_MUTATION = `
528
- mutation IssueBlockedByRemove($issueId: ID!, $blockedByIssueId: ID!) {
529
- removeBlockedBy(input: { issueId: $issueId, blockingIssueId: $blockedByIssueId }) {
530
- issue { id }
531
- blockingIssue { id }
532
- }
533
- }
534
- `;
535
- function createSdkClients(transport) {
536
- const client = {
537
- request(documentOrOptions, ...variablesAndRequestHeaders) {
538
- const options = typeof documentOrOptions === "object" && documentOrOptions !== null && "document" in documentOrOptions ? documentOrOptions : {
539
- document: documentOrOptions,
540
- variables: variablesAndRequestHeaders[0]
541
- };
542
- const queryText = queryToString(options.document);
543
- assertQuery(queryText);
544
- return transport.execute(queryText, options.variables);
545
- }
546
- };
547
- const graphqlRequestClient = client;
548
- return {
549
- issueCommentsList: getSdk(graphqlRequestClient),
550
- issueList: getSdk2(graphqlRequestClient),
551
- issue: getSdk3(graphqlRequestClient),
552
- prDiffListFiles: getSdk4(graphqlRequestClient),
553
- prList: getSdk6(graphqlRequestClient),
554
- prReviewsList: getSdk5(graphqlRequestClient),
555
- pr: getSdk7(graphqlRequestClient),
556
- repo: getSdk8(graphqlRequestClient)
557
- };
558
- }
559
- async function runRepoView(sdk, input) {
560
- assertRepoInput(input);
561
- const result = await sdk.RepoView(input);
562
- if (!result.repository) {
563
- throw new Error("Repository not found");
564
- }
565
- return {
566
- id: result.repository.id,
567
- name: result.repository.name,
568
- nameWithOwner: result.repository.nameWithOwner,
569
- isPrivate: result.repository.isPrivate,
570
- stargazerCount: result.repository.stargazerCount,
571
- forkCount: result.repository.forkCount,
572
- url: result.repository.url,
573
- defaultBranch: result.repository.defaultBranchRef?.name ?? null
574
- };
575
- }
576
- async function runIssueView(sdk, input) {
577
- assertIssueInput(input);
578
- const result = await sdk.IssueView(input);
579
- const issue = result.repository?.issue;
580
- if (!issue) {
581
- throw new Error("Issue not found");
582
- }
583
- return {
584
- id: issue.id,
585
- number: issue.number,
586
- title: issue.title,
587
- state: issue.state,
588
- url: issue.url
589
- };
590
- }
591
- async function runIssueList(sdk, input) {
592
- assertIssueListInput(input);
593
- const result = await sdk.IssueList(input);
594
- const issues = result.repository?.issues;
595
- if (!issues) {
596
- throw new Error("Issues not found");
597
- }
598
- return {
599
- items: (issues.nodes ?? []).flatMap(
600
- (issue) => issue ? [
601
- {
602
- id: issue.id,
603
- number: issue.number,
604
- title: issue.title,
605
- state: issue.state,
606
- url: issue.url
607
- }
608
- ] : []
609
- ),
610
- pageInfo: {
611
- endCursor: issues.pageInfo.endCursor ?? null,
612
- hasNextPage: issues.pageInfo.hasNextPage
613
- }
614
- };
615
- }
616
- async function runIssueCommentsList(sdk, input) {
617
- assertIssueCommentsListInput(input);
618
- const result = await sdk.IssueCommentsList(input);
619
- const comments = result.repository?.issue?.comments;
620
- if (!comments) {
621
- throw new Error("Issue comments not found");
622
- }
623
- return {
624
- items: (comments.nodes ?? []).flatMap(
625
- (comment) => comment ? [
626
- {
627
- id: comment.id,
628
- body: comment.body,
629
- authorLogin: comment.author?.login ?? null,
630
- createdAt: comment.createdAt,
631
- url: String(comment.url)
632
- }
633
- ] : []
634
- ),
635
- pageInfo: {
636
- endCursor: comments.pageInfo.endCursor ?? null,
637
- hasNextPage: comments.pageInfo.hasNextPage
638
- }
639
- };
640
- }
641
- function parseIssueNode(issue) {
642
- const issueRecord = asRecord(issue);
643
- if (!issueRecord || typeof issueRecord.id !== "string" || typeof issueRecord.number !== "number") {
644
- throw new Error("Issue mutation failed");
645
- }
646
- const result = {
647
- id: issueRecord.id,
648
- number: issueRecord.number
649
- };
650
- if (typeof issueRecord.title === "string") {
651
- result.title = issueRecord.title;
652
- }
653
- if (typeof issueRecord.state === "string") {
654
- result.state = issueRecord.state;
655
- }
656
- if (typeof issueRecord.url === "string") {
657
- result.url = issueRecord.url;
658
- }
659
- return result;
660
- }
661
- async function runIssueCreate(graphqlClient, input) {
662
- assertIssueCreateInput(input);
663
- const repositoryLookupResult = await graphqlClient.query(ISSUE_CREATE_REPOSITORY_ID_QUERY, {
664
- owner: input.owner,
665
- name: input.name
666
- });
667
- const repositoryId = asRecord(asRecord(repositoryLookupResult)?.repository)?.id;
668
- if (typeof repositoryId !== "string" || repositoryId.length === 0) {
669
- throw new Error("Repository not found");
670
- }
671
- const result = await graphqlClient.query(ISSUE_CREATE_MUTATION, {
672
- repositoryId,
673
- title: input.title,
674
- body: input.body
675
- });
676
- const issue = asRecord(asRecord(result)?.createIssue)?.issue;
677
- return parseIssueNode(issue);
678
- }
679
- async function runIssueUpdate(graphqlClient, input) {
680
- assertIssueUpdateInput(input);
681
- const result = await graphqlClient.query(ISSUE_UPDATE_MUTATION, {
682
- issueId: input.issueId,
683
- title: input.title,
684
- body: input.body
685
- });
686
- const issue = asRecord(asRecord(result)?.updateIssue)?.issue;
687
- return parseIssueNode(issue);
688
- }
689
- async function runIssueClose(graphqlClient, input) {
690
- assertIssueMutationInput(input);
691
- const result = await graphqlClient.query(ISSUE_CLOSE_MUTATION, {
692
- issueId: input.issueId
693
- });
694
- const issueData = parseIssueNode(asRecord(asRecord(result)?.closeIssue)?.issue);
695
- return {
696
- ...issueData,
697
- closed: issueData.state === "CLOSED"
698
- };
699
- }
700
- async function runIssueReopen(graphqlClient, input) {
701
- assertIssueMutationInput(input);
702
- const result = await graphqlClient.query(ISSUE_REOPEN_MUTATION, {
703
- issueId: input.issueId
704
- });
705
- const issueData = parseIssueNode(asRecord(asRecord(result)?.reopenIssue)?.issue);
706
- return {
707
- ...issueData,
708
- reopened: issueData.state === "OPEN"
709
- };
710
- }
711
- async function runIssueDelete(graphqlClient, input) {
712
- assertIssueMutationInput(input);
713
- const result = await graphqlClient.query(ISSUE_DELETE_MUTATION, {
714
- issueId: input.issueId
715
- });
716
- const mutation = asRecord(asRecord(result)?.deleteIssue);
717
- if (!mutation) {
718
- throw new Error("Issue deletion failed");
719
- }
720
- return {
721
- id: input.issueId,
722
- number: 0,
723
- deleted: true
724
- };
725
- }
726
- async function runIssueLabelsUpdate(graphqlClient, input) {
727
- assertIssueLabelsUpdateInput(input);
728
- const lookupResult = await graphqlClient.query(ISSUE_LABELS_LOOKUP_QUERY, {
729
- issueId: input.issueId
730
- });
731
- const availableLabels = Array.isArray(
732
- asRecord(asRecord(asRecord(asRecord(lookupResult)?.node)?.repository)?.labels)?.nodes
733
- ) ? asRecord(asRecord(asRecord(asRecord(lookupResult)?.node)?.repository)?.labels)?.nodes : [];
734
- const labelIdsByName = /* @__PURE__ */ new Map();
735
- for (const label of availableLabels) {
736
- const labelRecord = asRecord(label);
737
- if (typeof labelRecord?.name === "string" && typeof labelRecord?.id === "string") {
738
- labelIdsByName.set(labelRecord.name.toLowerCase(), labelRecord.id);
739
- }
740
- }
741
- const labelIds = input.labels.map((labelName) => {
742
- const id = labelIdsByName.get(labelName.toLowerCase());
743
- if (!id) {
744
- throw new Error(`Label not found: ${labelName}`);
745
- }
746
- return id;
747
- });
748
- const result = await graphqlClient.query(ISSUE_LABELS_UPDATE_MUTATION, {
749
- issueId: input.issueId,
750
- labelIds
751
- });
752
- const mutation = asRecord(asRecord(result)?.["updateIssue"]);
753
- const issue = asRecord(mutation?.["issue"]);
754
- const labels = asRecord(issue?.["labels"]);
755
- const labelNodes = Array.isArray(labels?.["nodes"]) ? labels["nodes"] : [];
756
- return {
757
- id: assertNonEmptyString(issue?.["id"], "Issue id"),
758
- labels: labelNodes.map((label) => asRecord(label)?.["name"]).filter((name) => typeof name === "string")
759
- };
760
- }
761
- async function runIssueAssigneesUpdate(graphqlClient, input) {
762
- assertIssueAssigneesUpdateInput(input);
763
- const lookupResult = await graphqlClient.query(ISSUE_ASSIGNEES_LOOKUP_QUERY, {
764
- issueId: input.issueId
765
- });
766
- const availableAssignees = Array.isArray(
767
- asRecord(asRecord(asRecord(asRecord(lookupResult)?.node)?.repository)?.assignableUsers)?.nodes
768
- ) ? asRecord(asRecord(asRecord(asRecord(lookupResult)?.node)?.repository)?.assignableUsers)?.nodes : [];
769
- const assigneeIdsByLogin = /* @__PURE__ */ new Map();
770
- for (const assignee of availableAssignees) {
771
- const assigneeRecord = asRecord(assignee);
772
- if (typeof assigneeRecord?.login === "string" && typeof assigneeRecord?.id === "string") {
773
- assigneeIdsByLogin.set(assigneeRecord.login.toLowerCase(), assigneeRecord.id);
774
- }
775
- }
776
- const assigneeIds = input.assignees.map((login) => {
777
- const id = assigneeIdsByLogin.get(login.toLowerCase());
778
- if (!id) {
779
- throw new Error(`Assignee not found: ${login}`);
780
- }
781
- return id;
782
- });
783
- const result = await graphqlClient.query(ISSUE_ASSIGNEES_UPDATE_MUTATION, {
784
- issueId: input.issueId,
785
- assigneeIds
786
- });
787
- const mutation = asRecord(asRecord(result)?.["updateIssue"]);
788
- const issue = asRecord(mutation?.["issue"]);
789
- const assignees = asRecord(issue?.["assignees"]);
790
- const assigneeNodes = Array.isArray(assignees?.["nodes"]) ? assignees["nodes"] : [];
791
- return {
792
- id: assertNonEmptyString(issue?.["id"], "Issue id"),
793
- assignees: assigneeNodes.map((assignee) => asRecord(assignee)?.["login"]).filter((login) => typeof login === "string")
794
- };
795
- }
796
- async function runIssueMilestoneSet(graphqlClient, input) {
797
- assertIssueMilestoneSetInput(input);
798
- let milestoneId = null;
799
- if (input.milestoneNumber !== null) {
800
- const lookupResult = await graphqlClient.query(ISSUE_MILESTONE_LOOKUP_QUERY, {
801
- issueId: input.issueId,
802
- milestoneNumber: input.milestoneNumber
803
- });
804
- const resolvedId = asRecord(asRecord(asRecord(asRecord(lookupResult)?.node)?.repository)?.milestone)?.id;
805
- if (typeof resolvedId !== "string" || resolvedId.length === 0) {
806
- throw new Error(`Milestone not found: ${input.milestoneNumber}`);
807
- }
808
- milestoneId = resolvedId;
809
- }
810
- const result = await graphqlClient.query(ISSUE_MILESTONE_SET_MUTATION, {
811
- issueId: input.issueId,
812
- milestoneId
813
- });
814
- const mutation = asRecord(asRecord(result)?.["updateIssue"]);
815
- const issue = asRecord(mutation?.["issue"]);
816
- const milestone = asRecord(issue?.["milestone"]);
817
- return {
818
- id: assertNonEmptyString(issue?.["id"], "Issue id"),
819
- milestoneNumber: typeof milestone?.["number"] === "number" ? milestone["number"] : null
820
- };
821
- }
822
- async function runIssueCommentCreate(graphqlClient, input) {
823
- assertIssueCommentCreateInput(input);
824
- const result = await graphqlClient.query(ISSUE_COMMENT_CREATE_MUTATION, {
825
- issueId: input.issueId,
826
- body: input.body
827
- });
828
- const mutation = asRecord(asRecord(result)?.["addComment"]);
829
- const commentEdge = asRecord(mutation?.["commentEdge"]);
830
- const node = asRecord(commentEdge?.["node"]);
831
- if (!node || typeof node["id"] !== "string" || typeof node["body"] !== "string") {
832
- throw new Error("Issue comment creation failed");
833
- }
834
- return {
835
- id: node["id"],
836
- body: node["body"],
837
- url: typeof node["url"] === "string" ? node["url"] : ""
838
- };
839
- }
840
- async function runIssueLinkedPrsList(graphqlClient, input) {
841
- assertIssueLinkedPrsListInput(input);
842
- const result = await graphqlClient.query(ISSUE_LINKED_PRS_LIST_QUERY, {
843
- owner: input.owner,
844
- name: input.name,
845
- issueNumber: input.issueNumber
846
- });
847
- const issue = asRecord(asRecord(asRecord(result)?.repository)?.issue);
848
- const timelineItems = asRecord(issue?.timelineItems);
849
- const nodes = Array.isArray(timelineItems?.nodes) ? timelineItems.nodes : [];
850
- return {
851
- items: nodes.map((node) => asRecord(asRecord(node)?.["subject"])).filter((subject) => Boolean(subject) && subject?.["__typename"] === "PullRequest").flatMap((subject) => {
852
- if (!subject) {
853
- return [];
854
- }
855
- if (typeof subject["id"] !== "string" || typeof subject["number"] !== "number" || typeof subject["title"] !== "string" || typeof subject["state"] !== "string" || typeof subject["url"] !== "string") {
856
- return [];
857
- }
858
- return [{
859
- id: subject["id"],
860
- number: subject["number"],
861
- title: subject["title"],
862
- state: subject["state"],
863
- url: subject["url"]
864
- }];
865
- })
866
- };
867
- }
868
- function parseIssueRelationNode(node) {
869
- const record = asRecord(node);
870
- if (!record || typeof record.id !== "string" || typeof record.number !== "number") {
871
- return null;
872
- }
873
- return {
874
- id: record.id,
875
- number: record.number
876
- };
877
- }
878
- async function runIssueRelationsGet(graphqlClient, input) {
879
- assertIssueRelationsGetInput(input);
880
- const result = await graphqlClient.query(ISSUE_RELATIONS_GET_QUERY, {
881
- owner: input.owner,
882
- name: input.name,
883
- issueNumber: input.issueNumber
884
- });
885
- const issue = asRecord(asRecord(asRecord(result)?.repository)?.issue);
886
- const currentIssue = parseIssueRelationNode(issue);
887
- if (!currentIssue) {
888
- throw new Error("Issue relations not found");
889
- }
890
- const parent = parseIssueRelationNode(issue?.parent);
891
- const subIssues = asRecord(issue?.["subIssues"]);
892
- const blockedByConnection = asRecord(issue?.["blockedBy"]);
893
- const childrenNodes = Array.isArray(subIssues?.["nodes"]) ? subIssues["nodes"] : [];
894
- const blockedByNodes = Array.isArray(blockedByConnection?.["nodes"]) ? blockedByConnection["nodes"] : [];
895
- return {
896
- issue: currentIssue,
897
- parent,
898
- children: childrenNodes.map((node) => parseIssueRelationNode(node)).flatMap((node) => node ? [node] : []),
899
- blockedBy: blockedByNodes.map((node) => parseIssueRelationNode(node)).flatMap((node) => node ? [node] : [])
900
- };
901
- }
902
- async function runIssueParentSet(graphqlClient, input) {
903
- assertIssueParentSetInput(input);
904
- const result = await graphqlClient.query(ISSUE_PARENT_SET_MUTATION, {
905
- issueId: input.issueId,
906
- parentIssueId: input.parentIssueId
907
- });
908
- const mutation = asRecord(asRecord(result)?.addSubIssue);
909
- const parentIssue = asRecord(mutation?.issue);
910
- const subIssue = asRecord(mutation?.subIssue);
911
- if (typeof parentIssue?.id !== "string" || typeof subIssue?.id !== "string") {
912
- throw new Error("Issue parent update failed");
913
- }
914
- return {
915
- issueId: subIssue.id,
916
- parentIssueId: parentIssue.id
917
- };
918
- }
919
- async function runIssueParentRemove(graphqlClient, input) {
920
- assertIssueParentRemoveInput(input);
921
- const lookupResult = await graphqlClient.query(ISSUE_PARENT_LOOKUP_QUERY, {
922
- issueId: input.issueId
923
- });
924
- const parentIssueId = asRecord(asRecord(asRecord(lookupResult)?.node)?.parent)?.id;
925
- if (typeof parentIssueId !== "string" || parentIssueId.length === 0) {
926
- throw new Error("Issue parent removal failed");
927
- }
928
- const result = await graphqlClient.query(ISSUE_PARENT_REMOVE_MUTATION, {
929
- issueId: input.issueId,
930
- parentIssueId
931
- });
932
- const mutation = asRecord(asRecord(result)?.removeSubIssue);
933
- const parentIssue = asRecord(mutation?.issue);
934
- const subIssue = asRecord(mutation?.subIssue);
935
- if (typeof parentIssue?.id !== "string" || typeof subIssue?.id !== "string") {
936
- throw new Error("Issue parent removal failed");
937
- }
938
- return {
939
- issueId: subIssue.id,
940
- parentRemoved: true
941
- };
942
- }
943
- async function runIssueBlockedByAdd(graphqlClient, input) {
944
- assertIssueBlockedByInput(input);
945
- const result = await graphqlClient.query(ISSUE_BLOCKED_BY_ADD_MUTATION, {
946
- issueId: input.issueId,
947
- blockedByIssueId: input.blockedByIssueId
948
- });
949
- const mutation = asRecord(asRecord(result)?.addBlockedBy);
950
- const issue = asRecord(mutation?.issue);
951
- const blockingIssue = asRecord(mutation?.blockingIssue);
952
- if (typeof issue?.id !== "string" || typeof blockingIssue?.id !== "string") {
953
- throw new Error("Issue dependency mutation failed");
954
- }
955
- return {
956
- issueId: issue.id,
957
- blockedByIssueId: blockingIssue.id
958
- };
959
- }
960
- async function runIssueBlockedByRemove(graphqlClient, input) {
961
- assertIssueBlockedByInput(input);
962
- const result = await graphqlClient.query(ISSUE_BLOCKED_BY_REMOVE_MUTATION, {
963
- issueId: input.issueId,
964
- blockedByIssueId: input.blockedByIssueId
965
- });
966
- const mutation = asRecord(asRecord(result)?.removeBlockedBy);
967
- const issue = asRecord(mutation?.issue);
968
- const blockingIssue = asRecord(mutation?.blockingIssue);
969
- if (typeof issue?.id !== "string" || typeof blockingIssue?.id !== "string") {
970
- throw new Error("Issue dependency mutation failed");
971
- }
972
- return {
973
- issueId: issue.id,
974
- blockedByIssueId: blockingIssue.id,
975
- removed: true
976
- };
977
- }
978
- async function runPrView(sdk, input) {
979
- assertPrInput(input);
980
- const result = await sdk.PrView(input);
981
- const pr = result.repository?.pullRequest;
982
- if (!pr) {
983
- throw new Error("Pull request not found");
984
- }
985
- return {
986
- id: pr.id,
987
- number: pr.number,
988
- title: pr.title,
989
- state: pr.state,
990
- url: pr.url
991
- };
992
- }
993
- async function runPrList(sdk, input) {
994
- assertPrListInput(input);
995
- const result = await sdk.PrList(input);
996
- const prs = result.repository?.pullRequests;
997
- if (!prs) {
998
- throw new Error("Pull requests not found");
999
- }
1000
- return {
1001
- items: (prs.nodes ?? []).flatMap(
1002
- (pr) => pr ? [
1003
- {
1004
- id: pr.id,
1005
- number: pr.number,
1006
- title: pr.title,
1007
- state: pr.state,
1008
- url: pr.url
1009
- }
1010
- ] : []
1011
- ),
1012
- pageInfo: {
1013
- endCursor: prs.pageInfo.endCursor ?? null,
1014
- hasNextPage: prs.pageInfo.hasNextPage
1015
- }
1016
- };
1017
- }
1018
- async function runPrReviewsList(sdk, input) {
1019
- assertPrReviewsListInput(input);
1020
- const result = await sdk.PrReviewsList(input);
1021
- const reviews = result.repository?.pullRequest?.reviews;
1022
- if (!reviews) {
1023
- throw new Error("Pull request reviews not found");
1024
- }
1025
- return {
1026
- items: (reviews.nodes ?? []).flatMap(
1027
- (review) => review ? [{
1028
- id: review.id,
1029
- authorLogin: review.author?.login ?? null,
1030
- body: review.body,
1031
- state: review.state,
1032
- submittedAt: review.submittedAt ?? null,
1033
- url: review.url,
1034
- commitOid: review.commit?.oid ?? null
1035
- }] : []
1036
- ),
1037
- pageInfo: {
1038
- endCursor: reviews.pageInfo.endCursor ?? null,
1039
- hasNextPage: reviews.pageInfo.hasNextPage
1040
- }
1041
- };
1042
- }
1043
- async function runPrDiffListFiles(sdk, input) {
1044
- assertPrDiffListFilesInput(input);
1045
- const result = await sdk.PrDiffListFiles(input);
1046
- const files = result.repository?.pullRequest?.files;
1047
- if (!files) {
1048
- throw new Error("Pull request files not found");
1049
- }
1050
- return {
1051
- items: (files.nodes ?? []).flatMap(
1052
- (file) => file ? [{
1053
- path: file.path,
1054
- additions: file.additions,
1055
- deletions: file.deletions
1056
- }] : []
1057
- ),
1058
- pageInfo: {
1059
- endCursor: files.pageInfo.endCursor ?? null,
1060
- hasNextPage: files.pageInfo.hasNextPage
1061
- }
1062
- };
1063
- }
1064
- var MAX_PR_REVIEW_THREAD_SCAN_PAGES = 5;
1065
- function asRecord(value) {
1066
- return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
1067
- }
1068
- function normalizePrReviewThreadComment(comment) {
1069
- const commentRecord = asRecord(comment);
1070
- if (!commentRecord || typeof commentRecord.id !== "string") {
1071
- return null;
1072
- }
1073
- const author = asRecord(commentRecord.author);
1074
- const url = commentRecord.url;
1075
- return {
1076
- id: commentRecord.id,
1077
- authorLogin: typeof author?.login === "string" ? author.login : null,
1078
- body: typeof commentRecord.body === "string" ? commentRecord.body : "",
1079
- createdAt: typeof commentRecord.createdAt === "string" ? commentRecord.createdAt : "",
1080
- url: typeof url === "string" ? url : String(url ?? "")
1081
- };
1082
- }
1083
- function normalizePrReviewThread(thread) {
1084
- const threadRecord = asRecord(thread);
1085
- if (!threadRecord || typeof threadRecord.id !== "string") {
1086
- return null;
1087
- }
1088
- const comments = asRecord(threadRecord.comments);
1089
- const commentNodes = Array.isArray(comments?.nodes) ? comments.nodes : [];
1090
- const resolvedBy = asRecord(threadRecord.resolvedBy);
1091
- return {
1092
- id: threadRecord.id,
1093
- path: typeof threadRecord.path === "string" ? threadRecord.path : null,
1094
- line: typeof threadRecord.line === "number" ? threadRecord.line : null,
1095
- startLine: typeof threadRecord.startLine === "number" ? threadRecord.startLine : null,
1096
- diffSide: typeof threadRecord.diffSide === "string" ? threadRecord.diffSide : null,
1097
- subjectType: typeof threadRecord.subjectType === "string" ? threadRecord.subjectType : null,
1098
- isResolved: Boolean(threadRecord.isResolved),
1099
- isOutdated: Boolean(threadRecord.isOutdated),
1100
- viewerCanReply: Boolean(threadRecord.viewerCanReply),
1101
- viewerCanResolve: Boolean(threadRecord.viewerCanResolve),
1102
- viewerCanUnresolve: Boolean(threadRecord.viewerCanUnresolve),
1103
- resolvedByLogin: typeof resolvedBy?.login === "string" ? resolvedBy.login : null,
1104
- comments: commentNodes.map((comment) => normalizePrReviewThreadComment(comment)).flatMap((comment) => comment ? [comment] : [])
1105
- };
1106
- }
1107
- async function runPrCommentsList(graphqlClient, input) {
1108
- assertPrCommentsListInput(input);
1109
- const unresolvedOnly = input.unresolvedOnly ?? false;
1110
- const includeOutdated = input.includeOutdated ?? true;
1111
- const filteredThreads = [];
1112
- let sourceEndCursor = input.after ?? null;
1113
- let sourceHasNextPage = false;
1114
- let pagesScanned = 0;
1115
- let sourceItemsScanned = 0;
1116
- while (pagesScanned < MAX_PR_REVIEW_THREAD_SCAN_PAGES && filteredThreads.length < input.first) {
1117
- const result = await graphqlClient.query(PR_COMMENTS_LIST_QUERY, {
1118
- owner: input.owner,
1119
- name: input.name,
1120
- prNumber: input.prNumber,
1121
- first: input.first,
1122
- after: sourceEndCursor
1123
- });
1124
- const repository = asRecord(asRecord(result)?.repository);
1125
- const pullRequest = asRecord(repository?.pullRequest);
1126
- const reviewThreads = asRecord(pullRequest?.reviewThreads);
1127
- if (!reviewThreads) {
1128
- throw new Error("Pull request review threads not found");
1129
- }
1130
- const pageInfo = asRecord(reviewThreads.pageInfo);
1131
- const threadEdges = Array.isArray(reviewThreads.edges) ? reviewThreads.edges.map((edge) => {
1132
- const edgeRecord = asRecord(edge);
1133
- if (!edgeRecord) {
1134
- return null;
1135
- }
1136
- return {
1137
- cursor: typeof edgeRecord.cursor === "string" ? edgeRecord.cursor : null,
1138
- node: edgeRecord.node
1139
- };
1140
- }).flatMap((edge) => edge ? [edge] : []) : [];
1141
- const threadNodes = threadEdges.length > 0 ? threadEdges : Array.isArray(reviewThreads.nodes) ? reviewThreads.nodes.map((node) => ({ cursor: null, node })) : [];
1142
- pagesScanned += 1;
1143
- sourceItemsScanned += threadNodes.length;
1144
- for (const threadNode of threadNodes) {
1145
- const normalized = normalizePrReviewThread(threadNode.node);
1146
- if (!normalized) {
1147
- continue;
1148
- }
1149
- if (unresolvedOnly && normalized.isResolved) {
1150
- continue;
1151
- }
1152
- if (unresolvedOnly && !includeOutdated && normalized.isOutdated) {
1153
- continue;
1154
- }
1155
- filteredThreads.push({ thread: normalized, cursor: threadNode.cursor });
1156
- }
1157
- sourceHasNextPage = Boolean(pageInfo?.hasNextPage);
1158
- sourceEndCursor = typeof pageInfo?.endCursor === "string" ? pageInfo.endCursor : null;
1159
- if (!sourceHasNextPage) {
1160
- break;
1161
- }
1162
- }
1163
- const hasBufferedFilteredItems = filteredThreads.length > input.first;
1164
- const returnedThreads = filteredThreads.slice(0, input.first);
1165
- const endCursor = returnedThreads.length > 0 ? returnedThreads[returnedThreads.length - 1]?.cursor ?? sourceEndCursor : sourceEndCursor;
1166
- const scanTruncated = sourceHasNextPage && pagesScanned >= MAX_PR_REVIEW_THREAD_SCAN_PAGES;
1167
- return {
1168
- items: returnedThreads.map((entry) => entry.thread),
1169
- pageInfo: {
1170
- hasNextPage: hasBufferedFilteredItems || sourceHasNextPage,
1171
- endCursor: hasBufferedFilteredItems || sourceHasNextPage ? endCursor : null
1172
- },
1173
- filterApplied: {
1174
- unresolvedOnly,
1175
- includeOutdated
1176
- },
1177
- scan: {
1178
- pagesScanned,
1179
- sourceItemsScanned,
1180
- scanTruncated
1181
- }
1182
- };
1183
- }
1184
- function assertReviewThreadInput(input) {
1185
- if (typeof input.threadId !== "string" || input.threadId.trim().length === 0) {
1186
- throw new Error("Review thread id is required");
1187
- }
1188
- }
1189
- function assertReplyToReviewThreadInput(input) {
1190
- assertReviewThreadInput(input);
1191
- if (typeof input.body !== "string" || input.body.trim().length === 0) {
1192
- throw new Error("Reply body is required");
1193
- }
1194
- }
1195
- function parseReviewThreadMutationResult(result, mutationKey) {
1196
- const root = asRecord(result);
1197
- const mutation = asRecord(root?.[mutationKey]);
1198
- const thread = asRecord(mutation?.thread);
1199
- if (!thread || typeof thread.id !== "string") {
1200
- throw new Error("Review thread mutation failed");
1201
- }
1202
- return {
1203
- id: thread.id,
1204
- isResolved: Boolean(thread.isResolved)
1205
- };
1206
- }
1207
- async function runReplyToReviewThread(graphqlClient, input) {
1208
- assertReplyToReviewThreadInput(input);
1209
- const result = await graphqlClient.query(PR_COMMENT_REPLY_MUTATION, {
1210
- threadId: input.threadId,
1211
- body: input.body
1212
- });
1213
- const root = asRecord(result);
1214
- const mutation = asRecord(root?.addPullRequestReviewThreadReply);
1215
- const comment = asRecord(mutation?.comment);
1216
- if (!comment || typeof comment.id !== "string") {
1217
- throw new Error("Review thread mutation failed");
1218
- }
1219
- const threadStateResult = await graphqlClient.query(REVIEW_THREAD_STATE_QUERY, {
1220
- threadId: input.threadId
1221
- });
1222
- const threadNode = asRecord(asRecord(threadStateResult)?.node);
1223
- if (!threadNode || typeof threadNode.id !== "string") {
1224
- throw new Error("Review thread state lookup failed");
1225
- }
1226
- return {
1227
- id: input.threadId,
1228
- isResolved: Boolean(threadNode.isResolved)
1229
- };
1230
- }
1231
- async function runResolveReviewThread(graphqlClient, input) {
1232
- assertReviewThreadInput(input);
1233
- const result = await graphqlClient.query(PR_COMMENT_RESOLVE_MUTATION, {
1234
- threadId: input.threadId
1235
- });
1236
- return parseReviewThreadMutationResult(result, "resolveReviewThread");
1237
- }
1238
- async function runUnresolveReviewThread(graphqlClient, input) {
1239
- assertReviewThreadInput(input);
1240
- const result = await graphqlClient.query(PR_COMMENT_UNRESOLVE_MUTATION, {
1241
- threadId: input.threadId
1242
- });
1243
- return parseReviewThreadMutationResult(result, "unresolveReviewThread");
1244
- }
1245
- function queryToString(query) {
1246
- if (typeof query === "string") {
1247
- return query;
1248
- }
1249
- if (typeof query === "object" && query !== null && "kind" in query) {
1250
- return print(query);
1251
- }
1252
- return String(query);
1253
- }
1254
- function assertQuery(query) {
1255
- if (query.trim().length === 0) {
1256
- throw new Error("GraphQL query must be non-empty");
1257
- }
1258
- }
1259
- function createGraphqlClient(transport) {
1260
- return {
1261
- async query(query, variables) {
1262
- const queryText = queryToString(query);
1263
- assertQuery(queryText);
1264
- return transport.execute(queryText, variables);
1265
- }
1266
- };
1267
- }
1268
- var DEFAULT_GRAPHQL_URL = "https://api.github.com/graphql";
1269
- function resolveGraphqlUrl() {
1270
- if (process.env.GITHUB_GRAPHQL_URL) {
1271
- return process.env.GITHUB_GRAPHQL_URL;
1272
- }
1273
- if (process.env.GH_HOST) {
1274
- return `https://${process.env.GH_HOST}/api/graphql`;
1275
- }
1276
- return DEFAULT_GRAPHQL_URL;
1277
- }
1278
- function createTokenTransport(token, graphqlUrl) {
1279
- const url = graphqlUrl ?? resolveGraphqlUrl();
1280
- return {
1281
- async execute(query, variables) {
1282
- const response = await fetch(url, {
1283
- method: "POST",
1284
- headers: {
1285
- "content-type": "application/json",
1286
- authorization: `Bearer ${token}`
1287
- },
1288
- body: JSON.stringify({ query, variables: variables ?? {} })
1289
- });
1290
- const payload = await response.json();
1291
- if (!response.ok) {
1292
- throw new Error(payload.message ?? `GraphQL request failed (${response.status})`);
1293
- }
1294
- if (payload.errors?.length) {
1295
- throw new Error(payload.errors[0]?.message ?? "GraphQL returned errors");
1296
- }
1297
- if (payload.data === void 0) {
1298
- throw new Error("GraphQL response missing data");
1299
- }
1300
- return payload.data;
1301
- }
1302
- };
1303
- }
1304
- function createGithubClientFromToken(tokenOrOptions) {
1305
- const token = typeof tokenOrOptions === "string" ? tokenOrOptions : tokenOrOptions.token;
1306
- const graphqlUrl = typeof tokenOrOptions === "string" ? void 0 : tokenOrOptions.graphqlUrl;
1307
- if (!token || token.trim().length === 0) {
1308
- throw new Error("GitHub token is required");
1309
- }
1310
- return createGithubClient(createTokenTransport(token, graphqlUrl));
1311
- }
1312
- function createGithubClient(transport) {
1313
- const graphqlClient = createGraphqlClient(transport);
1314
- const sdk = createSdkClients(transport);
1315
- return {
1316
- query: (query, variables) => graphqlClient.query(query, variables),
1317
- fetchRepoView: (input) => runRepoView(sdk.repo, input),
1318
- fetchIssueCommentsList: (input) => runIssueCommentsList(sdk.issueCommentsList, input),
1319
- createIssue: (input) => runIssueCreate(graphqlClient, input),
1320
- updateIssue: (input) => runIssueUpdate(graphqlClient, input),
1321
- closeIssue: (input) => runIssueClose(graphqlClient, input),
1322
- reopenIssue: (input) => runIssueReopen(graphqlClient, input),
1323
- deleteIssue: (input) => runIssueDelete(graphqlClient, input),
1324
- updateIssueLabels: (input) => runIssueLabelsUpdate(graphqlClient, input),
1325
- updateIssueAssignees: (input) => runIssueAssigneesUpdate(graphqlClient, input),
1326
- setIssueMilestone: (input) => runIssueMilestoneSet(graphqlClient, input),
1327
- createIssueComment: (input) => runIssueCommentCreate(graphqlClient, input),
1328
- fetchIssueLinkedPrs: (input) => runIssueLinkedPrsList(graphqlClient, input),
1329
- fetchIssueRelations: (input) => runIssueRelationsGet(graphqlClient, input),
1330
- setIssueParent: (input) => runIssueParentSet(graphqlClient, input),
1331
- removeIssueParent: (input) => runIssueParentRemove(graphqlClient, input),
1332
- addIssueBlockedBy: (input) => runIssueBlockedByAdd(graphqlClient, input),
1333
- removeIssueBlockedBy: (input) => runIssueBlockedByRemove(graphqlClient, input),
1334
- fetchIssueList: (input) => runIssueList(sdk.issueList, input),
1335
- fetchIssueView: (input) => runIssueView(sdk.issue, input),
1336
- fetchPrList: (input) => runPrList(sdk.prList, input),
1337
- fetchPrView: (input) => runPrView(sdk.pr, input),
1338
- fetchPrCommentsList: (input) => runPrCommentsList(graphqlClient, input),
1339
- fetchPrReviewsList: (input) => runPrReviewsList(sdk.prReviewsList, input),
1340
- fetchPrDiffListFiles: (input) => runPrDiffListFiles(sdk.prDiffListFiles, input),
1341
- replyToReviewThread: (input) => runReplyToReviewThread(graphqlClient, input),
1342
- resolveReviewThread: (input) => runResolveReviewThread(graphqlClient, input),
1343
- unresolveReviewThread: (input) => runUnresolveReviewThread(graphqlClient, input)
1344
- };
1345
- }
1346
-
1347
- export {
1348
- createGraphqlClient,
1349
- createGithubClientFromToken,
1350
- createGithubClient
1351
- };
1352
- //# sourceMappingURL=chunk-JLDU462R.js.map