oh-my-opencode 5.1.83 → 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 (442) 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/cli-program.d.ts +3 -0
  8. package/dist/cli/index.js +1197 -1008
  9. package/dist/cli/service-auth/devices.d.ts +5 -2
  10. package/dist/cli-node/index.js +1197 -1008
  11. package/dist/config/schema/agent-names.d.ts +1 -0
  12. package/dist/index.js +194 -213
  13. package/dist/skills/browser/SKILL.md +100 -91
  14. package/dist/skills/browser/references/commands.md +92 -27
  15. package/dist/skills/browser/references/desktop.md +22 -0
  16. package/dist/skills/browser/references/install.md +18 -0
  17. package/dist/skills/browser/references/owned-engine/README.md +7 -2
  18. package/dist/skills/browser/references/owned-engine/frames-and-humans.md +9 -2
  19. package/dist/skills/browser/references/owned-engine/network.md +13 -7
  20. package/dist/skills/browser/references/recipes/1password.md +6 -2
  21. package/dist/skills/browser/runtime/omowright/index.js +15 -15
  22. package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
  23. package/dist/skills/debugging/SKILL.md +1 -1
  24. package/dist/skills/debugging/references/tools/browser-qa.md +1 -1
  25. package/dist/skills/git/SKILL.md +62 -0
  26. package/dist/skills/git/agents/openai.yaml +13 -0
  27. package/dist/skills/github/SKILL.md +94 -0
  28. package/dist/skills/github/references/branch-rules.md +129 -0
  29. package/dist/skills/github/references/evidence-attachments.md +16 -0
  30. package/dist/skills/github/references/repo-setup.md +152 -0
  31. package/dist/skills/github/references/waiting.md +52 -0
  32. package/dist/skills/github/references/workflows.md +161 -0
  33. package/dist/skills/github/scripts/cli.ts +8 -0
  34. package/dist/skills/github/scripts/package.json +12 -0
  35. package/dist/skills/github/scripts/sdk.ts +11 -0
  36. package/dist/skills/github/scripts/src/account.ts +243 -0
  37. package/dist/skills/github/scripts/src/actions-write.ts +86 -0
  38. package/dist/skills/github/scripts/src/actions.ts +210 -0
  39. package/dist/skills/github/scripts/src/attestations.ts +136 -0
  40. package/dist/skills/github/scripts/src/blake2b.ts +102 -0
  41. package/dist/skills/github/scripts/src/branch-protection.ts +192 -0
  42. package/dist/skills/github/scripts/src/caches.ts +105 -0
  43. package/dist/skills/github/scripts/src/checks.ts +107 -0
  44. package/dist/skills/github/scripts/src/codespaces.ts +230 -0
  45. package/dist/skills/github/scripts/src/conversation-lock.ts +50 -0
  46. package/dist/skills/github/scripts/src/discussion-list.ts +126 -0
  47. package/dist/skills/github/scripts/src/discussion-lookup.ts +127 -0
  48. package/dist/skills/github/scripts/src/discussions.ts +234 -0
  49. package/dist/skills/github/scripts/src/env.ts +100 -0
  50. package/dist/skills/github/scripts/src/errors.ts +79 -0
  51. package/dist/skills/github/scripts/src/fields.ts +27 -0
  52. package/dist/skills/github/scripts/src/gist-shape.ts +58 -0
  53. package/dist/skills/github/scripts/src/gists-write.ts +130 -0
  54. package/dist/skills/github/scripts/src/gists.ts +118 -0
  55. package/dist/skills/github/scripts/src/git-auth.ts +46 -0
  56. package/dist/skills/github/scripts/src/http.ts +159 -0
  57. package/dist/skills/github/scripts/src/issue-develop.ts +118 -0
  58. package/dist/skills/github/scripts/src/issues-extra.ts +135 -0
  59. package/dist/skills/github/scripts/src/issues-write.ts +174 -0
  60. package/dist/skills/github/scripts/src/issues.ts +156 -0
  61. package/dist/skills/github/scripts/src/keys.ts +176 -0
  62. package/dist/skills/github/scripts/src/labels.ts +209 -0
  63. package/dist/skills/github/scripts/src/merge.ts +115 -0
  64. package/dist/skills/github/scripts/src/poly1305.ts +22 -0
  65. package/dist/skills/github/scripts/src/pr-checkout.ts +92 -0
  66. package/dist/skills/github/scripts/src/pr-view.ts +106 -0
  67. package/dist/skills/github/scripts/src/project-fields.ts +144 -0
  68. package/dist/skills/github/scripts/src/project-item-edit.ts +153 -0
  69. package/dist/skills/github/scripts/src/project-items.ts +191 -0
  70. package/dist/skills/github/scripts/src/project-links.ts +104 -0
  71. package/dist/skills/github/scripts/src/project-ref.ts +145 -0
  72. package/dist/skills/github/scripts/src/project-state.ts +99 -0
  73. package/dist/skills/github/scripts/src/projects.ts +158 -0
  74. package/dist/skills/github/scripts/src/pulls-extra.ts +165 -0
  75. package/dist/skills/github/scripts/src/pulls-read.ts +176 -0
  76. package/dist/skills/github/scripts/src/pulls-review.ts +206 -0
  77. package/dist/skills/github/scripts/src/pulls-write.ts +187 -0
  78. package/dist/skills/github/scripts/src/raw.ts +78 -0
  79. package/dist/skills/github/scripts/src/read.ts +77 -0
  80. package/dist/skills/github/scripts/src/release-assets.ts +111 -0
  81. package/dist/skills/github/scripts/src/release-download.ts +151 -0
  82. package/dist/skills/github/scripts/src/release-write.ts +197 -0
  83. package/dist/skills/github/scripts/src/repo-admin.ts +112 -0
  84. package/dist/skills/github/scripts/src/repo-content.ts +187 -0
  85. package/dist/skills/github/scripts/src/repo-create.ts +139 -0
  86. package/dist/skills/github/scripts/src/repo-extras.ts +217 -0
  87. package/dist/skills/github/scripts/src/repo-list.ts +143 -0
  88. package/dist/skills/github/scripts/src/repo-settings.ts +176 -0
  89. package/dist/skills/github/scripts/src/repo-sync.ts +81 -0
  90. package/dist/skills/github/scripts/src/repo-url.ts +104 -0
  91. package/dist/skills/github/scripts/src/repos.ts +87 -0
  92. package/dist/skills/github/scripts/src/ruleset-shape.ts +96 -0
  93. package/dist/skills/github/scripts/src/rulesets-write.ts +124 -0
  94. package/dist/skills/github/scripts/src/rulesets.ts +80 -0
  95. package/dist/skills/github/scripts/src/run-download.ts +88 -0
  96. package/dist/skills/github/scripts/src/salsa20.ts +97 -0
  97. package/dist/skills/github/scripts/src/scopes.ts +165 -0
  98. package/dist/skills/github/scripts/src/sealed-box.ts +75 -0
  99. package/dist/skills/github/scripts/src/search-commits.ts +114 -0
  100. package/dist/skills/github/scripts/src/search.ts +116 -0
  101. package/dist/skills/github/scripts/src/secrets.ts +131 -0
  102. package/dist/skills/github/scripts/src/snappy.ts +57 -0
  103. package/dist/skills/github/scripts/src/status-search.ts +55 -0
  104. package/dist/skills/github/scripts/src/transfer.ts +97 -0
  105. package/dist/skills/github/scripts/src/types.ts +75 -0
  106. package/dist/skills/github/scripts/src/variables.ts +86 -0
  107. package/dist/skills/github/scripts/src/wait.ts +164 -0
  108. package/dist/skills/github/scripts/src/wire.ts +159 -0
  109. package/dist/skills/github/scripts/src/workflows.ts +144 -0
  110. package/dist/skills/github/scripts/src/zip.ts +104 -0
  111. package/dist/skills/github/scripts/surface.ts +106 -0
  112. package/dist/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
  113. package/dist/skills/github/scripts/vendor/surface/cli.ts +203 -0
  114. package/dist/skills/github/scripts/vendor/surface/flags.ts +195 -0
  115. package/dist/skills/github/scripts/vendor/surface/help.ts +89 -0
  116. package/dist/skills/github/scripts/vendor/surface/http.ts +180 -0
  117. package/dist/skills/github/scripts/vendor/surface/index.ts +44 -0
  118. package/dist/skills/github/scripts/vendor/surface/mcp.ts +241 -0
  119. package/dist/skills/github/scripts/vendor/surface/schema.ts +200 -0
  120. package/dist/skills/github/scripts/vendor/surface/stdio.ts +54 -0
  121. package/dist/skills/github/scripts/vendor/surface/surface.ts +250 -0
  122. package/dist/skills/github/scripts/vendor/surface/tools.ts +80 -0
  123. package/dist/skills/programming/SKILL.md +51 -320
  124. package/dist/skills/programming/references/go/README.md +1 -0
  125. package/dist/skills/programming/references/python/README.md +21 -3
  126. package/dist/skills/programming/references/python/error-handling.md +14 -0
  127. package/dist/skills/programming/references/rust/README.md +5 -1
  128. package/dist/skills/programming/references/typescript/README.md +9 -3
  129. package/dist/skills/programming/references/typescript/error-handling.md +18 -0
  130. package/dist/skills/ultimate-browsing/SKILL.md +1 -1
  131. package/dist/skills/ulw-execute/SKILL.md +1 -1
  132. package/dist/skills/visual-qa/references/browser-setup.md +5 -5
  133. package/dist/tui.js +32 -29
  134. package/package.json +28 -26
  135. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  136. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +2 -2
  137. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  138. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  139. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  140. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  141. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  142. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  143. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  144. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  145. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
  146. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  147. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  148. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  149. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  150. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  151. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  152. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +8711 -172
  153. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +8660 -121
  154. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  155. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  156. package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +5 -0
  157. package/packages/omo-codex/plugin/components/telemetry/tsconfig.json +2 -2
  158. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  159. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  160. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  161. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  162. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  163. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  164. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
  165. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +3 -3
  166. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  167. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  168. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  169. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  170. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  171. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  172. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  173. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  174. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  175. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  176. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  177. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  178. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  179. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  180. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  181. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  182. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  183. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  184. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  185. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  186. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  187. package/packages/omo-codex/plugin/package-lock.json +12 -12
  188. package/packages/omo-codex/plugin/package.json +1 -1
  189. package/packages/omo-codex/plugin/shared/src/config-loader.ts +15 -1
  190. package/packages/omo-codex/plugin/skills/browser/SKILL.md +100 -91
  191. package/packages/omo-codex/plugin/skills/browser/references/commands.md +92 -27
  192. package/packages/omo-codex/plugin/skills/browser/references/desktop.md +22 -0
  193. package/packages/omo-codex/plugin/skills/browser/references/install.md +18 -0
  194. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +7 -2
  195. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +9 -2
  196. package/packages/omo-codex/plugin/skills/browser/references/owned-engine/network.md +13 -7
  197. package/packages/omo-codex/plugin/skills/browser/references/recipes/1password.md +6 -2
  198. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +15 -15
  199. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +4 -4
  200. package/packages/omo-codex/plugin/skills/debugging/SKILL.md +1 -1
  201. package/packages/omo-codex/plugin/skills/debugging/references/tools/browser-qa.md +1 -1
  202. package/packages/omo-codex/plugin/skills/git/SKILL.md +62 -0
  203. package/packages/omo-codex/plugin/skills/git/agents/openai.yaml +13 -0
  204. package/packages/omo-codex/plugin/skills/github/SKILL.md +94 -0
  205. package/packages/omo-codex/plugin/skills/github/agents/openai.yaml +2 -0
  206. package/packages/omo-codex/plugin/skills/github/references/branch-rules.md +129 -0
  207. package/packages/omo-codex/plugin/skills/github/references/evidence-attachments.md +16 -0
  208. package/packages/omo-codex/plugin/skills/github/references/repo-setup.md +152 -0
  209. package/packages/omo-codex/plugin/skills/github/references/waiting.md +52 -0
  210. package/packages/omo-codex/plugin/skills/github/references/workflows.md +161 -0
  211. package/packages/omo-codex/plugin/skills/github/scripts/cli.ts +8 -0
  212. package/packages/omo-codex/plugin/skills/github/scripts/package.json +12 -0
  213. package/packages/omo-codex/plugin/skills/github/scripts/sdk.ts +11 -0
  214. package/packages/omo-codex/plugin/skills/github/scripts/src/account.ts +243 -0
  215. package/packages/omo-codex/plugin/skills/github/scripts/src/actions-write.ts +86 -0
  216. package/packages/omo-codex/plugin/skills/github/scripts/src/actions.ts +210 -0
  217. package/packages/omo-codex/plugin/skills/github/scripts/src/attestations.ts +136 -0
  218. package/packages/omo-codex/plugin/skills/github/scripts/src/blake2b.ts +102 -0
  219. package/packages/omo-codex/plugin/skills/github/scripts/src/branch-protection.ts +192 -0
  220. package/packages/omo-codex/plugin/skills/github/scripts/src/caches.ts +105 -0
  221. package/packages/omo-codex/plugin/skills/github/scripts/src/checks.ts +107 -0
  222. package/packages/omo-codex/plugin/skills/github/scripts/src/codespaces.ts +230 -0
  223. package/packages/omo-codex/plugin/skills/github/scripts/src/conversation-lock.ts +50 -0
  224. package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-list.ts +126 -0
  225. package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-lookup.ts +127 -0
  226. package/packages/omo-codex/plugin/skills/github/scripts/src/discussions.ts +234 -0
  227. package/packages/omo-codex/plugin/skills/github/scripts/src/env.ts +100 -0
  228. package/packages/omo-codex/plugin/skills/github/scripts/src/errors.ts +79 -0
  229. package/packages/omo-codex/plugin/skills/github/scripts/src/fields.ts +27 -0
  230. package/packages/omo-codex/plugin/skills/github/scripts/src/gist-shape.ts +58 -0
  231. package/packages/omo-codex/plugin/skills/github/scripts/src/gists-write.ts +130 -0
  232. package/packages/omo-codex/plugin/skills/github/scripts/src/gists.ts +118 -0
  233. package/packages/omo-codex/plugin/skills/github/scripts/src/git-auth.ts +46 -0
  234. package/packages/omo-codex/plugin/skills/github/scripts/src/http.ts +159 -0
  235. package/packages/omo-codex/plugin/skills/github/scripts/src/issue-develop.ts +118 -0
  236. package/packages/omo-codex/plugin/skills/github/scripts/src/issues-extra.ts +135 -0
  237. package/packages/omo-codex/plugin/skills/github/scripts/src/issues-write.ts +174 -0
  238. package/packages/omo-codex/plugin/skills/github/scripts/src/issues.ts +156 -0
  239. package/packages/omo-codex/plugin/skills/github/scripts/src/keys.ts +176 -0
  240. package/packages/omo-codex/plugin/skills/github/scripts/src/labels.ts +209 -0
  241. package/packages/omo-codex/plugin/skills/github/scripts/src/merge.ts +115 -0
  242. package/packages/omo-codex/plugin/skills/github/scripts/src/poly1305.ts +22 -0
  243. package/packages/omo-codex/plugin/skills/github/scripts/src/pr-checkout.ts +92 -0
  244. package/packages/omo-codex/plugin/skills/github/scripts/src/pr-view.ts +106 -0
  245. package/packages/omo-codex/plugin/skills/github/scripts/src/project-fields.ts +144 -0
  246. package/packages/omo-codex/plugin/skills/github/scripts/src/project-item-edit.ts +153 -0
  247. package/packages/omo-codex/plugin/skills/github/scripts/src/project-items.ts +191 -0
  248. package/packages/omo-codex/plugin/skills/github/scripts/src/project-links.ts +104 -0
  249. package/packages/omo-codex/plugin/skills/github/scripts/src/project-ref.ts +145 -0
  250. package/packages/omo-codex/plugin/skills/github/scripts/src/project-state.ts +99 -0
  251. package/packages/omo-codex/plugin/skills/github/scripts/src/projects.ts +158 -0
  252. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-extra.ts +165 -0
  253. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-read.ts +176 -0
  254. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-review.ts +206 -0
  255. package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-write.ts +187 -0
  256. package/packages/omo-codex/plugin/skills/github/scripts/src/raw.ts +78 -0
  257. package/packages/omo-codex/plugin/skills/github/scripts/src/read.ts +77 -0
  258. package/packages/omo-codex/plugin/skills/github/scripts/src/release-assets.ts +111 -0
  259. package/packages/omo-codex/plugin/skills/github/scripts/src/release-download.ts +151 -0
  260. package/packages/omo-codex/plugin/skills/github/scripts/src/release-write.ts +197 -0
  261. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-admin.ts +112 -0
  262. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-content.ts +187 -0
  263. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-create.ts +139 -0
  264. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-extras.ts +217 -0
  265. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-list.ts +143 -0
  266. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-settings.ts +176 -0
  267. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-sync.ts +81 -0
  268. package/packages/omo-codex/plugin/skills/github/scripts/src/repo-url.ts +104 -0
  269. package/packages/omo-codex/plugin/skills/github/scripts/src/repos.ts +87 -0
  270. package/packages/omo-codex/plugin/skills/github/scripts/src/ruleset-shape.ts +96 -0
  271. package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets-write.ts +124 -0
  272. package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets.ts +80 -0
  273. package/packages/omo-codex/plugin/skills/github/scripts/src/run-download.ts +88 -0
  274. package/packages/omo-codex/plugin/skills/github/scripts/src/salsa20.ts +97 -0
  275. package/packages/omo-codex/plugin/skills/github/scripts/src/scopes.ts +165 -0
  276. package/packages/omo-codex/plugin/skills/github/scripts/src/sealed-box.ts +75 -0
  277. package/packages/omo-codex/plugin/skills/github/scripts/src/search-commits.ts +114 -0
  278. package/packages/omo-codex/plugin/skills/github/scripts/src/search.ts +116 -0
  279. package/packages/omo-codex/plugin/skills/github/scripts/src/secrets.ts +131 -0
  280. package/packages/omo-codex/plugin/skills/github/scripts/src/snappy.ts +57 -0
  281. package/packages/omo-codex/plugin/skills/github/scripts/src/status-search.ts +55 -0
  282. package/packages/omo-codex/plugin/skills/github/scripts/src/transfer.ts +97 -0
  283. package/packages/omo-codex/plugin/skills/github/scripts/src/types.ts +75 -0
  284. package/packages/omo-codex/plugin/skills/github/scripts/src/variables.ts +86 -0
  285. package/packages/omo-codex/plugin/skills/github/scripts/src/wait.ts +164 -0
  286. package/packages/omo-codex/plugin/skills/github/scripts/src/wire.ts +159 -0
  287. package/packages/omo-codex/plugin/skills/github/scripts/src/workflows.ts +144 -0
  288. package/packages/omo-codex/plugin/skills/github/scripts/src/zip.ts +104 -0
  289. package/packages/omo-codex/plugin/skills/github/scripts/surface.ts +106 -0
  290. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
  291. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/cli.ts +203 -0
  292. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/flags.ts +195 -0
  293. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/help.ts +89 -0
  294. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/http.ts +180 -0
  295. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/index.ts +44 -0
  296. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/mcp.ts +241 -0
  297. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/schema.ts +200 -0
  298. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/stdio.ts +54 -0
  299. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/surface.ts +250 -0
  300. package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/tools.ts +80 -0
  301. package/packages/omo-codex/plugin/skills/programming/SKILL.md +51 -320
  302. package/packages/omo-codex/plugin/skills/programming/references/go/README.md +1 -0
  303. package/packages/omo-codex/plugin/skills/programming/references/python/README.md +21 -3
  304. package/packages/omo-codex/plugin/skills/programming/references/python/error-handling.md +14 -0
  305. package/packages/omo-codex/plugin/skills/programming/references/rust/README.md +5 -1
  306. package/packages/omo-codex/plugin/skills/programming/references/typescript/README.md +9 -3
  307. package/packages/omo-codex/plugin/skills/programming/references/typescript/error-handling.md +18 -0
  308. package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +1 -1
  309. package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +1 -1
  310. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
  311. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +3 -3
  312. package/packages/omo-codex/plugin/skills/visual-qa/references/browser-setup.md +5 -5
  313. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +1 -1
  314. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -1
  315. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +5 -5
  316. package/packages/omo-codex/scripts/install-dist/install-local.mjs +21279 -20738
  317. package/packages/shared-skills/skills/browser/SKILL.md +100 -91
  318. package/packages/shared-skills/skills/browser/references/commands.md +92 -27
  319. package/packages/shared-skills/skills/browser/references/desktop.md +22 -0
  320. package/packages/shared-skills/skills/browser/references/install.md +18 -0
  321. package/packages/shared-skills/skills/browser/references/owned-engine/README.md +7 -2
  322. package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +9 -2
  323. package/packages/shared-skills/skills/browser/references/owned-engine/network.md +13 -7
  324. package/packages/shared-skills/skills/browser/references/recipes/1password.md +6 -2
  325. package/packages/shared-skills/skills/browser/runtime/omowright/index.js +15 -15
  326. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +4 -4
  327. package/packages/shared-skills/skills/debugging/SKILL.md +1 -1
  328. package/packages/shared-skills/skills/debugging/references/tools/browser-qa.md +1 -1
  329. package/packages/shared-skills/skills/git/SKILL.md +62 -0
  330. package/packages/shared-skills/skills/git/agents/openai.yaml +13 -0
  331. package/packages/shared-skills/skills/github/SKILL.md +94 -0
  332. package/packages/shared-skills/skills/github/references/branch-rules.md +129 -0
  333. package/packages/shared-skills/skills/github/references/evidence-attachments.md +16 -0
  334. package/packages/shared-skills/skills/github/references/repo-setup.md +152 -0
  335. package/packages/shared-skills/skills/github/references/waiting.md +52 -0
  336. package/packages/shared-skills/skills/github/references/workflows.md +161 -0
  337. package/packages/shared-skills/skills/github/scripts/cli.ts +8 -0
  338. package/packages/shared-skills/skills/github/scripts/package.json +12 -0
  339. package/packages/shared-skills/skills/github/scripts/sdk.ts +11 -0
  340. package/packages/shared-skills/skills/github/scripts/src/account.ts +243 -0
  341. package/packages/shared-skills/skills/github/scripts/src/actions-write.ts +86 -0
  342. package/packages/shared-skills/skills/github/scripts/src/actions.ts +210 -0
  343. package/packages/shared-skills/skills/github/scripts/src/attestations.ts +136 -0
  344. package/packages/shared-skills/skills/github/scripts/src/blake2b.ts +102 -0
  345. package/packages/shared-skills/skills/github/scripts/src/branch-protection.ts +192 -0
  346. package/packages/shared-skills/skills/github/scripts/src/caches.ts +105 -0
  347. package/packages/shared-skills/skills/github/scripts/src/checks.ts +107 -0
  348. package/packages/shared-skills/skills/github/scripts/src/codespaces.ts +230 -0
  349. package/packages/shared-skills/skills/github/scripts/src/conversation-lock.ts +50 -0
  350. package/packages/shared-skills/skills/github/scripts/src/discussion-list.ts +126 -0
  351. package/packages/shared-skills/skills/github/scripts/src/discussion-lookup.ts +127 -0
  352. package/packages/shared-skills/skills/github/scripts/src/discussions.ts +234 -0
  353. package/packages/shared-skills/skills/github/scripts/src/env.ts +100 -0
  354. package/packages/shared-skills/skills/github/scripts/src/errors.ts +79 -0
  355. package/packages/shared-skills/skills/github/scripts/src/fields.ts +27 -0
  356. package/packages/shared-skills/skills/github/scripts/src/gist-shape.ts +58 -0
  357. package/packages/shared-skills/skills/github/scripts/src/gists-write.ts +130 -0
  358. package/packages/shared-skills/skills/github/scripts/src/gists.ts +118 -0
  359. package/packages/shared-skills/skills/github/scripts/src/git-auth.ts +46 -0
  360. package/packages/shared-skills/skills/github/scripts/src/http.ts +159 -0
  361. package/packages/shared-skills/skills/github/scripts/src/issue-develop.ts +118 -0
  362. package/packages/shared-skills/skills/github/scripts/src/issues-extra.ts +135 -0
  363. package/packages/shared-skills/skills/github/scripts/src/issues-write.ts +174 -0
  364. package/packages/shared-skills/skills/github/scripts/src/issues.ts +156 -0
  365. package/packages/shared-skills/skills/github/scripts/src/keys.ts +176 -0
  366. package/packages/shared-skills/skills/github/scripts/src/labels.ts +209 -0
  367. package/packages/shared-skills/skills/github/scripts/src/merge.ts +115 -0
  368. package/packages/shared-skills/skills/github/scripts/src/poly1305.ts +22 -0
  369. package/packages/shared-skills/skills/github/scripts/src/pr-checkout.ts +92 -0
  370. package/packages/shared-skills/skills/github/scripts/src/pr-view.ts +106 -0
  371. package/packages/shared-skills/skills/github/scripts/src/project-fields.ts +144 -0
  372. package/packages/shared-skills/skills/github/scripts/src/project-item-edit.ts +153 -0
  373. package/packages/shared-skills/skills/github/scripts/src/project-items.ts +191 -0
  374. package/packages/shared-skills/skills/github/scripts/src/project-links.ts +104 -0
  375. package/packages/shared-skills/skills/github/scripts/src/project-ref.ts +145 -0
  376. package/packages/shared-skills/skills/github/scripts/src/project-state.ts +99 -0
  377. package/packages/shared-skills/skills/github/scripts/src/projects.ts +158 -0
  378. package/packages/shared-skills/skills/github/scripts/src/pulls-extra.ts +165 -0
  379. package/packages/shared-skills/skills/github/scripts/src/pulls-read.ts +176 -0
  380. package/packages/shared-skills/skills/github/scripts/src/pulls-review.ts +206 -0
  381. package/packages/shared-skills/skills/github/scripts/src/pulls-write.ts +187 -0
  382. package/packages/shared-skills/skills/github/scripts/src/raw.ts +78 -0
  383. package/packages/shared-skills/skills/github/scripts/src/read.ts +77 -0
  384. package/packages/shared-skills/skills/github/scripts/src/release-assets.ts +111 -0
  385. package/packages/shared-skills/skills/github/scripts/src/release-download.ts +151 -0
  386. package/packages/shared-skills/skills/github/scripts/src/release-write.ts +197 -0
  387. package/packages/shared-skills/skills/github/scripts/src/repo-admin.ts +112 -0
  388. package/packages/shared-skills/skills/github/scripts/src/repo-content.ts +187 -0
  389. package/packages/shared-skills/skills/github/scripts/src/repo-create.ts +139 -0
  390. package/packages/shared-skills/skills/github/scripts/src/repo-extras.ts +217 -0
  391. package/packages/shared-skills/skills/github/scripts/src/repo-list.ts +143 -0
  392. package/packages/shared-skills/skills/github/scripts/src/repo-settings.ts +176 -0
  393. package/packages/shared-skills/skills/github/scripts/src/repo-sync.ts +81 -0
  394. package/packages/shared-skills/skills/github/scripts/src/repo-url.ts +104 -0
  395. package/packages/shared-skills/skills/github/scripts/src/repos.ts +87 -0
  396. package/packages/shared-skills/skills/github/scripts/src/ruleset-shape.ts +96 -0
  397. package/packages/shared-skills/skills/github/scripts/src/rulesets-write.ts +124 -0
  398. package/packages/shared-skills/skills/github/scripts/src/rulesets.ts +80 -0
  399. package/packages/shared-skills/skills/github/scripts/src/run-download.ts +88 -0
  400. package/packages/shared-skills/skills/github/scripts/src/salsa20.ts +97 -0
  401. package/packages/shared-skills/skills/github/scripts/src/scopes.ts +165 -0
  402. package/packages/shared-skills/skills/github/scripts/src/sealed-box.ts +75 -0
  403. package/packages/shared-skills/skills/github/scripts/src/search-commits.ts +114 -0
  404. package/packages/shared-skills/skills/github/scripts/src/search.ts +116 -0
  405. package/packages/shared-skills/skills/github/scripts/src/secrets.ts +131 -0
  406. package/packages/shared-skills/skills/github/scripts/src/snappy.ts +57 -0
  407. package/packages/shared-skills/skills/github/scripts/src/status-search.ts +55 -0
  408. package/packages/shared-skills/skills/github/scripts/src/transfer.ts +97 -0
  409. package/packages/shared-skills/skills/github/scripts/src/types.ts +75 -0
  410. package/packages/shared-skills/skills/github/scripts/src/variables.ts +86 -0
  411. package/packages/shared-skills/skills/github/scripts/src/wait.ts +164 -0
  412. package/packages/shared-skills/skills/github/scripts/src/wire.ts +159 -0
  413. package/packages/shared-skills/skills/github/scripts/src/workflows.ts +144 -0
  414. package/packages/shared-skills/skills/github/scripts/src/zip.ts +104 -0
  415. package/packages/shared-skills/skills/github/scripts/surface.ts +106 -0
  416. package/packages/shared-skills/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
  417. package/packages/shared-skills/skills/github/scripts/vendor/surface/cli.ts +203 -0
  418. package/packages/shared-skills/skills/github/scripts/vendor/surface/flags.ts +195 -0
  419. package/packages/shared-skills/skills/github/scripts/vendor/surface/help.ts +89 -0
  420. package/packages/shared-skills/skills/github/scripts/vendor/surface/http.ts +180 -0
  421. package/packages/shared-skills/skills/github/scripts/vendor/surface/index.ts +44 -0
  422. package/packages/shared-skills/skills/github/scripts/vendor/surface/mcp.ts +241 -0
  423. package/packages/shared-skills/skills/github/scripts/vendor/surface/schema.ts +200 -0
  424. package/packages/shared-skills/skills/github/scripts/vendor/surface/stdio.ts +54 -0
  425. package/packages/shared-skills/skills/github/scripts/vendor/surface/surface.ts +250 -0
  426. package/packages/shared-skills/skills/github/scripts/vendor/surface/tools.ts +80 -0
  427. package/packages/shared-skills/skills/programming/SKILL.md +51 -320
  428. package/packages/shared-skills/skills/programming/references/go/README.md +1 -0
  429. package/packages/shared-skills/skills/programming/references/python/README.md +21 -3
  430. package/packages/shared-skills/skills/programming/references/python/error-handling.md +14 -0
  431. package/packages/shared-skills/skills/programming/references/rust/README.md +5 -1
  432. package/packages/shared-skills/skills/programming/references/typescript/README.md +9 -3
  433. package/packages/shared-skills/skills/programming/references/typescript/error-handling.md +18 -0
  434. package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +1 -1
  435. package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
  436. package/packages/shared-skills/skills/visual-qa/references/browser-setup.md +5 -5
  437. package/dist/skills/git-master/SKILL.md +0 -114
  438. package/dist/skills/git-master/agents/openai.yaml +0 -13
  439. package/packages/omo-codex/plugin/skills/git-master/SKILL.md +0 -114
  440. package/packages/omo-codex/plugin/skills/git-master/agents/openai.yaml +0 -13
  441. package/packages/shared-skills/skills/git-master/SKILL.md +0 -114
  442. package/packages/shared-skills/skills/git-master/agents/openai.yaml +0 -13
@@ -0,0 +1,139 @@
1
+ // `repo create`: a new repository for a user or organization, empty, initialized, or generated from a template.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { enc, writes } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import { num, str } from "./read.ts";
6
+ import { defined, repoSettings } from "./repo-settings.ts";
7
+
8
+ const usage = (message: string, hint: string) =>
9
+ new SurfaceError("usage", message, hint);
10
+
11
+ export const createOp = (gh: GitHub) =>
12
+ op({
13
+ description:
14
+ "Create a repository on GitHub: empty, initialized with a README, .gitignore or license, or generated from a template. API-side only: it does not clone, push or link a local directory (gh's --clone, --push, --source, --remote). Replaces `gh repo create`.",
15
+ input: s.object({
16
+ name: s.string({ description: "New repository name." }),
17
+ owner: s.optional(
18
+ s.string({
19
+ description:
20
+ "Organization (or your own login) to own it; default the authenticated user.",
21
+ }),
22
+ ),
23
+ visibility: s.enum(["public", "private", "internal"]),
24
+ description: s.optional(s.string()),
25
+ homepage: s.optional(s.string()),
26
+ template: s.optional(
27
+ s.string({
28
+ description: "Template repository owner/name to generate from.",
29
+ }),
30
+ ),
31
+ includeAllBranches: s.optional(
32
+ s.boolean({
33
+ description:
34
+ "Copy every branch of the template, not only the default.",
35
+ }),
36
+ ),
37
+ addReadme: s.optional(s.boolean()),
38
+ gitignore: s.optional(
39
+ s.string({ description: "gitignore template name, e.g. Node." }),
40
+ ),
41
+ license: s.optional(s.string({ description: "License key, e.g. mit." })),
42
+ team: s.optional(
43
+ s.string({
44
+ description: "Slug of the organization team granted access.",
45
+ }),
46
+ ),
47
+ disableIssues: s.optional(s.boolean()),
48
+ disableWiki: s.optional(s.boolean()),
49
+ }),
50
+ annotations: writes,
51
+ run: async (i) => {
52
+ const hint = "see `gh repo create` for which options combine";
53
+ if (i.includeAllBranches === true && i.template === undefined)
54
+ throw usage("includeAllBranches needs template", hint);
55
+ if (
56
+ i.template !== undefined &&
57
+ (i.addReadme === true ||
58
+ i.gitignore !== undefined ||
59
+ i.license !== undefined ||
60
+ i.homepage !== undefined ||
61
+ i.team !== undefined ||
62
+ i.disableIssues === true ||
63
+ i.disableWiki === true)
64
+ )
65
+ throw usage(
66
+ "template cannot combine with addReadme, gitignore, license, homepage, team, disableIssues or disableWiki",
67
+ hint,
68
+ );
69
+ if (i.template !== undefined) {
70
+ const t = await gh.repo(i.template);
71
+ const x = await gh.rest("POST", `repos/${t.full}/generate`, {
72
+ body: defined({
73
+ owner: i.owner,
74
+ name: i.name,
75
+ description: i.description,
76
+ include_all_branches: i.includeAllBranches,
77
+ private: i.visibility !== "public",
78
+ }),
79
+ });
80
+ // generate takes only a private flag; internal is set afterwards.
81
+ return repoSettings(
82
+ i.visibility === "internal"
83
+ ? await gh.rest("PATCH", `repos/${str(x, "full_name")}`, {
84
+ body: { visibility: "internal" },
85
+ })
86
+ : x,
87
+ );
88
+ }
89
+ let org: string | undefined;
90
+ if (i.owner !== undefined) {
91
+ const owner = await gh.rest("GET", `users/${enc(i.owner)}`);
92
+ if (str(owner, "type") === "Organization") org = str(owner, "login");
93
+ else if (
94
+ str(await gh.rest("GET", "user"), "login").toLowerCase() !==
95
+ i.owner.toLowerCase()
96
+ )
97
+ throw usage(
98
+ `${i.owner} is another user`,
99
+ "create under your own account or an organization",
100
+ );
101
+ }
102
+ if (
103
+ org === undefined &&
104
+ (i.visibility === "internal" || i.team !== undefined)
105
+ )
106
+ throw usage(
107
+ "internal visibility and team need an organization owner",
108
+ hint,
109
+ );
110
+ const teamId =
111
+ org === undefined || i.team === undefined
112
+ ? undefined
113
+ : num(
114
+ await gh.rest("GET", `orgs/${enc(org)}/teams/${enc(i.team)}`),
115
+ "id",
116
+ );
117
+ const x = await gh.rest(
118
+ "POST",
119
+ org === undefined ? "user/repos" : `orgs/${enc(org)}/repos`,
120
+ {
121
+ body: defined({
122
+ name: i.name,
123
+ description: i.description,
124
+ homepage: i.homepage,
125
+ ...(org === undefined
126
+ ? { private: i.visibility === "private" }
127
+ : { visibility: i.visibility }),
128
+ team_id: teamId,
129
+ auto_init: i.addReadme === true ? true : undefined,
130
+ gitignore_template: i.gitignore,
131
+ license_template: i.license,
132
+ has_issues: i.disableIssues === true ? false : undefined,
133
+ has_wiki: i.disableWiki === true ? false : undefined,
134
+ }),
135
+ },
136
+ );
137
+ return repoSettings(x);
138
+ },
139
+ });
@@ -0,0 +1,217 @@
1
+ // Repository side settings (autolinks, deploy keys) and GitHub's gitignore and license template catalogs.
2
+ import { op, s } 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 { arr, at, bool, num, optStr, str } from "./read.ts";
13
+ import { strings } from "./repo-settings.ts";
14
+
15
+ const idField = (what: string) => s.integer({ description: `${what} id.` });
16
+
17
+ const autolink = (x: unknown) => ({
18
+ id: num(x, "id"),
19
+ keyPrefix: str(x, "key_prefix"),
20
+ urlTemplate: str(x, "url_template"),
21
+ alphanumeric: bool(x, "is_alphanumeric"),
22
+ });
23
+
24
+ const deployKey = (x: unknown) => ({
25
+ id: num(x, "id"),
26
+ title: optStr(x, "title"),
27
+ key: str(x, "key"),
28
+ readOnly: bool(x, "read_only"),
29
+ createdAt: optStr(x, "created_at"),
30
+ });
31
+
32
+ const license = (x: unknown) => ({
33
+ key: str(x, "key"),
34
+ name: str(x, "name"),
35
+ spdxId: optStr(x, "spdx_id"),
36
+ });
37
+
38
+ export const repoExtraOps = (gh: GitHub) => ({
39
+ autolink: {
40
+ list: op({
41
+ description:
42
+ "Autolink references of a repository. Replaces `gh repo autolink list`.",
43
+ input: s.object({ repo: repoField }),
44
+ annotations: reads,
45
+ run: async ({ repo }) => {
46
+ const r = await gh.repo(repo);
47
+ const body = await gh.rest("GET", `repos/${r.full}/autolinks`);
48
+ return { repo: r.full, items: arr(body, "autolinks").map(autolink) };
49
+ },
50
+ }),
51
+ view: op({
52
+ description: "One autolink reference. Replaces `gh repo autolink view`.",
53
+ input: s.object({ repo: repoField, id: idField("Autolink") }),
54
+ annotations: reads,
55
+ run: async ({ repo, id }) => {
56
+ const r = await gh.repo(repo);
57
+ return {
58
+ repo: r.full,
59
+ ...autolink(await gh.rest("GET", `repos/${r.full}/autolinks/${id}`)),
60
+ };
61
+ },
62
+ }),
63
+ create: op({
64
+ description:
65
+ "Add an autolink: text starting with keyPrefix links to urlTemplate with <num> replaced. Alphanumeric references unless numeric. Replaces `gh repo autolink create`.",
66
+ input: s.object({
67
+ repo: repoField,
68
+ keyPrefix: s.string({
69
+ description: "Prefix that triggers the link, e.g. TICKET-.",
70
+ }),
71
+ urlTemplate: s.string({
72
+ description:
73
+ "URL containing <num>, e.g. https://example.com/t/<num>.",
74
+ }),
75
+ numeric: s.optional(
76
+ s.boolean({ description: "Match only digits after the prefix." }),
77
+ ),
78
+ }),
79
+ annotations: writes,
80
+ run: async ({ repo, keyPrefix, urlTemplate, numeric }) => {
81
+ const r = await gh.repo(repo);
82
+ const x = await gh.rest("POST", `repos/${r.full}/autolinks`, {
83
+ body: {
84
+ key_prefix: keyPrefix,
85
+ url_template: urlTemplate,
86
+ is_alphanumeric: numeric !== true,
87
+ },
88
+ });
89
+ return { repo: r.full, ...autolink(x) };
90
+ },
91
+ }),
92
+ delete: op({
93
+ description:
94
+ "Delete an autolink reference. Replaces `gh repo autolink delete --yes`.",
95
+ input: s.object({ repo: repoField, id: idField("Autolink") }),
96
+ annotations: irreversible,
97
+ run: async ({ repo, id }) => {
98
+ const r = await gh.repo(repo);
99
+ await gh.rest("DELETE", `repos/${r.full}/autolinks/${id}`);
100
+ return { repo: r.full, id, deleted: true };
101
+ },
102
+ }),
103
+ },
104
+ deployKey: {
105
+ list: op({
106
+ description:
107
+ "Deploy keys of a repository. Replaces `gh repo deploy-key list`.",
108
+ input: s.object({ repo: repoField, limit: limitField(100) }),
109
+ annotations: reads,
110
+ run: async ({ repo, limit }) => {
111
+ const r = await gh.repo(repo);
112
+ return {
113
+ repo: r.full,
114
+ items: (await gh.list(`repos/${r.full}/keys`, limit ?? 100)).map(
115
+ deployKey,
116
+ ),
117
+ };
118
+ },
119
+ }),
120
+ add: op({
121
+ description:
122
+ "Add a deploy key from its public key text, read-only unless allowWrite. Replaces `gh repo deploy-key add`.",
123
+ input: s.object({
124
+ repo: repoField,
125
+ key: s.string({
126
+ description: "Public key text, e.g. the contents of id_ed25519.pub.",
127
+ }),
128
+ title: s.optional(s.string()),
129
+ allowWrite: s.optional(s.boolean({ description: "Let the key push." })),
130
+ }),
131
+ annotations: writes,
132
+ run: async ({ repo, key, title, allowWrite }) => {
133
+ const r = await gh.repo(repo);
134
+ const x = await gh.rest("POST", `repos/${r.full}/keys`, {
135
+ body: {
136
+ key: key.trim(),
137
+ read_only: allowWrite !== true,
138
+ ...(title === undefined ? {} : { title }),
139
+ },
140
+ });
141
+ return { repo: r.full, ...deployKey(x) };
142
+ },
143
+ }),
144
+ delete: op({
145
+ description: "Remove a deploy key. Replaces `gh repo deploy-key delete`.",
146
+ input: s.object({ repo: repoField, id: idField("Deploy key") }),
147
+ annotations: irreversible,
148
+ run: async ({ repo, id }) => {
149
+ const r = await gh.repo(repo);
150
+ await gh.rest("DELETE", `repos/${r.full}/keys/${id}`);
151
+ return { repo: r.full, id, deleted: true };
152
+ },
153
+ }),
154
+ },
155
+ gitignore: {
156
+ list: op({
157
+ description:
158
+ "Names of GitHub's gitignore templates. Replaces `gh repo gitignore list`.",
159
+ input: s.object({}),
160
+ annotations: reads,
161
+ run: async () => ({
162
+ items: strings(
163
+ await gh.rest("GET", "gitignore/templates"),
164
+ "templates",
165
+ ),
166
+ }),
167
+ }),
168
+ view: op({
169
+ description:
170
+ "One gitignore template's text. Replaces `gh repo gitignore view`.",
171
+ input: s.object({
172
+ name: s.string({
173
+ description: "Template name, e.g. Node (case-sensitive).",
174
+ }),
175
+ }),
176
+ annotations: reads,
177
+ run: async ({ name }) => {
178
+ const x = await gh.rest("GET", `gitignore/templates/${enc(name)}`);
179
+ return { name: str(x, "name"), source: str(x, "source") };
180
+ },
181
+ }),
182
+ },
183
+ license: {
184
+ list: op({
185
+ description:
186
+ "Commonly used licenses with their keys and SPDX ids. Replaces `gh repo license list`.",
187
+ input: s.object({}),
188
+ annotations: reads,
189
+ run: async () => ({
190
+ items: arr(await gh.rest("GET", "licenses"), "licenses").map(license),
191
+ }),
192
+ }),
193
+ view: op({
194
+ description:
195
+ "One license's text, summary, permissions, conditions and limitations, by key or SPDX id. Replaces `gh repo license view`.",
196
+ input: s.object({
197
+ license: s.string({
198
+ description: "License key or SPDX id, e.g. mit or Apache-2.0.",
199
+ }),
200
+ }),
201
+ annotations: reads,
202
+ run: async ({ license: key }) => {
203
+ const x = await gh.rest("GET", `licenses/${enc(key.toLowerCase())}`);
204
+ return {
205
+ ...license(x),
206
+ description: optStr(x, "description"),
207
+ implementation: optStr(x, "implementation"),
208
+ permissions: strings(at(x, "permissions") ?? [], "permissions"),
209
+ conditions: strings(at(x, "conditions") ?? [], "conditions"),
210
+ limitations: strings(at(x, "limitations") ?? [], "limitations"),
211
+ body: str(x, "body"),
212
+ url: optStr(x, "html_url"),
213
+ };
214
+ },
215
+ }),
216
+ },
217
+ });
@@ -0,0 +1,143 @@
1
+ // `repo list`: an owner's repositories through GraphQL, or through repository search when filtering by language or topic.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { limitField, reads } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import type { Json } from "./read.ts";
6
+ import { at, bool, nodes, optNum, optStr, str } from "./read.ts";
7
+
8
+ const FIELDS = `nameWithOwner description visibility isFork isArchived isTemplate
9
+ primaryLanguage { name } repositoryTopics(first: 20) { nodes { topic { name } } }
10
+ stargazerCount defaultBranchRef { name } pushedAt url`;
11
+ const PAGE = "pageInfo { hasNextPage endCursor }";
12
+
13
+ const OWNER_QUERY = `query($login: String!, $first: Int!, $after: String, $visibility: RepositoryVisibility, $isFork: Boolean, $isArchived: Boolean) {
14
+ repositoryOwner(login: $login) {
15
+ repositories(first: $first, after: $after, visibility: $visibility, isFork: $isFork, isArchived: $isArchived,
16
+ ownerAffiliations: [OWNER], orderBy: { field: PUSHED_AT, direction: DESC }) { nodes { ${FIELDS} } ${PAGE} }
17
+ }
18
+ }`;
19
+ const SEARCH_QUERY = `query($q: String!, $first: Int!, $after: String) {
20
+ search(query: $q, type: REPOSITORY, first: $first, after: $after) { nodes { ... on Repository { ${FIELDS} } } ${PAGE} }
21
+ }`;
22
+
23
+ const listed = (n: unknown) => ({
24
+ repo: str(n, "nameWithOwner"),
25
+ description: optStr(n, "description"),
26
+ visibility: str(n, "visibility").toLowerCase(),
27
+ fork: bool(n, "isFork"),
28
+ archived: bool(n, "isArchived"),
29
+ template: bool(n, "isTemplate"),
30
+ language: optStr(n, "primaryLanguage", "name"),
31
+ topics: nodes(n, "repositoryTopics").flatMap((t) => {
32
+ const name = optStr(t, "topic", "name");
33
+ return name === null ? [] : [name];
34
+ }),
35
+ stars: optNum(n, "stargazerCount"),
36
+ defaultBranch: optStr(n, "defaultBranchRef", "name"),
37
+ pushedAt: optStr(n, "pushedAt"),
38
+ url: str(n, "url"),
39
+ });
40
+
41
+ const quote = (v: string) => (/\s/.test(v) ? `"${v}"` : v);
42
+
43
+ export const listOp = (gh: GitHub) =>
44
+ op({
45
+ description:
46
+ "An owner's repositories, most recently pushed first; the authenticated user's when owner is omitted. Language and topic filters go through repository search, which can lag behind brand-new repositories. Replaces `gh repo list`.",
47
+ input: s.object({
48
+ owner: s.optional(
49
+ s.string({ description: "User or organization login." }),
50
+ ),
51
+ visibility: s.optional(s.enum(["public", "private", "internal"])),
52
+ fork: s.optional(
53
+ s.boolean({
54
+ description:
55
+ "true: only forks (gh --fork); false: only non-forks (gh --source).",
56
+ }),
57
+ ),
58
+ archived: s.optional(
59
+ s.boolean({
60
+ description:
61
+ "true: only archived (gh --archived); false: omit archived (gh --no-archived).",
62
+ }),
63
+ ),
64
+ language: s.optional(s.string({ description: "Primary language." })),
65
+ topics: s.optional(s.array(s.string())),
66
+ limit: limitField(30),
67
+ }),
68
+ annotations: reads,
69
+ run: async ({
70
+ owner,
71
+ visibility,
72
+ fork,
73
+ archived,
74
+ language,
75
+ topics,
76
+ limit,
77
+ }) => {
78
+ const login =
79
+ owner ??
80
+ str(
81
+ await gh.graphql("query { viewer { login } }", {}),
82
+ "viewer",
83
+ "login",
84
+ );
85
+ const searching = language !== undefined || (topics?.length ?? 0) > 0;
86
+ const [query, base, path]: [string, Json, readonly string[]] = searching
87
+ ? [
88
+ SEARCH_QUERY,
89
+ {
90
+ q: [
91
+ `user:${login}`,
92
+ fork === undefined
93
+ ? "fork:true"
94
+ : fork
95
+ ? "fork:only"
96
+ : "fork:false",
97
+ archived === undefined ? undefined : `archived:${archived}`,
98
+ visibility === undefined ? undefined : `is:${visibility}`,
99
+ language === undefined
100
+ ? undefined
101
+ : `language:${quote(language)}`,
102
+ ...(topics ?? []).map((t) => `topic:${quote(t)}`),
103
+ "sort:updated",
104
+ ]
105
+ .filter((part) => part !== undefined)
106
+ .join(" "),
107
+ },
108
+ ["search"],
109
+ ]
110
+ : [
111
+ OWNER_QUERY,
112
+ {
113
+ login,
114
+ visibility: visibility?.toUpperCase() ?? null,
115
+ isFork: fork ?? null,
116
+ isArchived: archived ?? null,
117
+ },
118
+ ["repositoryOwner", "repositories"],
119
+ ];
120
+ const want = limit ?? 30;
121
+ const items: ReturnType<typeof listed>[] = [];
122
+ let after: string | null = null;
123
+ do {
124
+ const data = await gh.graphql(query, {
125
+ ...base,
126
+ first: Math.min(100, want - items.length),
127
+ after,
128
+ });
129
+ if (!searching && at(data, "repositoryOwner") === null)
130
+ throw new SurfaceError(
131
+ "not_found",
132
+ `no user or organization ${login}`,
133
+ "check the owner login",
134
+ );
135
+ const conn = at(data, ...path);
136
+ items.push(...nodes(conn).map(listed));
137
+ after = bool(conn, "pageInfo", "hasNextPage")
138
+ ? optStr(conn, "pageInfo", "endCursor")
139
+ : null;
140
+ } while (after !== null && items.length < want);
141
+ return { owner: login, items: items.slice(0, want) };
142
+ },
143
+ });
@@ -0,0 +1,176 @@
1
+ // A repository's settings as returned by create and edit, and the `repo edit` operation that changes them.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { repoField, writes } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import { arr, at, bool, optNum, optStr, str } from "./read.ts";
6
+
7
+ const flag = (x: unknown, key: string): boolean | null => {
8
+ const v = at(x, key);
9
+ return typeof v === "boolean" ? v : null;
10
+ };
11
+
12
+ export const strings = (x: unknown, what: string): string[] =>
13
+ arr(x, what).filter((t): t is string => typeof t === "string");
14
+
15
+ export const defined = (
16
+ fields: Readonly<Record<string, unknown>>,
17
+ ): Record<string, unknown> =>
18
+ Object.fromEntries(Object.entries(fields).filter(([, v]) => v !== undefined));
19
+
20
+ export const repoSettings = (x: unknown) => ({
21
+ repo: str(x, "full_name"),
22
+ description: optStr(x, "description"),
23
+ homepage: optStr(x, "homepage"),
24
+ defaultBranch: str(x, "default_branch"),
25
+ visibility: optStr(x, "visibility"),
26
+ private: bool(x, "private"),
27
+ archived: bool(x, "archived"),
28
+ fork: bool(x, "fork"),
29
+ template: flag(x, "is_template"),
30
+ stars: optNum(x, "stargazers_count"),
31
+ openIssues: optNum(x, "open_issues_count"),
32
+ topics: strings(at(x, "topics") ?? [], "topics"),
33
+ pushedAt: optStr(x, "pushed_at"),
34
+ url: str(x, "html_url"),
35
+ hasIssues: flag(x, "has_issues"),
36
+ hasWiki: flag(x, "has_wiki"),
37
+ hasProjects: flag(x, "has_projects"),
38
+ hasDiscussions: flag(x, "has_discussions"),
39
+ allowForking: flag(x, "allow_forking"),
40
+ allowSquashMerge: flag(x, "allow_squash_merge"),
41
+ allowMergeCommit: flag(x, "allow_merge_commit"),
42
+ allowRebaseMerge: flag(x, "allow_rebase_merge"),
43
+ allowAutoMerge: flag(x, "allow_auto_merge"),
44
+ allowUpdateBranch: flag(x, "allow_update_branch"),
45
+ deleteBranchOnMerge: flag(x, "delete_branch_on_merge"),
46
+ });
47
+
48
+ // gh's --squash-merge-commit-message choices, as the title/message pair the API takes.
49
+ const SQUASH = {
50
+ default: ["COMMIT_OR_PR_TITLE", "COMMIT_MESSAGES"],
51
+ "pr-title": ["PR_TITLE", "BLANK"],
52
+ "pr-title-commits": ["PR_TITLE", "COMMIT_MESSAGES"],
53
+ "pr-title-description": ["PR_TITLE", "PR_BODY"],
54
+ } as const;
55
+
56
+ const toggle = (description: string) => s.optional(s.boolean({ description }));
57
+
58
+ const status = (v: boolean | undefined) =>
59
+ v === undefined ? undefined : { status: v ? "enabled" : "disabled" };
60
+
61
+ export const editOp = (gh: GitHub) =>
62
+ op({
63
+ description:
64
+ "Change repository settings and topics; booleans set the feature on (true) or off (false), omitted fields stay as they are. Returns the repository's settings afterwards. Replaces `gh repo edit`.",
65
+ input: s.object({
66
+ repo: repoField,
67
+ description: s.optional(s.string()),
68
+ homepage: s.optional(s.string()),
69
+ visibility: s.optional(s.enum(["public", "private", "internal"])),
70
+ acceptVisibilityChangeConsequences: toggle(
71
+ "Must be true when visibility is given: a change can drop stars, watchers and forks.",
72
+ ),
73
+ defaultBranch: s.optional(s.string()),
74
+ addTopics: s.optional(s.array(s.string())),
75
+ removeTopics: s.optional(s.array(s.string())),
76
+ enableIssues: toggle("Issues on or off."),
77
+ enableWiki: toggle("Wiki on or off."),
78
+ enableProjects: toggle("Projects on or off."),
79
+ enableDiscussions: toggle("Discussions on or off."),
80
+ allowSquashMerge: toggle("Squash merging of pull requests."),
81
+ allowMergeCommit: toggle("Merge-commit merging of pull requests."),
82
+ allowRebaseMerge: toggle("Rebase merging of pull requests."),
83
+ deleteBranchOnMerge: toggle("Delete head branches after merge."),
84
+ allowUpdateBranch: toggle(
85
+ "Offer updating a pull request branch that is behind its base.",
86
+ ),
87
+ enableAutoMerge: toggle("Allow auto-merge on pull requests."),
88
+ template: toggle("Make it a template repository."),
89
+ allowForking: toggle("Allow forking (organization repositories)."),
90
+ enableAdvancedSecurity: toggle("GitHub Advanced Security."),
91
+ enableSecretScanning: toggle("Secret scanning."),
92
+ enableSecretScanningPushProtection: toggle(
93
+ "Secret scanning push protection (secret scanning must be on).",
94
+ ),
95
+ squashMergeCommitMessage: s.optional(
96
+ s.enum([
97
+ "default",
98
+ "pr-title",
99
+ "pr-title-commits",
100
+ "pr-title-description",
101
+ ]),
102
+ ),
103
+ }),
104
+ annotations: writes,
105
+ run: async (i) => {
106
+ if (
107
+ i.visibility !== undefined &&
108
+ i.acceptVisibilityChangeConsequences !== true
109
+ )
110
+ throw new SurfaceError(
111
+ "usage",
112
+ "changing visibility needs acceptVisibilityChangeConsequences: true",
113
+ "a visibility change can lose stars, watchers and forks; confirm it explicitly",
114
+ );
115
+ const r = await gh.repo(i.repo);
116
+ const squash =
117
+ i.squashMergeCommitMessage === undefined
118
+ ? undefined
119
+ : SQUASH[i.squashMergeCommitMessage];
120
+ const security = defined({
121
+ advanced_security: status(i.enableAdvancedSecurity),
122
+ secret_scanning: status(i.enableSecretScanning),
123
+ secret_scanning_push_protection: status(
124
+ i.enableSecretScanningPushProtection,
125
+ ),
126
+ });
127
+ const patch = defined({
128
+ description: i.description,
129
+ homepage: i.homepage,
130
+ visibility: i.visibility,
131
+ default_branch: i.defaultBranch,
132
+ has_issues: i.enableIssues,
133
+ has_wiki: i.enableWiki,
134
+ has_projects: i.enableProjects,
135
+ has_discussions: i.enableDiscussions,
136
+ allow_squash_merge: i.allowSquashMerge,
137
+ allow_merge_commit: i.allowMergeCommit,
138
+ allow_rebase_merge: i.allowRebaseMerge,
139
+ delete_branch_on_merge: i.deleteBranchOnMerge,
140
+ allow_update_branch: i.allowUpdateBranch,
141
+ allow_auto_merge: i.enableAutoMerge,
142
+ is_template: i.template,
143
+ allow_forking: i.allowForking,
144
+ squash_merge_commit_title: squash?.[0],
145
+ squash_merge_commit_message: squash?.[1],
146
+ security_and_analysis:
147
+ Object.keys(security).length > 0 ? security : undefined,
148
+ });
149
+ const topicsChange =
150
+ (i.addTopics?.length ?? 0) + (i.removeTopics?.length ?? 0) > 0;
151
+ if (Object.keys(patch).length === 0 && !topicsChange)
152
+ throw new SurfaceError(
153
+ "usage",
154
+ "nothing to change",
155
+ "pass at least one setting or topic",
156
+ );
157
+ const after =
158
+ Object.keys(patch).length > 0
159
+ ? await gh.rest("PATCH", `repos/${r.full}`, { body: patch })
160
+ : await gh.rest("GET", `repos/${r.full}`);
161
+ const settings = repoSettings(after);
162
+ if (!topicsChange) return settings;
163
+ const current = strings(
164
+ at(await gh.rest("GET", `repos/${r.full}/topics`), "names"),
165
+ "names",
166
+ );
167
+ const drop = new Set(i.removeTopics ?? []);
168
+ const names = [...new Set([...current, ...(i.addTopics ?? [])])].filter(
169
+ (t) => !drop.has(t),
170
+ );
171
+ const put = await gh.rest("PUT", `repos/${settings.repo}/topics`, {
172
+ body: { names },
173
+ });
174
+ return { ...settings, topics: strings(at(put, "names"), "names") };
175
+ },
176
+ });