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,81 @@
|
|
|
1
|
+
// `repo sync` in its remote form: bring a branch of a repository up to date with its upstream or another repository.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { optStr, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
// Reading one ref is git/ref/... (git/refs/... lists every ref with that prefix); updating it is git/refs/....
|
|
8
|
+
const refPath = (kind: "ref" | "refs", branch: string) =>
|
|
9
|
+
`git/${kind}/heads/${branch.split("/").map(enc).join("/")}`;
|
|
10
|
+
|
|
11
|
+
export const syncOp = (gh: GitHub) =>
|
|
12
|
+
op({
|
|
13
|
+
description:
|
|
14
|
+
"Update a branch of a repository on GitHub: without source, merge it from the fork's upstream (falling back to a forced reset to the parent when force is set and the merge conflicts); with source, move it to the source branch's head, fast-forward only unless force. No local checkout is touched. Replaces `gh repo sync` for a remote repository.",
|
|
15
|
+
input: s.object({
|
|
16
|
+
repo: repoField,
|
|
17
|
+
branch: s.optional(
|
|
18
|
+
s.string({
|
|
19
|
+
description:
|
|
20
|
+
"Branch to sync; default the destination's default branch (with source: the source's).",
|
|
21
|
+
}),
|
|
22
|
+
),
|
|
23
|
+
source: s.optional(
|
|
24
|
+
s.string({ description: "Source repository owner/name." }),
|
|
25
|
+
),
|
|
26
|
+
force: s.optional(
|
|
27
|
+
s.boolean({
|
|
28
|
+
description:
|
|
29
|
+
"Hard reset the branch to the source, discarding its own commits.",
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
}),
|
|
33
|
+
annotations: writes,
|
|
34
|
+
run: async ({ repo, branch, source, force }) => {
|
|
35
|
+
const r = await gh.repo(repo);
|
|
36
|
+
const fromSource = async (src: string) => {
|
|
37
|
+
const name =
|
|
38
|
+
branch ?? str(await gh.rest("GET", `repos/${src}`), "default_branch");
|
|
39
|
+
const sha = str(
|
|
40
|
+
await gh.rest("GET", `repos/${src}/${refPath("ref", name)}`),
|
|
41
|
+
"object",
|
|
42
|
+
"sha",
|
|
43
|
+
);
|
|
44
|
+
await gh.rest("PATCH", `repos/${r.full}/${refPath("refs", name)}`, {
|
|
45
|
+
body: { sha, force: force === true },
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
repo: r.full,
|
|
49
|
+
branch: name,
|
|
50
|
+
source: src,
|
|
51
|
+
sha,
|
|
52
|
+
mergeType: force === true ? "reset" : "fast-forward",
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
if (source !== undefined) return fromSource((await gh.repo(source)).full);
|
|
56
|
+
const dest = await gh.rest("GET", `repos/${r.full}`);
|
|
57
|
+
const name = branch ?? str(dest, "default_branch");
|
|
58
|
+
try {
|
|
59
|
+
const m = await gh.rest("POST", `repos/${r.full}/merge-upstream`, {
|
|
60
|
+
body: { branch: name },
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
repo: r.full,
|
|
64
|
+
branch: name,
|
|
65
|
+
source: optStr(dest, "parent", "full_name"),
|
|
66
|
+
sha: null,
|
|
67
|
+
mergeType: optStr(m, "merge_type"),
|
|
68
|
+
};
|
|
69
|
+
} catch (error) {
|
|
70
|
+
const parent = optStr(dest, "parent", "full_name");
|
|
71
|
+
if (
|
|
72
|
+
force === true &&
|
|
73
|
+
parent !== null &&
|
|
74
|
+
error instanceof SurfaceError &&
|
|
75
|
+
error.kind === "conflict"
|
|
76
|
+
)
|
|
77
|
+
return fromSource(parent);
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// `repo url`: the github.com address `gh browse -n` prints, built locally; only a bare path asks GitHub for the default branch.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, reads, repoField } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const segments = (path: string) =>
|
|
8
|
+
path.split("/").filter(Boolean).map(enc).join("/");
|
|
9
|
+
|
|
10
|
+
const usage = (message: string) =>
|
|
11
|
+
new SurfaceError(
|
|
12
|
+
"usage",
|
|
13
|
+
message,
|
|
14
|
+
"see the field descriptions of `repo url`",
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const urlOp = (gh: GitHub) =>
|
|
18
|
+
op({
|
|
19
|
+
description:
|
|
20
|
+
"The github.com URL of a repository, an issue or pull request, a file or directory (optionally at a branch or commit and line), a commit, or a repository page. Opens nothing. Replaces `gh browse -n`.",
|
|
21
|
+
input: s.object({
|
|
22
|
+
repo: repoField,
|
|
23
|
+
number: s.optional(
|
|
24
|
+
s.integer({ description: "Issue or pull request number." }),
|
|
25
|
+
),
|
|
26
|
+
path: s.optional(
|
|
27
|
+
s.string({
|
|
28
|
+
description: "File or directory path from the repository root.",
|
|
29
|
+
}),
|
|
30
|
+
),
|
|
31
|
+
line: s.optional(s.integer({ description: "Line to point at in path." })),
|
|
32
|
+
endLine: s.optional(
|
|
33
|
+
s.integer({ description: "Last line of a range starting at line." }),
|
|
34
|
+
),
|
|
35
|
+
blame: s.optional(s.boolean({ description: "Blame view of path." })),
|
|
36
|
+
branch: s.optional(
|
|
37
|
+
s.string({
|
|
38
|
+
description: "Branch for path, or the branch's tree alone.",
|
|
39
|
+
}),
|
|
40
|
+
),
|
|
41
|
+
commit: s.optional(
|
|
42
|
+
s.string({
|
|
43
|
+
description:
|
|
44
|
+
"Commit SHA: the version of path, or the commit page alone.",
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
page: s.optional(
|
|
48
|
+
s.enum(["settings", "wiki", "releases", "actions", "projects"]),
|
|
49
|
+
),
|
|
50
|
+
}),
|
|
51
|
+
annotations: reads,
|
|
52
|
+
run: async ({
|
|
53
|
+
repo,
|
|
54
|
+
number,
|
|
55
|
+
path,
|
|
56
|
+
line,
|
|
57
|
+
endLine,
|
|
58
|
+
blame,
|
|
59
|
+
branch,
|
|
60
|
+
commit,
|
|
61
|
+
page,
|
|
62
|
+
}) => {
|
|
63
|
+
const located =
|
|
64
|
+
path !== undefined || branch !== undefined || commit !== undefined;
|
|
65
|
+
if (
|
|
66
|
+
[number !== undefined, page !== undefined, located].filter(Boolean)
|
|
67
|
+
.length > 1
|
|
68
|
+
)
|
|
69
|
+
throw usage("pass only one of number, page, or path/branch/commit");
|
|
70
|
+
if (branch !== undefined && commit !== undefined)
|
|
71
|
+
throw usage("pass branch or commit, not both");
|
|
72
|
+
if (path === undefined && (line !== undefined || blame === true))
|
|
73
|
+
throw usage("line and blame need a path");
|
|
74
|
+
if (endLine !== undefined && line === undefined)
|
|
75
|
+
throw usage("endLine needs line");
|
|
76
|
+
const r = await gh.repo(repo);
|
|
77
|
+
const base = `https://github.com/${r.full}`;
|
|
78
|
+
const at = (suffix: string) => ({
|
|
79
|
+
repo: r.full,
|
|
80
|
+
url: `${base}/${suffix}`,
|
|
81
|
+
});
|
|
82
|
+
if (number !== undefined) return at(`issues/${number}`);
|
|
83
|
+
if (page !== undefined) return at(page);
|
|
84
|
+
if (path === undefined) {
|
|
85
|
+
if (commit !== undefined) return at(`commit/${enc(commit)}`);
|
|
86
|
+
if (branch !== undefined) return at(`tree/${segments(branch)}`);
|
|
87
|
+
return { repo: r.full, url: base };
|
|
88
|
+
}
|
|
89
|
+
const ref =
|
|
90
|
+
branch ??
|
|
91
|
+
commit ??
|
|
92
|
+
str(await gh.rest("GET", `repos/${r.full}`), "default_branch");
|
|
93
|
+
const view =
|
|
94
|
+
blame === true ? "blame" : line === undefined ? "tree" : "blob";
|
|
95
|
+
// Markdown renders by default, and a rendered page has no line anchors.
|
|
96
|
+
const plain =
|
|
97
|
+
view === "blob" && /\.(md|markdown)$/i.test(path) ? "?plain=1" : "";
|
|
98
|
+
const anchor =
|
|
99
|
+
line === undefined
|
|
100
|
+
? ""
|
|
101
|
+
: `#L${line}${endLine === undefined ? "" : `-L${endLine}`}`;
|
|
102
|
+
return at(`${view}/${segments(ref)}/${segments(path)}${plain}${anchor}`);
|
|
103
|
+
},
|
|
104
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { op, s } from "../vendor/surface/index.ts";
|
|
2
|
+
import { enc, limitField, reads, repoField } from "./fields.ts";
|
|
3
|
+
import type { GitHub } from "./http.ts";
|
|
4
|
+
import { arr, at, bool, num, optNum, optStr, str } from "./read.ts";
|
|
5
|
+
|
|
6
|
+
const release = (x: unknown) => ({
|
|
7
|
+
tag: str(x, "tag_name"),
|
|
8
|
+
name: optStr(x, "name"),
|
|
9
|
+
draft: bool(x, "draft"),
|
|
10
|
+
prerelease: bool(x, "prerelease"),
|
|
11
|
+
target: optStr(x, "target_commitish"),
|
|
12
|
+
publishedAt: optStr(x, "published_at"),
|
|
13
|
+
url: str(x, "html_url"),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const repoOps = (gh: GitHub) => ({
|
|
17
|
+
view: op({
|
|
18
|
+
description:
|
|
19
|
+
"Repository facts: default branch, visibility, archived, description, counts, topics. Replaces `gh repo view --json`.",
|
|
20
|
+
input: s.object({ repo: repoField }),
|
|
21
|
+
annotations: reads,
|
|
22
|
+
run: async ({ repo }) => {
|
|
23
|
+
const r = await gh.repo(repo);
|
|
24
|
+
const x = await gh.rest("GET", `repos/${r.full}`);
|
|
25
|
+
return {
|
|
26
|
+
repo: str(x, "full_name"),
|
|
27
|
+
description: optStr(x, "description"),
|
|
28
|
+
defaultBranch: str(x, "default_branch"),
|
|
29
|
+
visibility: optStr(x, "visibility"),
|
|
30
|
+
private: bool(x, "private"),
|
|
31
|
+
archived: bool(x, "archived"),
|
|
32
|
+
fork: bool(x, "fork"),
|
|
33
|
+
stars: optNum(x, "stargazers_count"),
|
|
34
|
+
openIssues: optNum(x, "open_issues_count"),
|
|
35
|
+
topics: arr(at(x, "topics") ?? [], "topics").filter(
|
|
36
|
+
(t) => typeof t === "string",
|
|
37
|
+
),
|
|
38
|
+
pushedAt: optStr(x, "pushed_at"),
|
|
39
|
+
url: str(x, "html_url"),
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const releaseOps = (gh: GitHub) => ({
|
|
46
|
+
list: op({
|
|
47
|
+
description:
|
|
48
|
+
"Releases, newest first, drafts included when the token can see them. Replaces `gh release list`.",
|
|
49
|
+
input: s.object({ repo: repoField, limit: limitField(20) }),
|
|
50
|
+
annotations: reads,
|
|
51
|
+
run: async ({ repo, limit }) => {
|
|
52
|
+
const r = await gh.repo(repo);
|
|
53
|
+
return {
|
|
54
|
+
repo: r.full,
|
|
55
|
+
releases: (await gh.list(`repos/${r.full}/releases`, limit ?? 20)).map(
|
|
56
|
+
release,
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
view: op({
|
|
62
|
+
description:
|
|
63
|
+
"One release by tag (latest when omitted) with notes and assets. Replaces `gh release view`.",
|
|
64
|
+
input: s.object({ repo: repoField, tag: s.optional(s.string()) }),
|
|
65
|
+
annotations: reads,
|
|
66
|
+
run: async ({ repo, tag }) => {
|
|
67
|
+
const r = await gh.repo(repo);
|
|
68
|
+
const x = await gh.rest(
|
|
69
|
+
"GET",
|
|
70
|
+
tag === undefined
|
|
71
|
+
? `repos/${r.full}/releases/latest`
|
|
72
|
+
: `repos/${r.full}/releases/tags/${enc(tag)}`,
|
|
73
|
+
);
|
|
74
|
+
return {
|
|
75
|
+
repo: r.full,
|
|
76
|
+
...release(x),
|
|
77
|
+
body: optStr(x, "body") ?? "",
|
|
78
|
+
assets: arr(at(x, "assets") ?? [], "assets").map((a) => ({
|
|
79
|
+
name: str(a, "name"),
|
|
80
|
+
size: num(a, "size"),
|
|
81
|
+
downloads: num(a, "download_count"),
|
|
82
|
+
url: str(a, "browser_download_url"),
|
|
83
|
+
})),
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
}),
|
|
87
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// How a ruleset is scoped (repository or org), its input fields, and how GitHub's ruleset JSON is trimmed.
|
|
2
|
+
import { s } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { arr, at, isObj, num, optNum, optStr, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
export const repoOrg = {
|
|
8
|
+
repo: s.optional(
|
|
9
|
+
s.string({
|
|
10
|
+
description:
|
|
11
|
+
"owner/name (a github.com URL works too). Defaults to the git origin of the current directory; ignored with org.",
|
|
12
|
+
}),
|
|
13
|
+
),
|
|
14
|
+
org: s.optional(
|
|
15
|
+
s.string({ description: "Organization, for an org-level ruleset." }),
|
|
16
|
+
),
|
|
17
|
+
};
|
|
18
|
+
export const idField = s.integer({ description: "Ruleset id." });
|
|
19
|
+
const rule = s.object({
|
|
20
|
+
type: s.string(),
|
|
21
|
+
parameters: s.optional(s.record(s.unknown())),
|
|
22
|
+
});
|
|
23
|
+
const bypassActor = s.object({
|
|
24
|
+
actorId: s.optional(
|
|
25
|
+
s.integer({ description: "Omit for OrganizationAdmin / DeployKey." }),
|
|
26
|
+
),
|
|
27
|
+
actorType: s.enum([
|
|
28
|
+
"Integration",
|
|
29
|
+
"OrganizationAdmin",
|
|
30
|
+
"RepositoryRole",
|
|
31
|
+
"Team",
|
|
32
|
+
"DeployKey",
|
|
33
|
+
]),
|
|
34
|
+
bypassMode: s.optional(s.enum(["always", "pull_request", "exempt"])),
|
|
35
|
+
});
|
|
36
|
+
export const fields = {
|
|
37
|
+
target: s.enum(["branch", "tag", "push"]),
|
|
38
|
+
enforcement: s.enum(["active", "disabled", "evaluate"]),
|
|
39
|
+
include: s.optional(
|
|
40
|
+
s.array(s.string(), {
|
|
41
|
+
description:
|
|
42
|
+
'Ref name patterns, e.g. "~DEFAULT_BRANCH", "refs/heads/main", "~ALL".',
|
|
43
|
+
}),
|
|
44
|
+
),
|
|
45
|
+
exclude: s.optional(s.array(s.string())),
|
|
46
|
+
conditions: s.optional(
|
|
47
|
+
s.record(s.unknown(), {
|
|
48
|
+
description:
|
|
49
|
+
"Other GitHub condition objects set beside ref_name, e.g. repository_name for an org ruleset.",
|
|
50
|
+
}),
|
|
51
|
+
),
|
|
52
|
+
bypassActors: s.optional(s.array(bypassActor)),
|
|
53
|
+
rules: s.optional(
|
|
54
|
+
s.array(rule, {
|
|
55
|
+
description:
|
|
56
|
+
"GitHub rule objects ({ type, parameters }), sent unchanged.",
|
|
57
|
+
}),
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type Scope = {
|
|
62
|
+
readonly path: string;
|
|
63
|
+
readonly out: { readonly repo: string } | { readonly org: string };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const scopeOf = async (
|
|
67
|
+
gh: GitHub,
|
|
68
|
+
repo: string | undefined,
|
|
69
|
+
org: string | undefined,
|
|
70
|
+
): Promise<Scope> => {
|
|
71
|
+
if (org !== undefined) return { path: `orgs/${enc(org)}`, out: { org } };
|
|
72
|
+
const r = await gh.repo(repo);
|
|
73
|
+
return { path: `repos/${r.full}`, out: { repo: r.full } };
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const summary = (x: unknown) => ({
|
|
77
|
+
id: num(x, "id"),
|
|
78
|
+
name: str(x, "name"),
|
|
79
|
+
target: optStr(x, "target"),
|
|
80
|
+
enforcement: str(x, "enforcement"),
|
|
81
|
+
source: optStr(x, "source"),
|
|
82
|
+
sourceType: optStr(x, "source_type"),
|
|
83
|
+
updatedAt: optStr(x, "updated_at"),
|
|
84
|
+
url: optStr(x, "_links", "html", "href"),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const detail = (x: unknown) => ({
|
|
88
|
+
...summary(x),
|
|
89
|
+
conditions: isObj(at(x, "conditions")) ? at(x, "conditions") : null,
|
|
90
|
+
bypassActors: arr(at(x, "bypass_actors") ?? [], "bypass_actors").map((a) => ({
|
|
91
|
+
actorId: optNum(a, "actor_id"),
|
|
92
|
+
actorType: str(a, "actor_type"),
|
|
93
|
+
bypassMode: optStr(a, "bypass_mode"),
|
|
94
|
+
})),
|
|
95
|
+
rules: arr(at(x, "rules") ?? [], "rules"),
|
|
96
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Ruleset writes: create, edit and delete (gh has no writer for these).
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { irreversible, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { arr, at, isObj } from "./read.ts";
|
|
6
|
+
import { detail, fields, idField, repoOrg, scopeOf } from "./ruleset-shape.ts";
|
|
7
|
+
|
|
8
|
+
type Fields = {
|
|
9
|
+
readonly name?: string | undefined;
|
|
10
|
+
readonly target?: string | undefined;
|
|
11
|
+
readonly enforcement?: string | undefined;
|
|
12
|
+
readonly include?: readonly string[] | undefined;
|
|
13
|
+
readonly exclude?: readonly string[] | undefined;
|
|
14
|
+
readonly conditions?: Readonly<Record<string, unknown>> | undefined;
|
|
15
|
+
readonly bypassActors?:
|
|
16
|
+
| readonly {
|
|
17
|
+
readonly actorId?: number | undefined;
|
|
18
|
+
readonly actorType: string;
|
|
19
|
+
readonly bypassMode?: string | undefined;
|
|
20
|
+
}[]
|
|
21
|
+
| undefined;
|
|
22
|
+
readonly rules?: readonly unknown[] | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// PUT replaces conditions whole, so an edit that names only one side keeps the other from `current`.
|
|
26
|
+
const body = (f: Fields, current: unknown) => {
|
|
27
|
+
const existing = at(current, "conditions");
|
|
28
|
+
const refName = at(existing, "ref_name");
|
|
29
|
+
const keepList = (key: string): unknown[] => [
|
|
30
|
+
...arr(at(refName, key) ?? [], key),
|
|
31
|
+
];
|
|
32
|
+
const touchesRefs = f.include !== undefined || f.exclude !== undefined;
|
|
33
|
+
const conditions =
|
|
34
|
+
touchesRefs || f.conditions !== undefined
|
|
35
|
+
? {
|
|
36
|
+
...(isObj(existing) ? existing : {}),
|
|
37
|
+
...f.conditions,
|
|
38
|
+
...(touchesRefs
|
|
39
|
+
? {
|
|
40
|
+
ref_name: {
|
|
41
|
+
include: f.include ?? keepList("include"),
|
|
42
|
+
exclude: f.exclude ?? keepList("exclude"),
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
: {}),
|
|
46
|
+
}
|
|
47
|
+
: undefined;
|
|
48
|
+
const entries = {
|
|
49
|
+
name: f.name,
|
|
50
|
+
target: f.target,
|
|
51
|
+
enforcement: f.enforcement,
|
|
52
|
+
conditions,
|
|
53
|
+
bypass_actors: f.bypassActors?.map((a) => ({
|
|
54
|
+
actor_id: a.actorId ?? null,
|
|
55
|
+
actor_type: a.actorType,
|
|
56
|
+
bypass_mode: a.bypassMode ?? "always",
|
|
57
|
+
})),
|
|
58
|
+
rules: f.rules,
|
|
59
|
+
};
|
|
60
|
+
return Object.fromEntries(
|
|
61
|
+
Object.entries(entries).filter(([, v]) => v !== undefined),
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const rulesetWriteOps = (gh: GitHub) => ({
|
|
66
|
+
create: op({
|
|
67
|
+
description:
|
|
68
|
+
"Create a ruleset on a repository, or on an org with `org`. gh has no equivalent.",
|
|
69
|
+
input: s.object({ ...repoOrg, name: s.string(), ...fields }),
|
|
70
|
+
annotations: writes,
|
|
71
|
+
run: async ({ repo, org, ...f }) => {
|
|
72
|
+
const sc = await scopeOf(gh, repo, org);
|
|
73
|
+
const x = await gh.rest("POST", `${sc.path}/rulesets`, {
|
|
74
|
+
body: body(f, undefined),
|
|
75
|
+
});
|
|
76
|
+
return { ...sc.out, ...detail(x) };
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
edit: op({
|
|
80
|
+
description:
|
|
81
|
+
"Change any field of a ruleset; `include` or `exclude` alone keeps the other side, `rules` and `bypassActors` replace the whole list. gh has no equivalent.",
|
|
82
|
+
input: s.object({
|
|
83
|
+
...repoOrg,
|
|
84
|
+
id: idField,
|
|
85
|
+
name: s.optional(s.string()),
|
|
86
|
+
target: s.optional(fields.target),
|
|
87
|
+
enforcement: s.optional(fields.enforcement),
|
|
88
|
+
include: fields.include,
|
|
89
|
+
exclude: fields.exclude,
|
|
90
|
+
conditions: fields.conditions,
|
|
91
|
+
bypassActors: fields.bypassActors,
|
|
92
|
+
rules: fields.rules,
|
|
93
|
+
}),
|
|
94
|
+
annotations: writes,
|
|
95
|
+
run: async ({ repo, org, id, ...f }) => {
|
|
96
|
+
const sc = await scopeOf(gh, repo, org);
|
|
97
|
+
if (Object.values(f).every((v) => v === undefined))
|
|
98
|
+
throw new SurfaceError(
|
|
99
|
+
"usage",
|
|
100
|
+
"nothing to change",
|
|
101
|
+
"pass at least one ruleset field",
|
|
102
|
+
);
|
|
103
|
+
const path = `${sc.path}/rulesets/${id}`;
|
|
104
|
+
const needsCurrent =
|
|
105
|
+
f.include !== undefined ||
|
|
106
|
+
f.exclude !== undefined ||
|
|
107
|
+
f.conditions !== undefined;
|
|
108
|
+
const current = needsCurrent ? await gh.rest("GET", path) : undefined;
|
|
109
|
+
const x = await gh.rest("PUT", path, { body: body(f, current) });
|
|
110
|
+
return { ...sc.out, ...detail(x) };
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
delete: op({
|
|
114
|
+
description:
|
|
115
|
+
"Delete a ruleset; its rules stop applying at once. gh has no equivalent.",
|
|
116
|
+
input: s.object({ ...repoOrg, id: idField }),
|
|
117
|
+
annotations: irreversible,
|
|
118
|
+
run: async ({ repo, org, id }) => {
|
|
119
|
+
const sc = await scopeOf(gh, repo, org);
|
|
120
|
+
await gh.rest("DELETE", `${sc.path}/rulesets/${id}`);
|
|
121
|
+
return { ...sc.out, id, deleted: true };
|
|
122
|
+
},
|
|
123
|
+
}),
|
|
124
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Repository and organization rulesets: list, view and the rules that apply to a branch; writes in rulesets-write.ts.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, limitField, reads, repoField } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { at, num, optStr, str } from "./read.ts";
|
|
6
|
+
import { detail, idField, repoOrg, scopeOf, summary } from "./ruleset-shape.ts";
|
|
7
|
+
import { rulesetWriteOps } from "./rulesets-write.ts";
|
|
8
|
+
|
|
9
|
+
export const rulesetOps = (gh: GitHub) => ({
|
|
10
|
+
list: op({
|
|
11
|
+
description:
|
|
12
|
+
"Rulesets of a repository (with those inherited from its org unless `parents: false`) or of an org. Replaces `gh ruleset list`.",
|
|
13
|
+
input: s.object({
|
|
14
|
+
...repoOrg,
|
|
15
|
+
parents: s.optional(s.boolean()),
|
|
16
|
+
limit: limitField(30),
|
|
17
|
+
}),
|
|
18
|
+
annotations: reads,
|
|
19
|
+
run: async ({ repo, org, parents, limit }) => {
|
|
20
|
+
const sc = await scopeOf(gh, repo, org);
|
|
21
|
+
const raw = await gh.list(`${sc.path}/rulesets`, limit ?? 30, {
|
|
22
|
+
query: org === undefined ? { includes_parents: parents ?? true } : {},
|
|
23
|
+
});
|
|
24
|
+
return { ...sc.out, items: raw.map(summary) };
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
view: op({
|
|
28
|
+
description:
|
|
29
|
+
"One ruleset: name, target, enforcement, conditions, bypass actors and rules with their parameters. Replaces `gh ruleset view`.",
|
|
30
|
+
input: s.object({ ...repoOrg, id: idField }),
|
|
31
|
+
annotations: reads,
|
|
32
|
+
run: async ({ repo, org, id }) => {
|
|
33
|
+
const sc = await scopeOf(gh, repo, org);
|
|
34
|
+
return {
|
|
35
|
+
...sc.out,
|
|
36
|
+
...detail(await gh.rest("GET", `${sc.path}/rulesets/${id}`)),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
check: op({
|
|
41
|
+
description:
|
|
42
|
+
"The rules that apply to a branch, each with the ruleset it comes from. Replaces `gh ruleset check`.",
|
|
43
|
+
input: s.object({
|
|
44
|
+
repo: repoField,
|
|
45
|
+
branch: s.optional(s.string()),
|
|
46
|
+
default: s.optional(
|
|
47
|
+
s.boolean({ description: "Check the default branch." }),
|
|
48
|
+
),
|
|
49
|
+
}),
|
|
50
|
+
annotations: reads,
|
|
51
|
+
run: async ({ repo, branch, default: useDefault }) => {
|
|
52
|
+
if ((branch === undefined) === (useDefault !== true))
|
|
53
|
+
throw new SurfaceError(
|
|
54
|
+
"usage",
|
|
55
|
+
"pass exactly one of branch or default: true",
|
|
56
|
+
"name the branch to check",
|
|
57
|
+
);
|
|
58
|
+
const r = await gh.repo(repo);
|
|
59
|
+
const name =
|
|
60
|
+
branch ??
|
|
61
|
+
str(await gh.rest("GET", `repos/${r.full}`), "default_branch");
|
|
62
|
+
const raw = await gh.list(
|
|
63
|
+
`repos/${r.full}/rules/branches/${enc(name)}`,
|
|
64
|
+
1000,
|
|
65
|
+
);
|
|
66
|
+
return {
|
|
67
|
+
repo: r.full,
|
|
68
|
+
branch: name,
|
|
69
|
+
items: raw.map((x) => ({
|
|
70
|
+
type: str(x, "type"),
|
|
71
|
+
parameters: at(x, "parameters") ?? null,
|
|
72
|
+
rulesetId: num(x, "ruleset_id"),
|
|
73
|
+
rulesetSource: optStr(x, "ruleset_source"),
|
|
74
|
+
rulesetSourceType: optStr(x, "ruleset_source_type"),
|
|
75
|
+
})),
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
...rulesetWriteOps(gh),
|
|
80
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Downloading a workflow run's artifacts and extracting each zip into a directory.
|
|
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 { bool, num, str } from "./read.ts";
|
|
6
|
+
import { safeJoin, unzip } from "./zip.ts";
|
|
7
|
+
|
|
8
|
+
export const runDownloadOp = (gh: GitHub) =>
|
|
9
|
+
op({
|
|
10
|
+
description:
|
|
11
|
+
"Download a run's unexpired artifacts (all, or those matching names or glob patterns) and extract them: into dir itself when exactly one name is given, else into dir/<artifact name>/. An existing file fails as `conflict` before anything is written. Replaces `gh run download`.",
|
|
12
|
+
input: s.object({
|
|
13
|
+
repo: repoField,
|
|
14
|
+
runId: s.integer({
|
|
15
|
+
description:
|
|
16
|
+
"Workflow run id (databaseId; the number in .../actions/runs/<id>).",
|
|
17
|
+
}),
|
|
18
|
+
names: s.optional(
|
|
19
|
+
s.array(s.string(), { description: "Artifact names to download." }),
|
|
20
|
+
),
|
|
21
|
+
patterns: s.optional(
|
|
22
|
+
s.array(s.string(), {
|
|
23
|
+
description: "Glob patterns over artifact names.",
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
dir: s.optional(
|
|
27
|
+
s.string({ description: "Target directory (default: cwd)." }),
|
|
28
|
+
),
|
|
29
|
+
}),
|
|
30
|
+
annotations: writes,
|
|
31
|
+
run: async ({ repo, runId, names, patterns, dir }) => {
|
|
32
|
+
const r = await gh.repo(repo);
|
|
33
|
+
const globs = (patterns ?? []).map((p) => new Bun.Glob(p));
|
|
34
|
+
const filtered = names !== undefined || patterns !== undefined;
|
|
35
|
+
const chosen = (
|
|
36
|
+
await gh.list(`repos/${r.full}/actions/runs/${runId}/artifacts`, 1000, {
|
|
37
|
+
key: "artifacts",
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
.filter((a) => !bool(a, "expired"))
|
|
41
|
+
.map((a) => ({ id: num(a, "id"), name: str(a, "name") }))
|
|
42
|
+
.filter(
|
|
43
|
+
(a) =>
|
|
44
|
+
!filtered ||
|
|
45
|
+
(names ?? []).includes(a.name) ||
|
|
46
|
+
globs.some((g) => g.match(a.name)),
|
|
47
|
+
);
|
|
48
|
+
if (chosen.length === 0)
|
|
49
|
+
throw new SurfaceError(
|
|
50
|
+
"not_found",
|
|
51
|
+
`run ${runId} has no unexpired artifacts${filtered ? " matching the filter" : ""}`,
|
|
52
|
+
"artifacts expire after the retention window; check names with `api rest`",
|
|
53
|
+
);
|
|
54
|
+
const flat = names?.length === 1 && patterns === undefined;
|
|
55
|
+
const root = dir ?? ".";
|
|
56
|
+
const planned = [];
|
|
57
|
+
for (const a of chosen) {
|
|
58
|
+
const base = flat ? root : safeJoin(root, a.name);
|
|
59
|
+
const zip = await gh.bytes(
|
|
60
|
+
`repos/${r.full}/actions/artifacts/${a.id}/zip`,
|
|
61
|
+
);
|
|
62
|
+
const entries = unzip(zip).map((e) => ({
|
|
63
|
+
target: safeJoin(base, e.path),
|
|
64
|
+
data: e.data,
|
|
65
|
+
}));
|
|
66
|
+
planned.push({ ...a, dir: base, entries });
|
|
67
|
+
}
|
|
68
|
+
for (const e of planned.flatMap((a) => a.entries))
|
|
69
|
+
if (await Bun.file(e.target).exists())
|
|
70
|
+
throw new SurfaceError(
|
|
71
|
+
"conflict",
|
|
72
|
+
`${e.target} already exists`,
|
|
73
|
+
"download into an empty dir or remove the file",
|
|
74
|
+
);
|
|
75
|
+
for (const e of planned.flatMap((a) => a.entries))
|
|
76
|
+
await Bun.write(e.target, e.data);
|
|
77
|
+
return {
|
|
78
|
+
repo: r.full,
|
|
79
|
+
runId,
|
|
80
|
+
artifacts: planned.map((a) => ({
|
|
81
|
+
id: a.id,
|
|
82
|
+
name: a.name,
|
|
83
|
+
dir: a.dir,
|
|
84
|
+
files: a.entries.map((e) => e.target),
|
|
85
|
+
})),
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
});
|