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,97 @@
|
|
|
1
|
+
// The Salsa20 core, HSalsa20 key derivation and the XSalsa20 stream cipher (24-byte nonce), as NaCl's crypto_box uses them.
|
|
2
|
+
const SIGMA = new TextEncoder().encode("expand 32-byte k");
|
|
3
|
+
|
|
4
|
+
const word = (x: Uint32Array, i: number): number => x[i] ?? 0;
|
|
5
|
+
const rotl = (v: number, n: number): number => (v << n) | (v >>> (32 - n));
|
|
6
|
+
|
|
7
|
+
const quarter = (
|
|
8
|
+
x: Uint32Array,
|
|
9
|
+
a: number,
|
|
10
|
+
b: number,
|
|
11
|
+
c: number,
|
|
12
|
+
d: number,
|
|
13
|
+
) => {
|
|
14
|
+
x[b] = word(x, b) ^ rotl((word(x, a) + word(x, d)) | 0, 7);
|
|
15
|
+
x[c] = word(x, c) ^ rotl((word(x, b) + word(x, a)) | 0, 9);
|
|
16
|
+
x[d] = word(x, d) ^ rotl((word(x, c) + word(x, b)) | 0, 13);
|
|
17
|
+
x[a] = word(x, a) ^ rotl((word(x, d) + word(x, c)) | 0, 18);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const ROUNDS = [
|
|
21
|
+
[0, 4, 8, 12],
|
|
22
|
+
[5, 9, 13, 1],
|
|
23
|
+
[10, 14, 2, 6],
|
|
24
|
+
[15, 3, 7, 11],
|
|
25
|
+
[0, 1, 2, 3],
|
|
26
|
+
[5, 6, 7, 4],
|
|
27
|
+
[10, 11, 8, 9],
|
|
28
|
+
[15, 12, 13, 14],
|
|
29
|
+
] as const;
|
|
30
|
+
|
|
31
|
+
const words = (bytes: Uint8Array): Uint32Array => {
|
|
32
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
33
|
+
return Uint32Array.from({ length: bytes.length / 4 }, (_, i) =>
|
|
34
|
+
view.getUint32(i * 4, true),
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const bytesOf = (w: Uint32Array): Uint8Array => {
|
|
39
|
+
const out = new Uint8Array(w.length * 4);
|
|
40
|
+
const view = new DataView(out.buffer);
|
|
41
|
+
w.forEach((v, i) => view.setUint32(i * 4, v, true));
|
|
42
|
+
return out;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const initial = (key: Uint8Array, input: Uint8Array): Uint32Array => {
|
|
46
|
+
const [c, k, n] = [words(SIGMA), words(key), words(input)];
|
|
47
|
+
return Uint32Array.of(
|
|
48
|
+
word(c, 0),
|
|
49
|
+
...k.subarray(0, 4),
|
|
50
|
+
word(c, 1),
|
|
51
|
+
...n,
|
|
52
|
+
word(c, 2),
|
|
53
|
+
...k.subarray(4, 8),
|
|
54
|
+
word(c, 3),
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const permute = (state: Uint32Array): Uint32Array => {
|
|
59
|
+
const x = state.slice();
|
|
60
|
+
for (let i = 0; i < 10; i++)
|
|
61
|
+
for (const [a, b, c, d] of ROUNDS) quarter(x, a, b, c, d);
|
|
62
|
+
return x;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** Salsa20 block for a 32-byte key and a 16-byte input (8-byte nonce, then a little-endian 64-bit counter). */
|
|
66
|
+
const block = (key: Uint8Array, input: Uint8Array): Uint8Array => {
|
|
67
|
+
const state = initial(key, input);
|
|
68
|
+
const x = permute(state);
|
|
69
|
+
return bytesOf(x.map((v, i) => v + word(state, i)));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const hsalsa20 = (key: Uint8Array, input: Uint8Array): Uint8Array => {
|
|
73
|
+
const x = permute(initial(key, input));
|
|
74
|
+
return bytesOf(
|
|
75
|
+
Uint32Array.from([0, 5, 10, 15, 6, 7, 8, 9], (i) => word(x, i)),
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** XOR `data` with the XSalsa20 keystream for a 32-byte key and a 24-byte nonce, starting at block 0. */
|
|
80
|
+
export const xsalsa20 = (
|
|
81
|
+
key: Uint8Array,
|
|
82
|
+
nonce: Uint8Array,
|
|
83
|
+
data: Uint8Array,
|
|
84
|
+
): Uint8Array => {
|
|
85
|
+
const subkey = hsalsa20(key, nonce.subarray(0, 16));
|
|
86
|
+
const input = new Uint8Array(16);
|
|
87
|
+
input.set(nonce.subarray(16, 24));
|
|
88
|
+
const counter = new DataView(input.buffer);
|
|
89
|
+
const out = new Uint8Array(data.length);
|
|
90
|
+
for (let offset = 0, n = 0; offset < data.length; offset += 64, n++) {
|
|
91
|
+
counter.setBigUint64(8, BigInt(n), true);
|
|
92
|
+
const stream = block(subkey, input);
|
|
93
|
+
for (let i = 0; i < 64 && offset + i < data.length; i++)
|
|
94
|
+
out[offset + i] = (data[offset + i] ?? 0) ^ (stream[i] ?? 0);
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Where an Actions-family secret or variable lives (repository, environment, organization, the user's Codespaces) and who may read an org-level one.
|
|
2
|
+
import { s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, repoField } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { num } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
export const scopeFields = {
|
|
8
|
+
repo: repoField,
|
|
9
|
+
env: s.optional(
|
|
10
|
+
s.string({ description: "Deployment environment of the repo." }),
|
|
11
|
+
),
|
|
12
|
+
org: s.optional(s.string({ description: "Organization login." })),
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const accessFields = {
|
|
16
|
+
visibility: s.optional(
|
|
17
|
+
s.enum(["all", "private", "selected"], {
|
|
18
|
+
description:
|
|
19
|
+
"Organization visibility (default private, or selected when repos is given).",
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
repos: s.optional(
|
|
23
|
+
s.array(s.string(), {
|
|
24
|
+
description:
|
|
25
|
+
"Repositories allowed to read it (name inside the org, or owner/name). Org scope with visibility selected, or user scope.",
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type Where = {
|
|
31
|
+
readonly repo?: string | undefined;
|
|
32
|
+
readonly env?: string | undefined;
|
|
33
|
+
readonly org?: string | undefined;
|
|
34
|
+
readonly user?: boolean | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type Scope =
|
|
38
|
+
| {
|
|
39
|
+
readonly kind: "repo";
|
|
40
|
+
readonly base: string;
|
|
41
|
+
readonly fields: { readonly repo: string };
|
|
42
|
+
}
|
|
43
|
+
| {
|
|
44
|
+
readonly kind: "env";
|
|
45
|
+
readonly base: string;
|
|
46
|
+
readonly fields: { readonly repo: string; readonly env: string };
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
readonly kind: "org";
|
|
50
|
+
readonly base: string;
|
|
51
|
+
readonly fields: { readonly org: string };
|
|
52
|
+
}
|
|
53
|
+
| {
|
|
54
|
+
readonly kind: "user";
|
|
55
|
+
readonly base: string;
|
|
56
|
+
readonly fields: { readonly user: true };
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const usage = (message: string, hint: string) =>
|
|
60
|
+
new SurfaceError("usage", message, hint);
|
|
61
|
+
|
|
62
|
+
export const resolveScope = async (
|
|
63
|
+
gh: GitHub,
|
|
64
|
+
where: Where,
|
|
65
|
+
app: string,
|
|
66
|
+
noun: string,
|
|
67
|
+
): Promise<Scope> => {
|
|
68
|
+
const { env, org, user } = where;
|
|
69
|
+
const chosen = [env, org, user === true ? true : undefined].filter(
|
|
70
|
+
(x) => x !== undefined,
|
|
71
|
+
);
|
|
72
|
+
if (chosen.length > 1)
|
|
73
|
+
throw usage("pass only one of env, org and user", "pick one scope");
|
|
74
|
+
if (org !== undefined)
|
|
75
|
+
return {
|
|
76
|
+
kind: "org",
|
|
77
|
+
base: `orgs/${enc(org)}/${app}/${noun}`,
|
|
78
|
+
fields: { org },
|
|
79
|
+
};
|
|
80
|
+
if (user === true) {
|
|
81
|
+
if (app !== "codespaces")
|
|
82
|
+
throw usage(
|
|
83
|
+
"user secrets exist only for codespaces",
|
|
84
|
+
"omit app or pass app: codespaces",
|
|
85
|
+
);
|
|
86
|
+
return {
|
|
87
|
+
kind: "user",
|
|
88
|
+
base: `user/codespaces/${noun}`,
|
|
89
|
+
fields: { user: true },
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const r = await gh.repo(where.repo);
|
|
93
|
+
if (env === undefined)
|
|
94
|
+
return {
|
|
95
|
+
kind: "repo",
|
|
96
|
+
base: `repos/${r.full}/${app}/${noun}`,
|
|
97
|
+
fields: { repo: r.full },
|
|
98
|
+
};
|
|
99
|
+
if (app !== "actions")
|
|
100
|
+
throw usage(
|
|
101
|
+
"environment secrets and variables exist only for actions",
|
|
102
|
+
"omit app or pass app: actions",
|
|
103
|
+
);
|
|
104
|
+
return {
|
|
105
|
+
kind: "env",
|
|
106
|
+
base: `repos/${r.full}/environments/${enc(env)}/${noun}`,
|
|
107
|
+
fields: { repo: r.full, env },
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const repoIds = (
|
|
112
|
+
gh: GitHub,
|
|
113
|
+
owner: string | undefined,
|
|
114
|
+
repos: readonly string[],
|
|
115
|
+
): Promise<number[]> =>
|
|
116
|
+
Promise.all(
|
|
117
|
+
repos.map(async (name) => {
|
|
118
|
+
if (owner === undefined && !name.includes("/"))
|
|
119
|
+
throw usage(
|
|
120
|
+
`repo ${name} needs its owner`,
|
|
121
|
+
"write repos as owner/name",
|
|
122
|
+
);
|
|
123
|
+
const r = await gh.repo(name.includes("/") ? name : `${owner}/${name}`);
|
|
124
|
+
return num(await gh.rest("GET", `repos/${r.full}`), "id");
|
|
125
|
+
}),
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
export const accessBody = async (
|
|
129
|
+
gh: GitHub,
|
|
130
|
+
scope: Scope,
|
|
131
|
+
visibility: "all" | "private" | "selected" | undefined,
|
|
132
|
+
repos: readonly string[] | undefined,
|
|
133
|
+
): Promise<Readonly<Record<string, unknown>>> => {
|
|
134
|
+
if (scope.kind === "repo" || scope.kind === "env") {
|
|
135
|
+
if (visibility !== undefined || repos !== undefined)
|
|
136
|
+
throw usage(
|
|
137
|
+
"visibility and repos apply to org or user scope only",
|
|
138
|
+
"pass org, or drop them",
|
|
139
|
+
);
|
|
140
|
+
return {};
|
|
141
|
+
}
|
|
142
|
+
if (scope.kind === "user") {
|
|
143
|
+
if (visibility !== undefined)
|
|
144
|
+
throw usage(
|
|
145
|
+
"user secrets have no visibility",
|
|
146
|
+
"pass repos to choose who reads it",
|
|
147
|
+
);
|
|
148
|
+
return repos === undefined
|
|
149
|
+
? {}
|
|
150
|
+
: { selected_repository_ids: await repoIds(gh, undefined, repos) };
|
|
151
|
+
}
|
|
152
|
+
const chosen = visibility ?? (repos === undefined ? "private" : "selected");
|
|
153
|
+
if (chosen !== "selected") {
|
|
154
|
+
if (repos !== undefined)
|
|
155
|
+
throw usage(
|
|
156
|
+
"repos needs visibility selected",
|
|
157
|
+
"drop repos or pass visibility: selected",
|
|
158
|
+
);
|
|
159
|
+
return { visibility: chosen };
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
visibility: chosen,
|
|
163
|
+
selected_repository_ids: await repoIds(gh, scope.fields.org, repos ?? []),
|
|
164
|
+
};
|
|
165
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// libsodium's crypto_box_seal in pure TypeScript, the encryption GitHub requires for a secret value.
|
|
2
|
+
import { createPrivateKey, createPublicKey, diffieHellman } from "node:crypto";
|
|
3
|
+
import { blake2b } from "./blake2b.ts";
|
|
4
|
+
import { poly1305 } from "./poly1305.ts";
|
|
5
|
+
import { hsalsa20, xsalsa20 } from "./salsa20.ts";
|
|
6
|
+
|
|
7
|
+
const KEY_BYTES = 32;
|
|
8
|
+
const PKCS8_X25519 = Buffer.from("302e020100300506032b656e04220420", "hex");
|
|
9
|
+
const SPKI_X25519 = Buffer.from("302a300506032b656e032100", "hex");
|
|
10
|
+
|
|
11
|
+
const privateKey = (secret: Uint8Array) =>
|
|
12
|
+
createPrivateKey({
|
|
13
|
+
key: Buffer.concat([PKCS8_X25519, secret]),
|
|
14
|
+
format: "der",
|
|
15
|
+
type: "pkcs8",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const publicKey = (raw: Uint8Array) =>
|
|
19
|
+
createPublicKey({
|
|
20
|
+
key: Buffer.concat([SPKI_X25519, raw]),
|
|
21
|
+
format: "der",
|
|
22
|
+
type: "spki",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const rawPublicKey = (secret: Uint8Array): Uint8Array =>
|
|
26
|
+
new Uint8Array(
|
|
27
|
+
createPublicKey(privateKey(secret))
|
|
28
|
+
.export({ format: "der", type: "spki" })
|
|
29
|
+
.subarray(SPKI_X25519.length),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
/** crypto_box_easy: XSalsa20-Poly1305 under the HSalsa20 of the X25519 shared secret; output is MAC || ciphertext. */
|
|
33
|
+
const boxEasy = (
|
|
34
|
+
message: Uint8Array,
|
|
35
|
+
nonce: Uint8Array,
|
|
36
|
+
recipient: Uint8Array,
|
|
37
|
+
secret: Uint8Array,
|
|
38
|
+
): Uint8Array => {
|
|
39
|
+
const shared = diffieHellman({
|
|
40
|
+
privateKey: privateKey(secret),
|
|
41
|
+
publicKey: publicKey(recipient),
|
|
42
|
+
});
|
|
43
|
+
const key = hsalsa20(new Uint8Array(shared), new Uint8Array(16));
|
|
44
|
+
const padded = new Uint8Array(KEY_BYTES + message.length);
|
|
45
|
+
padded.set(message, KEY_BYTES);
|
|
46
|
+
const stream = xsalsa20(key, nonce, padded);
|
|
47
|
+
const ciphertext = stream.subarray(KEY_BYTES);
|
|
48
|
+
const out = new Uint8Array(16 + message.length);
|
|
49
|
+
out.set(poly1305(stream.subarray(0, KEY_BYTES), ciphertext));
|
|
50
|
+
out.set(ciphertext, 16);
|
|
51
|
+
return out;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const seal = (
|
|
55
|
+
recipientPublicKey: Uint8Array,
|
|
56
|
+
message: Uint8Array,
|
|
57
|
+
ephemeralSecret: Uint8Array = crypto.getRandomValues(
|
|
58
|
+
new Uint8Array(KEY_BYTES),
|
|
59
|
+
),
|
|
60
|
+
): Uint8Array => {
|
|
61
|
+
if (recipientPublicKey.length !== KEY_BYTES)
|
|
62
|
+
throw new RangeError("recipient public key must be 32 bytes");
|
|
63
|
+
if (ephemeralSecret.length !== KEY_BYTES)
|
|
64
|
+
throw new RangeError("ephemeral secret must be 32 bytes");
|
|
65
|
+
const ephemeral = rawPublicKey(ephemeralSecret);
|
|
66
|
+
const nonceInput = new Uint8Array(2 * KEY_BYTES);
|
|
67
|
+
nonceInput.set(ephemeral);
|
|
68
|
+
nonceInput.set(recipientPublicKey, KEY_BYTES);
|
|
69
|
+
const nonce = blake2b(nonceInput, 24);
|
|
70
|
+
const box = boxEasy(message, nonce, recipientPublicKey, ephemeralSecret);
|
|
71
|
+
const out = new Uint8Array(KEY_BYTES + box.length);
|
|
72
|
+
out.set(ephemeral);
|
|
73
|
+
out.set(box, KEY_BYTES);
|
|
74
|
+
return out;
|
|
75
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Commit search across GitHub: free text plus the qualifiers `gh search commits` turns its flags into.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { limitField, reads } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { arr, at, num, optStr, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const quote = (v: string) => (/\s/.test(v) ? `"${v}"` : v);
|
|
8
|
+
|
|
9
|
+
const commitItem = (c: unknown) => ({
|
|
10
|
+
repo: str(c, "repository", "full_name"),
|
|
11
|
+
sha: str(c, "sha"),
|
|
12
|
+
message: str(c, "commit", "message"),
|
|
13
|
+
author: optStr(c, "author", "login"),
|
|
14
|
+
authorName: optStr(c, "commit", "author", "name"),
|
|
15
|
+
authorDate: optStr(c, "commit", "author", "date"),
|
|
16
|
+
committer: optStr(c, "committer", "login"),
|
|
17
|
+
committerDate: optStr(c, "commit", "committer", "date"),
|
|
18
|
+
url: str(c, "html_url"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const text = (description: string) => s.optional(s.string({ description }));
|
|
22
|
+
const date = text("Date or range: 2024-01-01, >2024-01-01, 2024-01..2024-03.");
|
|
23
|
+
const many = (description: string) =>
|
|
24
|
+
s.optional(s.array(s.string(), { description }));
|
|
25
|
+
|
|
26
|
+
export const commitSearchOp = (gh: GitHub) =>
|
|
27
|
+
op({
|
|
28
|
+
description:
|
|
29
|
+
"Search commits by message text and qualifiers (author, committer, dates, hash, merge, repo, owner, visibility), best match first unless `sort` is set. `total` is null when more than 100 results are requested. Replaces `gh search commits`.",
|
|
30
|
+
input: s.object({
|
|
31
|
+
query: text("Words to find in commit messages."),
|
|
32
|
+
author: text("Author login."),
|
|
33
|
+
authorEmail: s.optional(s.string()),
|
|
34
|
+
authorName: s.optional(s.string()),
|
|
35
|
+
authorDate: date,
|
|
36
|
+
committer: text("Committer login."),
|
|
37
|
+
committerEmail: s.optional(s.string()),
|
|
38
|
+
committerName: s.optional(s.string()),
|
|
39
|
+
committerDate: date,
|
|
40
|
+
hash: s.optional(s.string()),
|
|
41
|
+
parent: text("Parent commit hash."),
|
|
42
|
+
tree: text("Tree hash."),
|
|
43
|
+
merge: s.optional(
|
|
44
|
+
s.boolean({
|
|
45
|
+
description: "true for merge commits only, false to exclude them.",
|
|
46
|
+
}),
|
|
47
|
+
),
|
|
48
|
+
repo: many("owner/name repositories."),
|
|
49
|
+
owner: many("Repository owners (users or organizations)."),
|
|
50
|
+
visibility: s.optional(
|
|
51
|
+
s.array(s.enum(["public", "private", "internal"])),
|
|
52
|
+
),
|
|
53
|
+
sort: s.optional(s.enum(["author-date", "committer-date"])),
|
|
54
|
+
order: s.optional(
|
|
55
|
+
s.enum(["asc", "desc"], { description: "Applies only with sort." }),
|
|
56
|
+
),
|
|
57
|
+
limit: limitField(30),
|
|
58
|
+
}),
|
|
59
|
+
annotations: reads,
|
|
60
|
+
run: async (input) => {
|
|
61
|
+
const single = {
|
|
62
|
+
author: input.author,
|
|
63
|
+
"author-email": input.authorEmail,
|
|
64
|
+
"author-name": input.authorName,
|
|
65
|
+
"author-date": input.authorDate,
|
|
66
|
+
committer: input.committer,
|
|
67
|
+
"committer-email": input.committerEmail,
|
|
68
|
+
"committer-name": input.committerName,
|
|
69
|
+
"committer-date": input.committerDate,
|
|
70
|
+
hash: input.hash,
|
|
71
|
+
parent: input.parent,
|
|
72
|
+
tree: input.tree,
|
|
73
|
+
merge: input.merge === undefined ? undefined : String(input.merge),
|
|
74
|
+
};
|
|
75
|
+
const q = [
|
|
76
|
+
input.query ?? "",
|
|
77
|
+
...Object.entries(single).flatMap(([k, v]) =>
|
|
78
|
+
v === undefined ? [] : [`${k}:${quote(v)}`],
|
|
79
|
+
),
|
|
80
|
+
...(input.repo ?? []).map((v) => `repo:${quote(v)}`),
|
|
81
|
+
...(input.owner ?? []).map((v) => `user:${quote(v)}`),
|
|
82
|
+
...(input.visibility ?? []).map((v) => `is:${v}`),
|
|
83
|
+
]
|
|
84
|
+
.filter(Boolean)
|
|
85
|
+
.join(" ");
|
|
86
|
+
if (q === "")
|
|
87
|
+
throw new SurfaceError(
|
|
88
|
+
"usage",
|
|
89
|
+
"empty commit search",
|
|
90
|
+
"pass query text or at least one qualifier",
|
|
91
|
+
);
|
|
92
|
+
const limit = input.limit ?? 30;
|
|
93
|
+
const query = {
|
|
94
|
+
q,
|
|
95
|
+
...(input.sort === undefined
|
|
96
|
+
? {}
|
|
97
|
+
: { sort: input.sort, order: input.order ?? "desc" }),
|
|
98
|
+
};
|
|
99
|
+
if (limit > 100)
|
|
100
|
+
return {
|
|
101
|
+
total: null,
|
|
102
|
+
items: (
|
|
103
|
+
await gh.list("search/commits", limit, { query, key: "items" })
|
|
104
|
+
).map(commitItem),
|
|
105
|
+
};
|
|
106
|
+
const page = await gh.rest("GET", "search/commits", {
|
|
107
|
+
query: { ...query, per_page: Math.max(1, limit) },
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
total: num(page, "total_count"),
|
|
111
|
+
items: arr(at(page, "items"), "items").map(commitItem),
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { op, s } from "../vendor/surface/index.ts";
|
|
2
|
+
import { limitField, reads } from "./fields.ts";
|
|
3
|
+
import type { GitHub } from "./http.ts";
|
|
4
|
+
import { arr, at, bool, num, optStr, str } from "./read.ts";
|
|
5
|
+
|
|
6
|
+
const issueItem = (i: unknown) => ({
|
|
7
|
+
repo: (optStr(i, "repository_url") ?? "").replace(/^.*\/repos\//, ""),
|
|
8
|
+
number: num(i, "number"),
|
|
9
|
+
title: str(i, "title"),
|
|
10
|
+
state: str(i, "state"),
|
|
11
|
+
isPr: at(i, "pull_request") !== undefined,
|
|
12
|
+
merged: optStr(i, "pull_request", "merged_at") !== null,
|
|
13
|
+
draft: bool(i, "draft"),
|
|
14
|
+
author: optStr(i, "user", "login"),
|
|
15
|
+
url: str(i, "html_url"),
|
|
16
|
+
createdAt: optStr(i, "created_at"),
|
|
17
|
+
updatedAt: optStr(i, "updated_at"),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const searchRaw = async (
|
|
21
|
+
gh: GitHub,
|
|
22
|
+
q: string,
|
|
23
|
+
limit: number,
|
|
24
|
+
): Promise<{ total: number | null; raw: readonly unknown[] }> => {
|
|
25
|
+
const query = { q, sort: "updated", order: "desc" };
|
|
26
|
+
if (limit > 100)
|
|
27
|
+
return {
|
|
28
|
+
total: null,
|
|
29
|
+
raw: await gh.list("search/issues", limit, { query, key: "items" }),
|
|
30
|
+
};
|
|
31
|
+
const page = await gh.rest("GET", "search/issues", {
|
|
32
|
+
query: { ...query, per_page: Math.max(1, limit) },
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
total: num(page, "total_count"),
|
|
36
|
+
raw: arr(at(page, "items"), "items"),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const searchItems = async (gh: GitHub, q: string, limit: number) => {
|
|
41
|
+
const { total, raw } = await searchRaw(gh, q, limit);
|
|
42
|
+
return { total, items: raw.map(issueItem) };
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const scoped = (q: string, repo: string | undefined, extra: string) =>
|
|
46
|
+
[q, repo === undefined ? "" : `repo:${repo}`, extra]
|
|
47
|
+
.filter(Boolean)
|
|
48
|
+
.join(" ");
|
|
49
|
+
|
|
50
|
+
export const searchOps = (gh: GitHub) => ({
|
|
51
|
+
issues: op({
|
|
52
|
+
description:
|
|
53
|
+
"Search issues and pull requests with GitHub search syntax (is:open label:bug author:x ...). `type` narrows to issues or PRs. Replaces `gh search issues` / `gh search prs`.",
|
|
54
|
+
input: s.object({
|
|
55
|
+
query: s.string({ description: "GitHub issue search syntax." }),
|
|
56
|
+
type: s.optional(s.enum(["issue", "pr", "any"])),
|
|
57
|
+
repo: s.optional(s.string({ description: "owner/name to scope to." })),
|
|
58
|
+
limit: limitField(30),
|
|
59
|
+
}),
|
|
60
|
+
annotations: reads,
|
|
61
|
+
run: ({ query, type, repo, limit }) =>
|
|
62
|
+
searchItems(
|
|
63
|
+
gh,
|
|
64
|
+
scoped(
|
|
65
|
+
query,
|
|
66
|
+
repo,
|
|
67
|
+
type === "pr" ? "is:pr" : type === "issue" ? "is:issue" : "",
|
|
68
|
+
),
|
|
69
|
+
limit ?? 30,
|
|
70
|
+
),
|
|
71
|
+
}),
|
|
72
|
+
code: op({
|
|
73
|
+
description:
|
|
74
|
+
"Search code (GitHub code search syntax) with matching fragments. Replaces `gh search code`.",
|
|
75
|
+
input: s.object({
|
|
76
|
+
query: s.string(),
|
|
77
|
+
repo: s.optional(s.string()),
|
|
78
|
+
limit: limitField(20),
|
|
79
|
+
}),
|
|
80
|
+
annotations: reads,
|
|
81
|
+
run: async ({ query, repo, limit }) => {
|
|
82
|
+
const raw = await gh.list("search/code", limit ?? 20, {
|
|
83
|
+
query: { q: scoped(query, repo, "") },
|
|
84
|
+
key: "items",
|
|
85
|
+
accept: "application/vnd.github.text-match+json",
|
|
86
|
+
});
|
|
87
|
+
return raw.map((c) => ({
|
|
88
|
+
repo: str(c, "repository", "full_name"),
|
|
89
|
+
path: str(c, "path"),
|
|
90
|
+
url: str(c, "html_url"),
|
|
91
|
+
fragments: [at(c, "text_matches")].flat().flatMap((m) => {
|
|
92
|
+
const f = optStr(m, "fragment");
|
|
93
|
+
return f === null ? [] : [f];
|
|
94
|
+
}),
|
|
95
|
+
}));
|
|
96
|
+
},
|
|
97
|
+
}),
|
|
98
|
+
repos: op({
|
|
99
|
+
description: "Search repositories. Replaces `gh search repos`.",
|
|
100
|
+
input: s.object({ query: s.string(), limit: limitField(20) }),
|
|
101
|
+
annotations: reads,
|
|
102
|
+
run: async ({ query, limit }) =>
|
|
103
|
+
(
|
|
104
|
+
await gh.list("search/repositories", limit ?? 20, {
|
|
105
|
+
query: { q: query },
|
|
106
|
+
key: "items",
|
|
107
|
+
})
|
|
108
|
+
).map((r) => ({
|
|
109
|
+
repo: str(r, "full_name"),
|
|
110
|
+
description: optStr(r, "description"),
|
|
111
|
+
stars: num(r, "stargazers_count"),
|
|
112
|
+
url: str(r, "html_url"),
|
|
113
|
+
pushedAt: optStr(r, "pushed_at"),
|
|
114
|
+
})),
|
|
115
|
+
}),
|
|
116
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Actions, Codespaces and Dependabot secrets: list, set (sealed locally with the scope's public key) and delete.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, irreversible, reads, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { optStr, str } from "./read.ts";
|
|
6
|
+
import { seal } from "./sealed-box.ts";
|
|
7
|
+
import {
|
|
8
|
+
accessBody,
|
|
9
|
+
accessFields,
|
|
10
|
+
resolveScope,
|
|
11
|
+
scopeFields,
|
|
12
|
+
type Where,
|
|
13
|
+
} from "./scopes.ts";
|
|
14
|
+
|
|
15
|
+
const appField = s.optional(
|
|
16
|
+
s.enum(["actions", "codespaces", "dependabot"], {
|
|
17
|
+
description: "Secret store (default actions, or codespaces with user).",
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
const where = {
|
|
21
|
+
...scopeFields,
|
|
22
|
+
user: s.optional(s.boolean({ description: "Your Codespaces user secrets." })),
|
|
23
|
+
app: appField,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const scopeOf = (
|
|
27
|
+
gh: GitHub,
|
|
28
|
+
w: Where & { readonly app?: string | undefined },
|
|
29
|
+
) => {
|
|
30
|
+
const app = w.app ?? (w.user === true ? "codespaces" : "actions");
|
|
31
|
+
return resolveScope(gh, w, app, "secrets").then((scope) => ({ app, scope }));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const plaintext = async (
|
|
35
|
+
value: string | undefined,
|
|
36
|
+
file: string | undefined,
|
|
37
|
+
): Promise<Uint8Array> => {
|
|
38
|
+
if ((value === undefined) === (file === undefined))
|
|
39
|
+
throw new SurfaceError(
|
|
40
|
+
"usage",
|
|
41
|
+
"pass exactly one of value and file",
|
|
42
|
+
"give the secret inline as value, or a path to read it from as file",
|
|
43
|
+
);
|
|
44
|
+
if (value !== undefined) return new TextEncoder().encode(value);
|
|
45
|
+
const source = Bun.file(file ?? "");
|
|
46
|
+
if (!(await source.exists()))
|
|
47
|
+
throw new SurfaceError("usage", `no such file: ${file}`, "check the path");
|
|
48
|
+
return new Uint8Array(await source.arrayBuffer());
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const sealFor = async (
|
|
52
|
+
gh: GitHub,
|
|
53
|
+
base: string,
|
|
54
|
+
message: Uint8Array,
|
|
55
|
+
): Promise<{ readonly encrypted_value: string; readonly key_id: string }> => {
|
|
56
|
+
const publicKey = await gh.rest("GET", `${base}/public-key`);
|
|
57
|
+
const key = Buffer.from(str(publicKey, "key"), "base64");
|
|
58
|
+
if (key.length !== 32)
|
|
59
|
+
throw new SurfaceError(
|
|
60
|
+
"invalid_response",
|
|
61
|
+
"the scope's public key is not a 32-byte X25519 key",
|
|
62
|
+
"inspect it with `api rest` on the public-key endpoint",
|
|
63
|
+
);
|
|
64
|
+
return {
|
|
65
|
+
encrypted_value: Buffer.from(seal(key, message)).toString("base64"),
|
|
66
|
+
key_id: str(publicKey, "key_id"),
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const secretOps = (gh: GitHub) => ({
|
|
71
|
+
list: op({
|
|
72
|
+
description:
|
|
73
|
+
"Secret names (never values) with their update time, and visibility at org scope. Replaces `gh secret list`.",
|
|
74
|
+
input: s.object(where),
|
|
75
|
+
annotations: reads,
|
|
76
|
+
run: async (input) => {
|
|
77
|
+
const { app, scope } = await scopeOf(gh, input);
|
|
78
|
+
const raw = await gh.list(scope.base, 1000, { key: "secrets" });
|
|
79
|
+
return {
|
|
80
|
+
...scope.fields,
|
|
81
|
+
app,
|
|
82
|
+
items: raw.map((x) => ({
|
|
83
|
+
name: str(x, "name"),
|
|
84
|
+
createdAt: optStr(x, "created_at"),
|
|
85
|
+
updatedAt: optStr(x, "updated_at"),
|
|
86
|
+
visibility: optStr(x, "visibility"),
|
|
87
|
+
})),
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
set: op({
|
|
92
|
+
description:
|
|
93
|
+
"Create or update a secret: the value is encrypted locally with the scope's public key and only the ciphertext is sent; the result never contains it. Replaces `gh secret set`.",
|
|
94
|
+
input: s.object({
|
|
95
|
+
name: s.string(),
|
|
96
|
+
...where,
|
|
97
|
+
value: s.optional(
|
|
98
|
+
s.string({
|
|
99
|
+
description:
|
|
100
|
+
"The secret value. On the CLI pass it through --input, never as a flag.",
|
|
101
|
+
secret: true,
|
|
102
|
+
}),
|
|
103
|
+
),
|
|
104
|
+
file: s.optional(
|
|
105
|
+
s.string({ description: "Path of a file whose bytes are the value." }),
|
|
106
|
+
),
|
|
107
|
+
...accessFields,
|
|
108
|
+
}),
|
|
109
|
+
annotations: writes,
|
|
110
|
+
run: async ({ name, value, file, visibility, repos, ...rest }) => {
|
|
111
|
+
const message = await plaintext(value, file);
|
|
112
|
+
const { app, scope } = await scopeOf(gh, rest);
|
|
113
|
+
const access = await accessBody(gh, scope, visibility, repos);
|
|
114
|
+
const sealed = await sealFor(gh, scope.base, message);
|
|
115
|
+
await gh.rest("PUT", `${scope.base}/${enc(name)}`, {
|
|
116
|
+
body: { ...sealed, ...access },
|
|
117
|
+
});
|
|
118
|
+
return { ...scope.fields, app, name };
|
|
119
|
+
},
|
|
120
|
+
}),
|
|
121
|
+
delete: op({
|
|
122
|
+
description: "Delete a secret. Replaces `gh secret delete`.",
|
|
123
|
+
input: s.object({ name: s.string(), ...where }),
|
|
124
|
+
annotations: irreversible,
|
|
125
|
+
run: async ({ name, ...rest }) => {
|
|
126
|
+
const { app, scope } = await scopeOf(gh, rest);
|
|
127
|
+
await gh.rest("DELETE", `${scope.base}/${enc(name)}`);
|
|
128
|
+
return { ...scope.fields, app, name, deleted: true };
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
});
|