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.
- package/.agents/command/remove-deadcode.md +1 -1
- package/.agents/skills/remove-deadcode/SKILL.md +1 -1
- package/.agents/skills/work-with-pr/SKILL.md +2 -2
- package/.opencode/command/remove-deadcode.md +1 -1
- package/.opencode/skills/work-with-pr/SKILL.md +2 -2
- package/THIRD-PARTY-NOTICES.md +9 -3
- package/dist/cli/cli-program.d.ts +3 -0
- package/dist/cli/index.js +1197 -1008
- package/dist/cli/service-auth/devices.d.ts +5 -2
- package/dist/cli-node/index.js +1197 -1008
- package/dist/config/schema/agent-names.d.ts +1 -0
- package/dist/index.js +194 -213
- package/dist/skills/browser/SKILL.md +100 -91
- package/dist/skills/browser/references/commands.md +92 -27
- package/dist/skills/browser/references/desktop.md +22 -0
- package/dist/skills/browser/references/install.md +18 -0
- package/dist/skills/browser/references/owned-engine/README.md +7 -2
- package/dist/skills/browser/references/owned-engine/frames-and-humans.md +9 -2
- package/dist/skills/browser/references/owned-engine/network.md +13 -7
- package/dist/skills/browser/references/recipes/1password.md +6 -2
- package/dist/skills/browser/runtime/omowright/index.js +15 -15
- package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
- package/dist/skills/debugging/SKILL.md +1 -1
- package/dist/skills/debugging/references/tools/browser-qa.md +1 -1
- package/dist/skills/git/SKILL.md +62 -0
- package/dist/skills/git/agents/openai.yaml +13 -0
- package/dist/skills/github/SKILL.md +94 -0
- package/dist/skills/github/references/branch-rules.md +129 -0
- package/dist/skills/github/references/evidence-attachments.md +16 -0
- package/dist/skills/github/references/repo-setup.md +152 -0
- package/dist/skills/github/references/waiting.md +52 -0
- package/dist/skills/github/references/workflows.md +161 -0
- package/dist/skills/github/scripts/cli.ts +8 -0
- package/dist/skills/github/scripts/package.json +12 -0
- package/dist/skills/github/scripts/sdk.ts +11 -0
- package/dist/skills/github/scripts/src/account.ts +243 -0
- package/dist/skills/github/scripts/src/actions-write.ts +86 -0
- package/dist/skills/github/scripts/src/actions.ts +210 -0
- package/dist/skills/github/scripts/src/attestations.ts +136 -0
- package/dist/skills/github/scripts/src/blake2b.ts +102 -0
- package/dist/skills/github/scripts/src/branch-protection.ts +192 -0
- package/dist/skills/github/scripts/src/caches.ts +105 -0
- package/dist/skills/github/scripts/src/checks.ts +107 -0
- package/dist/skills/github/scripts/src/codespaces.ts +230 -0
- package/dist/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/dist/skills/github/scripts/src/discussion-list.ts +126 -0
- package/dist/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/dist/skills/github/scripts/src/discussions.ts +234 -0
- package/dist/skills/github/scripts/src/env.ts +100 -0
- package/dist/skills/github/scripts/src/errors.ts +79 -0
- package/dist/skills/github/scripts/src/fields.ts +27 -0
- package/dist/skills/github/scripts/src/gist-shape.ts +58 -0
- package/dist/skills/github/scripts/src/gists-write.ts +130 -0
- package/dist/skills/github/scripts/src/gists.ts +118 -0
- package/dist/skills/github/scripts/src/git-auth.ts +46 -0
- package/dist/skills/github/scripts/src/http.ts +159 -0
- package/dist/skills/github/scripts/src/issue-develop.ts +118 -0
- package/dist/skills/github/scripts/src/issues-extra.ts +135 -0
- package/dist/skills/github/scripts/src/issues-write.ts +174 -0
- package/dist/skills/github/scripts/src/issues.ts +156 -0
- package/dist/skills/github/scripts/src/keys.ts +176 -0
- package/dist/skills/github/scripts/src/labels.ts +209 -0
- package/dist/skills/github/scripts/src/merge.ts +115 -0
- package/dist/skills/github/scripts/src/poly1305.ts +22 -0
- package/dist/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/dist/skills/github/scripts/src/pr-view.ts +106 -0
- package/dist/skills/github/scripts/src/project-fields.ts +144 -0
- package/dist/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/dist/skills/github/scripts/src/project-items.ts +191 -0
- package/dist/skills/github/scripts/src/project-links.ts +104 -0
- package/dist/skills/github/scripts/src/project-ref.ts +145 -0
- package/dist/skills/github/scripts/src/project-state.ts +99 -0
- package/dist/skills/github/scripts/src/projects.ts +158 -0
- package/dist/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/dist/skills/github/scripts/src/pulls-read.ts +176 -0
- package/dist/skills/github/scripts/src/pulls-review.ts +206 -0
- package/dist/skills/github/scripts/src/pulls-write.ts +187 -0
- package/dist/skills/github/scripts/src/raw.ts +78 -0
- package/dist/skills/github/scripts/src/read.ts +77 -0
- package/dist/skills/github/scripts/src/release-assets.ts +111 -0
- package/dist/skills/github/scripts/src/release-download.ts +151 -0
- package/dist/skills/github/scripts/src/release-write.ts +197 -0
- package/dist/skills/github/scripts/src/repo-admin.ts +112 -0
- package/dist/skills/github/scripts/src/repo-content.ts +187 -0
- package/dist/skills/github/scripts/src/repo-create.ts +139 -0
- package/dist/skills/github/scripts/src/repo-extras.ts +217 -0
- package/dist/skills/github/scripts/src/repo-list.ts +143 -0
- package/dist/skills/github/scripts/src/repo-settings.ts +176 -0
- package/dist/skills/github/scripts/src/repo-sync.ts +81 -0
- package/dist/skills/github/scripts/src/repo-url.ts +104 -0
- package/dist/skills/github/scripts/src/repos.ts +87 -0
- package/dist/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/dist/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/dist/skills/github/scripts/src/rulesets.ts +80 -0
- package/dist/skills/github/scripts/src/run-download.ts +88 -0
- package/dist/skills/github/scripts/src/salsa20.ts +97 -0
- package/dist/skills/github/scripts/src/scopes.ts +165 -0
- package/dist/skills/github/scripts/src/sealed-box.ts +75 -0
- package/dist/skills/github/scripts/src/search-commits.ts +114 -0
- package/dist/skills/github/scripts/src/search.ts +116 -0
- package/dist/skills/github/scripts/src/secrets.ts +131 -0
- package/dist/skills/github/scripts/src/snappy.ts +57 -0
- package/dist/skills/github/scripts/src/status-search.ts +55 -0
- package/dist/skills/github/scripts/src/transfer.ts +97 -0
- package/dist/skills/github/scripts/src/types.ts +75 -0
- package/dist/skills/github/scripts/src/variables.ts +86 -0
- package/dist/skills/github/scripts/src/wait.ts +164 -0
- package/dist/skills/github/scripts/src/wire.ts +159 -0
- package/dist/skills/github/scripts/src/workflows.ts +144 -0
- package/dist/skills/github/scripts/src/zip.ts +104 -0
- package/dist/skills/github/scripts/surface.ts +106 -0
- package/dist/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/dist/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/dist/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/dist/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/dist/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/dist/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/dist/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/dist/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/dist/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/dist/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/dist/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/dist/skills/programming/SKILL.md +51 -320
- package/dist/skills/programming/references/go/README.md +1 -0
- package/dist/skills/programming/references/python/README.md +21 -3
- package/dist/skills/programming/references/python/error-handling.md +14 -0
- package/dist/skills/programming/references/rust/README.md +5 -1
- package/dist/skills/programming/references/typescript/README.md +9 -3
- package/dist/skills/programming/references/typescript/error-handling.md +18 -0
- package/dist/skills/ultimate-browsing/SKILL.md +1 -1
- package/dist/skills/ulw-execute/SKILL.md +1 -1
- package/dist/skills/visual-qa/references/browser-setup.md +5 -5
- package/dist/tui.js +32 -29
- package/package.json +28 -26
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +2 -2
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +8711 -172
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +8660 -121
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +5 -0
- package/packages/omo-codex/plugin/components/telemetry/tsconfig.json +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +3 -3
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/shared/src/config-loader.ts +15 -1
- package/packages/omo-codex/plugin/skills/browser/SKILL.md +100 -91
- package/packages/omo-codex/plugin/skills/browser/references/commands.md +92 -27
- package/packages/omo-codex/plugin/skills/browser/references/desktop.md +22 -0
- package/packages/omo-codex/plugin/skills/browser/references/install.md +18 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +7 -2
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +9 -2
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/network.md +13 -7
- package/packages/omo-codex/plugin/skills/browser/references/recipes/1password.md +6 -2
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +15 -15
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/omo-codex/plugin/skills/debugging/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/debugging/references/tools/browser-qa.md +1 -1
- package/packages/omo-codex/plugin/skills/git/SKILL.md +62 -0
- package/packages/omo-codex/plugin/skills/git/agents/openai.yaml +13 -0
- package/packages/omo-codex/plugin/skills/github/SKILL.md +94 -0
- package/packages/omo-codex/plugin/skills/github/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/github/references/branch-rules.md +129 -0
- package/packages/omo-codex/plugin/skills/github/references/evidence-attachments.md +16 -0
- package/packages/omo-codex/plugin/skills/github/references/repo-setup.md +152 -0
- package/packages/omo-codex/plugin/skills/github/references/waiting.md +52 -0
- package/packages/omo-codex/plugin/skills/github/references/workflows.md +161 -0
- package/packages/omo-codex/plugin/skills/github/scripts/cli.ts +8 -0
- package/packages/omo-codex/plugin/skills/github/scripts/package.json +12 -0
- package/packages/omo-codex/plugin/skills/github/scripts/sdk.ts +11 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/account.ts +243 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/actions-write.ts +86 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/actions.ts +210 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/attestations.ts +136 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/blake2b.ts +102 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/branch-protection.ts +192 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/caches.ts +105 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/checks.ts +107 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/codespaces.ts +230 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-list.ts +126 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussions.ts +234 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/env.ts +100 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/errors.ts +79 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/fields.ts +27 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gist-shape.ts +58 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gists-write.ts +130 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gists.ts +118 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/git-auth.ts +46 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/http.ts +159 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issue-develop.ts +118 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues-extra.ts +135 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues-write.ts +174 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues.ts +156 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/keys.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/labels.ts +209 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/merge.ts +115 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/poly1305.ts +22 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pr-view.ts +106 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-fields.ts +144 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-items.ts +191 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-links.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-ref.ts +145 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-state.ts +99 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/projects.ts +158 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-read.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-review.ts +206 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-write.ts +187 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/raw.ts +78 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/read.ts +77 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-assets.ts +111 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-download.ts +151 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-write.ts +197 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-admin.ts +112 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-content.ts +187 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-create.ts +139 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-extras.ts +217 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-list.ts +143 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-settings.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-sync.ts +81 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-url.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repos.ts +87 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets.ts +80 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/run-download.ts +88 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/salsa20.ts +97 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/scopes.ts +165 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/sealed-box.ts +75 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/search-commits.ts +114 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/search.ts +116 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/secrets.ts +131 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/snappy.ts +57 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/status-search.ts +55 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/transfer.ts +97 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/types.ts +75 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/variables.ts +86 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/wait.ts +164 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/wire.ts +159 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/workflows.ts +144 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/zip.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/surface.ts +106 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +51 -320
- package/packages/omo-codex/plugin/skills/programming/references/go/README.md +1 -0
- package/packages/omo-codex/plugin/skills/programming/references/python/README.md +21 -3
- package/packages/omo-codex/plugin/skills/programming/references/python/error-handling.md +14 -0
- package/packages/omo-codex/plugin/skills/programming/references/rust/README.md +5 -1
- package/packages/omo-codex/plugin/skills/programming/references/typescript/README.md +9 -3
- package/packages/omo-codex/plugin/skills/programming/references/typescript/error-handling.md +18 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +3 -3
- package/packages/omo-codex/plugin/skills/visual-qa/references/browser-setup.md +5 -5
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -1
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +5 -5
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +21279 -20738
- package/packages/shared-skills/skills/browser/SKILL.md +100 -91
- package/packages/shared-skills/skills/browser/references/commands.md +92 -27
- package/packages/shared-skills/skills/browser/references/desktop.md +22 -0
- package/packages/shared-skills/skills/browser/references/install.md +18 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/README.md +7 -2
- package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +9 -2
- package/packages/shared-skills/skills/browser/references/owned-engine/network.md +13 -7
- package/packages/shared-skills/skills/browser/references/recipes/1password.md +6 -2
- package/packages/shared-skills/skills/browser/runtime/omowright/index.js +15 -15
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/shared-skills/skills/debugging/SKILL.md +1 -1
- package/packages/shared-skills/skills/debugging/references/tools/browser-qa.md +1 -1
- package/packages/shared-skills/skills/git/SKILL.md +62 -0
- package/packages/shared-skills/skills/git/agents/openai.yaml +13 -0
- package/packages/shared-skills/skills/github/SKILL.md +94 -0
- package/packages/shared-skills/skills/github/references/branch-rules.md +129 -0
- package/packages/shared-skills/skills/github/references/evidence-attachments.md +16 -0
- package/packages/shared-skills/skills/github/references/repo-setup.md +152 -0
- package/packages/shared-skills/skills/github/references/waiting.md +52 -0
- package/packages/shared-skills/skills/github/references/workflows.md +161 -0
- package/packages/shared-skills/skills/github/scripts/cli.ts +8 -0
- package/packages/shared-skills/skills/github/scripts/package.json +12 -0
- package/packages/shared-skills/skills/github/scripts/sdk.ts +11 -0
- package/packages/shared-skills/skills/github/scripts/src/account.ts +243 -0
- package/packages/shared-skills/skills/github/scripts/src/actions-write.ts +86 -0
- package/packages/shared-skills/skills/github/scripts/src/actions.ts +210 -0
- package/packages/shared-skills/skills/github/scripts/src/attestations.ts +136 -0
- package/packages/shared-skills/skills/github/scripts/src/blake2b.ts +102 -0
- package/packages/shared-skills/skills/github/scripts/src/branch-protection.ts +192 -0
- package/packages/shared-skills/skills/github/scripts/src/caches.ts +105 -0
- package/packages/shared-skills/skills/github/scripts/src/checks.ts +107 -0
- package/packages/shared-skills/skills/github/scripts/src/codespaces.ts +230 -0
- package/packages/shared-skills/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/packages/shared-skills/skills/github/scripts/src/discussion-list.ts +126 -0
- package/packages/shared-skills/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/packages/shared-skills/skills/github/scripts/src/discussions.ts +234 -0
- package/packages/shared-skills/skills/github/scripts/src/env.ts +100 -0
- package/packages/shared-skills/skills/github/scripts/src/errors.ts +79 -0
- package/packages/shared-skills/skills/github/scripts/src/fields.ts +27 -0
- package/packages/shared-skills/skills/github/scripts/src/gist-shape.ts +58 -0
- package/packages/shared-skills/skills/github/scripts/src/gists-write.ts +130 -0
- package/packages/shared-skills/skills/github/scripts/src/gists.ts +118 -0
- package/packages/shared-skills/skills/github/scripts/src/git-auth.ts +46 -0
- package/packages/shared-skills/skills/github/scripts/src/http.ts +159 -0
- package/packages/shared-skills/skills/github/scripts/src/issue-develop.ts +118 -0
- package/packages/shared-skills/skills/github/scripts/src/issues-extra.ts +135 -0
- package/packages/shared-skills/skills/github/scripts/src/issues-write.ts +174 -0
- package/packages/shared-skills/skills/github/scripts/src/issues.ts +156 -0
- package/packages/shared-skills/skills/github/scripts/src/keys.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/labels.ts +209 -0
- package/packages/shared-skills/skills/github/scripts/src/merge.ts +115 -0
- package/packages/shared-skills/skills/github/scripts/src/poly1305.ts +22 -0
- package/packages/shared-skills/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/packages/shared-skills/skills/github/scripts/src/pr-view.ts +106 -0
- package/packages/shared-skills/skills/github/scripts/src/project-fields.ts +144 -0
- package/packages/shared-skills/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/packages/shared-skills/skills/github/scripts/src/project-items.ts +191 -0
- package/packages/shared-skills/skills/github/scripts/src/project-links.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/src/project-ref.ts +145 -0
- package/packages/shared-skills/skills/github/scripts/src/project-state.ts +99 -0
- package/packages/shared-skills/skills/github/scripts/src/projects.ts +158 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-read.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-review.ts +206 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-write.ts +187 -0
- package/packages/shared-skills/skills/github/scripts/src/raw.ts +78 -0
- package/packages/shared-skills/skills/github/scripts/src/read.ts +77 -0
- package/packages/shared-skills/skills/github/scripts/src/release-assets.ts +111 -0
- package/packages/shared-skills/skills/github/scripts/src/release-download.ts +151 -0
- package/packages/shared-skills/skills/github/scripts/src/release-write.ts +197 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-admin.ts +112 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-content.ts +187 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-create.ts +139 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-extras.ts +217 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-list.ts +143 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-settings.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-sync.ts +81 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-url.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/src/repos.ts +87 -0
- package/packages/shared-skills/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/packages/shared-skills/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/packages/shared-skills/skills/github/scripts/src/rulesets.ts +80 -0
- package/packages/shared-skills/skills/github/scripts/src/run-download.ts +88 -0
- package/packages/shared-skills/skills/github/scripts/src/salsa20.ts +97 -0
- package/packages/shared-skills/skills/github/scripts/src/scopes.ts +165 -0
- package/packages/shared-skills/skills/github/scripts/src/sealed-box.ts +75 -0
- package/packages/shared-skills/skills/github/scripts/src/search-commits.ts +114 -0
- package/packages/shared-skills/skills/github/scripts/src/search.ts +116 -0
- package/packages/shared-skills/skills/github/scripts/src/secrets.ts +131 -0
- package/packages/shared-skills/skills/github/scripts/src/snappy.ts +57 -0
- package/packages/shared-skills/skills/github/scripts/src/status-search.ts +55 -0
- package/packages/shared-skills/skills/github/scripts/src/transfer.ts +97 -0
- package/packages/shared-skills/skills/github/scripts/src/types.ts +75 -0
- package/packages/shared-skills/skills/github/scripts/src/variables.ts +86 -0
- package/packages/shared-skills/skills/github/scripts/src/wait.ts +164 -0
- package/packages/shared-skills/skills/github/scripts/src/wire.ts +159 -0
- package/packages/shared-skills/skills/github/scripts/src/workflows.ts +144 -0
- package/packages/shared-skills/skills/github/scripts/src/zip.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/surface.ts +106 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/packages/shared-skills/skills/programming/SKILL.md +51 -320
- package/packages/shared-skills/skills/programming/references/go/README.md +1 -0
- package/packages/shared-skills/skills/programming/references/python/README.md +21 -3
- package/packages/shared-skills/skills/programming/references/python/error-handling.md +14 -0
- package/packages/shared-skills/skills/programming/references/rust/README.md +5 -1
- package/packages/shared-skills/skills/programming/references/typescript/README.md +9 -3
- package/packages/shared-skills/skills/programming/references/typescript/error-handling.md +18 -0
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +1 -1
- package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
- package/packages/shared-skills/skills/visual-qa/references/browser-setup.md +5 -5
- package/dist/skills/git-master/SKILL.md +0 -114
- package/dist/skills/git-master/agents/openai.yaml +0 -13
- package/packages/omo-codex/plugin/skills/git-master/SKILL.md +0 -114
- package/packages/omo-codex/plugin/skills/git-master/agents/openai.yaml +0 -13
- package/packages/shared-skills/skills/git-master/SKILL.md +0 -114
- package/packages/shared-skills/skills/git-master/agents/openai.yaml +0 -13
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// Reviews: submit one, read reviews and their line threads, reply in a thread, resolve it, dismiss a review.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { numberField, reads, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { at, bool, nodes, num, optNum, optStr, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const REVIEWS = `query($owner:String!,$name:String!,$number:Int!){repository(owner:$owner,name:$name){pullRequest(number:$number){
|
|
8
|
+
reviewDecision
|
|
9
|
+
reviews(first:100){nodes{id author{login} state body submittedAt url}}
|
|
10
|
+
reviewThreads(first:100){nodes{id path line startLine isOutdated isResolved resolvedBy{login}
|
|
11
|
+
comments(first:50){nodes{id author{login} body createdAt url}}}}}}}`;
|
|
12
|
+
|
|
13
|
+
const threadIdField = s.string({
|
|
14
|
+
description: "Review thread id from `pr reviews` (threads[].id).",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const comment = (c: unknown) => ({
|
|
18
|
+
id: str(c, "id"),
|
|
19
|
+
author: optStr(c, "author", "login"),
|
|
20
|
+
body: str(c, "body"),
|
|
21
|
+
createdAt: str(c, "createdAt"),
|
|
22
|
+
url: str(c, "url"),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const pullReviewOps = (gh: GitHub) => ({
|
|
26
|
+
review: op({
|
|
27
|
+
description:
|
|
28
|
+
"Submit a review on a PR: approve, request changes or comment, optionally with comments on lines of the diff. `body` is required unless approving or sending line comments with a comment review. Replaces `gh pr review`.",
|
|
29
|
+
input: s.object({
|
|
30
|
+
repo: repoField,
|
|
31
|
+
number: numberField,
|
|
32
|
+
event: s.enum(["approve", "request_changes", "comment"]),
|
|
33
|
+
body: s.optional(s.string()),
|
|
34
|
+
comments: s.optional(
|
|
35
|
+
s.array(
|
|
36
|
+
s.object({
|
|
37
|
+
path: s.string(),
|
|
38
|
+
line: s.integer({
|
|
39
|
+
description: "Line in the file (the last one of a range).",
|
|
40
|
+
}),
|
|
41
|
+
startLine: s.optional(s.integer()),
|
|
42
|
+
side: s.optional(
|
|
43
|
+
s.enum(["LEFT", "RIGHT"], {
|
|
44
|
+
description: "RIGHT (default) is the new version.",
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
body: s.string(),
|
|
48
|
+
}),
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
}),
|
|
52
|
+
annotations: writes,
|
|
53
|
+
run: async ({ repo, number, event, body, comments }) => {
|
|
54
|
+
const lineComments = comments ?? [];
|
|
55
|
+
const needsBody =
|
|
56
|
+
event === "request_changes" ||
|
|
57
|
+
(event === "comment" && lineComments.length === 0);
|
|
58
|
+
if (needsBody && (body === undefined || body === ""))
|
|
59
|
+
throw new SurfaceError(
|
|
60
|
+
"usage",
|
|
61
|
+
`a ${event} review needs a body`,
|
|
62
|
+
"pass body",
|
|
63
|
+
);
|
|
64
|
+
const r = await gh.repo(repo);
|
|
65
|
+
const v = await gh.rest(
|
|
66
|
+
"POST",
|
|
67
|
+
`repos/${r.full}/pulls/${number}/reviews`,
|
|
68
|
+
{
|
|
69
|
+
body: {
|
|
70
|
+
event: event.toUpperCase(),
|
|
71
|
+
...(body === undefined ? {} : { body }),
|
|
72
|
+
...(lineComments.length === 0
|
|
73
|
+
? {}
|
|
74
|
+
: {
|
|
75
|
+
comments: lineComments.map((c) => ({
|
|
76
|
+
path: c.path,
|
|
77
|
+
line: c.line,
|
|
78
|
+
side: c.side ?? "RIGHT",
|
|
79
|
+
body: c.body,
|
|
80
|
+
...(c.startLine === undefined
|
|
81
|
+
? {}
|
|
82
|
+
: { start_line: c.startLine }),
|
|
83
|
+
})),
|
|
84
|
+
}),
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
return {
|
|
89
|
+
repo: r.full,
|
|
90
|
+
number,
|
|
91
|
+
id: num(v, "id"),
|
|
92
|
+
state: str(v, "state"),
|
|
93
|
+
url: str(v, "html_url"),
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
reviews: op({
|
|
98
|
+
description:
|
|
99
|
+
"A PR's reviews with their bodies, and its line-comment threads with path, line, resolved and outdated flags and every comment (first 100 reviews and threads). `unresolvedOnly` keeps the threads still open. Replaces `gh pr view --json reviews` plus the review threads gh does not show.",
|
|
100
|
+
input: s.object({
|
|
101
|
+
repo: repoField,
|
|
102
|
+
number: numberField,
|
|
103
|
+
unresolvedOnly: s.optional(s.boolean()),
|
|
104
|
+
}),
|
|
105
|
+
annotations: reads,
|
|
106
|
+
run: async ({ repo, number, unresolvedOnly }) => {
|
|
107
|
+
const r = await gh.repo(repo);
|
|
108
|
+
const pr = at(
|
|
109
|
+
await gh.graphql(REVIEWS, { owner: r.owner, name: r.name, number }),
|
|
110
|
+
"repository",
|
|
111
|
+
"pullRequest",
|
|
112
|
+
);
|
|
113
|
+
const threads = nodes(pr, "reviewThreads").map((t) => ({
|
|
114
|
+
id: str(t, "id"),
|
|
115
|
+
path: str(t, "path"),
|
|
116
|
+
line: optNum(t, "line"),
|
|
117
|
+
// GitHub reports a one-line thread with startLine equal to line; only a real range keeps it.
|
|
118
|
+
startLine:
|
|
119
|
+
optNum(t, "startLine") === optNum(t, "line")
|
|
120
|
+
? null
|
|
121
|
+
: optNum(t, "startLine"),
|
|
122
|
+
resolved: bool(t, "isResolved"),
|
|
123
|
+
resolvedBy: optStr(t, "resolvedBy", "login"),
|
|
124
|
+
outdated: bool(t, "isOutdated"),
|
|
125
|
+
comments: nodes(t, "comments").map(comment),
|
|
126
|
+
}));
|
|
127
|
+
return {
|
|
128
|
+
repo: r.full,
|
|
129
|
+
number,
|
|
130
|
+
reviewDecision: optStr(pr, "reviewDecision"),
|
|
131
|
+
reviews: nodes(pr, "reviews").map((v) => ({
|
|
132
|
+
id: str(v, "id"),
|
|
133
|
+
author: optStr(v, "author", "login"),
|
|
134
|
+
state: str(v, "state"),
|
|
135
|
+
body: str(v, "body"),
|
|
136
|
+
submittedAt: optStr(v, "submittedAt"),
|
|
137
|
+
url: str(v, "url"),
|
|
138
|
+
})),
|
|
139
|
+
threads:
|
|
140
|
+
unresolvedOnly === true
|
|
141
|
+
? threads.filter((t) => !t.resolved)
|
|
142
|
+
: threads,
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
146
|
+
replyToThread: op({
|
|
147
|
+
description:
|
|
148
|
+
"Reply inside a review thread (the line-comment conversation), for example to say what the fix was.",
|
|
149
|
+
input: s.object({ threadId: threadIdField, body: s.string() }),
|
|
150
|
+
annotations: writes,
|
|
151
|
+
run: async ({ threadId, body }) => {
|
|
152
|
+
const data = await gh.graphql(
|
|
153
|
+
`mutation($id:ID!,$body:String!){addPullRequestReviewThreadReply(input:{pullRequestReviewThreadId:$id,body:$body}){comment{id author{login} body createdAt url}}}`,
|
|
154
|
+
{ id: threadId, body },
|
|
155
|
+
);
|
|
156
|
+
return {
|
|
157
|
+
threadId,
|
|
158
|
+
...comment(at(data, "addPullRequestReviewThreadReply", "comment")),
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
}),
|
|
162
|
+
resolveThread: op({
|
|
163
|
+
description:
|
|
164
|
+
"Mark a review thread resolved, or with undo reopen it. Resolve only after the reply or the fix it asks for is in.",
|
|
165
|
+
input: s.object({
|
|
166
|
+
threadId: threadIdField,
|
|
167
|
+
undo: s.optional(s.boolean()),
|
|
168
|
+
}),
|
|
169
|
+
annotations: writes,
|
|
170
|
+
run: async ({ threadId, undo }) => {
|
|
171
|
+
const field =
|
|
172
|
+
undo === true ? "unresolveReviewThread" : "resolveReviewThread";
|
|
173
|
+
const data = await gh.graphql(
|
|
174
|
+
`mutation($id:ID!){${field}(input:{threadId:$id}){thread{id isResolved}}}`,
|
|
175
|
+
{ id: threadId },
|
|
176
|
+
);
|
|
177
|
+
return { threadId, resolved: bool(data, field, "thread", "isResolved") };
|
|
178
|
+
},
|
|
179
|
+
}),
|
|
180
|
+
dismissReview: op({
|
|
181
|
+
description:
|
|
182
|
+
"Dismiss an approving or change-requesting review with a message, so it no longer counts toward the review decision.",
|
|
183
|
+
input: s.object({
|
|
184
|
+
reviewId: s.string({
|
|
185
|
+
description: "Review id from `pr reviews` (reviews[].id).",
|
|
186
|
+
}),
|
|
187
|
+
message: s.string(),
|
|
188
|
+
}),
|
|
189
|
+
annotations: writes,
|
|
190
|
+
run: async ({ reviewId, message }) => {
|
|
191
|
+
const data = await gh.graphql(
|
|
192
|
+
`mutation($id:ID!,$message:String!){dismissPullRequestReview(input:{pullRequestReviewId:$id,message:$message}){pullRequestReview{id state}}}`,
|
|
193
|
+
{ id: reviewId, message },
|
|
194
|
+
);
|
|
195
|
+
return {
|
|
196
|
+
reviewId,
|
|
197
|
+
state: str(
|
|
198
|
+
data,
|
|
199
|
+
"dismissPullRequestReview",
|
|
200
|
+
"pullRequestReview",
|
|
201
|
+
"state",
|
|
202
|
+
),
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
}),
|
|
206
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { op, s } from "../vendor/surface/index.ts";
|
|
2
|
+
import { irreversible, numberField, repoField, writes } from "./fields.ts";
|
|
3
|
+
import type { GitHub } from "./http.ts";
|
|
4
|
+
import { commentOp, editLabels } from "./issues-write.ts";
|
|
5
|
+
import { deleteHead, mergeOp } from "./merge.ts";
|
|
6
|
+
import { pullNodeId } from "./pulls-read.ts";
|
|
7
|
+
import { at, bool, num, optStr, str } from "./read.ts";
|
|
8
|
+
|
|
9
|
+
const created = (p: unknown) => ({
|
|
10
|
+
number: num(p, "number"),
|
|
11
|
+
url: str(p, "html_url"),
|
|
12
|
+
state: str(p, "state"),
|
|
13
|
+
draft: bool(p, "draft"),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const pullWriteOps = (gh: GitHub) => ({
|
|
17
|
+
create: op({
|
|
18
|
+
description:
|
|
19
|
+
"Open a pull request. `base` defaults to the repo's default branch. Replaces `gh pr create`.",
|
|
20
|
+
input: s.object({
|
|
21
|
+
repo: repoField,
|
|
22
|
+
title: s.string(),
|
|
23
|
+
head: s.string({
|
|
24
|
+
description: "Branch with the changes (owner:branch for a fork).",
|
|
25
|
+
}),
|
|
26
|
+
base: s.optional(s.string()),
|
|
27
|
+
body: s.optional(s.string()),
|
|
28
|
+
draft: s.optional(s.boolean()),
|
|
29
|
+
labels: s.optional(s.array(s.string())),
|
|
30
|
+
reviewers: s.optional(s.array(s.string())),
|
|
31
|
+
}),
|
|
32
|
+
annotations: writes,
|
|
33
|
+
run: async ({
|
|
34
|
+
repo,
|
|
35
|
+
title,
|
|
36
|
+
head,
|
|
37
|
+
base,
|
|
38
|
+
body,
|
|
39
|
+
draft,
|
|
40
|
+
labels,
|
|
41
|
+
reviewers,
|
|
42
|
+
}) => {
|
|
43
|
+
const r = await gh.repo(repo);
|
|
44
|
+
const target =
|
|
45
|
+
base ?? str(await gh.rest("GET", `repos/${r.full}`), "default_branch");
|
|
46
|
+
const p = await gh.rest("POST", `repos/${r.full}/pulls`, {
|
|
47
|
+
body: {
|
|
48
|
+
title,
|
|
49
|
+
head,
|
|
50
|
+
base: target,
|
|
51
|
+
body: body ?? "",
|
|
52
|
+
draft: draft ?? false,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
const number = num(p, "number");
|
|
56
|
+
if (labels?.length) await editLabels(gh, r.full, number, labels, []);
|
|
57
|
+
if (reviewers?.length)
|
|
58
|
+
await gh.rest(
|
|
59
|
+
"POST",
|
|
60
|
+
`repos/${r.full}/pulls/${number}/requested_reviewers`,
|
|
61
|
+
{ body: { reviewers } },
|
|
62
|
+
);
|
|
63
|
+
return { repo: r.full, ...created(p), base: target };
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
edit: op({
|
|
67
|
+
description:
|
|
68
|
+
"Change a PR's title, body, base or open/closed state; add or remove labels; request reviewers. Replaces `gh pr edit` / `gh pr reopen`.",
|
|
69
|
+
input: s.object({
|
|
70
|
+
repo: repoField,
|
|
71
|
+
number: numberField,
|
|
72
|
+
title: s.optional(s.string()),
|
|
73
|
+
body: s.optional(s.string()),
|
|
74
|
+
base: s.optional(s.string()),
|
|
75
|
+
state: s.optional(s.enum(["open", "closed"])),
|
|
76
|
+
addLabels: s.optional(s.array(s.string())),
|
|
77
|
+
removeLabels: s.optional(s.array(s.string())),
|
|
78
|
+
addReviewers: s.optional(s.array(s.string())),
|
|
79
|
+
}),
|
|
80
|
+
annotations: writes,
|
|
81
|
+
run: async ({
|
|
82
|
+
repo,
|
|
83
|
+
number,
|
|
84
|
+
title,
|
|
85
|
+
body,
|
|
86
|
+
base,
|
|
87
|
+
state,
|
|
88
|
+
addLabels,
|
|
89
|
+
removeLabels,
|
|
90
|
+
addReviewers,
|
|
91
|
+
}) => {
|
|
92
|
+
const r = await gh.repo(repo);
|
|
93
|
+
const patch = Object.fromEntries(
|
|
94
|
+
Object.entries({ title, body, base, state }).filter(
|
|
95
|
+
([, v]) => v !== undefined,
|
|
96
|
+
),
|
|
97
|
+
);
|
|
98
|
+
const p =
|
|
99
|
+
Object.keys(patch).length > 0
|
|
100
|
+
? await gh.rest("PATCH", `repos/${r.full}/pulls/${number}`, {
|
|
101
|
+
body: patch,
|
|
102
|
+
})
|
|
103
|
+
: await gh.rest("GET", `repos/${r.full}/pulls/${number}`);
|
|
104
|
+
const labels = await editLabels(
|
|
105
|
+
gh,
|
|
106
|
+
r.full,
|
|
107
|
+
number,
|
|
108
|
+
addLabels ?? [],
|
|
109
|
+
removeLabels ?? [],
|
|
110
|
+
);
|
|
111
|
+
if (addReviewers?.length)
|
|
112
|
+
await gh.rest(
|
|
113
|
+
"POST",
|
|
114
|
+
`repos/${r.full}/pulls/${number}/requested_reviewers`,
|
|
115
|
+
{ body: { reviewers: addReviewers } },
|
|
116
|
+
);
|
|
117
|
+
return {
|
|
118
|
+
repo: r.full,
|
|
119
|
+
...created(p),
|
|
120
|
+
...(labels === undefined ? {} : { labels }),
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
}),
|
|
124
|
+
comment: commentOp(
|
|
125
|
+
gh,
|
|
126
|
+
"Add a conversation comment to a PR, or edit one of yours by id. Replaces `gh pr comment`.",
|
|
127
|
+
),
|
|
128
|
+
merge: mergeOp(gh),
|
|
129
|
+
ready: op({
|
|
130
|
+
description:
|
|
131
|
+
"Mark a draft PR ready for review, or with undo turn it back into a draft. Replaces `gh pr ready [--undo]`.",
|
|
132
|
+
input: s.object({
|
|
133
|
+
repo: repoField,
|
|
134
|
+
number: numberField,
|
|
135
|
+
undo: s.optional(s.boolean()),
|
|
136
|
+
}),
|
|
137
|
+
annotations: { ...writes, idempotent: true },
|
|
138
|
+
run: async ({ repo, number, undo }) => {
|
|
139
|
+
const r = await gh.repo(repo);
|
|
140
|
+
const pr = await pullNodeId(gh, r.full, number);
|
|
141
|
+
const mutation =
|
|
142
|
+
undo === true
|
|
143
|
+
? "convertPullRequestToDraft"
|
|
144
|
+
: "markPullRequestReadyForReview";
|
|
145
|
+
const data = await gh.graphql(
|
|
146
|
+
`mutation($id:ID!){${mutation}(input:{pullRequestId:$id}){pullRequest{isDraft}}}`,
|
|
147
|
+
{ id: pr.id },
|
|
148
|
+
);
|
|
149
|
+
return {
|
|
150
|
+
repo: r.full,
|
|
151
|
+
number,
|
|
152
|
+
draft: at(data, mutation, "pullRequest", "isDraft") === true,
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
}),
|
|
156
|
+
close: op({
|
|
157
|
+
description:
|
|
158
|
+
"Close a PR without merging, optionally leaving a comment first and deleting its same-repo head branch. Replaces `gh pr close`.",
|
|
159
|
+
input: s.object({
|
|
160
|
+
repo: repoField,
|
|
161
|
+
number: numberField,
|
|
162
|
+
comment: s.optional(s.string()),
|
|
163
|
+
deleteBranch: s.optional(s.boolean()),
|
|
164
|
+
}),
|
|
165
|
+
annotations: irreversible,
|
|
166
|
+
run: async ({ repo, number, comment, deleteBranch }) => {
|
|
167
|
+
const r = await gh.repo(repo);
|
|
168
|
+
if (comment !== undefined)
|
|
169
|
+
await gh.rest("POST", `repos/${r.full}/issues/${number}/comments`, {
|
|
170
|
+
body: { body: comment },
|
|
171
|
+
});
|
|
172
|
+
const p = await gh.rest("PATCH", `repos/${r.full}/pulls/${number}`, {
|
|
173
|
+
body: { state: "closed" },
|
|
174
|
+
});
|
|
175
|
+
const branchDeleted =
|
|
176
|
+
deleteBranch === true
|
|
177
|
+
? await deleteHead(
|
|
178
|
+
gh,
|
|
179
|
+
r,
|
|
180
|
+
str(p, "head", "ref"),
|
|
181
|
+
optStr(p, "head", "repo", "full_name"),
|
|
182
|
+
)
|
|
183
|
+
: false;
|
|
184
|
+
return { repo: r.full, ...created(p), branchDeleted };
|
|
185
|
+
},
|
|
186
|
+
}),
|
|
187
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { op, s } from "../vendor/surface/index.ts";
|
|
2
|
+
import { reads } from "./fields.ts";
|
|
3
|
+
import type { GitHub, Method } from "./http.ts";
|
|
4
|
+
import { at, isObj, num } from "./read.ts";
|
|
5
|
+
|
|
6
|
+
const bucket = (x: unknown) => ({
|
|
7
|
+
limit: num(x, "limit"),
|
|
8
|
+
remaining: num(x, "remaining"),
|
|
9
|
+
used: num(x, "used"),
|
|
10
|
+
resetsAt: new Date(num(x, "reset") * 1000).toISOString(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const rawOps = (gh: GitHub) => ({
|
|
14
|
+
rest: op({
|
|
15
|
+
description:
|
|
16
|
+
"Any REST call for what the typed operations do not cover. Path is relative to api.github.com (repos/o/n/...). `paginate` follows Link headers up to limit; `key` names the list inside a wrapped page (workflow_runs, items). Replaces `gh api`.",
|
|
17
|
+
input: s.object({
|
|
18
|
+
path: s.string(),
|
|
19
|
+
method: s.optional(s.enum(["GET", "POST", "PATCH", "PUT", "DELETE"])),
|
|
20
|
+
query: s.optional(s.record(s.string())),
|
|
21
|
+
body: s.optional(s.unknown({ description: "JSON request body." })),
|
|
22
|
+
accept: s.optional(s.string()),
|
|
23
|
+
paginate: s.optional(s.boolean()),
|
|
24
|
+
key: s.optional(s.string()),
|
|
25
|
+
limit: s.optional(
|
|
26
|
+
s.integer({ description: "Max items when paginating (default 1000)." }),
|
|
27
|
+
),
|
|
28
|
+
}),
|
|
29
|
+
annotations: { destructive: true, openWorld: true },
|
|
30
|
+
run: async ({
|
|
31
|
+
path,
|
|
32
|
+
method,
|
|
33
|
+
query,
|
|
34
|
+
body,
|
|
35
|
+
accept,
|
|
36
|
+
paginate,
|
|
37
|
+
key,
|
|
38
|
+
limit,
|
|
39
|
+
}) => {
|
|
40
|
+
const verb: Method = method ?? "GET";
|
|
41
|
+
const req = {
|
|
42
|
+
...(query === undefined ? {} : { query }),
|
|
43
|
+
...(body === undefined ? {} : { body }),
|
|
44
|
+
...(accept === undefined ? {} : { accept }),
|
|
45
|
+
};
|
|
46
|
+
if (paginate === true && verb === "GET")
|
|
47
|
+
return gh.list(path, limit ?? 1000, {
|
|
48
|
+
...req,
|
|
49
|
+
...(key === undefined ? {} : { key }),
|
|
50
|
+
});
|
|
51
|
+
return gh.rest(verb, path, req);
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
graphql: op({
|
|
55
|
+
description:
|
|
56
|
+
"Any GraphQL query or mutation; returns `data`. Errors come back as kinds (not_found, forbidden, graphql). Replaces `gh api graphql`.",
|
|
57
|
+
input: s.object({
|
|
58
|
+
query: s.string(),
|
|
59
|
+
variables: s.optional(s.record(s.unknown())),
|
|
60
|
+
}),
|
|
61
|
+
annotations: { destructive: true, openWorld: true },
|
|
62
|
+
run: ({ query, variables }) => gh.graphql(query, variables ?? {}),
|
|
63
|
+
}),
|
|
64
|
+
rate: op({
|
|
65
|
+
description:
|
|
66
|
+
"Remaining quota for core REST, GraphQL and search, with reset times. Replaces `gh api rate_limit`.",
|
|
67
|
+
input: s.object({}),
|
|
68
|
+
annotations: reads,
|
|
69
|
+
run: async () => {
|
|
70
|
+
const res = at(await gh.rest("GET", "rate_limit"), "resources");
|
|
71
|
+
return Object.fromEntries(
|
|
72
|
+
["core", "graphql", "search", "code_search"].flatMap((k) =>
|
|
73
|
+
isObj(at(res, k)) ? [[k, bucket(at(res, k))]] : [],
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Narrow GitHub's JSON without type assertions: every field an operation returns is read through one of these,
|
|
2
|
+
// so a changed or wrong endpoint fails as `invalid_response` instead of leaking `undefined` downstream.
|
|
3
|
+
import { SurfaceError } from "../vendor/surface/index.ts";
|
|
4
|
+
|
|
5
|
+
export type Json = Readonly<Record<string, unknown>>;
|
|
6
|
+
|
|
7
|
+
export const isObj = (x: unknown): x is Json =>
|
|
8
|
+
typeof x === "object" && x !== null && !Array.isArray(x);
|
|
9
|
+
|
|
10
|
+
const bad = (what: string): SurfaceError =>
|
|
11
|
+
new SurfaceError(
|
|
12
|
+
"invalid_response",
|
|
13
|
+
`GitHub response has no ${what}`,
|
|
14
|
+
"inspect the raw body with `api rest`; the endpoint or its shape may differ",
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const obj = (x: unknown, what: string): Json => {
|
|
18
|
+
if (!isObj(x)) throw bad(what);
|
|
19
|
+
return x;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const arr = (x: unknown, what: string): readonly unknown[] => {
|
|
23
|
+
if (!Array.isArray(x)) throw bad(what);
|
|
24
|
+
return x;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const at = (x: unknown, ...keys: readonly string[]): unknown =>
|
|
28
|
+
keys.reduce<unknown>((cur, k) => (isObj(cur) ? cur[k] : undefined), x);
|
|
29
|
+
|
|
30
|
+
export const str = (x: unknown, ...keys: readonly string[]): string => {
|
|
31
|
+
const v = at(x, ...keys);
|
|
32
|
+
if (typeof v !== "string") throw bad(keys.join("."));
|
|
33
|
+
return v;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const optStr = (
|
|
37
|
+
x: unknown,
|
|
38
|
+
...keys: readonly string[]
|
|
39
|
+
): string | null => {
|
|
40
|
+
const v = at(x, ...keys);
|
|
41
|
+
return typeof v === "string" ? v : null;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const num = (x: unknown, ...keys: readonly string[]): number => {
|
|
45
|
+
const v = at(x, ...keys);
|
|
46
|
+
if (typeof v !== "number") throw bad(keys.join("."));
|
|
47
|
+
return v;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const optNum = (
|
|
51
|
+
x: unknown,
|
|
52
|
+
...keys: readonly string[]
|
|
53
|
+
): number | null => {
|
|
54
|
+
const v = at(x, ...keys);
|
|
55
|
+
return typeof v === "number" ? v : null;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const bool = (x: unknown, ...keys: readonly string[]): boolean =>
|
|
59
|
+
at(x, ...keys) === true;
|
|
60
|
+
|
|
61
|
+
export const nodes = (
|
|
62
|
+
x: unknown,
|
|
63
|
+
...keys: readonly string[]
|
|
64
|
+
): readonly unknown[] => {
|
|
65
|
+
const v = at(x, ...keys, "nodes");
|
|
66
|
+
return Array.isArray(v) ? v : [];
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const names = (
|
|
70
|
+
x: unknown,
|
|
71
|
+
key: string,
|
|
72
|
+
...keys: readonly string[]
|
|
73
|
+
): string[] =>
|
|
74
|
+
nodes(x, ...keys).flatMap((n) => {
|
|
75
|
+
const v = at(n, key);
|
|
76
|
+
return typeof v === "string" ? [v] : [];
|
|
77
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Uploading and deleting the assets of a release.
|
|
2
|
+
import { basename } from "node:path";
|
|
3
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
4
|
+
import type { Infer } from "../vendor/surface/index.ts";
|
|
5
|
+
import { irreversible, repoField, writes } from "./fields.ts";
|
|
6
|
+
import type { GitHub } from "./http.ts";
|
|
7
|
+
import { str } from "./read.ts";
|
|
8
|
+
import { findRelease, releaseAssets } from "./release-download.ts";
|
|
9
|
+
|
|
10
|
+
export const tagField = s.string({ description: "Release tag, e.g. v1.2.0." });
|
|
11
|
+
export const filesField = s.array(
|
|
12
|
+
s.object({
|
|
13
|
+
path: s.string({ description: "Local file to upload." }),
|
|
14
|
+
name: s.optional(
|
|
15
|
+
s.string({ description: "Asset name (default: the file's base name)." }),
|
|
16
|
+
),
|
|
17
|
+
label: s.optional(s.string({ description: "Display label." })),
|
|
18
|
+
contentType: s.optional(
|
|
19
|
+
s.string({ description: "MIME type (default: from the extension)." }),
|
|
20
|
+
),
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
type Files = Infer<typeof filesField>;
|
|
24
|
+
|
|
25
|
+
const assetName = (f: Files[number]) => f.name ?? basename(f.path);
|
|
26
|
+
|
|
27
|
+
export const checkFiles = async (files: Files) => {
|
|
28
|
+
for (const f of files)
|
|
29
|
+
if (!(await Bun.file(f.path).exists()))
|
|
30
|
+
throw new SurfaceError(
|
|
31
|
+
"usage",
|
|
32
|
+
`no such file: ${f.path}`,
|
|
33
|
+
"pass paths to existing local files",
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const uploadAll = async (gh: GitHub, release: unknown, files: Files) => {
|
|
38
|
+
const base = str(release, "upload_url").replace(/\{[^}]*\}$/, "");
|
|
39
|
+
const names: string[] = [];
|
|
40
|
+
for (const f of files) {
|
|
41
|
+
const file = Bun.file(f.path);
|
|
42
|
+
const query = new URLSearchParams({
|
|
43
|
+
name: assetName(f),
|
|
44
|
+
...(f.label === undefined ? {} : { label: f.label }),
|
|
45
|
+
});
|
|
46
|
+
const asset = await gh.upload(
|
|
47
|
+
`${base}?${query.toString()}`,
|
|
48
|
+
await file.bytes(),
|
|
49
|
+
f.contentType ?? file.type,
|
|
50
|
+
);
|
|
51
|
+
names.push(str(asset, "name"));
|
|
52
|
+
}
|
|
53
|
+
return names;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const releaseAssetOps = (gh: GitHub) => ({
|
|
57
|
+
deleteAsset: op({
|
|
58
|
+
description:
|
|
59
|
+
"Delete one asset of a release by its name. Replaces `gh release delete-asset`.",
|
|
60
|
+
input: s.object({ repo: repoField, tag: tagField, name: s.string() }),
|
|
61
|
+
annotations: irreversible,
|
|
62
|
+
run: async ({ repo, tag, name }) => {
|
|
63
|
+
const r = await gh.repo(repo);
|
|
64
|
+
const asset = releaseAssets(await findRelease(gh, r.full, tag)).find(
|
|
65
|
+
(a) => a.name === name,
|
|
66
|
+
);
|
|
67
|
+
if (asset === undefined)
|
|
68
|
+
throw new SurfaceError(
|
|
69
|
+
"not_found",
|
|
70
|
+
`release ${tag} has no asset ${name}`,
|
|
71
|
+
"see the asset names with `release view`",
|
|
72
|
+
);
|
|
73
|
+
await gh.rest("DELETE", `repos/${r.full}/releases/assets/${asset.id}`);
|
|
74
|
+
return { repo: r.full, tag, name, id: asset.id, deleted: true };
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
upload: op({
|
|
78
|
+
description:
|
|
79
|
+
"Upload files as assets of an existing release. A same-named asset fails as `conflict` before anything uploads, unless clobber replaces it. Replaces `gh release upload`.",
|
|
80
|
+
input: s.object({
|
|
81
|
+
repo: repoField,
|
|
82
|
+
tag: tagField,
|
|
83
|
+
files: filesField,
|
|
84
|
+
clobber: s.optional(
|
|
85
|
+
s.boolean({ description: "Delete same-named assets first." }),
|
|
86
|
+
),
|
|
87
|
+
}),
|
|
88
|
+
annotations: writes,
|
|
89
|
+
run: async ({ repo, tag, files, clobber }) => {
|
|
90
|
+
const r = await gh.repo(repo);
|
|
91
|
+
await checkFiles(files);
|
|
92
|
+
const rel = await findRelease(gh, r.full, tag);
|
|
93
|
+
const wanted = new Set(files.map(assetName));
|
|
94
|
+
const clashes = releaseAssets(rel).filter((a) => wanted.has(a.name));
|
|
95
|
+
if (clashes.length > 0 && clobber !== true)
|
|
96
|
+
throw new SurfaceError(
|
|
97
|
+
"conflict",
|
|
98
|
+
`release ${tag} already has ${clashes.map((a) => a.name).join(", ")}`,
|
|
99
|
+
"pass clobber: true to replace them",
|
|
100
|
+
);
|
|
101
|
+
for (const a of clashes)
|
|
102
|
+
await gh.rest("DELETE", `repos/${r.full}/releases/assets/${a.id}`);
|
|
103
|
+
return {
|
|
104
|
+
repo: r.full,
|
|
105
|
+
tag,
|
|
106
|
+
assets: await uploadAll(gh, rel, files),
|
|
107
|
+
replaced: clashes.map((a) => a.name),
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
});
|