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,97 @@
1
+ // The Salsa20 core, HSalsa20 key derivation and the XSalsa20 stream cipher (24-byte nonce), as NaCl's crypto_box uses them.
2
+ const SIGMA = new TextEncoder().encode("expand 32-byte k");
3
+
4
+ const word = (x: Uint32Array, i: number): number => x[i] ?? 0;
5
+ const rotl = (v: number, n: number): number => (v << n) | (v >>> (32 - n));
6
+
7
+ const quarter = (
8
+ x: Uint32Array,
9
+ a: number,
10
+ b: number,
11
+ c: number,
12
+ d: number,
13
+ ) => {
14
+ x[b] = word(x, b) ^ rotl((word(x, a) + word(x, d)) | 0, 7);
15
+ x[c] = word(x, c) ^ rotl((word(x, b) + word(x, a)) | 0, 9);
16
+ x[d] = word(x, d) ^ rotl((word(x, c) + word(x, b)) | 0, 13);
17
+ x[a] = word(x, a) ^ rotl((word(x, d) + word(x, c)) | 0, 18);
18
+ };
19
+
20
+ const ROUNDS = [
21
+ [0, 4, 8, 12],
22
+ [5, 9, 13, 1],
23
+ [10, 14, 2, 6],
24
+ [15, 3, 7, 11],
25
+ [0, 1, 2, 3],
26
+ [5, 6, 7, 4],
27
+ [10, 11, 8, 9],
28
+ [15, 12, 13, 14],
29
+ ] as const;
30
+
31
+ const words = (bytes: Uint8Array): Uint32Array => {
32
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
33
+ return Uint32Array.from({ length: bytes.length / 4 }, (_, i) =>
34
+ view.getUint32(i * 4, true),
35
+ );
36
+ };
37
+
38
+ const bytesOf = (w: Uint32Array): Uint8Array => {
39
+ const out = new Uint8Array(w.length * 4);
40
+ const view = new DataView(out.buffer);
41
+ w.forEach((v, i) => view.setUint32(i * 4, v, true));
42
+ return out;
43
+ };
44
+
45
+ const initial = (key: Uint8Array, input: Uint8Array): Uint32Array => {
46
+ const [c, k, n] = [words(SIGMA), words(key), words(input)];
47
+ return Uint32Array.of(
48
+ word(c, 0),
49
+ ...k.subarray(0, 4),
50
+ word(c, 1),
51
+ ...n,
52
+ word(c, 2),
53
+ ...k.subarray(4, 8),
54
+ word(c, 3),
55
+ );
56
+ };
57
+
58
+ const permute = (state: Uint32Array): Uint32Array => {
59
+ const x = state.slice();
60
+ for (let i = 0; i < 10; i++)
61
+ for (const [a, b, c, d] of ROUNDS) quarter(x, a, b, c, d);
62
+ return x;
63
+ };
64
+
65
+ /** Salsa20 block for a 32-byte key and a 16-byte input (8-byte nonce, then a little-endian 64-bit counter). */
66
+ const block = (key: Uint8Array, input: Uint8Array): Uint8Array => {
67
+ const state = initial(key, input);
68
+ const x = permute(state);
69
+ return bytesOf(x.map((v, i) => v + word(state, i)));
70
+ };
71
+
72
+ export const hsalsa20 = (key: Uint8Array, input: Uint8Array): Uint8Array => {
73
+ const x = permute(initial(key, input));
74
+ return bytesOf(
75
+ Uint32Array.from([0, 5, 10, 15, 6, 7, 8, 9], (i) => word(x, i)),
76
+ );
77
+ };
78
+
79
+ /** XOR `data` with the XSalsa20 keystream for a 32-byte key and a 24-byte nonce, starting at block 0. */
80
+ export const xsalsa20 = (
81
+ key: Uint8Array,
82
+ nonce: Uint8Array,
83
+ data: Uint8Array,
84
+ ): Uint8Array => {
85
+ const subkey = hsalsa20(key, nonce.subarray(0, 16));
86
+ const input = new Uint8Array(16);
87
+ input.set(nonce.subarray(16, 24));
88
+ const counter = new DataView(input.buffer);
89
+ const out = new Uint8Array(data.length);
90
+ for (let offset = 0, n = 0; offset < data.length; offset += 64, n++) {
91
+ counter.setBigUint64(8, BigInt(n), true);
92
+ const stream = block(subkey, input);
93
+ for (let i = 0; i < 64 && offset + i < data.length; i++)
94
+ out[offset + i] = (data[offset + i] ?? 0) ^ (stream[i] ?? 0);
95
+ }
96
+ return out;
97
+ };
@@ -0,0 +1,165 @@
1
+ // Where an Actions-family secret or variable lives (repository, environment, organization, the user's Codespaces) and who may read an org-level one.
2
+ import { s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { enc, repoField } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import { num } from "./read.ts";
6
+
7
+ export const scopeFields = {
8
+ repo: repoField,
9
+ env: s.optional(
10
+ s.string({ description: "Deployment environment of the repo." }),
11
+ ),
12
+ org: s.optional(s.string({ description: "Organization login." })),
13
+ };
14
+
15
+ export const accessFields = {
16
+ visibility: s.optional(
17
+ s.enum(["all", "private", "selected"], {
18
+ description:
19
+ "Organization visibility (default private, or selected when repos is given).",
20
+ }),
21
+ ),
22
+ repos: s.optional(
23
+ s.array(s.string(), {
24
+ description:
25
+ "Repositories allowed to read it (name inside the org, or owner/name). Org scope with visibility selected, or user scope.",
26
+ }),
27
+ ),
28
+ };
29
+
30
+ export type Where = {
31
+ readonly repo?: string | undefined;
32
+ readonly env?: string | undefined;
33
+ readonly org?: string | undefined;
34
+ readonly user?: boolean | undefined;
35
+ };
36
+
37
+ export type Scope =
38
+ | {
39
+ readonly kind: "repo";
40
+ readonly base: string;
41
+ readonly fields: { readonly repo: string };
42
+ }
43
+ | {
44
+ readonly kind: "env";
45
+ readonly base: string;
46
+ readonly fields: { readonly repo: string; readonly env: string };
47
+ }
48
+ | {
49
+ readonly kind: "org";
50
+ readonly base: string;
51
+ readonly fields: { readonly org: string };
52
+ }
53
+ | {
54
+ readonly kind: "user";
55
+ readonly base: string;
56
+ readonly fields: { readonly user: true };
57
+ };
58
+
59
+ const usage = (message: string, hint: string) =>
60
+ new SurfaceError("usage", message, hint);
61
+
62
+ export const resolveScope = async (
63
+ gh: GitHub,
64
+ where: Where,
65
+ app: string,
66
+ noun: string,
67
+ ): Promise<Scope> => {
68
+ const { env, org, user } = where;
69
+ const chosen = [env, org, user === true ? true : undefined].filter(
70
+ (x) => x !== undefined,
71
+ );
72
+ if (chosen.length > 1)
73
+ throw usage("pass only one of env, org and user", "pick one scope");
74
+ if (org !== undefined)
75
+ return {
76
+ kind: "org",
77
+ base: `orgs/${enc(org)}/${app}/${noun}`,
78
+ fields: { org },
79
+ };
80
+ if (user === true) {
81
+ if (app !== "codespaces")
82
+ throw usage(
83
+ "user secrets exist only for codespaces",
84
+ "omit app or pass app: codespaces",
85
+ );
86
+ return {
87
+ kind: "user",
88
+ base: `user/codespaces/${noun}`,
89
+ fields: { user: true },
90
+ };
91
+ }
92
+ const r = await gh.repo(where.repo);
93
+ if (env === undefined)
94
+ return {
95
+ kind: "repo",
96
+ base: `repos/${r.full}/${app}/${noun}`,
97
+ fields: { repo: r.full },
98
+ };
99
+ if (app !== "actions")
100
+ throw usage(
101
+ "environment secrets and variables exist only for actions",
102
+ "omit app or pass app: actions",
103
+ );
104
+ return {
105
+ kind: "env",
106
+ base: `repos/${r.full}/environments/${enc(env)}/${noun}`,
107
+ fields: { repo: r.full, env },
108
+ };
109
+ };
110
+
111
+ const repoIds = (
112
+ gh: GitHub,
113
+ owner: string | undefined,
114
+ repos: readonly string[],
115
+ ): Promise<number[]> =>
116
+ Promise.all(
117
+ repos.map(async (name) => {
118
+ if (owner === undefined && !name.includes("/"))
119
+ throw usage(
120
+ `repo ${name} needs its owner`,
121
+ "write repos as owner/name",
122
+ );
123
+ const r = await gh.repo(name.includes("/") ? name : `${owner}/${name}`);
124
+ return num(await gh.rest("GET", `repos/${r.full}`), "id");
125
+ }),
126
+ );
127
+
128
+ export const accessBody = async (
129
+ gh: GitHub,
130
+ scope: Scope,
131
+ visibility: "all" | "private" | "selected" | undefined,
132
+ repos: readonly string[] | undefined,
133
+ ): Promise<Readonly<Record<string, unknown>>> => {
134
+ if (scope.kind === "repo" || scope.kind === "env") {
135
+ if (visibility !== undefined || repos !== undefined)
136
+ throw usage(
137
+ "visibility and repos apply to org or user scope only",
138
+ "pass org, or drop them",
139
+ );
140
+ return {};
141
+ }
142
+ if (scope.kind === "user") {
143
+ if (visibility !== undefined)
144
+ throw usage(
145
+ "user secrets have no visibility",
146
+ "pass repos to choose who reads it",
147
+ );
148
+ return repos === undefined
149
+ ? {}
150
+ : { selected_repository_ids: await repoIds(gh, undefined, repos) };
151
+ }
152
+ const chosen = visibility ?? (repos === undefined ? "private" : "selected");
153
+ if (chosen !== "selected") {
154
+ if (repos !== undefined)
155
+ throw usage(
156
+ "repos needs visibility selected",
157
+ "drop repos or pass visibility: selected",
158
+ );
159
+ return { visibility: chosen };
160
+ }
161
+ return {
162
+ visibility: chosen,
163
+ selected_repository_ids: await repoIds(gh, scope.fields.org, repos ?? []),
164
+ };
165
+ };
@@ -0,0 +1,75 @@
1
+ // libsodium's crypto_box_seal in pure TypeScript, the encryption GitHub requires for a secret value.
2
+ import { createPrivateKey, createPublicKey, diffieHellman } from "node:crypto";
3
+ import { blake2b } from "./blake2b.ts";
4
+ import { poly1305 } from "./poly1305.ts";
5
+ import { hsalsa20, xsalsa20 } from "./salsa20.ts";
6
+
7
+ const KEY_BYTES = 32;
8
+ const PKCS8_X25519 = Buffer.from("302e020100300506032b656e04220420", "hex");
9
+ const SPKI_X25519 = Buffer.from("302a300506032b656e032100", "hex");
10
+
11
+ const privateKey = (secret: Uint8Array) =>
12
+ createPrivateKey({
13
+ key: Buffer.concat([PKCS8_X25519, secret]),
14
+ format: "der",
15
+ type: "pkcs8",
16
+ });
17
+
18
+ const publicKey = (raw: Uint8Array) =>
19
+ createPublicKey({
20
+ key: Buffer.concat([SPKI_X25519, raw]),
21
+ format: "der",
22
+ type: "spki",
23
+ });
24
+
25
+ const rawPublicKey = (secret: Uint8Array): Uint8Array =>
26
+ new Uint8Array(
27
+ createPublicKey(privateKey(secret))
28
+ .export({ format: "der", type: "spki" })
29
+ .subarray(SPKI_X25519.length),
30
+ );
31
+
32
+ /** crypto_box_easy: XSalsa20-Poly1305 under the HSalsa20 of the X25519 shared secret; output is MAC || ciphertext. */
33
+ const boxEasy = (
34
+ message: Uint8Array,
35
+ nonce: Uint8Array,
36
+ recipient: Uint8Array,
37
+ secret: Uint8Array,
38
+ ): Uint8Array => {
39
+ const shared = diffieHellman({
40
+ privateKey: privateKey(secret),
41
+ publicKey: publicKey(recipient),
42
+ });
43
+ const key = hsalsa20(new Uint8Array(shared), new Uint8Array(16));
44
+ const padded = new Uint8Array(KEY_BYTES + message.length);
45
+ padded.set(message, KEY_BYTES);
46
+ const stream = xsalsa20(key, nonce, padded);
47
+ const ciphertext = stream.subarray(KEY_BYTES);
48
+ const out = new Uint8Array(16 + message.length);
49
+ out.set(poly1305(stream.subarray(0, KEY_BYTES), ciphertext));
50
+ out.set(ciphertext, 16);
51
+ return out;
52
+ };
53
+
54
+ export const seal = (
55
+ recipientPublicKey: Uint8Array,
56
+ message: Uint8Array,
57
+ ephemeralSecret: Uint8Array = crypto.getRandomValues(
58
+ new Uint8Array(KEY_BYTES),
59
+ ),
60
+ ): Uint8Array => {
61
+ if (recipientPublicKey.length !== KEY_BYTES)
62
+ throw new RangeError("recipient public key must be 32 bytes");
63
+ if (ephemeralSecret.length !== KEY_BYTES)
64
+ throw new RangeError("ephemeral secret must be 32 bytes");
65
+ const ephemeral = rawPublicKey(ephemeralSecret);
66
+ const nonceInput = new Uint8Array(2 * KEY_BYTES);
67
+ nonceInput.set(ephemeral);
68
+ nonceInput.set(recipientPublicKey, KEY_BYTES);
69
+ const nonce = blake2b(nonceInput, 24);
70
+ const box = boxEasy(message, nonce, recipientPublicKey, ephemeralSecret);
71
+ const out = new Uint8Array(KEY_BYTES + box.length);
72
+ out.set(ephemeral);
73
+ out.set(box, KEY_BYTES);
74
+ return out;
75
+ };
@@ -0,0 +1,114 @@
1
+ // Commit search across GitHub: free text plus the qualifiers `gh search commits` turns its flags into.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { limitField, reads } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import { arr, at, num, optStr, str } from "./read.ts";
6
+
7
+ const quote = (v: string) => (/\s/.test(v) ? `"${v}"` : v);
8
+
9
+ const commitItem = (c: unknown) => ({
10
+ repo: str(c, "repository", "full_name"),
11
+ sha: str(c, "sha"),
12
+ message: str(c, "commit", "message"),
13
+ author: optStr(c, "author", "login"),
14
+ authorName: optStr(c, "commit", "author", "name"),
15
+ authorDate: optStr(c, "commit", "author", "date"),
16
+ committer: optStr(c, "committer", "login"),
17
+ committerDate: optStr(c, "commit", "committer", "date"),
18
+ url: str(c, "html_url"),
19
+ });
20
+
21
+ const text = (description: string) => s.optional(s.string({ description }));
22
+ const date = text("Date or range: 2024-01-01, >2024-01-01, 2024-01..2024-03.");
23
+ const many = (description: string) =>
24
+ s.optional(s.array(s.string(), { description }));
25
+
26
+ export const commitSearchOp = (gh: GitHub) =>
27
+ op({
28
+ description:
29
+ "Search commits by message text and qualifiers (author, committer, dates, hash, merge, repo, owner, visibility), best match first unless `sort` is set. `total` is null when more than 100 results are requested. Replaces `gh search commits`.",
30
+ input: s.object({
31
+ query: text("Words to find in commit messages."),
32
+ author: text("Author login."),
33
+ authorEmail: s.optional(s.string()),
34
+ authorName: s.optional(s.string()),
35
+ authorDate: date,
36
+ committer: text("Committer login."),
37
+ committerEmail: s.optional(s.string()),
38
+ committerName: s.optional(s.string()),
39
+ committerDate: date,
40
+ hash: s.optional(s.string()),
41
+ parent: text("Parent commit hash."),
42
+ tree: text("Tree hash."),
43
+ merge: s.optional(
44
+ s.boolean({
45
+ description: "true for merge commits only, false to exclude them.",
46
+ }),
47
+ ),
48
+ repo: many("owner/name repositories."),
49
+ owner: many("Repository owners (users or organizations)."),
50
+ visibility: s.optional(
51
+ s.array(s.enum(["public", "private", "internal"])),
52
+ ),
53
+ sort: s.optional(s.enum(["author-date", "committer-date"])),
54
+ order: s.optional(
55
+ s.enum(["asc", "desc"], { description: "Applies only with sort." }),
56
+ ),
57
+ limit: limitField(30),
58
+ }),
59
+ annotations: reads,
60
+ run: async (input) => {
61
+ const single = {
62
+ author: input.author,
63
+ "author-email": input.authorEmail,
64
+ "author-name": input.authorName,
65
+ "author-date": input.authorDate,
66
+ committer: input.committer,
67
+ "committer-email": input.committerEmail,
68
+ "committer-name": input.committerName,
69
+ "committer-date": input.committerDate,
70
+ hash: input.hash,
71
+ parent: input.parent,
72
+ tree: input.tree,
73
+ merge: input.merge === undefined ? undefined : String(input.merge),
74
+ };
75
+ const q = [
76
+ input.query ?? "",
77
+ ...Object.entries(single).flatMap(([k, v]) =>
78
+ v === undefined ? [] : [`${k}:${quote(v)}`],
79
+ ),
80
+ ...(input.repo ?? []).map((v) => `repo:${quote(v)}`),
81
+ ...(input.owner ?? []).map((v) => `user:${quote(v)}`),
82
+ ...(input.visibility ?? []).map((v) => `is:${v}`),
83
+ ]
84
+ .filter(Boolean)
85
+ .join(" ");
86
+ if (q === "")
87
+ throw new SurfaceError(
88
+ "usage",
89
+ "empty commit search",
90
+ "pass query text or at least one qualifier",
91
+ );
92
+ const limit = input.limit ?? 30;
93
+ const query = {
94
+ q,
95
+ ...(input.sort === undefined
96
+ ? {}
97
+ : { sort: input.sort, order: input.order ?? "desc" }),
98
+ };
99
+ if (limit > 100)
100
+ return {
101
+ total: null,
102
+ items: (
103
+ await gh.list("search/commits", limit, { query, key: "items" })
104
+ ).map(commitItem),
105
+ };
106
+ const page = await gh.rest("GET", "search/commits", {
107
+ query: { ...query, per_page: Math.max(1, limit) },
108
+ });
109
+ return {
110
+ total: num(page, "total_count"),
111
+ items: arr(at(page, "items"), "items").map(commitItem),
112
+ };
113
+ },
114
+ });
@@ -0,0 +1,116 @@
1
+ import { op, s } from "../vendor/surface/index.ts";
2
+ import { limitField, reads } from "./fields.ts";
3
+ import type { GitHub } from "./http.ts";
4
+ import { arr, at, bool, num, optStr, str } from "./read.ts";
5
+
6
+ const issueItem = (i: unknown) => ({
7
+ repo: (optStr(i, "repository_url") ?? "").replace(/^.*\/repos\//, ""),
8
+ number: num(i, "number"),
9
+ title: str(i, "title"),
10
+ state: str(i, "state"),
11
+ isPr: at(i, "pull_request") !== undefined,
12
+ merged: optStr(i, "pull_request", "merged_at") !== null,
13
+ draft: bool(i, "draft"),
14
+ author: optStr(i, "user", "login"),
15
+ url: str(i, "html_url"),
16
+ createdAt: optStr(i, "created_at"),
17
+ updatedAt: optStr(i, "updated_at"),
18
+ });
19
+
20
+ export const searchRaw = async (
21
+ gh: GitHub,
22
+ q: string,
23
+ limit: number,
24
+ ): Promise<{ total: number | null; raw: readonly unknown[] }> => {
25
+ const query = { q, sort: "updated", order: "desc" };
26
+ if (limit > 100)
27
+ return {
28
+ total: null,
29
+ raw: await gh.list("search/issues", limit, { query, key: "items" }),
30
+ };
31
+ const page = await gh.rest("GET", "search/issues", {
32
+ query: { ...query, per_page: Math.max(1, limit) },
33
+ });
34
+ return {
35
+ total: num(page, "total_count"),
36
+ raw: arr(at(page, "items"), "items"),
37
+ };
38
+ };
39
+
40
+ const searchItems = async (gh: GitHub, q: string, limit: number) => {
41
+ const { total, raw } = await searchRaw(gh, q, limit);
42
+ return { total, items: raw.map(issueItem) };
43
+ };
44
+
45
+ const scoped = (q: string, repo: string | undefined, extra: string) =>
46
+ [q, repo === undefined ? "" : `repo:${repo}`, extra]
47
+ .filter(Boolean)
48
+ .join(" ");
49
+
50
+ export const searchOps = (gh: GitHub) => ({
51
+ issues: op({
52
+ description:
53
+ "Search issues and pull requests with GitHub search syntax (is:open label:bug author:x ...). `type` narrows to issues or PRs. Replaces `gh search issues` / `gh search prs`.",
54
+ input: s.object({
55
+ query: s.string({ description: "GitHub issue search syntax." }),
56
+ type: s.optional(s.enum(["issue", "pr", "any"])),
57
+ repo: s.optional(s.string({ description: "owner/name to scope to." })),
58
+ limit: limitField(30),
59
+ }),
60
+ annotations: reads,
61
+ run: ({ query, type, repo, limit }) =>
62
+ searchItems(
63
+ gh,
64
+ scoped(
65
+ query,
66
+ repo,
67
+ type === "pr" ? "is:pr" : type === "issue" ? "is:issue" : "",
68
+ ),
69
+ limit ?? 30,
70
+ ),
71
+ }),
72
+ code: op({
73
+ description:
74
+ "Search code (GitHub code search syntax) with matching fragments. Replaces `gh search code`.",
75
+ input: s.object({
76
+ query: s.string(),
77
+ repo: s.optional(s.string()),
78
+ limit: limitField(20),
79
+ }),
80
+ annotations: reads,
81
+ run: async ({ query, repo, limit }) => {
82
+ const raw = await gh.list("search/code", limit ?? 20, {
83
+ query: { q: scoped(query, repo, "") },
84
+ key: "items",
85
+ accept: "application/vnd.github.text-match+json",
86
+ });
87
+ return raw.map((c) => ({
88
+ repo: str(c, "repository", "full_name"),
89
+ path: str(c, "path"),
90
+ url: str(c, "html_url"),
91
+ fragments: [at(c, "text_matches")].flat().flatMap((m) => {
92
+ const f = optStr(m, "fragment");
93
+ return f === null ? [] : [f];
94
+ }),
95
+ }));
96
+ },
97
+ }),
98
+ repos: op({
99
+ description: "Search repositories. Replaces `gh search repos`.",
100
+ input: s.object({ query: s.string(), limit: limitField(20) }),
101
+ annotations: reads,
102
+ run: async ({ query, limit }) =>
103
+ (
104
+ await gh.list("search/repositories", limit ?? 20, {
105
+ query: { q: query },
106
+ key: "items",
107
+ })
108
+ ).map((r) => ({
109
+ repo: str(r, "full_name"),
110
+ description: optStr(r, "description"),
111
+ stars: num(r, "stargazers_count"),
112
+ url: str(r, "html_url"),
113
+ pushedAt: optStr(r, "pushed_at"),
114
+ })),
115
+ }),
116
+ });
@@ -0,0 +1,131 @@
1
+ // Actions, Codespaces and Dependabot secrets: list, set (sealed locally with the scope's public key) and delete.
2
+ import { op, s, SurfaceError } from "../vendor/surface/index.ts";
3
+ import { enc, irreversible, reads, writes } from "./fields.ts";
4
+ import type { GitHub } from "./http.ts";
5
+ import { optStr, str } from "./read.ts";
6
+ import { seal } from "./sealed-box.ts";
7
+ import {
8
+ accessBody,
9
+ accessFields,
10
+ resolveScope,
11
+ scopeFields,
12
+ type Where,
13
+ } from "./scopes.ts";
14
+
15
+ const appField = s.optional(
16
+ s.enum(["actions", "codespaces", "dependabot"], {
17
+ description: "Secret store (default actions, or codespaces with user).",
18
+ }),
19
+ );
20
+ const where = {
21
+ ...scopeFields,
22
+ user: s.optional(s.boolean({ description: "Your Codespaces user secrets." })),
23
+ app: appField,
24
+ };
25
+
26
+ const scopeOf = (
27
+ gh: GitHub,
28
+ w: Where & { readonly app?: string | undefined },
29
+ ) => {
30
+ const app = w.app ?? (w.user === true ? "codespaces" : "actions");
31
+ return resolveScope(gh, w, app, "secrets").then((scope) => ({ app, scope }));
32
+ };
33
+
34
+ const plaintext = async (
35
+ value: string | undefined,
36
+ file: string | undefined,
37
+ ): Promise<Uint8Array> => {
38
+ if ((value === undefined) === (file === undefined))
39
+ throw new SurfaceError(
40
+ "usage",
41
+ "pass exactly one of value and file",
42
+ "give the secret inline as value, or a path to read it from as file",
43
+ );
44
+ if (value !== undefined) return new TextEncoder().encode(value);
45
+ const source = Bun.file(file ?? "");
46
+ if (!(await source.exists()))
47
+ throw new SurfaceError("usage", `no such file: ${file}`, "check the path");
48
+ return new Uint8Array(await source.arrayBuffer());
49
+ };
50
+
51
+ const sealFor = async (
52
+ gh: GitHub,
53
+ base: string,
54
+ message: Uint8Array,
55
+ ): Promise<{ readonly encrypted_value: string; readonly key_id: string }> => {
56
+ const publicKey = await gh.rest("GET", `${base}/public-key`);
57
+ const key = Buffer.from(str(publicKey, "key"), "base64");
58
+ if (key.length !== 32)
59
+ throw new SurfaceError(
60
+ "invalid_response",
61
+ "the scope's public key is not a 32-byte X25519 key",
62
+ "inspect it with `api rest` on the public-key endpoint",
63
+ );
64
+ return {
65
+ encrypted_value: Buffer.from(seal(key, message)).toString("base64"),
66
+ key_id: str(publicKey, "key_id"),
67
+ };
68
+ };
69
+
70
+ export const secretOps = (gh: GitHub) => ({
71
+ list: op({
72
+ description:
73
+ "Secret names (never values) with their update time, and visibility at org scope. Replaces `gh secret list`.",
74
+ input: s.object(where),
75
+ annotations: reads,
76
+ run: async (input) => {
77
+ const { app, scope } = await scopeOf(gh, input);
78
+ const raw = await gh.list(scope.base, 1000, { key: "secrets" });
79
+ return {
80
+ ...scope.fields,
81
+ app,
82
+ items: raw.map((x) => ({
83
+ name: str(x, "name"),
84
+ createdAt: optStr(x, "created_at"),
85
+ updatedAt: optStr(x, "updated_at"),
86
+ visibility: optStr(x, "visibility"),
87
+ })),
88
+ };
89
+ },
90
+ }),
91
+ set: op({
92
+ description:
93
+ "Create or update a secret: the value is encrypted locally with the scope's public key and only the ciphertext is sent; the result never contains it. Replaces `gh secret set`.",
94
+ input: s.object({
95
+ name: s.string(),
96
+ ...where,
97
+ value: s.optional(
98
+ s.string({
99
+ description:
100
+ "The secret value. On the CLI pass it through --input, never as a flag.",
101
+ secret: true,
102
+ }),
103
+ ),
104
+ file: s.optional(
105
+ s.string({ description: "Path of a file whose bytes are the value." }),
106
+ ),
107
+ ...accessFields,
108
+ }),
109
+ annotations: writes,
110
+ run: async ({ name, value, file, visibility, repos, ...rest }) => {
111
+ const message = await plaintext(value, file);
112
+ const { app, scope } = await scopeOf(gh, rest);
113
+ const access = await accessBody(gh, scope, visibility, repos);
114
+ const sealed = await sealFor(gh, scope.base, message);
115
+ await gh.rest("PUT", `${scope.base}/${enc(name)}`, {
116
+ body: { ...sealed, ...access },
117
+ });
118
+ return { ...scope.fields, app, name };
119
+ },
120
+ }),
121
+ delete: op({
122
+ description: "Delete a secret. Replaces `gh secret delete`.",
123
+ input: s.object({ name: s.string(), ...where }),
124
+ annotations: irreversible,
125
+ run: async ({ name, ...rest }) => {
126
+ const { app, scope } = await scopeOf(gh, rest);
127
+ await gh.rest("DELETE", `${scope.base}/${enc(name)}`);
128
+ return { ...scope.fields, app, name, deleted: true };
129
+ },
130
+ }),
131
+ });