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,210 @@
|
|
|
1
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
2
|
+
import { enc, limitField, reads, repoField, writes } from "./fields.ts";
|
|
3
|
+
import type { GitHub } from "./http.ts";
|
|
4
|
+
import { arr, at, num, optNum, optStr, str } from "./read.ts";
|
|
5
|
+
|
|
6
|
+
const runIdField = s.integer({
|
|
7
|
+
description:
|
|
8
|
+
"Workflow run id (databaseId; the number in .../actions/runs/<id>).",
|
|
9
|
+
});
|
|
10
|
+
const FAILED = new Set([
|
|
11
|
+
"failure",
|
|
12
|
+
"timed_out",
|
|
13
|
+
"startup_failure",
|
|
14
|
+
"cancelled",
|
|
15
|
+
]);
|
|
16
|
+
const STAMP = /^\d{4}-\d\d-\d\dT[\d:.]+Z /;
|
|
17
|
+
|
|
18
|
+
export const runSummary = (w: unknown) => ({
|
|
19
|
+
id: num(w, "id"),
|
|
20
|
+
workflow: optStr(w, "name"),
|
|
21
|
+
title: optStr(w, "display_title"),
|
|
22
|
+
status: str(w, "status"),
|
|
23
|
+
conclusion: optStr(w, "conclusion"),
|
|
24
|
+
event: str(w, "event"),
|
|
25
|
+
branch: optStr(w, "head_branch"),
|
|
26
|
+
sha: str(w, "head_sha"),
|
|
27
|
+
attempt: optNum(w, "run_attempt") ?? 1,
|
|
28
|
+
createdAt: str(w, "created_at"),
|
|
29
|
+
updatedAt: optStr(w, "updated_at"),
|
|
30
|
+
url: str(w, "html_url"),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const jobSummary = (j: unknown) => ({
|
|
34
|
+
id: num(j, "id"),
|
|
35
|
+
name: str(j, "name"),
|
|
36
|
+
status: str(j, "status"),
|
|
37
|
+
conclusion: optStr(j, "conclusion"),
|
|
38
|
+
startedAt: optStr(j, "started_at"),
|
|
39
|
+
completedAt: optStr(j, "completed_at"),
|
|
40
|
+
url: optStr(j, "html_url"),
|
|
41
|
+
failedSteps: arr(at(j, "steps") ?? [], "steps").flatMap((st) =>
|
|
42
|
+
FAILED.has(optStr(st, "conclusion") ?? "") ? [str(st, "name")] : [],
|
|
43
|
+
),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const runJobs = async (gh: GitHub, full: string, runId: number) =>
|
|
47
|
+
(
|
|
48
|
+
await gh.list(`repos/${full}/actions/runs/${runId}/jobs`, 300, {
|
|
49
|
+
query: { filter: "latest" },
|
|
50
|
+
key: "jobs",
|
|
51
|
+
})
|
|
52
|
+
).map(jobSummary);
|
|
53
|
+
|
|
54
|
+
export const actionOps = (gh: GitHub) => ({
|
|
55
|
+
list: op({
|
|
56
|
+
description:
|
|
57
|
+
"Recent workflow runs, filterable by workflow file/name, branch, commit SHA, event or status. Replaces `gh run list`.",
|
|
58
|
+
input: s.object({
|
|
59
|
+
repo: repoField,
|
|
60
|
+
workflow: s.optional(
|
|
61
|
+
s.string({ description: "Workflow file name (ci.yml) or id." }),
|
|
62
|
+
),
|
|
63
|
+
branch: s.optional(s.string()),
|
|
64
|
+
sha: s.optional(s.string({ description: "Head commit SHA." })),
|
|
65
|
+
event: s.optional(s.string()),
|
|
66
|
+
status: s.optional(
|
|
67
|
+
s.enum([
|
|
68
|
+
"queued",
|
|
69
|
+
"in_progress",
|
|
70
|
+
"completed",
|
|
71
|
+
"success",
|
|
72
|
+
"failure",
|
|
73
|
+
"cancelled",
|
|
74
|
+
"waiting",
|
|
75
|
+
"requested",
|
|
76
|
+
"pending",
|
|
77
|
+
]),
|
|
78
|
+
),
|
|
79
|
+
limit: limitField(20),
|
|
80
|
+
}),
|
|
81
|
+
annotations: reads,
|
|
82
|
+
run: async ({ repo, workflow, branch, sha, event, status, limit }) => {
|
|
83
|
+
const r = await gh.repo(repo);
|
|
84
|
+
const path =
|
|
85
|
+
workflow === undefined
|
|
86
|
+
? `repos/${r.full}/actions/runs`
|
|
87
|
+
: `repos/${r.full}/actions/workflows/${enc(workflow)}/runs`;
|
|
88
|
+
const raw = await gh.list(path, limit ?? 20, {
|
|
89
|
+
query: { branch, head_sha: sha, event, status },
|
|
90
|
+
key: "workflow_runs",
|
|
91
|
+
});
|
|
92
|
+
return { repo: r.full, runs: raw.map(runSummary) };
|
|
93
|
+
},
|
|
94
|
+
}),
|
|
95
|
+
view: op({
|
|
96
|
+
description:
|
|
97
|
+
"One workflow run with its latest-attempt jobs and the names of failed steps. Replaces `gh run view`.",
|
|
98
|
+
input: s.object({ repo: repoField, runId: runIdField }),
|
|
99
|
+
annotations: reads,
|
|
100
|
+
run: async ({ repo, runId }) => {
|
|
101
|
+
const r = await gh.repo(repo);
|
|
102
|
+
const run = runSummary(
|
|
103
|
+
await gh.rest("GET", `repos/${r.full}/actions/runs/${runId}`),
|
|
104
|
+
);
|
|
105
|
+
return { repo: r.full, ...run, jobs: await runJobs(gh, r.full, runId) };
|
|
106
|
+
},
|
|
107
|
+
}),
|
|
108
|
+
logs: op({
|
|
109
|
+
description:
|
|
110
|
+
"Log tails of a run's failed jobs (or one job), timestamps stripped, optionally only lines matching a regex. Replaces `gh run view --log-failed`.",
|
|
111
|
+
input: s.object({
|
|
112
|
+
repo: repoField,
|
|
113
|
+
runId: s.optional(runIdField),
|
|
114
|
+
jobId: s.optional(
|
|
115
|
+
s.integer({ description: "One job id; overrides runId." }),
|
|
116
|
+
),
|
|
117
|
+
allJobs: s.optional(
|
|
118
|
+
s.boolean({ description: "Include jobs that did not fail." }),
|
|
119
|
+
),
|
|
120
|
+
tail: s.optional(
|
|
121
|
+
s.integer({ description: "Last N lines per job (default 150)." }),
|
|
122
|
+
),
|
|
123
|
+
grep: s.optional(
|
|
124
|
+
s.string({
|
|
125
|
+
description:
|
|
126
|
+
"Case-insensitive regex; keep only matching lines (applied before tail).",
|
|
127
|
+
}),
|
|
128
|
+
),
|
|
129
|
+
}),
|
|
130
|
+
annotations: reads,
|
|
131
|
+
run: async ({ repo, runId, jobId, allJobs, tail, grep }) => {
|
|
132
|
+
const r = await gh.repo(repo);
|
|
133
|
+
const pattern = grep === undefined ? undefined : new RegExp(grep, "i");
|
|
134
|
+
let jobs: {
|
|
135
|
+
readonly id: number;
|
|
136
|
+
readonly name: string;
|
|
137
|
+
readonly conclusion: string | null;
|
|
138
|
+
}[];
|
|
139
|
+
if (jobId !== undefined) {
|
|
140
|
+
const j = await gh.rest("GET", `repos/${r.full}/actions/jobs/${jobId}`);
|
|
141
|
+
jobs = [
|
|
142
|
+
{
|
|
143
|
+
id: jobId,
|
|
144
|
+
name: str(j, "name"),
|
|
145
|
+
conclusion: optStr(j, "conclusion"),
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
} else if (runId !== undefined) {
|
|
149
|
+
jobs = (await runJobs(gh, r.full, runId)).filter(
|
|
150
|
+
(j) => allJobs === true || FAILED.has(j.conclusion ?? ""),
|
|
151
|
+
);
|
|
152
|
+
} else {
|
|
153
|
+
throw new SurfaceError(
|
|
154
|
+
"usage",
|
|
155
|
+
"pass runId or jobId",
|
|
156
|
+
"find run ids with `run list` or `pr checks`",
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
return Promise.all(
|
|
160
|
+
jobs.map(async (j) => {
|
|
161
|
+
const lines = (
|
|
162
|
+
await gh.logs(`repos/${r.full}/actions/jobs/${j.id}/logs`)
|
|
163
|
+
)
|
|
164
|
+
.trimEnd()
|
|
165
|
+
.split(/\r?\n/)
|
|
166
|
+
.map((l) => l.replace(STAMP, ""));
|
|
167
|
+
const kept =
|
|
168
|
+
pattern === undefined
|
|
169
|
+
? lines
|
|
170
|
+
: lines.filter((l) => pattern.test(l));
|
|
171
|
+
return {
|
|
172
|
+
jobId: j.id,
|
|
173
|
+
name: j.name,
|
|
174
|
+
conclusion: j.conclusion,
|
|
175
|
+
totalLines: lines.length,
|
|
176
|
+
lines: kept.slice(-(tail ?? 150)),
|
|
177
|
+
};
|
|
178
|
+
}),
|
|
179
|
+
);
|
|
180
|
+
},
|
|
181
|
+
}),
|
|
182
|
+
dispatch: op({
|
|
183
|
+
description:
|
|
184
|
+
"Trigger a workflow_dispatch workflow on a ref with inputs. Replaces `gh workflow run`.",
|
|
185
|
+
input: s.object({
|
|
186
|
+
repo: repoField,
|
|
187
|
+
workflow: s.string({
|
|
188
|
+
description: "Workflow file name (release.yml) or id.",
|
|
189
|
+
}),
|
|
190
|
+
ref: s.optional(
|
|
191
|
+
s.string({
|
|
192
|
+
description: "Branch or tag; default branch when omitted.",
|
|
193
|
+
}),
|
|
194
|
+
),
|
|
195
|
+
inputs: s.optional(s.record(s.string())),
|
|
196
|
+
}),
|
|
197
|
+
annotations: writes,
|
|
198
|
+
run: async ({ repo, workflow, ref, inputs }) => {
|
|
199
|
+
const r = await gh.repo(repo);
|
|
200
|
+
const target =
|
|
201
|
+
ref ?? str(await gh.rest("GET", `repos/${r.full}`), "default_branch");
|
|
202
|
+
await gh.rest(
|
|
203
|
+
"POST",
|
|
204
|
+
`repos/${r.full}/actions/workflows/${enc(workflow)}/dispatches`,
|
|
205
|
+
{ body: { ref: target, inputs: inputs ?? {} } },
|
|
206
|
+
);
|
|
207
|
+
return { repo: r.full, workflow, ref: target, dispatched: true };
|
|
208
|
+
},
|
|
209
|
+
}),
|
|
210
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Artifact attestations: fetch the Sigstore bundles GitHub stores for an artifact digest (no verification).
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
4
|
+
import { enc, limitField, reads } from "./fields.ts";
|
|
5
|
+
import type { GitHub } from "./http.ts";
|
|
6
|
+
import { at, isObj, num, optStr, str } from "./read.ts";
|
|
7
|
+
import { unsnappy } from "./snappy.ts";
|
|
8
|
+
|
|
9
|
+
const DIGEST = /^(sha256|sha512):[0-9a-f]+$/;
|
|
10
|
+
|
|
11
|
+
const fileDigest = async (path: string, alg: "sha256" | "sha512") => {
|
|
12
|
+
const file = Bun.file(path);
|
|
13
|
+
if (!(await file.exists()))
|
|
14
|
+
throw new SurfaceError(
|
|
15
|
+
"usage",
|
|
16
|
+
`no such file: ${path}`,
|
|
17
|
+
"pass a local artifact path or digest",
|
|
18
|
+
);
|
|
19
|
+
const hasher = new Bun.CryptoHasher(alg);
|
|
20
|
+
for await (const chunk of file.stream()) hasher.update(chunk);
|
|
21
|
+
return `${alg}:${hasher.digest("hex")}`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const attestationOps = (gh: GitHub) => ({
|
|
25
|
+
list: op({
|
|
26
|
+
description:
|
|
27
|
+
"Fetch the attestations (Sigstore bundles) stored for an artifact, by a local file whose digest is computed here or by a ready digest, scoped to a repository or an owner; with dir, also write <digest>.jsonl there. This fetches attestations and does NOT verify them. Replaces `gh attestation download`.",
|
|
28
|
+
input: s.object({
|
|
29
|
+
file: s.optional(
|
|
30
|
+
s.string({ description: "Local artifact path to digest." }),
|
|
31
|
+
),
|
|
32
|
+
digest: s.optional(
|
|
33
|
+
s.string({ description: "sha256:<hex> or sha512:<hex>." }),
|
|
34
|
+
),
|
|
35
|
+
digestAlg: s.optional(s.enum(["sha256", "sha512"])),
|
|
36
|
+
repo: s.optional(
|
|
37
|
+
s.string({
|
|
38
|
+
description:
|
|
39
|
+
"owner/name; defaults to the git origin when owner is not given.",
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
owner: s.optional(
|
|
43
|
+
s.string({
|
|
44
|
+
description: "Organization or user login instead of repo.",
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
predicateType: s.optional(
|
|
48
|
+
s.string({ description: "e.g. https://slsa.dev/provenance/v1" }),
|
|
49
|
+
),
|
|
50
|
+
limit: limitField(30),
|
|
51
|
+
dir: s.optional(
|
|
52
|
+
s.string({ description: "Directory to write <digest>.jsonl into." }),
|
|
53
|
+
),
|
|
54
|
+
}),
|
|
55
|
+
annotations: reads,
|
|
56
|
+
run: async (input) => {
|
|
57
|
+
if ((input.file === undefined) === (input.digest === undefined))
|
|
58
|
+
throw new SurfaceError(
|
|
59
|
+
"usage",
|
|
60
|
+
"pass exactly one of file or digest",
|
|
61
|
+
"digest looks like sha256:<hex>",
|
|
62
|
+
);
|
|
63
|
+
if (input.repo !== undefined && input.owner !== undefined)
|
|
64
|
+
throw new SurfaceError(
|
|
65
|
+
"usage",
|
|
66
|
+
"pass repo or owner, not both",
|
|
67
|
+
"owner covers every repository it owns",
|
|
68
|
+
);
|
|
69
|
+
const digest =
|
|
70
|
+
input.file === undefined
|
|
71
|
+
? (input.digest ?? "").toLowerCase()
|
|
72
|
+
: await fileDigest(input.file, input.digestAlg ?? "sha256");
|
|
73
|
+
if (!DIGEST.test(digest))
|
|
74
|
+
throw new SurfaceError(
|
|
75
|
+
"usage",
|
|
76
|
+
`not a digest: ${digest}`,
|
|
77
|
+
"use sha256:<hex> or sha512:<hex>",
|
|
78
|
+
);
|
|
79
|
+
let scope: { readonly repo: string } | { readonly owner: string };
|
|
80
|
+
let path: string;
|
|
81
|
+
if (input.owner === undefined) {
|
|
82
|
+
const r = await gh.repo(input.repo);
|
|
83
|
+
scope = { repo: r.full };
|
|
84
|
+
path = `repos/${r.full}/attestations/${enc(digest)}`;
|
|
85
|
+
} else {
|
|
86
|
+
const kind = str(
|
|
87
|
+
await gh.rest("GET", `users/${enc(input.owner)}`),
|
|
88
|
+
"type",
|
|
89
|
+
);
|
|
90
|
+
scope = { owner: input.owner };
|
|
91
|
+
path = `${kind === "Organization" ? "orgs" : "users"}/${enc(input.owner)}/attestations/${enc(digest)}`;
|
|
92
|
+
}
|
|
93
|
+
const raw = await gh.list(path, input.limit ?? 30, {
|
|
94
|
+
query: { predicate_type: input.predicateType },
|
|
95
|
+
key: "attestations",
|
|
96
|
+
});
|
|
97
|
+
const items = await Promise.all(
|
|
98
|
+
raw.map(async (a) => {
|
|
99
|
+
const inline = at(a, "bundle");
|
|
100
|
+
const url = optStr(a, "bundle_url");
|
|
101
|
+
const bundle: unknown =
|
|
102
|
+
isObj(inline) || url === null
|
|
103
|
+
? inline
|
|
104
|
+
: JSON.parse(
|
|
105
|
+
new TextDecoder().decode(unsnappy(await gh.content(url))),
|
|
106
|
+
);
|
|
107
|
+
if (!isObj(bundle))
|
|
108
|
+
throw new SurfaceError(
|
|
109
|
+
"invalid_response",
|
|
110
|
+
"attestation has no bundle",
|
|
111
|
+
"inspect it with `api rest`",
|
|
112
|
+
);
|
|
113
|
+
return { repositoryId: num(a, "repository_id"), bundle };
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
116
|
+
const out =
|
|
117
|
+
input.dir === undefined
|
|
118
|
+
? undefined
|
|
119
|
+
: join(
|
|
120
|
+
input.dir,
|
|
121
|
+
`${process.platform === "win32" ? digest.replace(":", "-") : digest}.jsonl`,
|
|
122
|
+
);
|
|
123
|
+
if (out !== undefined)
|
|
124
|
+
await Bun.write(
|
|
125
|
+
out,
|
|
126
|
+
items.map((i) => `${JSON.stringify(i.bundle)}\n`).join(""),
|
|
127
|
+
);
|
|
128
|
+
return {
|
|
129
|
+
...scope,
|
|
130
|
+
digest,
|
|
131
|
+
items,
|
|
132
|
+
...(out === undefined ? {} : { path: out }),
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Unkeyed BLAKE2b (RFC 7693) with any digest length up to 64 bytes; node:crypto under Bun only produces the 64-byte digest.
|
|
2
|
+
const IV = new BigUint64Array([
|
|
3
|
+
0x6a09e667f3bcc908n,
|
|
4
|
+
0xbb67ae8584caa73bn,
|
|
5
|
+
0x3c6ef372fe94f82bn,
|
|
6
|
+
0xa54ff53a5f1d36f1n,
|
|
7
|
+
0x510e527fade682d1n,
|
|
8
|
+
0x9b05688c2b3e6c1fn,
|
|
9
|
+
0x1f83d9abfb41bd6bn,
|
|
10
|
+
0x5be0cd19137e2179n,
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const SIGMA = [
|
|
14
|
+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
15
|
+
[14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3],
|
|
16
|
+
[11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4],
|
|
17
|
+
[7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8],
|
|
18
|
+
[9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13],
|
|
19
|
+
[2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9],
|
|
20
|
+
[12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11],
|
|
21
|
+
[13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10],
|
|
22
|
+
[6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5],
|
|
23
|
+
[10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0],
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
const BLOCK = 128;
|
|
27
|
+
const MASK = (1n << 64n) - 1n;
|
|
28
|
+
|
|
29
|
+
const word = (a: BigUint64Array, i: number): bigint => a[i] ?? 0n;
|
|
30
|
+
const rotr = (x: bigint, n: bigint): bigint =>
|
|
31
|
+
((x >> n) | (x << (64n - n))) & MASK;
|
|
32
|
+
|
|
33
|
+
const mix = (
|
|
34
|
+
v: BigUint64Array,
|
|
35
|
+
[a, b, c, d]: readonly [number, number, number, number],
|
|
36
|
+
x: bigint,
|
|
37
|
+
y: bigint,
|
|
38
|
+
): void => {
|
|
39
|
+
v[a] = word(v, a) + word(v, b) + x;
|
|
40
|
+
v[d] = rotr(word(v, d) ^ word(v, a), 32n);
|
|
41
|
+
v[c] = word(v, c) + word(v, d);
|
|
42
|
+
v[b] = rotr(word(v, b) ^ word(v, c), 24n);
|
|
43
|
+
v[a] = word(v, a) + word(v, b) + y;
|
|
44
|
+
v[d] = rotr(word(v, d) ^ word(v, a), 16n);
|
|
45
|
+
v[c] = word(v, c) + word(v, d);
|
|
46
|
+
v[b] = rotr(word(v, b) ^ word(v, c), 63n);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const LANES = [
|
|
50
|
+
[0, 4, 8, 12],
|
|
51
|
+
[1, 5, 9, 13],
|
|
52
|
+
[2, 6, 10, 14],
|
|
53
|
+
[3, 7, 11, 15],
|
|
54
|
+
[0, 5, 10, 15],
|
|
55
|
+
[1, 6, 11, 12],
|
|
56
|
+
[2, 7, 8, 13],
|
|
57
|
+
[3, 4, 9, 14],
|
|
58
|
+
] as const;
|
|
59
|
+
|
|
60
|
+
const compress = (
|
|
61
|
+
h: BigUint64Array,
|
|
62
|
+
block: Uint8Array,
|
|
63
|
+
counter: bigint,
|
|
64
|
+
last: boolean,
|
|
65
|
+
): void => {
|
|
66
|
+
const view = new DataView(block.buffer, block.byteOffset, BLOCK);
|
|
67
|
+
const m = BigUint64Array.from({ length: 16 }, (_, i) =>
|
|
68
|
+
view.getBigUint64(i * 8, true),
|
|
69
|
+
);
|
|
70
|
+
const v = new BigUint64Array(16);
|
|
71
|
+
v.set(h);
|
|
72
|
+
v.set(IV, 8);
|
|
73
|
+
v[12] = word(v, 12) ^ (counter & MASK);
|
|
74
|
+
v[13] = word(v, 13) ^ (counter >> 64n);
|
|
75
|
+
if (last) v[14] = word(v, 14) ^ MASK;
|
|
76
|
+
for (let round = 0; round < 12; round++) {
|
|
77
|
+
const s = SIGMA[round % 10] ?? SIGMA[0];
|
|
78
|
+
LANES.forEach((lane, i) =>
|
|
79
|
+
mix(v, lane, word(m, s[2 * i] ?? 0), word(m, s[2 * i + 1] ?? 0)),
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
for (let i = 0; i < 8; i++) h[i] = word(h, i) ^ word(v, i) ^ word(v, i + 8);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const blake2b = (data: Uint8Array, outLength: number): Uint8Array => {
|
|
86
|
+
if (!Number.isInteger(outLength) || outLength < 1 || outLength > 64)
|
|
87
|
+
throw new RangeError("BLAKE2b digest length must be 1-64 bytes");
|
|
88
|
+
const h = new BigUint64Array(IV);
|
|
89
|
+
h[0] = word(h, 0) ^ (0x01010000n | BigInt(outLength));
|
|
90
|
+
const blocks = Math.max(1, Math.ceil(data.length / BLOCK));
|
|
91
|
+
for (let i = 0; i < blocks; i++) {
|
|
92
|
+
const block = new Uint8Array(BLOCK);
|
|
93
|
+
const chunk = data.subarray(i * BLOCK, (i + 1) * BLOCK);
|
|
94
|
+
block.set(chunk);
|
|
95
|
+
const last = i === blocks - 1;
|
|
96
|
+
compress(h, block, BigInt(i * BLOCK + chunk.length), last);
|
|
97
|
+
}
|
|
98
|
+
const out = new Uint8Array(64);
|
|
99
|
+
const view = new DataView(out.buffer);
|
|
100
|
+
h.forEach((x, i) => view.setBigUint64(i * 8, x, true));
|
|
101
|
+
return out.slice(0, outLength);
|
|
102
|
+
};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Classic branch protection (repos/{o}/{n}/branches/{branch}/protection): view, set and delete.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, irreversible, reads, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { arr, at, bool, isObj, optNum, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const branchField = s.string({ description: "Branch name." });
|
|
8
|
+
const check = s.object({
|
|
9
|
+
context: s.string(),
|
|
10
|
+
appId: s.optional(
|
|
11
|
+
s.integer({
|
|
12
|
+
description:
|
|
13
|
+
"Only this GitHub App may report the check (15368 = Actions).",
|
|
14
|
+
}),
|
|
15
|
+
),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const enabled = (x: unknown, key: string): boolean => bool(x, key, "enabled");
|
|
19
|
+
const names = (x: unknown, key: string, field: string): string[] =>
|
|
20
|
+
arr(at(x, key) ?? [], key).map((n) => str(n, field));
|
|
21
|
+
|
|
22
|
+
const trim = (x: unknown) => {
|
|
23
|
+
const checks = at(x, "required_status_checks");
|
|
24
|
+
const reviews = at(x, "required_pull_request_reviews");
|
|
25
|
+
const restrictions = at(x, "restrictions");
|
|
26
|
+
return {
|
|
27
|
+
protected: true,
|
|
28
|
+
requiredChecks: isObj(checks)
|
|
29
|
+
? {
|
|
30
|
+
strict: bool(checks, "strict"),
|
|
31
|
+
checks: arr(at(checks, "checks") ?? [], "checks").map((c) => ({
|
|
32
|
+
context: str(c, "context"),
|
|
33
|
+
appId: optNum(c, "app_id"),
|
|
34
|
+
})),
|
|
35
|
+
}
|
|
36
|
+
: null,
|
|
37
|
+
requiredApprovingReviewCount: isObj(reviews)
|
|
38
|
+
? (optNum(reviews, "required_approving_review_count") ?? 0)
|
|
39
|
+
: null,
|
|
40
|
+
dismissStaleReviews: isObj(reviews)
|
|
41
|
+
? bool(reviews, "dismiss_stale_reviews")
|
|
42
|
+
: null,
|
|
43
|
+
requireCodeOwnerReviews: isObj(reviews)
|
|
44
|
+
? bool(reviews, "require_code_owner_reviews")
|
|
45
|
+
: null,
|
|
46
|
+
enforceAdmins: enabled(x, "enforce_admins"),
|
|
47
|
+
requiredLinearHistory: enabled(x, "required_linear_history"),
|
|
48
|
+
allowForcePushes: enabled(x, "allow_force_pushes"),
|
|
49
|
+
allowDeletions: enabled(x, "allow_deletions"),
|
|
50
|
+
requiredConversationResolution: enabled(
|
|
51
|
+
x,
|
|
52
|
+
"required_conversation_resolution",
|
|
53
|
+
),
|
|
54
|
+
restrictions: isObj(restrictions)
|
|
55
|
+
? {
|
|
56
|
+
users: names(restrictions, "users", "login"),
|
|
57
|
+
teams: names(restrictions, "teams", "slug"),
|
|
58
|
+
apps: names(restrictions, "apps", "slug"),
|
|
59
|
+
}
|
|
60
|
+
: null,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const notProtected = (error: unknown): boolean =>
|
|
65
|
+
error instanceof SurfaceError &&
|
|
66
|
+
error.kind === "not_found" &&
|
|
67
|
+
/not protected/i.test(error.message);
|
|
68
|
+
|
|
69
|
+
export const branchProtectionOps = (gh: GitHub) => ({
|
|
70
|
+
view: op({
|
|
71
|
+
description:
|
|
72
|
+
"A branch's classic protection settings, or `{ protected: false }` when it has none (rulesets are separate: see `ruleset check`). Needs admin access.",
|
|
73
|
+
input: s.object({ repo: repoField, branch: branchField }),
|
|
74
|
+
annotations: reads,
|
|
75
|
+
run: async ({ repo, branch }) => {
|
|
76
|
+
const r = await gh.repo(repo);
|
|
77
|
+
try {
|
|
78
|
+
const x = await gh.rest(
|
|
79
|
+
"GET",
|
|
80
|
+
`repos/${r.full}/branches/${enc(branch)}/protection`,
|
|
81
|
+
);
|
|
82
|
+
return { repo: r.full, branch, ...trim(x) };
|
|
83
|
+
} catch (error) {
|
|
84
|
+
if (notProtected(error))
|
|
85
|
+
return { repo: r.full, branch, protected: false };
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
set: op({
|
|
91
|
+
description:
|
|
92
|
+
"Replace a branch's classic protection with the given settings; anything not passed is turned off. Needs admin access.",
|
|
93
|
+
input: s.object({
|
|
94
|
+
repo: repoField,
|
|
95
|
+
branch: branchField,
|
|
96
|
+
requiredChecks: s.optional(
|
|
97
|
+
s.object({
|
|
98
|
+
strict: s.optional(
|
|
99
|
+
s.boolean({ description: "Branch must be up to date first." }),
|
|
100
|
+
),
|
|
101
|
+
checks: s.array(check),
|
|
102
|
+
}),
|
|
103
|
+
),
|
|
104
|
+
requiredApprovingReviewCount: s.optional(s.integer()),
|
|
105
|
+
dismissStaleReviews: s.optional(s.boolean()),
|
|
106
|
+
requireCodeOwnerReviews: s.optional(s.boolean()),
|
|
107
|
+
enforceAdmins: s.optional(s.boolean()),
|
|
108
|
+
requiredLinearHistory: s.optional(s.boolean()),
|
|
109
|
+
allowForcePushes: s.optional(s.boolean()),
|
|
110
|
+
allowDeletions: s.optional(s.boolean()),
|
|
111
|
+
requiredConversationResolution: s.optional(s.boolean()),
|
|
112
|
+
restrictions: s.optional(
|
|
113
|
+
s.object(
|
|
114
|
+
{
|
|
115
|
+
users: s.array(s.string()),
|
|
116
|
+
teams: s.array(s.string()),
|
|
117
|
+
apps: s.optional(s.array(s.string())),
|
|
118
|
+
},
|
|
119
|
+
{ description: "Who may push (org repositories only)." },
|
|
120
|
+
),
|
|
121
|
+
),
|
|
122
|
+
}),
|
|
123
|
+
annotations: writes,
|
|
124
|
+
run: async ({ repo, branch, requiredChecks, restrictions, ...f }) => {
|
|
125
|
+
const r = await gh.repo(repo);
|
|
126
|
+
const wantsReviews =
|
|
127
|
+
f.requiredApprovingReviewCount !== undefined ||
|
|
128
|
+
f.dismissStaleReviews !== undefined ||
|
|
129
|
+
f.requireCodeOwnerReviews !== undefined;
|
|
130
|
+
const optional = {
|
|
131
|
+
required_linear_history: f.requiredLinearHistory,
|
|
132
|
+
allow_force_pushes: f.allowForcePushes,
|
|
133
|
+
allow_deletions: f.allowDeletions,
|
|
134
|
+
required_conversation_resolution: f.requiredConversationResolution,
|
|
135
|
+
};
|
|
136
|
+
const x = await gh.rest(
|
|
137
|
+
"PUT",
|
|
138
|
+
`repos/${r.full}/branches/${enc(branch)}/protection`,
|
|
139
|
+
{
|
|
140
|
+
body: {
|
|
141
|
+
required_status_checks:
|
|
142
|
+
requiredChecks === undefined
|
|
143
|
+
? null
|
|
144
|
+
: {
|
|
145
|
+
strict: requiredChecks.strict ?? false,
|
|
146
|
+
checks: requiredChecks.checks.map((c) => ({
|
|
147
|
+
context: c.context,
|
|
148
|
+
...(c.appId === undefined ? {} : { app_id: c.appId }),
|
|
149
|
+
})),
|
|
150
|
+
},
|
|
151
|
+
enforce_admins: f.enforceAdmins ?? null,
|
|
152
|
+
required_pull_request_reviews: wantsReviews
|
|
153
|
+
? {
|
|
154
|
+
required_approving_review_count:
|
|
155
|
+
f.requiredApprovingReviewCount ?? 1,
|
|
156
|
+
dismiss_stale_reviews: f.dismissStaleReviews ?? false,
|
|
157
|
+
require_code_owner_reviews:
|
|
158
|
+
f.requireCodeOwnerReviews ?? false,
|
|
159
|
+
}
|
|
160
|
+
: null,
|
|
161
|
+
restrictions:
|
|
162
|
+
restrictions === undefined
|
|
163
|
+
? null
|
|
164
|
+
: {
|
|
165
|
+
users: restrictions.users,
|
|
166
|
+
teams: restrictions.teams,
|
|
167
|
+
apps: restrictions.apps ?? [],
|
|
168
|
+
},
|
|
169
|
+
...Object.fromEntries(
|
|
170
|
+
Object.entries(optional).filter(([, v]) => v !== undefined),
|
|
171
|
+
),
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
);
|
|
175
|
+
return { repo: r.full, branch, ...trim(x) };
|
|
176
|
+
},
|
|
177
|
+
}),
|
|
178
|
+
delete: op({
|
|
179
|
+
description:
|
|
180
|
+
"Remove a branch's classic protection entirely (rulesets stay). Needs admin access.",
|
|
181
|
+
input: s.object({ repo: repoField, branch: branchField }),
|
|
182
|
+
annotations: irreversible,
|
|
183
|
+
run: async ({ repo, branch }) => {
|
|
184
|
+
const r = await gh.repo(repo);
|
|
185
|
+
await gh.rest(
|
|
186
|
+
"DELETE",
|
|
187
|
+
`repos/${r.full}/branches/${enc(branch)}/protection`,
|
|
188
|
+
);
|
|
189
|
+
return { repo: r.full, branch, protected: false };
|
|
190
|
+
},
|
|
191
|
+
}),
|
|
192
|
+
});
|