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,130 @@
|
|
|
1
|
+
// Gist writes: create, edit, rename, delete and clone.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, irreversible, writes } from "./fields.ts";
|
|
4
|
+
import {
|
|
5
|
+
contentsOf,
|
|
6
|
+
gistField,
|
|
7
|
+
gistId,
|
|
8
|
+
gistWritten,
|
|
9
|
+
readPaths,
|
|
10
|
+
} from "./gist-shape.ts";
|
|
11
|
+
import type { GitHub } from "./http.ts";
|
|
12
|
+
|
|
13
|
+
export const gistWriteOps = (gh: GitHub) => ({
|
|
14
|
+
create: op({
|
|
15
|
+
description:
|
|
16
|
+
"Create a gist from inline contents and/or local files; secret unless `public`. Replaces `gh gist create`.",
|
|
17
|
+
input: s.object({
|
|
18
|
+
files: s.optional(
|
|
19
|
+
s.record(s.string(), { description: "filename -> content." }),
|
|
20
|
+
),
|
|
21
|
+
paths: s.optional(
|
|
22
|
+
s.array(s.string(), {
|
|
23
|
+
description: "Local files to upload under their base names.",
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
description: s.optional(s.string()),
|
|
27
|
+
public: s.optional(s.boolean()),
|
|
28
|
+
}),
|
|
29
|
+
annotations: writes,
|
|
30
|
+
run: async ({ files, paths, description, public: isPublic }) => {
|
|
31
|
+
const contents = {
|
|
32
|
+
...contentsOf(files ?? {}),
|
|
33
|
+
...(await readPaths(paths ?? [])),
|
|
34
|
+
};
|
|
35
|
+
if (Object.keys(contents).length === 0)
|
|
36
|
+
throw new SurfaceError(
|
|
37
|
+
"usage",
|
|
38
|
+
"a gist needs at least one file",
|
|
39
|
+
"pass files or paths",
|
|
40
|
+
);
|
|
41
|
+
return gistWritten(
|
|
42
|
+
await gh.rest("POST", "gists", {
|
|
43
|
+
body: {
|
|
44
|
+
files: contents,
|
|
45
|
+
public: isPublic ?? false,
|
|
46
|
+
...(description === undefined ? {} : { description }),
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
edit: op({
|
|
53
|
+
description:
|
|
54
|
+
"Change a gist's description, replace or add file contents, add local files, or remove files. Replaces `gh gist edit`.",
|
|
55
|
+
input: s.object({
|
|
56
|
+
id: gistField,
|
|
57
|
+
description: s.optional(s.string()),
|
|
58
|
+
set: s.optional(
|
|
59
|
+
s.record(s.string(), {
|
|
60
|
+
description: "filename -> new content (adds the file if missing).",
|
|
61
|
+
}),
|
|
62
|
+
),
|
|
63
|
+
add: s.optional(
|
|
64
|
+
s.array(s.string(), {
|
|
65
|
+
description: "Local files to add under their base names.",
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
remove: s.optional(s.array(s.string(), { description: "Filenames." })),
|
|
69
|
+
}),
|
|
70
|
+
annotations: writes,
|
|
71
|
+
run: async ({ id, description, set, add, remove }) => {
|
|
72
|
+
const gist = gistId(id);
|
|
73
|
+
const files = {
|
|
74
|
+
...contentsOf(set ?? {}),
|
|
75
|
+
...(await readPaths(add ?? [])),
|
|
76
|
+
...Object.fromEntries((remove ?? []).map((name) => [name, null])),
|
|
77
|
+
};
|
|
78
|
+
if (description === undefined && Object.keys(files).length === 0)
|
|
79
|
+
throw new SurfaceError(
|
|
80
|
+
"usage",
|
|
81
|
+
"nothing to change",
|
|
82
|
+
"pass description, set, add or remove",
|
|
83
|
+
);
|
|
84
|
+
return gistWritten(
|
|
85
|
+
await gh.rest("PATCH", `gists/${enc(gist)}`, {
|
|
86
|
+
body: {
|
|
87
|
+
...(description === undefined ? {} : { description }),
|
|
88
|
+
...(Object.keys(files).length === 0 ? {} : { files }),
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
}),
|
|
94
|
+
rename: op({
|
|
95
|
+
description:
|
|
96
|
+
"Rename one file in a gist, keeping its content. Replaces `gh gist rename`.",
|
|
97
|
+
input: s.object({ id: gistField, from: s.string(), to: s.string() }),
|
|
98
|
+
annotations: writes,
|
|
99
|
+
run: async ({ id, from, to }) =>
|
|
100
|
+
gistWritten(
|
|
101
|
+
await gh.rest("PATCH", `gists/${enc(gistId(id))}`, {
|
|
102
|
+
body: { files: { [from]: { filename: to } } },
|
|
103
|
+
}),
|
|
104
|
+
),
|
|
105
|
+
}),
|
|
106
|
+
delete: op({
|
|
107
|
+
description: "Delete a gist and its history. Replaces `gh gist delete`.",
|
|
108
|
+
input: s.object({ id: gistField }),
|
|
109
|
+
annotations: irreversible,
|
|
110
|
+
run: async ({ id }) => {
|
|
111
|
+
const gist = gistId(id);
|
|
112
|
+
await gh.rest("DELETE", `gists/${enc(gist)}`);
|
|
113
|
+
return { id: gist, deleted: true };
|
|
114
|
+
},
|
|
115
|
+
}),
|
|
116
|
+
clone: op({
|
|
117
|
+
description:
|
|
118
|
+
"Clone a gist's git repository into a local directory. Replaces `gh gist clone`.",
|
|
119
|
+
input: s.object({
|
|
120
|
+
id: gistField,
|
|
121
|
+
dir: s.string({ description: "Directory to clone into." }),
|
|
122
|
+
}),
|
|
123
|
+
annotations: writes,
|
|
124
|
+
run: async ({ id, dir }) => {
|
|
125
|
+
const gist = gistId(id);
|
|
126
|
+
await gh.git(["clone", `https://gist.github.com/${gist}.git`, dir], ".");
|
|
127
|
+
return { id: gist, dir };
|
|
128
|
+
},
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Gists of the authenticated user: list and view here, writes in gists-write.ts.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { enc, limitField, reads } from "./fields.ts";
|
|
4
|
+
import { fileList, gistField, gistId, gistSummary } from "./gist-shape.ts";
|
|
5
|
+
import { gistWriteOps } from "./gists-write.ts";
|
|
6
|
+
import type { GitHub } from "./http.ts";
|
|
7
|
+
import { arr, at, bool, nodes, num, optStr, str } from "./read.ts";
|
|
8
|
+
|
|
9
|
+
const LIST = `query($n: Int!, $after: String, $privacy: GistPrivacy!, $content: Boolean!) {
|
|
10
|
+
viewer { gists(first: $n, after: $after, privacy: $privacy, orderBy: { field: CREATED_AT, direction: DESC }) {
|
|
11
|
+
nodes { name description isPublic updatedAt url files(limit: 300) { name text @include(if: $content) } }
|
|
12
|
+
pageInfo { hasNextPage endCursor }
|
|
13
|
+
} }
|
|
14
|
+
}`;
|
|
15
|
+
|
|
16
|
+
export const gistOps = (gh: GitHub) => ({
|
|
17
|
+
list: op({
|
|
18
|
+
description:
|
|
19
|
+
"Your gists, newest first, optionally only public or secret ones and only those whose description or file names match a regex. Replaces `gh gist list`.",
|
|
20
|
+
input: s.object({
|
|
21
|
+
visibility: s.optional(s.enum(["all", "public", "secret"])),
|
|
22
|
+
filter: s.optional(
|
|
23
|
+
s.string({
|
|
24
|
+
description: "Regex matched against the description and file names.",
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
includeContent: s.optional(
|
|
28
|
+
s.boolean({ description: "Also match the filter against file text." }),
|
|
29
|
+
),
|
|
30
|
+
limit: limitField(10),
|
|
31
|
+
}),
|
|
32
|
+
annotations: reads,
|
|
33
|
+
run: async ({ visibility, filter, includeContent, limit }) => {
|
|
34
|
+
const max = limit ?? 10;
|
|
35
|
+
const pattern = filter === undefined ? undefined : new RegExp(filter);
|
|
36
|
+
const content = pattern !== undefined && includeContent === true;
|
|
37
|
+
const items = [];
|
|
38
|
+
let after: string | null = null;
|
|
39
|
+
do {
|
|
40
|
+
const page: unknown = at(
|
|
41
|
+
await gh.graphql(LIST, {
|
|
42
|
+
n: pattern === undefined ? Math.min(100, max) : 100,
|
|
43
|
+
after,
|
|
44
|
+
privacy: (visibility ?? "all").toUpperCase(),
|
|
45
|
+
content,
|
|
46
|
+
}),
|
|
47
|
+
"viewer",
|
|
48
|
+
"gists",
|
|
49
|
+
);
|
|
50
|
+
for (const g of nodes(page)) {
|
|
51
|
+
const files = arr(at(g, "files") ?? [], "files");
|
|
52
|
+
const fields = [
|
|
53
|
+
optStr(g, "description") ?? "",
|
|
54
|
+
...files.map((f) => str(f, "name")),
|
|
55
|
+
...(content ? files.map((f) => optStr(f, "text") ?? "") : []),
|
|
56
|
+
];
|
|
57
|
+
if (pattern !== undefined && !fields.some((t) => pattern.test(t)))
|
|
58
|
+
continue;
|
|
59
|
+
items.push({
|
|
60
|
+
id: str(g, "name"),
|
|
61
|
+
description: optStr(g, "description"),
|
|
62
|
+
public: bool(g, "isPublic"),
|
|
63
|
+
files: files.map((f) => str(f, "name")),
|
|
64
|
+
updatedAt: str(g, "updatedAt"),
|
|
65
|
+
url: str(g, "url"),
|
|
66
|
+
});
|
|
67
|
+
if (items.length >= max) break;
|
|
68
|
+
}
|
|
69
|
+
after =
|
|
70
|
+
at(page, "pageInfo", "hasNextPage") === true
|
|
71
|
+
? optStr(page, "pageInfo", "endCursor")
|
|
72
|
+
: null;
|
|
73
|
+
} while (after !== null && items.length < max);
|
|
74
|
+
return { items };
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
view: op({
|
|
78
|
+
description:
|
|
79
|
+
"A gist's description, visibility and files with name, size and full content (a file over 1 MB is fetched from its raw URL; one over 10 MB needs `gist clone`). Replaces `gh gist view`.",
|
|
80
|
+
input: s.object({
|
|
81
|
+
id: gistField,
|
|
82
|
+
filename: s.optional(s.string({ description: "Return only this file." })),
|
|
83
|
+
files: s.optional(
|
|
84
|
+
s.boolean({ description: "Return file names and sizes only." }),
|
|
85
|
+
),
|
|
86
|
+
}),
|
|
87
|
+
annotations: reads,
|
|
88
|
+
run: async ({ id, filename, files }) => {
|
|
89
|
+
const g = await gh.rest("GET", `gists/${enc(gistId(id))}`);
|
|
90
|
+
const all = fileList(g).filter(
|
|
91
|
+
(f) => filename === undefined || str(f, "filename") === filename,
|
|
92
|
+
);
|
|
93
|
+
if (filename !== undefined && all.length === 0)
|
|
94
|
+
throw new SurfaceError(
|
|
95
|
+
"not_found",
|
|
96
|
+
`gist has no file named ${filename}`,
|
|
97
|
+
"list its files with `files: true`",
|
|
98
|
+
);
|
|
99
|
+
const content = async (f: unknown): Promise<string> =>
|
|
100
|
+
bool(f, "truncated")
|
|
101
|
+
? new TextDecoder().decode(await gh.content(str(f, "raw_url")))
|
|
102
|
+
: (optStr(f, "content") ?? "");
|
|
103
|
+
return {
|
|
104
|
+
...gistSummary(g),
|
|
105
|
+
files: await Promise.all(
|
|
106
|
+
all.map(async (f) => ({
|
|
107
|
+
name: str(f, "filename"),
|
|
108
|
+
size: num(f, "size"),
|
|
109
|
+
...(files === true
|
|
110
|
+
? {}
|
|
111
|
+
: { content: await content(f), rawUrl: str(f, "raw_url") }),
|
|
112
|
+
})),
|
|
113
|
+
),
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
117
|
+
...gistWriteOps(gh),
|
|
118
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// How a git child process authenticates to GitHub with this SDK's token, so clone and fetch need no gh login
|
|
2
|
+
// and no credential helper of the user's. The token travels only in the child's environment: never in argv,
|
|
3
|
+
// the remote URL or .git/config.
|
|
4
|
+
const TOKEN_VAR = "GITHUB_SDK_GIT_TOKEN";
|
|
5
|
+
const HOSTS = ["github.com", "gist.github.com"] as const;
|
|
6
|
+
const HELPER = `!f() { test "$1" = get && printf 'username=x-access-token\\npassword=%s\\n' "$${TOKEN_VAR}"; }; f`;
|
|
7
|
+
|
|
8
|
+
// Git reads GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n after its config files. An empty helper value clears the
|
|
9
|
+
// helpers configured for that host, so only ours answers and no stored credential is read or rewritten.
|
|
10
|
+
const TOKEN_VARS: ReadonlySet<string> = new Set([
|
|
11
|
+
"GH_TOKEN",
|
|
12
|
+
"GITHUB_TOKEN",
|
|
13
|
+
TOKEN_VAR,
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
// A checkout's hooks, filters and aliases run inside git children, so no git child inherits the
|
|
17
|
+
// token variables this process may hold. `auth` is added back only for a command that reaches the remote.
|
|
18
|
+
export const gitChildEnv = (
|
|
19
|
+
base: Readonly<Record<string, string | undefined>>,
|
|
20
|
+
auth: Readonly<Record<string, string>>,
|
|
21
|
+
): Record<string, string> => ({
|
|
22
|
+
...Object.fromEntries(
|
|
23
|
+
Object.entries(base).flatMap(([name, value]) =>
|
|
24
|
+
value === undefined || TOKEN_VARS.has(name) ? [] : [[name, value]],
|
|
25
|
+
),
|
|
26
|
+
),
|
|
27
|
+
...auth,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const gitAuthEnv = (token: string): Record<string, string> => {
|
|
31
|
+
const pairs = HOSTS.flatMap((host) => [
|
|
32
|
+
[`credential.https://${host}.helper`, ""],
|
|
33
|
+
[`credential.https://${host}.helper`, HELPER],
|
|
34
|
+
]);
|
|
35
|
+
return {
|
|
36
|
+
[TOKEN_VAR]: token,
|
|
37
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
38
|
+
GIT_CONFIG_COUNT: String(pairs.length),
|
|
39
|
+
...Object.fromEntries(
|
|
40
|
+
pairs.flatMap(([key, value], i) => [
|
|
41
|
+
[`GIT_CONFIG_KEY_${i}`, key],
|
|
42
|
+
[`GIT_CONFIG_VALUE_${i}`, value],
|
|
43
|
+
]),
|
|
44
|
+
),
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// One GitHub transport for every operation: JSON calls, pagination, GraphQL, downloads, uploads and local git.
|
|
2
|
+
import { SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { parseRepo } from "./env.ts";
|
|
4
|
+
import { gitAuthEnv, gitChildEnv } from "./git-auth.ts";
|
|
5
|
+
import { at, isObj, optStr } from "./read.ts";
|
|
6
|
+
import { createTransfer } from "./transfer.ts";
|
|
7
|
+
import type { Deps, GitHub } from "./types.ts";
|
|
8
|
+
import { createWire } from "./wire.ts";
|
|
9
|
+
|
|
10
|
+
export type {
|
|
11
|
+
Deps,
|
|
12
|
+
Fetch,
|
|
13
|
+
GitHub,
|
|
14
|
+
GitResult,
|
|
15
|
+
Method,
|
|
16
|
+
Repo,
|
|
17
|
+
Request,
|
|
18
|
+
} from "./types.ts";
|
|
19
|
+
|
|
20
|
+
// Only these git commands talk to the remote. Every other one (checkout, merge, config) can run the
|
|
21
|
+
// checkout's hooks and filter drivers, so it gets no token.
|
|
22
|
+
const REMOTE_COMMANDS: ReadonlySet<string> = new Set(["clone", "fetch"]);
|
|
23
|
+
|
|
24
|
+
const nextLink = (link: string | null): string | undefined =>
|
|
25
|
+
link
|
|
26
|
+
?.split(",")
|
|
27
|
+
.find((part) => /rel="next"/.test(part))
|
|
28
|
+
?.match(/<([^>]+)>/)?.[1];
|
|
29
|
+
|
|
30
|
+
export const createGitHub = (deps: Deps): GitHub => {
|
|
31
|
+
const wire = createWire(deps);
|
|
32
|
+
const { url, send, fail, decode, redact } = wire;
|
|
33
|
+
|
|
34
|
+
const rest: GitHub["rest"] = async (method, path, req = {}) => {
|
|
35
|
+
const target = url(path, req.query);
|
|
36
|
+
const res = await send(method, target, req);
|
|
37
|
+
if (!res.ok) return fail(method, target, res);
|
|
38
|
+
return decode(res);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const list: GitHub["list"] = async (path, limit, req = {}) => {
|
|
42
|
+
const out: unknown[] = [];
|
|
43
|
+
let target: URL | undefined = url(path, {
|
|
44
|
+
...req.query,
|
|
45
|
+
per_page: Math.min(100, Math.max(1, limit)),
|
|
46
|
+
});
|
|
47
|
+
while (target && out.length < limit) {
|
|
48
|
+
const res = await send("GET", target, req);
|
|
49
|
+
if (!res.ok) return fail("GET", target, res);
|
|
50
|
+
const body = await decode(res);
|
|
51
|
+
const page = req.key === undefined ? body : at(body, req.key);
|
|
52
|
+
if (!Array.isArray(page))
|
|
53
|
+
throw new SurfaceError(
|
|
54
|
+
"invalid_response",
|
|
55
|
+
`${target.pathname} did not return a list`,
|
|
56
|
+
"inspect it with `api rest`",
|
|
57
|
+
);
|
|
58
|
+
out.push(...page);
|
|
59
|
+
const next = nextLink(res.headers.get("link"));
|
|
60
|
+
target =
|
|
61
|
+
next === undefined || page.length === 0 ? undefined : new URL(next);
|
|
62
|
+
}
|
|
63
|
+
return out.slice(0, limit);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const text: GitHub["text"] = async (path, accept) => {
|
|
67
|
+
const target = url(path, undefined);
|
|
68
|
+
const res = await send("GET", target, { accept });
|
|
69
|
+
if (!res.ok) return fail("GET", target, res);
|
|
70
|
+
return res.text();
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const headers: GitHub["headers"] = async (path) => {
|
|
74
|
+
const target = url(path, undefined);
|
|
75
|
+
const res = await send("GET", target, {});
|
|
76
|
+
if (!res.ok) return fail("GET", target, res);
|
|
77
|
+
return res.headers;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const graphql: GitHub["graphql"] = async (query, variables) => {
|
|
81
|
+
const body = await rest("POST", "graphql", { body: { query, variables } });
|
|
82
|
+
const errors = at(body, "errors");
|
|
83
|
+
if (Array.isArray(errors) && errors.length > 0) {
|
|
84
|
+
const first = errors[0];
|
|
85
|
+
const type = optStr(first, "type") ?? "";
|
|
86
|
+
const message = errors.map((e) => optStr(e, "message") ?? "").join("; ");
|
|
87
|
+
const kind =
|
|
88
|
+
type === "NOT_FOUND"
|
|
89
|
+
? "not_found"
|
|
90
|
+
: type === "FORBIDDEN"
|
|
91
|
+
? "forbidden"
|
|
92
|
+
: "graphql";
|
|
93
|
+
throw new SurfaceError(
|
|
94
|
+
kind,
|
|
95
|
+
await redact(message),
|
|
96
|
+
kind === "not_found"
|
|
97
|
+
? "check owner/name and number"
|
|
98
|
+
: "fix the query or its variables",
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
const data = at(body, "data");
|
|
102
|
+
if (!isObj(data))
|
|
103
|
+
throw new SurfaceError(
|
|
104
|
+
"invalid_response",
|
|
105
|
+
"GraphQL response had no data",
|
|
106
|
+
"inspect it with `api graphql`",
|
|
107
|
+
);
|
|
108
|
+
return data;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const repo: GitHub["repo"] = async (given) => {
|
|
112
|
+
const source = given ?? (await deps.originRepo());
|
|
113
|
+
const parsed = source === undefined ? undefined : parseRepo(source);
|
|
114
|
+
if (parsed) return parsed;
|
|
115
|
+
throw new SurfaceError(
|
|
116
|
+
"usage",
|
|
117
|
+
given === undefined
|
|
118
|
+
? "no repo given and the current directory has no GitHub origin"
|
|
119
|
+
: `not a GitHub repo: ${given}`,
|
|
120
|
+
"pass repo as owner/name",
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const git: GitHub["git"] = async (args, cwd) => {
|
|
125
|
+
const res = await deps.git(
|
|
126
|
+
args,
|
|
127
|
+
cwd,
|
|
128
|
+
gitChildEnv(
|
|
129
|
+
deps.env(),
|
|
130
|
+
REMOTE_COMMANDS.has(args[0] ?? "")
|
|
131
|
+
? gitAuthEnv(await deps.token())
|
|
132
|
+
: {},
|
|
133
|
+
),
|
|
134
|
+
);
|
|
135
|
+
if (res.code !== 0)
|
|
136
|
+
throw new SurfaceError(
|
|
137
|
+
"git",
|
|
138
|
+
await redact(
|
|
139
|
+
`git ${args[0] ?? ""} exited ${res.code}: ${res.stderr.trim().slice(-400)}`,
|
|
140
|
+
),
|
|
141
|
+
"run the same git command in that directory to see the cause",
|
|
142
|
+
);
|
|
143
|
+
return res.stdout;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
rest,
|
|
148
|
+
list,
|
|
149
|
+
text,
|
|
150
|
+
headers,
|
|
151
|
+
graphql,
|
|
152
|
+
repo,
|
|
153
|
+
git,
|
|
154
|
+
redact,
|
|
155
|
+
...createTransfer(deps, wire),
|
|
156
|
+
now: deps.now,
|
|
157
|
+
sleep: deps.sleep,
|
|
158
|
+
};
|
|
159
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Branches linked to an issue: listing them and creating one on GitHub.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { numberField, repoField, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub, Repo } from "./http.ts";
|
|
5
|
+
import { at, nodes, str } from "./read.ts";
|
|
6
|
+
|
|
7
|
+
const LINKED = `query($owner:String!,$name:String!,$number:Int!){repository(owner:$owner,name:$name){issue(number:$number){
|
|
8
|
+
linkedBranches(first:100){nodes{ref{name target{oid} repository{nameWithOwner}}}}}}}`;
|
|
9
|
+
|
|
10
|
+
const TARGET = `query($owner:String!,$name:String!,$number:Int!,$bOwner:String!,$bName:String!,$base:String!,$hasBase:Boolean!){
|
|
11
|
+
repository(owner:$owner,name:$name){issue(number:$number){id}}
|
|
12
|
+
target:repository(owner:$bOwner,name:$bName){id defaultBranchRef{name target{oid}} ref(qualifiedName:$base) @include(if:$hasBase){name target{oid}}}}`;
|
|
13
|
+
|
|
14
|
+
const CREATE = `mutation($issue:ID!,$oid:GitObjectID!,$name:String,$repo:ID!){createLinkedBranch(input:{issueId:$issue,oid:$oid,name:$name,repositoryId:$repo}){
|
|
15
|
+
linkedBranch{ref{name target{oid} repository{nameWithOwner}}}}}`;
|
|
16
|
+
|
|
17
|
+
const branchOf = (ref: unknown) => {
|
|
18
|
+
const repo = str(ref, "repository", "nameWithOwner");
|
|
19
|
+
const name = str(ref, "name");
|
|
20
|
+
return {
|
|
21
|
+
name,
|
|
22
|
+
repo,
|
|
23
|
+
headSha: str(ref, "target", "oid"),
|
|
24
|
+
url: `https://github.com/${repo}/tree/${name}`,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const issueMissing = (r: Repo, number: number) =>
|
|
29
|
+
new SurfaceError(
|
|
30
|
+
"not_found",
|
|
31
|
+
`no issue #${number} in ${r.full}`,
|
|
32
|
+
"check the number",
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export const developOp = (gh: GitHub) =>
|
|
36
|
+
op({
|
|
37
|
+
description:
|
|
38
|
+
"With list, the branches linked to an issue; otherwise create a branch on GitHub linked to the issue, from `base` (default: the branch repo's default branch) in `branchRepo` (default: the issue's repo). Nothing is checked out locally; use git or `pr checkout` for that. Replaces `gh issue develop`.",
|
|
39
|
+
input: s.object({
|
|
40
|
+
repo: repoField,
|
|
41
|
+
number: numberField,
|
|
42
|
+
list: s.optional(s.boolean()),
|
|
43
|
+
name: s.optional(
|
|
44
|
+
s.string({ description: "Branch name (GitHub picks one if omitted)." }),
|
|
45
|
+
),
|
|
46
|
+
base: s.optional(s.string({ description: "Branch to start from." })),
|
|
47
|
+
branchRepo: s.optional(
|
|
48
|
+
s.string({ description: "owner/name to create the branch in." }),
|
|
49
|
+
),
|
|
50
|
+
}),
|
|
51
|
+
annotations: writes,
|
|
52
|
+
run: async ({ repo, number, list, name, base, branchRepo }) => {
|
|
53
|
+
if (
|
|
54
|
+
list === true &&
|
|
55
|
+
(name !== undefined || base !== undefined || branchRepo !== undefined)
|
|
56
|
+
)
|
|
57
|
+
throw new SurfaceError(
|
|
58
|
+
"usage",
|
|
59
|
+
"list cannot be combined with name, base or branchRepo",
|
|
60
|
+
"drop list to create a branch",
|
|
61
|
+
);
|
|
62
|
+
const r = await gh.repo(repo);
|
|
63
|
+
if (list === true) {
|
|
64
|
+
const data = await gh.graphql(LINKED, {
|
|
65
|
+
owner: r.owner,
|
|
66
|
+
name: r.name,
|
|
67
|
+
number,
|
|
68
|
+
});
|
|
69
|
+
const issue = at(data, "repository", "issue");
|
|
70
|
+
if (issue === null || issue === undefined)
|
|
71
|
+
throw issueMissing(r, number);
|
|
72
|
+
return {
|
|
73
|
+
repo: r.full,
|
|
74
|
+
number,
|
|
75
|
+
items: nodes(issue, "linkedBranches").map((n) =>
|
|
76
|
+
branchOf(at(n, "ref")),
|
|
77
|
+
),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const b = branchRepo === undefined ? r : await gh.repo(branchRepo);
|
|
81
|
+
const data = await gh.graphql(TARGET, {
|
|
82
|
+
owner: r.owner,
|
|
83
|
+
name: r.name,
|
|
84
|
+
number,
|
|
85
|
+
bOwner: b.owner,
|
|
86
|
+
bName: b.name,
|
|
87
|
+
base: `refs/heads/${base ?? ""}`,
|
|
88
|
+
hasBase: base !== undefined,
|
|
89
|
+
});
|
|
90
|
+
const issueId = at(data, "repository", "issue", "id");
|
|
91
|
+
if (typeof issueId !== "string") throw issueMissing(r, number);
|
|
92
|
+
const from = at(
|
|
93
|
+
data,
|
|
94
|
+
"target",
|
|
95
|
+
base === undefined ? "defaultBranchRef" : "ref",
|
|
96
|
+
);
|
|
97
|
+
if (from === null || from === undefined)
|
|
98
|
+
throw new SurfaceError(
|
|
99
|
+
"not_found",
|
|
100
|
+
`no branch ${base ?? "(default)"} in ${b.full}`,
|
|
101
|
+
"check base and branchRepo",
|
|
102
|
+
);
|
|
103
|
+
const created = await gh.graphql(CREATE, {
|
|
104
|
+
issue: issueId,
|
|
105
|
+
oid: str(from, "target", "oid"),
|
|
106
|
+
repo: str(data, "target", "id"),
|
|
107
|
+
...(name === undefined ? {} : { name }),
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
repo: r.full,
|
|
111
|
+
number,
|
|
112
|
+
base: str(from, "name"),
|
|
113
|
+
branch: branchOf(
|
|
114
|
+
at(created, "createLinkedBranch", "linkedBranch", "ref"),
|
|
115
|
+
),
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
});
|