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,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
+ };