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,209 @@
1
+ // Repository labels: list, create, edit, delete, and clone one repository's labels into another.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import {
4
+ enc,
5
+ irreversible,
6
+ limitField,
7
+ reads,
8
+ repoField,
9
+ writes,
10
+ } from "./fields.ts";
11
+ import type { GitHub } from "./http.ts";
12
+ import { at, bool, nodes, num, optStr, str } from "./read.ts";
13
+
14
+ const LIST = `query($owner:String!,$name:String!,$first:Int!,$after:String,$query:String,$field:LabelOrderField!,$direction:OrderDirection!){
15
+ repository(owner:$owner,name:$name){labels(first:$first,after:$after,query:$query,orderBy:{field:$field,direction:$direction}){
16
+ nodes{name color description isDefault createdAt url} pageInfo{hasNextPage endCursor}}}}`;
17
+ const ALL_LABELS = 10_000;
18
+
19
+ const restLabel = (x: unknown) => ({
20
+ id: num(x, "id"),
21
+ name: str(x, "name"),
22
+ color: str(x, "color"),
23
+ description: optStr(x, "description"),
24
+ isDefault: bool(x, "default"),
25
+ });
26
+
27
+ const defined = (o: Readonly<Record<string, unknown>>) =>
28
+ Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined));
29
+
30
+ const bare = (color: string | undefined) => color?.replace(/^#/, "");
31
+
32
+ const colorField = s.optional(
33
+ s.string({ description: "Six-digit hex color, with or without '#'." }),
34
+ );
35
+
36
+ export const labelOps = (gh: GitHub) => ({
37
+ list: op({
38
+ description:
39
+ "Labels of a repository with color, description and whether GitHub created them by default; `search` matches names and descriptions and GitHub then ranks by relevance, ignoring sort and order. Replaces `gh label list`.",
40
+ input: s.object({
41
+ repo: repoField,
42
+ search: s.optional(s.string()),
43
+ sort: s.optional(s.enum(["created", "name"])),
44
+ order: s.optional(s.enum(["asc", "desc"])),
45
+ limit: limitField(30),
46
+ }),
47
+ annotations: reads,
48
+ run: async ({ repo, search, sort, order, limit }) => {
49
+ const r = await gh.repo(repo);
50
+ const max = limit ?? 30;
51
+ const items: {
52
+ readonly name: string;
53
+ readonly color: string;
54
+ readonly description: string | null;
55
+ readonly isDefault: boolean;
56
+ readonly createdAt: string | null;
57
+ readonly url: string;
58
+ }[] = [];
59
+ let after: string | null = null;
60
+ do {
61
+ const data = await gh.graphql(LIST, {
62
+ owner: r.owner,
63
+ name: r.name,
64
+ first: Math.min(100, max - items.length),
65
+ after,
66
+ query: search ?? null,
67
+ field: sort === "name" ? "NAME" : "CREATED_AT",
68
+ direction: order === "desc" ? "DESC" : "ASC",
69
+ });
70
+ const page = at(data, "repository", "labels");
71
+ items.push(
72
+ ...nodes(page).map((l) => ({
73
+ name: str(l, "name"),
74
+ color: str(l, "color"),
75
+ description: optStr(l, "description"),
76
+ isDefault: bool(l, "isDefault"),
77
+ createdAt: optStr(l, "createdAt"),
78
+ url: str(l, "url"),
79
+ })),
80
+ );
81
+ after =
82
+ at(page, "pageInfo", "hasNextPage") === true
83
+ ? optStr(page, "pageInfo", "endCursor")
84
+ : null;
85
+ } while (after !== null && items.length < max);
86
+ return { repo: r.full, items };
87
+ },
88
+ }),
89
+ create: op({
90
+ description:
91
+ "Create a label; GitHub picks a color when none is given. With `force`, an existing label of that name gets the given color and description instead of failing. Replaces `gh label create`.",
92
+ input: s.object({
93
+ repo: repoField,
94
+ name: s.string(),
95
+ color: colorField,
96
+ description: s.optional(s.string()),
97
+ force: s.optional(
98
+ s.boolean({ description: "Update the label if it already exists." }),
99
+ ),
100
+ }),
101
+ annotations: writes,
102
+ run: async ({ repo, name, color, description, force }) => {
103
+ const r = await gh.repo(repo);
104
+ const fields = defined({ color: bare(color), description });
105
+ try {
106
+ const x = await gh.rest("POST", `repos/${r.full}/labels`, {
107
+ body: { name, ...fields },
108
+ });
109
+ return { repo: r.full, action: "created", ...restLabel(x) };
110
+ } catch (error) {
111
+ const exists =
112
+ error instanceof SurfaceError &&
113
+ error.kind === "invalid" &&
114
+ error.message.includes("already_exists");
115
+ if (force !== true || !exists) throw error;
116
+ }
117
+ const x = await gh.rest("PATCH", `repos/${r.full}/labels/${enc(name)}`, {
118
+ body: fields,
119
+ });
120
+ return { repo: r.full, action: "updated", ...restLabel(x) };
121
+ },
122
+ }),
123
+ edit: op({
124
+ description:
125
+ "Rename a label or change its color or description. Replaces `gh label edit`.",
126
+ input: s.object({
127
+ repo: repoField,
128
+ name: s.string({ description: "Current label name." }),
129
+ newName: s.optional(s.string()),
130
+ color: colorField,
131
+ description: s.optional(s.string()),
132
+ }),
133
+ annotations: writes,
134
+ run: async ({ repo, name, newName, color, description }) => {
135
+ const body = defined({
136
+ new_name: newName,
137
+ color: bare(color),
138
+ description,
139
+ });
140
+ if (Object.keys(body).length === 0)
141
+ throw new SurfaceError(
142
+ "usage",
143
+ "nothing to change",
144
+ "pass newName, color or description",
145
+ );
146
+ const r = await gh.repo(repo);
147
+ const x = await gh.rest("PATCH", `repos/${r.full}/labels/${enc(name)}`, {
148
+ body,
149
+ });
150
+ return { repo: r.full, ...restLabel(x) };
151
+ },
152
+ }),
153
+ delete: op({
154
+ description:
155
+ "Delete a label; it is removed from every issue and pull request that carried it. Replaces `gh label delete`.",
156
+ input: s.object({ repo: repoField, name: s.string() }),
157
+ annotations: irreversible,
158
+ run: async ({ repo, name }) => {
159
+ const r = await gh.repo(repo);
160
+ await gh.rest("DELETE", `repos/${r.full}/labels/${enc(name)}`);
161
+ return { repo: r.full, name, deleted: true };
162
+ },
163
+ }),
164
+ clone: op({
165
+ description:
166
+ "Copy every label of `source` into `repo`. Labels whose name already exists (case-insensitive) are skipped, or overwritten with the source color and description when `force` is set. Returns the created, updated and skipped names. Replaces `gh label clone`.",
167
+ input: s.object({
168
+ repo: repoField,
169
+ source: s.string({ description: "owner/name to copy labels from." }),
170
+ force: s.optional(s.boolean()),
171
+ }),
172
+ annotations: writes,
173
+ run: async ({ repo, source, force }) => {
174
+ const [r, src] = await Promise.all([gh.repo(repo), gh.repo(source)]);
175
+ const [from, to] = await Promise.all([
176
+ gh.list(`repos/${src.full}/labels`, ALL_LABELS),
177
+ gh.list(`repos/${r.full}/labels`, ALL_LABELS),
178
+ ]);
179
+ const existing = new Map(
180
+ to.map((l) => [str(l, "name").toLowerCase(), str(l, "name")]),
181
+ );
182
+ const created: string[] = [];
183
+ const updated: string[] = [];
184
+ const skipped: string[] = [];
185
+ for (const l of from) {
186
+ const name = str(l, "name");
187
+ const fields = {
188
+ color: str(l, "color"),
189
+ description: optStr(l, "description") ?? "",
190
+ };
191
+ const current = existing.get(name.toLowerCase());
192
+ if (current === undefined) {
193
+ await gh.rest("POST", `repos/${r.full}/labels`, {
194
+ body: { name, ...fields },
195
+ });
196
+ created.push(name);
197
+ } else if (force === true) {
198
+ await gh.rest("PATCH", `repos/${r.full}/labels/${enc(current)}`, {
199
+ body: { new_name: name, ...fields },
200
+ });
201
+ updated.push(name);
202
+ } else {
203
+ skipped.push(name);
204
+ }
205
+ }
206
+ return { repo: r.full, source: src.full, created, updated, skipped };
207
+ },
208
+ }),
209
+ });
@@ -0,0 +1,115 @@
1
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
2
+ import { enc, irreversible, numberField, repoField } from "./fields.ts";
3
+ import type { GitHub, Repo } from "./http.ts";
4
+ import { pullNodeId } from "./pulls-read.ts";
5
+ import { at, optStr, str } from "./read.ts";
6
+
7
+ const METHOD = { merge: "MERGE", squash: "SQUASH", rebase: "REBASE" } as const;
8
+
9
+ export const deleteHead = async (
10
+ gh: GitHub,
11
+ r: Repo,
12
+ head: string,
13
+ headRepo: string | null,
14
+ ): Promise<boolean> => {
15
+ if (headRepo !== r.full) return false;
16
+ await gh.rest(
17
+ "DELETE",
18
+ `repos/${r.full}/git/refs/heads/${head.split("/").map(enc).join("/")}`,
19
+ );
20
+ return true;
21
+ };
22
+
23
+ export const mergeOp = (gh: GitHub) =>
24
+ op({
25
+ description:
26
+ "Merge a PR now, or enable auto-merge. Pass matchHeadSha so the merge refuses if the head moved since you verified it (kind conflict). Replaces `gh pr merge --match-head-commit`.",
27
+ input: s.object({
28
+ repo: repoField,
29
+ number: numberField,
30
+ method: s.optional(
31
+ s.enum(["merge", "squash", "rebase"], {
32
+ description: "Default merge (a merge commit).",
33
+ }),
34
+ ),
35
+ matchHeadSha: s.optional(
36
+ s.string({
37
+ description: "Expected head commit SHA; strongly recommended.",
38
+ }),
39
+ ),
40
+ subject: s.optional(s.string()),
41
+ body: s.optional(s.string()),
42
+ auto: s.optional(
43
+ s.boolean({ description: "Enable auto-merge instead of merging now." }),
44
+ ),
45
+ deleteBranch: s.optional(
46
+ s.boolean({
47
+ description:
48
+ "Delete the head branch after a merge (same-repo heads only).",
49
+ }),
50
+ ),
51
+ }),
52
+ annotations: irreversible,
53
+ run: async ({
54
+ repo,
55
+ number,
56
+ method,
57
+ matchHeadSha,
58
+ subject,
59
+ body,
60
+ auto,
61
+ deleteBranch,
62
+ }) => {
63
+ const r = await gh.repo(repo);
64
+ const how = method ?? "merge";
65
+ if (auto === true) {
66
+ const pr = await pullNodeId(gh, r.full, number);
67
+ await gh.graphql(
68
+ "mutation($id:ID!,$m:PullRequestMergeMethod!,$oid:GitObjectID){enablePullRequestAutoMerge(input:{pullRequestId:$id,mergeMethod:$m,expectedHeadOid:$oid}){clientMutationId}}",
69
+ { id: pr.id, m: METHOD[how], oid: matchHeadSha ?? null },
70
+ );
71
+ return {
72
+ repo: r.full,
73
+ number,
74
+ merged: false,
75
+ autoMerge: true,
76
+ sha: null,
77
+ branchDeleted: false,
78
+ };
79
+ }
80
+ const pr =
81
+ deleteBranch === true
82
+ ? await pullNodeId(gh, r.full, number)
83
+ : undefined;
84
+ const res = await gh.rest(
85
+ "PUT",
86
+ `repos/${r.full}/pulls/${number}/merge`,
87
+ {
88
+ body: {
89
+ merge_method: how,
90
+ ...(matchHeadSha === undefined ? {} : { sha: matchHeadSha }),
91
+ ...(subject === undefined ? {} : { commit_title: subject }),
92
+ ...(body === undefined ? {} : { commit_message: body }),
93
+ },
94
+ },
95
+ );
96
+ if (at(res, "merged") !== true)
97
+ throw new SurfaceError(
98
+ "conflict",
99
+ optStr(res, "message") ?? "not merged",
100
+ "read `pr view` mergeState and checks",
101
+ );
102
+ const branchDeleted =
103
+ pr === undefined
104
+ ? false
105
+ : await deleteHead(gh, r, pr.head, pr.headRepo);
106
+ return {
107
+ repo: r.full,
108
+ number,
109
+ merged: true,
110
+ autoMerge: false,
111
+ sha: str(res, "sha"),
112
+ branchDeleted,
113
+ };
114
+ },
115
+ });
@@ -0,0 +1,22 @@
1
+ // The Poly1305 one-time authenticator (RFC 8439 section 2.5), on bigint arithmetic modulo 2^130 - 5.
2
+ const P = (1n << 130n) - 5n;
3
+ const CLAMP = 0x0ffffffc0ffffffc0ffffffc0fffffffn;
4
+ const MASK128 = (1n << 128n) - 1n;
5
+
6
+ const littleEndian = (bytes: Uint8Array): bigint =>
7
+ bytes.reduceRight((acc, byte) => (acc << 8n) | BigInt(byte), 0n);
8
+
9
+ export const poly1305 = (key: Uint8Array, message: Uint8Array): Uint8Array => {
10
+ const r = littleEndian(key.subarray(0, 16)) & CLAMP;
11
+ const s = littleEndian(key.subarray(16, 32));
12
+ let h = 0n;
13
+ for (let i = 0; i < message.length; i += 16) {
14
+ const chunk = message.subarray(i, i + 16);
15
+ const padded = littleEndian(chunk) | (1n << BigInt(8 * chunk.length));
16
+ h = ((h + padded) * r) % P;
17
+ }
18
+ let tag = (h + s) & MASK128;
19
+ const out = new Uint8Array(16);
20
+ for (let i = 0; i < 16; i++, tag >>= 8n) out[i] = Number(tag & 0xffn);
21
+ return out;
22
+ };
@@ -0,0 +1,92 @@
1
+ // Checking out a pull request into an existing local clone through git.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { numberField, repoField, writes } from "./fields.ts";
4
+ import type { GitHub, Repo } from "./http.ts";
5
+ import { str } from "./read.ts";
6
+
7
+ const remoteFor = async (gh: GitHub, r: Repo, dir: string) => {
8
+ const wanted = r.full.toLowerCase();
9
+ for (const line of (await gh.git(["remote", "-v"], dir)).split("\n")) {
10
+ const [name, url] = line.split(/\s+/);
11
+ const path = url
12
+ ?.toLowerCase()
13
+ .replace(/\/$/, "")
14
+ .replace(/\.git$/, "");
15
+ if (
16
+ name !== undefined &&
17
+ (path?.endsWith(`github.com/${wanted}`) ||
18
+ path?.endsWith(`github.com:${wanted}`))
19
+ )
20
+ return name;
21
+ }
22
+ return `https://github.com/${r.full}.git`;
23
+ };
24
+
25
+ export const checkoutOp = (gh: GitHub) =>
26
+ op({
27
+ description:
28
+ "Fetch a PR's head (refs/pull/N/head) from the base repository into the existing clone at `dir` and switch to it: a new branch is created, an existing one is fast-forwarded (or reset with force), or with detach HEAD is detached at it. No upstream tracking is configured. Replaces `gh pr checkout`.",
29
+ input: s.object({
30
+ repo: repoField,
31
+ number: numberField,
32
+ dir: s.string({ description: "Path of the existing local clone." }),
33
+ branch: s.optional(
34
+ s.string({
35
+ description: "Local branch name (default: the PR's head branch).",
36
+ }),
37
+ ),
38
+ detach: s.optional(s.boolean()),
39
+ force: s.optional(
40
+ s.boolean({
41
+ description: "Reset an existing local branch to the PR head.",
42
+ }),
43
+ ),
44
+ }),
45
+ annotations: writes,
46
+ run: async ({ repo, number, dir, branch, detach, force }) => {
47
+ if (detach === true && branch !== undefined)
48
+ throw new SurfaceError(
49
+ "usage",
50
+ "detach and branch cannot be combined",
51
+ "drop one of them",
52
+ );
53
+ const r = await gh.repo(repo);
54
+ const name =
55
+ detach === true
56
+ ? null
57
+ : (branch ??
58
+ str(
59
+ await gh.rest("GET", `repos/${r.full}/pulls/${number}`),
60
+ "head",
61
+ "ref",
62
+ ));
63
+ if (name?.startsWith("-"))
64
+ throw new SurfaceError(
65
+ "usage",
66
+ `invalid branch name: ${name}`,
67
+ "pass branch",
68
+ );
69
+ await gh.git(
70
+ ["fetch", await remoteFor(gh, r, dir), `refs/pull/${number}/head`],
71
+ dir,
72
+ );
73
+ if (name === null)
74
+ await gh.git(["checkout", "--detach", "FETCH_HEAD"], dir);
75
+ else if (
76
+ force === true ||
77
+ (await gh.git(["branch", "--list", name], dir)).trim() === ""
78
+ )
79
+ await gh.git(["checkout", "-B", name, "FETCH_HEAD"], dir);
80
+ else {
81
+ await gh.git(["checkout", name], dir);
82
+ await gh.git(["merge", "--ff-only", "FETCH_HEAD"], dir);
83
+ }
84
+ return {
85
+ repo: r.full,
86
+ number,
87
+ dir,
88
+ branch: name,
89
+ headSha: (await gh.git(["rev-parse", "HEAD"], dir)).trim(),
90
+ };
91
+ },
92
+ });
@@ -0,0 +1,106 @@
1
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
2
+ import { numberField, reads, repoField } from "./fields.ts";
3
+ import type { GitHub } from "./http.ts";
4
+ import { at, bool, names, nodes, num, optNum, optStr, str } from "./read.ts";
5
+
6
+ const VIEW = `query($owner:String!,$name:String!,$number:Int!,$comments:Int!){repository(owner:$owner,name:$name){pullRequest(number:$number){
7
+ id number title url state isDraft merged mergedAt closedAt createdAt updatedAt body author{login}
8
+ headRefName headRefOid baseRefName headRepository{nameWithOwner} mergeable mergeStateStatus reviewDecision
9
+ additions deletions changedFiles labels(first:50){nodes{name}} assignees(first:20){nodes{login}}
10
+ reviewRequests(first:20){nodes{requestedReviewer{... on User{login} ... on Team{slug}}}}
11
+ latestReviews(first:20){nodes{author{login} state submittedAt}} closingIssuesReferences(first:20){nodes{number}}
12
+ commits(last:1){nodes{commit{statusCheckRollup{state}}}}
13
+ comments(last:$comments){totalCount nodes{author{login} body createdAt url}}}}}`;
14
+
15
+ export const pullViewOp = (gh: GitHub) =>
16
+ op({
17
+ description:
18
+ "One pull request: state, draft/merged, mergeability, review decision, head SHA, labels, reviewers, linked issues, rollup check state, and optionally its last N comments. Replaces `gh pr view --json ...`.",
19
+ input: s.object({
20
+ repo: repoField,
21
+ number: numberField,
22
+ comments: s.optional(
23
+ s.integer({
24
+ description:
25
+ "How many of the latest conversation comments to include (default 0, max 100).",
26
+ }),
27
+ ),
28
+ body: s.optional(
29
+ s.boolean({
30
+ description: "Include the PR description (default true).",
31
+ }),
32
+ ),
33
+ }),
34
+ annotations: reads,
35
+ run: async ({ repo, number, comments, body }) => {
36
+ const r = await gh.repo(repo);
37
+ const data = await gh.graphql(VIEW, {
38
+ owner: r.owner,
39
+ name: r.name,
40
+ number,
41
+ comments: Math.min(comments ?? 0, 100),
42
+ });
43
+ const p = at(data, "repository", "pullRequest");
44
+ if (p === null || p === undefined)
45
+ throw new SurfaceError(
46
+ "not_found",
47
+ `no pull request #${number} in ${r.full}`,
48
+ "check the number",
49
+ );
50
+ return {
51
+ repo: r.full,
52
+ id: str(p, "id"),
53
+ number: num(p, "number"),
54
+ title: str(p, "title"),
55
+ url: str(p, "url"),
56
+ state: str(p, "state"),
57
+ draft: bool(p, "isDraft"),
58
+ merged: bool(p, "merged"),
59
+ mergedAt: optStr(p, "mergedAt"),
60
+ closedAt: optStr(p, "closedAt"),
61
+ createdAt: str(p, "createdAt"),
62
+ updatedAt: str(p, "updatedAt"),
63
+ author: optStr(p, "author", "login"),
64
+ head: str(p, "headRefName"),
65
+ headSha: str(p, "headRefOid"),
66
+ headRepo: optStr(p, "headRepository", "nameWithOwner"),
67
+ base: str(p, "baseRefName"),
68
+ mergeable: str(p, "mergeable"),
69
+ mergeState: str(p, "mergeStateStatus"),
70
+ reviewDecision: optStr(p, "reviewDecision"),
71
+ checks: optStr(
72
+ nodes(p, "commits")[0],
73
+ "commit",
74
+ "statusCheckRollup",
75
+ "state",
76
+ ),
77
+ additions: num(p, "additions"),
78
+ deletions: num(p, "deletions"),
79
+ changedFiles: num(p, "changedFiles"),
80
+ labels: names(p, "name", "labels"),
81
+ assignees: names(p, "login", "assignees"),
82
+ reviewRequests: nodes(p, "reviewRequests").flatMap((n) => {
83
+ const who =
84
+ optStr(n, "requestedReviewer", "login") ??
85
+ optStr(n, "requestedReviewer", "slug");
86
+ return who === null ? [] : [who];
87
+ }),
88
+ reviews: nodes(p, "latestReviews").map((n) => ({
89
+ author: optStr(n, "author", "login"),
90
+ state: str(n, "state"),
91
+ at: optStr(n, "submittedAt"),
92
+ })),
93
+ closes: nodes(p, "closingIssuesReferences").map((n) =>
94
+ num(n, "number"),
95
+ ),
96
+ ...(body === false ? {} : { body: optStr(p, "body") ?? "" }),
97
+ commentCount: optNum(p, "comments", "totalCount") ?? 0,
98
+ comments: nodes(p, "comments").map((n) => ({
99
+ author: optStr(n, "author", "login"),
100
+ at: str(n, "createdAt"),
101
+ url: str(n, "url"),
102
+ body: str(n, "body"),
103
+ })),
104
+ };
105
+ },
106
+ });
@@ -0,0 +1,144 @@
1
+ // Project (v2) fields: list them with their options and iterations, create custom ones, delete them.
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 {
6
+ collect,
7
+ mutate,
8
+ ownerField,
9
+ pageInfo,
10
+ projectNumberField,
11
+ projectQuery,
12
+ resolveProject,
13
+ } from "./project-ref.ts";
14
+ import { arr, at, num, str } from "./read.ts";
15
+
16
+ const FIELD = `... on ProjectV2FieldCommon { id name dataType }
17
+ ... on ProjectV2SingleSelectField { options { id name } }
18
+ ... on ProjectV2IterationField { configuration { iterations { id title startDate duration } } }`;
19
+
20
+ const field = (x: unknown) => {
21
+ const options = at(x, "options");
22
+ const iterations = at(x, "configuration", "iterations");
23
+ return {
24
+ id: str(x, "id"),
25
+ name: str(x, "name"),
26
+ dataType: str(x, "dataType"),
27
+ ...(options === undefined
28
+ ? {}
29
+ : {
30
+ options: arr(options, "options").map((o) => ({
31
+ id: str(o, "id"),
32
+ name: str(o, "name"),
33
+ })),
34
+ }),
35
+ ...(iterations === undefined
36
+ ? {}
37
+ : {
38
+ iterations: arr(iterations, "iterations").map((i) => ({
39
+ id: str(i, "id"),
40
+ title: str(i, "title"),
41
+ startDate: str(i, "startDate"),
42
+ duration: num(i, "duration"),
43
+ })),
44
+ }),
45
+ };
46
+ };
47
+
48
+ export const projectFieldOps = (gh: GitHub) => ({
49
+ fieldList: op({
50
+ description:
51
+ "Fields of a project with ids, data types, single-select options and iterations (the ids itemEdit needs). Replaces `gh project field-list`.",
52
+ input: s.object({
53
+ owner: ownerField,
54
+ number: projectNumberField,
55
+ limit: limitField(30),
56
+ }),
57
+ annotations: reads,
58
+ run: async ({ owner, number, limit }) => {
59
+ let login = owner;
60
+ const raw = await collect(limit ?? 30, async (first, after) => {
61
+ const r = await projectQuery(
62
+ gh,
63
+ owner,
64
+ number,
65
+ `fields(first: $first, after: $after) { nodes { ${FIELD} } ${pageInfo} }`,
66
+ { decl: "$first: Int!, $after: String", vars: { first, after } },
67
+ );
68
+ login = r.login;
69
+ return at(r.project, "fields");
70
+ });
71
+ return { owner: login, number, items: raw.map(field) };
72
+ },
73
+ }),
74
+ fieldCreate: op({
75
+ description:
76
+ "Add a custom field to a project; SINGLE_SELECT needs `singleSelectOptions`. Replaces `gh project field-create`.",
77
+ input: s.object({
78
+ owner: ownerField,
79
+ number: projectNumberField,
80
+ name: s.string(),
81
+ dataType: s.enum(["TEXT", "SINGLE_SELECT", "DATE", "NUMBER"]),
82
+ singleSelectOptions: s.optional(s.array(s.string())),
83
+ }),
84
+ annotations: writes,
85
+ run: async ({ owner, number, name, dataType, singleSelectOptions }) => {
86
+ const select = dataType === "SINGLE_SELECT";
87
+ if (
88
+ select !==
89
+ (singleSelectOptions !== undefined && singleSelectOptions.length > 0)
90
+ )
91
+ throw new SurfaceError(
92
+ "usage",
93
+ select
94
+ ? "a SINGLE_SELECT field needs singleSelectOptions"
95
+ : "singleSelectOptions only applies to SINGLE_SELECT",
96
+ "pass options exactly when dataType is SINGLE_SELECT",
97
+ );
98
+ const { id } = await resolveProject(gh, owner, number);
99
+ const result = await mutate(
100
+ gh,
101
+ "createProjectV2Field",
102
+ {
103
+ projectId: id,
104
+ dataType,
105
+ name,
106
+ ...(select
107
+ ? {
108
+ singleSelectOptions: (singleSelectOptions ?? []).map((o) => ({
109
+ name: o,
110
+ color: "GRAY",
111
+ description: "",
112
+ })),
113
+ }
114
+ : {}),
115
+ },
116
+ `projectV2Field { ${FIELD} }`,
117
+ );
118
+ return field(at(result, "projectV2Field"));
119
+ },
120
+ }),
121
+ fieldDelete: op({
122
+ description:
123
+ "Delete a custom field and every value set on it; this cannot be undone. Replaces `gh project field-delete`.",
124
+ input: s.object({
125
+ id: s.string({
126
+ description: "Field node id (PVTF_...), from fieldList.",
127
+ }),
128
+ }),
129
+ annotations: irreversible,
130
+ run: async ({ id }) => {
131
+ const result = await mutate(
132
+ gh,
133
+ "deleteProjectV2Field",
134
+ { fieldId: id },
135
+ "projectV2Field { ... on ProjectV2FieldCommon { id name } }",
136
+ );
137
+ return {
138
+ id: str(result, "projectV2Field", "id"),
139
+ name: str(result, "projectV2Field", "name"),
140
+ deleted: true,
141
+ };
142
+ },
143
+ }),
144
+ });