oh-my-opencode 5.1.84 → 5.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/command/remove-deadcode.md +1 -1
- package/.agents/skills/remove-deadcode/SKILL.md +1 -1
- package/.agents/skills/work-with-pr/SKILL.md +2 -2
- package/.opencode/command/remove-deadcode.md +1 -1
- package/.opencode/skills/work-with-pr/SKILL.md +2 -2
- package/THIRD-PARTY-NOTICES.md +9 -3
- package/dist/cli/index.js +1022 -842
- package/dist/cli/service-auth/devices.d.ts +5 -2
- package/dist/cli-node/index.js +1022 -842
- package/dist/config/schema/agent-names.d.ts +1 -0
- package/dist/index.js +180 -205
- package/dist/skills/browser/SKILL.md +4 -1
- package/dist/skills/browser/references/commands.md +5 -2
- package/dist/skills/browser/references/desktop.md +1 -0
- package/dist/skills/browser/references/owned-engine/README.md +2 -0
- package/dist/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/dist/skills/browser/references/owned-engine/network.md +10 -5
- package/dist/skills/browser/references/recipes/1password.md +2 -0
- package/dist/skills/browser/runtime/omowright/index.js +11 -11
- package/dist/skills/browser/runtime/omowright/manifest.json +4 -4
- package/dist/skills/debugging/SKILL.md +1 -1
- package/dist/skills/git/SKILL.md +62 -0
- package/dist/skills/git/agents/openai.yaml +13 -0
- package/dist/skills/github/SKILL.md +94 -0
- package/dist/skills/github/references/branch-rules.md +129 -0
- package/dist/skills/github/references/evidence-attachments.md +16 -0
- package/dist/skills/github/references/repo-setup.md +152 -0
- package/dist/skills/github/references/waiting.md +52 -0
- package/dist/skills/github/references/workflows.md +161 -0
- package/dist/skills/github/scripts/cli.ts +8 -0
- package/dist/skills/github/scripts/package.json +12 -0
- package/dist/skills/github/scripts/sdk.ts +11 -0
- package/dist/skills/github/scripts/src/account.ts +243 -0
- package/dist/skills/github/scripts/src/actions-write.ts +86 -0
- package/dist/skills/github/scripts/src/actions.ts +210 -0
- package/dist/skills/github/scripts/src/attestations.ts +136 -0
- package/dist/skills/github/scripts/src/blake2b.ts +102 -0
- package/dist/skills/github/scripts/src/branch-protection.ts +192 -0
- package/dist/skills/github/scripts/src/caches.ts +105 -0
- package/dist/skills/github/scripts/src/checks.ts +107 -0
- package/dist/skills/github/scripts/src/codespaces.ts +230 -0
- package/dist/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/dist/skills/github/scripts/src/discussion-list.ts +126 -0
- package/dist/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/dist/skills/github/scripts/src/discussions.ts +234 -0
- package/dist/skills/github/scripts/src/env.ts +100 -0
- package/dist/skills/github/scripts/src/errors.ts +79 -0
- package/dist/skills/github/scripts/src/fields.ts +27 -0
- package/dist/skills/github/scripts/src/gist-shape.ts +58 -0
- package/dist/skills/github/scripts/src/gists-write.ts +130 -0
- package/dist/skills/github/scripts/src/gists.ts +118 -0
- package/dist/skills/github/scripts/src/git-auth.ts +46 -0
- package/dist/skills/github/scripts/src/http.ts +159 -0
- package/dist/skills/github/scripts/src/issue-develop.ts +118 -0
- package/dist/skills/github/scripts/src/issues-extra.ts +135 -0
- package/dist/skills/github/scripts/src/issues-write.ts +174 -0
- package/dist/skills/github/scripts/src/issues.ts +156 -0
- package/dist/skills/github/scripts/src/keys.ts +176 -0
- package/dist/skills/github/scripts/src/labels.ts +209 -0
- package/dist/skills/github/scripts/src/merge.ts +115 -0
- package/dist/skills/github/scripts/src/poly1305.ts +22 -0
- package/dist/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/dist/skills/github/scripts/src/pr-view.ts +106 -0
- package/dist/skills/github/scripts/src/project-fields.ts +144 -0
- package/dist/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/dist/skills/github/scripts/src/project-items.ts +191 -0
- package/dist/skills/github/scripts/src/project-links.ts +104 -0
- package/dist/skills/github/scripts/src/project-ref.ts +145 -0
- package/dist/skills/github/scripts/src/project-state.ts +99 -0
- package/dist/skills/github/scripts/src/projects.ts +158 -0
- package/dist/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/dist/skills/github/scripts/src/pulls-read.ts +176 -0
- package/dist/skills/github/scripts/src/pulls-review.ts +206 -0
- package/dist/skills/github/scripts/src/pulls-write.ts +187 -0
- package/dist/skills/github/scripts/src/raw.ts +78 -0
- package/dist/skills/github/scripts/src/read.ts +77 -0
- package/dist/skills/github/scripts/src/release-assets.ts +111 -0
- package/dist/skills/github/scripts/src/release-download.ts +151 -0
- package/dist/skills/github/scripts/src/release-write.ts +197 -0
- package/dist/skills/github/scripts/src/repo-admin.ts +112 -0
- package/dist/skills/github/scripts/src/repo-content.ts +187 -0
- package/dist/skills/github/scripts/src/repo-create.ts +139 -0
- package/dist/skills/github/scripts/src/repo-extras.ts +217 -0
- package/dist/skills/github/scripts/src/repo-list.ts +143 -0
- package/dist/skills/github/scripts/src/repo-settings.ts +176 -0
- package/dist/skills/github/scripts/src/repo-sync.ts +81 -0
- package/dist/skills/github/scripts/src/repo-url.ts +104 -0
- package/dist/skills/github/scripts/src/repos.ts +87 -0
- package/dist/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/dist/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/dist/skills/github/scripts/src/rulesets.ts +80 -0
- package/dist/skills/github/scripts/src/run-download.ts +88 -0
- package/dist/skills/github/scripts/src/salsa20.ts +97 -0
- package/dist/skills/github/scripts/src/scopes.ts +165 -0
- package/dist/skills/github/scripts/src/sealed-box.ts +75 -0
- package/dist/skills/github/scripts/src/search-commits.ts +114 -0
- package/dist/skills/github/scripts/src/search.ts +116 -0
- package/dist/skills/github/scripts/src/secrets.ts +131 -0
- package/dist/skills/github/scripts/src/snappy.ts +57 -0
- package/dist/skills/github/scripts/src/status-search.ts +55 -0
- package/dist/skills/github/scripts/src/transfer.ts +97 -0
- package/dist/skills/github/scripts/src/types.ts +75 -0
- package/dist/skills/github/scripts/src/variables.ts +86 -0
- package/dist/skills/github/scripts/src/wait.ts +164 -0
- package/dist/skills/github/scripts/src/wire.ts +159 -0
- package/dist/skills/github/scripts/src/workflows.ts +144 -0
- package/dist/skills/github/scripts/src/zip.ts +104 -0
- package/dist/skills/github/scripts/surface.ts +106 -0
- package/dist/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/dist/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/dist/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/dist/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/dist/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/dist/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/dist/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/dist/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/dist/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/dist/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/dist/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/dist/skills/programming/SKILL.md +1 -1
- package/dist/skills/ulw-execute/SKILL.md +1 -1
- package/dist/tui.js +30 -27
- package/package.json +28 -26
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +3 -3
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/browser/SKILL.md +4 -1
- package/packages/omo-codex/plugin/skills/browser/references/commands.md +5 -2
- package/packages/omo-codex/plugin/skills/browser/references/desktop.md +1 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/README.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/references/owned-engine/network.md +10 -5
- package/packages/omo-codex/plugin/skills/browser/references/recipes/1password.md +2 -0
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/index.js +11 -11
- package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/omo-codex/plugin/skills/debugging/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/git/SKILL.md +62 -0
- package/packages/omo-codex/plugin/skills/git/agents/openai.yaml +13 -0
- package/packages/omo-codex/plugin/skills/github/SKILL.md +94 -0
- package/packages/omo-codex/plugin/skills/github/agents/openai.yaml +2 -0
- package/packages/omo-codex/plugin/skills/github/references/branch-rules.md +129 -0
- package/packages/omo-codex/plugin/skills/github/references/evidence-attachments.md +16 -0
- package/packages/omo-codex/plugin/skills/github/references/repo-setup.md +152 -0
- package/packages/omo-codex/plugin/skills/github/references/waiting.md +52 -0
- package/packages/omo-codex/plugin/skills/github/references/workflows.md +161 -0
- package/packages/omo-codex/plugin/skills/github/scripts/cli.ts +8 -0
- package/packages/omo-codex/plugin/skills/github/scripts/package.json +12 -0
- package/packages/omo-codex/plugin/skills/github/scripts/sdk.ts +11 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/account.ts +243 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/actions-write.ts +86 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/actions.ts +210 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/attestations.ts +136 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/blake2b.ts +102 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/branch-protection.ts +192 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/caches.ts +105 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/checks.ts +107 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/codespaces.ts +230 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-list.ts +126 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/discussions.ts +234 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/env.ts +100 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/errors.ts +79 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/fields.ts +27 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gist-shape.ts +58 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gists-write.ts +130 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/gists.ts +118 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/git-auth.ts +46 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/http.ts +159 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issue-develop.ts +118 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues-extra.ts +135 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues-write.ts +174 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/issues.ts +156 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/keys.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/labels.ts +209 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/merge.ts +115 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/poly1305.ts +22 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pr-view.ts +106 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-fields.ts +144 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-items.ts +191 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-links.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-ref.ts +145 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/project-state.ts +99 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/projects.ts +158 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-read.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-review.ts +206 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/pulls-write.ts +187 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/raw.ts +78 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/read.ts +77 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-assets.ts +111 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-download.ts +151 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/release-write.ts +197 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-admin.ts +112 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-content.ts +187 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-create.ts +139 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-extras.ts +217 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-list.ts +143 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-settings.ts +176 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-sync.ts +81 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repo-url.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/repos.ts +87 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/rulesets.ts +80 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/run-download.ts +88 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/salsa20.ts +97 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/scopes.ts +165 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/sealed-box.ts +75 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/search-commits.ts +114 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/search.ts +116 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/secrets.ts +131 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/snappy.ts +57 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/status-search.ts +55 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/transfer.ts +97 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/types.ts +75 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/variables.ts +86 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/wait.ts +164 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/wire.ts +159 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/workflows.ts +144 -0
- package/packages/omo-codex/plugin/skills/github/scripts/src/zip.ts +104 -0
- package/packages/omo-codex/plugin/skills/github/scripts/surface.ts +106 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/packages/omo-codex/plugin/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +3 -3
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +1 -1
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -1
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +5 -5
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +20 -15
- package/packages/shared-skills/skills/browser/SKILL.md +4 -1
- package/packages/shared-skills/skills/browser/references/commands.md +5 -2
- package/packages/shared-skills/skills/browser/references/desktop.md +1 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/README.md +2 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/frames-and-humans.md +2 -0
- package/packages/shared-skills/skills/browser/references/owned-engine/network.md +10 -5
- package/packages/shared-skills/skills/browser/references/recipes/1password.md +2 -0
- package/packages/shared-skills/skills/browser/runtime/omowright/index.js +11 -11
- package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +4 -4
- package/packages/shared-skills/skills/debugging/SKILL.md +1 -1
- package/packages/shared-skills/skills/git/SKILL.md +62 -0
- package/packages/shared-skills/skills/git/agents/openai.yaml +13 -0
- package/packages/shared-skills/skills/github/SKILL.md +94 -0
- package/packages/shared-skills/skills/github/references/branch-rules.md +129 -0
- package/packages/shared-skills/skills/github/references/evidence-attachments.md +16 -0
- package/packages/shared-skills/skills/github/references/repo-setup.md +152 -0
- package/packages/shared-skills/skills/github/references/waiting.md +52 -0
- package/packages/shared-skills/skills/github/references/workflows.md +161 -0
- package/packages/shared-skills/skills/github/scripts/cli.ts +8 -0
- package/packages/shared-skills/skills/github/scripts/package.json +12 -0
- package/packages/shared-skills/skills/github/scripts/sdk.ts +11 -0
- package/packages/shared-skills/skills/github/scripts/src/account.ts +243 -0
- package/packages/shared-skills/skills/github/scripts/src/actions-write.ts +86 -0
- package/packages/shared-skills/skills/github/scripts/src/actions.ts +210 -0
- package/packages/shared-skills/skills/github/scripts/src/attestations.ts +136 -0
- package/packages/shared-skills/skills/github/scripts/src/blake2b.ts +102 -0
- package/packages/shared-skills/skills/github/scripts/src/branch-protection.ts +192 -0
- package/packages/shared-skills/skills/github/scripts/src/caches.ts +105 -0
- package/packages/shared-skills/skills/github/scripts/src/checks.ts +107 -0
- package/packages/shared-skills/skills/github/scripts/src/codespaces.ts +230 -0
- package/packages/shared-skills/skills/github/scripts/src/conversation-lock.ts +50 -0
- package/packages/shared-skills/skills/github/scripts/src/discussion-list.ts +126 -0
- package/packages/shared-skills/skills/github/scripts/src/discussion-lookup.ts +127 -0
- package/packages/shared-skills/skills/github/scripts/src/discussions.ts +234 -0
- package/packages/shared-skills/skills/github/scripts/src/env.ts +100 -0
- package/packages/shared-skills/skills/github/scripts/src/errors.ts +79 -0
- package/packages/shared-skills/skills/github/scripts/src/fields.ts +27 -0
- package/packages/shared-skills/skills/github/scripts/src/gist-shape.ts +58 -0
- package/packages/shared-skills/skills/github/scripts/src/gists-write.ts +130 -0
- package/packages/shared-skills/skills/github/scripts/src/gists.ts +118 -0
- package/packages/shared-skills/skills/github/scripts/src/git-auth.ts +46 -0
- package/packages/shared-skills/skills/github/scripts/src/http.ts +159 -0
- package/packages/shared-skills/skills/github/scripts/src/issue-develop.ts +118 -0
- package/packages/shared-skills/skills/github/scripts/src/issues-extra.ts +135 -0
- package/packages/shared-skills/skills/github/scripts/src/issues-write.ts +174 -0
- package/packages/shared-skills/skills/github/scripts/src/issues.ts +156 -0
- package/packages/shared-skills/skills/github/scripts/src/keys.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/labels.ts +209 -0
- package/packages/shared-skills/skills/github/scripts/src/merge.ts +115 -0
- package/packages/shared-skills/skills/github/scripts/src/poly1305.ts +22 -0
- package/packages/shared-skills/skills/github/scripts/src/pr-checkout.ts +92 -0
- package/packages/shared-skills/skills/github/scripts/src/pr-view.ts +106 -0
- package/packages/shared-skills/skills/github/scripts/src/project-fields.ts +144 -0
- package/packages/shared-skills/skills/github/scripts/src/project-item-edit.ts +153 -0
- package/packages/shared-skills/skills/github/scripts/src/project-items.ts +191 -0
- package/packages/shared-skills/skills/github/scripts/src/project-links.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/src/project-ref.ts +145 -0
- package/packages/shared-skills/skills/github/scripts/src/project-state.ts +99 -0
- package/packages/shared-skills/skills/github/scripts/src/projects.ts +158 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-extra.ts +165 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-read.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-review.ts +206 -0
- package/packages/shared-skills/skills/github/scripts/src/pulls-write.ts +187 -0
- package/packages/shared-skills/skills/github/scripts/src/raw.ts +78 -0
- package/packages/shared-skills/skills/github/scripts/src/read.ts +77 -0
- package/packages/shared-skills/skills/github/scripts/src/release-assets.ts +111 -0
- package/packages/shared-skills/skills/github/scripts/src/release-download.ts +151 -0
- package/packages/shared-skills/skills/github/scripts/src/release-write.ts +197 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-admin.ts +112 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-content.ts +187 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-create.ts +139 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-extras.ts +217 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-list.ts +143 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-settings.ts +176 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-sync.ts +81 -0
- package/packages/shared-skills/skills/github/scripts/src/repo-url.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/src/repos.ts +87 -0
- package/packages/shared-skills/skills/github/scripts/src/ruleset-shape.ts +96 -0
- package/packages/shared-skills/skills/github/scripts/src/rulesets-write.ts +124 -0
- package/packages/shared-skills/skills/github/scripts/src/rulesets.ts +80 -0
- package/packages/shared-skills/skills/github/scripts/src/run-download.ts +88 -0
- package/packages/shared-skills/skills/github/scripts/src/salsa20.ts +97 -0
- package/packages/shared-skills/skills/github/scripts/src/scopes.ts +165 -0
- package/packages/shared-skills/skills/github/scripts/src/sealed-box.ts +75 -0
- package/packages/shared-skills/skills/github/scripts/src/search-commits.ts +114 -0
- package/packages/shared-skills/skills/github/scripts/src/search.ts +116 -0
- package/packages/shared-skills/skills/github/scripts/src/secrets.ts +131 -0
- package/packages/shared-skills/skills/github/scripts/src/snappy.ts +57 -0
- package/packages/shared-skills/skills/github/scripts/src/status-search.ts +55 -0
- package/packages/shared-skills/skills/github/scripts/src/transfer.ts +97 -0
- package/packages/shared-skills/skills/github/scripts/src/types.ts +75 -0
- package/packages/shared-skills/skills/github/scripts/src/variables.ts +86 -0
- package/packages/shared-skills/skills/github/scripts/src/wait.ts +164 -0
- package/packages/shared-skills/skills/github/scripts/src/wire.ts +159 -0
- package/packages/shared-skills/skills/github/scripts/src/workflows.ts +144 -0
- package/packages/shared-skills/skills/github/scripts/src/zip.ts +104 -0
- package/packages/shared-skills/skills/github/scripts/surface.ts +106 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/SOURCE.json +15 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/cli.ts +203 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/flags.ts +195 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/help.ts +89 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/http.ts +180 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/index.ts +44 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/mcp.ts +241 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/schema.ts +200 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/stdio.ts +54 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/surface.ts +250 -0
- package/packages/shared-skills/skills/github/scripts/vendor/surface/tools.ts +80 -0
- package/packages/shared-skills/skills/programming/SKILL.md +1 -1
- package/packages/shared-skills/skills/ulw-execute/SKILL.md +1 -1
- package/dist/skills/git-master/SKILL.md +0 -114
- package/dist/skills/git-master/agents/openai.yaml +0 -13
- package/packages/omo-codex/plugin/skills/git-master/SKILL.md +0 -114
- package/packages/omo-codex/plugin/skills/git-master/agents/openai.yaml +0 -13
- package/packages/shared-skills/skills/git-master/SKILL.md +0 -114
- package/packages/shared-skills/skills/git-master/agents/openai.yaml +0 -13
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Editing one project item: set or clear one field value, and retitle or rewrite a draft issue.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import {
|
|
6
|
+
itemIdField,
|
|
7
|
+
missing,
|
|
8
|
+
mutate,
|
|
9
|
+
ownerField,
|
|
10
|
+
projectGraphql,
|
|
11
|
+
projectNumberField,
|
|
12
|
+
projectQuery,
|
|
13
|
+
} from "./project-ref.ts";
|
|
14
|
+
import { at, optStr, str } from "./read.ts";
|
|
15
|
+
|
|
16
|
+
const usage = (message: string, hint: string) =>
|
|
17
|
+
new SurfaceError("usage", message, hint);
|
|
18
|
+
|
|
19
|
+
const resolveField = async (
|
|
20
|
+
gh: GitHub,
|
|
21
|
+
owner: string,
|
|
22
|
+
number: number,
|
|
23
|
+
name: string | undefined,
|
|
24
|
+
) => {
|
|
25
|
+
const { project } = await projectQuery(
|
|
26
|
+
gh,
|
|
27
|
+
owner,
|
|
28
|
+
number,
|
|
29
|
+
name === undefined
|
|
30
|
+
? ""
|
|
31
|
+
: "field(name: $field) { ... on ProjectV2FieldCommon { id } }",
|
|
32
|
+
name === undefined
|
|
33
|
+
? {}
|
|
34
|
+
: { decl: "$field: String!", vars: { field: name } },
|
|
35
|
+
);
|
|
36
|
+
return {
|
|
37
|
+
projectId: str(project, "id"),
|
|
38
|
+
fieldId: optStr(project, "field", "id"),
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const draftIssueId = async (gh: GitHub, itemId: string) => {
|
|
43
|
+
const data = await projectGraphql(
|
|
44
|
+
gh,
|
|
45
|
+
"query($id: ID!) { node(id: $id) { ... on ProjectV2Item { content { ... on DraftIssue { id } } } } }",
|
|
46
|
+
{ id: itemId },
|
|
47
|
+
);
|
|
48
|
+
const id = optStr(data, "node", "content", "id");
|
|
49
|
+
if (id === null)
|
|
50
|
+
throw usage(
|
|
51
|
+
`item ${itemId} is not a draft issue`,
|
|
52
|
+
"title and body only apply to draft issue items; edit an issue or PR with issue.edit / pr.edit",
|
|
53
|
+
);
|
|
54
|
+
return id;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const itemEditOp = (gh: GitHub) =>
|
|
58
|
+
op({
|
|
59
|
+
description:
|
|
60
|
+
"Set one field value on a project item (by field name or id), clear it, or change a draft issue's title/body. Replaces `gh project item-edit`.",
|
|
61
|
+
input: s.object({
|
|
62
|
+
owner: ownerField,
|
|
63
|
+
number: projectNumberField,
|
|
64
|
+
id: itemIdField,
|
|
65
|
+
field: s.optional(s.string({ description: "Field name to update." })),
|
|
66
|
+
fieldId: s.optional(s.string({ description: "Field id (PVTF_...)." })),
|
|
67
|
+
text: s.optional(s.string()),
|
|
68
|
+
numberValue: s.optional(
|
|
69
|
+
s.number({ description: "Value for a NUMBER field." }),
|
|
70
|
+
),
|
|
71
|
+
date: s.optional(s.string({ description: "YYYY-MM-DD." })),
|
|
72
|
+
singleSelectOptionId: s.optional(s.string()),
|
|
73
|
+
iterationId: s.optional(s.string()),
|
|
74
|
+
clear: s.optional(s.boolean({ description: "Remove the field value." })),
|
|
75
|
+
title: s.optional(s.string({ description: "Draft issue title." })),
|
|
76
|
+
body: s.optional(s.string({ description: "Draft issue body." })),
|
|
77
|
+
}),
|
|
78
|
+
annotations: writes,
|
|
79
|
+
run: async (input) => {
|
|
80
|
+
const { owner, number, id, field, fieldId, clear, title, body } = input;
|
|
81
|
+
const value = Object.fromEntries(
|
|
82
|
+
Object.entries({
|
|
83
|
+
text: input.text,
|
|
84
|
+
number: input.numberValue,
|
|
85
|
+
date: input.date,
|
|
86
|
+
singleSelectOptionId: input.singleSelectOptionId,
|
|
87
|
+
iterationId: input.iterationId,
|
|
88
|
+
}).filter(([, v]) => v !== undefined),
|
|
89
|
+
);
|
|
90
|
+
const changes = Object.keys(value).length + (clear === true ? 1 : 0);
|
|
91
|
+
const named = field !== undefined || fieldId !== undefined;
|
|
92
|
+
const draft = title !== undefined || body !== undefined;
|
|
93
|
+
if (field !== undefined && fieldId !== undefined)
|
|
94
|
+
throw usage("pass field or fieldId, not both", "name the field once");
|
|
95
|
+
if (changes > 1)
|
|
96
|
+
throw usage("one field value per call", "pass a single value or clear");
|
|
97
|
+
if (named !== (changes === 1))
|
|
98
|
+
throw usage(
|
|
99
|
+
named
|
|
100
|
+
? "a field needs a value or clear"
|
|
101
|
+
: "a value needs field or fieldId",
|
|
102
|
+
"pass field (or fieldId) together with one value or clear",
|
|
103
|
+
);
|
|
104
|
+
if (!named && !draft)
|
|
105
|
+
throw usage(
|
|
106
|
+
"nothing to change",
|
|
107
|
+
"pass a field value, clear, title or body",
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const result: Record<string, unknown> = { id };
|
|
111
|
+
if (named) {
|
|
112
|
+
const ref = await resolveField(gh, owner, number, field);
|
|
113
|
+
const target = fieldId ?? ref.fieldId;
|
|
114
|
+
if (target === null) throw missing(`field "${field ?? ""}"`);
|
|
115
|
+
const keys = { projectId: ref.projectId, itemId: id, fieldId: target };
|
|
116
|
+
await (clear === true
|
|
117
|
+
? mutate(
|
|
118
|
+
gh,
|
|
119
|
+
"clearProjectV2ItemFieldValue",
|
|
120
|
+
keys,
|
|
121
|
+
"projectV2Item { id }",
|
|
122
|
+
)
|
|
123
|
+
: mutate(
|
|
124
|
+
gh,
|
|
125
|
+
"updateProjectV2ItemFieldValue",
|
|
126
|
+
{ ...keys, value },
|
|
127
|
+
"projectV2Item { id }",
|
|
128
|
+
));
|
|
129
|
+
Object.assign(result, {
|
|
130
|
+
fieldId: target,
|
|
131
|
+
value: clear === true ? null : value,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
if (draft) {
|
|
135
|
+
const draftId = await draftIssueId(gh, id);
|
|
136
|
+
const d = await mutate(
|
|
137
|
+
gh,
|
|
138
|
+
"updateProjectV2DraftIssue",
|
|
139
|
+
{
|
|
140
|
+
draftIssueId: draftId,
|
|
141
|
+
...(title === undefined ? {} : { title }),
|
|
142
|
+
...(body === undefined ? {} : { body }),
|
|
143
|
+
},
|
|
144
|
+
"draftIssue { id title body }",
|
|
145
|
+
);
|
|
146
|
+
Object.assign(result, {
|
|
147
|
+
title: str(d, "draftIssue", "title"),
|
|
148
|
+
body: optStr(at(d, "draftIssue"), "body"),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
},
|
|
153
|
+
});
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// Project (v2) items: list with field values, add issues/PRs, create drafts, archive and delete.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { irreversible, limitField, reads, writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import { itemEditOp } from "./project-item-edit.ts";
|
|
6
|
+
import {
|
|
7
|
+
collect,
|
|
8
|
+
itemIdField,
|
|
9
|
+
mutate,
|
|
10
|
+
ownerField,
|
|
11
|
+
pageInfo,
|
|
12
|
+
projectGraphql,
|
|
13
|
+
projectNumberField,
|
|
14
|
+
projectQuery,
|
|
15
|
+
resolveProject,
|
|
16
|
+
} from "./project-ref.ts";
|
|
17
|
+
import { at, bool, nodes, optNum, optStr, str } from "./read.ts";
|
|
18
|
+
|
|
19
|
+
const NAME = "field { ... on ProjectV2FieldCommon { name } }";
|
|
20
|
+
// Issue.state and PullRequest.state are different enums, so they need distinct response names.
|
|
21
|
+
const ITEM = `id type isArchived
|
|
22
|
+
content {
|
|
23
|
+
... on DraftIssue { id title body }
|
|
24
|
+
... on Issue { id number title url issueState: state repository { nameWithOwner } }
|
|
25
|
+
... on PullRequest { id number title url prState: state repository { nameWithOwner } }
|
|
26
|
+
}
|
|
27
|
+
fieldValues(first: 30) { nodes {
|
|
28
|
+
... on ProjectV2ItemFieldTextValue { text ${NAME} }
|
|
29
|
+
... on ProjectV2ItemFieldNumberValue { number ${NAME} }
|
|
30
|
+
... on ProjectV2ItemFieldDateValue { date ${NAME} }
|
|
31
|
+
... on ProjectV2ItemFieldSingleSelectValue { name optionId ${NAME} }
|
|
32
|
+
... on ProjectV2ItemFieldIterationValue { title iterationId ${NAME} }
|
|
33
|
+
} }`;
|
|
34
|
+
|
|
35
|
+
const fieldValue = (v: unknown): string | number | null =>
|
|
36
|
+
optStr(v, "text") ??
|
|
37
|
+
optNum(v, "number") ??
|
|
38
|
+
optStr(v, "date") ??
|
|
39
|
+
optStr(v, "name") ??
|
|
40
|
+
optStr(v, "title");
|
|
41
|
+
|
|
42
|
+
const item = (x: unknown) => {
|
|
43
|
+
const c = at(x, "content");
|
|
44
|
+
return {
|
|
45
|
+
id: str(x, "id"),
|
|
46
|
+
type: str(x, "type"),
|
|
47
|
+
archived: bool(x, "isArchived"),
|
|
48
|
+
contentId: optStr(c, "id"),
|
|
49
|
+
title: optStr(c, "title"),
|
|
50
|
+
number: optNum(c, "number"),
|
|
51
|
+
state: optStr(c, "issueState") ?? optStr(c, "prState"),
|
|
52
|
+
repo: optStr(c, "repository", "nameWithOwner"),
|
|
53
|
+
url: optStr(c, "url"),
|
|
54
|
+
fields: Object.fromEntries(
|
|
55
|
+
nodes(x, "fieldValues").flatMap((v) => {
|
|
56
|
+
const name = optStr(v, "field", "name");
|
|
57
|
+
const value = fieldValue(v);
|
|
58
|
+
return name === null || value === null ? [] : [[name, value]];
|
|
59
|
+
}),
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const itemInput = { owner: ownerField, number: projectNumberField };
|
|
65
|
+
|
|
66
|
+
export const projectItemOps = (gh: GitHub) => ({
|
|
67
|
+
itemList: op({
|
|
68
|
+
description:
|
|
69
|
+
"Items of a project with their issue/PR/draft content and field values by field name. Replaces `gh project item-list`.",
|
|
70
|
+
input: s.object({
|
|
71
|
+
...itemInput,
|
|
72
|
+
query: s.optional(
|
|
73
|
+
s.string({
|
|
74
|
+
description:
|
|
75
|
+
'Projects filter syntax, e.g. "assignee:octocat -status:Done".',
|
|
76
|
+
}),
|
|
77
|
+
),
|
|
78
|
+
limit: limitField(30),
|
|
79
|
+
}),
|
|
80
|
+
annotations: reads,
|
|
81
|
+
run: async ({ owner, number, query, limit }) => {
|
|
82
|
+
let login = owner;
|
|
83
|
+
const raw = await collect(limit ?? 30, async (first, after) => {
|
|
84
|
+
const r = await projectQuery(
|
|
85
|
+
gh,
|
|
86
|
+
owner,
|
|
87
|
+
number,
|
|
88
|
+
`items(first: $first, after: $after, query: $query) { nodes { ${ITEM} } ${pageInfo} }`,
|
|
89
|
+
{
|
|
90
|
+
decl: "$first: Int!, $after: String, $query: String",
|
|
91
|
+
vars: { first, after, query: query ?? null },
|
|
92
|
+
},
|
|
93
|
+
);
|
|
94
|
+
login = r.login;
|
|
95
|
+
return at(r.project, "items");
|
|
96
|
+
});
|
|
97
|
+
return { owner: login, number, items: raw.map(item) };
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
itemAdd: op({
|
|
101
|
+
description:
|
|
102
|
+
"Add an issue or pull request to a project by its URL; adding one already there returns the existing item. Replaces `gh project item-add`.",
|
|
103
|
+
input: s.object({
|
|
104
|
+
...itemInput,
|
|
105
|
+
url: s.string({ description: "Issue or pull request URL." }),
|
|
106
|
+
}),
|
|
107
|
+
annotations: writes,
|
|
108
|
+
run: async ({ owner, number, url }) => {
|
|
109
|
+
const data = await projectGraphql(
|
|
110
|
+
gh,
|
|
111
|
+
"query($url: URI!) { resource(url: $url) { ... on Issue { id } ... on PullRequest { id } } }",
|
|
112
|
+
{ url },
|
|
113
|
+
);
|
|
114
|
+
const contentId = optStr(data, "resource", "id");
|
|
115
|
+
if (contentId === null)
|
|
116
|
+
throw new SurfaceError(
|
|
117
|
+
"not_found",
|
|
118
|
+
`${url} is not an issue or pull request this token can see`,
|
|
119
|
+
"pass the full github.com URL of an issue or pull request",
|
|
120
|
+
);
|
|
121
|
+
const { id } = await resolveProject(gh, owner, number);
|
|
122
|
+
const result = await mutate(
|
|
123
|
+
gh,
|
|
124
|
+
"addProjectV2ItemById",
|
|
125
|
+
{ projectId: id, contentId },
|
|
126
|
+
`item { ${ITEM} }`,
|
|
127
|
+
);
|
|
128
|
+
return item(at(result, "item"));
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
itemCreate: op({
|
|
132
|
+
description:
|
|
133
|
+
"Create a draft issue item in a project. Replaces `gh project item-create`.",
|
|
134
|
+
input: s.object({
|
|
135
|
+
...itemInput,
|
|
136
|
+
title: s.string(),
|
|
137
|
+
body: s.optional(s.string()),
|
|
138
|
+
}),
|
|
139
|
+
annotations: writes,
|
|
140
|
+
run: async ({ owner, number, title, body }) => {
|
|
141
|
+
const { id } = await resolveProject(gh, owner, number);
|
|
142
|
+
const result = await mutate(
|
|
143
|
+
gh,
|
|
144
|
+
"addProjectV2DraftIssue",
|
|
145
|
+
{ projectId: id, title, ...(body === undefined ? {} : { body }) },
|
|
146
|
+
`projectItem { ${ITEM} }`,
|
|
147
|
+
);
|
|
148
|
+
return item(at(result, "projectItem"));
|
|
149
|
+
},
|
|
150
|
+
}),
|
|
151
|
+
itemEdit: itemEditOp(gh),
|
|
152
|
+
itemArchive: op({
|
|
153
|
+
description:
|
|
154
|
+
"Archive a project item, or restore it with `undo`. Replaces `gh project item-archive [--undo]`.",
|
|
155
|
+
input: s.object({
|
|
156
|
+
...itemInput,
|
|
157
|
+
id: itemIdField,
|
|
158
|
+
undo: s.optional(s.boolean({ description: "true to unarchive." })),
|
|
159
|
+
}),
|
|
160
|
+
annotations: writes,
|
|
161
|
+
run: async ({ owner, number, id, undo }) => {
|
|
162
|
+
const p = await resolveProject(gh, owner, number);
|
|
163
|
+
const result = await mutate(
|
|
164
|
+
gh,
|
|
165
|
+
undo === true ? "unarchiveProjectV2Item" : "archiveProjectV2Item",
|
|
166
|
+
{ projectId: p.id, itemId: id },
|
|
167
|
+
"item { id isArchived }",
|
|
168
|
+
);
|
|
169
|
+
return {
|
|
170
|
+
id: str(result, "item", "id"),
|
|
171
|
+
archived: bool(result, "item", "isArchived"),
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
itemDelete: op({
|
|
176
|
+
description:
|
|
177
|
+
"Remove an item from a project (a draft issue is destroyed; an issue or PR itself stays). Replaces `gh project item-delete`.",
|
|
178
|
+
input: s.object({ ...itemInput, id: itemIdField }),
|
|
179
|
+
annotations: irreversible,
|
|
180
|
+
run: async ({ owner, number, id }) => {
|
|
181
|
+
const p = await resolveProject(gh, owner, number);
|
|
182
|
+
const result = await mutate(
|
|
183
|
+
gh,
|
|
184
|
+
"deleteProjectV2Item",
|
|
185
|
+
{ projectId: p.id, itemId: id },
|
|
186
|
+
"deletedItemId",
|
|
187
|
+
);
|
|
188
|
+
return { id: str(result, "deletedItemId"), deleted: true };
|
|
189
|
+
},
|
|
190
|
+
}),
|
|
191
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Linking a project to a repository or an organization team, and undoing it.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import {
|
|
6
|
+
mutate,
|
|
7
|
+
ownerField,
|
|
8
|
+
projectGraphql,
|
|
9
|
+
projectNumberField,
|
|
10
|
+
resolveProject,
|
|
11
|
+
} from "./project-ref.ts";
|
|
12
|
+
import { at, str } from "./read.ts";
|
|
13
|
+
|
|
14
|
+
const target = async (
|
|
15
|
+
gh: GitHub,
|
|
16
|
+
owner: string,
|
|
17
|
+
repo: string | undefined,
|
|
18
|
+
team: string | undefined,
|
|
19
|
+
) => {
|
|
20
|
+
if (repo !== undefined && team !== undefined)
|
|
21
|
+
throw new SurfaceError(
|
|
22
|
+
"usage",
|
|
23
|
+
"pass repo or team, not both",
|
|
24
|
+
"link one target per call",
|
|
25
|
+
);
|
|
26
|
+
if (team !== undefined) {
|
|
27
|
+
if (owner === "@me")
|
|
28
|
+
throw new SurfaceError(
|
|
29
|
+
"usage",
|
|
30
|
+
"teams belong to organizations; @me has none",
|
|
31
|
+
"pass the organization login as owner",
|
|
32
|
+
);
|
|
33
|
+
const data = await projectGraphql(
|
|
34
|
+
gh,
|
|
35
|
+
"query($org: String!, $slug: String!) { organization(login: $org) { team(slug: $slug) { id slug } } }",
|
|
36
|
+
{ org: owner, slug: team },
|
|
37
|
+
);
|
|
38
|
+
if (at(data, "organization", "team") == null)
|
|
39
|
+
throw new SurfaceError(
|
|
40
|
+
"not_found",
|
|
41
|
+
`team ${owner}/${team} not found`,
|
|
42
|
+
"pass the team slug of the project's organization",
|
|
43
|
+
);
|
|
44
|
+
return {
|
|
45
|
+
kind: "team",
|
|
46
|
+
id: str(data, "organization", "team", "id"),
|
|
47
|
+
name: `${owner}/${team}`,
|
|
48
|
+
} as const;
|
|
49
|
+
}
|
|
50
|
+
const r = await gh.repo(repo);
|
|
51
|
+
const data = await projectGraphql(
|
|
52
|
+
gh,
|
|
53
|
+
"query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { id } }",
|
|
54
|
+
{ owner: r.owner, name: r.name },
|
|
55
|
+
);
|
|
56
|
+
return {
|
|
57
|
+
kind: "repo",
|
|
58
|
+
id: str(data, "repository", "id"),
|
|
59
|
+
name: r.full,
|
|
60
|
+
} as const;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const linkOp = (gh: GitHub, action: "link" | "unlink") =>
|
|
64
|
+
op({
|
|
65
|
+
description:
|
|
66
|
+
action === "link"
|
|
67
|
+
? "Link a project to a repository (default: the current repo) or to an organization team. Replaces `gh project link`."
|
|
68
|
+
: "Unlink a project from a repository (default: the current repo) or from an organization team. Replaces `gh project unlink`.",
|
|
69
|
+
input: s.object({
|
|
70
|
+
owner: ownerField,
|
|
71
|
+
number: projectNumberField,
|
|
72
|
+
repo: s.optional(
|
|
73
|
+
s.string({
|
|
74
|
+
description:
|
|
75
|
+
"owner/name to link. Defaults to the git origin of the current directory.",
|
|
76
|
+
}),
|
|
77
|
+
),
|
|
78
|
+
team: s.optional(
|
|
79
|
+
s.string({ description: "Team slug in the owner organization." }),
|
|
80
|
+
),
|
|
81
|
+
}),
|
|
82
|
+
annotations: writes,
|
|
83
|
+
run: async ({ owner, number, repo, team }) => {
|
|
84
|
+
const to = await target(gh, owner, repo, team);
|
|
85
|
+
const project = await resolveProject(gh, owner, number);
|
|
86
|
+
const verb =
|
|
87
|
+
action === "link" ? "linkProjectV2To" : "unlinkProjectV2From";
|
|
88
|
+
const noun = to.kind === "team" ? "Team" : "Repository";
|
|
89
|
+
await mutate(
|
|
90
|
+
gh,
|
|
91
|
+
`${verb}${noun}`,
|
|
92
|
+
{
|
|
93
|
+
projectId: project.id,
|
|
94
|
+
[to.kind === "team" ? "teamId" : "repositoryId"]: to.id,
|
|
95
|
+
},
|
|
96
|
+
to.kind === "team" ? "team { id }" : "repository { id }",
|
|
97
|
+
);
|
|
98
|
+
return {
|
|
99
|
+
projectId: project.id,
|
|
100
|
+
[to.kind === "team" ? "team" : "repo"]: to.name,
|
|
101
|
+
linked: action === "link",
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
});
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// Shared plumbing for Projects (v2): owner/number addressing, the project node id lookup, paging and the scope hint.
|
|
2
|
+
import { s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import type { GitHub } from "./http.ts";
|
|
4
|
+
import { at, bool, nodes, num, optStr, str, type Json } from "./read.ts";
|
|
5
|
+
|
|
6
|
+
export const ownerField = s.string({
|
|
7
|
+
description:
|
|
8
|
+
'Project owner: a user or organization login, or "@me" for the authenticated user.',
|
|
9
|
+
});
|
|
10
|
+
export const projectNumberField = s.integer({
|
|
11
|
+
description: "Project number (the one in the project URL).",
|
|
12
|
+
});
|
|
13
|
+
export const itemIdField = s.string({
|
|
14
|
+
description: "Project item node id (PVTI_...), as returned by itemList.",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const scopeHint =
|
|
18
|
+
"the token needs the `project` scope (`read:project` for reads): run `gh auth refresh -s project` or mint a token with it";
|
|
19
|
+
|
|
20
|
+
// GitHub's INSUFFICIENT_SCOPES arrives from gh.graphql as a plain `graphql` error with a "fix the query" hint.
|
|
21
|
+
export const projectGraphql = async (
|
|
22
|
+
gh: GitHub,
|
|
23
|
+
query: string,
|
|
24
|
+
variables: Json,
|
|
25
|
+
): Promise<Json> => {
|
|
26
|
+
try {
|
|
27
|
+
return await gh.graphql(query, variables);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
if (
|
|
30
|
+
error instanceof SurfaceError &&
|
|
31
|
+
error.kind === "graphql" &&
|
|
32
|
+
/required scopes/.test(error.message)
|
|
33
|
+
)
|
|
34
|
+
throw new SurfaceError("forbidden", error.message, scopeHint);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const ownerRoot = (owner: string) =>
|
|
40
|
+
owner === "@me"
|
|
41
|
+
? { root: "viewer", decl: "", vars: {} }
|
|
42
|
+
: {
|
|
43
|
+
root: "repositoryOwner(login: $login)",
|
|
44
|
+
decl: "$login: String!",
|
|
45
|
+
vars: { login: owner },
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const declare = (...decls: readonly string[]): string => {
|
|
49
|
+
const list = decls.filter(Boolean).join(", ");
|
|
50
|
+
return list === "" ? "" : `(${list})`;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const missing = (what: string): SurfaceError =>
|
|
54
|
+
new SurfaceError(
|
|
55
|
+
"not_found",
|
|
56
|
+
`${what} not found`,
|
|
57
|
+
'check owner (a login or "@me") and the project number',
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const resolveOwner = async (gh: GitHub, owner: string) => {
|
|
61
|
+
const o = ownerRoot(owner);
|
|
62
|
+
const data = await projectGraphql(
|
|
63
|
+
gh,
|
|
64
|
+
`query${declare(o.decl)} { owner: ${o.root} { id login } }`,
|
|
65
|
+
o.vars,
|
|
66
|
+
);
|
|
67
|
+
if (at(data, "owner") == null) throw missing(`owner ${owner}`);
|
|
68
|
+
return { id: str(data, "owner", "id"), login: str(data, "owner", "login") };
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const projectQuery = async (
|
|
72
|
+
gh: GitHub,
|
|
73
|
+
owner: string,
|
|
74
|
+
number: number,
|
|
75
|
+
selection = "",
|
|
76
|
+
extra: { readonly decl?: string; readonly vars?: Json } = {},
|
|
77
|
+
) => {
|
|
78
|
+
const o = ownerRoot(owner);
|
|
79
|
+
const data = await projectGraphql(
|
|
80
|
+
gh,
|
|
81
|
+
`query${declare("$number: Int!", o.decl, extra.decl ?? "")} { owner: ${o.root} { login ... on ProjectV2Owner { projectV2(number: $number) { id title ${selection} } } } }`,
|
|
82
|
+
{ number, ...o.vars, ...extra.vars },
|
|
83
|
+
);
|
|
84
|
+
const project = at(data, "owner", "projectV2");
|
|
85
|
+
if (project == null) throw missing(`project ${owner}/${number}`);
|
|
86
|
+
return { login: str(data, "owner", "login"), project };
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const resolveProject = async (
|
|
90
|
+
gh: GitHub,
|
|
91
|
+
owner: string,
|
|
92
|
+
number: number,
|
|
93
|
+
) => {
|
|
94
|
+
const { project } = await projectQuery(gh, owner, number);
|
|
95
|
+
return { id: str(project, "id"), title: str(project, "title") };
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const collect = async (
|
|
99
|
+
limit: number,
|
|
100
|
+
page: (first: number, after: string | null) => Promise<unknown>,
|
|
101
|
+
keep: (node: unknown) => boolean = () => true,
|
|
102
|
+
): Promise<unknown[]> => {
|
|
103
|
+
const out: unknown[] = [];
|
|
104
|
+
let after: string | null = null;
|
|
105
|
+
while (out.length < limit) {
|
|
106
|
+
const conn = await page(Math.min(100, limit - out.length), after);
|
|
107
|
+
out.push(...nodes(conn).filter(keep));
|
|
108
|
+
after = optStr(conn, "pageInfo", "endCursor");
|
|
109
|
+
if (!bool(conn, "pageInfo", "hasNextPage") || after === null) break;
|
|
110
|
+
}
|
|
111
|
+
return out.slice(0, limit);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const mutate = async (
|
|
115
|
+
gh: GitHub,
|
|
116
|
+
name: string,
|
|
117
|
+
input: Json,
|
|
118
|
+
selection: string,
|
|
119
|
+
): Promise<unknown> => {
|
|
120
|
+
const inputType = `${name.charAt(0).toUpperCase()}${name.slice(1)}Input`;
|
|
121
|
+
const data = await projectGraphql(
|
|
122
|
+
gh,
|
|
123
|
+
`mutation($input: ${inputType}!) { result: ${name}(input: $input) { ${selection} } }`,
|
|
124
|
+
{ input },
|
|
125
|
+
);
|
|
126
|
+
return at(data, "result");
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const pageInfo = "pageInfo { hasNextPage endCursor }";
|
|
130
|
+
|
|
131
|
+
export const PROJECT_FIELDS =
|
|
132
|
+
"id number title shortDescription public closed template url createdAt updatedAt";
|
|
133
|
+
|
|
134
|
+
export const projectSummary = (x: unknown) => ({
|
|
135
|
+
id: str(x, "id"),
|
|
136
|
+
number: num(x, "number"),
|
|
137
|
+
title: str(x, "title"),
|
|
138
|
+
description: optStr(x, "shortDescription"),
|
|
139
|
+
public: bool(x, "public"),
|
|
140
|
+
closed: bool(x, "closed"),
|
|
141
|
+
template: bool(x, "template"),
|
|
142
|
+
url: str(x, "url"),
|
|
143
|
+
createdAt: optStr(x, "createdAt"),
|
|
144
|
+
updatedAt: optStr(x, "updatedAt"),
|
|
145
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Changing an existing project: title, description, readme and visibility; closed; template mark.
|
|
2
|
+
import { op, s, SurfaceError } from "../vendor/surface/index.ts";
|
|
3
|
+
import { writes } from "./fields.ts";
|
|
4
|
+
import type { GitHub } from "./http.ts";
|
|
5
|
+
import {
|
|
6
|
+
mutate,
|
|
7
|
+
ownerField,
|
|
8
|
+
PROJECT_FIELDS,
|
|
9
|
+
projectNumberField,
|
|
10
|
+
projectSummary,
|
|
11
|
+
resolveProject,
|
|
12
|
+
} from "./project-ref.ts";
|
|
13
|
+
import { at } from "./read.ts";
|
|
14
|
+
|
|
15
|
+
const update = async (
|
|
16
|
+
gh: GitHub,
|
|
17
|
+
owner: string,
|
|
18
|
+
number: number,
|
|
19
|
+
patch: Readonly<Record<string, string | boolean | undefined>>,
|
|
20
|
+
) => {
|
|
21
|
+
const { id } = await resolveProject(gh, owner, number);
|
|
22
|
+
const input = Object.fromEntries(
|
|
23
|
+
Object.entries(patch).filter(([, v]) => v !== undefined),
|
|
24
|
+
);
|
|
25
|
+
const result = await mutate(
|
|
26
|
+
gh,
|
|
27
|
+
"updateProjectV2",
|
|
28
|
+
{ projectId: id, ...input },
|
|
29
|
+
`projectV2 { ${PROJECT_FIELDS} }`,
|
|
30
|
+
);
|
|
31
|
+
return projectSummary(at(result, "projectV2"));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const undoField = (what: string) =>
|
|
35
|
+
s.optional(s.boolean({ description: `true to ${what} instead.` }));
|
|
36
|
+
|
|
37
|
+
export const projectStateOps = (gh: GitHub) => ({
|
|
38
|
+
edit: op({
|
|
39
|
+
description:
|
|
40
|
+
"Change a project's title, short description, readme or visibility. Replaces `gh project edit`.",
|
|
41
|
+
input: s.object({
|
|
42
|
+
owner: ownerField,
|
|
43
|
+
number: projectNumberField,
|
|
44
|
+
title: s.optional(s.string()),
|
|
45
|
+
description: s.optional(s.string()),
|
|
46
|
+
readme: s.optional(s.string()),
|
|
47
|
+
visibility: s.optional(s.enum(["PUBLIC", "PRIVATE"])),
|
|
48
|
+
}),
|
|
49
|
+
annotations: writes,
|
|
50
|
+
run: async ({ owner, number, title, description, readme, visibility }) => {
|
|
51
|
+
if (
|
|
52
|
+
[title, description, readme, visibility].every((v) => v === undefined)
|
|
53
|
+
)
|
|
54
|
+
throw new SurfaceError(
|
|
55
|
+
"usage",
|
|
56
|
+
"nothing to change",
|
|
57
|
+
"pass title, description, readme or visibility",
|
|
58
|
+
);
|
|
59
|
+
return update(gh, owner, number, {
|
|
60
|
+
title,
|
|
61
|
+
shortDescription: description,
|
|
62
|
+
readme,
|
|
63
|
+
public: visibility === undefined ? undefined : visibility === "PUBLIC",
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
close: op({
|
|
68
|
+
description:
|
|
69
|
+
"Close a project, or reopen it with `undo`. Replaces `gh project close [--undo]`.",
|
|
70
|
+
input: s.object({
|
|
71
|
+
owner: ownerField,
|
|
72
|
+
number: projectNumberField,
|
|
73
|
+
undo: undoField("reopen"),
|
|
74
|
+
}),
|
|
75
|
+
annotations: writes,
|
|
76
|
+
run: ({ owner, number, undo }) =>
|
|
77
|
+
update(gh, owner, number, { closed: undo !== true }),
|
|
78
|
+
}),
|
|
79
|
+
markTemplate: op({
|
|
80
|
+
description:
|
|
81
|
+
"Mark an organization project as a template, or unmark it with `undo`. Replaces `gh project mark-template [--undo]`.",
|
|
82
|
+
input: s.object({
|
|
83
|
+
owner: ownerField,
|
|
84
|
+
number: projectNumberField,
|
|
85
|
+
undo: undoField("unmark it"),
|
|
86
|
+
}),
|
|
87
|
+
annotations: writes,
|
|
88
|
+
run: async ({ owner, number, undo }) => {
|
|
89
|
+
const { id } = await resolveProject(gh, owner, number);
|
|
90
|
+
const result = await mutate(
|
|
91
|
+
gh,
|
|
92
|
+
undo === true ? "unmarkProjectV2AsTemplate" : "markProjectV2AsTemplate",
|
|
93
|
+
{ projectId: id },
|
|
94
|
+
`projectV2 { ${PROJECT_FIELDS} }`,
|
|
95
|
+
);
|
|
96
|
+
return projectSummary(at(result, "projectV2"));
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
});
|