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,105 @@
|
|
|
1
|
+
// Listing and deleting GitHub Actions caches.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { irreversible, limitField, reads, repoField } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { arr, at, num, optStr, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const refField = s.optional(
|
|
8
|
+
s.string({
|
|
9
|
+
description: "refs/heads/<branch> or refs/pull/<number>/merge.",
|
|
10
|
+
}),
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const cache = (c: unknown) => ({
|
|
14
|
+
id: num(c, "id"),
|
|
15
|
+
key: str(c, "key"),
|
|
16
|
+
ref: str(c, "ref"),
|
|
17
|
+
sizeInBytes: num(c, "size_in_bytes"),
|
|
18
|
+
createdAt: optStr(c, "created_at"),
|
|
19
|
+
lastAccessedAt: optStr(c, "last_accessed_at"),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const listCaches = async (
|
|
23
|
+
gh: GitHub,
|
|
24
|
+
full: string,
|
|
25
|
+
limit: number,
|
|
26
|
+
query: Readonly<Record<string, string | undefined>>,
|
|
27
|
+
) =>
|
|
28
|
+
(
|
|
29
|
+
await gh.list(`repos/${full}/actions/caches`, limit, {
|
|
30
|
+
query,
|
|
31
|
+
key: "actions_caches",
|
|
32
|
+
})
|
|
33
|
+
).map(cache);
|
|
34
|
+
|
|
35
|
+
export const cacheOps = (gh: GitHub) => ({
|
|
36
|
+
list: op({
|
|
37
|
+
description:
|
|
38
|
+
"Actions caches with key, ref, size and access times, filterable by key prefix and ref. Replaces `gh cache list`.",
|
|
39
|
+
input: s.object({
|
|
40
|
+
repo: repoField,
|
|
41
|
+
key: s.optional(s.string({ description: "Cache key prefix." })),
|
|
42
|
+
ref: refField,
|
|
43
|
+
sort: s.optional(
|
|
44
|
+
s.enum(["created_at", "last_accessed_at", "size_in_bytes"]),
|
|
45
|
+
),
|
|
46
|
+
order: s.optional(s.enum(["asc", "desc"])),
|
|
47
|
+
limit: limitField(30),
|
|
48
|
+
}),
|
|
49
|
+
annotations: reads,
|
|
50
|
+
run: async ({ repo, key, ref, sort, order, limit }) => {
|
|
51
|
+
const r = await gh.repo(repo);
|
|
52
|
+
return {
|
|
53
|
+
repo: r.full,
|
|
54
|
+
items: await listCaches(gh, r.full, limit ?? 30, {
|
|
55
|
+
key,
|
|
56
|
+
ref,
|
|
57
|
+
sort,
|
|
58
|
+
direction: order,
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
delete: op({
|
|
64
|
+
description:
|
|
65
|
+
"Delete caches by id, by exact key (optionally only on one ref), or all of them (optionally only on one ref); returns how many were deleted. Replaces `gh cache delete`.",
|
|
66
|
+
input: s.object({
|
|
67
|
+
repo: repoField,
|
|
68
|
+
id: s.optional(s.integer({ description: "Cache id." })),
|
|
69
|
+
key: s.optional(s.string({ description: "Exact cache key." })),
|
|
70
|
+
all: s.optional(s.boolean()),
|
|
71
|
+
ref: refField,
|
|
72
|
+
}),
|
|
73
|
+
annotations: irreversible,
|
|
74
|
+
run: async ({ repo, id, key, all, ref }) => {
|
|
75
|
+
const modes = [id !== undefined, key !== undefined, all === true];
|
|
76
|
+
if (
|
|
77
|
+
modes.filter(Boolean).length !== 1 ||
|
|
78
|
+
(id !== undefined && ref !== undefined)
|
|
79
|
+
)
|
|
80
|
+
throw new SurfaceError(
|
|
81
|
+
"usage",
|
|
82
|
+
"pass exactly one of id, key or all (ref only with key or all)",
|
|
83
|
+
"find ids and keys with `cache list`",
|
|
84
|
+
);
|
|
85
|
+
const r = await gh.repo(repo);
|
|
86
|
+
let ids: number[];
|
|
87
|
+
if (id !== undefined) {
|
|
88
|
+
await gh.rest("DELETE", `repos/${r.full}/actions/caches/${id}`);
|
|
89
|
+
ids = [id];
|
|
90
|
+
} else if (key !== undefined) {
|
|
91
|
+
const x = await gh.rest("DELETE", `repos/${r.full}/actions/caches`, {
|
|
92
|
+
query: { key, ref },
|
|
93
|
+
});
|
|
94
|
+
ids = arr(at(x, "actions_caches"), "actions_caches").map((c) =>
|
|
95
|
+
num(c, "id"),
|
|
96
|
+
);
|
|
97
|
+
} else {
|
|
98
|
+
ids = (await listCaches(gh, r.full, 100_000, { ref })).map((c) => c.id);
|
|
99
|
+
for (const each of ids)
|
|
100
|
+
await gh.rest("DELETE", `repos/${r.full}/actions/caches/${each}`);
|
|
101
|
+
}
|
|
102
|
+
return { repo: r.full, deleted: ids.length, ids };
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// `pr checks`: one GraphQL rollup of check runs and commit statuses, bucketed the way `gh pr checks` buckets them.
|
|
2
|
+
import { SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import type { GitHub, Repo } from "./http.ts";
|
|
4
|
+
import { at, nodes, optNum, optStr, str } from "./read.ts";
|
|
5
|
+
|
|
6
|
+
export type Bucket = "pass" | "fail" | "pending" | "skipping" | "cancel";
|
|
7
|
+
export type Check = {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly bucket: Bucket;
|
|
10
|
+
readonly state: string;
|
|
11
|
+
readonly required: boolean;
|
|
12
|
+
readonly url: string | null;
|
|
13
|
+
readonly workflow: string | null;
|
|
14
|
+
readonly runId: number | null;
|
|
15
|
+
readonly startedAt: string | null;
|
|
16
|
+
readonly completedAt: string | null;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const QUERY = `query($owner:String!,$name:String!,$number:Int!,$after:String){repository(owner:$owner,name:$name){pullRequest(number:$number){
|
|
20
|
+
headRefOid commits(last:1){nodes{commit{statusCheckRollup{state contexts(first:100,after:$after){pageInfo{hasNextPage endCursor}
|
|
21
|
+
nodes{__typename
|
|
22
|
+
... on CheckRun{name status conclusion detailsUrl startedAt completedAt isRequired(pullRequestNumber:$number) checkSuite{workflowRun{databaseId workflow{name}}}}
|
|
23
|
+
... on StatusContext{context state targetUrl createdAt isRequired(pullRequestNumber:$number)}}}}}}}}}}`;
|
|
24
|
+
|
|
25
|
+
const runBucket = (status: string, conclusion: string): Bucket => {
|
|
26
|
+
if (status !== "COMPLETED") return "pending";
|
|
27
|
+
if (conclusion === "SUCCESS") return "pass";
|
|
28
|
+
if (conclusion === "CANCELLED") return "cancel";
|
|
29
|
+
if (conclusion === "SKIPPED" || conclusion === "NEUTRAL") return "skipping";
|
|
30
|
+
return "fail";
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const statusBucket = (state: string): Bucket =>
|
|
34
|
+
state === "SUCCESS"
|
|
35
|
+
? "pass"
|
|
36
|
+
: state === "PENDING" || state === "EXPECTED"
|
|
37
|
+
? "pending"
|
|
38
|
+
: "fail";
|
|
39
|
+
|
|
40
|
+
const toCheck = (n: unknown): Check => {
|
|
41
|
+
if (at(n, "__typename") === "CheckRun") {
|
|
42
|
+
const status = str(n, "status");
|
|
43
|
+
const conclusion = optStr(n, "conclusion") ?? "";
|
|
44
|
+
return {
|
|
45
|
+
name: str(n, "name"),
|
|
46
|
+
bucket: runBucket(status, conclusion),
|
|
47
|
+
state: conclusion || status,
|
|
48
|
+
required: at(n, "isRequired") === true,
|
|
49
|
+
url: optStr(n, "detailsUrl"),
|
|
50
|
+
workflow: optStr(n, "checkSuite", "workflowRun", "workflow", "name"),
|
|
51
|
+
runId: optNum(n, "checkSuite", "workflowRun", "databaseId"),
|
|
52
|
+
startedAt: optStr(n, "startedAt"),
|
|
53
|
+
completedAt: optStr(n, "completedAt"),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const state = str(n, "state");
|
|
57
|
+
return {
|
|
58
|
+
name: str(n, "context"),
|
|
59
|
+
bucket: statusBucket(state),
|
|
60
|
+
state,
|
|
61
|
+
required: at(n, "isRequired") === true,
|
|
62
|
+
url: optStr(n, "targetUrl"),
|
|
63
|
+
workflow: null,
|
|
64
|
+
runId: null,
|
|
65
|
+
startedAt: optStr(n, "createdAt"),
|
|
66
|
+
completedAt: null,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const fetchChecks = async (gh: GitHub, repo: Repo, number: number) => {
|
|
71
|
+
const checks: Check[] = [];
|
|
72
|
+
let after: string | null = null;
|
|
73
|
+
let headSha = "";
|
|
74
|
+
let rollup: string | null = null;
|
|
75
|
+
do {
|
|
76
|
+
const data = await gh.graphql(QUERY, {
|
|
77
|
+
owner: repo.owner,
|
|
78
|
+
name: repo.name,
|
|
79
|
+
number,
|
|
80
|
+
after,
|
|
81
|
+
});
|
|
82
|
+
const pr = at(data, "repository", "pullRequest");
|
|
83
|
+
if (pr === null || pr === undefined)
|
|
84
|
+
throw new SurfaceError(
|
|
85
|
+
"not_found",
|
|
86
|
+
`no pull request #${number} in ${repo.full}`,
|
|
87
|
+
"check the number",
|
|
88
|
+
);
|
|
89
|
+
headSha = str(pr, "headRefOid");
|
|
90
|
+
const commit = at(nodes(pr, "commits")[0], "commit", "statusCheckRollup");
|
|
91
|
+
rollup = optStr(commit, "state");
|
|
92
|
+
checks.push(...nodes(commit, "contexts").map(toCheck));
|
|
93
|
+
after =
|
|
94
|
+
at(commit, "contexts", "pageInfo", "hasNextPage") === true
|
|
95
|
+
? optStr(commit, "contexts", "pageInfo", "endCursor")
|
|
96
|
+
: null;
|
|
97
|
+
} while (after !== null);
|
|
98
|
+
const counts: Record<Bucket, number> = {
|
|
99
|
+
pass: 0,
|
|
100
|
+
fail: 0,
|
|
101
|
+
pending: 0,
|
|
102
|
+
skipping: 0,
|
|
103
|
+
cancel: 0,
|
|
104
|
+
};
|
|
105
|
+
for (const c of checks) counts[c.bucket] += 1;
|
|
106
|
+
return { headSha, rollup, counts, checks };
|
|
107
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// Codespaces over REST: the user's own (user/codespaces), per repository, and org-admin views of members' codespaces.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import {
|
|
4
|
+
enc,
|
|
5
|
+
irreversible,
|
|
6
|
+
limitField,
|
|
7
|
+
reads,
|
|
8
|
+
repoField,
|
|
9
|
+
writes,
|
|
10
|
+
} from "./fields.ts";
|
|
11
|
+
import type { GitHub } from "./http.ts";
|
|
12
|
+
import { bool, optNum, optStr, str } from "./read.ts";
|
|
13
|
+
|
|
14
|
+
const nameField = s.string({
|
|
15
|
+
description: "Codespace name (not its display name).",
|
|
16
|
+
});
|
|
17
|
+
const orgField = s.optional(
|
|
18
|
+
s.string({ description: "Organization login; org admins only, with user." }),
|
|
19
|
+
);
|
|
20
|
+
const userField = s.optional(
|
|
21
|
+
s.string({ description: "Member whose codespace it is; used with org." }),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const codespaceSummary = (c: unknown) => ({
|
|
25
|
+
name: str(c, "name"),
|
|
26
|
+
displayName: optStr(c, "display_name"),
|
|
27
|
+
state: str(c, "state"),
|
|
28
|
+
owner: optStr(c, "owner", "login"),
|
|
29
|
+
repo: str(c, "repository", "full_name"),
|
|
30
|
+
branch: optStr(c, "git_status", "ref"),
|
|
31
|
+
ahead: optNum(c, "git_status", "ahead"),
|
|
32
|
+
behind: optNum(c, "git_status", "behind"),
|
|
33
|
+
unpushedChanges: bool(c, "git_status", "has_unpushed_changes"),
|
|
34
|
+
uncommittedChanges: bool(c, "git_status", "has_uncommitted_changes"),
|
|
35
|
+
machine: optStr(c, "machine", "name"),
|
|
36
|
+
location: str(c, "location"),
|
|
37
|
+
devcontainerPath: optStr(c, "devcontainer_path"),
|
|
38
|
+
idleTimeoutMinutes: optNum(c, "idle_timeout_minutes"),
|
|
39
|
+
retentionExpiresAt: optStr(c, "retention_expires_at"),
|
|
40
|
+
createdAt: str(c, "created_at"),
|
|
41
|
+
lastUsedAt: str(c, "last_used_at"),
|
|
42
|
+
webUrl: str(c, "web_url"),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Without the `codespace` scope GitHub answers 403 or 404, which reads like a missing codespace.
|
|
46
|
+
const scoped = <T>(call: Promise<T>): Promise<T> =>
|
|
47
|
+
call.catch((error: unknown) => {
|
|
48
|
+
if (
|
|
49
|
+
error instanceof SurfaceError &&
|
|
50
|
+
(error.kind === "forbidden" || error.kind === "not_found")
|
|
51
|
+
)
|
|
52
|
+
throw new SurfaceError(
|
|
53
|
+
error.kind,
|
|
54
|
+
error.message,
|
|
55
|
+
"the token needs the `codespace` scope (`gh auth refresh -s codespace`); otherwise check the codespace name",
|
|
56
|
+
);
|
|
57
|
+
throw error;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const memberPath = (
|
|
61
|
+
name: string,
|
|
62
|
+
org: string | undefined,
|
|
63
|
+
user: string | undefined,
|
|
64
|
+
): string => {
|
|
65
|
+
if (org === undefined && user === undefined)
|
|
66
|
+
return `user/codespaces/${enc(name)}`;
|
|
67
|
+
if (org === undefined || user === undefined)
|
|
68
|
+
throw new SurfaceError(
|
|
69
|
+
"usage",
|
|
70
|
+
"org and user go together",
|
|
71
|
+
"pass both to act on a member's codespace as an org admin, or neither for your own",
|
|
72
|
+
);
|
|
73
|
+
return `orgs/${enc(org)}/members/${enc(user)}/codespaces/${enc(name)}`;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const codespaceOps = (gh: GitHub) => ({
|
|
77
|
+
list: op({
|
|
78
|
+
description:
|
|
79
|
+
"Your codespaces, optionally only one repository's; org admins can list an organization's or one member's. Replaces `gh codespace list`.",
|
|
80
|
+
input: s.object({
|
|
81
|
+
repo: s.optional(
|
|
82
|
+
s.string({ description: "Only codespaces of owner/name." }),
|
|
83
|
+
),
|
|
84
|
+
org: orgField,
|
|
85
|
+
user: userField,
|
|
86
|
+
limit: limitField(30),
|
|
87
|
+
}),
|
|
88
|
+
annotations: reads,
|
|
89
|
+
run: async ({ repo, org, user, limit }) => {
|
|
90
|
+
if (user !== undefined && org === undefined)
|
|
91
|
+
throw new SurfaceError(
|
|
92
|
+
"usage",
|
|
93
|
+
"user needs org",
|
|
94
|
+
"pass the organization login too",
|
|
95
|
+
);
|
|
96
|
+
const r = repo === undefined ? undefined : await gh.repo(repo);
|
|
97
|
+
const path =
|
|
98
|
+
org !== undefined
|
|
99
|
+
? user === undefined
|
|
100
|
+
? `orgs/${enc(org)}/codespaces`
|
|
101
|
+
: `orgs/${enc(org)}/members/${enc(user)}/codespaces`
|
|
102
|
+
: r === undefined
|
|
103
|
+
? "user/codespaces"
|
|
104
|
+
: `repos/${r.full}/codespaces`;
|
|
105
|
+
const all = (
|
|
106
|
+
await scoped(gh.list(path, limit ?? 30, { key: "codespaces" }))
|
|
107
|
+
).map(codespaceSummary);
|
|
108
|
+
return {
|
|
109
|
+
...(r === undefined ? {} : { repo: r.full }),
|
|
110
|
+
...(org === undefined ? {} : { org }),
|
|
111
|
+
...(user === undefined ? {} : { user }),
|
|
112
|
+
items:
|
|
113
|
+
org !== undefined && r !== undefined
|
|
114
|
+
? all.filter((c) => c.repo === r.full)
|
|
115
|
+
: all,
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
}),
|
|
119
|
+
view: op({
|
|
120
|
+
description:
|
|
121
|
+
"One of your codespaces by name: state, branch with ahead/behind and unpushed changes, machine, timeouts. Replaces `gh codespace view`.",
|
|
122
|
+
input: s.object({ name: nameField }),
|
|
123
|
+
annotations: reads,
|
|
124
|
+
run: async ({ name }) =>
|
|
125
|
+
codespaceSummary(
|
|
126
|
+
await scoped(gh.rest("GET", `user/codespaces/${enc(name)}`)),
|
|
127
|
+
),
|
|
128
|
+
}),
|
|
129
|
+
create: op({
|
|
130
|
+
description:
|
|
131
|
+
"Create a codespace for a repository branch; it may still be provisioning (state Queued or Provisioning) when this returns. Replaces `gh codespace create`.",
|
|
132
|
+
input: s.object({
|
|
133
|
+
repo: repoField,
|
|
134
|
+
branch: s.optional(
|
|
135
|
+
s.string({ description: "Default branch when omitted." }),
|
|
136
|
+
),
|
|
137
|
+
machine: s.optional(
|
|
138
|
+
s.string({ description: "Machine type name, e.g. standardLinux32gb." }),
|
|
139
|
+
),
|
|
140
|
+
location: s.optional(
|
|
141
|
+
s.string({
|
|
142
|
+
description: "EastUs, SouthEastAsia, WestEurope or WestUs2.",
|
|
143
|
+
}),
|
|
144
|
+
),
|
|
145
|
+
devcontainerPath: s.optional(s.string()),
|
|
146
|
+
idleTimeoutMinutes: s.optional(s.integer()),
|
|
147
|
+
retentionPeriodMinutes: s.optional(
|
|
148
|
+
s.integer({
|
|
149
|
+
description: "Minutes after stopping before auto-delete (max 43200).",
|
|
150
|
+
}),
|
|
151
|
+
),
|
|
152
|
+
displayName: s.optional(
|
|
153
|
+
s.string({ description: "48 characters or less." }),
|
|
154
|
+
),
|
|
155
|
+
defaultPermissions: s.optional(
|
|
156
|
+
s.boolean({
|
|
157
|
+
description:
|
|
158
|
+
"Skip extra repository permissions the devcontainer requests.",
|
|
159
|
+
}),
|
|
160
|
+
),
|
|
161
|
+
}),
|
|
162
|
+
annotations: writes,
|
|
163
|
+
run: async (input) => {
|
|
164
|
+
const r = await gh.repo(input.repo);
|
|
165
|
+
const body = Object.fromEntries(
|
|
166
|
+
Object.entries({
|
|
167
|
+
ref: input.branch,
|
|
168
|
+
machine: input.machine,
|
|
169
|
+
location: input.location,
|
|
170
|
+
devcontainer_path: input.devcontainerPath,
|
|
171
|
+
idle_timeout_minutes: input.idleTimeoutMinutes,
|
|
172
|
+
retention_period_minutes: input.retentionPeriodMinutes,
|
|
173
|
+
display_name: input.displayName,
|
|
174
|
+
multi_repo_permissions_opt_out: input.defaultPermissions,
|
|
175
|
+
}).filter(([, v]) => v !== undefined),
|
|
176
|
+
);
|
|
177
|
+
return codespaceSummary(
|
|
178
|
+
await scoped(gh.rest("POST", `repos/${r.full}/codespaces`, { body })),
|
|
179
|
+
);
|
|
180
|
+
},
|
|
181
|
+
}),
|
|
182
|
+
delete: op({
|
|
183
|
+
description:
|
|
184
|
+
"Delete a codespace (yours, or a member's as org admin). Irreversible: uncommitted and unpushed changes in it are lost, so check unpushedChanges with view first. Replaces `gh codespace delete`.",
|
|
185
|
+
input: s.object({ name: nameField, org: orgField, user: userField }),
|
|
186
|
+
annotations: irreversible,
|
|
187
|
+
run: async ({ name, org, user }) => {
|
|
188
|
+
await scoped(gh.rest("DELETE", memberPath(name, org, user)));
|
|
189
|
+
return { name, deleted: true };
|
|
190
|
+
},
|
|
191
|
+
}),
|
|
192
|
+
edit: op({
|
|
193
|
+
description:
|
|
194
|
+
"Rename a codespace or change its machine type (a machine change applies at the next start). Replaces `gh codespace edit`.",
|
|
195
|
+
input: s.object({
|
|
196
|
+
name: nameField,
|
|
197
|
+
displayName: s.optional(s.string()),
|
|
198
|
+
machine: s.optional(s.string()),
|
|
199
|
+
}),
|
|
200
|
+
annotations: writes,
|
|
201
|
+
run: async ({ name, displayName, machine }) => {
|
|
202
|
+
if (displayName === undefined && machine === undefined)
|
|
203
|
+
throw new SurfaceError(
|
|
204
|
+
"usage",
|
|
205
|
+
"nothing to change",
|
|
206
|
+
"pass displayName or machine",
|
|
207
|
+
);
|
|
208
|
+
const body = Object.fromEntries(
|
|
209
|
+
Object.entries({ display_name: displayName, machine }).filter(
|
|
210
|
+
([, v]) => v !== undefined,
|
|
211
|
+
),
|
|
212
|
+
);
|
|
213
|
+
return codespaceSummary(
|
|
214
|
+
await scoped(
|
|
215
|
+
gh.rest("PATCH", `user/codespaces/${enc(name)}`, { body }),
|
|
216
|
+
),
|
|
217
|
+
);
|
|
218
|
+
},
|
|
219
|
+
}),
|
|
220
|
+
stop: op({
|
|
221
|
+
description:
|
|
222
|
+
"Stop a running codespace (yours, or a member's as org admin); its files are kept. Replaces `gh codespace stop`.",
|
|
223
|
+
input: s.object({ name: nameField, org: orgField, user: userField }),
|
|
224
|
+
annotations: writes,
|
|
225
|
+
run: async ({ name, org, user }) =>
|
|
226
|
+
codespaceSummary(
|
|
227
|
+
await scoped(gh.rest("POST", `${memberPath(name, org, user)}/stop`)),
|
|
228
|
+
),
|
|
229
|
+
}),
|
|
230
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Locking a conversation: issues and pull requests share the issues lock endpoint.
|
|
2
|
+
import { op, s } from "../vendor/surface/index.ts";
|
|
3
|
+
import { numberField, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
|
|
6
|
+
// The REST endpoint spells reasons with a hyphen and a space, unlike gh's flag values.
|
|
7
|
+
const restReason = {
|
|
8
|
+
off_topic: "off-topic",
|
|
9
|
+
too_heated: "too heated",
|
|
10
|
+
resolved: "resolved",
|
|
11
|
+
spam: "spam",
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
export const lockOps = (gh: GitHub, noun: "pr" | "issue") => {
|
|
15
|
+
const what = noun === "pr" ? "a pull request" : "an issue";
|
|
16
|
+
return {
|
|
17
|
+
lock: op({
|
|
18
|
+
description: `Lock the conversation of ${what} so only collaborators can comment, with an optional reason. Replaces \`gh ${noun} lock\`.`,
|
|
19
|
+
input: s.object({
|
|
20
|
+
repo: repoField,
|
|
21
|
+
number: numberField,
|
|
22
|
+
reason: s.optional(
|
|
23
|
+
s.enum(["off_topic", "too_heated", "resolved", "spam"]),
|
|
24
|
+
),
|
|
25
|
+
}),
|
|
26
|
+
annotations: { ...writes, idempotent: true },
|
|
27
|
+
run: async ({ repo, number, reason }) => {
|
|
28
|
+
const r = await gh.repo(repo);
|
|
29
|
+
await gh.rest(
|
|
30
|
+
"PUT",
|
|
31
|
+
`repos/${r.full}/issues/${number}/lock`,
|
|
32
|
+
reason === undefined
|
|
33
|
+
? {}
|
|
34
|
+
: { body: { lock_reason: restReason[reason] } },
|
|
35
|
+
);
|
|
36
|
+
return { repo: r.full, number, locked: true, reason: reason ?? null };
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
unlock: op({
|
|
40
|
+
description: `Unlock the conversation of ${what}. Replaces \`gh ${noun} unlock\`.`,
|
|
41
|
+
input: s.object({ repo: repoField, number: numberField }),
|
|
42
|
+
annotations: { ...writes, idempotent: true },
|
|
43
|
+
run: async ({ repo, number }) => {
|
|
44
|
+
const r = await gh.repo(repo);
|
|
45
|
+
await gh.rest("DELETE", `repos/${r.full}/issues/${number}/lock`);
|
|
46
|
+
return { repo: r.full, number, locked: false };
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Listing discussions: the repository connection, or GitHub search when author, label or text filters are given.
|
|
2
|
+
import { op, s } from "../vendor/surface/index.ts";
|
|
3
|
+
import {
|
|
4
|
+
categoryField,
|
|
5
|
+
DISCUSSION,
|
|
6
|
+
discussionSummary,
|
|
7
|
+
lookup,
|
|
8
|
+
} from "./discussion-lookup.ts";
|
|
9
|
+
import { limitField, reads, repoField } from "./fields.ts";
|
|
10
|
+
import type { GitHub } from "./http.ts";
|
|
11
|
+
import { at, bool, nodes, optStr } from "./read.ts";
|
|
12
|
+
|
|
13
|
+
const LIST = `query($owner:String!,$name:String!,$first:Int!,$after:String,$states:[DiscussionState!],$categoryId:ID,$answered:Boolean,$orderBy:DiscussionOrder){
|
|
14
|
+
repository(owner:$owner,name:$name){discussions(first:$first,after:$after,states:$states,categoryId:$categoryId,answered:$answered,orderBy:$orderBy){
|
|
15
|
+
pageInfo{endCursor hasNextPage} nodes{${DISCUSSION}}}}}`;
|
|
16
|
+
const SEARCH = `query($q:String!,$first:Int!,$after:String){search(type:DISCUSSION,query:$q,first:$first,after:$after){
|
|
17
|
+
pageInfo{endCursor hasNextPage} nodes{... on Discussion{${DISCUSSION}}}}}`;
|
|
18
|
+
|
|
19
|
+
type Page = {
|
|
20
|
+
readonly items: readonly unknown[];
|
|
21
|
+
readonly next: string | null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const pages = async (
|
|
25
|
+
limit: number,
|
|
26
|
+
after: string | undefined,
|
|
27
|
+
fetch: (first: number, after: string | null) => Promise<unknown>,
|
|
28
|
+
) => {
|
|
29
|
+
const items: unknown[] = [];
|
|
30
|
+
let cursor = after ?? null;
|
|
31
|
+
let next: string | null = cursor;
|
|
32
|
+
do {
|
|
33
|
+
const conn = await fetch(Math.min(100, limit - items.length), cursor);
|
|
34
|
+
const page: Page = {
|
|
35
|
+
items: nodes(conn),
|
|
36
|
+
next: bool(conn, "pageInfo", "hasNextPage")
|
|
37
|
+
? optStr(conn, "pageInfo", "endCursor")
|
|
38
|
+
: null,
|
|
39
|
+
};
|
|
40
|
+
items.push(...page.items);
|
|
41
|
+
next = page.next;
|
|
42
|
+
cursor = next;
|
|
43
|
+
} while (next !== null && items.length < limit);
|
|
44
|
+
return { items, endCursor: next };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const quote = (v: string) => `"${v.replaceAll('"', "")}"`;
|
|
48
|
+
|
|
49
|
+
export const discussionListOp = (gh: GitHub) =>
|
|
50
|
+
op({
|
|
51
|
+
description:
|
|
52
|
+
"Discussions in a repository, newest activity first, with the cursor for the next page in endCursor. Author, label and search filters go through GitHub search. Replaces `gh discussion list`.",
|
|
53
|
+
input: s.object({
|
|
54
|
+
repo: repoField,
|
|
55
|
+
state: s.optional(s.enum(["open", "closed", "all"])),
|
|
56
|
+
category: s.optional(categoryField),
|
|
57
|
+
author: s.optional(s.string()),
|
|
58
|
+
labels: s.optional(s.array(s.string())),
|
|
59
|
+
answered: s.optional(s.boolean()),
|
|
60
|
+
search: s.optional(s.string({ description: "Search query text." })),
|
|
61
|
+
sort: s.optional(s.enum(["created", "updated"])),
|
|
62
|
+
order: s.optional(s.enum(["asc", "desc"])),
|
|
63
|
+
limit: limitField(30),
|
|
64
|
+
after: s.optional(
|
|
65
|
+
s.string({ description: "endCursor of a previous page." }),
|
|
66
|
+
),
|
|
67
|
+
}),
|
|
68
|
+
annotations: reads,
|
|
69
|
+
run: async (input) => {
|
|
70
|
+
const r = await gh.repo(input.repo);
|
|
71
|
+
const state = input.state ?? "open";
|
|
72
|
+
const sort = input.sort ?? "updated";
|
|
73
|
+
const order = input.order ?? "desc";
|
|
74
|
+
const category =
|
|
75
|
+
input.category === undefined
|
|
76
|
+
? undefined
|
|
77
|
+
: (await lookup(gh, r, { category: input.category })).category;
|
|
78
|
+
const viaSearch =
|
|
79
|
+
input.author !== undefined ||
|
|
80
|
+
(input.labels?.length ?? 0) > 0 ||
|
|
81
|
+
input.search !== undefined;
|
|
82
|
+
const { items, endCursor } = await pages(
|
|
83
|
+
input.limit ?? 30,
|
|
84
|
+
input.after,
|
|
85
|
+
async (first, after) => {
|
|
86
|
+
if (!viaSearch)
|
|
87
|
+
return at(
|
|
88
|
+
await gh.graphql(LIST, {
|
|
89
|
+
owner: r.owner,
|
|
90
|
+
name: r.name,
|
|
91
|
+
first,
|
|
92
|
+
after,
|
|
93
|
+
states: state === "all" ? null : [state.toUpperCase()],
|
|
94
|
+
categoryId: category?.id ?? null,
|
|
95
|
+
answered: input.answered ?? null,
|
|
96
|
+
orderBy: {
|
|
97
|
+
field: sort === "created" ? "CREATED_AT" : "UPDATED_AT",
|
|
98
|
+
direction: order.toUpperCase(),
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
"repository",
|
|
102
|
+
"discussions",
|
|
103
|
+
);
|
|
104
|
+
const q = [
|
|
105
|
+
`repo:${r.full}`,
|
|
106
|
+
state === "all" ? "" : `is:${state}`,
|
|
107
|
+
input.author === undefined ? "" : `author:${input.author}`,
|
|
108
|
+
...(input.labels ?? []).map((l) => `label:${quote(l)}`),
|
|
109
|
+
category === undefined ? "" : `category:${quote(category.name)}`,
|
|
110
|
+
input.answered === undefined
|
|
111
|
+
? ""
|
|
112
|
+
: input.answered
|
|
113
|
+
? "is:answered"
|
|
114
|
+
: "is:unanswered",
|
|
115
|
+
`sort:${sort}-${order}`,
|
|
116
|
+
input.search ?? "",
|
|
117
|
+
].filter(Boolean);
|
|
118
|
+
return at(
|
|
119
|
+
await gh.graphql(SEARCH, { q: q.join(" "), first, after }),
|
|
120
|
+
"search",
|
|
121
|
+
);
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
return { repo: r.full, items: items.map(discussionSummary), endCursor };
|
|
125
|
+
},
|
|
126
|
+
});
|