oh-my-opencode 5.1.84 → 5.1.86

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 (405) hide show
  1. package/.agents/command/remove-deadcode.md +1 -1
  2. package/.agents/skills/remove-deadcode/SKILL.md +1 -1
  3. package/.agents/skills/work-with-pr/SKILL.md +2 -2
  4. package/.opencode/command/remove-deadcode.md +1 -1
  5. package/.opencode/skills/work-with-pr/SKILL.md +2 -2
  6. package/THIRD-PARTY-NOTICES.md +9 -3
  7. package/dist/cli/index.js +1022 -842
  8. package/dist/cli/service-auth/devices.d.ts +5 -2
  9. package/dist/cli-node/index.js +1022 -842
  10. package/dist/config/schema/agent-names.d.ts +1 -0
  11. package/dist/index.js +180 -205
  12. package/dist/skills/browser/SKILL.md +4 -1
  13. package/dist/skills/browser/references/commands.md +5 -2
  14. package/dist/skills/browser/references/desktop.md +1 -0
  15. package/dist/skills/browser/references/owned-engine/README.md +2 -0
  16. package/dist/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
  17. package/dist/skills/browser/references/owned-engine/network.md +10 -5
  18. package/dist/skills/browser/references/recipes/1password.md +2 -0
  19. package/dist/skills/browser/runtime/omowright/index.js +11 -11
  20. package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
  21. package/dist/skills/debugging/SKILL.md +1 -1
  22. package/dist/skills/git/SKILL.md +62 -0
  23. package/dist/skills/git/agents/openai.yaml +13 -0
  24. package/dist/skills/github/SKILL.md +94 -0
  25. package/dist/skills/github/references/branch-rules.md +129 -0
  26. package/dist/skills/github/references/evidence-attachments.md +16 -0
  27. package/dist/skills/github/references/repo-setup.md +152 -0
  28. package/dist/skills/github/references/waiting.md +52 -0
  29. package/dist/skills/github/references/workflows.md +161 -0
  30. package/dist/skills/github/scripts/cli.ts +8 -0
  31. package/dist/skills/github/scripts/package.json +12 -0
  32. package/dist/skills/github/scripts/sdk.ts +11 -0
  33. package/dist/skills/github/scripts/src/account.ts +243 -0
  34. package/dist/skills/github/scripts/src/actions-write.ts +86 -0
  35. package/dist/skills/github/scripts/src/actions.ts +210 -0
  36. package/dist/skills/github/scripts/src/attestations.ts +136 -0
  37. package/dist/skills/github/scripts/src/blake2b.ts +102 -0
  38. package/dist/skills/github/scripts/src/branch-protection.ts +192 -0
  39. package/dist/skills/github/scripts/src/caches.ts +105 -0
  40. package/dist/skills/github/scripts/src/checks.ts +107 -0
  41. package/dist/skills/github/scripts/src/codespaces.ts +230 -0
  42. package/dist/skills/github/scripts/src/conversation-lock.ts +50 -0
  43. package/dist/skills/github/scripts/src/discussion-list.ts +126 -0
  44. package/dist/skills/github/scripts/src/discussion-lookup.ts +127 -0
  45. package/dist/skills/github/scripts/src/discussions.ts +234 -0
  46. package/dist/skills/github/scripts/src/env.ts +100 -0
  47. package/dist/skills/github/scripts/src/errors.ts +79 -0
  48. package/dist/skills/github/scripts/src/fields.ts +27 -0
  49. package/dist/skills/github/scripts/src/gist-shape.ts +58 -0
  50. package/dist/skills/github/scripts/src/gists-write.ts +130 -0
  51. package/dist/skills/github/scripts/src/gists.ts +118 -0
  52. package/dist/skills/github/scripts/src/git-auth.ts +46 -0
  53. package/dist/skills/github/scripts/src/http.ts +159 -0
  54. package/dist/skills/github/scripts/src/issue-develop.ts +118 -0
  55. package/dist/skills/github/scripts/src/issues-extra.ts +135 -0
  56. package/dist/skills/github/scripts/src/issues-write.ts +174 -0
  57. package/dist/skills/github/scripts/src/issues.ts +156 -0
  58. package/dist/skills/github/scripts/src/keys.ts +176 -0
  59. package/dist/skills/github/scripts/src/labels.ts +209 -0
  60. package/dist/skills/github/scripts/src/merge.ts +115 -0
  61. package/dist/skills/github/scripts/src/poly1305.ts +22 -0
  62. package/dist/skills/github/scripts/src/pr-checkout.ts +92 -0
  63. package/dist/skills/github/scripts/src/pr-view.ts +106 -0
  64. package/dist/skills/github/scripts/src/project-fields.ts +144 -0
  65. package/dist/skills/github/scripts/src/project-item-edit.ts +153 -0
  66. package/dist/skills/github/scripts/src/project-items.ts +191 -0
  67. package/dist/skills/github/scripts/src/project-links.ts +104 -0
  68. package/dist/skills/github/scripts/src/project-ref.ts +145 -0
  69. package/dist/skills/github/scripts/src/project-state.ts +99 -0
  70. package/dist/skills/github/scripts/src/projects.ts +158 -0
  71. package/dist/skills/github/scripts/src/pulls-extra.ts +165 -0
  72. package/dist/skills/github/scripts/src/pulls-read.ts +176 -0
  73. package/dist/skills/github/scripts/src/pulls-review.ts +206 -0
  74. package/dist/skills/github/scripts/src/pulls-write.ts +187 -0
  75. package/dist/skills/github/scripts/src/raw.ts +78 -0
  76. package/dist/skills/github/scripts/src/read.ts +77 -0
  77. package/dist/skills/github/scripts/src/release-assets.ts +111 -0
  78. package/dist/skills/github/scripts/src/release-download.ts +151 -0
  79. package/dist/skills/github/scripts/src/release-write.ts +197 -0
  80. package/dist/skills/github/scripts/src/repo-admin.ts +112 -0
  81. package/dist/skills/github/scripts/src/repo-content.ts +187 -0
  82. package/dist/skills/github/scripts/src/repo-create.ts +139 -0
  83. package/dist/skills/github/scripts/src/repo-extras.ts +217 -0
  84. package/dist/skills/github/scripts/src/repo-list.ts +143 -0
  85. package/dist/skills/github/scripts/src/repo-settings.ts +176 -0
  86. package/dist/skills/github/scripts/src/repo-sync.ts +81 -0
  87. package/dist/skills/github/scripts/src/repo-url.ts +104 -0
  88. package/dist/skills/github/scripts/src/repos.ts +87 -0
  89. package/dist/skills/github/scripts/src/ruleset-shape.ts +96 -0
  90. package/dist/skills/github/scripts/src/rulesets-write.ts +124 -0
  91. package/dist/skills/github/scripts/src/rulesets.ts +80 -0
  92. package/dist/skills/github/scripts/src/run-download.ts +88 -0
  93. package/dist/skills/github/scripts/src/salsa20.ts +97 -0
  94. package/dist/skills/github/scripts/src/scopes.ts +165 -0
  95. package/dist/skills/github/scripts/src/sealed-box.ts +75 -0
  96. package/dist/skills/github/scripts/src/search-commits.ts +114 -0
  97. package/dist/skills/github/scripts/src/search.ts +116 -0
  98. package/dist/skills/github/scripts/src/secrets.ts +131 -0
  99. package/dist/skills/github/scripts/src/snappy.ts +57 -0
  100. package/dist/skills/github/scripts/src/status-search.ts +55 -0
  101. package/dist/skills/github/scripts/src/transfer.ts +97 -0
  102. package/dist/skills/github/scripts/src/types.ts +75 -0
  103. package/dist/skills/github/scripts/src/variables.ts +86 -0
  104. package/dist/skills/github/scripts/src/wait.ts +164 -0
  105. package/dist/skills/github/scripts/src/wire.ts +159 -0
  106. package/dist/skills/github/scripts/src/workflows.ts +144 -0
  107. package/dist/skills/github/scripts/src/zip.ts +104 -0
  108. package/dist/skills/github/scripts/surface.ts +106 -0
  109. package/dist/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
  110. package/dist/skills/github/scripts/vendor/surface/cli.ts +203 -0
  111. package/dist/skills/github/scripts/vendor/surface/flags.ts +195 -0
  112. package/dist/skills/github/scripts/vendor/surface/help.ts +89 -0
  113. package/dist/skills/github/scripts/vendor/surface/http.ts +180 -0
  114. package/dist/skills/github/scripts/vendor/surface/index.ts +44 -0
  115. package/dist/skills/github/scripts/vendor/surface/mcp.ts +241 -0
  116. package/dist/skills/github/scripts/vendor/surface/schema.ts +200 -0
  117. package/dist/skills/github/scripts/vendor/surface/stdio.ts +54 -0
  118. package/dist/skills/github/scripts/vendor/surface/surface.ts +250 -0
  119. package/dist/skills/github/scripts/vendor/surface/tools.ts +80 -0
  120. package/dist/skills/programming/SKILL.md +1 -1
  121. package/dist/skills/ulw-execute/SKILL.md +1 -1
  122. package/dist/tui.js +30 -27
  123. package/package.json +28 -26
  124. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  125. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  126. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  127. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  128. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  129. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  130. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  131. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  132. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  133. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
  134. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  135. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  136. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  137. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  138. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  139. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  140. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  141. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  142. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  143. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  144. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  145. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  146. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  147. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  148. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
  149. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +3 -3
  150. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  151. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  152. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  153. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  154. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  155. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  156. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  157. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  158. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  159. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  160. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  161. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  162. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  163. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  164. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  165. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  166. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  167. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  168. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  169. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  170. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  171. package/packages/omo-codex/plugin/package-lock.json +12 -12
  172. package/packages/omo-codex/plugin/package.json +1 -1
  173. package/packages/omo-codex/plugin/skills/browser/SKILL.md +4 -1
  174. package/packages/omo-codex/plugin/skills/browser/references/commands.md +5 -2
  175. package/packages/omo-codex/plugin/skills/browser/references/desktop.md +1 -0
  176. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +2 -0
  177. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
  178. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/network.md +10 -5
  179. package/packages/omo-codex/plugin/skills/browser/references/recipes/1password.md +2 -0
  180. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +11 -11
  181. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +4 -4
  182. package/packages/omo-codex/plugin/skills/debugging/SKILL.md +1 -1
  183. package/packages/omo-codex/plugin/skills/git/SKILL.md +62 -0
  184. package/packages/omo-codex/plugin/skills/git/agents/openai.yaml +13 -0
  185. package/packages/omo-codex/plugin/skills/github/SKILL.md +94 -0
  186. package/packages/omo-codex/plugin/skills/github/agents/openai.yaml +2 -0
  187. package/packages/omo-codex/plugin/skills/github/references/branch-rules.md +129 -0
  188. package/packages/omo-codex/plugin/skills/github/references/evidence-attachments.md +16 -0
  189. package/packages/omo-codex/plugin/skills/github/references/repo-setup.md +152 -0
  190. package/packages/omo-codex/plugin/skills/github/references/waiting.md +52 -0
  191. package/packages/omo-codex/plugin/skills/github/references/workflows.md +161 -0
  192. package/packages/omo-codex/plugin/skills/github/scripts/cli.ts +8 -0
  193. package/packages/omo-codex/plugin/skills/github/scripts/package.json +12 -0
  194. package/packages/omo-codex/plugin/skills/github/scripts/sdk.ts +11 -0
  195. package/packages/omo-codex/plugin/skills/github/scripts/src/account.ts +243 -0
  196. package/packages/omo-codex/plugin/skills/github/scripts/src/actions-write.ts +86 -0
  197. package/packages/omo-codex/plugin/skills/github/scripts/src/actions.ts +210 -0
  198. package/packages/omo-codex/plugin/skills/github/scripts/src/attestations.ts +136 -0
  199. package/packages/omo-codex/plugin/skills/github/scripts/src/blake2b.ts +102 -0
  200. package/packages/omo-codex/plugin/skills/github/scripts/src/branch-protection.ts +192 -0
  201. package/packages/omo-codex/plugin/skills/github/scripts/src/caches.ts +105 -0
  202. package/packages/omo-codex/plugin/skills/github/scripts/src/checks.ts +107 -0
  203. package/packages/omo-codex/plugin/skills/github/scripts/src/codespaces.ts +230 -0
  204. package/packages/omo-codex/plugin/skills/github/scripts/src/conversation-lock.ts +50 -0
  205. package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-list.ts +126 -0
  206. package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-lookup.ts +127 -0
  207. package/packages/omo-codex/plugin/skills/github/scripts/src/discussions.ts +234 -0
  208. package/packages/omo-codex/plugin/skills/github/scripts/src/env.ts +100 -0
  209. package/packages/omo-codex/plugin/skills/github/scripts/src/errors.ts +79 -0
  210. package/packages/omo-codex/plugin/skills/github/scripts/src/fields.ts +27 -0
  211. package/packages/omo-codex/plugin/skills/github/scripts/src/gist-shape.ts +58 -0
  212. package/packages/omo-codex/plugin/skills/github/scripts/src/gists-write.ts +130 -0
  213. package/packages/omo-codex/plugin/skills/github/scripts/src/gists.ts +118 -0
  214. package/packages/omo-codex/plugin/skills/github/scripts/src/git-auth.ts +46 -0
  215. package/packages/omo-codex/plugin/skills/github/scripts/src/http.ts +159 -0
  216. package/packages/omo-codex/plugin/skills/github/scripts/src/issue-develop.ts +118 -0
  217. package/packages/omo-codex/plugin/skills/github/scripts/src/issues-extra.ts +135 -0
  218. package/packages/omo-codex/plugin/skills/github/scripts/src/issues-write.ts +174 -0
  219. package/packages/omo-codex/plugin/skills/github/scripts/src/issues.ts +156 -0
  220. package/packages/omo-codex/plugin/skills/github/scripts/src/keys.ts +176 -0
  221. package/packages/omo-codex/plugin/skills/github/scripts/src/labels.ts +209 -0
  222. package/packages/omo-codex/plugin/skills/github/scripts/src/merge.ts +115 -0
  223. package/packages/omo-codex/plugin/skills/github/scripts/src/poly1305.ts +22 -0
  224. package/packages/omo-codex/plugin/skills/github/scripts/src/pr-checkout.ts +92 -0
  225. package/packages/omo-codex/plugin/skills/github/scripts/src/pr-view.ts +106 -0
  226. package/packages/omo-codex/plugin/skills/github/scripts/src/project-fields.ts +144 -0
  227. package/packages/omo-codex/plugin/skills/github/scripts/src/project-item-edit.ts +153 -0
  228. package/packages/omo-codex/plugin/skills/github/scripts/src/project-items.ts +191 -0
  229. package/packages/omo-codex/plugin/skills/github/scripts/src/project-links.ts +104 -0
  230. package/packages/omo-codex/plugin/skills/github/scripts/src/project-ref.ts +145 -0
  231. package/packages/omo-codex/plugin/skills/github/scripts/src/project-state.ts +99 -0
  232. package/packages/omo-codex/plugin/skills/github/scripts/src/projects.ts +158 -0
  233. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-extra.ts +165 -0
  234. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-read.ts +176 -0
  235. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-review.ts +206 -0
  236. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-write.ts +187 -0
  237. package/packages/omo-codex/plugin/skills/github/scripts/src/raw.ts +78 -0
  238. package/packages/omo-codex/plugin/skills/github/scripts/src/read.ts +77 -0
  239. package/packages/omo-codex/plugin/skills/github/scripts/src/release-assets.ts +111 -0
  240. package/packages/omo-codex/plugin/skills/github/scripts/src/release-download.ts +151 -0
  241. package/packages/omo-codex/plugin/skills/github/scripts/src/release-write.ts +197 -0
  242. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-admin.ts +112 -0
  243. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-content.ts +187 -0
  244. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-create.ts +139 -0
  245. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-extras.ts +217 -0
  246. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-list.ts +143 -0
  247. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-settings.ts +176 -0
  248. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-sync.ts +81 -0
  249. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-url.ts +104 -0
  250. package/packages/omo-codex/plugin/skills/github/scripts/src/repos.ts +87 -0
  251. package/packages/omo-codex/plugin/skills/github/scripts/src/ruleset-shape.ts +96 -0
  252. package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets-write.ts +124 -0
  253. package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets.ts +80 -0
  254. package/packages/omo-codex/plugin/skills/github/scripts/src/run-download.ts +88 -0
  255. package/packages/omo-codex/plugin/skills/github/scripts/src/salsa20.ts +97 -0
  256. package/packages/omo-codex/plugin/skills/github/scripts/src/scopes.ts +165 -0
  257. package/packages/omo-codex/plugin/skills/github/scripts/src/sealed-box.ts +75 -0
  258. package/packages/omo-codex/plugin/skills/github/scripts/src/search-commits.ts +114 -0
  259. package/packages/omo-codex/plugin/skills/github/scripts/src/search.ts +116 -0
  260. package/packages/omo-codex/plugin/skills/github/scripts/src/secrets.ts +131 -0
  261. package/packages/omo-codex/plugin/skills/github/scripts/src/snappy.ts +57 -0
  262. package/packages/omo-codex/plugin/skills/github/scripts/src/status-search.ts +55 -0
  263. package/packages/omo-codex/plugin/skills/github/scripts/src/transfer.ts +97 -0
  264. package/packages/omo-codex/plugin/skills/github/scripts/src/types.ts +75 -0
  265. package/packages/omo-codex/plugin/skills/github/scripts/src/variables.ts +86 -0
  266. package/packages/omo-codex/plugin/skills/github/scripts/src/wait.ts +164 -0
  267. package/packages/omo-codex/plugin/skills/github/scripts/src/wire.ts +159 -0
  268. package/packages/omo-codex/plugin/skills/github/scripts/src/workflows.ts +144 -0
  269. package/packages/omo-codex/plugin/skills/github/scripts/src/zip.ts +104 -0
  270. package/packages/omo-codex/plugin/skills/github/scripts/surface.ts +106 -0
  271. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
  272. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/cli.ts +203 -0
  273. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/flags.ts +195 -0
  274. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/help.ts +89 -0
  275. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/http.ts +180 -0
  276. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/index.ts +44 -0
  277. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/mcp.ts +241 -0
  278. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/schema.ts +200 -0
  279. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/stdio.ts +54 -0
  280. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/surface.ts +250 -0
  281. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/tools.ts +80 -0
  282. package/packages/omo-codex/plugin/skills/programming/SKILL.md +1 -1
  283. package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +1 -1
  284. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
  285. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +3 -3
  286. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +1 -1
  287. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -1
  288. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +5 -5
  289. package/packages/omo-codex/scripts/install-dist/install-local.mjs +20 -15
  290. package/packages/shared-skills/skills/browser/SKILL.md +4 -1
  291. package/packages/shared-skills/skills/browser/references/commands.md +5 -2
  292. package/packages/shared-skills/skills/browser/references/desktop.md +1 -0
  293. package/packages/shared-skills/skills/browser/references/owned-engine/README.md +2 -0
  294. package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
  295. package/packages/shared-skills/skills/browser/references/owned-engine/network.md +10 -5
  296. package/packages/shared-skills/skills/browser/references/recipes/1password.md +2 -0
  297. package/packages/shared-skills/skills/browser/runtime/omowright/index.js +11 -11
  298. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +4 -4
  299. package/packages/shared-skills/skills/debugging/SKILL.md +1 -1
  300. package/packages/shared-skills/skills/git/SKILL.md +62 -0
  301. package/packages/shared-skills/skills/git/agents/openai.yaml +13 -0
  302. package/packages/shared-skills/skills/github/SKILL.md +94 -0
  303. package/packages/shared-skills/skills/github/references/branch-rules.md +129 -0
  304. package/packages/shared-skills/skills/github/references/evidence-attachments.md +16 -0
  305. package/packages/shared-skills/skills/github/references/repo-setup.md +152 -0
  306. package/packages/shared-skills/skills/github/references/waiting.md +52 -0
  307. package/packages/shared-skills/skills/github/references/workflows.md +161 -0
  308. package/packages/shared-skills/skills/github/scripts/cli.ts +8 -0
  309. package/packages/shared-skills/skills/github/scripts/package.json +12 -0
  310. package/packages/shared-skills/skills/github/scripts/sdk.ts +11 -0
  311. package/packages/shared-skills/skills/github/scripts/src/account.ts +243 -0
  312. package/packages/shared-skills/skills/github/scripts/src/actions-write.ts +86 -0
  313. package/packages/shared-skills/skills/github/scripts/src/actions.ts +210 -0
  314. package/packages/shared-skills/skills/github/scripts/src/attestations.ts +136 -0
  315. package/packages/shared-skills/skills/github/scripts/src/blake2b.ts +102 -0
  316. package/packages/shared-skills/skills/github/scripts/src/branch-protection.ts +192 -0
  317. package/packages/shared-skills/skills/github/scripts/src/caches.ts +105 -0
  318. package/packages/shared-skills/skills/github/scripts/src/checks.ts +107 -0
  319. package/packages/shared-skills/skills/github/scripts/src/codespaces.ts +230 -0
  320. package/packages/shared-skills/skills/github/scripts/src/conversation-lock.ts +50 -0
  321. package/packages/shared-skills/skills/github/scripts/src/discussion-list.ts +126 -0
  322. package/packages/shared-skills/skills/github/scripts/src/discussion-lookup.ts +127 -0
  323. package/packages/shared-skills/skills/github/scripts/src/discussions.ts +234 -0
  324. package/packages/shared-skills/skills/github/scripts/src/env.ts +100 -0
  325. package/packages/shared-skills/skills/github/scripts/src/errors.ts +79 -0
  326. package/packages/shared-skills/skills/github/scripts/src/fields.ts +27 -0
  327. package/packages/shared-skills/skills/github/scripts/src/gist-shape.ts +58 -0
  328. package/packages/shared-skills/skills/github/scripts/src/gists-write.ts +130 -0
  329. package/packages/shared-skills/skills/github/scripts/src/gists.ts +118 -0
  330. package/packages/shared-skills/skills/github/scripts/src/git-auth.ts +46 -0
  331. package/packages/shared-skills/skills/github/scripts/src/http.ts +159 -0
  332. package/packages/shared-skills/skills/github/scripts/src/issue-develop.ts +118 -0
  333. package/packages/shared-skills/skills/github/scripts/src/issues-extra.ts +135 -0
  334. package/packages/shared-skills/skills/github/scripts/src/issues-write.ts +174 -0
  335. package/packages/shared-skills/skills/github/scripts/src/issues.ts +156 -0
  336. package/packages/shared-skills/skills/github/scripts/src/keys.ts +176 -0
  337. package/packages/shared-skills/skills/github/scripts/src/labels.ts +209 -0
  338. package/packages/shared-skills/skills/github/scripts/src/merge.ts +115 -0
  339. package/packages/shared-skills/skills/github/scripts/src/poly1305.ts +22 -0
  340. package/packages/shared-skills/skills/github/scripts/src/pr-checkout.ts +92 -0
  341. package/packages/shared-skills/skills/github/scripts/src/pr-view.ts +106 -0
  342. package/packages/shared-skills/skills/github/scripts/src/project-fields.ts +144 -0
  343. package/packages/shared-skills/skills/github/scripts/src/project-item-edit.ts +153 -0
  344. package/packages/shared-skills/skills/github/scripts/src/project-items.ts +191 -0
  345. package/packages/shared-skills/skills/github/scripts/src/project-links.ts +104 -0
  346. package/packages/shared-skills/skills/github/scripts/src/project-ref.ts +145 -0
  347. package/packages/shared-skills/skills/github/scripts/src/project-state.ts +99 -0
  348. package/packages/shared-skills/skills/github/scripts/src/projects.ts +158 -0
  349. package/packages/shared-skills/skills/github/scripts/src/pulls-extra.ts +165 -0
  350. package/packages/shared-skills/skills/github/scripts/src/pulls-read.ts +176 -0
  351. package/packages/shared-skills/skills/github/scripts/src/pulls-review.ts +206 -0
  352. package/packages/shared-skills/skills/github/scripts/src/pulls-write.ts +187 -0
  353. package/packages/shared-skills/skills/github/scripts/src/raw.ts +78 -0
  354. package/packages/shared-skills/skills/github/scripts/src/read.ts +77 -0
  355. package/packages/shared-skills/skills/github/scripts/src/release-assets.ts +111 -0
  356. package/packages/shared-skills/skills/github/scripts/src/release-download.ts +151 -0
  357. package/packages/shared-skills/skills/github/scripts/src/release-write.ts +197 -0
  358. package/packages/shared-skills/skills/github/scripts/src/repo-admin.ts +112 -0
  359. package/packages/shared-skills/skills/github/scripts/src/repo-content.ts +187 -0
  360. package/packages/shared-skills/skills/github/scripts/src/repo-create.ts +139 -0
  361. package/packages/shared-skills/skills/github/scripts/src/repo-extras.ts +217 -0
  362. package/packages/shared-skills/skills/github/scripts/src/repo-list.ts +143 -0
  363. package/packages/shared-skills/skills/github/scripts/src/repo-settings.ts +176 -0
  364. package/packages/shared-skills/skills/github/scripts/src/repo-sync.ts +81 -0
  365. package/packages/shared-skills/skills/github/scripts/src/repo-url.ts +104 -0
  366. package/packages/shared-skills/skills/github/scripts/src/repos.ts +87 -0
  367. package/packages/shared-skills/skills/github/scripts/src/ruleset-shape.ts +96 -0
  368. package/packages/shared-skills/skills/github/scripts/src/rulesets-write.ts +124 -0
  369. package/packages/shared-skills/skills/github/scripts/src/rulesets.ts +80 -0
  370. package/packages/shared-skills/skills/github/scripts/src/run-download.ts +88 -0
  371. package/packages/shared-skills/skills/github/scripts/src/salsa20.ts +97 -0
  372. package/packages/shared-skills/skills/github/scripts/src/scopes.ts +165 -0
  373. package/packages/shared-skills/skills/github/scripts/src/sealed-box.ts +75 -0
  374. package/packages/shared-skills/skills/github/scripts/src/search-commits.ts +114 -0
  375. package/packages/shared-skills/skills/github/scripts/src/search.ts +116 -0
  376. package/packages/shared-skills/skills/github/scripts/src/secrets.ts +131 -0
  377. package/packages/shared-skills/skills/github/scripts/src/snappy.ts +57 -0
  378. package/packages/shared-skills/skills/github/scripts/src/status-search.ts +55 -0
  379. package/packages/shared-skills/skills/github/scripts/src/transfer.ts +97 -0
  380. package/packages/shared-skills/skills/github/scripts/src/types.ts +75 -0
  381. package/packages/shared-skills/skills/github/scripts/src/variables.ts +86 -0
  382. package/packages/shared-skills/skills/github/scripts/src/wait.ts +164 -0
  383. package/packages/shared-skills/skills/github/scripts/src/wire.ts +159 -0
  384. package/packages/shared-skills/skills/github/scripts/src/workflows.ts +144 -0
  385. package/packages/shared-skills/skills/github/scripts/src/zip.ts +104 -0
  386. package/packages/shared-skills/skills/github/scripts/surface.ts +106 -0
  387. package/packages/shared-skills/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
  388. package/packages/shared-skills/skills/github/scripts/vendor/surface/cli.ts +203 -0
  389. package/packages/shared-skills/skills/github/scripts/vendor/surface/flags.ts +195 -0
  390. package/packages/shared-skills/skills/github/scripts/vendor/surface/help.ts +89 -0
  391. package/packages/shared-skills/skills/github/scripts/vendor/surface/http.ts +180 -0
  392. package/packages/shared-skills/skills/github/scripts/vendor/surface/index.ts +44 -0
  393. package/packages/shared-skills/skills/github/scripts/vendor/surface/mcp.ts +241 -0
  394. package/packages/shared-skills/skills/github/scripts/vendor/surface/schema.ts +200 -0
  395. package/packages/shared-skills/skills/github/scripts/vendor/surface/stdio.ts +54 -0
  396. package/packages/shared-skills/skills/github/scripts/vendor/surface/surface.ts +250 -0
  397. package/packages/shared-skills/skills/github/scripts/vendor/surface/tools.ts +80 -0
  398. package/packages/shared-skills/skills/programming/SKILL.md +1 -1
  399. package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
  400. package/dist/skills/git-master/SKILL.md +0 -114
  401. package/dist/skills/git-master/agents/openai.yaml +0 -13
  402. package/packages/omo-codex/plugin/skills/git-master/SKILL.md +0 -114
  403. package/packages/omo-codex/plugin/skills/git-master/agents/openai.yaml +0 -13
  404. package/packages/shared-skills/skills/git-master/SKILL.md +0 -114
  405. package/packages/shared-skills/skills/git-master/agents/openai.yaml +0 -13
@@ -0,0 +1,158 @@
1
+ // Projects (v2) themselves: list, view, create, delete and copy; state changes and links are spread in.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { irreversible, limitField, reads, writes } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import { linkOp } from "./project-links.ts";
6
+ import {
7
+ collect,
8
+ declare,
9
+ missing,
10
+ mutate,
11
+ ownerField,
12
+ ownerRoot,
13
+ pageInfo,
14
+ PROJECT_FIELDS as FIELDS,
15
+ projectGraphql,
16
+ projectNumberField,
17
+ projectQuery,
18
+ projectSummary as project,
19
+ resolveOwner,
20
+ resolveProject,
21
+ } from "./project-ref.ts";
22
+ import { projectStateOps } from "./project-state.ts";
23
+ import { at, bool, num, optStr, str } from "./read.ts";
24
+
25
+ export const projectOps = (gh: GitHub) => ({
26
+ list: op({
27
+ description:
28
+ "Projects of a user or organization, open ones only unless `closed` is true. Replaces `gh project list`.",
29
+ input: s.object({
30
+ owner: ownerField,
31
+ closed: s.optional(
32
+ s.boolean({ description: "Include closed projects." }),
33
+ ),
34
+ limit: limitField(30),
35
+ }),
36
+ annotations: reads,
37
+ run: async ({ owner, closed, limit }) => {
38
+ const o = ownerRoot(owner);
39
+ const query = `query${declare("$first: Int!", "$after: String", o.decl)} { owner: ${o.root} { login ... on ProjectV2Owner { projectsV2(first: $first, after: $after) { nodes { ${FIELDS} } ${pageInfo} } } } }`;
40
+ let login = owner;
41
+ const raw = await collect(
42
+ limit ?? 30,
43
+ async (first, after) => {
44
+ const data = await projectGraphql(gh, query, {
45
+ first,
46
+ after,
47
+ ...o.vars,
48
+ });
49
+ if (at(data, "owner") == null) throw missing(`owner ${owner}`);
50
+ login = str(data, "owner", "login");
51
+ return at(data, "owner", "projectsV2");
52
+ },
53
+ (p) => closed === true || !bool(p, "closed"),
54
+ );
55
+ return { owner: login, items: raw.map(project) };
56
+ },
57
+ }),
58
+ view: op({
59
+ description:
60
+ "One project with its readme and item and field counts. Replaces `gh project view`.",
61
+ input: s.object({ owner: ownerField, number: projectNumberField }),
62
+ annotations: reads,
63
+ run: async ({ owner, number }) => {
64
+ const { login, project: p } = await projectQuery(
65
+ gh,
66
+ owner,
67
+ number,
68
+ `${FIELDS} readme items { totalCount } fields { totalCount }`,
69
+ );
70
+ return {
71
+ owner: login,
72
+ ...project(p),
73
+ readme: optStr(p, "readme"),
74
+ itemCount: num(p, "items", "totalCount"),
75
+ fieldCount: num(p, "fields", "totalCount"),
76
+ };
77
+ },
78
+ }),
79
+ create: op({
80
+ description:
81
+ "Create an empty project under a user or organization. Replaces `gh project create`.",
82
+ input: s.object({ owner: ownerField, title: s.string() }),
83
+ annotations: writes,
84
+ run: async ({ owner, title }) => {
85
+ const o = await resolveOwner(gh, owner);
86
+ const result = await mutate(
87
+ gh,
88
+ "createProjectV2",
89
+ { ownerId: o.id, title },
90
+ `projectV2 { ${FIELDS} }`,
91
+ );
92
+ return { owner: o.login, ...project(at(result, "projectV2")) };
93
+ },
94
+ }),
95
+ delete: op({
96
+ description:
97
+ "Delete a project with all its items and fields; this cannot be undone. `confirm` must equal the project's title. Replaces `gh project delete`.",
98
+ input: s.object({
99
+ owner: ownerField,
100
+ number: projectNumberField,
101
+ confirm: s.string({ description: "The project's exact title." }),
102
+ }),
103
+ annotations: irreversible,
104
+ run: async ({ owner, number, confirm }) => {
105
+ const p = await resolveProject(gh, owner, number);
106
+ if (confirm !== p.title)
107
+ throw new SurfaceError(
108
+ "usage",
109
+ `confirm "${confirm}" does not match the project title "${p.title}"`,
110
+ "pass the project's exact title as confirm",
111
+ );
112
+ await mutate(
113
+ gh,
114
+ "deleteProjectV2",
115
+ { projectId: p.id },
116
+ "projectV2 { id }",
117
+ );
118
+ return { id: p.id, title: p.title, deleted: true };
119
+ },
120
+ }),
121
+ copy: op({
122
+ description:
123
+ "Copy a project's fields and views (and draft issues with `drafts`) into a new project. Replaces `gh project copy`.",
124
+ input: s.object({
125
+ owner: s.string({
126
+ description: 'Source project owner login, or "@me".',
127
+ }),
128
+ number: projectNumberField,
129
+ targetOwner: s.optional(
130
+ s.string({ description: "New project owner (default: owner)." }),
131
+ ),
132
+ title: s.string({ description: "Title for the new project." }),
133
+ drafts: s.optional(
134
+ s.boolean({ description: "Include draft issues when copying." }),
135
+ ),
136
+ }),
137
+ annotations: writes,
138
+ run: async ({ owner, number, targetOwner, title, drafts }) => {
139
+ const source = await resolveProject(gh, owner, number);
140
+ const target = await resolveOwner(gh, targetOwner ?? owner);
141
+ const result = await mutate(
142
+ gh,
143
+ "copyProjectV2",
144
+ {
145
+ projectId: source.id,
146
+ ownerId: target.id,
147
+ title,
148
+ includeDraftIssues: drafts === true,
149
+ },
150
+ `projectV2 { ${FIELDS} }`,
151
+ );
152
+ return { owner: target.login, ...project(at(result, "projectV2")) };
153
+ },
154
+ }),
155
+ link: linkOp(gh, "link"),
156
+ unlink: linkOp(gh, "unlink"),
157
+ ...projectStateOps(gh),
158
+ });
@@ -0,0 +1,165 @@
1
+ // Pull request operations beyond create/edit/merge: locks, branch updates, reverts, status and checkout.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { lockOps } from "./conversation-lock.ts";
4
+ import { limitField, numberField, reads, repoField, writes } from "./fields.ts";
5
+ import type { GitHub } from "./http.ts";
6
+ import { checkoutOp } from "./pr-checkout.ts";
7
+ import { pullNodeId } from "./pulls-read.ts";
8
+ import { at, bool, nodes, num, optStr, str } from "./read.ts";
9
+ import { byNumber, statusSearch } from "./status-search.ts";
10
+
11
+ const PULL = `fragment P on PullRequest{number title url state isDraft headRefName author{login} updatedAt reviewDecision
12
+ mergeable @include(if:$conflicts) mergeStateStatus @include(if:$conflicts) commits(last:1){nodes{commit{statusCheckRollup{state}}}}}`;
13
+
14
+ const statusPull = (conflicts: boolean) => (p: unknown) => ({
15
+ number: num(p, "number"),
16
+ title: str(p, "title"),
17
+ url: str(p, "url"),
18
+ state: str(p, "state"),
19
+ draft: bool(p, "isDraft"),
20
+ head: str(p, "headRefName"),
21
+ author: optStr(p, "author", "login"),
22
+ updatedAt: str(p, "updatedAt"),
23
+ checks: optStr(
24
+ nodes(p, "commits")[0],
25
+ "commit",
26
+ "statusCheckRollup",
27
+ "state",
28
+ ),
29
+ reviewDecision: optStr(p, "reviewDecision"),
30
+ ...(conflicts
31
+ ? {
32
+ mergeable: optStr(p, "mergeable"),
33
+ mergeState: optStr(p, "mergeStateStatus"),
34
+ }
35
+ : {}),
36
+ });
37
+
38
+ export const pullExtraOps = (gh: GitHub) => ({
39
+ ...lockOps(gh, "pr"),
40
+ updateBranch: op({
41
+ description:
42
+ "Bring a PR branch up to date with its base by merging the base in, or with rebase by rebasing onto it; GitHub applies it asynchronously. With expectedHeadSha a moved head is refused. Replaces `gh pr update-branch`.",
43
+ input: s.object({
44
+ repo: repoField,
45
+ number: numberField,
46
+ rebase: s.optional(s.boolean()),
47
+ expectedHeadSha: s.optional(
48
+ s.string({ description: "Refuse unless the PR head is this commit." }),
49
+ ),
50
+ }),
51
+ annotations: writes,
52
+ run: async ({ repo, number, rebase, expectedHeadSha }) => {
53
+ const r = await gh.repo(repo);
54
+ const pr = await pullNodeId(gh, r.full, number);
55
+ const method = rebase === true ? "REBASE" : "MERGE";
56
+ await gh
57
+ .graphql(
58
+ `mutation($id:ID!,$method:PullRequestBranchUpdateMethod!,$sha:GitObjectID){updatePullRequestBranch(input:{pullRequestId:$id,updateMethod:$method,expectedHeadOid:$sha}){pullRequest{number}}}`,
59
+ {
60
+ id: pr.id,
61
+ method,
62
+ ...(expectedHeadSha === undefined ? {} : { sha: expectedHeadSha }),
63
+ },
64
+ )
65
+ .catch((error: unknown) => {
66
+ // GitHub reports a moved head as a plain GraphQL error; callers branch on `conflict`.
67
+ if (
68
+ error instanceof SurfaceError &&
69
+ error.message.includes("head sha didn't match")
70
+ )
71
+ throw new SurfaceError(
72
+ "conflict",
73
+ error.message,
74
+ "the PR head moved; re-read pr view and pass the new head",
75
+ );
76
+ throw error;
77
+ });
78
+ return { repo: r.full, number, method: method.toLowerCase() };
79
+ },
80
+ }),
81
+ revert: op({
82
+ description:
83
+ "Open a pull request that reverts a merged PR; returns the new PR's number and url. Replaces `gh pr revert`.",
84
+ input: s.object({
85
+ repo: repoField,
86
+ number: numberField,
87
+ title: s.optional(s.string()),
88
+ body: s.optional(s.string()),
89
+ draft: s.optional(s.boolean()),
90
+ }),
91
+ annotations: writes,
92
+ run: async ({ repo, number, title, body, draft }) => {
93
+ const r = await gh.repo(repo);
94
+ const pr = await pullNodeId(gh, r.full, number);
95
+ const data = await gh.graphql(
96
+ `mutation($id:ID!,$title:String,$body:String,$draft:Boolean){revertPullRequest(input:{pullRequestId:$id,title:$title,body:$body,draft:$draft}){revertPullRequest{number url}}}`,
97
+ Object.fromEntries(
98
+ Object.entries({ id: pr.id, title, body, draft }).filter(
99
+ ([, v]) => v !== undefined,
100
+ ),
101
+ ),
102
+ );
103
+ const revert = at(data, "revertPullRequest", "revertPullRequest");
104
+ return {
105
+ repo: r.full,
106
+ reverted: number,
107
+ number: num(revert, "number"),
108
+ url: str(revert, "url"),
109
+ };
110
+ },
111
+ }),
112
+ status: op({
113
+ description:
114
+ "Open PRs in the repo created by the authenticated user or requesting their review, plus the newest PR for `branch` when given, each with checks rollup state, review decision, mergeability with `conflicts`, and the reasons it matched. Replaces `gh pr status`.",
115
+ input: s.object({
116
+ repo: repoField,
117
+ branch: s.optional(
118
+ s.string({
119
+ description:
120
+ "Head branch whose PR to include (the SDK does not read the local checkout).",
121
+ }),
122
+ ),
123
+ conflicts: s.optional(s.boolean()),
124
+ limit: limitField(30),
125
+ }),
126
+ annotations: reads,
127
+ run: async ({ repo, branch, conflicts, limit }) => {
128
+ const r = await gh.repo(repo);
129
+ const scope = `repo:${r.full} is:pr is:open`;
130
+ const { data, user, hits } = await statusSearch(gh, {
131
+ groups: {
132
+ created: `${scope} author:@me`,
133
+ reviewRequested: `${scope} review-requested:@me`,
134
+ },
135
+ select: "...P",
136
+ limit: limit ?? 30,
137
+ declare:
138
+ ",$conflicts:Boolean!,$owner:String!,$name:String!,$branch:String!,$hasBranch:Boolean!",
139
+ extra:
140
+ "branch:repository(owner:$owner,name:$name) @include(if:$hasBranch){pullRequests(headRefName:$branch,first:1,orderBy:{field:CREATED_AT,direction:DESC}){nodes{...P}}}",
141
+ fragments: PULL,
142
+ variables: {
143
+ conflicts: conflicts === true,
144
+ owner: r.owner,
145
+ name: r.name,
146
+ branch: branch ?? "",
147
+ hasBranch: branch !== undefined,
148
+ },
149
+ });
150
+ const branchHits = nodes(data, "branch", "pullRequests").map((node) => ({
151
+ reason: "branch",
152
+ node,
153
+ }));
154
+ return {
155
+ repo: r.full,
156
+ user,
157
+ items: byNumber(
158
+ [...branchHits, ...hits],
159
+ statusPull(conflicts === true),
160
+ ),
161
+ };
162
+ },
163
+ }),
164
+ checkout: checkoutOp(gh),
165
+ });
@@ -0,0 +1,176 @@
1
+ import { op, s } from "../vendor/surface/index.ts";
2
+ import { fetchChecks } from "./checks.ts";
3
+ import { pullViewOp } from "./pr-view.ts";
4
+ import { enc, limitField, numberField, reads, repoField } from "./fields.ts";
5
+ import type { GitHub } from "./http.ts";
6
+ import { bool, num, optStr, str } from "./read.ts";
7
+ import { searchRaw } from "./search.ts";
8
+
9
+ const pullFromRest = (p: unknown) => ({
10
+ number: num(p, "number"),
11
+ title: str(p, "title"),
12
+ state: str(p, "state"),
13
+ draft: bool(p, "draft"),
14
+ author: optStr(p, "user", "login"),
15
+ head: optStr(p, "head", "ref"),
16
+ base: optStr(p, "base", "ref"),
17
+ url: str(p, "html_url"),
18
+ createdAt: optStr(p, "created_at"),
19
+ updatedAt: optStr(p, "updated_at"),
20
+ });
21
+
22
+ export const pullReadOps = (gh: GitHub) => ({
23
+ view: pullViewOp(gh),
24
+ list: op({
25
+ description:
26
+ "List pull requests. Plain state/base/head filters use the pulls API; author, label, merged-only or free text go through search. Replaces `gh pr list`.",
27
+ input: s.object({
28
+ repo: repoField,
29
+ state: s.optional(s.enum(["open", "closed", "merged", "all"])),
30
+ base: s.optional(s.string({ description: "Base branch." })),
31
+ head: s.optional(
32
+ s.string({ description: "Head branch (owner:branch for forks)." }),
33
+ ),
34
+ author: s.optional(s.string()),
35
+ label: s.optional(s.string()),
36
+ search: s.optional(
37
+ s.string({ description: "Extra GitHub search qualifiers or words." }),
38
+ ),
39
+ limit: limitField(30),
40
+ }),
41
+ annotations: reads,
42
+ run: async ({ repo, state, base, head, author, label, search, limit }) => {
43
+ const r = await gh.repo(repo);
44
+ const max = limit ?? 30;
45
+ if (
46
+ author !== undefined ||
47
+ label !== undefined ||
48
+ search !== undefined ||
49
+ state === "merged"
50
+ ) {
51
+ const q = [
52
+ `repo:${r.full}`,
53
+ "is:pr",
54
+ state === "merged"
55
+ ? "is:merged"
56
+ : state === "all"
57
+ ? ""
58
+ : `is:${state ?? "open"}`,
59
+ base === undefined ? "" : `base:${base}`,
60
+ head === undefined ? "" : `head:${head}`,
61
+ author === undefined ? "" : `author:${author}`,
62
+ label === undefined ? "" : `label:"${label}"`,
63
+ search ?? "",
64
+ ];
65
+ return {
66
+ repo: r.full,
67
+ items: (
68
+ await searchRaw(gh, q.filter(Boolean).join(" "), max)
69
+ ).raw.map(pullFromRest),
70
+ };
71
+ }
72
+ const raw = await gh.list(`repos/${r.full}/pulls`, max, {
73
+ query: {
74
+ state: state ?? "open",
75
+ base,
76
+ head:
77
+ head === undefined || head.includes(":")
78
+ ? head
79
+ : `${r.owner}:${head}`,
80
+ sort: "updated",
81
+ direction: "desc",
82
+ },
83
+ });
84
+ return { repo: r.full, items: raw.map(pullFromRest) };
85
+ },
86
+ }),
87
+ checks: op({
88
+ description:
89
+ "Checks on a PR's head commit: each check run and commit status with bucket pass|fail|pending|skipping|cancel, required flag and Actions run id, plus counts. Replaces `gh pr checks`.",
90
+ input: s.object({
91
+ repo: repoField,
92
+ number: numberField,
93
+ only: s.optional(
94
+ s.array(s.enum(["pass", "fail", "pending", "skipping", "cancel"]), {
95
+ description: "Return only checks in these buckets.",
96
+ }),
97
+ ),
98
+ requiredOnly: s.optional(s.boolean()),
99
+ }),
100
+ annotations: reads,
101
+ run: async ({ repo, number, only, requiredOnly }) => {
102
+ const r = await gh.repo(repo);
103
+ const all = await fetchChecks(gh, r, number);
104
+ const checks = all.checks.filter(
105
+ (c) =>
106
+ (only === undefined || only.includes(c.bucket)) &&
107
+ (requiredOnly !== true || c.required),
108
+ );
109
+ return { repo: r.full, number, ...all, checks };
110
+ },
111
+ }),
112
+ diff: op({
113
+ description:
114
+ "Unified diff of a PR, truncated at maxBytes. Use `files` first when you only need the changed paths. Replaces `gh pr diff`.",
115
+ input: s.object({
116
+ repo: repoField,
117
+ number: numberField,
118
+ maxBytes: s.optional(s.integer({ description: "Default 200000." })),
119
+ }),
120
+ annotations: reads,
121
+ run: async ({ repo, number, maxBytes }) => {
122
+ const r = await gh.repo(repo);
123
+ const diff = await gh.text(
124
+ `repos/${r.full}/pulls/${number}`,
125
+ "application/vnd.github.diff",
126
+ );
127
+ const cap = maxBytes ?? 200_000;
128
+ return {
129
+ repo: r.full,
130
+ number,
131
+ bytes: diff.length,
132
+ truncated: diff.length > cap,
133
+ diff: diff.slice(0, cap),
134
+ };
135
+ },
136
+ }),
137
+ files: op({
138
+ description:
139
+ "Changed files of a PR with status and line counts; patches only when asked. Replaces `gh pr diff --name-only` / `gh pr view --json files`.",
140
+ input: s.object({
141
+ repo: repoField,
142
+ number: numberField,
143
+ patch: s.optional(s.boolean()),
144
+ limit: limitField(300),
145
+ }),
146
+ annotations: reads,
147
+ run: async ({ repo, number, patch, limit }) => {
148
+ const r = await gh.repo(repo);
149
+ const raw = await gh.list(
150
+ `repos/${r.full}/pulls/${number}/files`,
151
+ limit ?? 300,
152
+ );
153
+ return raw.map((f) => ({
154
+ path: str(f, "filename"),
155
+ status: str(f, "status"),
156
+ additions: num(f, "additions"),
157
+ deletions: num(f, "deletions"),
158
+ previousPath: optStr(f, "previous_filename"),
159
+ ...(patch === true ? { patch: optStr(f, "patch") } : {}),
160
+ }));
161
+ },
162
+ }),
163
+ });
164
+
165
+ export const pullNodeId = async (
166
+ gh: GitHub,
167
+ full: string,
168
+ number: number,
169
+ ): Promise<{ id: string; head: string; headRepo: string | null }> => {
170
+ const p = await gh.rest("GET", `repos/${full}/pulls/${enc(String(number))}`);
171
+ return {
172
+ id: str(p, "node_id"),
173
+ head: str(p, "head", "ref"),
174
+ headRepo: optStr(p, "head", "repo", "full_name"),
175
+ };
176
+ };