oh-my-opencode 5.1.84 → 5.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/command/remove-deadcode.md +1 -1
- package/.agents/skills/remove-deadcode/SKILL.md +1 -1
- package/.agents/skills/work-with-pr/SKILL.md +2 -2
- package/.opencode/command/remove-deadcode.md +1 -1
- package/.opencode/skills/work-with-pr/SKILL.md +2 -2
- package/THIRD-PARTY-NOTICES.md +9 -3
- package/dist/cli/index.js +1022 -842
- package/dist/cli/service-auth/devices.d.ts +5 -2
- package/dist/cli-node/index.js +1022 -842
- package/dist/config/schema/agent-names.d.ts +1 -0
- package/dist/index.js +180 -205
- package/dist/skills/browser/SKILL.md +4 -1
- package/dist/skills/browser/references/commands.md +5 -2
- package/dist/skills/browser/references/desktop.md +1 -0
- package/dist/skills/browser/references/owned-engine/README.md +2 -0
- package/dist/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/dist/skills/browser/references/owned-engine/network.md +10 -5
- package/dist/skills/browser/references/recipes/1password.md +2 -0
- package/dist/skills/browser/runtime/omowright/index.js +11 -11
- package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
- package/dist/skills/debugging/SKILL.md +1 -1
- package/dist/skills/git/SKILL.md +62 -0
- package/dist/skills/git/agents/openai.yaml +13 -0
- package/dist/skills/github/SKILL.md +94 -0
- package/dist/skills/github/references/branch-rules.md +129 -0
- package/dist/skills/github/references/evidence-attachments.md +16 -0
- package/dist/skills/github/references/repo-setup.md +152 -0
- package/dist/skills/github/references/waiting.md +52 -0
- package/dist/skills/github/references/workflows.md +161 -0
- package/dist/skills/github/scripts/cli.ts +8 -0
- package/dist/skills/github/scripts/package.json +12 -0
- package/dist/skills/github/scripts/sdk.ts +11 -0
- package/dist/skills/github/scripts/src/account.ts +243 -0
- package/dist/skills/github/scripts/src/actions-write.ts +86 -0
- package/dist/skills/github/scripts/src/actions.ts +210 -0
- package/dist/skills/github/scripts/src/attestations.ts +136 -0
- package/dist/skills/github/scripts/src/blake2b.ts +102 -0
- package/dist/skills/github/scripts/src/branch-protection.ts +192 -0
- package/dist/skills/github/scripts/src/caches.ts +105 -0
- package/dist/skills/github/scripts/src/checks.ts +107 -0
- package/dist/skills/github/scripts/src/codespaces.ts +230 -0
- package/dist/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/dist/skills/github/scripts/src/discussion-list.ts +126 -0
- package/dist/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/dist/skills/github/scripts/src/discussions.ts +234 -0
- package/dist/skills/github/scripts/src/env.ts +100 -0
- package/dist/skills/github/scripts/src/errors.ts +79 -0
- package/dist/skills/github/scripts/src/fields.ts +27 -0
- package/dist/skills/github/scripts/src/gist-shape.ts +58 -0
- package/dist/skills/github/scripts/src/gists-write.ts +130 -0
- package/dist/skills/github/scripts/src/gists.ts +118 -0
- package/dist/skills/github/scripts/src/git-auth.ts +46 -0
- package/dist/skills/github/scripts/src/http.ts +159 -0
- package/dist/skills/github/scripts/src/issue-develop.ts +118 -0
- package/dist/skills/github/scripts/src/issues-extra.ts +135 -0
- package/dist/skills/github/scripts/src/issues-write.ts +174 -0
- package/dist/skills/github/scripts/src/issues.ts +156 -0
- package/dist/skills/github/scripts/src/keys.ts +176 -0
- package/dist/skills/github/scripts/src/labels.ts +209 -0
- package/dist/skills/github/scripts/src/merge.ts +115 -0
- package/dist/skills/github/scripts/src/poly1305.ts +22 -0
- package/dist/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/dist/skills/github/scripts/src/pr-view.ts +106 -0
- package/dist/skills/github/scripts/src/project-fields.ts +144 -0
- package/dist/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/dist/skills/github/scripts/src/project-items.ts +191 -0
- package/dist/skills/github/scripts/src/project-links.ts +104 -0
- package/dist/skills/github/scripts/src/project-ref.ts +145 -0
- package/dist/skills/github/scripts/src/project-state.ts +99 -0
- package/dist/skills/github/scripts/src/projects.ts +158 -0
- package/dist/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/dist/skills/github/scripts/src/pulls-read.ts +176 -0
- package/dist/skills/github/scripts/src/pulls-review.ts +206 -0
- package/dist/skills/github/scripts/src/pulls-write.ts +187 -0
- package/dist/skills/github/scripts/src/raw.ts +78 -0
- package/dist/skills/github/scripts/src/read.ts +77 -0
- package/dist/skills/github/scripts/src/release-assets.ts +111 -0
- package/dist/skills/github/scripts/src/release-download.ts +151 -0
- package/dist/skills/github/scripts/src/release-write.ts +197 -0
- package/dist/skills/github/scripts/src/repo-admin.ts +112 -0
- package/dist/skills/github/scripts/src/repo-content.ts +187 -0
- package/dist/skills/github/scripts/src/repo-create.ts +139 -0
- package/dist/skills/github/scripts/src/repo-extras.ts +217 -0
- package/dist/skills/github/scripts/src/repo-list.ts +143 -0
- package/dist/skills/github/scripts/src/repo-settings.ts +176 -0
- package/dist/skills/github/scripts/src/repo-sync.ts +81 -0
- package/dist/skills/github/scripts/src/repo-url.ts +104 -0
- package/dist/skills/github/scripts/src/repos.ts +87 -0
- package/dist/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/dist/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/dist/skills/github/scripts/src/rulesets.ts +80 -0
- package/dist/skills/github/scripts/src/run-download.ts +88 -0
- package/dist/skills/github/scripts/src/salsa20.ts +97 -0
- package/dist/skills/github/scripts/src/scopes.ts +165 -0
- package/dist/skills/github/scripts/src/sealed-box.ts +75 -0
- package/dist/skills/github/scripts/src/search-commits.ts +114 -0
- package/dist/skills/github/scripts/src/search.ts +116 -0
- package/dist/skills/github/scripts/src/secrets.ts +131 -0
- package/dist/skills/github/scripts/src/snappy.ts +57 -0
- package/dist/skills/github/scripts/src/status-search.ts +55 -0
- package/dist/skills/github/scripts/src/transfer.ts +97 -0
- package/dist/skills/github/scripts/src/types.ts +75 -0
- package/dist/skills/github/scripts/src/variables.ts +86 -0
- package/dist/skills/github/scripts/src/wait.ts +164 -0
- package/dist/skills/github/scripts/src/wire.ts +159 -0
- package/dist/skills/github/scripts/src/workflows.ts +144 -0
- package/dist/skills/github/scripts/src/zip.ts +104 -0
- package/dist/skills/github/scripts/surface.ts +106 -0
- package/dist/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/dist/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/dist/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/dist/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/dist/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/dist/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/dist/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/dist/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/dist/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/dist/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/dist/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/dist/skills/programming/SKILL.md +1 -1
- package/dist/skills/ulw-execute/SKILL.md +1 -1
- package/dist/tui.js +30 -27
- package/package.json +28 -26
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +3 -3
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/SKILL.md +4 -1
- package/packages/omo-codex/plugin/skills/browser/references/commands.md +5 -2
- package/packages/omo-codex/plugin/skills/browser/references/desktop.md +1 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/network.md +10 -5
- package/packages/omo-codex/plugin/skills/browser/references/recipes/1password.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +11 -11
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/omo-codex/plugin/skills/debugging/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/git/SKILL.md +62 -0
- package/packages/omo-codex/plugin/skills/git/agents/openai.yaml +13 -0
- package/packages/omo-codex/plugin/skills/github/SKILL.md +94 -0
- package/packages/omo-codex/plugin/skills/github/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/github/references/branch-rules.md +129 -0
- package/packages/omo-codex/plugin/skills/github/references/evidence-attachments.md +16 -0
- package/packages/omo-codex/plugin/skills/github/references/repo-setup.md +152 -0
- package/packages/omo-codex/plugin/skills/github/references/waiting.md +52 -0
- package/packages/omo-codex/plugin/skills/github/references/workflows.md +161 -0
- package/packages/omo-codex/plugin/skills/github/scripts/cli.ts +8 -0
- package/packages/omo-codex/plugin/skills/github/scripts/package.json +12 -0
- package/packages/omo-codex/plugin/skills/github/scripts/sdk.ts +11 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/account.ts +243 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/actions-write.ts +86 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/actions.ts +210 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/attestations.ts +136 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/blake2b.ts +102 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/branch-protection.ts +192 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/caches.ts +105 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/checks.ts +107 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/codespaces.ts +230 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-list.ts +126 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussions.ts +234 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/env.ts +100 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/errors.ts +79 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/fields.ts +27 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gist-shape.ts +58 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gists-write.ts +130 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gists.ts +118 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/git-auth.ts +46 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/http.ts +159 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issue-develop.ts +118 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues-extra.ts +135 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues-write.ts +174 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues.ts +156 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/keys.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/labels.ts +209 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/merge.ts +115 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/poly1305.ts +22 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pr-view.ts +106 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-fields.ts +144 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-items.ts +191 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-links.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-ref.ts +145 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-state.ts +99 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/projects.ts +158 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-read.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-review.ts +206 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-write.ts +187 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/raw.ts +78 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/read.ts +77 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-assets.ts +111 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-download.ts +151 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-write.ts +197 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-admin.ts +112 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-content.ts +187 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-create.ts +139 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-extras.ts +217 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-list.ts +143 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-settings.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-sync.ts +81 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-url.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repos.ts +87 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets.ts +80 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/run-download.ts +88 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/salsa20.ts +97 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/scopes.ts +165 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/sealed-box.ts +75 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/search-commits.ts +114 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/search.ts +116 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/secrets.ts +131 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/snappy.ts +57 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/status-search.ts +55 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/transfer.ts +97 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/types.ts +75 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/variables.ts +86 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/wait.ts +164 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/wire.ts +159 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/workflows.ts +144 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/zip.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/surface.ts +106 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +3 -3
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -1
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +5 -5
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +20 -15
- package/packages/shared-skills/skills/browser/SKILL.md +4 -1
- package/packages/shared-skills/skills/browser/references/commands.md +5 -2
- package/packages/shared-skills/skills/browser/references/desktop.md +1 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/README.md +2 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/network.md +10 -5
- package/packages/shared-skills/skills/browser/references/recipes/1password.md +2 -0
- package/packages/shared-skills/skills/browser/runtime/omowright/index.js +11 -11
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/shared-skills/skills/debugging/SKILL.md +1 -1
- package/packages/shared-skills/skills/git/SKILL.md +62 -0
- package/packages/shared-skills/skills/git/agents/openai.yaml +13 -0
- package/packages/shared-skills/skills/github/SKILL.md +94 -0
- package/packages/shared-skills/skills/github/references/branch-rules.md +129 -0
- package/packages/shared-skills/skills/github/references/evidence-attachments.md +16 -0
- package/packages/shared-skills/skills/github/references/repo-setup.md +152 -0
- package/packages/shared-skills/skills/github/references/waiting.md +52 -0
- package/packages/shared-skills/skills/github/references/workflows.md +161 -0
- package/packages/shared-skills/skills/github/scripts/cli.ts +8 -0
- package/packages/shared-skills/skills/github/scripts/package.json +12 -0
- package/packages/shared-skills/skills/github/scripts/sdk.ts +11 -0
- package/packages/shared-skills/skills/github/scripts/src/account.ts +243 -0
- package/packages/shared-skills/skills/github/scripts/src/actions-write.ts +86 -0
- package/packages/shared-skills/skills/github/scripts/src/actions.ts +210 -0
- package/packages/shared-skills/skills/github/scripts/src/attestations.ts +136 -0
- package/packages/shared-skills/skills/github/scripts/src/blake2b.ts +102 -0
- package/packages/shared-skills/skills/github/scripts/src/branch-protection.ts +192 -0
- package/packages/shared-skills/skills/github/scripts/src/caches.ts +105 -0
- package/packages/shared-skills/skills/github/scripts/src/checks.ts +107 -0
- package/packages/shared-skills/skills/github/scripts/src/codespaces.ts +230 -0
- package/packages/shared-skills/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/packages/shared-skills/skills/github/scripts/src/discussion-list.ts +126 -0
- package/packages/shared-skills/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/packages/shared-skills/skills/github/scripts/src/discussions.ts +234 -0
- package/packages/shared-skills/skills/github/scripts/src/env.ts +100 -0
- package/packages/shared-skills/skills/github/scripts/src/errors.ts +79 -0
- package/packages/shared-skills/skills/github/scripts/src/fields.ts +27 -0
- package/packages/shared-skills/skills/github/scripts/src/gist-shape.ts +58 -0
- package/packages/shared-skills/skills/github/scripts/src/gists-write.ts +130 -0
- package/packages/shared-skills/skills/github/scripts/src/gists.ts +118 -0
- package/packages/shared-skills/skills/github/scripts/src/git-auth.ts +46 -0
- package/packages/shared-skills/skills/github/scripts/src/http.ts +159 -0
- package/packages/shared-skills/skills/github/scripts/src/issue-develop.ts +118 -0
- package/packages/shared-skills/skills/github/scripts/src/issues-extra.ts +135 -0
- package/packages/shared-skills/skills/github/scripts/src/issues-write.ts +174 -0
- package/packages/shared-skills/skills/github/scripts/src/issues.ts +156 -0
- package/packages/shared-skills/skills/github/scripts/src/keys.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/labels.ts +209 -0
- package/packages/shared-skills/skills/github/scripts/src/merge.ts +115 -0
- package/packages/shared-skills/skills/github/scripts/src/poly1305.ts +22 -0
- package/packages/shared-skills/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/packages/shared-skills/skills/github/scripts/src/pr-view.ts +106 -0
- package/packages/shared-skills/skills/github/scripts/src/project-fields.ts +144 -0
- package/packages/shared-skills/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/packages/shared-skills/skills/github/scripts/src/project-items.ts +191 -0
- package/packages/shared-skills/skills/github/scripts/src/project-links.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/src/project-ref.ts +145 -0
- package/packages/shared-skills/skills/github/scripts/src/project-state.ts +99 -0
- package/packages/shared-skills/skills/github/scripts/src/projects.ts +158 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-read.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-review.ts +206 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-write.ts +187 -0
- package/packages/shared-skills/skills/github/scripts/src/raw.ts +78 -0
- package/packages/shared-skills/skills/github/scripts/src/read.ts +77 -0
- package/packages/shared-skills/skills/github/scripts/src/release-assets.ts +111 -0
- package/packages/shared-skills/skills/github/scripts/src/release-download.ts +151 -0
- package/packages/shared-skills/skills/github/scripts/src/release-write.ts +197 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-admin.ts +112 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-content.ts +187 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-create.ts +139 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-extras.ts +217 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-list.ts +143 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-settings.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-sync.ts +81 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-url.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/src/repos.ts +87 -0
- package/packages/shared-skills/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/packages/shared-skills/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/packages/shared-skills/skills/github/scripts/src/rulesets.ts +80 -0
- package/packages/shared-skills/skills/github/scripts/src/run-download.ts +88 -0
- package/packages/shared-skills/skills/github/scripts/src/salsa20.ts +97 -0
- package/packages/shared-skills/skills/github/scripts/src/scopes.ts +165 -0
- package/packages/shared-skills/skills/github/scripts/src/sealed-box.ts +75 -0
- package/packages/shared-skills/skills/github/scripts/src/search-commits.ts +114 -0
- package/packages/shared-skills/skills/github/scripts/src/search.ts +116 -0
- package/packages/shared-skills/skills/github/scripts/src/secrets.ts +131 -0
- package/packages/shared-skills/skills/github/scripts/src/snappy.ts +57 -0
- package/packages/shared-skills/skills/github/scripts/src/status-search.ts +55 -0
- package/packages/shared-skills/skills/github/scripts/src/transfer.ts +97 -0
- package/packages/shared-skills/skills/github/scripts/src/types.ts +75 -0
- package/packages/shared-skills/skills/github/scripts/src/variables.ts +86 -0
- package/packages/shared-skills/skills/github/scripts/src/wait.ts +164 -0
- package/packages/shared-skills/skills/github/scripts/src/wire.ts +159 -0
- package/packages/shared-skills/skills/github/scripts/src/workflows.ts +144 -0
- package/packages/shared-skills/skills/github/scripts/src/zip.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/surface.ts +106 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/packages/shared-skills/skills/programming/SKILL.md +1 -1
- package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
- package/dist/skills/git-master/SKILL.md +0 -114
- package/dist/skills/git-master/agents/openai.yaml +0 -13
- package/packages/omo-codex/plugin/skills/git-master/SKILL.md +0 -114
- package/packages/omo-codex/plugin/skills/git-master/agents/openai.yaml +0 -13
- package/packages/shared-skills/skills/git-master/SKILL.md +0 -114
- package/packages/shared-skills/skills/git-master/agents/openai.yaml +0 -13
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Workflows
|
|
2
|
+
|
|
3
|
+
How current GitHub Actions files are written, the action versions they pin, and how to operate workflows through the SDK. Taken from the workflow files of a set of working repositories on 2026-11-26.
|
|
4
|
+
|
|
5
|
+
## Rules
|
|
6
|
+
|
|
7
|
+
1. **NEVER INVENT A WORKFLOW KEY OR AN ACTION VERSION.** Copy from a current file in the repo, or confirm it against the action's releases and GitHub's changelog. A broken workflow on the default branch stops every pull request at once.
|
|
8
|
+
2. **PIN BY COMMIT SHA WITH THE VERSION IN A COMMENT.** Resolve the SHA yourself (below). A tag can be moved; a SHA cannot.
|
|
9
|
+
3. **LINT BEFORE YOU PUSH.** `actionlint` over `.github/workflows`. Most repos do not lint workflows in CI.
|
|
10
|
+
4. **A RUN BELONGS TO WHOEVER STARTED IT.** Cancel only runs you dispatched or pushed. Never re-trigger CI to make it move: no label toggles, no close and reopen, no empty commits.
|
|
11
|
+
5. **NEVER PUT `${{ inputs.* }}` OR `${{ github.event.* }}` TEXT INSIDE A `run:` SCRIPT.** Pass it through `env:` and validate it there. Interpolated text is executed as shell.
|
|
12
|
+
|
|
13
|
+
## Current pins
|
|
14
|
+
|
|
15
|
+
Each row is the action's latest release on 2026-11-26 and the SHA the newest files use.
|
|
16
|
+
|
|
17
|
+
| Action | Pin |
|
|
18
|
+
|---|---|
|
|
19
|
+
| actions/checkout | `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1` |
|
|
20
|
+
| oven-sh/setup-bun | `oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0` |
|
|
21
|
+
| actions/setup-node | `actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0` |
|
|
22
|
+
| actions/cache (also `/restore`, `/save`) | `actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0` |
|
|
23
|
+
| actions/upload-artifact | `actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2` |
|
|
24
|
+
| actions/download-artifact | `actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2` |
|
|
25
|
+
| rhysd/actionlint | `rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12` |
|
|
26
|
+
|
|
27
|
+
Older files still carry `actions/checkout@v4` or `@v5` by tag. Move a file to the current pin when you touch it.
|
|
28
|
+
|
|
29
|
+
Resolve a pin, or check that this table is still current:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const rel = await client.release.view({ repo: "actions/checkout" }) // latest
|
|
33
|
+
const commit = await client.api.rest({ path: `repos/actions/checkout/commits/${rel.tag}` })
|
|
34
|
+
console.log(`actions/checkout@${commit.sha} # ${rel.tag}`)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## A CI file
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
name: Check
|
|
41
|
+
|
|
42
|
+
on:
|
|
43
|
+
pull_request:
|
|
44
|
+
push:
|
|
45
|
+
branches: [main]
|
|
46
|
+
|
|
47
|
+
permissions:
|
|
48
|
+
contents: read
|
|
49
|
+
|
|
50
|
+
concurrency:
|
|
51
|
+
group: check-${{ github.ref }}
|
|
52
|
+
cancel-in-progress: true
|
|
53
|
+
|
|
54
|
+
jobs:
|
|
55
|
+
check:
|
|
56
|
+
name: Check
|
|
57
|
+
runs-on: ubuntu-24.04
|
|
58
|
+
timeout-minutes: 15
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
61
|
+
with:
|
|
62
|
+
persist-credentials: false
|
|
63
|
+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
64
|
+
with:
|
|
65
|
+
bun-version-file: package.json
|
|
66
|
+
- id: install
|
|
67
|
+
run: bun install --frozen-lockfile
|
|
68
|
+
- id: verify
|
|
69
|
+
run: bun run verify
|
|
70
|
+
- name: Summary
|
|
71
|
+
if: always()
|
|
72
|
+
env:
|
|
73
|
+
INSTALL: ${{ steps.install.outcome }}
|
|
74
|
+
VERIFY: ${{ steps.verify.outcome }}
|
|
75
|
+
run: |
|
|
76
|
+
{
|
|
77
|
+
echo "## Check"
|
|
78
|
+
echo
|
|
79
|
+
echo "| Step | Outcome |"
|
|
80
|
+
echo "| --- | --- |"
|
|
81
|
+
echo "| bun install --frozen-lockfile | $INSTALL |"
|
|
82
|
+
echo "| bun run verify | $VERIFY |"
|
|
83
|
+
echo
|
|
84
|
+
echo "Head: \`$GITHUB_SHA\`"
|
|
85
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
| Part | What the files do | Why |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| Triggers | `pull_request` with no branch filter, plus `push` to the default branch | every pull request reports the required checks ([branch-rules.md](branch-rules.md)) |
|
|
91
|
+
| `permissions` | `contents: read` at the top; a job that needs more widens only itself | a job that runs test code cannot push |
|
|
92
|
+
| `concurrency` | per ref, `cancel-in-progress: true` for CI | a new push replaces the stale run |
|
|
93
|
+
| `timeout-minutes` | on every job | a hung runner otherwise burns six hours |
|
|
94
|
+
| Runner | a named image (`ubuntu-24.04`) in the newer files; the newest are on `ubuntu-26.04` | `-latest` moves under you |
|
|
95
|
+
| Matrix | only when the artifact ships on more than one OS (a tool that runs on a laptop takes ubuntu and macOS), with `fail-fast: false` | a service that runs on Linux needs no Windows leg |
|
|
96
|
+
| Bun | `bun-version-file: package.json`, or an exact `bun-version: "1.4.5"` | `latest` makes setup-bun call the API, which fails under token contention |
|
|
97
|
+
| Install | `bun install --frozen-lockfile` | CI never resolves fresh |
|
|
98
|
+
| The gate | one script (`bun run verify`, `bun run check`) | the same command passes locally and in CI |
|
|
99
|
+
| Job `name:` | short and stable (`Check`, `Web e2e`) | it is the required-check context |
|
|
100
|
+
| Summary | a last step with `if: always()` writing `$GITHUB_STEP_SUMMARY` | the run page shows the outcome without opening logs |
|
|
101
|
+
| Checkout | `persist-credentials: false` unless the job pushes | later steps cannot use the token |
|
|
102
|
+
|
|
103
|
+
## Release and deploy files
|
|
104
|
+
|
|
105
|
+
| Part | What the release files do |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Trigger | `workflow_dispatch` with a version input, checked in a first step (`^[0-9]+\.[0-9]+\.[0-9]+$`) and re-exported as a job output that later steps read |
|
|
108
|
+
| Branch gate | a first step fails unless `github.ref` is the release branch, and the publishing job repeats it in `if:` |
|
|
109
|
+
| Concurrency | one fixed group with `cancel-in-progress: false`, so a publish is never cancelled halfway; deploys that must all run in order add `queue: max` |
|
|
110
|
+
| npm | OIDC trusted publishing: the publishing job alone gets `id-token: write` and `contents: write`, and no npm token is stored |
|
|
111
|
+
| Re-runs | every step is safe to run again at the same version, so a re-run finishes what a failed run left |
|
|
112
|
+
| Pushing to a protected branch | the Actions token cannot bypass a ruleset; a deploy key or a GitHub App can ([branch-rules.md](branch-rules.md)) |
|
|
113
|
+
|
|
114
|
+
## Linting workflows in CI
|
|
115
|
+
|
|
116
|
+
A complete `actionlint.yml`:
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
name: Actionlint
|
|
120
|
+
|
|
121
|
+
on:
|
|
122
|
+
pull_request:
|
|
123
|
+
push:
|
|
124
|
+
branches: [main]
|
|
125
|
+
|
|
126
|
+
permissions:
|
|
127
|
+
contents: read
|
|
128
|
+
|
|
129
|
+
jobs:
|
|
130
|
+
actionlint:
|
|
131
|
+
name: actionlint on .github/**
|
|
132
|
+
runs-on: ubuntu-24.04
|
|
133
|
+
timeout-minutes: 5
|
|
134
|
+
steps:
|
|
135
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
136
|
+
with:
|
|
137
|
+
persist-credentials: false
|
|
138
|
+
- name: Run actionlint
|
|
139
|
+
uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12
|
|
140
|
+
with:
|
|
141
|
+
args: -color
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Operating workflows
|
|
145
|
+
|
|
146
|
+
| Task | Operation |
|
|
147
|
+
|---|---|
|
|
148
|
+
| Which workflows exist, and which are disabled | `workflow.list({ repo, all: true })` |
|
|
149
|
+
| One workflow's state, file and latest runs | `workflow.view({ repo, workflow: "ci.yml" })` |
|
|
150
|
+
| Turn a workflow off or on | `workflow.disable`, `workflow.enable` |
|
|
151
|
+
| Start a run | `run.dispatch`, then `run.list({ workflow })` for its id |
|
|
152
|
+
| Wait for it | `run.wait`, or a monitor: [waiting.md](waiting.md) |
|
|
153
|
+
| Why it failed | `run.logs({ runId, grep: "##\\[error\\]" })` |
|
|
154
|
+
| Run the failed jobs again | `run.rerun({ runId, failed: true })` |
|
|
155
|
+
| Stop a run you started | `run.cancel({ runId })` |
|
|
156
|
+
| Fetch what it built | `run.download({ runId, dir })` |
|
|
157
|
+
| A cache that serves a stale build | `cache.list({ repo, key })`, `cache.delete` |
|
|
158
|
+
|
|
159
|
+
After adding or changing a workflow: push, read `run.list({ repo, sha })` to see that it triggered, wait for it, then take the check names from `pr.checks` into the branch rule.
|
|
160
|
+
|
|
161
|
+
**A job that fails in seconds with no steps** and the annotation `The job was not started because an Actions budget is preventing further use` did not run. Read it as absent, not as a red check.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// `bun cli.ts --help`, `bun cli.ts hello greet --name x`, `bun cli.ts mcp` (stdio) or `mcp --http`.
|
|
3
|
+
import { runCli } from "./vendor/surface/index.ts";
|
|
4
|
+
import { surface } from "./surface.ts";
|
|
5
|
+
|
|
6
|
+
process.exitCode = await runCli(surface, Bun.argv.slice(2), {
|
|
7
|
+
cli: "github",
|
|
8
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "github",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "github: one definition served as a typed SDK (sdk.ts), a CLI and an MCP server (cli.ts).",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"mcp": "bun cli.ts mcp"
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"bun": ">=1.4"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// The typed SDK: `const { client } = await import(".../github/scripts/sdk.ts"); await client.pr.view({ repo, number })`.
|
|
2
|
+
import { bind } from "./vendor/surface/index.ts";
|
|
3
|
+
import type { Deps } from "./src/http.ts";
|
|
4
|
+
import { surface, surfaceWith } from "./surface.ts";
|
|
5
|
+
|
|
6
|
+
export { surface };
|
|
7
|
+
export { parseRepo } from "./src/env.ts";
|
|
8
|
+
export type { Deps } from "./src/http.ts";
|
|
9
|
+
export const client = bind(surface.ops);
|
|
10
|
+
export const createClient = (inject: Partial<Deps> = {}) =>
|
|
11
|
+
bind(surfaceWith(inject).ops);
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// What the authenticated account sees across repositories: status digest, organizations and the token in use.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, limitField, reads } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { at, num, optNum, optStr, str } from "./read.ts";
|
|
6
|
+
import { searchRaw } from "./search.ts";
|
|
7
|
+
|
|
8
|
+
type Env = Readonly<Record<string, string | undefined>>;
|
|
9
|
+
type Scope = {
|
|
10
|
+
readonly org: string | undefined;
|
|
11
|
+
readonly exclude: readonly string[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const SEARCH_LIMIT = 25;
|
|
15
|
+
const NOTIFICATION_LIMIT = 300;
|
|
16
|
+
const EVENT_LIMIT = 200;
|
|
17
|
+
const FETCH_WIDTH = 10;
|
|
18
|
+
const PREVIEW = 200;
|
|
19
|
+
|
|
20
|
+
const inScope = (
|
|
21
|
+
scope: Scope,
|
|
22
|
+
repo: string | null,
|
|
23
|
+
owner: string | null,
|
|
24
|
+
): repo is string =>
|
|
25
|
+
repo !== null &&
|
|
26
|
+
(scope.org === undefined ||
|
|
27
|
+
owner?.toLowerCase() === scope.org.toLowerCase()) &&
|
|
28
|
+
!scope.exclude.some((x) => x.toLowerCase() === repo.toLowerCase());
|
|
29
|
+
|
|
30
|
+
const preview = (body: string | null) => body?.slice(0, PREVIEW) ?? null;
|
|
31
|
+
|
|
32
|
+
const searchItems = async (gh: GitHub, q: string) =>
|
|
33
|
+
(await searchRaw(gh, q, SEARCH_LIMIT)).raw.map((i) => ({
|
|
34
|
+
repo: (optStr(i, "repository_url") ?? "").replace(/^.*\/repos\//, ""),
|
|
35
|
+
number: num(i, "number"),
|
|
36
|
+
title: str(i, "title"),
|
|
37
|
+
url: str(i, "html_url"),
|
|
38
|
+
updatedAt: optStr(i, "updated_at"),
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
const commentMentioning = async (gh: GitHub, url: string, login: string) => {
|
|
42
|
+
try {
|
|
43
|
+
const c = await gh.rest("GET", new URL(url).pathname.slice(1));
|
|
44
|
+
const body = optStr(c, "body") ?? "";
|
|
45
|
+
return body.toLowerCase().includes(`@${login.toLowerCase()}`)
|
|
46
|
+
? { body, url: optStr(c, "html_url") }
|
|
47
|
+
: undefined;
|
|
48
|
+
} catch (error) {
|
|
49
|
+
// gh skips comments that were deleted or sit behind SSO the token is not authorized for.
|
|
50
|
+
if (
|
|
51
|
+
error instanceof SurfaceError &&
|
|
52
|
+
(error.kind === "not_found" || error.kind === "forbidden")
|
|
53
|
+
)
|
|
54
|
+
return undefined;
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const mentions = async (gh: GitHub, login: string, scope: Scope) => {
|
|
60
|
+
const notes = (
|
|
61
|
+
await gh.list("notifications", NOTIFICATION_LIMIT, {
|
|
62
|
+
query: { participating: true, all: true },
|
|
63
|
+
})
|
|
64
|
+
).flatMap((n) => {
|
|
65
|
+
const repo = optStr(n, "repository", "full_name");
|
|
66
|
+
const comment = optStr(n, "subject", "latest_comment_url");
|
|
67
|
+
return optStr(n, "reason") === "mention" &&
|
|
68
|
+
comment !== null &&
|
|
69
|
+
inScope(scope, repo, optStr(n, "repository", "owner", "login"))
|
|
70
|
+
? [{ repo, comment, n }]
|
|
71
|
+
: [];
|
|
72
|
+
});
|
|
73
|
+
const out = [];
|
|
74
|
+
for (let i = 0; i < notes.length; i += FETCH_WIDTH) {
|
|
75
|
+
const batch = notes.slice(i, i + FETCH_WIDTH);
|
|
76
|
+
const found = await Promise.all(
|
|
77
|
+
batch.map((x) => commentMentioning(gh, x.comment, login)),
|
|
78
|
+
);
|
|
79
|
+
for (const [j, hit] of found.entries()) {
|
|
80
|
+
const note = batch[j];
|
|
81
|
+
if (hit === undefined || note === undefined) continue;
|
|
82
|
+
const number = Number(
|
|
83
|
+
(optStr(note.n, "subject", "url") ?? "").split("/").pop(),
|
|
84
|
+
);
|
|
85
|
+
out.push({
|
|
86
|
+
repo: note.repo,
|
|
87
|
+
number: Number.isInteger(number) ? number : null,
|
|
88
|
+
title: optStr(note.n, "subject", "title"),
|
|
89
|
+
url: hit.url,
|
|
90
|
+
preview: preview(hit.body),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const activityEntry = (e: unknown) => {
|
|
98
|
+
const action = optStr(e, "payload", "action");
|
|
99
|
+
switch (optStr(e, "type") ?? "") {
|
|
100
|
+
case "IssuesEvent":
|
|
101
|
+
return action === "opened"
|
|
102
|
+
? { reason: "new issue", subject: "issue", comment: false }
|
|
103
|
+
: undefined;
|
|
104
|
+
case "PullRequestEvent":
|
|
105
|
+
return action === "opened"
|
|
106
|
+
? { reason: "new PR", subject: "pull_request", comment: false }
|
|
107
|
+
: undefined;
|
|
108
|
+
case "IssueCommentEvent":
|
|
109
|
+
return { reason: "comment", subject: "issue", comment: true };
|
|
110
|
+
case "PullRequestReviewCommentEvent":
|
|
111
|
+
return { reason: "comment", subject: "pull_request", comment: true };
|
|
112
|
+
default:
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const activity = async (gh: GitHub, login: string, scope: Scope) =>
|
|
118
|
+
(await gh.list(`users/${enc(login)}/received_events`, EVENT_LIMIT)).flatMap(
|
|
119
|
+
(e) => {
|
|
120
|
+
const kind = activityEntry(e);
|
|
121
|
+
if (kind === undefined) return [];
|
|
122
|
+
const repo = optStr(e, "repo", "name");
|
|
123
|
+
const owner = optStr(e, "org", "login") ?? repo?.split("/")[0] ?? null;
|
|
124
|
+
const subject = at(e, "payload", kind.subject);
|
|
125
|
+
const number = optNum(subject, "number");
|
|
126
|
+
if (number === null || !inScope(scope, repo, owner)) return [];
|
|
127
|
+
return [
|
|
128
|
+
{
|
|
129
|
+
repo,
|
|
130
|
+
number,
|
|
131
|
+
title: optStr(subject, "title"),
|
|
132
|
+
url: kind.comment
|
|
133
|
+
? optStr(e, "payload", "comment", "html_url")
|
|
134
|
+
: optStr(subject, "html_url"),
|
|
135
|
+
reason: kind.reason,
|
|
136
|
+
preview: kind.comment
|
|
137
|
+
? preview(optStr(e, "payload", "comment", "body"))
|
|
138
|
+
: null,
|
|
139
|
+
createdAt: optStr(e, "created_at"),
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
},
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const statusOp = (gh: GitHub) =>
|
|
146
|
+
op({
|
|
147
|
+
description:
|
|
148
|
+
"The authenticated user's open assigned issues and PRs, open review requests, recent comments mentioning them and new issues, PRs and comments in watched repositories. `org` limits every section to one organization; `exclude` drops owner/name repos. Replaces `gh status`.",
|
|
149
|
+
input: s.object({
|
|
150
|
+
org: s.optional(s.string()),
|
|
151
|
+
exclude: s.optional(
|
|
152
|
+
s.array(s.string(), { description: "owner/name repos to leave out." }),
|
|
153
|
+
),
|
|
154
|
+
}),
|
|
155
|
+
annotations: reads,
|
|
156
|
+
run: async ({ org, exclude }) => {
|
|
157
|
+
const scope: Scope = { org, exclude: exclude ?? [] };
|
|
158
|
+
const filter = [
|
|
159
|
+
"state:open archived:false",
|
|
160
|
+
org === undefined ? "" : `org:${org}`,
|
|
161
|
+
...scope.exclude.map((x) => `-repo:${x}`),
|
|
162
|
+
]
|
|
163
|
+
.filter(Boolean)
|
|
164
|
+
.join(" ");
|
|
165
|
+
const login = str(await gh.rest("GET", "user"), "login");
|
|
166
|
+
const [assignedIssues, assignedPrs, reviewRequests, mentioned, recent] =
|
|
167
|
+
await Promise.all([
|
|
168
|
+
searchItems(gh, `assignee:@me is:issue ${filter}`),
|
|
169
|
+
searchItems(gh, `assignee:@me is:pr ${filter}`),
|
|
170
|
+
searchItems(gh, `review-requested:@me is:pr ${filter}`),
|
|
171
|
+
mentions(gh, login, scope),
|
|
172
|
+
activity(gh, login, scope),
|
|
173
|
+
]);
|
|
174
|
+
return {
|
|
175
|
+
login,
|
|
176
|
+
assignedIssues,
|
|
177
|
+
assignedPrs,
|
|
178
|
+
reviewRequests,
|
|
179
|
+
mentions: mentioned,
|
|
180
|
+
activity: recent,
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
export const orgOps = (gh: GitHub) => ({
|
|
186
|
+
list: op({
|
|
187
|
+
description:
|
|
188
|
+
"Logins of the organizations the authenticated user belongs to. Replaces `gh org list`.",
|
|
189
|
+
input: s.object({ limit: limitField(30) }),
|
|
190
|
+
annotations: reads,
|
|
191
|
+
run: async ({ limit }) => ({
|
|
192
|
+
items: (await gh.list("user/orgs", limit ?? 30)).map((o) =>
|
|
193
|
+
str(o, "login"),
|
|
194
|
+
),
|
|
195
|
+
}),
|
|
196
|
+
}),
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// Mirrors defaultToken in env.ts: a set but empty GH_TOKEN falls through to the gh login, not to GITHUB_TOKEN.
|
|
200
|
+
// A token provider passed to createClient replaces defaultToken, so the environment says nothing about it.
|
|
201
|
+
const tokenSource = (env: Env, tokenInjected: boolean) => {
|
|
202
|
+
if (tokenInjected) return "injected";
|
|
203
|
+
const name =
|
|
204
|
+
env["GH_TOKEN"] !== undefined
|
|
205
|
+
? "GH_TOKEN"
|
|
206
|
+
: env["GITHUB_TOKEN"] !== undefined
|
|
207
|
+
? "GITHUB_TOKEN"
|
|
208
|
+
: undefined;
|
|
209
|
+
return name !== undefined && env[name] !== "" ? name : "gh";
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export const authOps = (
|
|
213
|
+
gh: GitHub,
|
|
214
|
+
env: Env = process.env,
|
|
215
|
+
tokenInjected = false,
|
|
216
|
+
) => ({
|
|
217
|
+
status: op({
|
|
218
|
+
description:
|
|
219
|
+
"The account behind the token: login, name, OAuth scopes (null for fine-grained and app tokens, which report none) and where the token came from (GH_TOKEN, GITHUB_TOKEN, the gh login, or `injected` for a token provider passed to createClient). The token itself is never returned. Replaces `gh auth status`.",
|
|
220
|
+
input: s.object({}),
|
|
221
|
+
annotations: reads,
|
|
222
|
+
run: async () => {
|
|
223
|
+
const [user, headers] = await Promise.all([
|
|
224
|
+
gh.rest("GET", "user"),
|
|
225
|
+
gh.headers("user"),
|
|
226
|
+
]);
|
|
227
|
+
const scopes = headers.get("x-oauth-scopes");
|
|
228
|
+
return {
|
|
229
|
+
host: "github.com",
|
|
230
|
+
login: str(user, "login"),
|
|
231
|
+
name: optStr(user, "name"),
|
|
232
|
+
scopes:
|
|
233
|
+
scopes === null
|
|
234
|
+
? null
|
|
235
|
+
: scopes
|
|
236
|
+
.split(",")
|
|
237
|
+
.map((x) => x.trim())
|
|
238
|
+
.filter(Boolean),
|
|
239
|
+
tokenSource: tokenSource(env, tokenInjected),
|
|
240
|
+
};
|
|
241
|
+
},
|
|
242
|
+
}),
|
|
243
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Cancelling, re-running, deleting and downloading workflow runs.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { irreversible, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { runDownloadOp } from "./run-download.ts";
|
|
6
|
+
|
|
7
|
+
const runIdField = s.integer({
|
|
8
|
+
description:
|
|
9
|
+
"Workflow run id (databaseId; the number in .../actions/runs/<id>).",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const actionWriteOps = (gh: GitHub) => ({
|
|
13
|
+
cancel: op({
|
|
14
|
+
description:
|
|
15
|
+
"Cancel a queued or running workflow run; force cancels even jobs that ignore cancellation (e.g. `if: always()`). A finished run fails as `conflict`. Replaces `gh run cancel`.",
|
|
16
|
+
input: s.object({
|
|
17
|
+
repo: repoField,
|
|
18
|
+
runId: runIdField,
|
|
19
|
+
force: s.optional(s.boolean()),
|
|
20
|
+
}),
|
|
21
|
+
annotations: irreversible,
|
|
22
|
+
run: async ({ repo, runId, force }) => {
|
|
23
|
+
const r = await gh.repo(repo);
|
|
24
|
+
await gh.rest(
|
|
25
|
+
"POST",
|
|
26
|
+
`repos/${r.full}/actions/runs/${runId}/${force === true ? "force-cancel" : "cancel"}`,
|
|
27
|
+
);
|
|
28
|
+
return { repo: r.full, runId, cancelled: true, force: force === true };
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
rerun: op({
|
|
32
|
+
description:
|
|
33
|
+
"Re-run a workflow run, only its failed jobs, or one job (with the jobs it depends on), optionally with debug logging. Replaces `gh run rerun`.",
|
|
34
|
+
input: s.object({
|
|
35
|
+
repo: repoField,
|
|
36
|
+
runId: s.optional(runIdField),
|
|
37
|
+
failed: s.optional(
|
|
38
|
+
s.boolean({
|
|
39
|
+
description: "Only the failed jobs and their dependencies.",
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
jobId: s.optional(
|
|
43
|
+
s.integer({ description: "Re-run this one job instead of a run." }),
|
|
44
|
+
),
|
|
45
|
+
debug: s.optional(s.boolean({ description: "Enable debug logging." })),
|
|
46
|
+
}),
|
|
47
|
+
annotations: writes,
|
|
48
|
+
run: async ({ repo, runId, failed, jobId, debug }) => {
|
|
49
|
+
let path: string;
|
|
50
|
+
if (jobId !== undefined && runId === undefined && failed !== true)
|
|
51
|
+
path = `actions/jobs/${jobId}/rerun`;
|
|
52
|
+
else if (jobId === undefined && runId !== undefined)
|
|
53
|
+
path = `actions/runs/${runId}/${failed === true ? "rerun-failed-jobs" : "rerun"}`;
|
|
54
|
+
else
|
|
55
|
+
throw new SurfaceError(
|
|
56
|
+
"usage",
|
|
57
|
+
"pass runId (optionally with failed) or jobId alone",
|
|
58
|
+
"find ids with `run view`",
|
|
59
|
+
);
|
|
60
|
+
const r = await gh.repo(repo);
|
|
61
|
+
await gh.rest("POST", `repos/${r.full}/${path}`, {
|
|
62
|
+
...(debug === true ? { body: { enable_debug_logging: true } } : {}),
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
repo: r.full,
|
|
66
|
+
runId: runId ?? null,
|
|
67
|
+
jobId: jobId ?? null,
|
|
68
|
+
failedOnly: failed === true,
|
|
69
|
+
debug: debug === true,
|
|
70
|
+
rerun: true,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
delete: op({
|
|
75
|
+
description:
|
|
76
|
+
"Delete a completed workflow run with its logs and artifacts. Replaces `gh run delete`.",
|
|
77
|
+
input: s.object({ repo: repoField, runId: runIdField }),
|
|
78
|
+
annotations: irreversible,
|
|
79
|
+
run: async ({ repo, runId }) => {
|
|
80
|
+
const r = await gh.repo(repo);
|
|
81
|
+
await gh.rest("DELETE", `repos/${r.full}/actions/runs/${runId}`);
|
|
82
|
+
return { repo: r.full, runId, deleted: true };
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
download: runDownloadOp(gh),
|
|
86
|
+
});
|