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,144 @@
1
+ // Listing, viewing, enabling and disabling Actions workflows.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { enc, limitField, reads, repoField, writes } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import { num, optStr, str } from "./read.ts";
6
+ import { runSummary } from "./actions.ts";
7
+
8
+ const workflowField = s.string({
9
+ description: "Workflow file name (ci.yml), numeric id, or display name.",
10
+ });
11
+
12
+ const workflow = (w: unknown) => ({
13
+ id: num(w, "id"),
14
+ name: str(w, "name"),
15
+ path: str(w, "path"),
16
+ state: str(w, "state"),
17
+ url: str(w, "html_url"),
18
+ updatedAt: optStr(w, "updated_at"),
19
+ });
20
+
21
+ const allWorkflows = async (gh: GitHub, full: string) =>
22
+ (
23
+ await gh.list(`repos/${full}/actions/workflows`, 1000, {
24
+ key: "workflows",
25
+ })
26
+ ).map(workflow);
27
+
28
+ const resolveWorkflow = async (gh: GitHub, full: string, given: string) => {
29
+ if (/^\d+$/.test(given) || /\.ya?ml$/i.test(given))
30
+ return workflow(
31
+ await gh.rest("GET", `repos/${full}/actions/workflows/${enc(given)}`),
32
+ );
33
+ const matches = (await allWorkflows(gh, full)).filter(
34
+ (w) => w.name.toLowerCase() === given.toLowerCase(),
35
+ );
36
+ const [only, ...rest] = matches;
37
+ if (only === undefined)
38
+ throw new SurfaceError(
39
+ "not_found",
40
+ `no workflow named ${given} in ${full}`,
41
+ "list workflows with `workflow list` (all: true includes disabled ones)",
42
+ );
43
+ if (rest.length > 0)
44
+ throw new SurfaceError(
45
+ "usage",
46
+ `several workflows are named ${given}: ${matches.map((w) => `${w.id} (${w.path})`).join(", ")}`,
47
+ "pass the workflow id or file name instead",
48
+ );
49
+ return only;
50
+ };
51
+
52
+ const toggle = (gh: GitHub, verb: "enable" | "disable", description: string) =>
53
+ op({
54
+ description,
55
+ input: s.object({ repo: repoField, workflow: workflowField }),
56
+ annotations: writes,
57
+ run: async ({ repo, workflow: given }) => {
58
+ const r = await gh.repo(repo);
59
+ const w = await resolveWorkflow(gh, r.full, given);
60
+ await gh.rest("PUT", `repos/${r.full}/actions/workflows/${w.id}/${verb}`);
61
+ return {
62
+ repo: r.full,
63
+ ...workflow(
64
+ await gh.rest("GET", `repos/${r.full}/actions/workflows/${w.id}`),
65
+ ),
66
+ };
67
+ },
68
+ });
69
+
70
+ export const workflowOps = (gh: GitHub) => ({
71
+ list: op({
72
+ description:
73
+ "Workflows of a repo with their id, file path and state; disabled ones only when all is set. Replaces `gh workflow list`.",
74
+ input: s.object({
75
+ repo: repoField,
76
+ all: s.optional(
77
+ s.boolean({ description: "Include disabled workflows." }),
78
+ ),
79
+ limit: limitField(50),
80
+ }),
81
+ annotations: reads,
82
+ run: async ({ repo, all, limit }) => {
83
+ const r = await gh.repo(repo);
84
+ const items = (await allWorkflows(gh, r.full)).filter(
85
+ (w) => all === true || w.state === "active",
86
+ );
87
+ return { repo: r.full, items: items.slice(0, limit ?? 50) };
88
+ },
89
+ }),
90
+ view: op({
91
+ description:
92
+ "One workflow's state, path and url with its latest runs; yaml: true adds the workflow file content at a ref. Replaces `gh workflow view`.",
93
+ input: s.object({
94
+ repo: repoField,
95
+ workflow: workflowField,
96
+ yaml: s.optional(
97
+ s.boolean({ description: "Include the workflow file content." }),
98
+ ),
99
+ ref: s.optional(
100
+ s.string({
101
+ description:
102
+ "Branch or tag to read the YAML from (default branch when omitted).",
103
+ }),
104
+ ),
105
+ limit: limitField(5),
106
+ }),
107
+ annotations: reads,
108
+ run: async ({ repo, workflow: given, yaml, ref, limit }) => {
109
+ const r = await gh.repo(repo);
110
+ const w = await resolveWorkflow(gh, r.full, given);
111
+ const runs = (
112
+ await gh.list(
113
+ `repos/${r.full}/actions/workflows/${w.id}/runs`,
114
+ limit ?? 5,
115
+ { key: "workflow_runs" },
116
+ )
117
+ ).map(runSummary);
118
+ const file = w.path.split("/").map(enc).join("/");
119
+ const content =
120
+ yaml === true
121
+ ? await gh.text(
122
+ `repos/${r.full}/contents/${file}${ref === undefined ? "" : `?ref=${enc(ref)}`}`,
123
+ "application/vnd.github.raw+json",
124
+ )
125
+ : undefined;
126
+ return {
127
+ repo: r.full,
128
+ ...w,
129
+ runs,
130
+ ...(content === undefined ? {} : { yaml: content }),
131
+ };
132
+ },
133
+ }),
134
+ enable: toggle(
135
+ gh,
136
+ "enable",
137
+ "Enable a disabled workflow; returns its new state. Replaces `gh workflow enable`.",
138
+ ),
139
+ disable: toggle(
140
+ gh,
141
+ "disable",
142
+ "Disable a workflow so it stops triggering; returns its new state. Replaces `gh workflow disable`.",
143
+ ),
144
+ });
@@ -0,0 +1,104 @@
1
+ // Reads zip archives (artifact downloads) and keeps every extracted path inside its target directory.
2
+ import { isAbsolute, relative, resolve, sep } from "node:path";
3
+ import { inflateRawSync } from "node:zlib";
4
+ import { SurfaceError } from "../vendor/surface/index.ts";
5
+
6
+ export type ZipEntry = { readonly path: string; readonly data: Uint8Array };
7
+
8
+ const EOCD = 0x06054b50;
9
+ const CENTRAL = 0x02014b50;
10
+ const LOCAL = 0x04034b50;
11
+ const ZIP64 = 0xffffffff;
12
+
13
+ const broken = (why: string): SurfaceError =>
14
+ new SurfaceError(
15
+ "invalid_response",
16
+ `not a readable zip: ${why}`,
17
+ "download it again; the archive may be truncated or use a feature this reader does not support",
18
+ );
19
+
20
+ /** Where `name` lands under `dir`; a name that resolves outside `dir` is refused. */
21
+ export const safeJoin = (dir: string, name: string): string => {
22
+ const root = resolve(dir);
23
+ const target = resolve(root, name);
24
+ const rel = relative(root, target);
25
+ if (
26
+ name.includes("\\") ||
27
+ isAbsolute(name) ||
28
+ rel === "" ||
29
+ rel === ".." ||
30
+ rel.startsWith(`..${sep}`) ||
31
+ isAbsolute(rel)
32
+ )
33
+ throw new SurfaceError(
34
+ "invalid_response",
35
+ `refusing a path outside the target directory: ${name}`,
36
+ "the archive or asset name is unsafe; inspect it before extracting",
37
+ );
38
+ return target;
39
+ };
40
+
41
+ /** The file entries of a zip (directories skipped), each checked against its stored size and CRC-32. */
42
+ export const unzip = (bytes: Uint8Array): ZipEntry[] => {
43
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
44
+ const fits = (at: number, size: number) => {
45
+ if (at < 0 || at + size > bytes.length) throw broken("truncated");
46
+ };
47
+ const u16 = (at: number) => {
48
+ fits(at, 2);
49
+ return view.getUint16(at, true);
50
+ };
51
+ const u32 = (at: number) => {
52
+ fits(at, 4);
53
+ return view.getUint32(at, true);
54
+ };
55
+ const slice = (at: number, size: number) => {
56
+ fits(at, size);
57
+ return bytes.subarray(at, at + size);
58
+ };
59
+
60
+ let end = -1;
61
+ for (
62
+ let at = bytes.length - 22;
63
+ at >= Math.max(0, bytes.length - 22 - 0xffff);
64
+ at--
65
+ )
66
+ if (u32(at) === EOCD) {
67
+ end = at;
68
+ break;
69
+ }
70
+ if (end < 0) throw broken("no end-of-central-directory record");
71
+ const count = u16(end + 10);
72
+ let at = u32(end + 16);
73
+ if (count === 0xffff || at === ZIP64) throw broken("zip64 is not supported");
74
+
75
+ const names = new TextDecoder();
76
+ const entries: ZipEntry[] = [];
77
+ for (let i = 0; i < count; i++) {
78
+ if (u32(at) !== CENTRAL) throw broken("bad central directory entry");
79
+ const flags = u16(at + 8);
80
+ const method = u16(at + 10);
81
+ const crc = u32(at + 16);
82
+ const packed = u32(at + 20);
83
+ const size = u32(at + 24);
84
+ const nameLength = u16(at + 28);
85
+ const local = u32(at + 42);
86
+ const path = names.decode(slice(at + 46, nameLength));
87
+ at += 46 + nameLength + u16(at + 30) + u16(at + 32);
88
+ if (path.endsWith("/")) continue;
89
+ if ((flags & 1) !== 0) throw broken(`${path} is encrypted`);
90
+ if (packed === ZIP64 || size === ZIP64)
91
+ throw broken("zip64 is not supported");
92
+ if (u32(local) !== LOCAL) throw broken(`bad local header for ${path}`);
93
+ const raw = slice(local + 30 + u16(local + 26) + u16(local + 28), packed);
94
+ let data: Uint8Array;
95
+ if (method === 0) data = raw;
96
+ else if (method === 8)
97
+ data = inflateRawSync(raw, { maxOutputLength: Math.max(size, 1) });
98
+ else throw broken(`${path} uses compression method ${method}`);
99
+ if (data.length !== size || Bun.hash.crc32(data) !== crc)
100
+ throw broken(`${path} fails its checksum`);
101
+ entries.push({ path, data });
102
+ }
103
+ return entries;
104
+ };
@@ -0,0 +1,106 @@
1
+ // Every operation this skill offers, defined once. sdk.ts, cli.ts and the MCP server (cli.ts mcp)
2
+ // are built from this; change an operation here and all three follow.
3
+ import { defineSurface } from "./vendor/surface/index.ts";
4
+ import { authOps, orgOps, statusOp } from "./src/account.ts";
5
+ import { actionOps } from "./src/actions.ts";
6
+ import { actionWriteOps } from "./src/actions-write.ts";
7
+ import { attestationOps } from "./src/attestations.ts";
8
+ import { branchProtectionOps } from "./src/branch-protection.ts";
9
+ import { cacheOps } from "./src/caches.ts";
10
+ import { codespaceOps } from "./src/codespaces.ts";
11
+ import { discussionOps } from "./src/discussions.ts";
12
+ import { defaultDeps } from "./src/env.ts";
13
+ import { gistOps } from "./src/gists.ts";
14
+ import { createGitHub, type Deps, type GitHub } from "./src/http.ts";
15
+ import { issueReadOps } from "./src/issues.ts";
16
+ import { issueExtraOps } from "./src/issues-extra.ts";
17
+ import { issueWriteOps } from "./src/issues-write.ts";
18
+ import { gpgKeyOps, sshKeyOps } from "./src/keys.ts";
19
+ import { labelOps } from "./src/labels.ts";
20
+ import { projectFieldOps } from "./src/project-fields.ts";
21
+ import { projectItemOps } from "./src/project-items.ts";
22
+ import { projectOps } from "./src/projects.ts";
23
+ import { pullExtraOps } from "./src/pulls-extra.ts";
24
+ import { pullReadOps } from "./src/pulls-read.ts";
25
+ import { pullReviewOps } from "./src/pulls-review.ts";
26
+ import { pullWriteOps } from "./src/pulls-write.ts";
27
+ import { rawOps } from "./src/raw.ts";
28
+ import { releaseWriteOps } from "./src/release-write.ts";
29
+ import { repoAdminOps } from "./src/repo-admin.ts";
30
+ import { repoContentOps } from "./src/repo-content.ts";
31
+ import { repoExtraOps } from "./src/repo-extras.ts";
32
+ import { releaseOps, repoOps } from "./src/repos.ts";
33
+ import { rulesetOps } from "./src/rulesets.ts";
34
+ import { searchOps } from "./src/search.ts";
35
+ import { commitSearchOp } from "./src/search-commits.ts";
36
+ import { secretOps } from "./src/secrets.ts";
37
+ import { variableOps } from "./src/variables.ts";
38
+ import { waitOps } from "./src/wait.ts";
39
+ import { workflowOps } from "./src/workflows.ts";
40
+
41
+ export const createSurface = (gh: GitHub, tokenInjected = false) =>
42
+ defineSurface({
43
+ name: "github",
44
+ version: "0.2.0",
45
+ description:
46
+ "Typed GitHub: pull requests, issues, Actions runs, workflows and caches, repositories and their settings, branch rules, releases, labels, secrets, variables, gists, projects, discussions, codespaces, search, raw REST and GraphQL.",
47
+ redact: gh.redact,
48
+ instructions:
49
+ "Use these tools instead of shelling out to the gh CLI. `repo` is owner/name and defaults to the git origin of the working directory. " +
50
+ "Results are trimmed JSON; reach for api_rest or api_graphql only when no typed tool fits. " +
51
+ "Before pr_merge, read pr_view and pr_checks and pass matchHeadSha so a moved head refuses the merge. " +
52
+ "Change repository settings, rules and secrets only on a repository the task owns.",
53
+ ops: {
54
+ pr: {
55
+ ...pullReadOps(gh),
56
+ ...pullWriteOps(gh),
57
+ ...pullExtraOps(gh),
58
+ ...pullReviewOps(gh),
59
+ wait: waitOps(gh).pr,
60
+ },
61
+ issue: {
62
+ ...issueReadOps(gh),
63
+ ...issueWriteOps(gh),
64
+ ...issueExtraOps(gh),
65
+ },
66
+ run: { ...actionOps(gh), ...actionWriteOps(gh), wait: waitOps(gh).run },
67
+ workflow: workflowOps(gh),
68
+ cache: cacheOps(gh),
69
+ repo: {
70
+ ...repoOps(gh),
71
+ ...repoAdminOps(gh),
72
+ ...repoContentOps(gh),
73
+ ...repoExtraOps(gh),
74
+ },
75
+ ruleset: rulesetOps(gh),
76
+ branchProtection: branchProtectionOps(gh),
77
+ release: { ...releaseOps(gh), ...releaseWriteOps(gh) },
78
+ label: labelOps(gh),
79
+ secret: secretOps(gh),
80
+ variable: variableOps(gh),
81
+ gist: gistOps(gh),
82
+ project: {
83
+ ...projectOps(gh),
84
+ ...projectFieldOps(gh),
85
+ ...projectItemOps(gh),
86
+ },
87
+ discussion: discussionOps(gh),
88
+ codespace: codespaceOps(gh),
89
+ attestation: attestationOps(gh),
90
+ sshKey: sshKeyOps(gh),
91
+ gpgKey: gpgKeyOps(gh),
92
+ search: { ...searchOps(gh), commits: commitSearchOp(gh) },
93
+ status: statusOp(gh),
94
+ org: orgOps(gh),
95
+ auth: authOps(gh, process.env, tokenInjected),
96
+ api: rawOps(gh),
97
+ },
98
+ });
99
+
100
+ export const surfaceWith = (inject: Partial<Deps> = {}) =>
101
+ createSurface(
102
+ createGitHub({ ...defaultDeps(), ...inject }),
103
+ inject.token !== undefined,
104
+ );
105
+
106
+ export const surface = surfaceWith();
@@ -0,0 +1,15 @@
1
+ {
2
+ "from": "skill-creator/surface",
3
+ "files": {
4
+ "cli.ts": "d957558db8722151c6e2100a7e0c2615d1c587844b23d631f2464ddc79cf983d",
5
+ "flags.ts": "938093648b3bc8982b2a18d8ab370cbd750aafd836b46f78b9a4f72b3b3d2d91",
6
+ "help.ts": "c249bf63198c08bc6efdc83125db93ee27d4c2bc36e10657b47a944814dd125e",
7
+ "http.ts": "932bd91feeae47045267227bc6235c093d1d6320605ba9b04d7422759bb30f38",
8
+ "index.ts": "1ffdc25a3375e143ef5fd195cad6680afac76b500f5cdfca45d694037413ada1",
9
+ "mcp.ts": "c278d2546bd22bf71694fa50d4f6ac0aa7ba3daad18385a0017b453b1ef2296b",
10
+ "schema.ts": "805ccdb74cb9663f53e0453b0a6a9aa3b532e07273e3b8f1f12b655952366cf5",
11
+ "stdio.ts": "3f94670e6a3ed3e4aace92a147420337571e832549cebfd7ae5c53853dfa732a",
12
+ "surface.ts": "2fcd7dad290f337b64f2fdabf584aadecde60ce6114850e7ed5a34783f269c53",
13
+ "tools.ts": "d84be74864c8c82b890208836ca4438fb3c025b27ce5e68a6e9566d6ea6fffb9"
14
+ }
15
+ }
@@ -0,0 +1,203 @@
1
+ // The command line a surface defines. `<group> <op> --flag value` runs an operation and prints
2
+ // its result as JSON; `--help` anywhere explains what is there; `mcp` serves the same operations
3
+ // as an MCP server (stdio by default, `--http` for Streamable HTTP).
4
+ import { parseArgs } from "node:util";
5
+ import { parseFlags } from "./flags.ts";
6
+ import { mcpHelp, opHelp, overview } from "./help.ts";
7
+ import { serveHttp } from "./http.ts";
8
+ import { mcpHandler, type McpOptions } from "./mcp.ts";
9
+ import { serveStdio } from "./stdio.ts";
10
+ import {
11
+ describeError,
12
+ internalError,
13
+ isOp,
14
+ redactValue,
15
+ SurfaceError,
16
+ type Ops,
17
+ type SurfaceDefinition,
18
+ } from "./surface.ts";
19
+
20
+ export type CliIo = {
21
+ readonly out: (text: string) => void;
22
+ readonly err: (text: string) => void;
23
+ readonly stdin: () => ReadableStream<Uint8Array>;
24
+ readonly env: Readonly<Record<string, string | undefined>>;
25
+ /** Resolves when the HTTP server should stop (SIGINT or SIGTERM by default). */
26
+ readonly stopped: () => Promise<void>;
27
+ };
28
+
29
+ const processIo = (): CliIo => ({
30
+ out: (text) => process.stdout.write(`${text}\n`),
31
+ err: (text) => process.stderr.write(`${text}\n`),
32
+ stdin: () => Bun.stdin.stream(),
33
+ env: process.env,
34
+ stopped: () =>
35
+ new Promise((resolve) => {
36
+ process.once("SIGINT", () => resolve());
37
+ process.once("SIGTERM", () => resolve());
38
+ }),
39
+ });
40
+
41
+ type Say = (text: string) => Promise<void>;
42
+ /** The only way this command line writes a line of its own: through the redactor. */
43
+ type Voice = { readonly out: Say; readonly err: Say };
44
+
45
+ // The bearer the HTTP server will require is a secret of this process too. It is read leniently,
46
+ // before the arguments are validated, so that not even the error for a bad argument can print it.
47
+ const bearerOf = (
48
+ argv: readonly string[],
49
+ env: CliIo["env"],
50
+ ): string | undefined => {
51
+ const { values } = parseArgs({
52
+ args: [...argv],
53
+ options: { "token-env": { type: "string" } },
54
+ strict: false,
55
+ });
56
+ const name = values["token-env"];
57
+ const value = typeof name === "string" ? env[name] : undefined;
58
+ return value === undefined || value === "" ? undefined : value;
59
+ };
60
+
61
+ const serveMcp = async (
62
+ surface: SurfaceDefinition<Ops>,
63
+ cli: string,
64
+ argv: readonly string[],
65
+ io: CliIo,
66
+ say: Voice,
67
+ ): Promise<number> => {
68
+ const { values } = parseArgs({
69
+ args: [...argv],
70
+ options: {
71
+ http: { type: "boolean" },
72
+ host: { type: "string" },
73
+ port: { type: "string" },
74
+ path: { type: "string" },
75
+ "token-env": { type: "string" },
76
+ "read-only": { type: "boolean" },
77
+ only: { type: "string" },
78
+ exclude: { type: "string" },
79
+ help: { type: "boolean", short: "h" },
80
+ },
81
+ });
82
+ if (values.help === true) {
83
+ await say.out(mcpHelp(cli));
84
+ return 0;
85
+ }
86
+ const split = (text: string | undefined) =>
87
+ text === undefined ? undefined : text.split(",").map((each) => each.trim());
88
+ const only = split(values.only);
89
+ const exclude = split(values.exclude);
90
+ const options: McpOptions = {
91
+ ...(values["read-only"] === true ? { readOnly: true } : {}),
92
+ ...(only === undefined ? {} : { only }),
93
+ ...(exclude === undefined ? {} : { exclude }),
94
+ };
95
+ const handler = mcpHandler(surface, options);
96
+ if (values.http !== true) {
97
+ // The protocol stream: each line is a reply the handler has already redacted.
98
+ await serveStdio(handler, { input: io.stdin(), write: io.out });
99
+ return 0;
100
+ }
101
+ const tokenName = values["token-env"];
102
+ if (tokenName === undefined)
103
+ throw new SurfaceError(
104
+ "usage",
105
+ "mcp --http needs --token-env NAME",
106
+ "name an environment variable that holds the bearer token clients must send",
107
+ );
108
+ const token = io.env[tokenName] ?? "";
109
+ if (token === "") throw new SurfaceError("usage", `$${tokenName} is empty`);
110
+ const server = serveHttp(handler, {
111
+ ...(values.host === undefined ? {} : { hostname: values.host }),
112
+ ...(values.port === undefined ? {} : { port: Number(values.port) }),
113
+ ...(values.path === undefined ? {} : { path: values.path }),
114
+ token,
115
+ });
116
+ await say.err(
117
+ `${surface.name} MCP server: ${server.url} (${handler.tools.length} tools)`,
118
+ );
119
+ await io.stopped();
120
+ await server.stop();
121
+ return 0;
122
+ };
123
+
124
+ /** Runs the command line `argv` (without the program name); resolves to the exit code. */
125
+ export const runCli = async <O extends Ops>(
126
+ surface: SurfaceDefinition<O>,
127
+ argv: readonly string[],
128
+ given: Partial<CliIo> & { readonly cli?: string } = {},
129
+ ): Promise<number> => {
130
+ const io = { ...processIo(), ...given };
131
+ const cli = given.cli ?? surface.name;
132
+ const bearer =
133
+ argv[0] === "mcp" ? bearerOf(argv.slice(1), io.env) : undefined;
134
+ const redact = async (text: string): Promise<string> => {
135
+ const hidden =
136
+ bearer === undefined ? text : text.replaceAll(bearer, "[redacted]");
137
+ return surface.redact === undefined ? hidden : surface.redact(hidden);
138
+ };
139
+ const say: Voice = {
140
+ out: async (text) => io.out(await redact(text)),
141
+ err: async (text) => io.err(await redact(text)),
142
+ };
143
+ try {
144
+ // The server gets the same redactor, so its replies hide the bearer as well as the surface's secrets.
145
+ if (argv[0] === "mcp")
146
+ return await serveMcp(
147
+ { ...surface, redact },
148
+ cli,
149
+ argv.slice(1),
150
+ io,
151
+ say,
152
+ );
153
+ let ops: Ops = surface.ops;
154
+ const path: string[] = [];
155
+ for (const word of argv) {
156
+ if (word.startsWith("-")) break;
157
+ const next = ops[word];
158
+ if (next === undefined)
159
+ throw new SurfaceError(
160
+ "usage",
161
+ `unknown command ${[...path, word].join(" ")}`,
162
+ `run ${cli} ${path.join(" ")} --help`,
163
+ );
164
+ path.push(word);
165
+ if (isOp(next)) {
166
+ const rest = argv.slice(path.length);
167
+ const parsed = await parseFlags(next.input.json, rest, () =>
168
+ new Response(io.stdin()).text(),
169
+ );
170
+ if (parsed.help) {
171
+ await say.out(opHelp(cli, path, next));
172
+ return 0;
173
+ }
174
+ const result = await next.invoke(parsed.input);
175
+ if (result !== undefined)
176
+ await say.out(
177
+ JSON.stringify(await redactValue(redact, result), null, 2),
178
+ );
179
+ return 0;
180
+ }
181
+ ops = next;
182
+ }
183
+ await say.out(overview(surface, cli, ops, path));
184
+ return argv.length === path.length ||
185
+ argv.includes("--help") ||
186
+ argv.includes("-h")
187
+ ? 0
188
+ : 2;
189
+ } catch (error) {
190
+ // Any thrown value is wrapped, never rethrown, so its text still reaches the redactor; the
191
+ // instanceof check itself is guarded, because it throws for a revoked or trapped Proxy.
192
+ let reported: Error;
193
+ try {
194
+ reported = error instanceof Error ? error : internalError(error);
195
+ } catch {
196
+ reported = internalError(error);
197
+ }
198
+ const { kind, message, hint } = describeError(reported);
199
+ await say.err(`error: ${kind}: ${message}`);
200
+ if (hint !== undefined) await say.err(`hint: ${hint}`);
201
+ return kind === "usage" ? 2 : 1;
202
+ }
203
+ };