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,139 @@
|
|
|
1
|
+
// `repo create`: a new repository for a user or organization, empty, initialized, or generated from a template.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { num, str } from "./read.ts";
|
|
6
|
+
import { defined, repoSettings } from "./repo-settings.ts";
|
|
7
|
+
|
|
8
|
+
const usage = (message: string, hint: string) =>
|
|
9
|
+
new SurfaceError("usage", message, hint);
|
|
10
|
+
|
|
11
|
+
export const createOp = (gh: GitHub) =>
|
|
12
|
+
op({
|
|
13
|
+
description:
|
|
14
|
+
"Create a repository on GitHub: empty, initialized with a README, .gitignore or license, or generated from a template. API-side only: it does not clone, push or link a local directory (gh's --clone, --push, --source, --remote). Replaces `gh repo create`.",
|
|
15
|
+
input: s.object({
|
|
16
|
+
name: s.string({ description: "New repository name." }),
|
|
17
|
+
owner: s.optional(
|
|
18
|
+
s.string({
|
|
19
|
+
description:
|
|
20
|
+
"Organization (or your own login) to own it; default the authenticated user.",
|
|
21
|
+
}),
|
|
22
|
+
),
|
|
23
|
+
visibility: s.enum(["public", "private", "internal"]),
|
|
24
|
+
description: s.optional(s.string()),
|
|
25
|
+
homepage: s.optional(s.string()),
|
|
26
|
+
template: s.optional(
|
|
27
|
+
s.string({
|
|
28
|
+
description: "Template repository owner/name to generate from.",
|
|
29
|
+
}),
|
|
30
|
+
),
|
|
31
|
+
includeAllBranches: s.optional(
|
|
32
|
+
s.boolean({
|
|
33
|
+
description:
|
|
34
|
+
"Copy every branch of the template, not only the default.",
|
|
35
|
+
}),
|
|
36
|
+
),
|
|
37
|
+
addReadme: s.optional(s.boolean()),
|
|
38
|
+
gitignore: s.optional(
|
|
39
|
+
s.string({ description: "gitignore template name, e.g. Node." }),
|
|
40
|
+
),
|
|
41
|
+
license: s.optional(s.string({ description: "License key, e.g. mit." })),
|
|
42
|
+
team: s.optional(
|
|
43
|
+
s.string({
|
|
44
|
+
description: "Slug of the organization team granted access.",
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
disableIssues: s.optional(s.boolean()),
|
|
48
|
+
disableWiki: s.optional(s.boolean()),
|
|
49
|
+
}),
|
|
50
|
+
annotations: writes,
|
|
51
|
+
run: async (i) => {
|
|
52
|
+
const hint = "see `gh repo create` for which options combine";
|
|
53
|
+
if (i.includeAllBranches === true && i.template === undefined)
|
|
54
|
+
throw usage("includeAllBranches needs template", hint);
|
|
55
|
+
if (
|
|
56
|
+
i.template !== undefined &&
|
|
57
|
+
(i.addReadme === true ||
|
|
58
|
+
i.gitignore !== undefined ||
|
|
59
|
+
i.license !== undefined ||
|
|
60
|
+
i.homepage !== undefined ||
|
|
61
|
+
i.team !== undefined ||
|
|
62
|
+
i.disableIssues === true ||
|
|
63
|
+
i.disableWiki === true)
|
|
64
|
+
)
|
|
65
|
+
throw usage(
|
|
66
|
+
"template cannot combine with addReadme, gitignore, license, homepage, team, disableIssues or disableWiki",
|
|
67
|
+
hint,
|
|
68
|
+
);
|
|
69
|
+
if (i.template !== undefined) {
|
|
70
|
+
const t = await gh.repo(i.template);
|
|
71
|
+
const x = await gh.rest("POST", `repos/${t.full}/generate`, {
|
|
72
|
+
body: defined({
|
|
73
|
+
owner: i.owner,
|
|
74
|
+
name: i.name,
|
|
75
|
+
description: i.description,
|
|
76
|
+
include_all_branches: i.includeAllBranches,
|
|
77
|
+
private: i.visibility !== "public",
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
// generate takes only a private flag; internal is set afterwards.
|
|
81
|
+
return repoSettings(
|
|
82
|
+
i.visibility === "internal"
|
|
83
|
+
? await gh.rest("PATCH", `repos/${str(x, "full_name")}`, {
|
|
84
|
+
body: { visibility: "internal" },
|
|
85
|
+
})
|
|
86
|
+
: x,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
let org: string | undefined;
|
|
90
|
+
if (i.owner !== undefined) {
|
|
91
|
+
const owner = await gh.rest("GET", `users/${enc(i.owner)}`);
|
|
92
|
+
if (str(owner, "type") === "Organization") org = str(owner, "login");
|
|
93
|
+
else if (
|
|
94
|
+
str(await gh.rest("GET", "user"), "login").toLowerCase() !==
|
|
95
|
+
i.owner.toLowerCase()
|
|
96
|
+
)
|
|
97
|
+
throw usage(
|
|
98
|
+
`${i.owner} is another user`,
|
|
99
|
+
"create under your own account or an organization",
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
if (
|
|
103
|
+
org === undefined &&
|
|
104
|
+
(i.visibility === "internal" || i.team !== undefined)
|
|
105
|
+
)
|
|
106
|
+
throw usage(
|
|
107
|
+
"internal visibility and team need an organization owner",
|
|
108
|
+
hint,
|
|
109
|
+
);
|
|
110
|
+
const teamId =
|
|
111
|
+
org === undefined || i.team === undefined
|
|
112
|
+
? undefined
|
|
113
|
+
: num(
|
|
114
|
+
await gh.rest("GET", `orgs/${enc(org)}/teams/${enc(i.team)}`),
|
|
115
|
+
"id",
|
|
116
|
+
);
|
|
117
|
+
const x = await gh.rest(
|
|
118
|
+
"POST",
|
|
119
|
+
org === undefined ? "user/repos" : `orgs/${enc(org)}/repos`,
|
|
120
|
+
{
|
|
121
|
+
body: defined({
|
|
122
|
+
name: i.name,
|
|
123
|
+
description: i.description,
|
|
124
|
+
homepage: i.homepage,
|
|
125
|
+
...(org === undefined
|
|
126
|
+
? { private: i.visibility === "private" }
|
|
127
|
+
: { visibility: i.visibility }),
|
|
128
|
+
team_id: teamId,
|
|
129
|
+
auto_init: i.addReadme === true ? true : undefined,
|
|
130
|
+
gitignore_template: i.gitignore,
|
|
131
|
+
license_template: i.license,
|
|
132
|
+
has_issues: i.disableIssues === true ? false : undefined,
|
|
133
|
+
has_wiki: i.disableWiki === true ? false : undefined,
|
|
134
|
+
}),
|
|
135
|
+
},
|
|
136
|
+
);
|
|
137
|
+
return repoSettings(x);
|
|
138
|
+
},
|
|
139
|
+
});
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// Repository side settings (autolinks, deploy keys) and GitHub's gitignore and license template catalogs.
|
|
2
|
+
import { op, s } 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 { arr, at, bool, num, optStr, str } from "./read.ts";
|
|
13
|
+
import { strings } from "./repo-settings.ts";
|
|
14
|
+
|
|
15
|
+
const idField = (what: string) => s.integer({ description: `${what} id.` });
|
|
16
|
+
|
|
17
|
+
const autolink = (x: unknown) => ({
|
|
18
|
+
id: num(x, "id"),
|
|
19
|
+
keyPrefix: str(x, "key_prefix"),
|
|
20
|
+
urlTemplate: str(x, "url_template"),
|
|
21
|
+
alphanumeric: bool(x, "is_alphanumeric"),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const deployKey = (x: unknown) => ({
|
|
25
|
+
id: num(x, "id"),
|
|
26
|
+
title: optStr(x, "title"),
|
|
27
|
+
key: str(x, "key"),
|
|
28
|
+
readOnly: bool(x, "read_only"),
|
|
29
|
+
createdAt: optStr(x, "created_at"),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const license = (x: unknown) => ({
|
|
33
|
+
key: str(x, "key"),
|
|
34
|
+
name: str(x, "name"),
|
|
35
|
+
spdxId: optStr(x, "spdx_id"),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const repoExtraOps = (gh: GitHub) => ({
|
|
39
|
+
autolink: {
|
|
40
|
+
list: op({
|
|
41
|
+
description:
|
|
42
|
+
"Autolink references of a repository. Replaces `gh repo autolink list`.",
|
|
43
|
+
input: s.object({ repo: repoField }),
|
|
44
|
+
annotations: reads,
|
|
45
|
+
run: async ({ repo }) => {
|
|
46
|
+
const r = await gh.repo(repo);
|
|
47
|
+
const body = await gh.rest("GET", `repos/${r.full}/autolinks`);
|
|
48
|
+
return { repo: r.full, items: arr(body, "autolinks").map(autolink) };
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
view: op({
|
|
52
|
+
description: "One autolink reference. Replaces `gh repo autolink view`.",
|
|
53
|
+
input: s.object({ repo: repoField, id: idField("Autolink") }),
|
|
54
|
+
annotations: reads,
|
|
55
|
+
run: async ({ repo, id }) => {
|
|
56
|
+
const r = await gh.repo(repo);
|
|
57
|
+
return {
|
|
58
|
+
repo: r.full,
|
|
59
|
+
...autolink(await gh.rest("GET", `repos/${r.full}/autolinks/${id}`)),
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
create: op({
|
|
64
|
+
description:
|
|
65
|
+
"Add an autolink: text starting with keyPrefix links to urlTemplate with <num> replaced. Alphanumeric references unless numeric. Replaces `gh repo autolink create`.",
|
|
66
|
+
input: s.object({
|
|
67
|
+
repo: repoField,
|
|
68
|
+
keyPrefix: s.string({
|
|
69
|
+
description: "Prefix that triggers the link, e.g. TICKET-.",
|
|
70
|
+
}),
|
|
71
|
+
urlTemplate: s.string({
|
|
72
|
+
description:
|
|
73
|
+
"URL containing <num>, e.g. https://example.com/t/<num>.",
|
|
74
|
+
}),
|
|
75
|
+
numeric: s.optional(
|
|
76
|
+
s.boolean({ description: "Match only digits after the prefix." }),
|
|
77
|
+
),
|
|
78
|
+
}),
|
|
79
|
+
annotations: writes,
|
|
80
|
+
run: async ({ repo, keyPrefix, urlTemplate, numeric }) => {
|
|
81
|
+
const r = await gh.repo(repo);
|
|
82
|
+
const x = await gh.rest("POST", `repos/${r.full}/autolinks`, {
|
|
83
|
+
body: {
|
|
84
|
+
key_prefix: keyPrefix,
|
|
85
|
+
url_template: urlTemplate,
|
|
86
|
+
is_alphanumeric: numeric !== true,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
return { repo: r.full, ...autolink(x) };
|
|
90
|
+
},
|
|
91
|
+
}),
|
|
92
|
+
delete: op({
|
|
93
|
+
description:
|
|
94
|
+
"Delete an autolink reference. Replaces `gh repo autolink delete --yes`.",
|
|
95
|
+
input: s.object({ repo: repoField, id: idField("Autolink") }),
|
|
96
|
+
annotations: irreversible,
|
|
97
|
+
run: async ({ repo, id }) => {
|
|
98
|
+
const r = await gh.repo(repo);
|
|
99
|
+
await gh.rest("DELETE", `repos/${r.full}/autolinks/${id}`);
|
|
100
|
+
return { repo: r.full, id, deleted: true };
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
103
|
+
},
|
|
104
|
+
deployKey: {
|
|
105
|
+
list: op({
|
|
106
|
+
description:
|
|
107
|
+
"Deploy keys of a repository. Replaces `gh repo deploy-key list`.",
|
|
108
|
+
input: s.object({ repo: repoField, limit: limitField(100) }),
|
|
109
|
+
annotations: reads,
|
|
110
|
+
run: async ({ repo, limit }) => {
|
|
111
|
+
const r = await gh.repo(repo);
|
|
112
|
+
return {
|
|
113
|
+
repo: r.full,
|
|
114
|
+
items: (await gh.list(`repos/${r.full}/keys`, limit ?? 100)).map(
|
|
115
|
+
deployKey,
|
|
116
|
+
),
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
}),
|
|
120
|
+
add: op({
|
|
121
|
+
description:
|
|
122
|
+
"Add a deploy key from its public key text, read-only unless allowWrite. Replaces `gh repo deploy-key add`.",
|
|
123
|
+
input: s.object({
|
|
124
|
+
repo: repoField,
|
|
125
|
+
key: s.string({
|
|
126
|
+
description: "Public key text, e.g. the contents of id_ed25519.pub.",
|
|
127
|
+
}),
|
|
128
|
+
title: s.optional(s.string()),
|
|
129
|
+
allowWrite: s.optional(s.boolean({ description: "Let the key push." })),
|
|
130
|
+
}),
|
|
131
|
+
annotations: writes,
|
|
132
|
+
run: async ({ repo, key, title, allowWrite }) => {
|
|
133
|
+
const r = await gh.repo(repo);
|
|
134
|
+
const x = await gh.rest("POST", `repos/${r.full}/keys`, {
|
|
135
|
+
body: {
|
|
136
|
+
key: key.trim(),
|
|
137
|
+
read_only: allowWrite !== true,
|
|
138
|
+
...(title === undefined ? {} : { title }),
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
return { repo: r.full, ...deployKey(x) };
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
delete: op({
|
|
145
|
+
description: "Remove a deploy key. Replaces `gh repo deploy-key delete`.",
|
|
146
|
+
input: s.object({ repo: repoField, id: idField("Deploy key") }),
|
|
147
|
+
annotations: irreversible,
|
|
148
|
+
run: async ({ repo, id }) => {
|
|
149
|
+
const r = await gh.repo(repo);
|
|
150
|
+
await gh.rest("DELETE", `repos/${r.full}/keys/${id}`);
|
|
151
|
+
return { repo: r.full, id, deleted: true };
|
|
152
|
+
},
|
|
153
|
+
}),
|
|
154
|
+
},
|
|
155
|
+
gitignore: {
|
|
156
|
+
list: op({
|
|
157
|
+
description:
|
|
158
|
+
"Names of GitHub's gitignore templates. Replaces `gh repo gitignore list`.",
|
|
159
|
+
input: s.object({}),
|
|
160
|
+
annotations: reads,
|
|
161
|
+
run: async () => ({
|
|
162
|
+
items: strings(
|
|
163
|
+
await gh.rest("GET", "gitignore/templates"),
|
|
164
|
+
"templates",
|
|
165
|
+
),
|
|
166
|
+
}),
|
|
167
|
+
}),
|
|
168
|
+
view: op({
|
|
169
|
+
description:
|
|
170
|
+
"One gitignore template's text. Replaces `gh repo gitignore view`.",
|
|
171
|
+
input: s.object({
|
|
172
|
+
name: s.string({
|
|
173
|
+
description: "Template name, e.g. Node (case-sensitive).",
|
|
174
|
+
}),
|
|
175
|
+
}),
|
|
176
|
+
annotations: reads,
|
|
177
|
+
run: async ({ name }) => {
|
|
178
|
+
const x = await gh.rest("GET", `gitignore/templates/${enc(name)}`);
|
|
179
|
+
return { name: str(x, "name"), source: str(x, "source") };
|
|
180
|
+
},
|
|
181
|
+
}),
|
|
182
|
+
},
|
|
183
|
+
license: {
|
|
184
|
+
list: op({
|
|
185
|
+
description:
|
|
186
|
+
"Commonly used licenses with their keys and SPDX ids. Replaces `gh repo license list`.",
|
|
187
|
+
input: s.object({}),
|
|
188
|
+
annotations: reads,
|
|
189
|
+
run: async () => ({
|
|
190
|
+
items: arr(await gh.rest("GET", "licenses"), "licenses").map(license),
|
|
191
|
+
}),
|
|
192
|
+
}),
|
|
193
|
+
view: op({
|
|
194
|
+
description:
|
|
195
|
+
"One license's text, summary, permissions, conditions and limitations, by key or SPDX id. Replaces `gh repo license view`.",
|
|
196
|
+
input: s.object({
|
|
197
|
+
license: s.string({
|
|
198
|
+
description: "License key or SPDX id, e.g. mit or Apache-2.0.",
|
|
199
|
+
}),
|
|
200
|
+
}),
|
|
201
|
+
annotations: reads,
|
|
202
|
+
run: async ({ license: key }) => {
|
|
203
|
+
const x = await gh.rest("GET", `licenses/${enc(key.toLowerCase())}`);
|
|
204
|
+
return {
|
|
205
|
+
...license(x),
|
|
206
|
+
description: optStr(x, "description"),
|
|
207
|
+
implementation: optStr(x, "implementation"),
|
|
208
|
+
permissions: strings(at(x, "permissions") ?? [], "permissions"),
|
|
209
|
+
conditions: strings(at(x, "conditions") ?? [], "conditions"),
|
|
210
|
+
limitations: strings(at(x, "limitations") ?? [], "limitations"),
|
|
211
|
+
body: str(x, "body"),
|
|
212
|
+
url: optStr(x, "html_url"),
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
}),
|
|
216
|
+
},
|
|
217
|
+
});
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// `repo list`: an owner's repositories through GraphQL, or through repository search when filtering by language or topic.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { limitField, reads } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import type { Json } from "./read.ts";
|
|
6
|
+
import { at, bool, nodes, optNum, optStr, str } from "./read.ts";
|
|
7
|
+
|
|
8
|
+
const FIELDS = `nameWithOwner description visibility isFork isArchived isTemplate
|
|
9
|
+
primaryLanguage { name } repositoryTopics(first: 20) { nodes { topic { name } } }
|
|
10
|
+
stargazerCount defaultBranchRef { name } pushedAt url`;
|
|
11
|
+
const PAGE = "pageInfo { hasNextPage endCursor }";
|
|
12
|
+
|
|
13
|
+
const OWNER_QUERY = `query($login: String!, $first: Int!, $after: String, $visibility: RepositoryVisibility, $isFork: Boolean, $isArchived: Boolean) {
|
|
14
|
+
repositoryOwner(login: $login) {
|
|
15
|
+
repositories(first: $first, after: $after, visibility: $visibility, isFork: $isFork, isArchived: $isArchived,
|
|
16
|
+
ownerAffiliations: [OWNER], orderBy: { field: PUSHED_AT, direction: DESC }) { nodes { ${FIELDS} } ${PAGE} }
|
|
17
|
+
}
|
|
18
|
+
}`;
|
|
19
|
+
const SEARCH_QUERY = `query($q: String!, $first: Int!, $after: String) {
|
|
20
|
+
search(query: $q, type: REPOSITORY, first: $first, after: $after) { nodes { ... on Repository { ${FIELDS} } } ${PAGE} }
|
|
21
|
+
}`;
|
|
22
|
+
|
|
23
|
+
const listed = (n: unknown) => ({
|
|
24
|
+
repo: str(n, "nameWithOwner"),
|
|
25
|
+
description: optStr(n, "description"),
|
|
26
|
+
visibility: str(n, "visibility").toLowerCase(),
|
|
27
|
+
fork: bool(n, "isFork"),
|
|
28
|
+
archived: bool(n, "isArchived"),
|
|
29
|
+
template: bool(n, "isTemplate"),
|
|
30
|
+
language: optStr(n, "primaryLanguage", "name"),
|
|
31
|
+
topics: nodes(n, "repositoryTopics").flatMap((t) => {
|
|
32
|
+
const name = optStr(t, "topic", "name");
|
|
33
|
+
return name === null ? [] : [name];
|
|
34
|
+
}),
|
|
35
|
+
stars: optNum(n, "stargazerCount"),
|
|
36
|
+
defaultBranch: optStr(n, "defaultBranchRef", "name"),
|
|
37
|
+
pushedAt: optStr(n, "pushedAt"),
|
|
38
|
+
url: str(n, "url"),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const quote = (v: string) => (/\s/.test(v) ? `"${v}"` : v);
|
|
42
|
+
|
|
43
|
+
export const listOp = (gh: GitHub) =>
|
|
44
|
+
op({
|
|
45
|
+
description:
|
|
46
|
+
"An owner's repositories, most recently pushed first; the authenticated user's when owner is omitted. Language and topic filters go through repository search, which can lag behind brand-new repositories. Replaces `gh repo list`.",
|
|
47
|
+
input: s.object({
|
|
48
|
+
owner: s.optional(
|
|
49
|
+
s.string({ description: "User or organization login." }),
|
|
50
|
+
),
|
|
51
|
+
visibility: s.optional(s.enum(["public", "private", "internal"])),
|
|
52
|
+
fork: s.optional(
|
|
53
|
+
s.boolean({
|
|
54
|
+
description:
|
|
55
|
+
"true: only forks (gh --fork); false: only non-forks (gh --source).",
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
58
|
+
archived: s.optional(
|
|
59
|
+
s.boolean({
|
|
60
|
+
description:
|
|
61
|
+
"true: only archived (gh --archived); false: omit archived (gh --no-archived).",
|
|
62
|
+
}),
|
|
63
|
+
),
|
|
64
|
+
language: s.optional(s.string({ description: "Primary language." })),
|
|
65
|
+
topics: s.optional(s.array(s.string())),
|
|
66
|
+
limit: limitField(30),
|
|
67
|
+
}),
|
|
68
|
+
annotations: reads,
|
|
69
|
+
run: async ({
|
|
70
|
+
owner,
|
|
71
|
+
visibility,
|
|
72
|
+
fork,
|
|
73
|
+
archived,
|
|
74
|
+
language,
|
|
75
|
+
topics,
|
|
76
|
+
limit,
|
|
77
|
+
}) => {
|
|
78
|
+
const login =
|
|
79
|
+
owner ??
|
|
80
|
+
str(
|
|
81
|
+
await gh.graphql("query { viewer { login } }", {}),
|
|
82
|
+
"viewer",
|
|
83
|
+
"login",
|
|
84
|
+
);
|
|
85
|
+
const searching = language !== undefined || (topics?.length ?? 0) > 0;
|
|
86
|
+
const [query, base, path]: [string, Json, readonly string[]] = searching
|
|
87
|
+
? [
|
|
88
|
+
SEARCH_QUERY,
|
|
89
|
+
{
|
|
90
|
+
q: [
|
|
91
|
+
`user:${login}`,
|
|
92
|
+
fork === undefined
|
|
93
|
+
? "fork:true"
|
|
94
|
+
: fork
|
|
95
|
+
? "fork:only"
|
|
96
|
+
: "fork:false",
|
|
97
|
+
archived === undefined ? undefined : `archived:${archived}`,
|
|
98
|
+
visibility === undefined ? undefined : `is:${visibility}`,
|
|
99
|
+
language === undefined
|
|
100
|
+
? undefined
|
|
101
|
+
: `language:${quote(language)}`,
|
|
102
|
+
...(topics ?? []).map((t) => `topic:${quote(t)}`),
|
|
103
|
+
"sort:updated",
|
|
104
|
+
]
|
|
105
|
+
.filter((part) => part !== undefined)
|
|
106
|
+
.join(" "),
|
|
107
|
+
},
|
|
108
|
+
["search"],
|
|
109
|
+
]
|
|
110
|
+
: [
|
|
111
|
+
OWNER_QUERY,
|
|
112
|
+
{
|
|
113
|
+
login,
|
|
114
|
+
visibility: visibility?.toUpperCase() ?? null,
|
|
115
|
+
isFork: fork ?? null,
|
|
116
|
+
isArchived: archived ?? null,
|
|
117
|
+
},
|
|
118
|
+
["repositoryOwner", "repositories"],
|
|
119
|
+
];
|
|
120
|
+
const want = limit ?? 30;
|
|
121
|
+
const items: ReturnType<typeof listed>[] = [];
|
|
122
|
+
let after: string | null = null;
|
|
123
|
+
do {
|
|
124
|
+
const data = await gh.graphql(query, {
|
|
125
|
+
...base,
|
|
126
|
+
first: Math.min(100, want - items.length),
|
|
127
|
+
after,
|
|
128
|
+
});
|
|
129
|
+
if (!searching && at(data, "repositoryOwner") === null)
|
|
130
|
+
throw new SurfaceError(
|
|
131
|
+
"not_found",
|
|
132
|
+
`no user or organization ${login}`,
|
|
133
|
+
"check the owner login",
|
|
134
|
+
);
|
|
135
|
+
const conn = at(data, ...path);
|
|
136
|
+
items.push(...nodes(conn).map(listed));
|
|
137
|
+
after = bool(conn, "pageInfo", "hasNextPage")
|
|
138
|
+
? optStr(conn, "pageInfo", "endCursor")
|
|
139
|
+
: null;
|
|
140
|
+
} while (after !== null && items.length < want);
|
|
141
|
+
return { owner: login, items: items.slice(0, want) };
|
|
142
|
+
},
|
|
143
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// A repository's settings as returned by create and edit, and the `repo edit` operation that changes them.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { arr, at, bool, optNum, optStr, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const flag = (x: unknown, key: string): boolean | null => {
|
|
8
|
+
const v = at(x, key);
|
|
9
|
+
return typeof v === "boolean" ? v : null;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const strings = (x: unknown, what: string): string[] =>
|
|
13
|
+
arr(x, what).filter((t): t is string => typeof t === "string");
|
|
14
|
+
|
|
15
|
+
export const defined = (
|
|
16
|
+
fields: Readonly<Record<string, unknown>>,
|
|
17
|
+
): Record<string, unknown> =>
|
|
18
|
+
Object.fromEntries(Object.entries(fields).filter(([, v]) => v !== undefined));
|
|
19
|
+
|
|
20
|
+
export const repoSettings = (x: unknown) => ({
|
|
21
|
+
repo: str(x, "full_name"),
|
|
22
|
+
description: optStr(x, "description"),
|
|
23
|
+
homepage: optStr(x, "homepage"),
|
|
24
|
+
defaultBranch: str(x, "default_branch"),
|
|
25
|
+
visibility: optStr(x, "visibility"),
|
|
26
|
+
private: bool(x, "private"),
|
|
27
|
+
archived: bool(x, "archived"),
|
|
28
|
+
fork: bool(x, "fork"),
|
|
29
|
+
template: flag(x, "is_template"),
|
|
30
|
+
stars: optNum(x, "stargazers_count"),
|
|
31
|
+
openIssues: optNum(x, "open_issues_count"),
|
|
32
|
+
topics: strings(at(x, "topics") ?? [], "topics"),
|
|
33
|
+
pushedAt: optStr(x, "pushed_at"),
|
|
34
|
+
url: str(x, "html_url"),
|
|
35
|
+
hasIssues: flag(x, "has_issues"),
|
|
36
|
+
hasWiki: flag(x, "has_wiki"),
|
|
37
|
+
hasProjects: flag(x, "has_projects"),
|
|
38
|
+
hasDiscussions: flag(x, "has_discussions"),
|
|
39
|
+
allowForking: flag(x, "allow_forking"),
|
|
40
|
+
allowSquashMerge: flag(x, "allow_squash_merge"),
|
|
41
|
+
allowMergeCommit: flag(x, "allow_merge_commit"),
|
|
42
|
+
allowRebaseMerge: flag(x, "allow_rebase_merge"),
|
|
43
|
+
allowAutoMerge: flag(x, "allow_auto_merge"),
|
|
44
|
+
allowUpdateBranch: flag(x, "allow_update_branch"),
|
|
45
|
+
deleteBranchOnMerge: flag(x, "delete_branch_on_merge"),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// gh's --squash-merge-commit-message choices, as the title/message pair the API takes.
|
|
49
|
+
const SQUASH = {
|
|
50
|
+
default: ["COMMIT_OR_PR_TITLE", "COMMIT_MESSAGES"],
|
|
51
|
+
"pr-title": ["PR_TITLE", "BLANK"],
|
|
52
|
+
"pr-title-commits": ["PR_TITLE", "COMMIT_MESSAGES"],
|
|
53
|
+
"pr-title-description": ["PR_TITLE", "PR_BODY"],
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
56
|
+
const toggle = (description: string) => s.optional(s.boolean({ description }));
|
|
57
|
+
|
|
58
|
+
const status = (v: boolean | undefined) =>
|
|
59
|
+
v === undefined ? undefined : { status: v ? "enabled" : "disabled" };
|
|
60
|
+
|
|
61
|
+
export const editOp = (gh: GitHub) =>
|
|
62
|
+
op({
|
|
63
|
+
description:
|
|
64
|
+
"Change repository settings and topics; booleans set the feature on (true) or off (false), omitted fields stay as they are. Returns the repository's settings afterwards. Replaces `gh repo edit`.",
|
|
65
|
+
input: s.object({
|
|
66
|
+
repo: repoField,
|
|
67
|
+
description: s.optional(s.string()),
|
|
68
|
+
homepage: s.optional(s.string()),
|
|
69
|
+
visibility: s.optional(s.enum(["public", "private", "internal"])),
|
|
70
|
+
acceptVisibilityChangeConsequences: toggle(
|
|
71
|
+
"Must be true when visibility is given: a change can drop stars, watchers and forks.",
|
|
72
|
+
),
|
|
73
|
+
defaultBranch: s.optional(s.string()),
|
|
74
|
+
addTopics: s.optional(s.array(s.string())),
|
|
75
|
+
removeTopics: s.optional(s.array(s.string())),
|
|
76
|
+
enableIssues: toggle("Issues on or off."),
|
|
77
|
+
enableWiki: toggle("Wiki on or off."),
|
|
78
|
+
enableProjects: toggle("Projects on or off."),
|
|
79
|
+
enableDiscussions: toggle("Discussions on or off."),
|
|
80
|
+
allowSquashMerge: toggle("Squash merging of pull requests."),
|
|
81
|
+
allowMergeCommit: toggle("Merge-commit merging of pull requests."),
|
|
82
|
+
allowRebaseMerge: toggle("Rebase merging of pull requests."),
|
|
83
|
+
deleteBranchOnMerge: toggle("Delete head branches after merge."),
|
|
84
|
+
allowUpdateBranch: toggle(
|
|
85
|
+
"Offer updating a pull request branch that is behind its base.",
|
|
86
|
+
),
|
|
87
|
+
enableAutoMerge: toggle("Allow auto-merge on pull requests."),
|
|
88
|
+
template: toggle("Make it a template repository."),
|
|
89
|
+
allowForking: toggle("Allow forking (organization repositories)."),
|
|
90
|
+
enableAdvancedSecurity: toggle("GitHub Advanced Security."),
|
|
91
|
+
enableSecretScanning: toggle("Secret scanning."),
|
|
92
|
+
enableSecretScanningPushProtection: toggle(
|
|
93
|
+
"Secret scanning push protection (secret scanning must be on).",
|
|
94
|
+
),
|
|
95
|
+
squashMergeCommitMessage: s.optional(
|
|
96
|
+
s.enum([
|
|
97
|
+
"default",
|
|
98
|
+
"pr-title",
|
|
99
|
+
"pr-title-commits",
|
|
100
|
+
"pr-title-description",
|
|
101
|
+
]),
|
|
102
|
+
),
|
|
103
|
+
}),
|
|
104
|
+
annotations: writes,
|
|
105
|
+
run: async (i) => {
|
|
106
|
+
if (
|
|
107
|
+
i.visibility !== undefined &&
|
|
108
|
+
i.acceptVisibilityChangeConsequences !== true
|
|
109
|
+
)
|
|
110
|
+
throw new SurfaceError(
|
|
111
|
+
"usage",
|
|
112
|
+
"changing visibility needs acceptVisibilityChangeConsequences: true",
|
|
113
|
+
"a visibility change can lose stars, watchers and forks; confirm it explicitly",
|
|
114
|
+
);
|
|
115
|
+
const r = await gh.repo(i.repo);
|
|
116
|
+
const squash =
|
|
117
|
+
i.squashMergeCommitMessage === undefined
|
|
118
|
+
? undefined
|
|
119
|
+
: SQUASH[i.squashMergeCommitMessage];
|
|
120
|
+
const security = defined({
|
|
121
|
+
advanced_security: status(i.enableAdvancedSecurity),
|
|
122
|
+
secret_scanning: status(i.enableSecretScanning),
|
|
123
|
+
secret_scanning_push_protection: status(
|
|
124
|
+
i.enableSecretScanningPushProtection,
|
|
125
|
+
),
|
|
126
|
+
});
|
|
127
|
+
const patch = defined({
|
|
128
|
+
description: i.description,
|
|
129
|
+
homepage: i.homepage,
|
|
130
|
+
visibility: i.visibility,
|
|
131
|
+
default_branch: i.defaultBranch,
|
|
132
|
+
has_issues: i.enableIssues,
|
|
133
|
+
has_wiki: i.enableWiki,
|
|
134
|
+
has_projects: i.enableProjects,
|
|
135
|
+
has_discussions: i.enableDiscussions,
|
|
136
|
+
allow_squash_merge: i.allowSquashMerge,
|
|
137
|
+
allow_merge_commit: i.allowMergeCommit,
|
|
138
|
+
allow_rebase_merge: i.allowRebaseMerge,
|
|
139
|
+
delete_branch_on_merge: i.deleteBranchOnMerge,
|
|
140
|
+
allow_update_branch: i.allowUpdateBranch,
|
|
141
|
+
allow_auto_merge: i.enableAutoMerge,
|
|
142
|
+
is_template: i.template,
|
|
143
|
+
allow_forking: i.allowForking,
|
|
144
|
+
squash_merge_commit_title: squash?.[0],
|
|
145
|
+
squash_merge_commit_message: squash?.[1],
|
|
146
|
+
security_and_analysis:
|
|
147
|
+
Object.keys(security).length > 0 ? security : undefined,
|
|
148
|
+
});
|
|
149
|
+
const topicsChange =
|
|
150
|
+
(i.addTopics?.length ?? 0) + (i.removeTopics?.length ?? 0) > 0;
|
|
151
|
+
if (Object.keys(patch).length === 0 && !topicsChange)
|
|
152
|
+
throw new SurfaceError(
|
|
153
|
+
"usage",
|
|
154
|
+
"nothing to change",
|
|
155
|
+
"pass at least one setting or topic",
|
|
156
|
+
);
|
|
157
|
+
const after =
|
|
158
|
+
Object.keys(patch).length > 0
|
|
159
|
+
? await gh.rest("PATCH", `repos/${r.full}`, { body: patch })
|
|
160
|
+
: await gh.rest("GET", `repos/${r.full}`);
|
|
161
|
+
const settings = repoSettings(after);
|
|
162
|
+
if (!topicsChange) return settings;
|
|
163
|
+
const current = strings(
|
|
164
|
+
at(await gh.rest("GET", `repos/${r.full}/topics`), "names"),
|
|
165
|
+
"names",
|
|
166
|
+
);
|
|
167
|
+
const drop = new Set(i.removeTopics ?? []);
|
|
168
|
+
const names = [...new Set([...current, ...(i.addTopics ?? [])])].filter(
|
|
169
|
+
(t) => !drop.has(t),
|
|
170
|
+
);
|
|
171
|
+
const put = await gh.rest("PUT", `repos/${settings.repo}/topics`, {
|
|
172
|
+
body: { names },
|
|
173
|
+
});
|
|
174
|
+
return { ...settings, topics: strings(at(put, "names"), "names") };
|
|
175
|
+
},
|
|
176
|
+
});
|