oh-my-opencode 5.1.84 → 5.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/index.js +1022 -842
- package/dist/cli/service-auth/devices.d.ts +5 -2
- package/dist/cli-node/index.js +1022 -842
- package/dist/config/schema/agent-names.d.ts +1 -0
- package/dist/index.js +180 -205
- package/dist/skills/browser/SKILL.md +4 -1
- package/dist/skills/browser/references/commands.md +5 -2
- package/dist/skills/browser/references/desktop.md +1 -0
- package/dist/skills/browser/references/owned-engine/README.md +2 -0
- package/dist/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/dist/skills/browser/references/owned-engine/network.md +10 -5
- package/dist/skills/browser/references/recipes/1password.md +2 -0
- package/dist/skills/browser/runtime/omowright/index.js +11 -11
- package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
- package/dist/skills/debugging/SKILL.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 +1 -1
- package/dist/skills/ulw-execute/SKILL.md +1 -1
- package/dist/tui.js +30 -27
- package/package.json +28 -26
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- 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/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- 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/skills/browser/SKILL.md +4 -1
- package/packages/omo-codex/plugin/skills/browser/references/commands.md +5 -2
- package/packages/omo-codex/plugin/skills/browser/references/desktop.md +1 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/network.md +10 -5
- package/packages/omo-codex/plugin/skills/browser/references/recipes/1password.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +11 -11
- 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/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 +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/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 +20 -15
- package/packages/shared-skills/skills/browser/SKILL.md +4 -1
- package/packages/shared-skills/skills/browser/references/commands.md +5 -2
- package/packages/shared-skills/skills/browser/references/desktop.md +1 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/README.md +2 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/network.md +10 -5
- package/packages/shared-skills/skills/browser/references/recipes/1password.md +2 -0
- package/packages/shared-skills/skills/browser/runtime/omowright/index.js +11 -11
- 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/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 +1 -1
- package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
- 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,209 @@
|
|
|
1
|
+
// Repository labels: list, create, edit, delete, and clone one repository's labels into another.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import {
|
|
4
|
+
enc,
|
|
5
|
+
irreversible,
|
|
6
|
+
limitField,
|
|
7
|
+
reads,
|
|
8
|
+
repoField,
|
|
9
|
+
writes,
|
|
10
|
+
} from "./fields.ts";
|
|
11
|
+
import type { GitHub } from "./http.ts";
|
|
12
|
+
import { at, bool, nodes, num, optStr, str } from "./read.ts";
|
|
13
|
+
|
|
14
|
+
const LIST = `query($owner:String!,$name:String!,$first:Int!,$after:String,$query:String,$field:LabelOrderField!,$direction:OrderDirection!){
|
|
15
|
+
repository(owner:$owner,name:$name){labels(first:$first,after:$after,query:$query,orderBy:{field:$field,direction:$direction}){
|
|
16
|
+
nodes{name color description isDefault createdAt url} pageInfo{hasNextPage endCursor}}}}`;
|
|
17
|
+
const ALL_LABELS = 10_000;
|
|
18
|
+
|
|
19
|
+
const restLabel = (x: unknown) => ({
|
|
20
|
+
id: num(x, "id"),
|
|
21
|
+
name: str(x, "name"),
|
|
22
|
+
color: str(x, "color"),
|
|
23
|
+
description: optStr(x, "description"),
|
|
24
|
+
isDefault: bool(x, "default"),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const defined = (o: Readonly<Record<string, unknown>>) =>
|
|
28
|
+
Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined));
|
|
29
|
+
|
|
30
|
+
const bare = (color: string | undefined) => color?.replace(/^#/, "");
|
|
31
|
+
|
|
32
|
+
const colorField = s.optional(
|
|
33
|
+
s.string({ description: "Six-digit hex color, with or without '#'." }),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const labelOps = (gh: GitHub) => ({
|
|
37
|
+
list: op({
|
|
38
|
+
description:
|
|
39
|
+
"Labels of a repository with color, description and whether GitHub created them by default; `search` matches names and descriptions and GitHub then ranks by relevance, ignoring sort and order. Replaces `gh label list`.",
|
|
40
|
+
input: s.object({
|
|
41
|
+
repo: repoField,
|
|
42
|
+
search: s.optional(s.string()),
|
|
43
|
+
sort: s.optional(s.enum(["created", "name"])),
|
|
44
|
+
order: s.optional(s.enum(["asc", "desc"])),
|
|
45
|
+
limit: limitField(30),
|
|
46
|
+
}),
|
|
47
|
+
annotations: reads,
|
|
48
|
+
run: async ({ repo, search, sort, order, limit }) => {
|
|
49
|
+
const r = await gh.repo(repo);
|
|
50
|
+
const max = limit ?? 30;
|
|
51
|
+
const items: {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly color: string;
|
|
54
|
+
readonly description: string | null;
|
|
55
|
+
readonly isDefault: boolean;
|
|
56
|
+
readonly createdAt: string | null;
|
|
57
|
+
readonly url: string;
|
|
58
|
+
}[] = [];
|
|
59
|
+
let after: string | null = null;
|
|
60
|
+
do {
|
|
61
|
+
const data = await gh.graphql(LIST, {
|
|
62
|
+
owner: r.owner,
|
|
63
|
+
name: r.name,
|
|
64
|
+
first: Math.min(100, max - items.length),
|
|
65
|
+
after,
|
|
66
|
+
query: search ?? null,
|
|
67
|
+
field: sort === "name" ? "NAME" : "CREATED_AT",
|
|
68
|
+
direction: order === "desc" ? "DESC" : "ASC",
|
|
69
|
+
});
|
|
70
|
+
const page = at(data, "repository", "labels");
|
|
71
|
+
items.push(
|
|
72
|
+
...nodes(page).map((l) => ({
|
|
73
|
+
name: str(l, "name"),
|
|
74
|
+
color: str(l, "color"),
|
|
75
|
+
description: optStr(l, "description"),
|
|
76
|
+
isDefault: bool(l, "isDefault"),
|
|
77
|
+
createdAt: optStr(l, "createdAt"),
|
|
78
|
+
url: str(l, "url"),
|
|
79
|
+
})),
|
|
80
|
+
);
|
|
81
|
+
after =
|
|
82
|
+
at(page, "pageInfo", "hasNextPage") === true
|
|
83
|
+
? optStr(page, "pageInfo", "endCursor")
|
|
84
|
+
: null;
|
|
85
|
+
} while (after !== null && items.length < max);
|
|
86
|
+
return { repo: r.full, items };
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
create: op({
|
|
90
|
+
description:
|
|
91
|
+
"Create a label; GitHub picks a color when none is given. With `force`, an existing label of that name gets the given color and description instead of failing. Replaces `gh label create`.",
|
|
92
|
+
input: s.object({
|
|
93
|
+
repo: repoField,
|
|
94
|
+
name: s.string(),
|
|
95
|
+
color: colorField,
|
|
96
|
+
description: s.optional(s.string()),
|
|
97
|
+
force: s.optional(
|
|
98
|
+
s.boolean({ description: "Update the label if it already exists." }),
|
|
99
|
+
),
|
|
100
|
+
}),
|
|
101
|
+
annotations: writes,
|
|
102
|
+
run: async ({ repo, name, color, description, force }) => {
|
|
103
|
+
const r = await gh.repo(repo);
|
|
104
|
+
const fields = defined({ color: bare(color), description });
|
|
105
|
+
try {
|
|
106
|
+
const x = await gh.rest("POST", `repos/${r.full}/labels`, {
|
|
107
|
+
body: { name, ...fields },
|
|
108
|
+
});
|
|
109
|
+
return { repo: r.full, action: "created", ...restLabel(x) };
|
|
110
|
+
} catch (error) {
|
|
111
|
+
const exists =
|
|
112
|
+
error instanceof SurfaceError &&
|
|
113
|
+
error.kind === "invalid" &&
|
|
114
|
+
error.message.includes("already_exists");
|
|
115
|
+
if (force !== true || !exists) throw error;
|
|
116
|
+
}
|
|
117
|
+
const x = await gh.rest("PATCH", `repos/${r.full}/labels/${enc(name)}`, {
|
|
118
|
+
body: fields,
|
|
119
|
+
});
|
|
120
|
+
return { repo: r.full, action: "updated", ...restLabel(x) };
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
edit: op({
|
|
124
|
+
description:
|
|
125
|
+
"Rename a label or change its color or description. Replaces `gh label edit`.",
|
|
126
|
+
input: s.object({
|
|
127
|
+
repo: repoField,
|
|
128
|
+
name: s.string({ description: "Current label name." }),
|
|
129
|
+
newName: s.optional(s.string()),
|
|
130
|
+
color: colorField,
|
|
131
|
+
description: s.optional(s.string()),
|
|
132
|
+
}),
|
|
133
|
+
annotations: writes,
|
|
134
|
+
run: async ({ repo, name, newName, color, description }) => {
|
|
135
|
+
const body = defined({
|
|
136
|
+
new_name: newName,
|
|
137
|
+
color: bare(color),
|
|
138
|
+
description,
|
|
139
|
+
});
|
|
140
|
+
if (Object.keys(body).length === 0)
|
|
141
|
+
throw new SurfaceError(
|
|
142
|
+
"usage",
|
|
143
|
+
"nothing to change",
|
|
144
|
+
"pass newName, color or description",
|
|
145
|
+
);
|
|
146
|
+
const r = await gh.repo(repo);
|
|
147
|
+
const x = await gh.rest("PATCH", `repos/${r.full}/labels/${enc(name)}`, {
|
|
148
|
+
body,
|
|
149
|
+
});
|
|
150
|
+
return { repo: r.full, ...restLabel(x) };
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
delete: op({
|
|
154
|
+
description:
|
|
155
|
+
"Delete a label; it is removed from every issue and pull request that carried it. Replaces `gh label delete`.",
|
|
156
|
+
input: s.object({ repo: repoField, name: s.string() }),
|
|
157
|
+
annotations: irreversible,
|
|
158
|
+
run: async ({ repo, name }) => {
|
|
159
|
+
const r = await gh.repo(repo);
|
|
160
|
+
await gh.rest("DELETE", `repos/${r.full}/labels/${enc(name)}`);
|
|
161
|
+
return { repo: r.full, name, deleted: true };
|
|
162
|
+
},
|
|
163
|
+
}),
|
|
164
|
+
clone: op({
|
|
165
|
+
description:
|
|
166
|
+
"Copy every label of `source` into `repo`. Labels whose name already exists (case-insensitive) are skipped, or overwritten with the source color and description when `force` is set. Returns the created, updated and skipped names. Replaces `gh label clone`.",
|
|
167
|
+
input: s.object({
|
|
168
|
+
repo: repoField,
|
|
169
|
+
source: s.string({ description: "owner/name to copy labels from." }),
|
|
170
|
+
force: s.optional(s.boolean()),
|
|
171
|
+
}),
|
|
172
|
+
annotations: writes,
|
|
173
|
+
run: async ({ repo, source, force }) => {
|
|
174
|
+
const [r, src] = await Promise.all([gh.repo(repo), gh.repo(source)]);
|
|
175
|
+
const [from, to] = await Promise.all([
|
|
176
|
+
gh.list(`repos/${src.full}/labels`, ALL_LABELS),
|
|
177
|
+
gh.list(`repos/${r.full}/labels`, ALL_LABELS),
|
|
178
|
+
]);
|
|
179
|
+
const existing = new Map(
|
|
180
|
+
to.map((l) => [str(l, "name").toLowerCase(), str(l, "name")]),
|
|
181
|
+
);
|
|
182
|
+
const created: string[] = [];
|
|
183
|
+
const updated: string[] = [];
|
|
184
|
+
const skipped: string[] = [];
|
|
185
|
+
for (const l of from) {
|
|
186
|
+
const name = str(l, "name");
|
|
187
|
+
const fields = {
|
|
188
|
+
color: str(l, "color"),
|
|
189
|
+
description: optStr(l, "description") ?? "",
|
|
190
|
+
};
|
|
191
|
+
const current = existing.get(name.toLowerCase());
|
|
192
|
+
if (current === undefined) {
|
|
193
|
+
await gh.rest("POST", `repos/${r.full}/labels`, {
|
|
194
|
+
body: { name, ...fields },
|
|
195
|
+
});
|
|
196
|
+
created.push(name);
|
|
197
|
+
} else if (force === true) {
|
|
198
|
+
await gh.rest("PATCH", `repos/${r.full}/labels/${enc(current)}`, {
|
|
199
|
+
body: { new_name: name, ...fields },
|
|
200
|
+
});
|
|
201
|
+
updated.push(name);
|
|
202
|
+
} else {
|
|
203
|
+
skipped.push(name);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return { repo: r.full, source: src.full, created, updated, skipped };
|
|
207
|
+
},
|
|
208
|
+
}),
|
|
209
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
2
|
+
import { enc, irreversible, numberField, repoField } from "./fields.ts";
|
|
3
|
+
import type { GitHub, Repo } from "./http.ts";
|
|
4
|
+
import { pullNodeId } from "./pulls-read.ts";
|
|
5
|
+
import { at, optStr, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const METHOD = { merge: "MERGE", squash: "SQUASH", rebase: "REBASE" } as const;
|
|
8
|
+
|
|
9
|
+
export const deleteHead = async (
|
|
10
|
+
gh: GitHub,
|
|
11
|
+
r: Repo,
|
|
12
|
+
head: string,
|
|
13
|
+
headRepo: string | null,
|
|
14
|
+
): Promise<boolean> => {
|
|
15
|
+
if (headRepo !== r.full) return false;
|
|
16
|
+
await gh.rest(
|
|
17
|
+
"DELETE",
|
|
18
|
+
`repos/${r.full}/git/refs/heads/${head.split("/").map(enc).join("/")}`,
|
|
19
|
+
);
|
|
20
|
+
return true;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const mergeOp = (gh: GitHub) =>
|
|
24
|
+
op({
|
|
25
|
+
description:
|
|
26
|
+
"Merge a PR now, or enable auto-merge. Pass matchHeadSha so the merge refuses if the head moved since you verified it (kind conflict). Replaces `gh pr merge --match-head-commit`.",
|
|
27
|
+
input: s.object({
|
|
28
|
+
repo: repoField,
|
|
29
|
+
number: numberField,
|
|
30
|
+
method: s.optional(
|
|
31
|
+
s.enum(["merge", "squash", "rebase"], {
|
|
32
|
+
description: "Default merge (a merge commit).",
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
35
|
+
matchHeadSha: s.optional(
|
|
36
|
+
s.string({
|
|
37
|
+
description: "Expected head commit SHA; strongly recommended.",
|
|
38
|
+
}),
|
|
39
|
+
),
|
|
40
|
+
subject: s.optional(s.string()),
|
|
41
|
+
body: s.optional(s.string()),
|
|
42
|
+
auto: s.optional(
|
|
43
|
+
s.boolean({ description: "Enable auto-merge instead of merging now." }),
|
|
44
|
+
),
|
|
45
|
+
deleteBranch: s.optional(
|
|
46
|
+
s.boolean({
|
|
47
|
+
description:
|
|
48
|
+
"Delete the head branch after a merge (same-repo heads only).",
|
|
49
|
+
}),
|
|
50
|
+
),
|
|
51
|
+
}),
|
|
52
|
+
annotations: irreversible,
|
|
53
|
+
run: async ({
|
|
54
|
+
repo,
|
|
55
|
+
number,
|
|
56
|
+
method,
|
|
57
|
+
matchHeadSha,
|
|
58
|
+
subject,
|
|
59
|
+
body,
|
|
60
|
+
auto,
|
|
61
|
+
deleteBranch,
|
|
62
|
+
}) => {
|
|
63
|
+
const r = await gh.repo(repo);
|
|
64
|
+
const how = method ?? "merge";
|
|
65
|
+
if (auto === true) {
|
|
66
|
+
const pr = await pullNodeId(gh, r.full, number);
|
|
67
|
+
await gh.graphql(
|
|
68
|
+
"mutation($id:ID!,$m:PullRequestMergeMethod!,$oid:GitObjectID){enablePullRequestAutoMerge(input:{pullRequestId:$id,mergeMethod:$m,expectedHeadOid:$oid}){clientMutationId}}",
|
|
69
|
+
{ id: pr.id, m: METHOD[how], oid: matchHeadSha ?? null },
|
|
70
|
+
);
|
|
71
|
+
return {
|
|
72
|
+
repo: r.full,
|
|
73
|
+
number,
|
|
74
|
+
merged: false,
|
|
75
|
+
autoMerge: true,
|
|
76
|
+
sha: null,
|
|
77
|
+
branchDeleted: false,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const pr =
|
|
81
|
+
deleteBranch === true
|
|
82
|
+
? await pullNodeId(gh, r.full, number)
|
|
83
|
+
: undefined;
|
|
84
|
+
const res = await gh.rest(
|
|
85
|
+
"PUT",
|
|
86
|
+
`repos/${r.full}/pulls/${number}/merge`,
|
|
87
|
+
{
|
|
88
|
+
body: {
|
|
89
|
+
merge_method: how,
|
|
90
|
+
...(matchHeadSha === undefined ? {} : { sha: matchHeadSha }),
|
|
91
|
+
...(subject === undefined ? {} : { commit_title: subject }),
|
|
92
|
+
...(body === undefined ? {} : { commit_message: body }),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
);
|
|
96
|
+
if (at(res, "merged") !== true)
|
|
97
|
+
throw new SurfaceError(
|
|
98
|
+
"conflict",
|
|
99
|
+
optStr(res, "message") ?? "not merged",
|
|
100
|
+
"read `pr view` mergeState and checks",
|
|
101
|
+
);
|
|
102
|
+
const branchDeleted =
|
|
103
|
+
pr === undefined
|
|
104
|
+
? false
|
|
105
|
+
: await deleteHead(gh, r, pr.head, pr.headRepo);
|
|
106
|
+
return {
|
|
107
|
+
repo: r.full,
|
|
108
|
+
number,
|
|
109
|
+
merged: true,
|
|
110
|
+
autoMerge: false,
|
|
111
|
+
sha: str(res, "sha"),
|
|
112
|
+
branchDeleted,
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The Poly1305 one-time authenticator (RFC 8439 section 2.5), on bigint arithmetic modulo 2^130 - 5.
|
|
2
|
+
const P = (1n << 130n) - 5n;
|
|
3
|
+
const CLAMP = 0x0ffffffc0ffffffc0ffffffc0fffffffn;
|
|
4
|
+
const MASK128 = (1n << 128n) - 1n;
|
|
5
|
+
|
|
6
|
+
const littleEndian = (bytes: Uint8Array): bigint =>
|
|
7
|
+
bytes.reduceRight((acc, byte) => (acc << 8n) | BigInt(byte), 0n);
|
|
8
|
+
|
|
9
|
+
export const poly1305 = (key: Uint8Array, message: Uint8Array): Uint8Array => {
|
|
10
|
+
const r = littleEndian(key.subarray(0, 16)) & CLAMP;
|
|
11
|
+
const s = littleEndian(key.subarray(16, 32));
|
|
12
|
+
let h = 0n;
|
|
13
|
+
for (let i = 0; i < message.length; i += 16) {
|
|
14
|
+
const chunk = message.subarray(i, i + 16);
|
|
15
|
+
const padded = littleEndian(chunk) | (1n << BigInt(8 * chunk.length));
|
|
16
|
+
h = ((h + padded) * r) % P;
|
|
17
|
+
}
|
|
18
|
+
let tag = (h + s) & MASK128;
|
|
19
|
+
const out = new Uint8Array(16);
|
|
20
|
+
for (let i = 0; i < 16; i++, tag >>= 8n) out[i] = Number(tag & 0xffn);
|
|
21
|
+
return out;
|
|
22
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Checking out a pull request into an existing local clone through git.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { numberField, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub, Repo } from "./http.ts";
|
|
5
|
+
import { str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const remoteFor = async (gh: GitHub, r: Repo, dir: string) => {
|
|
8
|
+
const wanted = r.full.toLowerCase();
|
|
9
|
+
for (const line of (await gh.git(["remote", "-v"], dir)).split("\n")) {
|
|
10
|
+
const [name, url] = line.split(/\s+/);
|
|
11
|
+
const path = url
|
|
12
|
+
?.toLowerCase()
|
|
13
|
+
.replace(/\/$/, "")
|
|
14
|
+
.replace(/\.git$/, "");
|
|
15
|
+
if (
|
|
16
|
+
name !== undefined &&
|
|
17
|
+
(path?.endsWith(`github.com/${wanted}`) ||
|
|
18
|
+
path?.endsWith(`github.com:${wanted}`))
|
|
19
|
+
)
|
|
20
|
+
return name;
|
|
21
|
+
}
|
|
22
|
+
return `https://github.com/${r.full}.git`;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const checkoutOp = (gh: GitHub) =>
|
|
26
|
+
op({
|
|
27
|
+
description:
|
|
28
|
+
"Fetch a PR's head (refs/pull/N/head) from the base repository into the existing clone at `dir` and switch to it: a new branch is created, an existing one is fast-forwarded (or reset with force), or with detach HEAD is detached at it. No upstream tracking is configured. Replaces `gh pr checkout`.",
|
|
29
|
+
input: s.object({
|
|
30
|
+
repo: repoField,
|
|
31
|
+
number: numberField,
|
|
32
|
+
dir: s.string({ description: "Path of the existing local clone." }),
|
|
33
|
+
branch: s.optional(
|
|
34
|
+
s.string({
|
|
35
|
+
description: "Local branch name (default: the PR's head branch).",
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
detach: s.optional(s.boolean()),
|
|
39
|
+
force: s.optional(
|
|
40
|
+
s.boolean({
|
|
41
|
+
description: "Reset an existing local branch to the PR head.",
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
44
|
+
}),
|
|
45
|
+
annotations: writes,
|
|
46
|
+
run: async ({ repo, number, dir, branch, detach, force }) => {
|
|
47
|
+
if (detach === true && branch !== undefined)
|
|
48
|
+
throw new SurfaceError(
|
|
49
|
+
"usage",
|
|
50
|
+
"detach and branch cannot be combined",
|
|
51
|
+
"drop one of them",
|
|
52
|
+
);
|
|
53
|
+
const r = await gh.repo(repo);
|
|
54
|
+
const name =
|
|
55
|
+
detach === true
|
|
56
|
+
? null
|
|
57
|
+
: (branch ??
|
|
58
|
+
str(
|
|
59
|
+
await gh.rest("GET", `repos/${r.full}/pulls/${number}`),
|
|
60
|
+
"head",
|
|
61
|
+
"ref",
|
|
62
|
+
));
|
|
63
|
+
if (name?.startsWith("-"))
|
|
64
|
+
throw new SurfaceError(
|
|
65
|
+
"usage",
|
|
66
|
+
`invalid branch name: ${name}`,
|
|
67
|
+
"pass branch",
|
|
68
|
+
);
|
|
69
|
+
await gh.git(
|
|
70
|
+
["fetch", await remoteFor(gh, r, dir), `refs/pull/${number}/head`],
|
|
71
|
+
dir,
|
|
72
|
+
);
|
|
73
|
+
if (name === null)
|
|
74
|
+
await gh.git(["checkout", "--detach", "FETCH_HEAD"], dir);
|
|
75
|
+
else if (
|
|
76
|
+
force === true ||
|
|
77
|
+
(await gh.git(["branch", "--list", name], dir)).trim() === ""
|
|
78
|
+
)
|
|
79
|
+
await gh.git(["checkout", "-B", name, "FETCH_HEAD"], dir);
|
|
80
|
+
else {
|
|
81
|
+
await gh.git(["checkout", name], dir);
|
|
82
|
+
await gh.git(["merge", "--ff-only", "FETCH_HEAD"], dir);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
repo: r.full,
|
|
86
|
+
number,
|
|
87
|
+
dir,
|
|
88
|
+
branch: name,
|
|
89
|
+
headSha: (await gh.git(["rev-parse", "HEAD"], dir)).trim(),
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
2
|
+
import { numberField, reads, repoField } from "./fields.ts";
|
|
3
|
+
import type { GitHub } from "./http.ts";
|
|
4
|
+
import { at, bool, names, nodes, num, optNum, optStr, str } from "./read.ts";
|
|
5
|
+
|
|
6
|
+
const VIEW = `query($owner:String!,$name:String!,$number:Int!,$comments:Int!){repository(owner:$owner,name:$name){pullRequest(number:$number){
|
|
7
|
+
id number title url state isDraft merged mergedAt closedAt createdAt updatedAt body author{login}
|
|
8
|
+
headRefName headRefOid baseRefName headRepository{nameWithOwner} mergeable mergeStateStatus reviewDecision
|
|
9
|
+
additions deletions changedFiles labels(first:50){nodes{name}} assignees(first:20){nodes{login}}
|
|
10
|
+
reviewRequests(first:20){nodes{requestedReviewer{... on User{login} ... on Team{slug}}}}
|
|
11
|
+
latestReviews(first:20){nodes{author{login} state submittedAt}} closingIssuesReferences(first:20){nodes{number}}
|
|
12
|
+
commits(last:1){nodes{commit{statusCheckRollup{state}}}}
|
|
13
|
+
comments(last:$comments){totalCount nodes{author{login} body createdAt url}}}}}`;
|
|
14
|
+
|
|
15
|
+
export const pullViewOp = (gh: GitHub) =>
|
|
16
|
+
op({
|
|
17
|
+
description:
|
|
18
|
+
"One pull request: state, draft/merged, mergeability, review decision, head SHA, labels, reviewers, linked issues, rollup check state, and optionally its last N comments. Replaces `gh pr view --json ...`.",
|
|
19
|
+
input: s.object({
|
|
20
|
+
repo: repoField,
|
|
21
|
+
number: numberField,
|
|
22
|
+
comments: s.optional(
|
|
23
|
+
s.integer({
|
|
24
|
+
description:
|
|
25
|
+
"How many of the latest conversation comments to include (default 0, max 100).",
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
body: s.optional(
|
|
29
|
+
s.boolean({
|
|
30
|
+
description: "Include the PR description (default true).",
|
|
31
|
+
}),
|
|
32
|
+
),
|
|
33
|
+
}),
|
|
34
|
+
annotations: reads,
|
|
35
|
+
run: async ({ repo, number, comments, body }) => {
|
|
36
|
+
const r = await gh.repo(repo);
|
|
37
|
+
const data = await gh.graphql(VIEW, {
|
|
38
|
+
owner: r.owner,
|
|
39
|
+
name: r.name,
|
|
40
|
+
number,
|
|
41
|
+
comments: Math.min(comments ?? 0, 100),
|
|
42
|
+
});
|
|
43
|
+
const p = at(data, "repository", "pullRequest");
|
|
44
|
+
if (p === null || p === undefined)
|
|
45
|
+
throw new SurfaceError(
|
|
46
|
+
"not_found",
|
|
47
|
+
`no pull request #${number} in ${r.full}`,
|
|
48
|
+
"check the number",
|
|
49
|
+
);
|
|
50
|
+
return {
|
|
51
|
+
repo: r.full,
|
|
52
|
+
id: str(p, "id"),
|
|
53
|
+
number: num(p, "number"),
|
|
54
|
+
title: str(p, "title"),
|
|
55
|
+
url: str(p, "url"),
|
|
56
|
+
state: str(p, "state"),
|
|
57
|
+
draft: bool(p, "isDraft"),
|
|
58
|
+
merged: bool(p, "merged"),
|
|
59
|
+
mergedAt: optStr(p, "mergedAt"),
|
|
60
|
+
closedAt: optStr(p, "closedAt"),
|
|
61
|
+
createdAt: str(p, "createdAt"),
|
|
62
|
+
updatedAt: str(p, "updatedAt"),
|
|
63
|
+
author: optStr(p, "author", "login"),
|
|
64
|
+
head: str(p, "headRefName"),
|
|
65
|
+
headSha: str(p, "headRefOid"),
|
|
66
|
+
headRepo: optStr(p, "headRepository", "nameWithOwner"),
|
|
67
|
+
base: str(p, "baseRefName"),
|
|
68
|
+
mergeable: str(p, "mergeable"),
|
|
69
|
+
mergeState: str(p, "mergeStateStatus"),
|
|
70
|
+
reviewDecision: optStr(p, "reviewDecision"),
|
|
71
|
+
checks: optStr(
|
|
72
|
+
nodes(p, "commits")[0],
|
|
73
|
+
"commit",
|
|
74
|
+
"statusCheckRollup",
|
|
75
|
+
"state",
|
|
76
|
+
),
|
|
77
|
+
additions: num(p, "additions"),
|
|
78
|
+
deletions: num(p, "deletions"),
|
|
79
|
+
changedFiles: num(p, "changedFiles"),
|
|
80
|
+
labels: names(p, "name", "labels"),
|
|
81
|
+
assignees: names(p, "login", "assignees"),
|
|
82
|
+
reviewRequests: nodes(p, "reviewRequests").flatMap((n) => {
|
|
83
|
+
const who =
|
|
84
|
+
optStr(n, "requestedReviewer", "login") ??
|
|
85
|
+
optStr(n, "requestedReviewer", "slug");
|
|
86
|
+
return who === null ? [] : [who];
|
|
87
|
+
}),
|
|
88
|
+
reviews: nodes(p, "latestReviews").map((n) => ({
|
|
89
|
+
author: optStr(n, "author", "login"),
|
|
90
|
+
state: str(n, "state"),
|
|
91
|
+
at: optStr(n, "submittedAt"),
|
|
92
|
+
})),
|
|
93
|
+
closes: nodes(p, "closingIssuesReferences").map((n) =>
|
|
94
|
+
num(n, "number"),
|
|
95
|
+
),
|
|
96
|
+
...(body === false ? {} : { body: optStr(p, "body") ?? "" }),
|
|
97
|
+
commentCount: optNum(p, "comments", "totalCount") ?? 0,
|
|
98
|
+
comments: nodes(p, "comments").map((n) => ({
|
|
99
|
+
author: optStr(n, "author", "login"),
|
|
100
|
+
at: str(n, "createdAt"),
|
|
101
|
+
url: str(n, "url"),
|
|
102
|
+
body: str(n, "body"),
|
|
103
|
+
})),
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// Project (v2) fields: list them with their options and iterations, create custom ones, delete them.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { irreversible, limitField, reads, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import {
|
|
6
|
+
collect,
|
|
7
|
+
mutate,
|
|
8
|
+
ownerField,
|
|
9
|
+
pageInfo,
|
|
10
|
+
projectNumberField,
|
|
11
|
+
projectQuery,
|
|
12
|
+
resolveProject,
|
|
13
|
+
} from "./project-ref.ts";
|
|
14
|
+
import { arr, at, num, str } from "./read.ts";
|
|
15
|
+
|
|
16
|
+
const FIELD = `... on ProjectV2FieldCommon { id name dataType }
|
|
17
|
+
... on ProjectV2SingleSelectField { options { id name } }
|
|
18
|
+
... on ProjectV2IterationField { configuration { iterations { id title startDate duration } } }`;
|
|
19
|
+
|
|
20
|
+
const field = (x: unknown) => {
|
|
21
|
+
const options = at(x, "options");
|
|
22
|
+
const iterations = at(x, "configuration", "iterations");
|
|
23
|
+
return {
|
|
24
|
+
id: str(x, "id"),
|
|
25
|
+
name: str(x, "name"),
|
|
26
|
+
dataType: str(x, "dataType"),
|
|
27
|
+
...(options === undefined
|
|
28
|
+
? {}
|
|
29
|
+
: {
|
|
30
|
+
options: arr(options, "options").map((o) => ({
|
|
31
|
+
id: str(o, "id"),
|
|
32
|
+
name: str(o, "name"),
|
|
33
|
+
})),
|
|
34
|
+
}),
|
|
35
|
+
...(iterations === undefined
|
|
36
|
+
? {}
|
|
37
|
+
: {
|
|
38
|
+
iterations: arr(iterations, "iterations").map((i) => ({
|
|
39
|
+
id: str(i, "id"),
|
|
40
|
+
title: str(i, "title"),
|
|
41
|
+
startDate: str(i, "startDate"),
|
|
42
|
+
duration: num(i, "duration"),
|
|
43
|
+
})),
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const projectFieldOps = (gh: GitHub) => ({
|
|
49
|
+
fieldList: op({
|
|
50
|
+
description:
|
|
51
|
+
"Fields of a project with ids, data types, single-select options and iterations (the ids itemEdit needs). Replaces `gh project field-list`.",
|
|
52
|
+
input: s.object({
|
|
53
|
+
owner: ownerField,
|
|
54
|
+
number: projectNumberField,
|
|
55
|
+
limit: limitField(30),
|
|
56
|
+
}),
|
|
57
|
+
annotations: reads,
|
|
58
|
+
run: async ({ owner, number, limit }) => {
|
|
59
|
+
let login = owner;
|
|
60
|
+
const raw = await collect(limit ?? 30, async (first, after) => {
|
|
61
|
+
const r = await projectQuery(
|
|
62
|
+
gh,
|
|
63
|
+
owner,
|
|
64
|
+
number,
|
|
65
|
+
`fields(first: $first, after: $after) { nodes { ${FIELD} } ${pageInfo} }`,
|
|
66
|
+
{ decl: "$first: Int!, $after: String", vars: { first, after } },
|
|
67
|
+
);
|
|
68
|
+
login = r.login;
|
|
69
|
+
return at(r.project, "fields");
|
|
70
|
+
});
|
|
71
|
+
return { owner: login, number, items: raw.map(field) };
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
fieldCreate: op({
|
|
75
|
+
description:
|
|
76
|
+
"Add a custom field to a project; SINGLE_SELECT needs `singleSelectOptions`. Replaces `gh project field-create`.",
|
|
77
|
+
input: s.object({
|
|
78
|
+
owner: ownerField,
|
|
79
|
+
number: projectNumberField,
|
|
80
|
+
name: s.string(),
|
|
81
|
+
dataType: s.enum(["TEXT", "SINGLE_SELECT", "DATE", "NUMBER"]),
|
|
82
|
+
singleSelectOptions: s.optional(s.array(s.string())),
|
|
83
|
+
}),
|
|
84
|
+
annotations: writes,
|
|
85
|
+
run: async ({ owner, number, name, dataType, singleSelectOptions }) => {
|
|
86
|
+
const select = dataType === "SINGLE_SELECT";
|
|
87
|
+
if (
|
|
88
|
+
select !==
|
|
89
|
+
(singleSelectOptions !== undefined && singleSelectOptions.length > 0)
|
|
90
|
+
)
|
|
91
|
+
throw new SurfaceError(
|
|
92
|
+
"usage",
|
|
93
|
+
select
|
|
94
|
+
? "a SINGLE_SELECT field needs singleSelectOptions"
|
|
95
|
+
: "singleSelectOptions only applies to SINGLE_SELECT",
|
|
96
|
+
"pass options exactly when dataType is SINGLE_SELECT",
|
|
97
|
+
);
|
|
98
|
+
const { id } = await resolveProject(gh, owner, number);
|
|
99
|
+
const result = await mutate(
|
|
100
|
+
gh,
|
|
101
|
+
"createProjectV2Field",
|
|
102
|
+
{
|
|
103
|
+
projectId: id,
|
|
104
|
+
dataType,
|
|
105
|
+
name,
|
|
106
|
+
...(select
|
|
107
|
+
? {
|
|
108
|
+
singleSelectOptions: (singleSelectOptions ?? []).map((o) => ({
|
|
109
|
+
name: o,
|
|
110
|
+
color: "GRAY",
|
|
111
|
+
description: "",
|
|
112
|
+
})),
|
|
113
|
+
}
|
|
114
|
+
: {}),
|
|
115
|
+
},
|
|
116
|
+
`projectV2Field { ${FIELD} }`,
|
|
117
|
+
);
|
|
118
|
+
return field(at(result, "projectV2Field"));
|
|
119
|
+
},
|
|
120
|
+
}),
|
|
121
|
+
fieldDelete: op({
|
|
122
|
+
description:
|
|
123
|
+
"Delete a custom field and every value set on it; this cannot be undone. Replaces `gh project field-delete`.",
|
|
124
|
+
input: s.object({
|
|
125
|
+
id: s.string({
|
|
126
|
+
description: "Field node id (PVTF_...), from fieldList.",
|
|
127
|
+
}),
|
|
128
|
+
}),
|
|
129
|
+
annotations: irreversible,
|
|
130
|
+
run: async ({ id }) => {
|
|
131
|
+
const result = await mutate(
|
|
132
|
+
gh,
|
|
133
|
+
"deleteProjectV2Field",
|
|
134
|
+
{ fieldId: id },
|
|
135
|
+
"projectV2Field { ... on ProjectV2FieldCommon { id name } }",
|
|
136
|
+
);
|
|
137
|
+
return {
|
|
138
|
+
id: str(result, "projectV2Field", "id"),
|
|
139
|
+
name: str(result, "projectV2Field", "name"),
|
|
140
|
+
deleted: true,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
});
|